Class DBMS_FORM

Description

Databese Formulars / Lists

this class can be used to handel all kind of forms needed it is administrated through the admin link: /admin/dbms

SRCVERSION 2

  • the fields are no longer stored just by serialize DBMS_FORM::fieldLst instead a seralized are is stored therefore the classes need not to be preloaded
    -- $fldData['OBJDESC'] -> discription of the object -- $fldData['OBJVAL'] -> get_object_vars($this)

    • author: Peter Krebs (pk) <pitlinz@users.sourceforge.net>
    • version: pk-04-10-05
    • version: pk-05-11-04
    • version: pk-07-02-27 ajax
    • see: DBMS_FORM::fieldLst_ToTxt() - before the fieldObject is created by evaluating <code>eval("\$fld=new ".$fldData['OBJDESC']['SRCFILE']."()");</code> the object class source is included with <code>require_once $GLOBALS['PROJECT']['PATH'].$fldData['OBJDESC']['SRCFILE']; </code>
    • see: DBMS_FORM::fieldLst_FromTxt()
    • project: Open CSP-Management
    • license: GNU Public License

    Located in /db/forms/DBMS_FORM.phpclass (line 68)

    
    	
    			
    Direct descendents
    Class Description
     class DBMS_FORMAJAX Class DBMS_FORMAJAX
    Variable Summary
    Method Summary
     DBMS_FORM DBMS_FORM ([int $aId = 0], [boolean $debug = FALSE])
     DBMS_FIELD &addClassField (string $class, string $key, [array $dbDesc = NULL], [string $label = ""], [string $tbl = DBMS_NO_DBFIELD], [boolean $debug = FALSE])
     DBMS_FIELD &addField (string $key, [string $type = "unknown"], [array $dbDesc = NULL], [string $label = ""], [string $tbl = DBMS_NO_DBFIELD], [boolean $debug = FALSE])
     DBMS_FIELD; &addFieldObj (DBMS_FIELD $field, [boolean $keepTable = TRUE], [boolean $debug = FALSE], [boolean $keepSort = FALSE])
     void &addNoDbClassField ( $class,  $key, [ $label = ""], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
     void &addNoDbField ( $key, [ $label = ""], [ $type = "unknown"], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
     &DBMS_FIELD &addNoDBFieldObj (DBMS_FIELD $field, [boolean $debug = FALSE])
     void &addPKField ( $key, [ $label = ""], [ $type = "unknown"], [ $dbDesc = NULL], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
     boolean addTable (string $aTable, [boolean $isDefaultFrm = FALSE], [boolean $debug = FALSE])
     void ajax_createObj ()
     AJAX_FORM &ajax_getObj ()
     void ajax_setObj ( &$aAjaxFrmObj, AJAX_FORM $aAjaxFrmObj)
     boolean checkForNVL (array $postArr, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     void cleanupFieldArr ()
     void clearCache ([boolean $clear_tblcache = FALSE])
     void clearErrors ()
     int countListCols ([array $links = NULL], [array $fields = NULL])
     bool; create (string $aName, [string $tbls = ""], [boolean $asDefault = 0])
     bool createDBColumn (string $fldName, [bool $debug = FALSE])
     void deleteField (boolean $field, [boolean $debug = FALSE])
     void disableField (string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
     void enableField (string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
     void en_disAbleField (boolean $enabled, string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
     boolean fieldExists (string $fldName, [string $tbl = ""])
     boolean fieldLst_FromTxt ( $serTxt, [boolean $debug = FALSE], string $dbVal)
     string fieldLst_ToTxt ([boolean $debug = FALSE])
     string generateDBKey (string $key)
     void generateJoin ([boolean $debug = FALSE])
     array getAutoIncFields ([boolean $debug = FALSE])
     string getClassFile ([boolean $withoutOCSPPath = FALSE])
     void getCSVHeadLine ([array $row = NULL], [char $fldSep = ';'], [char $txtSep = '"'], [boolean $allFields = FALSE], [boolean $debug = FALSE])
     void getCSVLine (array $row, [char $fldSep = ';'], [char $txtSep = '"'], [boolean $allFields = FALSE], [boolean $debug = FALSE])
     OCSP_DB &getDBObj ([boolean $debug = FALSE])
     array getDBRow ([boolean $withoutNull = FALSE], [boolean $debug = FALSE], [int $srcVersion = 3])
     boolean getDebugMode ([int $mode = 0])
     array getDefaultValArr ([string $table = ""], [boolean $debug = FALSE])
     array getErrorArr ()
     string getErrors ([string $sep = "\n"], [boolean $debug = FALSE], [boolean $withoutLabel = TRUE])
     DBMS_FIELD &getField (string $name, [string $table = ""], [boolean $debug = FALSE])
     array getFieldArr ([boolean $sorted = TRUE])
     array getFields ([string $aTable = ''], [boolean $debug = FALSE])
     int getFrmMode ()
     string getFromStmt ([boolean $debug = FALSE])
     string getHTMLFormButtons ([int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     string getHTMLFormFromArray (array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $frmAction = ""], [string $nextURI = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     string getHTMLFormHiddenFields ([string $arrName = "DBVAL"], [boolean $debug = FALSE])
     string getHTMLFormNoRights ([int $usrId = 0], [int $mode = FRM_READONLY], [array $dbVal = NULL], [string $txtInfo = ""], [boolean $debug = FALSE])
     string getHTMLLstFromCursor (DBCURSOR $cursor,  &$nofRows, [array $links = NULL], [string $sortLnk = NULL], [boolean $debug = FALSE], int $nofRows)
     void getHTMLLstFromQuery ( &$nofRows, [ $query = ""], [ $links = NULL], [ $sortLnk = NULL], [ $limit = 0], [ $offset = 0], [ $debug = FALSE])
     string getHTMLName ()
     int getId ()
     boolean getInsertCols (array $postArr, string &$cmd, [string $table = ""], [boolean $debug = FALSE])
     boolean getInsertValues (array $postArr, string &$cmd, [string $table = ""], [ $arrName = "DBVAL"], [boolean $debug = FALSE])
     string getJavaCode ([int $mode = FRM_MODE_READONLY], [boolean $withJSInc = FALSE], [boolean $debug = FALSE], string $frmName)
     array getKeyArray ([boolean $nameToIndex = FALSE], [boolean $withoutTable = TRUE])
     array getKeyColNames ()
     array getListColLabelArr ([boolean $debug = FALSE])
     string getListHeaderRow ( &$noCols, [array $links = NULL], [ $sortLnk = ""], [boolean $debug = FALSE], int $noCols, string $sortLink)
     string getListRow (array $row,  &$rowNr, [array $links = NULL], [boolean $debug = FALSE], int $rowNr)
     string getList_SQLFieldLst ([boolean $debug = FALSE])
     string getName ()
     int getNofFields ()
     mixed getObjectVar (string $varName)
     string getReloadUri ([boolean $debug = FALSE])
     mixed getRowObjValue ( &$fldObj, array $row, [boolean $debug = FALSE], DBMS_FIELD $fldObj)
     string getRowQueryString (array $dataArr, [string $table = ""], [boolean $debug = FALSE])
     string getSearchWhere (array $postArr, [boolean $debug = FALSE], [boolean $alwaysRetWhere = TRUE])
     string getTableFromArray (array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     array getTableList ()
     array getTableValueArrays (array $postArr, [boolean $debug = FALSE])
     array getTabLinkArray (int $mode, [boolean $debug = FALSE])
     string getTitle ()
     boolean getUpdateValues (array $postArr, string &$cmd, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     array getValueArray (array $postArr, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     bool getWhereValues (array $postArr,  &$cmd, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE], string $cmd)
     array get_frmFields ([boolean $withoutTable = FALSE])
     string get_gDBIDX ()
     bool hasErrors ()
     boolean hasSortFld ([boolean $withArrowOnly = FALSE], [boolean $debug = FALSE])
     void hideAllTblFields (string $tbl, [boolean $debug = FALSE])
     void hideField (string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
     boolean isReloaded (string $postArrName, [boolean $debug = FALSE])
     boolean loadFromDb ([ $debug = FALSE])
     void lstShowRowNrOnOff ([boolean $on = TRUE])
     boolean mergeFormFields ( &$frmMerge, [boolean $prepend = FALSE], [boolean $debug = FALSE], DBMS_FORM $frmMerge)
     DBMS_FIELD &newField (string $class, string $key, [string $tbl = DBMS_NO_DBFIELD], [int $orderNr = 0], [string $label = ""], [array $dbDesc = NULL], [boolean $debug = FALSE])
     string p_getListRowLink (array $link, array $row, int $rowNr, [boolean $debug = FALSE])
     boolean p_userCan (string $col, [int $usrId = NULL], [boolean $debug = FALSE])
     array reloadCheck ([array $aktRow = NULL], [boolean $debug = FALSE], [boolean $pArrName = ""])
     boolean removeTable (string $aTable, [boolean $debug = FALSE])
     void removeTableFields (string $aTable, [boolean $debug = FALSE])
     void setAsNew ([string $frmName = NULL], [ $frmDesc = ""], [ $debug = "0"])
     void setDBRow (array $dbVal, [boolean $asPopulated = TRUE], [boolean $debug = FALSE])
     void setError (array $aError, [string $fld = ""])
     void setErrorArr (array $errArr, [boolean $merge = TRUE])
     void setFieldObj ( $sTbl, DBMS_FIELD $fld, [boolean $debug = FALSE], string $tbl)
     void setFldFrmObj ([boolean $debug = FALSE])
     void setFrmMode (int $mode)
     void setHTMLFORM_BtnSource ([ $debug = FALSE])
     void setHTMLFORM_objectVar (array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $frmAction = ""], [string $nextURI = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     void setHTMLName (string $aName)
     void setName (string $aName)
     void setObjectVar (string $varName, mixed $value)
     void set_gDBIDX (string $idx)
     void showField (string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
     void showFieldInList (string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
     bool storeToDb ([boolean $debug = FALSE])
     void unserFldRow (string $key, array $fldDesc, [boolean $debug = FALSE], [array $fldRow = NULL])
     void updateFields ([boolean $debug = FALSE])
     boolean userCanDelete ([int $usrId = 0], [boolean $debug = FALSE])
     boolean userCanEdit ([int $usrId = 0], [boolean $debug = FALSE])
     boolean userCanExport ([int $usrId = 0], [boolean $debug = FALSE])
     boolean userCanInsert ([int $usrId = 0], [boolean $debug = FALSE])
     boolean userCanMode (int $usrId, int $mode, [boolean $debug = FALSE])
     boolean userCanShow ([int $usrId = 0], [boolean $debug = FALSE])
     boolean usesTable (string $aTable)
     void writeErros ([boolean $withLabel = TRUE])
     void writeField (string $name, int $mode, any $val, [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     void writeListRow (array $row, int $rowNr, array $links, [array $fields = NULL], [string $trTag = ""], [array $tdDesc = ""], [boolean $debug = FALSE])
     void writeSearchForm ([string $arrName = "DBSEARCH"], [string $trTag = ""], [boolean $debug = FALSE])
     string writeTableFromArray ( $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE], DB_xxx $DBOBJ, string $query)
     string writeTableFromQuery (DB_xxx $DBOBJ, string $query, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
     void writeTableList ([ $aSelectName = ""], [ $sep = "\n"])
     bool; xmlDomNodeImport (DomElement $frmNode, [ $debug = FALSE])
     bool; xmlExport ([string $xmlfile = ""], [boolean $base64 = TRUE], [boolean $debug = FALSE], [boolean $echoXML = TRUE])
    Variables
    boolean $debugDelete = FALSE (line 193)
    • since: pk-05-03-23
    boolean $debugInsert = FALSE (line 183)
    • since: pk-05-03-23
    boolean $debugMode = FALSE (line 128)
    • since: pk-04-07-23
    boolean $debugUpdate = FALSE (line 188)
    • since: pk-05-03-23
    array $errors = array() (line 137)
    • var: array ( [ERRORS] boolean [FLD] array [LABEL],[MSG]
    mixed $FRMADDBUTTONS = "" (line 260)
    string $FRMDELETEURL = NULL (line 229)
    longstring $frmDesc = NULL (line 84)
    • var: Beschreibungstext
    string $FRMEDITURL = NULL (line 225)
    • since: pk-05-01-09
    array $frmFields = array() (line 100)
    • var: array of field objects DBMS_FIELD or child classes
    int $frmId (line 72)
    array $frmJoin = array() (line 110)
    • var: array of identifing foreign key COLUMNS key is the DB column name value is an array of DB columns (TABLENAME.COLNAME)
    array $frmKeys = array() (line 96)
    • var: array of the db key colum names
    mixed $FRMLST_ADDBEFORELINKS = "" (line 257)
    int $FRMLST_LIMIT (line 246)
    • var: FRMLST_LIMIT number of lines per list (0=no limit)
    • since: pk-06-05-08
    mixed $FRMLST_ROWADD = "" (line 253)
    mixed $FRMLST_TABLEADD = "" (line 252)

    some layout vars

    mixed $FRMLST_TDADD = "" (line 255)
    mixed $FRMLST_TDFLDADD = "" (line 256)
    string $FRMLST_THADD = "class=\"lstHeader\"" (line 177)
    • var: list header th add tag
    • since: pk-05-03-16
    mixed $FRMLST_TRADD = "" (line 254)
    int $frmMode (line 219)

    show mode of the form

    • since: pk-05-11-04
    string $frmName = NULL (line 76)
    • var: unique name of the form
    mixed $FRMNOBUTTONS = FALSE (line 261)
    string $frmQuery = "" (line 104)
    string $frmRevision = 1 (line 80)
    • var: fore future use
    array $frmRights = array() (line 116)
    • var: array of groups and access rights
    • todo: form rights are not implemented jet
    array $frmTables = array() (line 88)
    • var: array with db tablenames used in the form
    mixed $FRMTAGADD = "" (line 259)
    string $gDBIDX = "USRDB" (line 163)
    • var: $GLOBALS[] index of db object
    • deprecated: since pk-07-06-28
    • since: pk-05-02-17
    string $HTMLFORM_arrayName = "DBVAL" (line 235)
    • var: HTMLFORM_arrayName
    • since: pk-06-03-07
    array $HTMLFORM_button_src = array() (line 156)
    • var: definition
    • todo: add to dbms admin to customize buttons per form
    • since: pk-05-02-16
    string $HTMLFORM_URL_back = "" (line 240)
    • var: HTMLFORM_URL_back if empty history.back()
    boolean $isTblDefault = FALSE (line 92)
    • var: the form is the default form for the one and only table it uses
    linuxTimestamp $lastDBCheck (line 122)
    • var: timestamp when db-columns/fields has been checked with the database tables
    array $layoutFields = array() (line 199)
    • since: pk-05-04-18
    boolean $lstShowRowNr = FALSE (line 205)
    • since: pk-05-07-05
    AJAX_FORM $myAjaxObj = NULL (line 277)

    the ajax object for the form NOTE: the class source is not automaticaly implemented

    • since: pk-07-02-27
    • access: protected
    string $myClassSrcFile = __FILE__ (line 267)
    • var: sourcefile of the class
    • since: pk-06-12-17
    string $myDBMS_TABLEOBJ_class = "" (line 149)
    • var: table object class
    • since: pk-05-01-11
    string $myDBMS_TABLEOBJ_include = "" (line 143)
    • var: table object class include
    • since: pk-05-01-11
    OCSP_DB $myDBObj = NULL (line 170)
    • since: pk-07-06-28
    • access: protected
    string $myHTMLName = "" (line 212)

    name of the html forms

    • since: pk-05-09-16
    Methods
    Constructor DBMS_FORM (line 286)
    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
    addClassField (line 1534)

    adds a new field and get the class out of type

    • version: pk-06-02-01
    • since: pk-04-01-11
    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
    addField (line 1560)

    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

    • version: pk-05-07-14
    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
    addFieldObj (line 1617)

    adds afield object to the form

    • version: pk-06-01-11
    • version: pk-06-07-14
    • since: pk-05-02-17
    DBMS_FIELD; &addFieldObj (DBMS_FIELD $field, [boolean $keepTable = TRUE], [boolean $debug = FALSE], [boolean $keepSort = FALSE])
    • DBMS_FIELD $field
    • boolean $keepTable
    • boolean $debug
    • boolean $keepSort
    addNoDbClassField (line 1597)
    void &addNoDbClassField ( $class,  $key, [ $label = ""], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
    • $class
    • $key
    • $label
    • $tbl
    • $debug
    addNoDbField (line 1592)
    void &addNoDbField ( $key, [ $label = ""], [ $type = "unknown"], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
    • $key
    • $label
    • $type
    • $tbl
    • $debug
    addNoDBFieldObj (line 1647)

    adds a field object to the form

    • return: pointer to the copy of the field inserted to the form
    • version: pk-05-02-17
    &DBMS_FIELD &addNoDBFieldObj (DBMS_FIELD $field, [boolean $debug = FALSE])
    addPKField (line 1578)
    void &addPKField ( $key, [ $label = ""], [ $type = "unknown"], [ $dbDesc = NULL], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
    • $key
    • $label
    • $type
    • $dbDesc
    • $tbl
    • $debug
    addTable (line 1870)

    adds a table to the form

    • version: pk-05-02-22
    • version: pk-06-01-11
    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
    ajax_createObj (line 5133)

    creates an AJAX_FORM for the form

    • since: pk-07-02-27
    • access: protected
    void ajax_createObj ()
    ajax_getObj (line 5144)
    • since: pk-07-02-27
    • access: public
    AJAX_FORM &ajax_getObj ()
    ajax_setObj (line 5156)
    • since: pk-07-02-27
    • access: public
    void ajax_setObj ( &$aAjaxFrmObj, AJAX_FORM $aAjaxFrmObj)
    • AJAX_FORM $aAjaxFrmObj
    • &$aAjaxFrmObj
    checkForNVL (line 3432)

    checks if all required (NOT NULL FIELDS) are set

    • return: TRUE if all fields are set else FALSE
    • version: pk-03-12-13 getValue instead of slashedValue
    • version: pk-04-08-03 use $obj->allow NULL
    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
    cleanupFieldArr (line 2282)
    void cleanupFieldArr ()
    clearCache (line 1038)

    removes the cache files of the form

    • version: pk-06-04-23
    void clearCache ([boolean $clear_tblcache = FALSE])
    • boolean $clear_tblcache
    clearErrors (line 3965)

    unsets $this->errors

    void clearErrors ()
    countListCols (line 4075)

    countListCols

    returns the number of cols the list table has

    • version: pk-05-03-17
    • version: pk-05-07-05
    int countListCols ([array $links = NULL], [array $fields = NULL])
    • array $links
    • array $fields
    create (line 519)

    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)
    createDBColumn (line 1667)

    creates a db column out of a field

    • version: pk-06-04-23 clearCache added
    • since: pk-06-01-11
    bool createDBColumn (string $fldName, [bool $debug = FALSE])
    • string $fldName
    • bool $debug
    deleteField (line 1712)

    deletes field

    • access: public
    void deleteField (boolean $field, [boolean $debug = FALSE])
    • boolean $field
    • boolean $debug
    disableField (line 2371)

    disables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used

    • version: pk-05-07-21
    • since: pk-05-07-19
    void disableField (string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
    • string $fldName
    • int $mode
    • string $tbl
    • boolean $debug
    enableField (line 2353)

    disables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used

    • since: pk-05-07-21
    void enableField (string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
    • string $fldName
    • int $mode
    • string $tbl
    • boolean $debug
    en_disAbleField (line 2308)

    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

    • since: pk-05-07-21
    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
    fieldExists (line 1398)

    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)
    fieldLst_FromTxt (line 634)

    generates frmFields out of a string generated with DBMS_FORM::db_setFieldLst

    • return: TRUE if succeed
    • version: pk-05-07-14
    • since: pk-04-10-05
    boolean fieldLst_FromTxt ( $serTxt, [boolean $debug = FALSE], string $dbVal)
    • string $dbVal
    • boolean $debug
    • $serTxt
    fieldLst_ToTxt (line 672)

    generates a string to store the fieldlist into a blob (text) field

    • version: pk-05-01-13
    string fieldLst_ToTxt ([boolean $debug = FALSE])
    • boolean $debug
    generateDBKey (line 1418)

    transform a key to a dbusable column name (only letters, numbers and underscore)

    • return: since pk-04-01-11
    string generateDBKey (string $key)
    • string $key
    generateJoin (line 1817)

    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]

    • version: pk-06-01-25
    void generateJoin ([boolean $debug = FALSE])
    • boolean $debug: show debug info
    getAutoIncFields (line 2269)

    returns an array with all auto_inc fields

    • since: pk-06-01-24
    array getAutoIncFields ([boolean $debug = FALSE])
    • boolean $debug
    getClassFile (line 375)

    returns the class file

    • version: pk-06-12-17 // use of $this->myClassSrcFile instead of __FILE__
    string getClassFile ([boolean $withoutOCSPPath = FALSE])
    • boolean $withoutOCSPPath
    getCSVHeadLine (line 4815)

    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
    getCSVLine (line 4843)

    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
    getDBObj (line 357)

    returns the db ojbect of the form and ensures the db object is connected

    • since: pk-07-06-28
    • requires: __OCSP_PHPINCPATH__."db/OCSP_DB.phpclass"
    • access: public
    OCSP_DB &getDBObj ([boolean $debug = FALSE])
    • boolean $debug
    getDBRow (line 700)

    returns an array representing the table row of the form object

    • version: pk-05-03-23 debugMode changed
    • version: pk-05-07-14
    • version: pk-05-08-25
    • since: pk-04-10-07
    array getDBRow ([boolean $withoutNull = FALSE], [boolean $debug = FALSE], [int $srcVersion = 3])
    • boolean $withoutNull
    • boolean $debug
    • int $srcVersion: (pk-05-07-14)
    getDebugMode (line 476)
    • version:

      pk-06-01-03

      *

    • since: pk-04-07-23
    boolean getDebugMode ([int $mode = 0])
    • int $mode
    getDefaultValArr (line 2496)

    returns an array with the field default values;

    • return:

      an array with field name as key and default value

      pk-04-08-31: param $debug added

    • version: pk-04-08-31
    array getDefaultValArr ([string $table = ""], [boolean $debug = FALSE])
    • string $table: if not empty only fields of $table are returned
    • boolean $debug
    getErrorArr (line 4013)

    returns the error array

    • since: pk-06-03-06
    array getErrorArr ()
    getErrors (line 3943)

    returns the error in a string

    • version: pk-04-12-30
    string getErrors ([string $sep = "\n"], [boolean $debug = FALSE], [boolean $withoutLabel = TRUE])
    • string $sep
    • boolean $debug
    • boolean $withoutLabel
    getField (line 2127)

    returns a pointer to a field object

    • version: pk-07-02-27
    • since: pk-03-12-17
    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
    getFieldArr (line 2213)

    returns an array of pointers to the form fields

    • return: of &DBMS_FIELDS
    • version: pk-04-07-23
    • version: pk-07-05-03
    • access: public
    array getFieldArr ([boolean $sorted = TRUE])
    • boolean $sorted: sorted array index is field order nr
    getFieldDescArray (line 2021)
    void getFieldDescArray ()
    getFields (line 2245)

    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
    getFrmMode (line 496)
    • since: pk-05-11-04
    int getFrmMode ()
    getFromStmt (line 2042)

    generates a sql from statement

    • version: pk-05-02-16
    • todo: currently only mysql join is implemented
    string getFromStmt ([boolean $debug = FALSE])
    • boolean $debug: (since pk-06-07-31)
    getHTMLFormButtons (line 3186)

    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

    • version: pk-05-12-14
    • version: pk-06-01-09
    • version: pk-06-02-13 class=\"button\" added to img-tages
    • version: pk-06-09-11 remove _DBMS_FIELDS from MD5DELVALKEY
    • since: pk-05-03-22
    string getHTMLFormButtons ([int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
    • int $mode
    • string $arrName
    • boolean $debug
    getHTMLFormFromArray (line 3344)

    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

    • version: pk-05-02-08 if $frmAction != "" don't append $_SERVER['QUERY_STRING']
    • version: pk-06-02-06 call of getHTMLFormStatement()
    • version: pk-07-02-28 pcf_get_htmlJsInclude
    • todo: BUG DBMSFORMID sometimes DBMSFORMID is 0 workaround with $_POST is done now
    • since: pk-04-12-29
    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
    getHTMLFormHiddenFields (line 3072)

    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.

    • version: pk-05-09-13
    • version: pk-06-09-11 FRMRELOADFLD added
    • since: pk-05-03-22
    string getHTMLFormHiddenFields ([string $arrName = "DBVAL"], [boolean $debug = FALSE])
    • string $arrName
    • boolean $debug
    getHTMLFormNoRights (line 1294)

    returns a html statement for no rights errors

    • since: pk-06-02-13
    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
    getHTMLFormStatement (line 3024)

    returns the html form statement

    • version: pk-07-01-18
    • since: pk-06-02-06
    string getHTMLFormStatement ()
    getHTMLLstFromCursor (line 4718)

    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 >)

    • since: pk-04-12-31
    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
    getHTMLLstFromQuery (line 4778)
    void getHTMLLstFromQuery ( &$nofRows, [ $query = ""], [ $links = NULL], [ $sortLnk = NULL], [ $limit = 0], [ $offset = 0], [ $debug = FALSE])
    • &$nofRows
    • $query
    • $links
    • $sortLnk
    • $limit
    • $offset
    • $debug
    getHTMLName (line 429)

    returns the name of the form in the html form

    <form name="....">

    • since: pk-05-09-16
    string getHTMLName ()
    getId (line 463)

    returns the name of the form

    • return: ID of the form
    • version: pk-03-10-22
    int getId ()
    getInsertCols (line 3813)

    generates a string with the column names to use in an insert statement appends a comma seperated list to $cmd

    • see: DBMS_FORM::getInsertValues for code example
    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
    getInsertValues (line 3874)

    generates a string with comma seperated slashed field values to use in an insert statement together with DMBS_FORM::getInsertCols()

    example:

    1.  $frmObj->clearErrors();
    2.  $errors=TRUE;
    3.  do {
    4.      $query="INSERT INTO T_CMS_MENU (";
    5.      if (!($frmObj->getInsertCols($DBVAL,$query))) break;
    6.      $query.=") VALUES (";
    7.      if (!($frmObj->getInsertValues($DBVAL,$query))) break;
    8.      $query.=")";
    9.      $errors=FALSE;
    10.  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
    getJavaCode (line 2690)

    gets the html (javaScriptCode) for the formular start

    • version: pk-06-11-22 usage of html_includes
    • version: pk-07-02-28 use pcf_get_htmlJsInclude
    • since: pk-04-09-08
    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
    getKeyArray (line 1985)

    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)
    getKeyColNames (line 2012)

    returns an array with the key column names

    • since: pk-06-02-06
    array getKeyColNames ()
    getListColLabelArr (line 4671)

    returns an array with key=column name and value = label of the form

    • since: pk-05-07-06
    array getListColLabelArr ([boolean $debug = FALSE])
    • boolean $debug
    getListHeaderRow (line 4599)

    echos the list header Row

    class = "lstHeader" is added to <a> html tag $this->FRMLST_THADD is added to <th>

    • version: pk-05-07-05 $this->lstShowRowNr
    • version: pk-05-04-15 $fldObj->lstLink added
    • version: pk-05-03-16
    • version: pk-04-02-15
    • version: pk-07-01-10 use $fldObj->isToShow() instead of direct access
    • version: pk-05-11-07 links SHOWQUERY added
    • version: pk-06-09-12 use $fldObj->lstColSpan
    • version: pk-05-11-30 add ? or & to $sortLnk
    • version: pk-06-02-23 check dbDesc['COLNAME'] in sortLink
    • version: pk-06-01-19 lstLabel added in fields
    • todo: check query for SHOWQUERY
    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
    getListRow (line 4395)

    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

    • version: pk-05-07-08
    • version: pk-05-07-05 $this->lstShowRowNr
    • version: pk-05-04-13 anchor added
    • version: pk-05-10-06 object values added
    • version: pk-05-11-15 button cols width 20 added
    • version: pk-06-10-20 linking of the column
    • version: pk-06-09-08 $rowNr call by reference
    • version: pk-06-03-02 [GROUPID] added
    • todo: check edit link && check column links
    • since: pk-04-12-30
    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:
    getList_SQLFieldLst (line 4544)

    returns the SQL-Fieldlist for Lists

    • version: pk-05-02-22 add primary keys
    • version: pk-06-05-15 bugfix; debugging
    • since: pk-05-02-16
    string getList_SQLFieldLst ([boolean $debug = FALSE])
    • boolean $debug
    getName (line 411)

    returns the name of the form

    • return: unique name of the form
    string getName ()
    getNofFields (line 1797)

    returns the number of fields

    • since: pk-07-04-23
    • access: public
    int getNofFields ()
    getObjectVar (line 304)

    returns the value of an object variable

    • since: pk-06-07-27
    mixed getObjectVar (string $varName)
    • string $varName
    getReloadUri (line 2518)

    returns the relaod url

    • since: pk-07-01-18
    string getReloadUri ([boolean $debug = FALSE])
    • boolean $debug
    getRowObjValue (line 4321)

    returns an object value for a row

    • global: $OCSP_OBJ $OCSP_OBJ:
    • since: pk-05-10-06
    mixed getRowObjValue ( &$fldObj, array $row, [boolean $debug = FALSE], DBMS_FIELD $fldObj)
    • DBMS_FIELD $fldObj
    • array $row
    • boolean $debug
    • &$fldObj
    getRowQueryString (line 3785)

    returns a query string for the row in $rowArr

    • since: pk-04-07-29
    string getRowQueryString (array $dataArr, [string $table = ""], [boolean $debug = FALSE])
    • array $dataArr
    • string $table
    • boolean $debug
    getSearchWhere (line 4909)

    generates a where statement for search

    • version: pk-05-08-11
    • version: pk-06-01-25 $alwaysRetWhere added
    • version: pk-07-01-09 skip filds with no db
    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
    getTableFromArray (line 2831)

    returns the form table rows

    • version: pk-05-11-04
    • version: pk-06-04-02 add foreign keyfields as hidden input if they do have values in $DBVAL
    • version: pk-06-11-19 set the form object to the field
    • since: pk-
    string getTableFromArray (array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
    • array $DBVAL
    • int $mode
    • string $arrName
    • boolean $debug
    getTableList (line 1972)

    returns the table list

    • since: pk-04-07-28
    array getTableList ()
    getTableValueArrays (line 3655)

    returns an 2 dimensional array of all form data [table][col]

    • version: pk-06-01-13
    • since: pk-05-12-05
    array getTableValueArrays (array $postArr, [boolean $debug = FALSE])
    • array $postArr: array with key=>value
    • boolean $debug: show debug option
    getTabLinkArray (line 3400)

    returns an array with links to use in a tab NOTE templates are not parsed

    • since: pk-06-09-12
    array getTabLinkArray (int $mode, [boolean $debug = FALSE])
    • int $mode
    • boolean $debug
    getTitle (line 451)
    • since: pk-05-08-25
    string getTitle ()
    getUpdateValues (line 3487)

    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:

    1.  $DBVAL=$_POST;
    2.  $cmd="UPDATE mytable SET myNotPostedField=1,";
    3.  // append http posted fields
    4.  if (!$frmObj->getUpdateValues($DBVAL,$cmd,"mytable","DBVAL"{
    5.      // show error message
    6.      $frmObj->writeErros();
    7.  else {
    8.      $cmd .= " WHERE myKey=1";
    9.      $DBOBJ->executeCmd($cmd)
    10.  }

    • return: TRUE
    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
    getValueArray (line 3545)

    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

    • version: pk-05-02-22 don't check hidden fields (leads to errors in joins)
    • version: pk-03-12-13
    • version: pk-05-12-05 debuging
    • version: pk-05-12-29 handling hidden auto_inc fields
    • version: pk-06-02-16 handling of sortorder fields (DBMS_FIELD_ORDERNR)
    • version: pk-06-01-13 auto_inc fields are always NULL in FRM_MODE_NEW and FRM_MODE_COPY
    • since: pk-03-12-13
    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
    getWhereValues (line 3743)

    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
    get_frmFields (line 2189)

    returns the form field array

    • since: am-06-05-15
    array get_frmFields ([boolean $withoutTable = FALSE])
    • boolean $withoutTable: include table name in the key
    get_gDBIDX (line 341)

    gets gDBIDX

    • deprecated: since pk-07-06-28
    • since: pk-05-02-17
    string get_gDBIDX ()
    hasErrors (line 3998)

    checks $this->errors

    • version: pk-03-12-13
    bool hasErrors ()
    hasSortFld (line 1433)

    returns if the form has a sortcolumn (DBMS_FIELD_ORDERNR)

    • since: pk-06-01-25
    boolean hasSortFld ([boolean $withArrowOnly = FALSE], [boolean $debug = FALSE])
    • boolean $withArrowOnly
    • boolean $debug
    hideAllTblFields (line 2474)

    hides all fields of a table

    • since: pk-04-07-30
    void hideAllTblFields (string $tbl, [boolean $debug = FALSE])
    • string $tbl
    • boolean $debug
    hideField (line 2387)

    set a field hidden

    • since: pk-04-03-08
    void hideField (string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
    • string $fldName
    • string $tbl
    • boolean $debug
    isReloaded (line 2544)

    returns if the form is reloaded

    • since: pk-07-03-02
    • access: public
    boolean isReloaded (string $postArrName, [boolean $debug = FALSE])
    • string $postArrName
    • boolean $debug
    loadFromDb (line 995)

    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

    • return: succeed?
    • version: pk-04-07-28
    • version: pk-05-07-14
    boolean loadFromDb ([ $debug = FALSE])
    • $debug
    lstShowRowNrOnOff (line 4055)

    sets lstShowRowNr

    • since: pk-05-07-05
    void lstShowRowNrOnOff ([boolean $on = TRUE])
    • boolean $on
    mergeFormFields (line 1069)

    merges the fields of an other form to $this if ($prepend) is true the fields will be prepended else appended to the fieldlist

    • since: pk-06-01-24
    boolean mergeFormFields ( &$frmMerge, [boolean $prepend = FALSE], [boolean $debug = FALSE], DBMS_FORM $frmMerge)
    • DBMS_FORM $frmMerge
    • boolean $prepend
    • boolean $debug
    • &$frmMerge
    newField (line 1463)

    creates a new field

    • version: pk-04-01-11
    • version: pk-05-02-17
    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
    p_getListRowLink (line 4110)

    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

    • version: pk-06-01-09
    string p_getListRowLink (array $link, array $row, int $rowNr, [boolean $debug = FALSE])
    • array $link
    • array $row
    • int $rowNr
    • boolean $debug
    p_userCan (line 1132)

    private method checks right from table T_DBMS_FORMRIGHTS

    • version: pk-05-07-21
    • version: pk-06-03-06 memory cache $GLOBALS['OCSP']['CACHE']['FRMRIGHTS'][$this->getId()][$usrId][$col] added
    • since: pk-05-02-15
    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
    reloadCheck (line 2592)

    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

    • version: pk-05-11-23
    • version: pk-05-11-17 debug infos
    • version: pk-05-11-25 debug info
    • version: pk-05-11-29 bugfix
    • version: pk-07-02-28
    • version: pk-06-10-25 bugfix regex http? -> https?
    • since: pk-05-08-08
    array reloadCheck ([array $aktRow = NULL], [boolean $debug = FALSE], [boolean $pArrName = ""])
    • array $aktRow
    • boolean $debug
    • boolean $pArrName
    removeTable (line 1900)

    removes a table from the form

    boolean removeTable (string $aTable, [boolean $debug = FALSE])
    • string $aTable: name of the tablename
    • boolean $debug
    removeTableFields (line 1925)

    removes all fields of a Table

    • since: pk-04-07-30
    void removeTableFields (string $aTable, [boolean $debug = FALSE])
    • string $aTable
    • boolean $debug
    setAsNew (line 394)

    marks the form as new it will be inserted on $this::storeToDb

    • since: pk-06-01-24
    void setAsNew ([string $frmName = NULL], [ $frmDesc = ""], [ $debug = "0"])
    • string $frmName
    • $frmDesc
    • $debug
    setDBRow (line 787)

    sets the object values from a data array

    • version: pk-05-03-23
    • version: pk-05-08-25
    • since: pk-04-10-07
    void setDBRow (array $dbVal, [boolean $asPopulated = TRUE], [boolean $debug = FALSE])
    • array $dbVal
    • boolean $asPopulated: not used
    • boolean $debug
    setError (line 3981)

    adds an error to this::errors

    • version: pk-03-12-14
    • version: pk-05-08-30
    • since: pk-03-12-14
    void setError (array $aError, [string $fld = ""])
    • array $aError: with LABEL und MSG values
    • string $fld
    setErrorArr (line 4026)

    sets the error array

    • since: pk-06-03-06
    void setErrorArr (array $errArr, [boolean $merge = TRUE])
    • array $errArr
    • boolean $merge
    setFieldObj (line 2171)

    sets a field object

    • since: am-06-05-15
    void setFieldObj ( $sTbl, DBMS_FIELD $fld, [boolean $debug = FALSE], string $tbl)
    • string $tbl
    • DBMS_FIELD $fld
    • boolean $debug
    • $sTbl
    setFldFrmObj (line 1777)

    sets myForm in each field

    • since: pk-05-09-14
    void setFldFrmObj ([boolean $debug = FALSE])
    • boolean $debug
    setFrmMode (line 504)
    • since: pk-05-11-04
    void setFrmMode (int $mode)
    • int $mode
    setHTMLFORM_BtnSource (line 2919)

    sets the button array

    • version: pk-05-08-08 png -> gif
    • since: pk-05-03-22
    void setHTMLFORM_BtnSource ([ $debug = FALSE])
    • $debug
    setHTMLFORM_objectVar (line 2956)

    sets object HTMLFORM variables:

    • HTMLFORM_mode
    • HTMLFORM_URL_action
    • HTMLFORM_URL_back
    • HTMLFORM_URL_next
    • HTMLFORM_URL_reload

    • version: pk-05-06-22
    • version: pk-05-09-05
    • version: pk-05-11-04
    • version: pk-06-03-07 HTMLFORM_arrayName added
    • since: pk-05-03-22
    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
    setHTMLName (line 441)

    sets the name of the form in the html form

    <form name="....">

    • since: pk-05-09-16
    void setHTMLName (string $aName)
    • string $aName
    setName (line 419)
    • since: pk-05-09-14
    void setName (string $aName)
    • string $aName
    setObjectVar (line 318)

    sets the value of an object variable

    • since: pk-06-09-14
    void setObjectVar (string $varName, mixed $value)
    • string $varName
    • mixed $value
    set_gDBIDX (line 329)
    • deprecated: since pk-07-06-28
    • since: pk-05-02-17
    void set_gDBIDX (string $idx)
    • string $idx
    showField (line 2445)

    set a field not hidden

    • since: pk-04-10-11
    void showField (string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
    • string $fldName
    • string $tbl
    • boolean $debug
    showFieldInList (line 2416)

    enable field in list

    • since: pk-06-09-06
    void showFieldInList (string $fldName, [string $tbl = ""], [boolean $debug = FALSE])
    • string $fldName
    • string $tbl
    • boolean $debug
    storeToDb (line 907)

    stores a form object to database table T_DBMS_FORM

    uses $GLOBALS['USRDB'] as database object calls

    1.  if ($this->frmId{
    2.     return $GLOBALS['USRDB']->replace("T_DBMS_FORM",$dbValues,$debug);
    3.  else {
    4.     INSERT FORM -> update fields -> UPDATE FROM
    5.  }

    • version: pk-04-10-07
    • version: pk-05-01-13 update fields after insert
    • version: pk-05-07-11 T_DBMS_FORMFIELDS added
    • version: pk-07-06-10 FRM_CLASS added
    • version: pk-08-06-03
    bool storeToDb ([boolean $debug = FALSE])
    • boolean $debug
    unserFldRow (line 556)

    unserializes a fieldRow (array element)

    • version: pk-05-10-25
    • version: pk-05-12-01
    • version: pk-06-07-28
    • version: pk-07-03-05
    • since: pk-05-07-14
    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
    updateFields (line 1734)

    checks if the table has changed

    • version: pk-06-08-02 hide new fields by default
    void updateFields ([boolean $debug = FALSE])
    • boolean $debug
    userCanDelete (line 1243)

    checks if a user is allowed to delete the data

    • since: pk-05-03-17
    boolean userCanDelete ([int $usrId = 0], [boolean $debug = FALSE])
    • int $usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
    • boolean $debug
    userCanEdit (line 1210)

    checks if a user is allowed to edit (update) the data

    • since: pk-05-02-15
    boolean userCanEdit ([int $usrId = 0], [boolean $debug = FALSE])
    • int $usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
    • boolean $debug
    userCanExport (line 1275)

    checks if a user is allowed to export the data

    • since: pk-06-01-25
    boolean userCanExport ([int $usrId = 0], [boolean $debug = FALSE])
    • int $usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
    • boolean $debug
    userCanInsert (line 1226)

    checks if a user is allowed to add (insert) new data

    • since: pk-05-03-17
    boolean userCanInsert ([int $usrId = 0], [boolean $debug = FALSE])
    • int $usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
    • boolean $debug
    userCanMode (line 1363)

    returns if the user is allowed in mode

    • since: pk-06-03-06
    boolean userCanMode (int $usrId, int $mode, [boolean $debug = FALSE])
    • int $usrId
    • int $mode
    • boolean $debug
    userCanShow (line 1259)

    checks if a user is allowed to show the data

    • since: pk-05-03-17
    boolean userCanShow ([int $usrId = 0], [boolean $debug = FALSE])
    • int $usrId: the user id if (!isset $GLOBALS['USER']->getId() is used)
    • boolean $debug
    usesTable (line 1947)

    check if the form uses $aTable

    • since: pk-05-02-22
    boolean usesTable (string $aTable)
    • string $aTable
    writeErros (line 3917)

    echos the form errors

    void writeErros ([boolean $withLabel = TRUE])
    • boolean $withLabel
    writeField (line 2735)

    writes a field and sets the fields form Id

    • version: pk-04-07-29
    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
    writeListRow (line 4192)

    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
      1.                  if (stristr($val['IMG'],"src=")) {
      2.                      echo "<img ".$val['IMG'].">";   // new style by gaisi
      3.                   else {
      4.                       echo "<img src=\"".$val['IMG']."\" alt=\"".$val['TEXT']."\" border=\"0\">";
      5.                   }
    • TEXT text to show if no IMG or alt of the image

    if $links['EDIT'] isset each data colum is link to the url

    • version: pk-03-12-12
    • version: pk-05-07-05 $this->lstShowRowNr
    • version: pk-05-07-08 $val->lstTDAdd added
    • deprecated: since pk-07-01-10
    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
    writeSearchForm (line 4877)

    echos a searchForm

    • version: pk-04-11-10
    void writeSearchForm ([string $arrName = "DBSEARCH"], [string $trTag = ""], [boolean $debug = FALSE])
    • string $arrName
    • string $trTag
    • boolean $debug
    writeTableFromArray (line 2779)

    writes a form table from a query

    • version: pk-04-09-08
    • version: pk-05-11-04
    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
    writeTableFromQuery (line 2757)

    writes a form table from a query

    • version: pk-04-02-23
    • version: pk-05-11-04
    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
    writeTableList (line 1956)
    void writeTableList ([ $aSelectName = ""], [ $sep = "\n"])
    • $aSelectName
    • $sep
    xmlDomNodeImport (line 5038)

    exports the form to an xml file

    • version: pk-06-05-25
    bool; xmlDomNodeImport (DomElement $frmNode, [ $debug = FALSE])
    • DomElement $frmNode
    • $debug
    xmlExport (line 4944)

    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

    Documentation generated on Thu, 08 Jan 2009 17:43:36 +0100 by phpDocumentor 1.4.0a2