DBMS_FORM
DBMS_FORM
([int $aId = 0], [boolean $debug = FALSE])
-
int
$aId: FRM_ID in the database if !0 the form is loaded from the database
-
boolean
$debug: since pk-05-01-12
adds a new field and get the class out of type
DBMS_FIELD
&addClassField
(
string $class,
string $key, [
array $dbDesc =
NULL], [
string $label =
""], [
string $tbl =
DBMS_NO_DBFIELD], [
boolean $debug =
FALSE])
-
string
$class: class name
-
string
$key: column name
-
array
$dbDesc: db field description array
-
string
$label
-
string
$tbl: table name
-
boolean
$debug
adds a new field and get the class out of type if the class could not derived from $GLOBALS['DBMS_FIELD_CLASSES'][$type] DBMS_FIELD is used
DBMS_FIELD
&addField
(
string $key, [
string $type =
"unknown"], [
array $dbDesc =
NULL], [
string $label =
""], [
string $tbl =
DBMS_NO_DBFIELD], [
boolean $debug =
FALSE])
-
string
$key: column name
-
string
$type: column db type
-
array
$dbDesc
-
string
$label
-
string
$tbl
-
boolean
$debug
adds afield object to the form
DBMS_FIELD;
&addFieldObj
(
DBMS_FIELD $field, [
boolean $keepTable =
TRUE], [
boolean $debug =
FALSE], [
boolean $keepSort =
FALSE])
-
DBMS_FIELD
$field
-
boolean
$keepTable
-
boolean
$debug
-
boolean
$keepSort
void
&addNoDbClassField
( $class, $key, [ $label = ""], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
-
$class
-
$key
-
$label
-
$tbl
-
$debug
void
&addNoDbField
( $key, [ $label = ""], [ $type = "unknown"], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
-
$key
-
$label
-
$type
-
$tbl
-
$debug
adds a field object to the form
&DBMS_FIELD
&addNoDBFieldObj
(
DBMS_FIELD $field, [
boolean $debug =
FALSE])
void
&addPKField
( $key, [ $label = ""], [ $type = "unknown"], [ $dbDesc = NULL], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
-
$key
-
$label
-
$type
-
$dbDesc
-
$tbl
-
$debug
adds a table to the form
boolean
addTable
(string $aTable, [boolean $isDefaultFrm = FALSE], [boolean $debug = FALSE])
-
string
$aTable: name of the tablename
-
boolean
$isDefaultFrm: the form is default for the table
-
boolean
$debug: since pk-05-02-22
creates an AJAX_FORM for the form
void
ajax_createObj
()
AJAX_FORM
&ajax_getObj
()
void
ajax_setObj
( &$aAjaxFrmObj, AJAX_FORM $aAjaxFrmObj)
-
AJAX_FORM
$aAjaxFrmObj
-
&$aAjaxFrmObj
checks if all required (NOT NULL FIELDS) are set
boolean
checkForNVL
(array $postArr, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$postArr: Array with values
-
string
$table: Name of the table if empty all tabels are checked
-
string
$arrName: Name of the global data array (${$arrName})
-
boolean
$debug: show debug information
removes the cache files of the form
void
clearCache
([boolean $clear_tblcache = FALSE])
unsets $this->errors
void
clearErrors
()
countListCols
returns the number of cols the list table has
int
countListCols
([array $links = NULL], [array $fields = NULL])
-
array
$links
-
array
$fields
creates a form
bool;
create
(string $aName, [string $tbls = ""], [boolean $asDefault = 0])
-
string
$aName: name of the form
-
string
$tbls: comma seperated list of tables used
-
boolean
$asDefault: it's the default form ($aName equal $tbls)
creates a db column out of a field
bool
createDBColumn
(string $fldName, [bool $debug = FALSE])
-
string
$fldName
-
bool
$debug
deletes field
void
deleteField
(boolean $field, [boolean $debug = FALSE])
-
boolean
$field
-
boolean
$debug
disables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used
void
disableField
(string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
-
string
$fldName
-
int
$mode
-
string
$tbl
-
boolean
$debug
disables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used
void
enableField
(string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
-
string
$fldName
-
int
$mode
-
string
$tbl
-
boolean
$debug
disables or enables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used
void
en_disAbleField
(boolean $enabled, string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
-
boolean
$enabled
-
string
$fldName
-
int
$mode
-
string
$tbl
-
boolean
$debug
checks if a field with $fldName exists for table $tbl (if not empty)
boolean
fieldExists
(string $fldName, [string $tbl = ""])
-
string
$fldName: name of the field
-
string
$tbl: name of the table (only checked if not empty)
generates frmFields out of a string generated with DBMS_FORM::db_setFieldLst
boolean
fieldLst_FromTxt
( $serTxt, [boolean $debug = FALSE], string $dbVal)
-
string
$dbVal
-
boolean
$debug
-
$serTxt
generates a string to store the fieldlist into a blob (text) field
string
fieldLst_ToTxt
([boolean $debug = FALSE])
transform a key to a dbusable column name (only letters, numbers and underscore)
string
generateDBKey
(string $key)
populates the join array $frmJoin
first find all primary keys if a primary key COLNAME occures more then 1 time an array with field names (TABLENAME.COLNAME) as value is added to $frmJoin[COLNAME]
void
generateJoin
([boolean $debug = FALSE])
-
boolean
$debug: show debug info
returns an array with all auto_inc fields
array
getAutoIncFields
([boolean $debug = FALSE])
returns the class file
string
getClassFile
([boolean $withoutOCSPPath = FALSE])
returns the csv header line (column names)
void
getCSVHeadLine
([array $row = NULL], [char $fldSep = ';'], [char $txtSep = '"'], [boolean $allFields = FALSE], [boolean $debug = FALSE])
-
array
$row
-
char
$fldSep: field seperator
-
char
$txtSep: string seperator
-
boolean
$allFields: check exportCSV is set in the field
-
boolean
$debug
returns a csv line
void
getCSVLine
(array $row, [char $fldSep = ';'], [char $txtSep = '"'], [boolean $allFields = FALSE], [boolean $debug = FALSE])
-
array
$row
-
char
$fldSep: field seperator
-
char
$txtSep: string seperator
-
boolean
$allFields: check exportCSV is set in the field
-
boolean
$debug
returns the db ojbect of the form and ensures the db object is connected
OCSP_DB
&getDBObj
([
boolean $debug =
FALSE])
returns an array representing the table row of the form object
array
getDBRow
([boolean $withoutNull = FALSE], [boolean $debug = FALSE], [int $srcVersion = 3])
-
boolean
$withoutNull
-
boolean
$debug
-
int
$srcVersion: (pk-05-07-14)
boolean
getDebugMode
([int $mode = 0])
returns an array with the field default values;
array
getDefaultValArr
([string $table = ""], [boolean $debug = FALSE])
-
string
$table: if not empty only fields of $table are returned
-
boolean
$debug
returns the error array
array
getErrorArr
()
returns the error in a string
string
getErrors
([string $sep = "\n"], [boolean $debug = FALSE], [boolean $withoutLabel = TRUE])
-
string
$sep
-
boolean
$debug
-
boolean
$withoutLabel
returns a pointer to a field object
DBMS_FIELD
&getField
(
string $name, [
string $table =
""], [
boolean $debug =
FALSE])
-
string
$name: (COLUMN) name of the field or the field key (table.name) where $table is empty
-
string
$table: table name the field belongs to if empty fields are checked for name fit
-
boolean
$debug: show debug info
returns an array of pointers to the form fields
array
getFieldArr
([boolean $sorted = TRUE])
-
boolean
$sorted: sorted array index is field order nr
void
getFieldDescArray
()
returns an array of fields (for compatibility with new version (OCSP_FORM)
array
getFields
([string $aTable = ''], [boolean $debug = FALSE])
-
string
$aTable: (empty to get all fields)
-
boolean
$debug
generates a sql from statement
string
getFromStmt
([boolean $debug = FALSE])
-
boolean
$debug: (since pk-06-07-31)
returns the html code for the form buttons row (colspan=2)
beside the method parameters the HTMLFORM object:
- HTMLFORM_URL_action
- HTMLFORM_URL_back
- HTMLFORM_URL_next
- HTMLFORM_URL_reload
- FRMADDBUTTONS html code to add in the button line
are used.
button images are derived from $this->HTMLFORM_button_src[] array
in read only mode if userCanEdit editbutton is added link is $this::FRMEDITURL or $this::HTMLFORM_URL_reload?FRMCMD=EDIT if userCanDelete delete button is added only if not emtpy $this::FRMDELETEURL
string
getHTMLFormButtons
([int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
int
$mode
-
string
$arrName
-
boolean
$debug
returns the html code for the complete form
object vars used you can set them to change layout or enlarge functionality
- FRMTAGADD (<form ..... FRMTAGADD>)
- FRMTBLTAG (<table .... FRMTBLTAG>)
- FRMTBLHEADERROW (1st row in the table example: <tr><td colspan="2">.....</td></tr>);
- FRMDELETEURL (<a href=\"$this->FRMDELETEURL\">...)
- FRMADDBUTTONS (html code to add in the button line)
- FRMNOBUTTONS do not add buttons in read only mode
string
getHTMLFormFromArray
(array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $frmAction = ""], [string $nextURI = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$DBVAL
-
int
$mode
-
string
$frmAction
-
string
$nextURI
-
string
$arrName
-
boolean
$debug
returns the html code for the hidden form fields
beside the method parameters the HTMLFORM object:
- HTMLFORM_mode
- HTMLFORM_URL_action
- HTMLFORM_URL_back
- HTMLFORM_URL_next
- HTMLFORM_URL_reload
are used.
string
getHTMLFormHiddenFields
([string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
string
$arrName
-
boolean
$debug
returns a html statement for no rights errors
string
getHTMLFormNoRights
([int $usrId = 0], [int $mode = FRM_READONLY], [array $dbVal = NULL], [string $txtInfo = ""], [boolean $debug = FALSE])
-
int
$usrId
-
int
$mode
-
array
$dbVal
-
string
$txtInfo
-
boolean
$debug
returns the html form statement
string
getHTMLFormStatement
()
returns the html code for list from a database cursor object
$cursor->fetchArrayFld() is called to get the row
NOTE: use getList_SQLFieldLst() in the select statement if you have a LEFT JOIN to get the right fields and values
layout class var used:
- FRMLST_TABLEADD (<table $this$this->FRMLST_TABLEADD>)
- FRMLST_TRADD (<tr $this->FRMLST_TRADD[($rowNr % 2)] >)
- FRMLST_TDADD (<td $this->FRMLST_TDADD >)
string
getHTMLLstFromCursor
(DBCURSOR $cursor, &$nofRows, [array $links = NULL], [string $sortLnk = NULL], [boolean $debug = FALSE], int $nofRows)
-
DBCURSOR
$cursor
-
int
$nofRows
-
array
$links
-
string
$sortLnk
-
boolean
$debug
-
&$nofRows
void
getHTMLLstFromQuery
( &$nofRows, [ $query = ""], [ $links = NULL], [ $sortLnk = NULL], [ $limit = 0], [ $offset = 0], [ $debug = FALSE])
-
&$nofRows
-
$query
-
$links
-
$sortLnk
-
$limit
-
$offset
-
$debug
returns the name of the form in the html form
<form name="....">
string
getHTMLName
()
returns the name of the form
int
getId
()
generates a string with the column names to use in an insert statement appends a comma seperated list to $cmd
boolean
getInsertCols
(array $postArr, string &$cmd, [string $table = ""], [boolean $debug = FALSE])
-
array
$postArr: array of fields posted by the form
-
string
&$cmd: the return string
-
string
$table: name of the table if set only oolumns of $table are added
-
boolean
$debug
generates a string with comma seperated slashed field values to use in an insert statement together with DMBS_FORM::getInsertCols()
example:
$errors=TRUE;
do {
$query="INSERT INTO T_CMS_MENU (";
$query.=") VALUES (";
$query.=")";
$errors=FALSE;
} while (FALSE);
boolean
getInsertValues
(array $postArr, string &$cmd, [string $table = ""], [ $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$postArr: array of fields posted by the form
-
string
&$cmd: the return string
-
string
$table: name of the table if set only oolumns of $table are added
-
boolean
$debug
-
$arrName
gets the html (javaScriptCode) for the formular start
string
getJavaCode
([int $mode = FRM_MODE_READONLY], [boolean $withJSInc = FALSE], [boolean $debug = FALSE], string $frmName)
-
string
$frmName
-
int
$mode
-
boolean
$withJSInc: @deprecated since pk-07-02-28 (allways check for includes)
-
boolean
$debug
returns the key array
array
getKeyArray
([boolean $nameToIndex = FALSE], [boolean $withoutTable = TRUE])
-
boolean
$nameToIndex: set the array index to the column name
-
boolean
$withoutTable: don't use table names in array index (see the TABLES field in value array)
returns an array with the key column names
array
getKeyColNames
()
returns an array with key=column name and value = label of the form
array
getListColLabelArr
([boolean $debug = FALSE])
echos the list header Row
class = "lstHeader" is added to <a> html tag $this->FRMLST_THADD is added to <th>
string
getListHeaderRow
( &$noCols, [array $links = NULL], [ $sortLnk = ""], [boolean $debug = FALSE], int $noCols, string $sortLink)
-
int
$noCols: number of columns
-
array
$links: Linkicons to count colspan of the last row
-
string
$sortLink: links the col title
-
boolean
$debug
-
&$noCols
-
$sortLnk
returns the htmlCode for a list row
layout class var used:
- FRMLST_TRADD (<tr $this->FRMLST_TRADD[($rowNr % 2)] >)
- FRMLST_TDADD (<td $this->FRMLST_TDADD >)
- FRMLST_TDFLDADD (<td $this->FRMLST_TDADD $this->FRMLST_TDFLDADD[FLDNAME] >)
links array creates links at the end of the row $links[colname|linkname] -[A] => link templdate parsed with $row -[TEXT] => the html code for the link button -[SHOWQUERY] => if str_replace(";","%","SELECT ".pcf_tmpl_parse($lArr['SHOWQUERY'],$row)) is TRUE the link is show otherwise not -[GROUPID] => overrules [SHOWQUERY]
if $links['EDIT'] isset each data colum is link to the url if the link key == fldname the link is added to the field
string
getListRow
(array $row, &$rowNr, [array $links = NULL], [boolean $debug = FALSE], int $rowNr)
-
array
$row
-
int
$rowNr
-
array
$links
-
boolean
$debug
-
&$rowNr
Redefined in descendants as:
returns the SQL-Fieldlist for Lists
string
getList_SQLFieldLst
([boolean $debug = FALSE])
returns the name of the form
string
getName
()
returns the number of fields
int
getNofFields
()
returns the value of an object variable
mixed
getObjectVar
(string $varName)
returns the relaod url
string
getReloadUri
([boolean $debug = FALSE])
returns an object value for a row
mixed
getRowObjValue
(
&$fldObj,
array $row, [
boolean $debug =
FALSE],
DBMS_FIELD $fldObj)
-
DBMS_FIELD
$fldObj
-
array
$row
-
boolean
$debug
-
&$fldObj
returns a query string for the row in $rowArr
string
getRowQueryString
(array $dataArr, [string $table = ""], [boolean $debug = FALSE])
-
array
$dataArr
-
string
$table
-
boolean
$debug
generates a where statement for search
string
getSearchWhere
(array $postArr, [boolean $debug = FALSE], [boolean $alwaysRetWhere = TRUE])
-
array
$postArr
-
boolean
$debug
-
boolean
$alwaysRetWhere: if true return WHERE 1=1 if no values found
returns the form table rows
string
getTableFromArray
(array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$DBVAL
-
int
$mode
-
string
$arrName
-
boolean
$debug
returns the table list
array
getTableList
()
returns an 2 dimensional array of all form data [table][col]
array
getTableValueArrays
(array $postArr, [boolean $debug = FALSE])
-
array
$postArr: array with key=>value
-
boolean
$debug: show debug option
returns an array with links to use in a tab NOTE templates are not parsed
array
getTabLinkArray
(int $mode, [boolean $debug = FALSE])
generates a sql update statement key = value pares NOTE $cmd call by reference!!
as this only APPENDS key=value pares to seperated with a "," to the command you have to take care for a valid sql statement
ATTANTION: the , is only set between key=value
example:
$DBVAL=$_POST;
$cmd="UPDATE mytable SET myNotPostedField=1,";
// append http posted fields
// show error message
} else {
$cmd .= " WHERE myKey=1";
$DBOBJ->executeCmd($cmd)
}
boolean
getUpdateValues
(array $postArr, string &$cmd, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$postArr: array with key=>value
-
string
&$cmd: IN-OUT first part of the sql statement includeing key word SET
-
string
$table: use only this table if set
-
string
$arrName: name of the global key=>value (${$arrName})
-
boolean
$debug: show debug option
returns an array with values checked against the form sets the form errors in case of array but always returns the array check the form for errors with this::hasErrors() before proceeding
array
getValueArray
(array $postArr, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$postArr: array with key=>value
-
string
$table: use only this table if set
-
string
$arrName: name of the global key=>value (${$arrName})
-
boolean
$debug: show debug option
appends the values set in postArr to $cmd to use in SQL Where
$cmd .= [AND] DBMS_FIELD::getAssignment()
bool
getWhereValues
(array $postArr, &$cmd, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE], string $cmd)
-
array
$postArr
-
string
$cmd
-
string
$table
-
string
$arrName
-
boolean
$debug
-
&$cmd
returns the form field array
array
get_frmFields
([boolean $withoutTable = FALSE])
-
boolean
$withoutTable: include table name in the key
gets gDBIDX
string
get_gDBIDX
()
checks $this->errors
bool
hasErrors
()
returns if the form has a sortcolumn (DBMS_FIELD_ORDERNR)
boolean
hasSortFld
([boolean $withArrowOnly = FALSE], [boolean $debug = FALSE])
-
boolean
$withArrowOnly
-
boolean
$debug
hides all fields of a table
void
hideAllTblFields
(string $tbl, [boolean $debug = FALSE])
-
string
$tbl
-
boolean
$debug
set a field hidden
void
hideField
(string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
-
string
$fldName
-
string
$tbl
-
boolean
$debug
returns if the form is reloaded
boolean
isReloaded
(string $postArrName, [boolean $debug = FALSE])
-
string
$postArrName
-
boolean
$debug
loads the form form the database
returns true if a row with $this->id is fetched from the db NOTE: table columns are hard coded changes to the database table can create errors
boolean
loadFromDb
([ $debug = FALSE])
sets lstShowRowNr
void
lstShowRowNrOnOff
([boolean $on = TRUE])
merges the fields of an other form to $this if ($prepend) is true the fields will be prepended else appended to the fieldlist
boolean
mergeFormFields
(
&$frmMerge, [
boolean $prepend =
FALSE], [
boolean $debug =
FALSE],
DBMS_FORM $frmMerge)
-
DBMS_FORM
$frmMerge
-
boolean
$prepend
-
boolean
$debug
-
&$frmMerge
creates a new field
DBMS_FIELD
&newField
(
string $class,
string $key, [
string $tbl =
DBMS_NO_DBFIELD], [
int $orderNr =
0], [
string $label =
""], [
array $dbDesc =
NULL], [
boolean $debug =
FALSE])
-
string
$class: class name
-
string
$key: column name
-
string
$tbl: table name
-
int
$orderNr
-
string
$label
-
array
$dbDesc
-
boolean
$debug
returns the link url for a row
$link is array with keys:
- URL template of the url
- CHECKFLDS array of rows => values which have to fit to link
string
p_getListRowLink
(array $link, array $row, int $rowNr, [boolean $debug = FALSE])
-
array
$link
-
array
$row
-
int
$rowNr
-
boolean
$debug
private method checks right from table T_DBMS_FORMRIGHTS
boolean
p_userCan
(string $col, [int $usrId = NULL], [boolean $debug = FALSE])
-
string
$col: right column name
-
int
$usrId: user id (if !intval($GLBOALS['USER'] is used)
-
boolean
$debug
check if the form is relaoded and we have to use the posted values instead of $aktRow if $aktRow is not an array the form default values are used
array
reloadCheck
([array $aktRow = NULL], [boolean $debug = FALSE], [boolean $pArrName = ""])
-
array
$aktRow
-
boolean
$debug
-
boolean
$pArrName
removes a table from the form
boolean
removeTable
(string $aTable, [boolean $debug = FALSE])
-
string
$aTable: name of the tablename
-
boolean
$debug
removes all fields of a Table
void
removeTableFields
(string $aTable, [boolean $debug = FALSE])
-
string
$aTable
-
boolean
$debug
marks the form as new it will be inserted on $this::storeToDb
void
setAsNew
([string $frmName = NULL], [ $frmDesc = ""], [ $debug = "0"])
-
string
$frmName
-
$frmDesc
-
$debug
sets the object values from a data array
void
setDBRow
(array $dbVal, [boolean $asPopulated = TRUE], [boolean $debug = FALSE])
-
array
$dbVal
-
boolean
$asPopulated: not used
-
boolean
$debug
adds an error to this::errors
void
setError
(array $aError, [string $fld = ""])
-
array
$aError: with LABEL und MSG values
-
string
$fld
sets the error array
void
setErrorArr
(array $errArr, [boolean $merge = TRUE])
-
array
$errArr
-
boolean
$merge
sets a field object
void
setFieldObj
(
$sTbl,
DBMS_FIELD $fld, [
boolean $debug =
FALSE],
string $tbl)
sets myForm in each field
void
setFldFrmObj
([boolean $debug = FALSE])
void
setFrmMode
(int $mode)
sets the button array
void
setHTMLFORM_BtnSource
([ $debug = FALSE])
sets object HTMLFORM variables:
- HTMLFORM_mode
- HTMLFORM_URL_action
- HTMLFORM_URL_back
- HTMLFORM_URL_next
- HTMLFORM_URL_reload
void
setHTMLFORM_objectVar
(array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $frmAction = ""], [string $nextURI = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
array
$DBVAL
-
int
$mode
-
string
$frmAction
-
string
$nextURI
-
string
$arrName
-
boolean
$debug
sets the name of the form in the html form
<form name="....">
void
setHTMLName
(string $aName)
void
setName
(string $aName)
sets the value of an object variable
void
setObjectVar
(string $varName, mixed $value)
-
string
$varName
-
mixed
$value
void
set_gDBIDX
(string $idx)
set a field not hidden
void
showField
(string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
-
string
$fldName
-
string
$tbl
-
boolean
$debug
enable field in list
void
showFieldInList
(string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
-
string
$fldName
-
string
$tbl
-
boolean
$debug
stores a form object to database table T_DBMS_FORM
uses $GLOBALS['USRDB'] as database object calls
return $GLOBALS['USRDB']->replace("T_DBMS_FORM",$dbValues,$debug);
} else {
INSERT FORM -> update fields -> UPDATE FROM
}
bool
storeToDb
([boolean $debug = FALSE])
unserializes a fieldRow (array element)
void
unserFldRow
(string $key, array $fldDesc, [boolean $debug = FALSE], [array $fldRow = NULL])
-
string
$key
-
array
$fldDesc
-
boolean
$debug
-
array
$fldRow: the database row since pk-06-07-28
checks if the table has changed
void
updateFields
([boolean $debug = FALSE])
checks if a user is allowed to delete the data
boolean
userCanDelete
([int $usrId = 0], [boolean $debug = FALSE])
-
int
$usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
-
boolean
$debug
checks if a user is allowed to edit (update) the data
boolean
userCanEdit
([int $usrId = 0], [boolean $debug = FALSE])
-
int
$usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
-
boolean
$debug
checks if a user is allowed to export the data
boolean
userCanExport
([int $usrId = 0], [boolean $debug = FALSE])
-
int
$usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
-
boolean
$debug
checks if a user is allowed to add (insert) new data
boolean
userCanInsert
([int $usrId = 0], [boolean $debug = FALSE])
-
int
$usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
-
boolean
$debug
returns if the user is allowed in mode
boolean
userCanMode
(int $usrId, int $mode, [boolean $debug = FALSE])
-
int
$usrId
-
int
$mode
-
boolean
$debug
checks if a user is allowed to show the data
boolean
userCanShow
([int $usrId = 0], [boolean $debug = FALSE])
-
int
$usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
-
boolean
$debug
check if the form uses $aTable
boolean
usesTable
(string $aTable)
echos the form errors
void
writeErros
([boolean $withLabel = TRUE])
writes a field and sets the fields form Id
void
writeField
(string $name, int $mode, any $val, [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
string
$name: index in $this->frmFields
-
int
$mode
-
any
$val
-
string
$arrName
-
boolean
$debug
echos a html table row <tr> ... </tr> for a row
NOTE: sets the global $FORMS_LISTROW only use this global var in function called within this function it is used in field objects to access values of other fields with global ${$arrName}
link array creates a <a ></a> HTML code with the folowing attributes (if array links[attrib] ! empty)
- TARGET target=".."
- ACLASS class=".."
- ASTYLE style=".."
- ATAGADD additional tags added as is
- URL used in p_getListRowLink DBMS_FORM::p_getListRowLink
- CHECKFLDS used in p_getListRowLink DBMS_FORM::p_getListRowLink
- IMG a button img (tag or only source) both are handeled
echo "<img ".$val['IMG'].">"; // new style by gaisi
} else {
echo "<img src=\"".$val['IMG']."\" alt=\"".$val['TEXT']."\" border=\"0\">";
}
- TEXT text to show if no IMG or alt of the image
if $links['EDIT'] isset each data colum is link to the url
void
writeListRow
(array $row, int $rowNr, array $links, [array $fields = NULL], [string $trTag = ""], [array $tdDesc = ""], [boolean $debug = FALSE])
-
array
$row: array of row falues wiht col names as index
-
int
$rowNr: Counter for the row (added to links)
-
array
$links: array of link arrays to add in the button
-
array
$fields: $this->getFieldArr(TRUE) to not call the function for every row
-
string
$trTag: HTML-Code to append in <tr ...> tag
-
array
$tdDesc: array with tag options in <td ...> tag
-
boolean
$debug: show debug info
echos a searchForm
void
writeSearchForm
([string $arrName = "DBSEARCH"], [string $trTag = ""], [boolean $debug = FALSE])
-
string
$arrName
-
string
$trTag
-
boolean
$debug
writes a form table from a query
string
writeTableFromArray
( $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE], DB_xxx $DBOBJ, string $query)
-
DB_xxx
$DBOBJ
-
string
$query
-
int
$mode
-
string
$arrName
-
boolean
$debug
-
$DBVAL
writes a form table from a query
string
writeTableFromQuery
(DB_xxx $DBOBJ, string $query, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
-
DB_xxx
$DBOBJ
-
string
$query
-
int
$mode
-
string
$arrName
-
boolean
$debug
void
writeTableList
([ $aSelectName = ""], [ $sep = "\n"])
exports the form to an xml file
bool;
xmlDomNodeImport
(DomElement $frmNode, [ $debug = FALSE])
-
DomElement
$frmNode
-
$debug
exports the form to an xml file
bool;
xmlExport
([string $xmlfile = ""], [boolean $base64 = TRUE], [boolean $debug = FALSE], [boolean $echoXML = TRUE])
-
string
$xmlfile
-
boolean
$base64
-
boolean
$debug
-
boolean
$echoXML