Source for file DBMS_FIELD_TREEPARENTSELECT.phpclass

Documentation is available at DBMS_FIELD_TREEPARENTSELECT.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_TREEPARENTSELECT.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   int
  8.   *
  9.   * @author     Peter Krebs <p.krebs@crewboerse.at>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   * @since pk-06-11-29
  13.   *
  14.   ***/
  15.  
  16. if (empty($GLOBALS['OCSP']['DBMSFLD_PATH'])) $GLOBALS['OCSP']['DBMSFLD_PATH']=dirname(__FILE__)."/";
  17. require_once $GLOBALS['OCSP']['DBMSFLD_PATH']."DBMS_FIELD_TREESELECT.phpclass";
  18.  
  19. /**
  20.   * Class DBMS_FIELD_TREEPARENTSELECT
  21.   *
  22.   * @project    Open CSP-Management
  23.   * @package    dbms_field
  24.   * @category   int
  25.   *
  26.   * @author     Peter Krebs <p.krebs@crewboerse.at>
  27.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  28.   *
  29.   * @since pk-06-11-29
  30.   *
  31.   ***/
  32.     var $className          = "TREEPARENTSELECT";
  33.  
  34.     /**
  35.       * source file of the class
  36.       *
  37.       * @var string $classSrcFile 
  38.       ***/
  39.     var $classSrcFile=__FILE__;
  40.  
  41.     /**
  42.       * @var string whereAndAdd userdefined where condition
  43.       ***/
  44.     var $whereAndAdd="";
  45.  
  46.     // ###########################################################
  47.     // OBJECT SETTINGS METHODS
  48.     // ###########################################################
  49.  
  50.     /**
  51.       * returns an array of field to bie shown in the edit form
  52.       * by using editTbl_echoForm
  53.       *
  54.       * the array is in the form:
  55.       *
  56.       * <code>
  57.       * [_sectionName_]
  58.       *      [TITLE] -> string
  59.       *      [_rowName_]
  60.       *         [FLDLAB]  (complete html code with <td></td>)
  61.       *         [FLDVAL] (complete html code with <td></td>)
  62.       * </code>
  63.       *
  64.       * @param boolean $debug 
  65.       *
  66.       * @returns array
  67.       *
  68.       ***/
  69.     function editTbl_getFieldEditArr($debug=FALSE{
  70.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_TREEPARENTSELECT::editTbl_getFieldEditArr","",0);
  71.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  72.         $a_ret['DBLOOKUP']['FLD_FOREIGNTBL']['FLDVAL']=$this->myTable;
  73.         $s_keyFld=(empty($this->keyField"[Schl&uuml;sselfeld]"$this->keyField);
  74.         $a_ret['DBLOOKUP']['FLD_WHEREFLD']['FLDVAL']="
  75.                         <div style=\"float:left\">
  76.                             WHERE ".$this->myName."<>'\$*".$s_keyFld."\$ AND
  77.                             <textarea name=\"whereAndAdd\" rows=\"2\" cols=\"30\">".htmlspecialchars($this->whereAndAdd)."</textarea>
  78.                         </div>
  79.                         <input type=\"checkbox\" name=\"checkWhereAnd\" value=\"1\" ".(($this->checkWhereAnd"checked " "")."> beim Prüfen verwenden
  80.  
  81.             ";
  82.         unset($a_ret['DBLOOKUP']['PARENTFIELD']);
  83.  
  84.         return $a_ret;
  85.     }
  86.  
  87.     /**
  88.       * saves the field definition
  89.       *
  90.       * @returns boolean
  91.       *
  92.       * @version pk-05-06-26
  93.       * @version pk-05-09-27
  94.       ***/
  95.     function save({
  96.         if (isset($this->treeTbl)) unset($this->treeTbl);
  97.  
  98.         // save the parent first to be sure to have the table in DBcheckEditInput
  99.         if ($ret=parent::save()) {
  100.             $this->foreignTbl=$this->myTable;
  101.             $this->parentField=$this->myName;
  102.             $this->whereAndAdd=(isset($_POST['whereAndAdd']trim($_POST['whereAndAdd']"");
  103.             $this->whereAnd=$this->parentField."<>'\$*".$this->keyField."\$'";
  104.             if (!empty($this->whereAndAdd)) {
  105.                 $this->whereAnd.=" AND ".$this->whereAndAdd;
  106.             }
  107.             return TRUE;
  108.         }
  109.         return FALSE;
  110.     }
  111.  
  112.  
  113.     // ###########################################
  114.  
  115.  
  116.  
  117. }
  118. ?>

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