Class DBMS_FIELD_MEDIA

Description

handles foreign keys to media files

  • author: Peter Krebs (pk) <p.krebs@lvus.at>
  • version: $Id: DBMS_FIELD_FOREIGNKEY.phpclass,v 1.18 2008/12/03 21:32:40 pitlinz Exp $
  • version: pk-06-08-09
  • version: pk-06-10-05 nullToZero added
  • version: pk-07-08-31
  • copyright: (c) 2002-2005 by LVUS <http://opencsp.lvu.at>
  • project: Open CSP-Management
  • license: GNU Public License

Located in /db/frmClasses/DBMS_FIELD_MEDIA.phpclass (line 31)

DBMS_FIELD
   |
   --DBMS_FIELD_SELECTLIST
      |
      --DBMS_FIELD_DBSELECTLIST
         |
         --DBMS_FIELD_DBLOOKUPSELECTLIST
            |
            --DBMS_FIELD_FOREIGNKEY
               |
               --DBMS_FIELD_MEDIA
Variable Summary
Method Summary
 void DBcheckEditInput ( $str)
 void echoAddButton ([string $arrName = "DBVAL"])
 void echoReloadButton ([ $arrName = "DBVAL"])
 bool echoSelect ([mixed $aValue = ""], [string $arrName = "DBVAL"], [bool $debug = False])
 void echoSelectOptionLst ([mixed $aValue = ""], [bool $debug = False])
 void echoSelectStart ( $arrName)
 void echoZoomButton ([ $arrName = "DBVAL"])
 void editTblForm ([bool $showSize = False], [bool $showSortFld = False], [bool $showDBFld = False], [ $showNewEdit = False])
 string getListLink (mixed $aValue, [string $arrName = "DBVAL"])
 void getScreenValue ( $aValue, [ $arrName = "DBVAL"], [ $debug = False])
 void getSelectStmt ([ $debug = False])
 string getValue (string $aValue,  &$err, [string $arrName = "DBVAL"], [bool $debug = False], array $err)
 void getWhereStmt ([ $arrName = "DBVAL"], [ $append = ""], [ $debug = False])
 bool save ([ $debug = False])
 string searchWhere (array $aArr, [bool $debug = False])
 string slashedValue (string $aValue,  &$err, [string $arrName = "DBVAL"], [bool $debug = False], array $err)
 True writeField (int $mode, [mixed $aValue = ""], [string $arrName = "DBVAL"], [boolean $debug = False])
 void writeSearchCompTypes ( $arrName)
Variables
mixed $allowNullSelect = False (line 37)
mixed $className = "MEDIAFILE" (line 32)
string $classSrcFile = __FILE__ (line 48)

source file of the class

  • since: pk-05-02-19

Redefinition of:
DBMS_FIELD_FOREIGNKEY::$classSrcFile
source file of the class
mixed $defaultMEC_ID (line 40)
mixed $foreignTbl = "T_MED_FILES" (line 33)
mixed $keyField = "MEF_ID" (line 35)
mixed $rootMEC_ID (line 39)
mixed $showField = "CONCAT(MEF_NAME,' (',MEC_ID,'/',MEF_ID,')')" (line 34)
mixed $sortField = "MEF_NAME" (line 36)

Inherited Variables

Inherited from DBMS_FIELD_FOREIGNKEY

DBMS_FIELD_FOREIGNKEY::$checkWhereAnd
DBMS_FIELD_FOREIGNKEY::$editEnableInList
DBMS_FIELD_FOREIGNKEY::$editFormId
DBMS_FIELD_FOREIGNKEY::$editUrl
DBMS_FIELD_FOREIGNKEY::$myLayerDivClass
DBMS_FIELD_FOREIGNKEY::$myLayerDivStyle
DBMS_FIELD_FOREIGNKEY::$myURIQueryArrgs
DBMS_FIELD_FOREIGNKEY::$newEditAsAjax
DBMS_FIELD_FOREIGNKEY::$newFormId
DBMS_FIELD_FOREIGNKEY::$newUrl
DBMS_FIELD_FOREIGNKEY::$popupWndHeight
DBMS_FIELD_FOREIGNKEY::$popupWndWidth

Inherited from DBMS_FIELD_DBLOOKUPSELECTLIST

DBMS_FIELD_DBLOOKUPSELECTLIST::$allowAddValues
DBMS_FIELD_DBLOOKUPSELECTLIST::$allowEditValues
DBMS_FIELD_DBLOOKUPSELECTLIST::$lookupField
DBMS_FIELD_DBLOOKUPSELECTLIST::$lookupShowField
DBMS_FIELD_DBLOOKUPSELECTLIST::$lookupShowLstField
DBMS_FIELD_DBLOOKUPSELECTLIST::$lookupSort
DBMS_FIELD_DBLOOKUPSELECTLIST::$lookupTable
DBMS_FIELD_DBLOOKUPSELECTLIST::$lookupWhere

Inherited from DBMS_FIELD_DBSELECTLIST

DBMS_FIELD_DBSELECTLIST::$classCache
DBMS_FIELD_DBSELECTLIST::$classValPopulateTs
DBMS_FIELD_DBSELECTLIST::$query

Inherited from DBMS_FIELD_SELECTLIST

DBMS_FIELD_SELECTLIST::$ajax_onChange_FuncName
DBMS_FIELD_SELECTLIST::$extJSxType
DBMS_FIELD_SELECTLIST::$lstValueIsHtml
DBMS_FIELD_SELECTLIST::$multiselect
DBMS_FIELD_SELECTLIST::$mySeperator
DBMS_FIELD_SELECTLIST::$myValues
DBMS_FIELD_SELECTLIST::$notInLstValues
DBMS_FIELD_SELECTLIST::$nullLabel
DBMS_FIELD_SELECTLIST::$nullToZero
DBMS_FIELD_SELECTLIST::$reloadFormOnChange
DBMS_FIELD_SELECTLIST::$selectAddTag
DBMS_FIELD_SELECTLIST::$selectsize
DBMS_FIELD_SELECTLIST::$showAsCheckRadio
DBMS_FIELD_SELECTLIST::$showNullOption
DBMS_FIELD_SELECTLIST::$showValuesInList
DBMS_FIELD_SELECTLIST::$static_fixedSelSize

Inherited from DBMS_FIELD

DBMS_FIELD::$addTag
DBMS_FIELD::$ajaxDebug
DBMS_FIELD::$ajaxNotifyLst
DBMS_FIELD::$allowNull
DBMS_FIELD::$dbDesc
DBMS_FIELD::$defaultValue
DBMS_FIELD::$enableCopy
DBMS_FIELD::$enableEdit
DBMS_FIELD::$enableEditIfEmpty
DBMS_FIELD::$enableNew
DBMS_FIELD::$errMsg
DBMS_FIELD::$exportCSV
DBMS_FIELD::$extConfOptions
DBMS_FIELD::$fieldtd_add
DBMS_FIELD::$fldDbgGetValue
DBMS_FIELD::$fldDebug
DBMS_FIELD::$hideAddTag_ro
DBMS_FIELD::$hideCopy
DBMS_FIELD::$hideEdit
DBMS_FIELD::$hideNew
DBMS_FIELD::$hideReadOnly
DBMS_FIELD::$inputAdd
DBMS_FIELD::$isHidden
DBMS_FIELD::$isSearchable
DBMS_FIELD::$js_check
DBMS_FIELD::$label
DBMS_FIELD::$labelcol_hide
DBMS_FIELD::$labeltd_add
DBMS_FIELD::$lstColSpan
DBMS_FIELD::$lstDisableLinks
DBMS_FIELD::$lstLabel
DBMS_FIELD::$lstLink
DBMS_FIELD::$lstTDAdd
DBMS_FIELD::$lstWidth
DBMS_FIELD::$maxlength
DBMS_FIELD::$myAjaxObj
DBMS_FIELD::$myBlock
DBMS_FIELD::$myBlockId
DBMS_FIELD::$myControll
DBMS_FIELD::$myCurrentMode
DBMS_FIELD::$myDataArrName
DBMS_FIELD::$myDeleteFlag
DBMS_FIELD::$myDesc
DBMS_FIELD::$myDOMId
DBMS_FIELD::$myForm
DBMS_FIELD::$myFrmId
DBMS_FIELD::$myGrpKey
DBMS_FIELD::$myHelpUrl
DBMS_FIELD::$myModuleKey
DBMS_FIELD::$myName
DBMS_FIELD::$myTable
DBMS_FIELD::$myTableAlias
DBMS_FIELD::$myView
DBMS_FIELD::$nullErrMsg
DBMS_FIELD::$ps_defaultDataArrName
DBMS_FIELD::$regexcheck_pattern
DBMS_FIELD::$regexErrMsg
DBMS_FIELD::$searchGroup_allowAll
DBMS_FIELD::$showGroup
DBMS_FIELD::$showInList
DBMS_FIELD::$showQasHidden
DBMS_FIELD::$showQuery
DBMS_FIELD::$size
DBMS_FIELD::$sortOrder
DBMS_FIELD::$srcVersion
DBMS_FIELD::$tabIndex
DBMS_FIELD::$toolTip
DBMS_FIELD::$toolTipAsTitle
DBMS_FIELD::$trimValue
Methods
DBcheckEditInput (line 95)
void DBcheckEditInput ( $str)
  • $str

Redefinition of:
DBMS_FIELD_DBLOOKUPSELECTLIST::DBcheckEditInput()
ensures that no ; is in $str used in a sql statements
echoAddButton (line 187)

echos a link to open a new window

as we don't know the keys of the row we add each integer value of the ${$arrName} as get param to the link url

void echoAddButton ([string $arrName = "DBVAL"])
  • string $arrName: name of the GLOBAL array holding the row values
echoReloadButton (line 249)
void echoReloadButton ([ $arrName = "DBVAL"])
  • $arrName
echoSelect (line 337)

echos a select box

is overritten here because echoSelectOptionLst requires an aditional parameter

for $arrName see DBMS_FIELD::writeField()

calls the following functions:

  • calls $this->echoSelectStart()
  • echos NULL option with html code
  • calls $this->SelectOptionLst()
  • echos </select>
  • calls $this->echoAddButton()
  • calls $this->echoReloadButton()

  • return: always True
  • version: pk-03-10-19
bool echoSelect ([mixed $aValue = ""], [string $arrName = "DBVAL"], [bool $debug = False])
  • mixed $aValue: selected value
  • string $arrName: array in Name of the html input form <input name=ARRNAME[FIELDNAME]>
  • bool $debug: show debug info
echoSelectOptionLst (line 289)

echos the select option list

the query is created by:

  1.  $query=$this->getSelectStmt().$this->getWhereStmt();
  2.  if ($this->sortField$query.= " ORDER BY ".$this->sortField;
  3.  else $query .=" ORDER BY SHOWFIELD";
if the query does not return a row the select statement is echoed as html comment (<!-- $query -->)

void echoSelectOptionLst ([mixed $aValue = ""], [bool $debug = False])
  • mixed $aValue: current value to set as selected
  • bool $debug: show debug info
echoSelectStart (line 261)
void echoSelectStart ( $arrName)
  • $arrName
echoZoomButton (line 219)
void echoZoomButton ([ $arrName = "DBVAL"])
  • $arrName
editTblForm (line 59)

show the filed definition form

  • version: pk-03-10-17
void editTblForm ([bool $showSize = False], [bool $showSortFld = False], [bool $showDBFld = False], [ $showNewEdit = False])
  • bool $showSize: show size input
  • bool $showSortFld: show Select-List sortfield input
  • bool $showDBFld: show Table Selector for Foreign TABL and KEY,VALUE input fields
  • $showNewEdit

Redefinition of:
DBMS_FIELD::editTblForm()
show the filed definition form
getListLink (line 549)

get the link url for a list entry

as we don't know the keys of the row we add each integer value of the ${$arrName} as get param to the link url

  • return: empty if no link is to show a <a href=...url..> if the field is linked
  • version: pk-03-10-17
string getListLink (mixed $aValue, [string $arrName = "DBVAL"])
  • mixed $aValue: value of the db field
  • string $arrName: name of the GLOBAL array holding the row values

Redefinition of:
DBMS_FIELD::getListLink()
getScreenValue (line 572)
void getScreenValue ( $aValue, [ $arrName = "DBVAL"], [ $debug = False])
  • $aValue
  • $arrName
  • $debug

Redefinition of:
DBMS_FIELD_DBLOOKUPSELECTLIST::getScreenValue()
returns the html code for the readonly field
getSelectStmt (line 146)
void getSelectStmt ([ $debug = False])
  • $debug
getValue (line 600)

returns the field value if the referenzed row exists

  • version: pk-03-12-13
  • since: pk-03-12-13
string getValue (string $aValue,  &$err, [string $arrName = "DBVAL"], [bool $debug = False], array $err)
  • string $aValue: the value
  • array $err: error array
  • string $arrName: name of the array to access fieldsarray gloabl ${$arrName}
  • bool $debug
  • &$err

Redefinition of:
DBMS_FIELD_FOREIGNKEY::getValue()
returns the field value if the referenzed row exists
getWhereStmt (line 154)
void getWhereStmt ([ $arrName = "DBVAL"], [ $append = ""], [ $debug = False])
  • $arrName
  • $append
  • $debug
save (line 112)

save the filed definition form

  • return:
    1. parent::save()
  • version: pk-03-10-17
bool save ([ $debug = False])
  • $debug

Redefinition of:
DBMS_FIELD_FOREIGNKEY::save()
save the filed definition form
searchWhere (line 488)

returns the where statement part for the field

string searchWhere (array $aArr, [bool $debug = False])
  • array $aArr: form input array
  • bool $debug
slashedValue (line 646)

add slashes to the value from getValue to add it to a sql command

  • version: pk-03-12-13
string slashedValue (string $aValue,  &$err, [string $arrName = "DBVAL"], [bool $debug = False], array $err)
  • string $aValue: the value
  • array $err: error array
  • string $arrName: name of the global array to access field gloabl ${$arrName}
  • bool $debug
  • &$err

Redefinition of:
DBMS_FIELD_SELECTLIST::slashedValue()
add slashes to the value from getValue to add it to a sql command
writeField (line 406)

html output of the field

echos the field due to $mode

  • FRM_MODE_READONLY echos $this->getScreenValue() $this->getAddTag()
  • FRM_MODE_LIST echos $this->getScreenValue()
  • FRM_MODE_EDIT calls $this->echoSelect()
  • FRM_MODE_NEW calls $this->echoSelect()
  • FRM_MODE SEARCH outputs
    1.          $this->echoSelectStart($arrName."[VALUE]");
    2.          echo "<option value=\"\">---???---</option>\n";
    3.          if (!$this->allowNullSelect{
    4.              echo "<option value=\"".$this->treeROOTKey."\">".$this->nullLabel."</option>\n";
    5.          }
    6.          $this->echoSelectOptionLst(NULL,$debug);
    7.          echo "</select>\n\n";

  • return: if an input field is written
  • version: pk-03-10-19
  • version: pk-05-09-05
True writeField (int $mode, [mixed $aValue = ""], [string $arrName = "DBVAL"], [boolean $debug = False])
  • int $mode: show mode of the field
  • mixed $aValue: value of the field
  • string $arrName: array in Name of the html input form <input name=ARRNAME[FIELDNAME]> it also needs to be a global array global ${$arrName}
  • boolean $debug: show debug info
writeSearchCompTypes (line 472)
void writeSearchCompTypes ( $arrName)
  • $arrName

Inherited Methods

Inherited From DBMS_FIELD_FOREIGNKEY

 DBMS_FIELD_FOREIGNKEY::editTbl_getFieldEditArr()
 DBMS_FIELD_FOREIGNKEY::editTbl_tableChanged()
 DBMS_FIELD_FOREIGNKEY::getNewBtn()
 DBMS_FIELD_FOREIGNKEY::getValue()
 DBMS_FIELD_FOREIGNKEY::getZoomBtn()
 DBMS_FIELD_FOREIGNKEY::jOCSP_addDetail()
 DBMS_FIELD_FOREIGNKEY::jOCSP_detailFormLayer()
 DBMS_FIELD_FOREIGNKEY::jOCSP_editDetail()
 DBMS_FIELD_FOREIGNKEY::jOCSP_showDetail()
 DBMS_FIELD_FOREIGNKEY::save()
 DBMS_FIELD_FOREIGNKEY::setObjectVars()

Inherited From DBMS_FIELD_DBLOOKUPSELECTLIST

 DBMS_FIELD_DBLOOKUPSELECTLIST::DBcheckEditInput()
 DBMS_FIELD_DBLOOKUPSELECTLIST::editTbl_getFieldEditArr()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getClassCacheKey()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getDBValue()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getInputTag()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getListValue()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getMyValueQuery()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getNewBtn()
 DBMS_FIELD_DBLOOKUPSELECTLIST::getScreenValue()
 DBMS_FIELD_DBLOOKUPSELECTLIST::save()
 DBMS_FIELD_DBLOOKUPSELECTLIST::setMyValues()
 DBMS_FIELD_DBLOOKUPSELECTLIST::_getMyValueWhere()

Inherited From DBMS_FIELD_DBSELECTLIST

 DBMS_FIELD_DBSELECTLIST::editTbl_getFieldEditArr()
 DBMS_FIELD_DBSELECTLIST::getClassCacheKey()
 DBMS_FIELD_DBSELECTLIST::getPopupLinkJs()
 DBMS_FIELD_DBSELECTLIST::jOCSP_reloadOptionLst()
 DBMS_FIELD_DBSELECTLIST::save()
 DBMS_FIELD_DBSELECTLIST::setMyValues()

Inherited From DBMS_FIELD_SELECTLIST

 DBMS_FIELD_SELECTLIST::editTabl_save()
 DBMS_FIELD_SELECTLIST::editTbl_getFieldEditArr()
 DBMS_FIELD_SELECTLIST::getArrayFromString()
 DBMS_FIELD_SELECTLIST::getCheckRadio()
 DBMS_FIELD_SELECTLIST::getExtJSConfigOptions()
 DBMS_FIELD_SELECTLIST::getFormFieldSelect()
 DBMS_FIELD_SELECTLIST::getFormFieldSelectAttributes()
 DBMS_FIELD_SELECTLIST::getInputName()
 DBMS_FIELD_SELECTLIST::getInputTag()
 DBMS_FIELD_SELECTLIST::getListValue()
 DBMS_FIELD_SELECTLIST::getOnChangedTag()
 DBMS_FIELD_SELECTLIST::getOptionList()
 DBMS_FIELD_SELECTLIST::getReloadButton()
 DBMS_FIELD_SELECTLIST::getScreenValue()
 DBMS_FIELD_SELECTLIST::getSearchCompTypes()
 DBMS_FIELD_SELECTLIST::getSearchInputTag()
 DBMS_FIELD_SELECTLIST::getSelectTag()
 DBMS_FIELD_SELECTLIST::getValue()
 DBMS_FIELD_SELECTLIST::jOCSP_getAdditonalFieldObjElems()
 DBMS_FIELD_SELECTLIST::jOCSP_getReloadScript()
 DBMS_FIELD_SELECTLIST::jOCSP_getRequiredModules()
 DBMS_FIELD_SELECTLIST::setMyValues()
 DBMS_FIELD_SELECTLIST::slashedValue()

Inherited From DBMS_FIELD

 DBMS_FIELD::DBMS_FIELD()
 DBMS_FIELD::allowNull()
 DBMS_FIELD::check()
 DBMS_FIELD::editLst_getAdminLstStyle()
 DBMS_FIELD::editLst_getClassSelectOptions()
 DBMS_FIELD::editTblForm()
 DBMS_FIELD::editTbl_echoForm()
 DBMS_FIELD::editTbl_getForm()
 DBMS_FIELD::fldTypeIsUseable()
 DBMS_FIELD::getAddTag()
 DBMS_FIELD::getBlockId()
 DBMS_FIELD::getDataArrName()
 DBMS_FIELD::getDBColName()
 DBMS_FIELD::getDBColType()
 DBMS_FIELD::getDbDefault()
 DBMS_FIELD::getdbDesc()
 DBMS_FIELD::getDebugMode()
 DBMS_FIELD::getDefaultValue()
 DBMS_FIELD::getFieldRow()
 DBMS_FIELD::getFieldRowCols()
 DBMS_FIELD::getFieldTag()
 DBMS_FIELD::getFrmId()
 DBMS_FIELD::getInputTag()
 DBMS_FIELD::getKey()
 DBMS_FIELD::getLabel()
 DBMS_FIELD::getLabelColTag()
 DBMS_FIELD::getListLink()
 DBMS_FIELD::getListLinkArr()
 DBMS_FIELD::getListValue()
 DBMS_FIELD::getLstColSpan()
 DBMS_FIELD::getLstLabel()
 DBMS_FIELD::getLstWidth()
 DBMS_FIELD::getModuleKey()
 DBMS_FIELD::getMyBlock()
 DBMS_FIELD::getMyForm()
 DBMS_FIELD::getMyFormName()
 DBMS_FIELD::getName()
 DBMS_FIELD::getObjectData()
 DBMS_FIELD::getObjectVars()
 DBMS_FIELD::getOrderNr()
 DBMS_FIELD::getScreenValue()
 DBMS_FIELD::getSetting()
 DBMS_FIELD::getShowGroup()
 DBMS_FIELD::getSize()
 DBMS_FIELD::getSourceFile()
 DBMS_FIELD::getTabIndex()
 DBMS_FIELD::getTable()
 DBMS_FIELD::getTblAlias()
 DBMS_FIELD::getToolTip()
 DBMS_FIELD::getType()
 DBMS_FIELD::getValId()
 DBMS_FIELD::get_lstTDAdd()
 DBMS_FIELD::incOrderNr()
 DBMS_FIELD::isAutoInc()
 DBMS_FIELD::isEnabled()
 DBMS_FIELD::isHidden()
 DBMS_FIELD::isLayoutFld()
 DBMS_FIELD::isMarkedDeleted()
 DBMS_FIELD::isPrimaryKey()
 DBMS_FIELD::isReadOnlyShown()
 DBMS_FIELD::isSearchable()
 DBMS_FIELD::isToShow()
 DBMS_FIELD::labelIsHidden()
 DBMS_FIELD::lstLinksDisabled()
 DBMS_FIELD::markDeleted()
 DBMS_FIELD::markUnDeleted()
 DBMS_FIELD::save()
 DBMS_FIELD::setDataArrName()
 DBMS_FIELD::setdbDesc()
 DBMS_FIELD::setFieldVar()
 DBMS_FIELD::setFrmId()
 DBMS_FIELD::setHidden()
 DBMS_FIELD::setLabel()
 DBMS_FIELD::setModuleKey()
 DBMS_FIELD::setMyBlock()
 DBMS_FIELD::setMyForm()
 DBMS_FIELD::setName()
 DBMS_FIELD::setObjectVars()
 DBMS_FIELD::setObjVarsFrom()
 DBMS_FIELD::setOrderNr()
 DBMS_FIELD::setShown()
 DBMS_FIELD::setTable()
 DBMS_FIELD::setTblAlias()
 DBMS_FIELD::showInList()
Class Constants

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