Class OCSP_FORM

Description

Implements interfaces:

Database Formular Basic Elements this class is without any layout elements to extend to what ever is needed

Located in /db/forms/OCSP_FORM.phpclass (line 51)

OCSP_OBJ
   |
   --OCSP_FORM
Direct descendents
Class Description
 class CLI_FORM Class file CLI_FORM
 class CLI_PROFILE_FORM Class CLI_PROFILE_FORM handels forms for client profiles overwrites DBMS_FORM database functions to store the form in a row of T_CLI_PROFILES instead of T_DBMS_FORM
 class CLI_STAFF_FORM Class file CLI_STAFF_FORM
 class CMS_CHAPTER_FORM Class file CMS_CHAPTER_FORM
 class CMS_MENU_FORM openCSP class CMS_MENU_FORM
 class CMS_PAGE_FORM Class file CMS_PAGE_FORM
Abstract class OCSP_FORM_MODULE openCSP class OCSP_FORM_MODULE
Class Constant Summary
 CLASS_SRC_FILE = __FILE__
 FORM_CACHE_DIR = "form_cache"
 FORM_CACHE_FILEEXT = ".frm.cache"
Variable Summary
Method Summary
 static void clearFieldClassDescCache ([boolean $debug = False])
 static void compat_setOCSP_DBMS_FIELDDESC ([boolean $debug = False])
 static OCSP_FORM &factory_from_cacheArr (array $cacheArr, [string $className = NULL], [boolean $debug = False])
 static OCSP_FORM &factory_from_id (int $aId, [string $className = ''], [boolean $debug = False], [boolean $forceNew = False])
 static OCSP_FORM &factory_from_name ( $aName, [float $className = NULL], [boolean $debug = False], [boolean $forceNew = False], int $aId)
 static OCSP_FORM &factory_from_request ([boolean $debug = False])
 static string findForm_getHTMLOptionList ([string $aTable = NULL], [int $selectedForm = 0], [boolean $debug = False])
 static void findForm_listForTable ([ $aTable = NULL], [ $debug = False])
 static string getCacheFileName (mixed $frmIdName, [global $debug = False])
 static void getFieldClassDesc ([ $aClassName = 'DBMS_FIELD'], [boolean $debug = False], array $aClass)
 static array getFieldClassDescArr ()
 static OCSP_FORM &get_existing_instance (mixed $frmIdName, string $className, [boolean $debug = False])
 static boolean loadFieldClassDesc ([boolean $debug = False])
 static boolean requireFieldClass (string $aClassName, [boolean $debug = False])
 static boolean writeFieldClassDescToCache ([boolean $debug = False])
 OCSP_FORM __construct ([int $aId = 0], [string $aName = ""], [boolean $debug = False])
 boolean addNewBlock (array $blockData, [array $colNames = NULL], [boolean $debug = False])
 boolean addNewBlockFromPost ([string $arrName = 'DBVAL'], [array $colNames = NULL], [boolean $debug = False])
 void addPassThroughField (string $colName, mixed $mixValue)
 boolean addTable (string $aTable, [int $aBlockId = 0], [boolean $debug = False])
 boolean ajax_canChangeForm ()
 void ajax_createObj ()
 OCSP_AJAX &ajax_getObj ([boolean $force = True])
 void ajax_setObj ( &$aAjaxFrmObj, OCSP_AJAX $aAjaxFrmObj)
 boolean castFieldTo (string $fldKey, string $className, [boolean $debug = False])
 boolean checkSubmitData ([string $method = ""], [boolean $debug = False], string $contrClass)
 void clearErrors ([ $fieldsTo = False], boolean $fieldsToo, boolean $debug)
 boolean copyBlock (int $blockId, [boolean $debug = False])
 boolean createDBColumn ( &$field, boolean $debug, mixed $filed)
 boolean curUserCanCol (string $str_col, [boolean $debug = False])
 boolean curUserCanDelete ([ $debug = False])
 boolean curUserCanEdit ([ $debug = False])
 boolean curUserCanExport ([ $debug = False])
 boolean curUserCanInsert ([ $debug = False])
 boolean curUserCanSave ([boolean $debug = False])
 boolean curUserCanShow ([ $debug = False])
 void delCacheFiles ()
 boolean deleteBlock (int $blockId, [boolean $debug = False])
 void deleteField (string $fldKey, [int $blockId = -1], [boolean $debug = False], return 3)
 void deleteFromDb ([boolean $debug = False])
 DBMS_FIELD factory_field (string $fldName, [string $fldClass = ''], [array $dbDesc = array()], [array $fieldValues = array()], [boolean $debug = False])
 boolean formIsLoaded ()
 DBMS_FIELD &getAutoIncField (string $tbl, [boolan $debug = False])
 OCSP_FORM_BLOCK &getBlock (int $blockId, [boolean $debug = False])
 OCSP_FORM_BLOCK &getBlockByName (string $blockName, [boolean $debug = False])
 array &getBlocks ([boolean $debug = False])
 string getClassName ()
 OCSP_FRMCONTR &getControllObj ([string $contrClass = "OCSP_FRMCONTR"], [boolean $debug = False])
 OCSP_FRMCONTR &getControlObj ([string $contrClass = "OCSP_FRMCONTR"], [boolean $debug = False])
 string getDataArrName ()
 OCSP_DB &getDBObj ([boolean $debug = False])
 array getErrorFields ([boolean $debug = False])
 string getErrors ([boolean $withFields = False], [int $returnType = FRM_DATATYPE_STRING], [boolean $debug = False])
 string; getExportString ()
 DBMS_FIELD &getField (string $aFldName, [string $aTable = ""], [int $aBlockId = -1], [boolean $debug = False])
 array getFields ([string $aTable = ""], [boolean $debug = False], [form $frmMode = -1])
 array getFormCmdFields ([boolean $debug = False])
 int getFrmMode ()
 string getHTMLLstFromQuery ( &$nofRows, [string $query = ""], [array $links = NULL], [string $sortLnk = NULL], [int $limit = 0], [int $offset = 0], [boolean $debug = False], int $nofRows)
 string getHTMLname ()
 int getId ()
 array getJoinCols ()
 array getKeyFields ([boolean $debug = False])
 string getLangTxt (string $txt, [string $lang = "DE"])
 string getLayoutField (string $key)
 OCSP_FRMCONTR_LIST &getListControll ([string $contrClass = "OCSP_FRMCONTR_LIST"], [boolean $debug = False])
 OCSP_FRMVIEW_LIST &getListView ([string $viewClass = "OCSP_FRMVIEW_LIST"], [boolean $debug = False])
 string getMasterTable ()
 void &getMyDBControll ([ $debug = False])
 array() getMyDBRow ([boolean $debug = False])
 string getMyJsId ()
 DBMS_TABLEOBJ &getMyTblObj ([boolean $force = False], [boolean $debug = False])
 string getName ()
 void getNofBlocks ([boolean $debug = False])
 void getNofFields ([int $mode = -1], [boolean $debug = False])
 mixed getObjectVar (string $varName)
 $this->myPassThroughFields; getPassThroughFields ()
 array getPKFields ([string $aTable = ""], [boolean $debug = False])
 string getReloadUri ([boolean $debug = False])
 string getSubmitAction (int $mode, [string $type = 'ACTION'])
 array getTables ()
 string getTblObjClass ()
 string getTblObjInc ([boolean $debug = False])
 string getTitle ()
 OCSP_FRMVIEW &getViewObj ([string $viewClass = "OCSP_FRMVIEW"], [boolean $debug = False])
 array get_listGroups ()
 void hasErrors ()
 void hideField (string $aFldName, [string $aTable = ""], [string $scope = "all"], [int $aBlockId = -1], [boolean $debug = False])
 void importFromArray (array $impArray, [boolean $debug = False])
 void initCheckSubmitData (array $frmSettings, string $dataArrName, array $frmValues, [boolean $debug = False])
 boolean linkBlock (int $blockId, [boolean $debug = False])
 void loadBlocksFromDb ([boolean $debug = False])
 void loadFieldDescFromCache ([boolean $debug = False])
 OSCP_FORM_BASIC &loadFromDb ([int $aId = 0], [string $aName = ""], [float $revision = 0.0], boolean $debug)
 OCSP_FORM loadFromFileCache ([int $aId = 0], [string $aName = ""], float $revision, boolean $debug)
 int prepareList (array $settings, [boolean $debug = False])
 void registerTable (string $aTable)
 void removeTable (string $aTable, [boolean $debug = False])
 void rightsAreSet ()
 void setControl ( &$aControl, [boolean $sync = True], [boolean $debug = False], OCSP_FRMCONTR $aControl)
 void setControll ( &$aControl, [boolean $sync = True], [boolean $debug = False], OCSP_FRMCONTR $aControl)
 void setDBObj ( &$dbObj, [boolean $debug = False], OCSP_DB $dbObj)
 void setError (mixed $aError, [string $fld = ""], [boolean $debug = False])
 void setFrmMode (int $mode)
 void setId (int $aId)
 void setLayoutField (string $key, string $value)
 void setMasterTable ( $aTbl)
 void setMyDBControll (OCSP_FORM_DBCONTROLL &$aDB_CONTROLL)
 void setMyDBRow (array $aRow, [boolean $debug = False])
 void setMyJsId (string $aId)
 void setMyTblObj ( &$tblObj, [boolean $debug = False], DBMS_TABLE_OBJ $tblObj)
 void setName (string $aName)
 string setSubmitAction (int $mode, string $uri, [string $type = 'ACTION'])
 void setTblObjClass (string $className, [ $debug = False])
 boolean setTblObjFromSubmitData ( &$dataArr, [boolean $debug = False], array $dataArr)
 void setTblObjInc (string $incFile, [ $debug = False])
 void storeToDb ([boolean $debug = False])
 void writeFieldDescToCache ([boolen $debug = False])
 void writeToFileCache (boolean $debug)
Variables
static mixed $dbmsFieldClassDesc = array() (line 93)
  • staticvar: array $dbmsFieldClassDesc:
  • access: protected
static mixed $dbmsFieldTypeClasses = array() (line 98)
  • staticvar: array $dbmsFieldTypeClasses:
  • access: protected
static mixed $form_instances = array() (line 83)
  • staticvar: array $form_instances: index starts at 1
  • access: public
static mixed $staticClassVars = array('form_instances') (line 88)
  • staticvar: array $staticClassVars: vars which must not be copied
  • access: protected

Redefinition of:
OCSP_OBJ::$staticClassVars
int $frmMode (line 505)
  • access: protected
int $FRM_DEBUG = 0 (line 425)
  • access: protected
string $FRM_DESC = "" (line 430)
  • access: protected
boolean $FRM_DISABLEAJAXCHANGEFORM = 0 (line 445)

disable to check the form on ajax relaod

  • since: pk-08-11-01
  • access: protected
int $FRM_ID = 0 (line 385)

db attributes stored in T_DBMS_FORM

  • access: protected
boolean $FRM_ISDEFLT = False (line 410)
  • access: protected
string $FRM_JOIN = "" (line 405)
  • access: protected
string $FRM_LAYOUT = "" (line 420)
  • access: protected
string $FRM_LSTGROUPS = "" (line 435)
  • access: protected
string $FRM_NAME = "" (line 390)
  • access: protected
int $FRM_SRCVERSION = 4 (line 415)
  • access: protected
string $FRM_TABLES = "" (line 395)
  • access: protected
string $FRM_TITLE = "" (line 400)
  • access: protected
array $layoutFields = array() (line 480)
  • access: protected
array $listGroups = array() (line 493)
  • var: array [DBMS_FIELD->getKey()]:
    • [CSSCLASS] a css class to use for the table row <tr>
    • [CSSSTYLE] a css style to add inline to the row <td> / <th>
    • [USE_TH] boolean use <th> or <td> for the value
    • [TMPL] a template to parse
    • [ORDERBY] column(s) to add to sql sorting (if empty the field key is used)
  • access: protected
array $loadedUserRights = array() (line 552)

alread loaded userrights from the db

  • access: protected
OCSP_AJAXFORM $myAjaxObj = NULL (line 348)

the ajax object used by the fields

  • access: protected
OCSP_FORM_BLOCK $myBlocks = array() (line 315)
  • access: protected
OCSP_FRMCONTR_LIST $myControl = NULL (line 327)
  • access: protected
OCSP_FORM_DBCONTROLL $myDBControll = NULL (line 333)
  • access: protected
OCSP_DB $myDBObj = NULL (line 307)
  • access: protected

Redefinition of:
OCSP_OBJ::$myDBObj
array $myDBValues = array() (line 451)
  • var: database representation of the form
  • access: protected
array $myErrors = array() (line 511)
  • var: array of error messages array('LABEL','MSG')
  • access: protected
array $myFormDBCols = array('FRM_ID','FRM_NAME','FRM_TITLE','FRM_CLASS',
'FRM_TABLES','FRM_ISDEFLT','FRM_QUERY','FRM_JOIN',
'FRM_REVISION','FRM_SRCVERSION','FRM_LAYOUT','FRM_DEBUG','FRM_DESC','FRM_LSTGROUPS',
'FRM_DISABLEAJAXCHANGEFORM')
(line 457)
  • var: (columns of T_DBMS_FORM to use in the object)
  • access: protected
boolean $myFormValuesAreSet = False (line 364)
  • access: protected
int $myInstanceId (line 358)

index in self::instances_byId

  • access: protected
array $myPassThroughFields = array() (line 532)

array of fields which have to been pass through to class

if you need to add values to the form data on save without having it in the form available add it this array

the fields will be passed encrypted and overwrites values set in the form

  • since: pk-08-06-25
  • access: protected
array $myTables = array() (line 378)

array with all tables the form uses note Index 0 is considered as master table the first table to load.

if the tables are joined the order of adding to the join depends on the index

the array is populated by exploding $this->FRM_TABLES (,-seperated)

  • access: protected
DBMS_TABLE_OBJ $myTblObj = NULL (line 340)

the current table object class

  • access: protected
OCSP_FRMVIEW_LIST $myView = NULL (line 321)
  • access: protected
string $my_jsId = "" (line 517)
  • var: a unique id of the form used to identify the form in the javascript array ocsp_frmList
  • access: protected
mixed $rightsSet = 0 (line 545)
  • access: protected
array $submitActions = array() (line 499)
  • access: protected
string $tblObj_class = NULL (line 473)

class file of the table object

  • access: protected
string $tblObj_include = NULL (line 467)

include file for the table object

  • access: protected

Inherited Variables

Inherited from OCSP_OBJ

OCSP_OBJ::$global_currentUser
OCSP_OBJ::$global_defaultDBObj_read
OCSP_OBJ::$global_defaultDBObj_write
Methods
static clearFieldClassDescCache (line 292)

clears the FieldClassDesc cache

  • since: pk-08-06-14
  • access: public
void clearFieldClassDescCache ([boolean $debug = False])
  • boolean $debug
static compat_setOCSP_DBMS_FIELDDESC (line 277)

sets the old style $GLOBALS['OCSP']['DBMS_FIELDDESC']

  • access: public
void compat_setOCSP_DBMS_FIELDDESC ([boolean $debug = False])
  • boolean $debug
static factory_from_cacheArr (line 635)
  • since: pk-07-10-13
  • requires: pcf_templates.phpinc
  • access: public
OCSP_FORM &factory_from_cacheArr (array $cacheArr, [string $className = NULL], [boolean $debug = False])
  • array $cacheArr
  • string $className: (if set overwrite 'FRM_CLASS' in cacheArr )
  • boolean $debug
static factory_from_id (line 696)

returns the form object with FRM_ID is $aId

  • access: public
OCSP_FORM &factory_from_id (int $aId, [string $className = ''], [boolean $debug = False], [boolean $forceNew = False])
  • int $aId
  • string $className: (note need to be loaded before if not a standard openCSP form class)
  • boolean $debug
  • boolean $forceNew: (do not check self::instances_byId)
static factory_from_name (line 765)

returns the form object with FRM_NAME= $aName

  • access: public
OCSP_FORM &factory_from_name ( $aName, [float $className = NULL], [boolean $debug = False], [boolean $forceNew = False], int $aId)
  • int $aId
  • float $className
  • boolean $debug
  • boolean $forceNew: (do not check self::instances_byId)
  • $aName
static factory_from_request (line 817)
  • version: pk-07-10-07
  • requires: pcf_md5.phpinc
  • access: public
OCSP_FORM &factory_from_request ([boolean $debug = False])
  • boolean $debug
static findForm_getHTMLOptionList (line 934)

gets an html option list with all possible forms for $aTable

  • return: (html)
  • since: pk-08-02-21
  • access: public
string findForm_getHTMLOptionList ([string $aTable = NULL], [int $selectedForm = 0], [boolean $debug = False])
  • string $aTable
  • int $selectedForm
  • boolean $debug
static findForm_listForTable (line 900)
  • access: public
void findForm_listForTable ([ $aTable = NULL], [ $debug = False])
  • $aTable
  • $debug
static getCacheFileName (line 568)
  • return: (cache file path)
  • version: pk-08-11-03
  • since: pk-07-10-13
  • access: public
string getCacheFileName (mixed $frmIdName, [global $debug = False])
  • mixed $frmIdName
  • global $debug: array $OCSP_CONF
static getFieldClassDesc (line 106)

returns the field class description for a field

  • access: public
void getFieldClassDesc ([ $aClassName = 'DBMS_FIELD'], [boolean $debug = False], array $aClass)
  • array $aClass
  • boolean $debug
  • $aClassName
static getFieldClassDescArr (line 127)

returns all field class descriptions

  • access: public
array getFieldClassDescArr ()
static get_existing_instance (line 592)
  • access: public
OCSP_FORM &get_existing_instance (mixed $frmIdName, string $className, [boolean $debug = False])
  • mixed $frmIdName
  • string $className
  • boolean $debug
static loadFieldClassDesc (line 214)

loads the field Desc from File cache and sets self::$dbmsFieldClassDesc

  • version: pk-08-06-13
  • access: public
boolean loadFieldClassDesc ([boolean $debug = False])
  • boolean $debug
static requireFieldClass (line 140)

requires the a field class src file

  • access: public
boolean requireFieldClass (string $aClassName, [boolean $debug = False])
  • string $aClassName
  • boolean $debug
static writeFieldClassDescToCache (line 239)

loads field definition from the db and caches to a file

  • access: public
boolean writeFieldClassDescToCache ([boolean $debug = False])
  • boolean $debug
Constructor __construct (line 977)
OCSP_FORM __construct ([int $aId = 0], [string $aName = ""], [boolean $debug = False])
  • int $aId
  • string $aName
  • boolean $debug
addNewBlock (line 2331)

adds a new block to the form and returns the block

boolean addNewBlock (array $blockData, [array $colNames = NULL], [boolean $debug = False])
  • array $blockData
  • array $colNames
  • boolean $debug
addNewBlockFromPost (line 2299)

adds a new block to the form and returns the block

boolean addNewBlockFromPost ([string $arrName = 'DBVAL'], [array $colNames = NULL], [boolean $debug = False])
  • string $arrName
  • array $colNames
  • boolean $debug
addPassThroughField (line 3258)

adds a pass-through field

  • access: public
void addPassThroughField (string $colName, mixed $mixValue)
  • string $colName
  • mixed $mixValue
addTable (line 2089)

adds a table to the form

boolean addTable (string $aTable, [int $aBlockId = 0], [boolean $debug = False])
  • string $aTable
  • int $aBlockId
  • boolean $debug
ajax_canChangeForm (line 3716)

return if the form can be changed on an relaod

  • since: pk-08-11-01
boolean ajax_canChangeForm ()

Redefined in descendants as:
ajax_createObj (line 3680)

creates an OCSP_AJAXFORM for the form

  • since: pk-07-02-27
  • access: protected
void ajax_createObj ()
ajax_getObj (line 3693)
  • since: pk-07-02-27
  • access: public
OCSP_AJAX &ajax_getObj ([boolean $force = True])
  • boolean $force
ajax_setObj (line 3705)
  • since: pk-07-02-27
  • access: public
void ajax_setObj ( &$aAjaxFrmObj, OCSP_AJAX $aAjaxFrmObj)
castFieldTo (line 2775)

changes the class of a field object

boolean castFieldTo (string $fldKey, string $className, [boolean $debug = False])
  • string $fldKey
  • string $className
  • boolean $debug
checkSubmitData (line 3357)
  • return: (True if no error found)
boolean checkSubmitData ([string $method = ""], [boolean $debug = False], string $contrClass)
  • string $method: (POST|GET)
  • string $contrClass: (sub)class Name of OCSP_FRMCONTR
  • boolean $debug
clearErrors (line 3732)

clears all errors

  • todo: clear field errors if $fieldsToo
void clearErrors ([ $fieldsTo = False], boolean $fieldsToo, boolean $debug)
  • boolean $fieldsToo
  • boolean $debug
  • $fieldsTo
copyBlock (line 2496)

link a block from an other form

  • todo: OCSP_FORM::linkBlock() inline SQL
boolean copyBlock (int $blockId, [boolean $debug = False])
  • int $blockId
  • boolean $debug
createDBColumn (line 2845)

creates the field column in the database

boolean createDBColumn ( &$field, boolean $debug, mixed $filed)
  • mixed $filed: (name or object)
  • boolean $debug
  • &$field
curUserCanCol (line 3886)

loads the right settings from T_DBMS_FORMRIGHTS

NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS

  • access: protected
boolean curUserCanCol (string $str_col, [boolean $debug = False])
  • string $str_col
  • boolean $debug
curUserCanDelete (line 3965)

returns if the current user is allowed to open the form readonly

NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS

  • access: public
boolean curUserCanDelete ([ $debug = False])
  • $debug
curUserCanEdit (line 3939)

returns if the current user is allowed to open the form readonly

NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS

  • access: public
boolean curUserCanEdit ([ $debug = False])
  • $debug
curUserCanExport (line 3979)

returns if the current user is allowed to open the form readonly

NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS

  • access: public
boolean curUserCanExport ([ $debug = False])
  • $debug
curUserCanInsert (line 3952)

returns if the current user is allowed to open the form readonly

NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS

  • access: public
boolean curUserCanInsert ([ $debug = False])
  • $debug
curUserCanSave (line 3992)

returns if the current user can save the form in the current mode

boolean curUserCanSave ([boolean $debug = False])
  • boolean $debug

Redefined in descendants as:
curUserCanShow (line 3926)

returns if the current user is allowed to open the form readonly

NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS

  • access: public
boolean curUserCanShow ([ $debug = False])
  • $debug
delCacheFiles (line 1812)

deletes the form cache files

void delCacheFiles ()
deleteBlock (line 2626)

marks a block as deleted (changes FRM_ID to $this->getId() * (-1))

boolean deleteBlock (int $blockId, [boolean $debug = False])
  • int $blockId
  • boolean $debug
deleteField (line 2826)

deletes a field NOTE: does not delete the database column of this field NOTE: does not store the form this has to be done outside

void deleteField (string $fldKey, [int $blockId = -1], [boolean $debug = False], return 3)
  • string $fldKey
  • int $blockId
  • boolean $debug
  • return 3: boolean
deleteFromDb (line 1647)

deletes a form and all dependencies

void deleteFromDb ([boolean $debug = False])
  • boolean $debug
factory_field (line 2880)

foctory a new field object

  • version: pk-08-06-13
  • version: pk-08-06-17
DBMS_FIELD factory_field (string $fldName, [string $fldClass = ''], [array $dbDesc = array()], [array $fieldValues = array()], [boolean $debug = False])
  • string $fldName
  • string $fldClass
  • array $dbDesc
  • array $fieldValues
  • boolean $debug
formIsLoaded (line 1004)
  • access: public
boolean formIsLoaded ()
getAutoIncField (line 2197)

returns the autoincrement field of $tbl

  • since: pk-08-01-15
DBMS_FIELD &getAutoIncField (string $tbl, [boolan $debug = False])
  • string $tbl
  • boolan $debug
getBlock (line 2252)
OCSP_FORM_BLOCK &getBlock (int $blockId, [boolean $debug = False])
  • int $blockId
  • boolean $debug
getBlockByName (line 2276)

returns the first block with $blockName as Name

  • since: pk-08-01-15
OCSP_FORM_BLOCK &getBlockByName (string $blockName, [boolean $debug = False])
  • string $blockName
  • boolean $debug
getBlocks (line 2236)
  • todo: cache
array &getBlocks ([boolean $debug = False])
  • boolean $debug
getClassName (line 1137)

overwrite in child classes if get_class does not fit

string getClassName ()
getControl (line 3081)
OCSP_FRMCONTR &getControl ()
getControll (line 3073)

alias for $this->getControl()

  • deprecated: since pk-08-11-20
OCSP_FRMCONTR &getControll ()
getControllObj (line 3095)

alias for $this->getControlObj()

  • deprecated: since pk-08-11-20
OCSP_FRMCONTR &getControllObj ([string $contrClass = "OCSP_FRMCONTR"], [boolean $debug = False])
  • string $contrClass
  • boolean $debug
getControlObj (line 3110)

instantiates a new class if $this->myControl not type of $contrClass

NOTE the class must exists or have it's code in __FILE__

OCSP_FRMCONTR &getControlObj ([string $contrClass = "OCSP_FRMCONTR"], [boolean $debug = False])
  • string $contrClass
  • boolean $debug
getDataArrName (line 1234)

returns the post sub array name of the form fields

  • access: public
string getDataArrName ()
getDBObj (line 1027)

if $this->myDBObj is NULL a new connection to either the users db or the global database will be establisched

  • global: array $OCSP_OBJ: OCSP_OBJ
  • requires: OCSP_DB.phpclass"
OCSP_DB &getDBObj ([boolean $debug = False])
  • boolean $debug

Redefinition of:
OCSP_OBJ::getDBObj()
allowed modes are:
getErrorFields (line 3834)

returns an array with all fields having an error

array getErrorFields ([boolean $debug = False])
  • boolean $debug
getErrors (line 3798)

returns the form errors

  • todo: OCSP_FORM::getErrors() only FRM_DATATYPE_STRING implemented now
string getErrors ([boolean $withFields = False], [int $returnType = FRM_DATATYPE_STRING], [boolean $debug = False])
  • boolean $withFields: if True the field errors are also included
  • int $returnType
  • boolean $debug
getExportString (line 1734)

returns the form export string (php array)

  • access: public
string; getExportString ()
getField (line 2721)

returns a field object

  • version: pk-08-07-12 (OBJVALS_)
DBMS_FIELD &getField (string $aFldName, [string $aTable = ""], [int $aBlockId = -1], [boolean $debug = False])
  • string $aFldName
  • string $aTable: (empty to search in all tables)
  • int $aBlockId: (-1 to search in all blocks)
  • boolean $debug

Redefined in descendants as:
getFields (line 2691)

returns an array of fields

  • version: pk-08-11-06 ($frmMode added)
array getFields ([string $aTable = ""], [boolean $debug = False], [form $frmMode = -1])
  • string $aTable: (empty to get all fields)
  • boolean $debug
  • form $frmMode: mode (-1 == all fields)
getFormCmdFields (line 3288)

returns form command fields

commands needed in subclasses to validate submitdata this is used in OCSP_FRMCONTR_FORM::getFormCmdFields()

NOTE: only added if form class != OCSP_FORM

  • version: pk-08-06-26
  • since: pk-07-12-05
array getFormCmdFields ([boolean $debug = False])
  • boolean $debug

Redefined in descendants as:
getFrmMode (line 1428)
  • since: pk-05-11-04
int getFrmMode ()
getHTMLLstFromQuery (line 4050)

returns the html code for list from a query

if $query is empty it is generated with:

  1.      $query="SELECT ".$this->getList_SQLFieldLst().$this->getFromStmt();

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->FRMLST_TABLEADD>)
  • FRMLST_TRADD (<tr $this->FRMLST_TRADD[($rowNr % 2)] >)
  • FRMLST_TDADD (<td $this->FRMLST_TDADD >)

  • version: pk-06-01-24
  • since: pk-04-12-31
string getHTMLLstFromQuery ( &$nofRows, [string $query = ""], [array $links = NULL], [string $sortLnk = NULL], [int $limit = 0], [int $offset = 0], [boolean $debug = False], int $nofRows)
  • int $nofRows: return the number of rows processed
  • string $query: if empty the query is generated
  • array $links
  • string $sortLnk
  • int $limit
  • int $offset
  • boolean $debug
  • &$nofRows
getHTMLname (line 1214)

returns the html form name

  • access: public
string getHTMLname ()
getId (line 1145)
int getId ()
getJoinCols (line 1444)
  • return: (the unserialized value of FRM_JOIN)
array getJoinCols ()
getKeyFields (line 2168)

returns an array of all primary key's found in the form

the return array has the following structure: array [table][] => &fieldobj

  • since: pk-07-09-30
array getKeyFields ([boolean $debug = False])
  • boolean $debug
getLangTxt (line 1464)

returns the language string

  • todo: OCSP_FORM::getLangTxt() currently only DE is supported
string getLangTxt (string $txt, [string $lang = "DE"])
  • string $txt
  • string $lang
getLayoutField (line 2990)

returns a layout field (added into the tag)

list keys:

  • FRMLST_TABLEADD
  • FRMLST_THEADADD
  • FRMLST_THADD
  • FRMLST_TRADD_odd
  • FRMLST_TRADD_even
  • FRMLST_TDADD
  • FRMLST_ADDBEFORELINKS
  • FRMLST_ROWADD
  • FRMLST_LIMIT
form keys:
  • FRMFRM_FORMADD
  • FRMFRM_FIELDSETADD
  • FRMFRM_TABLEADD

string getLayoutField (string $key)
  • string $key
getListControll (line 3239)

if $contrClass is not set to "NO" a controll object will be created if none exists ($this->myControl) is empty

if $contrClass is set to "NO" $this->myControl is returned as is without checking that we

OCSP_FRMCONTR_LIST &getListControll ([string $contrClass = "OCSP_FRMCONTR_LIST"], [boolean $debug = False])
  • string $contrClass
  • boolean $debug
getListView (line 3055)
OCSP_FRMVIEW_LIST &getListView ([string $viewClass = "OCSP_FRMVIEW_LIST"], [boolean $debug = False])
  • string $viewClass
  • boolean $debug
getMasterTable (line 2018)
  • access: public
string getMasterTable ()
getMyDBControll (line 1092)
void &getMyDBControll ([ $debug = False])
  • $debug
getMyDBRow (line 1542)
array() getMyDBRow ([boolean $debug = False])
  • boolean $debug
getMyJsId (line 1191)

if empty($this->my_jsId) it is set

  • return: (the js id of the form)
  • version: pk-08-09-23
string getMyJsId ()
getMyTblObj (line 1277)
  • requires: common/pcf_templates.phpinc
DBMS_TABLEOBJ &getMyTblObj ([boolean $force = False], [boolean $debug = False])
  • boolean $force: (if False only $this->myTblObj is returned else it tries to instantiate a new object)
  • boolean $debug

Redefined in descendants as:
getName (line 1173)
string getName ()
getNofBlocks (line 2222)

returns the number of blocks

void getNofBlocks ([boolean $debug = False])
  • boolean $debug
getNofFields (line 2665)

returns the number of fields in the form

void getNofFields ([int $mode = -1], [boolean $debug = False])
  • int $mode
  • boolean $debug
getObjectVar (line 1126)

returns the value of an object variable

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

returns the pass-through fields array

  • access: public
$this->myPassThroughFields; getPassThroughFields ()
getPKFields (line 2935)

returns an array with the primary key fields

  • since: pk-08-10-03
  • access: public
array getPKFields ([string $aTable = ""], [boolean $debug = False])
  • string $aTable
  • boolean $debug
getReloadUri (line 3217)

returns the relaod url

  • since: pk-07-08-21
string getReloadUri ([boolean $debug = False])
  • boolean $debug
getSubmitAction (line 1389)

get main commands of the form

used keywords:

  • js: execute a java script
  • default: open url

  • access: public
string getSubmitAction (int $mode, [string $type = 'ACTION'])
  • int $mode
  • string $type: ([ACTION|NEXT|RELOAD])
getTables (line 2065)
  • access: public
array getTables ()
getTblObjClass (line 1368)
string getTblObjClass ()
getTblObjInc (line 1339)

returns the include file for the table object class

string getTblObjInc ([boolean $debug = False])
  • boolean $debug
getTitle (line 1224)

returns the title of the form

  • access: public
string getTitle ()
getView (line 3003)
OCSP_FRMVIEW getView ()
getViewObj (line 3018)

instantiates a new class if $this->myControl not type of $contrClass

NOTE the class must exists or have it's code in __FILE__

OCSP_FRMVIEW &getViewObj ([string $viewClass = "OCSP_FRMVIEW"], [boolean $debug = False])
  • string $viewClass
  • boolean $debug
get_listGroups (line 3654)
  • since: pk-07-10-16
array get_listGroups ()
hasErrors (line 3745)

returns if the form has errors

void hasErrors ()
hideField (line 2915)

set a field hidden

  • since: pk-04-03-08
void hideField (string $aFldName, [string $aTable = ""], [string $scope = "all"], [int $aBlockId = -1], [boolean $debug = False])
  • string $aFldName
  • string $aTable
  • string $scope: @see DBMS_FIELD::setHidden()
  • int $aBlockId
  • boolean $debug
importFromArray (line 1767)

imports the form from an array NOTE: does not save the form

  • access: public
void importFromArray (array $impArray, [boolean $debug = False])
  • array $impArray
  • boolean $debug
initCheckSubmitData (line 3308)
  • abstract: for child objects to init on checkSubmitData
void initCheckSubmitData (array $frmSettings, string $dataArrName, array $frmValues, [boolean $debug = False])
  • array $frmSettings
  • string $dataArrName
  • array $frmValues
  • boolean $debug

Redefined in descendants as:
linkBlock (line 2432)

link a block from an other form

  • todo: OCSP_FORM::linkBlock() inline SQL
boolean linkBlock (int $blockId, [boolean $debug = False])
  • int $blockId
  • boolean $debug
loadBlocksFromDb (line 2585)

loads the form blocks from the database into $this::myBlocks

  • todo: OCSP_FORM::loadBlocksFromDb() only Class OCSP_FORM_BLOCK is implemented
  • access: protected
void loadBlocksFromDb ([boolean $debug = False])
  • boolean $debug
loadFieldDescFromCache (line 1987)
void loadFieldDescFromCache ([boolean $debug = False])
  • boolean $debug
loadFromDb (line 1603)

returns a new form form the database

  • global: $OCSP_OBJ $OCSP_OBJ:
  • todo: load revision
  • access: public
OSCP_FORM_BASIC &loadFromDb ([int $aId = 0], [string $aName = ""], [float $revision = 0.0], boolean $debug)
  • int $aId
  • string $aName
  • boolean $debug
  • float $revision
loadFromFileCache (line 1838)

returns a new form from the file cache

  • global: $OCSP_OBJ $OCSP_OBJ:
  • requires: pcf_templates.phpinc
  • access: protected
OCSP_FORM loadFromFileCache ([int $aId = 0], [string $aName = ""], float $revision, boolean $debug)
  • int $aId
  • string $aName
  • boolean $debug
  • float $revision
prepareList (line 3522)

settings:

  • (OCSP_FRMVIEW_LIST) VIEWOBJ
  • (string) VIEWCLASS

  • (OCSP_FRMCONTR_LIST) CONTROBJ
  • (string) CONTRCLASS
  • (string) LISTQUERY
  • (array) FILTER
  • (int) OFFSET
  • (int) LIMIT
  • (array) LSTGROUPS
  • (string) ORDERBY
  • (array) CONTRROWCMD
  • (array) CONTRBUTTONS (['C'] => command ['I'] => icon tag)
  • (array) FOOTERCMDS (['name'] => html)

  • return: (number of rows to show)
  • version: pk-08-01-22
  • version: pk-08-01-28 (CONTRROWCMD,CONTRBUTTONS added)
int prepareList (array $settings, [boolean $debug = False])
  • array $settings: (array of settings to list view and controll)
  • boolean $debug
registerTable (line 2117)

register a table for use with the form

unlicke add table the columns are not loaded

  • since: pk-08-10-31
  • access: public
void registerTable (string $aTable)
  • string $aTable
removeTable (line 2133)

removes a table an all table columns from the form

void removeTable (string $aTable, [boolean $debug = False])
  • string $aTable
  • boolean $debug
rightsAreSet (line 3856)
  • access: public
void rightsAreSet ()
setAjaxDisableChangeForm (line 1419)
  • access: public
void setAjaxDisableChangeForm ( $to)
  • $to
setControl (line 3174)

sets a control

NOTE also changes the controll in $this->myView and sets the view in $aControll if $sync is True

  • access: public
void setControl ( &$aControl, [boolean $sync = True], [boolean $debug = False], OCSP_FRMCONTR $aControl)
  • OCSP_FRMCONTR $aControl
  • boolean $sync
  • boolean $debug
  • &$aControl
setControll (line 3201)

alias for setControl

  • deprecated: since pk-08-12-03
  • access: public
void setControll ( &$aControl, [boolean $sync = True], [boolean $debug = False], OCSP_FRMCONTR $aControl)
  • OCSP_FRMCONTR $aControl
  • boolean $sync
  • boolean $debug
  • &$aControl
setDBObj (line 1063)
void setDBObj ( &$dbObj, [boolean $debug = False], OCSP_DB $dbObj)
  • OCSP_DB $dbObj
  • boolean $debug
  • &$dbObj

Redefinition of:
OCSP_OBJ::setDBObj()
sets the database object (link)
setError (line 3759)

adds an error to this::errors

void setError (mixed $aError, [string $fld = ""], [boolean $debug = False])
  • mixed $aError: either an array with LABEL and MSG values or only the message if empty only $this->errors['ERROR'] is set to True
  • string $fld
  • boolean $debug
setFrmMode (line 1436)
  • since: pk-05-11-04
void setFrmMode (int $mode)
  • int $mode
setId (line 1155)
  • since: pk-08-01-30
void setId (int $aId)
  • int $aId
setLayoutField (line 2962)
void setLayoutField (string $key, string $value)
  • string $key
  • string $value
setMasterTable (line 2045)
void setMasterTable ( $aTbl)
  • $aTbl
setMyDBControll (line 1073)
  • access: public
void setMyDBControll (OCSP_FORM_DBCONTROLL &$aDB_CONTROLL)
setMyDBRow (line 1483)
void setMyDBRow (array $aRow, [boolean $debug = False])
  • array $aRow
  • boolean $debug
setMyJsId (line 1203)
void setMyJsId (string $aId)
  • string $aId
setMyTblObj (line 1248)

links a table object with the form

void setMyTblObj ( &$tblObj, [boolean $debug = False], DBMS_TABLE_OBJ $tblObj)
  • DBMS_TABLE_OBJ $tblObj
  • boolean $debug
  • &$tblObj

Redefined in descendants as:
setName (line 1181)
void setName (string $aName)
  • string $aName
setSubmitAction (line 1413)

sets a main cmmonad of the form

used keywords:

  • js: execute a java script
  • default: open url

  • access: public
string setSubmitAction (int $mode, string $uri, [string $type = 'ACTION'])
  • int $mode
  • string $uri
  • string $type: ([ACTION|NEXT|RELOAD])
setTblObjClass (line 1358)
void setTblObjClass (string $className, [ $debug = False])
  • string $className
  • $debug
setTblObjFromSubmitData (line 3328)

sets the tableobject class and include from $dataArr and tries to instantiate by calling $this->getMyTblObj

if class is set in $dataArr and it could not be instantiated False is returned else True is returned

  • since: pk-07-12-05
boolean setTblObjFromSubmitData ( &$dataArr, [boolean $debug = False], array $dataArr)
  • array $dataArr: (normaly $_POST)
  • boolean $debug
  • &$dataArr

Redefined in descendants as:
setTblObjInc (line 1326)
void setTblObjInc (string $incFile, [ $debug = False])
  • string $incFile
  • $debug
storeToDb (line 1676)

stores a form object and all depending objects (blocks and fields) to the database

  • access: public
void storeToDb ([boolean $debug = False])
  • boolean $debug
writeFieldDescToCache (line 2003)

writes field definition array (T_DBMS_FIELDDESC) to the cache

and populated

  • $GLOBALS['DBMS_FIELD_CLASSES']
  • $GLOBALS['DBMS_FIELD_DESC']

  • deprecated: since pk-08-06-13
void writeFieldDescToCache ([boolen $debug = False])
  • boolen $debug
writeToFileCache (line 1928)

writes the object to the file cache

  • global: $OCSP_CONF $OCSP_CONF:
  • requires: pcf_directory.phpinc
  • access: protected
void writeToFileCache (boolean $debug)
  • boolean $debug

Inherited Methods

Inherited From OCSP_OBJ

 OCSP_OBJ::castObj()
 OCSP_OBJ::cloneMe()
 OCSP_OBJ::currentUser()
 OCSP_OBJ::dbConnect()
 OCSP_OBJ::defaultDBObj()
 OCSP_OBJ::defaultReadDBObj()
 OCSP_OBJ::defaultWriteDBObj()
 OCSP_OBJ::getConf()
 OCSP_OBJ::getDBObj()
 OCSP_OBJ::get_myClassConstant()
 OCSP_OBJ::get_myObject_vars()
 OCSP_OBJ::get_mySourceFile()
 OCSP_OBJ::isConnected()
 OCSP_OBJ::isMultiByteStr()
 OCSP_OBJ::isUTF8()
 OCSP_OBJ::setConf()
 OCSP_OBJ::setDBObj()
 OCSP_OBJ::set_myObject_vars()
 OCSP_OBJ::set_myVarsFrom()
Class Constants
CLASS_SRC_FILE = __FILE__ (line 62)
FORM_CACHE_DIR = "form_cache" (line 67)
FORM_CACHE_FILEEXT = ".frm.cache" (line 72)

Inherited Constants

Inherited from OCSP_OBJ

OCSP_OBJ::CLASS_SRC_FILE

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