Class OCSP_FRMCONTR

Description

class OCSP_FRMCONTR

  • author: Peter Krebs (pk) <pitlinz@users.sourceforge.net>
  • version: $Id: OCSP_FRMCONTR.phpclass,v 1.33 2008/12/17 16:28:51 peterkrebs Exp $
  • version: pk-08-01-21 // extends OCSP_OBJ
  • requires: common/pcf_templates.phpinc
  • since: pk-07-06-30
  • project: Open CSP-Management
  • license: GNU Public License

Located in /db/forms/OCSP_FRMCONTR.phpclass (line 38)

OCSP_OBJ
   |
   --OCSP_FRMCONTR
Direct descendents
Class Description
 class OCSP_FRMCONTR_LIST class OCSP_FRMCONTR_LIST
 class OCSP_FRMCONTR_FORM class OCSP_FRMCONTR_FORM
Variable Summary
Method Summary
 OCSP_FRMCONTR __construct ([ &$aForm = NULL], [boolean $debug = False], OCSP_FORM $aForm)
 void addFilter (string $key, mixed $value)
 boolean checkRights (int $mode, [mixed $aUser = 0], [boolean $debug = False])
 string getActionURL ([boolean $debug = False])
 OCSP_AJAX &getAjaxObj ([boolean $force = False])
 array &getCurrentRow ()
 array &getCurRow ()
 mixed getCurValue (string $aColumn)
 OCSP_DB &getDBObj ([boolean $debug = False])
 array getFilter ()
 array getObjectValues ([boolean $debug = False])
 string getReloadUrl ()
 unknown &getView ()
 string jOCSP_getfrmHash ()
 void jOCSP_setfrmHash (string $aHash)
 string parseFieldTmpl ( &$aField, string $aTemplate, [boolean $debug = False], DBMS_FIELD $aField)
 string parseRowTmpl (string $aTmpl, [boolean $debug = False])
 boolean populateRow ([array $filterAdd = NULL], [boolean $debug = False])
 boolean rowIsPopulated ()
 boolean saveCurRow (boolean $debug)
 void setActionURL (string $aAction)
 void setAjaxObj ( &$ajaxObj, OCSP_AJAX $ajaxObj)
 void setCommand (string $aCmdName, int $aType, string $cmdCode, [string $aBlockName = '_FORM_'])
 void setCurRow (array $aRow, [boolean $debug = False])
 void setCurRowValue (string $colName, mixed $value, [boolean $debug = False])
 void setFilter (array $aFilter)
 void setMyForm ( &$aForm, OCSP_FORM $aForm)
 void setObjectValues (array $objVals, [boolean $debug = False])
 void setReloadUrl (string $aUrl)
 void setView ( &$aView, OCSP_FRMVIEW $aView)
 void set_userCanShowMethod (string $methodName)
 void unsetFilter (string $key)
 boolean validateBlockSubmit (OCSP_FORM_BLOCK $aBlock, array $data, boolean $debug)
 boolean validateSubmit (int $mode, array $data, [boolean $debug = False])
Variables
int $checkRights_hasDBRightsSet = -1 (line 115)

only used in checkRights() must not be used outside

  • var: (we have group entries in T_DBMS_FORMRIGHTS);
  • access: protected
array $checkRights_userRights = array() (line 108)

only used in checkRights() must not be used outside

  • var: (array for each user)
  • access: protected
array $curRow = array() (line 72)
  • access: protected
string $myActionURL = "" (line 90)
  • access: protected
array $myCommands = array() (line 84)
  • access: protected
OCSP_DB $myDBObj (line 58)
  • deprecated: since pk-08-08-18 use OCSP_OBJ db ojbects
  • access: protected

Redefinition of:
OCSP_OBJ::$myDBObj
array $myFilter = array() (line 66)
  • access: protected
OCSP_FORM $myForm = Null (line 50)
  • access: protected
string $myjOCSPHash = "" (line 131)

hash key to identify the form in jOCSP

  • since: pk-08-01-31
  • access: protected
string $myReloadUrl (line 101)

url to submit the form on reload

Note: $this->myForm->getSubmitAction($this->myForm->getFrmMode(),'RELOAD') overrules this setting

  • since: pk-08-06-14
  • access: protected
OCSP_FRMVIEW $myView = NULL (line 139)
  • access: protected
double $rowPopulateTS (line 78)
  • access: protected
string $userCanShowMethod = "userCanShow" (line 123)

if the form has a table object this method is called to check if a user has the rights

to show the values

  • access: protected

Inherited Variables

Inherited from OCSP_OBJ

OCSP_OBJ::$global_currentUser
OCSP_OBJ::$global_defaultDBObj_read
OCSP_OBJ::$global_defaultDBObj_write
OCSP_OBJ::$staticClassVars
Methods
Constructor __construct (line 152)
OCSP_FRMCONTR __construct ([ &$aForm = NULL], [boolean $debug = False], OCSP_FORM $aForm)

Redefined in descendants as:
addFilter (line 227)
  • access: public
void addFilter (string $key, mixed $value)
  • string $key
  • mixed $value
checkRights (line 960)

checks the user rights form the database

  • todo: OCSP_FRMCONTR::checkRights => use cache
  • requires: user/OCSP_USER.phpclass
  • access: public
boolean checkRights (int $mode, [mixed $aUser = 0], [boolean $debug = False])
  • int $mode
  • mixed $aUser: (int) userId or (OCSP_USER) a user if 0 $GLOBALS['OCSP_OBJ']['USER'] is used
  • boolean $debug
getActionURL (line 315)

returns the action URL if set otherwise the default action for $this->myForm->getFrmMode()

  • global: $OCSP_CONF $OCSP_CONF:
  • version: pk-08-02-07
string getActionURL ([boolean $debug = False])
  • boolean $debug

Redefined in descendants as:
getAjaxObj (line 398)
  • since: pk-07-09-18
  • access: public
OCSP_AJAX &getAjaxObj ([boolean $force = False])
  • boolean $force: (the instantiation of a new object)
getCurrentRow (line 570)

returns the array of the current select DB values

  • deprecated: since pk-08-01-14 (use getCurRow() instead)
array &getCurrentRow ()
getCurRow (line 582)

returns the array of the current select DB values

  • since: pk-08-01-14
array &getCurRow ()
getCurValue (line 596)

returns a column value of the current row

  • since: pk-08-02-08
mixed getCurValue (string $aColumn)
  • string $aColumn
getDBObj (line 452)

returns the db object from the form

OCSP_DB &getDBObj ([boolean $debug = False])
  • boolean $debug

Redefinition of:
OCSP_OBJ::getDBObj()
allowed modes are:
getFilter (line 218)
  • since: pk-08-06-05
  • access: public
array getFilter ()
getMyForm (line 174)
OCSP_FORM &getMyForm ()
getObjectValues (line 255)

returns all values of the object

  • access: public
array getObjectValues ([boolean $debug = False])
  • boolean $debug
getReloadUrl (line 359)

returns a reload url if set either in form or with setReloadUrl

the reload url is set when a (select) field change requires to reload the form. in this case the form is sent to the url as ajax request which returns a java script

settings stored in $this->myForm->getSubmitAction overwrites $this->myReloadUrl

  • version: pk-08-06-14
  • since: pk-08-02-07
  • access: public
string getReloadUrl ()
getView (line 192)

returns the current view

unknown &getView ()
jOCSP_getfrmHash (line 415)

returns a hash to identify the form if not set a new one is generated

  • since: pk-08-01-31
  • access: public
string jOCSP_getfrmHash ()
jOCSP_setfrmHash (line 436)

sets myjOCSPHash

  • access: public
void jOCSP_setfrmHash (string $aHash)
  • string $aHash
parseFieldTmpl (line 635)
  • requires: common/pcf_templates.phpinc
string parseFieldTmpl ( &$aField, string $aTemplate, [boolean $debug = False], DBMS_FIELD $aField)
  • DBMS_FIELD $aField
  • string $aTemplate
  • boolean $debug
  • &$aField
parseRowTmpl (line 619)

returns a template parsed with the current row

  • requires: pcf_templates.phpinc
string parseRowTmpl (string $aTmpl, [boolean $debug = False])
  • string $aTmpl
  • boolean $debug
populateRow (line 484)

populates one row from the database this is the first row fitting $this->myFilter

  • todo: for more than one table
boolean populateRow ([array $filterAdd = NULL], [boolean $debug = False])
  • array $filterAdd
  • boolean $debug

Redefined in descendants as:
rowIsPopulated (line 467)
boolean rowIsPopulated ()
saveCurRow (line 830)

save the row to the database

boolean saveCurRow (boolean $debug)
  • boolean $debug

Redefined in descendants as:
setActionURL (line 299)
void setActionURL (string $aAction)
  • string $aAction: URL to send the form to
setAjaxObj (line 387)
  • since: pk-07-09-18
  • access: public
void setAjaxObj ( &$ajaxObj, OCSP_AJAX $ajaxObj)
setCommand (line 287)
void setCommand (string $aCmdName, int $aType, string $cmdCode, [string $aBlockName = '_FORM_'])
  • string $aCmdName
  • int $aType: (_OCSP_FRMCMDTYPE_...)
  • string $cmdCode
  • string $aBlockName
setCurRow (line 511)

sets the current row from outside

  • access: public
void setCurRow (array $aRow, [boolean $debug = False])
  • array $aRow
  • boolean $debug
setCurRowValue (line 531)

sets a value in $this-curRow

if (!$this->rowIsPopulated()) this->populateRow() is called before setting the value

void setCurRowValue (string $colName, mixed $value, [boolean $debug = False])
  • string $colName
  • mixed $value
  • boolean $debug
setFilter (line 208)
void setFilter (array $aFilter)
  • array $aFilter
setMyForm (line 182)
void setMyForm ( &$aForm, OCSP_FORM $aForm)
setObjectValues (line 273)
  • access: public
void setObjectValues (array $objVals, [boolean $debug = False])
  • array $objVals
  • boolean $debug
setReloadUrl (line 377)
  • since: pk-08-06-14
  • access: public
void setReloadUrl (string $aUrl)
  • string $aUrl: Note: $this->myForm->getSubmitAction overrules $this->myReloadUrl
setView (line 200)
void setView ( &$aView, OCSP_FRMVIEW $aView)
set_userCanShowMethod (line 1058)

if the form has a tableobject class getRowValue calls this method to check if the current user is allowed to see the row

NOTE: this leads to errors in counting as nofRows returns the size of the list

  • access: public
void set_userCanShowMethod (string $methodName)
  • string $methodName
unsetFilter (line 239)

removes a filter value from the current filter

  • since: pk-08-06-05
  • access: public
void unsetFilter (string $key)
  • string $key
validateBlockSubmit (line 738)

validates the block fields

  • version: pk-08-01-10
boolean validateBlockSubmit (OCSP_FORM_BLOCK $aBlock, array $data, boolean $debug)
validateSubmit (line 658)
  • requires: $GLOBALS['OCSP']['PHPINCPATH']."common/pcf_md5.phpinc"
boolean validateSubmit (int $mode, array $data, [boolean $debug = False])
  • int $mode
  • array $data
  • boolean $debug

Redefined in descendants as:

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

Inherited Constants

Inherited from OCSP_OBJ

OCSP_OBJ::CLASS_SRC_FILE

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