Source for file DBMS_FIELD_CLI_SEXLOOKUP.phpclass

Documentation is available at DBMS_FIELD_CLI_SEXLOOKUP.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_CLI_SEXLOOKUP.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   any
  8.   *
  9.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   * @version pk-06-01-17
  13.   *
  14.   ***/
  15.  
  16. if (empty($GLOBALS['OCSP']['PHPFORMPATH'])) $GLOBALS['OCSP']['PHPFORMPATH']=dirname(__FILE__)."/";
  17.  
  18. if (!class_exists("DBMS_FIELD_DBLOOKUPSELECTLIST")) {
  19.     require_once dirname(__FILE__)."/DBMS_FIELD_DBLOOKUPSELECTLIST.phpclass";
  20. }
  21.  
  22. /**
  23.   * Class DBMS_FIELD_CLI_SEXLOOKUP
  24.   *
  25.   * @project    Open CSP-Management
  26.   * @package    dbms_field
  27.   * @category   any
  28.   *
  29.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  30.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  31.   *
  32.   * @version pk-06-01-17
  33.   *
  34.   ***/
  35.  
  36.     // ###########################################################
  37.     // OBJECT (CONST) VAR DECLARATION
  38.     // ###########################################################
  39.  
  40.      var $className       = "LookupCLI_SEX";
  41.  
  42.      /**
  43.        * @var string lookupTable
  44.        ***/
  45.     var $lookupTable="T_LOOKUP_SEX";
  46.  
  47.     /**
  48.       * @var string showField
  49.       * @since pk-05-11-20
  50.       ***/
  51.     var $lookupShowField="LUP_VALUE";
  52.  
  53.     /**
  54.       * @var string lookupField
  55.       ***/
  56.     var $lookupField="LUP_KEY";
  57.  
  58.     /**
  59.       * @var boolean $isAddress 
  60.       * @since pk-06-01-17
  61.       ***/
  62.     var $isAddress=TRUE;
  63.  
  64.     /**
  65.       * @var boolean $isClient 
  66.       * @since pk-06-01-17
  67.       ***/
  68.     var $isClient=TRUE;
  69.  
  70.     /**
  71.       * @var boolean $isClient 
  72.       * @since pk-06-01-17
  73.       ***/
  74.     var $isStaff=TRUE;
  75.  
  76.  
  77.     /**
  78.       * @var allowAddValues 
  79.       *
  80.       *  DOES NOT CARE if the values are in the list check is disabled
  81.       *  when is is enabled
  82.       ***/
  83.     var $allowAddValues=FALSE;
  84.  
  85.     /**
  86.       * source file of the class
  87.       *
  88.       * @var string $classSrcFile 
  89.       * @since pk-05-02-19
  90.       ***/
  91.     var $classSrcFile=__FILE__;
  92.  
  93.  
  94.     // ###########################################################
  95.     // OBJECT SETTINGS METHODS
  96.     // ###########################################################
  97.  
  98.     /**
  99.       * returns an array of field to bie shown in the edit form
  100.       * by using editTbl_echoForm
  101.       *
  102.       * the array is in the form:
  103.       *
  104.       * <code>
  105.       * [_sectionName_]
  106.       *      [TITLE] -> string
  107.       *      [_rowName_]
  108.       *         [FLDLAB]  (complete html code with <td></td>)
  109.       *         [FLDVAL] (complete html code with <td></td>)
  110.       * </code>
  111.       *
  112.       * @param boolean $debug 
  113.       *
  114.       * @return array 
  115.       *
  116.       * @since pk-07-05-17
  117.       *
  118.       ***/
  119.     function editTbl_getFieldEditArr($debug=FALSE{
  120.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DBSELECTLIST::editTbl_getFieldEditArr","",0);
  121.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  122.  
  123.         unset($a_ret['SELECT']['FLD_VALQUERY']);
  124.         $a_ret['ADDR_LOOKUP']=array(
  125.             'TITLE'         =>"Adressenart",
  126.             'FLD_ADRTYPE'   => array(
  127.                     'FLDLAB'=>"Adressenart",
  128.                     'FLDVAL'=>"
  129.                         <input type=\"checkbox\" name=\"isAddress\" value=\"1\" ".($this->isAddress ? "checked" "")."> Adresse<br />
  130.                         <input type=\"checkbox\" name=\"isClient\" value=\"1\" ".($this->isClient ? "checked" "")."> Kunde/Einzelperson<br />
  131.                         <input type=\"checkbox\" name=\"isStaff\" value=\"1\" ".($this->isStaff ? "checked" "")."> Mitarbeiter<br />
  132.                         "
  133.                     )
  134.                 );
  135.         return $a_ret;
  136.     }
  137.  
  138.     /*
  139.       * echos the filed definition form
  140.       *
  141.       * @param boolean $showSize
  142.       * @param boolean $showDBFields
  143.       *
  144.       * @version pk-06-01-17
  145.       *
  146.      function editTblForm($showSize=FALSE,$showDBFields=FALSE) {
  147.         parent::editTblForm($showSize,$showDBFields);
  148.         // <pk-06-01-17>
  149.         echo "<tr><td class=\"fldName\">Adressenart:</td>";
  150.         echo "<td class=\"fldValue\">";
  151.         echo "<input type=\"checkbox\" name=\"isAddress\" value=\"1\" ".($this->isAddress ? "checked" : "")."> Adresse<br />\n";
  152.         echo "";
  153.         echo "\n";
  154.         echo "</td></tr>\n";
  155.         // </pk-06-01-17>
  156.     }
  157.       */
  158.  
  159.     /**
  160.       * save the filed definition form
  161.       *
  162.       * @return boolean 
  163.       *
  164.       * @version pk-05-12-08
  165.       * @version pk-06-01-17
  166.       * @version pk-07-05-17
  167.       *
  168.       ***/
  169.     function save({
  170.         $b_ret=parent::save();
  171.         $this->lookupTable="T_LOOKUP_SEX";
  172.         $this->lookupShowField="LUP_VALUE";
  173.         $this->lookupField="LUP_KEY";
  174.         $this->lookupWhere="";
  175.  
  176.         // <pk-06-01-17> <pk-07-05-17> E_ALL
  177.         $this->isAddress=((isset($_POST['isAddress']&& intval($_POST['isAddress'])) TRUE FALSE);
  178.         $this->isClient =((isset($_POST['isClient']&& intval($_POST['isClient'])) TRUE FALSE);
  179.         $this->isStaff  =((isset($_POST['isStaff']&& intval($_POST['isStaff'])) TRUE FALSE);
  180.         // </pk-06-01-17></pk-07-05-17>
  181.  
  182.         $this->allowAddValues=FALSE// <pk-05-12-08>
  183.         return $b_ret;
  184.     }
  185.  
  186.     // ###########################################################
  187.     // OBJECT DATA METHODS
  188.     // ###########################################################
  189.  
  190.     /**
  191.       * sets populates $this->myValues array from the database
  192.       *
  193.       * @param string $arrName 
  194.       * @param boolean $debug 
  195.       *
  196.       * @since pk-06-01-17
  197.       *
  198.       ***/
  199.     function setMyValues($arrName="DBVAL",$debug=FALSE{
  200.         if ($debugechoDebug(__FILE__,"<p><b>DBMS_FIELD_CLI_SEXLOOKUP::setMyValues()</b> (".get_class($this).")</p>",0);
  201.  
  202.         $this->lookupWhere="(";
  203.         $s_or="";
  204.         if ($this->isAddress{
  205.             $this->lookupWhere.=$s_or."LUP_ADDR=1";
  206.             $s_or=" OR ";
  207.         }
  208.         if ($this->isClient{
  209.             $this->lookupWhere.=$s_or."LUP_CLI=1";
  210.             $s_or=" OR ";
  211.         }
  212.         if ($this->isStaff{
  213.             $this->lookupWhere.=$s_or."LUP_STAFF=1";
  214.             $s_or=" OR ";
  215.         }
  216.  
  217.         if ($s_or != ""{
  218.             $this->lookupWhere.=")";
  219.             if ($debugechoDebug(__FILE__,"<p>WHERE: ".$this->lookupWhere."</p>",1);
  220.         else {
  221.             // no where condition clear lookupWhere
  222.             if ($debugechoDebug(__FILE__,"<p>NO FILTER</p>",1);
  223.             $this->lookupWhere="";
  224.         }
  225.  
  226.         parent::setMyValues($arrName,$debug);
  227.     }
  228.  
  229.  
  230.  
  231.     // ###########################################################
  232.     // OBJECT HTML FORM METHODS
  233.     // ###########################################################
  234.  
  235.  
  236.     // ###########################################################
  237.     // SEARCH FORM METHODS
  238.     // ###########################################################
  239.  
  240.  
  241.     // ###########################################################
  242.     // OBJECT HTML FORM METHODS
  243.     // ###########################################################
  244.  
  245.  
  246.     // ###########################################################
  247.     // OBJECT VALUE CHECK METHODS
  248.     // ###########################################################
  249.  
  250.  
  251. // end class DBMS_FIELD_DBSELECTLIST
  252. ?>

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