Source for file DBMS_FIELD_DBCOLSELECTLIST.phpclass

Documentation is available at DBMS_FIELD_DBCOLSELECTLIST.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_DBCOLSELECTLIST.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   string
  8.   *
  9.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   ***/
  13.  
  14. require_once dirname(__FILE__)._OCSP_DIRSEP_."DBMS_FIELD_SELECTLIST.phpclass";
  15.  
  16. /**
  17.   * Class DBMS_FIELD_DBCOLSELECTLIST
  18.   *
  19.   * handles file upload
  20.   *
  21.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  22.   * @author     Christian Gaisberger <c.gaisberger@lvus.at>
  23.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  24.   *
  25.   * @since pk-06-02-06
  26.   * @version pk-06-09-11 $this->tblFilter as cvs
  27.   * @version pk-07-03-05 ajax
  28.   *
  29.   * @todo DBMS_FIELD_DBCOLSELECTLIST use $myForm->getDBObj for database handle
  30.   *
  31.   ***/
  32.     /**
  33.       * source file of the class
  34.       *
  35.       * @var string $classSrcFile 
  36.       * @since pk-04-10-05
  37.       ***/
  38.     protected $classSrcFile=__FILE__;
  39.     
  40.     var $allowNullSelect = FALSE;
  41.  
  42.     /**
  43.       * filter of the table names
  44.       * @var string $tblFilter 
  45.       * @access protected
  46.       ***/
  47.     protected $tblFilter       = "";
  48.     
  49.     /**
  50.       * @var string $myTblField formfield contains the table
  51.       * @since pk-07-03-05
  52.       * @access protected
  53.       ***/
  54.     protected $myTblField = "";
  55.       
  56.     /**
  57.       * the default table
  58.       * @var string $defaultTbl 
  59.       * @access protected
  60.       ***/
  61.     protected $defaultTbl      = "";
  62.     
  63.     /**
  64.       * user is allowed to change table
  65.       * @var boolean $allowChangeTbl 
  66.       * @access protected
  67.       ***/
  68.     protected $allowChangeTbl  = FALSE;
  69.     
  70.     /**
  71.       * return tableNAME.columnNAME if true else columnNAME
  72.       * @var boolean $addTblName 
  73.       * @access protected
  74.       ***/
  75.     protected $addTblName     = FALSE;
  76.  
  77.     // ###########################################################
  78.     // FIELD DEFINITION DATA METHODS
  79.     // ###########################################################
  80.  
  81.     /**
  82.       * returns an array of field to bie shown in the edit form
  83.       * by using editTbl_echoForm
  84.       *
  85.       * the array is in the form:
  86.       *
  87.       * <code>
  88.       * [_sectionName_]
  89.       *      [TITLE] -> string
  90.       *      [_rowName_]
  91.       *         [FLDLAB]  (complete html code with <td></td>)
  92.       *         [FLDVAL] (complete html code with <td></td>)
  93.       * </code>
  94.       *
  95.       * @param boolean $debug 
  96.       *
  97.       * @returns array
  98.       *
  99.       * @since pk-06-08-11
  100.       *
  101.       ***/
  102.     function editTbl_getFieldEditArr($debug=FALSE{
  103.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DBSELECTLIST::editTbl_getFieldEditArr","",0);
  104.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  105.  
  106.         unset($a_ret['SELECT']['FLD_LSTVALISHTML']);
  107.         unset($a_ret['SELECT']['FLD_LSTVALS']);
  108.  
  109.         $a_ret['DB_TABLE']=array(
  110.             'TITLE'=>"Tabelle",
  111.             'FLD_TBLFIELD'=>array('ISHIDDEN'=>TRUE),
  112.             'FLD_FILTER'=>array(
  113.                 'FLDLAB'=>"Default Tabelle",
  114.                 'FLDVAL'=>"<input name=\"tblFilter\" value=\"".$this->tblFilter."\" size=\"40\" />"
  115.             ),
  116.             'FLD_DEFAULTTBL'=>array(
  117.                 'FLDLAB'=>"Tabellenfilter (durch Komma getrennt)"
  118.             ),
  119.             'FLD_ALLOWCHGTBL'=>array(
  120.                 'FLDLAB'=>"Tabelle wechseln",
  121.                 'FLDVAL'=>"<input type=\"checkbox\" name=\"allowChangeTbl\" value=\"1\" ".($this->allowChangeTbl ? "checked" "")." /> erlauben"
  122.             ),
  123.             'FLD_ADDTBLNAME'=>array(
  124.                 'FLDLAB'=>"Tabellenname mitspiechern",
  125.                 'FLDVAL'=>"
  126.                         <input type=\"radio\" value=\"1\" name=\"addTblName\" ".($this->addTblName ? "checked=\"checked\"" "")." /> ja (TABLE.COLUMN speichern)<br />
  127.                         <input type=\"radio\" value=\"0\" name=\"addTblName\" ".($this->addTblName ? "" "checked=\"checked\"")." /> nein (COLUMN speichern)<br />
  128.                     "
  129.             )
  130.         );
  131.  
  132.         // <pk-07-03-05> get table fields 
  133.         $this->getMyForm();
  134.         $a_flds=$this->myForm->getFieldArr(TRUE);
  135.         $a_tblFields=array();
  136.         foreach($a_flds as &$o_fld{
  137.             if ($debugecho "<p>".get_class($o_fld)."</p>";
  138.             if (pcf_is_instance_of($o_fld,'DBMS_FIELD_DBTBLLIST')) {
  139.                 if ($debugecho "<p><b>Feld gefunden: ".$o_fld->getKey()."</b></p>";
  140.                 $a_tblFields[]=$o_fld;
  141.             }
  142.         }
  143.         
  144.         if (sizeof($a_tblFields)) {
  145.             $a_ret['DB_TABLE']['FLD_TBLFIELD']['ISHIDDEN']=FALSE;
  146.             $a_ret['DB_TABLE']['FLD_TBLFIELD']['FLDLAB']="Tabellenfeld";
  147.             $s_tag ="<select name=\"myTblField\" onChange=\"if (this.options[this.options.selectedIndex].value != '') {";
  148.             
  149.             $s_tag.="this.form.tblFilter.defaultValue=this.form.tblFilter.value;";
  150.             $s_tag.="this.form.tblFilter.value='-- vom Tabellen Feld --';";
  151.             
  152.             $s_tag.="this.form.defaultTbl.defaultIndex=this.form.defaultTbl.options[this.form.defaultTbl.options.selectedIndex];";
  153.             $s_tag.="this.form.defaultTbl.options[0].text='-- Tabellen Feld verwenden --';";
  154.             $s_tag.="this.form.defaultTbl.options.selectedIndex=0;";
  155.             
  156.             $s_tag.="} else {";
  157.             
  158.             $s_tag.="this.form.tblFilter.value=this.form.tblFilter.defaultValue;";
  159.             $s_tag.="this.form.defaultTbl.options[0].text='-- ??? --';";
  160.             $s_tag.="this.form.defaultTbl.options.selectedIndex=this.form.defaultTbl.defaultIndex;";
  161.             
  162.             $s_tag.="}\">\n";
  163.             $s_tag.="<option value=\"\">--- ??? ---</option>\n";
  164.             foreach($a_tblFields as $o_fld{
  165.                 $s_tag.="<option value=\"".$o_fld->getKey()."\" ".(($this->myTblField == $o_fld->getKey()) " selected=\"selected\"" "").">".$o_fld->getLabel()." (".$o_fld->getName().")</option>\n";
  166.             }
  167.             $s_tag.="</select>";
  168.             $a_ret['DB_TABLE']['FLD_TBLFIELD']['FLDVAL']=$s_tag;
  169.         }
  170.  
  171.         // </pk-07-03-05
  172.  
  173.         $a_ret['DB_TABLE']['FLD_DEFAULTTBL']['FLDVAL'="<select name=\"defaultTbl\" size=\"1\">\n";
  174.         $a_ret['DB_TABLE']['FLD_DEFAULTTBL']['FLDVAL'].="<option value=\"\">--- ??? ---</option>\n";
  175.         $a_tables=$GLOBALS['USRDB']->getDBTblList();
  176.         foreach($a_tables as $s_tbl{
  177.             $s_opt="<option value=\"".$s_tbl."\"";
  178.             if ($this->defaultTbl==$s_tbl$s_opt.=" selected=\"selected\"";
  179.             $s_opt.=">$s_tbl</option>\n";
  180.             $a_ret['DB_TABLE']['FLD_DEFAULTTBL']['FLDVAL'].=$s_opt;
  181.         }
  182.         $a_ret['DB_TABLE']['FLD_DEFAULTTBL']['FLDVAL'].="</select>\n";
  183.         return $a_ret;
  184.     }
  185.  
  186.     /**
  187.       * saves the fld definition
  188.       *
  189.       * @return bool 
  190.       *
  191.       ***/
  192.     function save({
  193.         $ret parent::save();
  194.  
  195.         $this->myTblField       = $_POST['myTblField'];
  196.         $this->tblFilter        = $_POST['tblFilter'];
  197.         $this->defaultTbl       = $_POST['defaultTbl'];
  198.         $this->allowChangeTbl   = (intval($_POST['allowChangeTbl']TRUE FALSE);
  199.         $this->addTblName       = (intval($_POST['addTblName']TRUE FALSE);
  200.         
  201.         if (!empty($this->myTblField)) {
  202.             $this->getMyForm()// ensure we have the right form object
  203.             if ($o_tblfld=$this->myForm->getField($this->myTblField)) {
  204.                 $o_tblfld->ajax_registerFldToNotify('onChange',$this->getKey(),'ajax_setColLst',$debug);
  205.             }
  206.         }
  207.         return $ret;
  208.     }
  209.  
  210.     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  211.     // javascript & ajax
  212.     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213.  
  214.       
  215.  
  216.     /**
  217.       * returns the js code to update the column select list
  218.       * NOTE: the axCURVAL is the table
  219.       * 
  220.       * @returns string
  221.       *
  222.       * @since pk-07-03-05
  223.       *
  224.       * @access public
  225.       */
  226.     function ajax_setColLst(
  227.     {
  228.         $s_arrName=((isset($_GET['axARRNAME']&& (!empty($_GET['axARRNAME']))) $_GET['axARRNAME'$this->getDataArrName());
  229.         $s_tblName=(isset($_GET['axCURVAL']$_GET['axCURVAL'"");
  230.         
  231.         global ${$s_arrName};
  232.         $s_ret="";
  233.         $s_ret.="
  234.             if (fld_colSel=searchElement(document,\"".$this->getColSelName()."\")) 
  235.             {
  236.                 var str_curCol=fld_colSel.options[fld_colSel.options.selectedIndex].value;
  237.                 var bol_selected=false;
  238.                 fld_colSel.options.length=0;
  239.         ";        
  240.         $a_optlst=$this->getColOptLst($s_tblName,NULL);
  241.         if (is_array($a_optlst)) 
  242.         {
  243.             foreach($a_optlst as $a_option
  244.             {
  245.                 $s_ret.="bol_selected=(str_curCol==\"".$a_option['VALUE']."\");\n";
  246.                 $s_ret.="fld_colSel.options[fld_colSel.options.length]=new Option(";
  247.                 $s_ret.="\"".$a_option['NAME']."\",\"".$a_option['VALUE']."\",".($a_option['DEFAULTSELECT'"true" "false").",".($a_option['SELECTED'"true" "bol_selected").");\n";                
  248.             }
  249.         }
  250.         $s_ret.="
  251.             }
  252.         ";
  253.         return $s_ret;
  254.     }
  255.  
  256.     /**
  257.       * returns the js code to update the table list select
  258.       * 
  259.       * @returns string
  260.       *
  261.       * @since pk-07-03-7
  262.       *
  263.       * @access public
  264.       */
  265.     function ajax_updateTblLst(
  266.     {
  267.         $s_arrName=((isset($_GET['axARRNAME']&& (!empty($_GET['axARRNAME']))) $_GET['axARRNAME'$this->getDataArrName());
  268.         $s_value=(isset($_GET['axCURVAL']$_GET['axCURVAL'"");
  269.  
  270.         return "alert(\"TODO ".__CLASS__."::".__METHOD__."()\");";
  271.     }
  272.  
  273.  
  274.     // ###########################################################
  275.     // VALUE METHODS
  276.     // ###########################################################
  277.     
  278.     // -----------------------------------------------------------
  279.     // table methods
  280.     // -----------------------------------------------------------
  281.     
  282.     /**
  283.       * returns the table name out of $aValue or the global ${$this->getDataArrName()}
  284.       * NOTE: does not check if the table exists
  285.       *
  286.       * @param string $aValue 
  287.       * @param boolean $debug 
  288.       *
  289.       * @returns string
  290.       *
  291.       * @since pk-07-03-07
  292.       *
  293.       * @access public
  294.       *
  295.       ***/
  296.     function getTablName($aValue,$debug=FALSE{
  297.         if ($debugechoDebugMethod(__FILE__." L: ".__LINE__,get_class($this),__CLASS__."::".__METHOD__."()","\$aValue: <pre>".print_r($aValue)."</pre>");
  298.         
  299.         $s_defTbl=$this->defaultTbl;
  300.         global ${$this->getDataArrName()};
  301.         
  302.         if (!empty($this->myTblField)) {
  303.             $this->getMyForm();
  304.             if ($o_fld=$this->myForm->getField($this->myTblField)) {
  305.                 $s_defTbl=${$this->getDataArrName()}[$o_fld->getName()];
  306.             }
  307.         }
  308.         
  309.         if (!empty($aValue)) {
  310.             if (is_array($aValue&& !empty($aValue['TBL'])) {
  311.                 return $aValue['TBL'];
  312.             }
  313.             if (strstr($aValue,'.')) {
  314.                 if ($a_TblCol=explode('.',$aValue,2&& !empty($a_TblCol[0])) {
  315.                    return $a_TblCol[0];
  316.                 }
  317.             }
  318.             // return the default table to avoid an endless loop when recalling the function for empty values below
  319.             return $s_defTbl;
  320.         else if (!empty(${$this->getDataArrName()}[$this->getName()])) {
  321.             return $this->getTablName(${$this->getDataArrName()}[$this->getName()]);
  322.         }
  323.         
  324.         if (empty($s_defTbl)) {
  325.             if (strstr($this->getDefaultValue(),".")) {
  326.                 return $this->getTablName($this->getDefaultValue());
  327.             }
  328.         }
  329.         
  330.         return $s_defTbl;
  331.     }
  332.     
  333.     /**
  334.       * returns an array of tables as options which can be used (in a js) to populate the list
  335.       *
  336.       * @param string $aTblName 
  337.       * @param boolean $debug 
  338.       *
  339.       * @returns array array(string [NAME], string [VALUE],boolean [DEFAULTSELECT],boolean [SELECTED])
  340.       *
  341.       * @since pk-07-03-07
  342.       *
  343.       */
  344.     function getTblOptLst($aTblName,$debug=FALSE{
  345.         if ($debugechoDebugMethod(__FILE__." L: ".__LINE__,get_class($this),__CLASS__."::".__METHOD__."($aTblName)");
  346.         
  347.         if ($a_tables=$GLOBALS['USRDB']->getDBTblList()) {
  348.             if (!empty($this->tblFilter)) {
  349.                 $a_filter=explode(',',$this->tblFilter);
  350.             else {
  351.                 $s_ret=array();
  352.                 foreach($a_tables as $s_tbl
  353.                 {
  354.                     $b_selected=(($s_tbl == $aTblNameTRUE FALSE);
  355.                     if ($a_filter{
  356.                         reset($a_filter)$b_found=FALSE;
  357.                         while(!$b_found && (list($i_dx$s_tbleach($a_tblFlter))) {
  358.                             if (stristr($s_val,$s_tbl)) {
  359.                                 $s_ret[]=array('NAME'=>$s_tbl,'VALUE'=>$s_tag,'DEFAULTSELECT'=>FALSE,'SELECTED'=>$b_selected);
  360.                                 $b_found=TRUE;
  361.                             }
  362.                         }
  363.                         
  364.                     else {
  365.                         $s_ret[]=array('NAME'=>$s_tbl,'VALUE'=>$s_tag,'DEFAULTSELECT'=>FALSE,'SELECTED'=>$b_selected);
  366.                     }
  367.                 }
  368.             }
  369.             return $s_ret;
  370.         else {
  371.             return NULL;
  372.         }
  373.     }
  374.  
  375.     // -----------------------------------------------------------
  376.     // col methods
  377.     // -----------------------------------------------------------
  378.  
  379.     /**
  380.       * returns the name of the column select element
  381.       *
  382.       * @returns string
  383.       *
  384.       * @since pk-07-03-07
  385.       *
  386.       * @access public
  387.       */
  388.     function getColSelName(
  389.     {
  390.         if ($this->allowChangeTbl && empty($this->myTblField)) 
  391.         {
  392.             return $this->getDataArrName()."[".$this->getName()."][COL]";
  393.         
  394.         else 
  395.         {
  396.             return $this->getDataArrName()."[".$this->getName()."]";
  397.         }
  398.     }
  399.  
  400.  
  401.     /**
  402.       * reads the table columns
  403.       * and adds all entries to $this->myValues
  404.       *
  405.       * @param string $arrName index of the data array in $GLOBALS
  406.       * @param bool $debug 
  407.       *
  408.       ***/
  409.     function setMyValues($arrName="DBVAL",$debug=FALSE{
  410.         if ($debugecho "<p><b>DBMS_FIELD_DBCOLSELECTLIST::setMyValues($arrName,$debug)</b> (".get_class($this).")</p>";
  411.         global ${$arrName};
  412.         
  413.         $a_optlst=$this->getColOptLst($this->getTablName(${$arrName}[$this->getName()]));
  414.         if (is_array($a_optlst)) 
  415.         {
  416.             $this->myValues=array();
  417.             foreach($a_optlst as $a_option{
  418.                 $this->myValues[$a_option['VALUE']]=$a_option['NAME'];
  419.             }
  420.         
  421.         else 
  422.         {
  423.             
  424.         }
  425.     }
  426.  
  427.  
  428.     /**
  429.       * returns an array of tables columns as options which can be used (in a js) to populate the list
  430.       *
  431.       * @param string $aTblName 
  432.       * @param boolean $debug 
  433.       *
  434.       * @returns array array(string [NAME], string [VALUE],boolean [DEFAULTSELECT],boolean [SELECTED])
  435.       *
  436.       * @since pk-07-03-07
  437.       * @version pk-07-11-28
  438.       *
  439.       */
  440.     function getColOptLst($aTblName,$aValue=NULL,$debug=FALSE
  441.     {
  442.         if ($debugechoDebugMethod(__FILE__." L: ".__LINE__,get_class($this),__CLASS__."::".__METHOD__."($aTblName)");
  443.         
  444.         $a_ret=array();
  445.         if (!empty($aTblName)) 
  446.         {
  447.             $obj_myDB=$this->myForm->getDBObj()// <pk-07-11-28 />
  448.             $a_tblDesc=$obj_myDB->getDBTblDesc($aTblName)
  449.             if (sizeof($a_tblDesc)) 
  450.             {
  451.                 if ($this->allowNull
  452.                 {
  453.                      $s_ret[]=array('NAME'=>$this->nullLabel,'VALUE'=>"",'DEFAULTSELECT'=>FALSE,'SELECTED'=>FALSE);
  454.                 }
  455.                 foreach($a_tblDesc as $s_colName => $a_colDesc
  456.                 {
  457.                     $a_opt=array();
  458.                     
  459.                     if ($a_colDesc['PRIMARY_KEY']
  460.                     {
  461.                         $a_opt['NAME']=strtoupper($s_colName);
  462.                     
  463.                     else 
  464.                     {
  465.                         $a_opt['NAME']=strtolower($s_colName);
  466.                     }
  467.                     $a_opt['NAME'].=" (".$a_colDesc['TYPE'];
  468.                     
  469.                     if (!$a_colDesc['NULL'])
  470.                     {
  471.                         $a_opt['NAME'].=" NN";
  472.                     }
  473.                     $a_opt['NAME'].=")";
  474.                     
  475.                     $a_opt['VALUE']=$s_colName;
  476.                     if ($this->addTblName
  477.                     {
  478.                         $a_opt['VALUE']=$aTblName.".".$s_colName;
  479.                     }
  480.                     
  481.                     $a_opt['DEFAULTSELECT']=FALSE;
  482.                     $a_opt['SELECTED']=($aValue==$a_opt['VALUE']);
  483.                     
  484.                     $s_ret[]=$a_opt;
  485.                         
  486.                 }
  487.             }
  488.             else 
  489.             {
  490.                 $s_ret[]=array('NAME'=>"Wählen Sie bitte eine Tabelle aus!",'VALUE'=>"",'DEFAULTSELECT'=>FALSE,'SELECTED'=>FALSE);
  491.             }
  492.         
  493.         else 
  494.         {
  495.             $s_ret[]=array('NAME'=>"Wählen Sie bitte eine Tabelle aus!",'VALUE'=>"",'DEFAULTSELECT'=>FALSE,'SELECTED'=>FALSE);
  496.         }
  497.         
  498.         return $s_ret;
  499.     }
  500.  
  501.     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  502.  
  503.  
  504.     /**
  505.       * returns the html code for the select
  506.       *
  507.       * @param string $aValue 
  508.       * @param string $arrName 
  509.       * @param boolean $debug 
  510.       *
  511.       * @returns string
  512.       *
  513.       * @version pk-04-08-18
  514.       * @version pk-05-06-24
  515.       *
  516.       */
  517.     function getInputTag($aValue,$arrName="DBVAL",$debug=FALSE{
  518.         $debug=($debug || $this->fldDebug);
  519.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DBCOLSELECTLIST::getInputTag()","Value: ".print_r($aValue,TRUE)."\n$arrName");
  520.  
  521.         $this->getMyForm()// ensure the object is loaded
  522.         
  523.         $s_tbl=$this->getTablName($aValue);
  524.         $s_tag="<a name=\"".$this->myName."\"></a>";
  525.  
  526.         global ${$arrName};
  527.         /*
  528.         if ($this->myForm->isReloaded($arrName,$debug)) {
  529.             if (isset($_POST[$arrName][$this->myName]['TBL'])) {
  530.                 $s_tbl=$_POST[$arrName][$this->myName]['TBL'];
  531.                 $s_col=(isset($_POST[$arrName][$this->myName]['COL']) ? $_POST[$arrName][$this->myName]['COL'] : "");
  532.             } else {
  533.                 $s_col=$aValue;
  534.             }
  535.         } else {
  536.             $s_col=$aValue;
  537.         }
  538.         */
  539.         $s_col=$aValue;
  540.         
  541.         if (strstr($s_col,".")) // value is TABLE.COLUMN
  542.             $a_tblCol=explode('.',$s_col,2);
  543.             $s_tbl=$a_tblCol[0];
  544.             $s_col=$a_tblCol[1];
  545.         }
  546.         
  547.         if ($debug$s_tag.="Table$s_tbl<br/>Value$s_col<br />";        
  548.         
  549.         $o_ajax=$this->myForm->ajax_getObj();
  550.         if ($this->allowChangeTbl && !$o_tblFld{
  551.             $s_ret.="TODO change Table ..".substr(__FILE__,-20)." LINE: ".__LINE__;
  552.         }
  553.         
  554.         $a_optlst=$this->getColOptLst($s_tbl,$s_col,$debug);
  555.         $s_tag.= "<select name=\"".$this->getColSelName()."\" >\n";
  556.         foreach($a_optlst as $a_opt{
  557.             $s_tag.="<option value=\"".$a_opt['VALUE']."\"".($a_opt['SELECTED'" selected" "").">".$a_opt['NAME']."</option>\n";
  558.         }
  559.         $s_tag.= "</select>\n";
  560.  
  561.         return $s_tag;
  562.  
  563.     }
  564.  
  565.     /**
  566.       * returns the field value
  567.       *
  568.       * @param  string  $aValue     the value
  569.       * @param  array   $err        error array
  570.       * @param  string  $arrName    name of the array to access fieldsarray  gloabl ${$arrName}
  571.       * @param  bool    $debug 
  572.       *
  573.       * @return string 
  574.       *
  575.       * @version pk-04-08-19
  576.       * @version pk-05-06-24
  577.       *
  578.       ***/
  579.     function getValue($aValue,&$err,$arrName="DBVAL",$debug=FALSE{
  580.         $debug=($debug || $this->fldDebug);
  581.         if ($debugechoDebug(__FILE__,"<p><b>DBMS_FIELD_DBCOLSELECTLIST::getValue($aValue,$err,$arrName,$debug)</b> (".get_class($this)." | ".$this->myName.")</p>",0);
  582.         if (is_array($aValue)) {
  583.             if (!empty($aValue['COL'])) {
  584.                 if ($this->addTblName{
  585.                     $col=$aValue['TBL'].".".$aValue['COL'];
  586.                 else {
  587.                     $col=$aValue['COL'];
  588.                 }
  589.             else {
  590.                 $col=NULL;
  591.             }
  592.         else {
  593.             $col=$aValue;
  594.         }
  595.         return parent::getValue($col,$err,$arrName,$debug);
  596.     }
  597.  
  598.  
  599. // end class DBMS_FIELD_DBCOLSELECTLIST
  600. ?>

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