Source for file DBMS_FIELD_PRO_PGPSELECT.phpclass

Documentation is available at DBMS_FIELD_PRO_PGPSELECT.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_PRO_PGPSELECT.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @project    Open CSP-Management
  7.   * @package    dbms_field
  8.   * @category   int
  9.   *
  10.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   ***/
  14.  
  15. /**
  16.   * requirements
  17.   */
  18.     pcf_require_class('DBMS_FIELD_TREESELECT',dirname(__FILE__)."/");
  19.  
  20. /**
  21.   * Class DBMS_FIELD_PRO_PGPSELECT
  22.   *
  23.   * @project    Open CSP-Management
  24.   * @package    dbms_field
  25.   * @category   int
  26.   *
  27.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  28.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  29.   *
  30.   * @since pk-06-02-01
  31.   *
  32.   ***/
  33.  
  34.     var $className          = "PROGROUPSELECT";
  35.     var $nullLabel          = "Alle";
  36.     var $showField          = "CONCAT(IFNULL(CONCAT(PGP_NUMBER,' '),''),PGP_NAME,' (',PGP_ID,')')";
  37.     
  38.     protected $lookupTable        = "T_PRO_GROUP";
  39.     protected $lookupField        = "PGP_ID";
  40.     
  41.     var $parentField        = "PGP_PARENT";
  42.     var $sortField          = "PROJ_ID,PGP_SORTORDER";
  43.     var $whereAnd           = "(PROJ_ID='\$*PROJ_ID\$' OR PROJ_ID='\$^PROJ_ID\$' OR PROJ_ID=0)";
  44.     var $checkWhereAnd      = FALSE;
  45.  
  46.     /**
  47.       * @var int $projId 
  48.       ***/
  49.     var $projId             = -1;
  50.     /**
  51.       * @var boolean $incDefaultProj 
  52.       ***/
  53.     var $incDefaultProj     = TRUE;
  54.     /**
  55.       * @var string $classSrcFile 
  56.       ***/
  57.     var $classSrcFile=__FILE__;
  58.  
  59.  
  60.     // ###########################################################
  61.     // OBJECT SETTINGS METHODS
  62.     // ###########################################################
  63.  
  64.     /**
  65.       * returns an array of field to bie shown in the edit form
  66.       * by using editTbl_echoForm
  67.       *
  68.       * the array is in the form:
  69.       *
  70.       * <code>
  71.       * [_sectionName_]
  72.       *      [TITLE] -> string
  73.       *      [_rowName_]
  74.       *         [FLDLAB]  (complete html code with <td></td>)
  75.       *         [FLDVAL] (complete html code with <td></td>)
  76.       * </code>
  77.       *
  78.       * @param boolean $debug 
  79.       *
  80.       * @returns array
  81.       *
  82.       * @since pk-06-07-04
  83.       *
  84.       */
  85.     function editTbl_getFieldEditArr($debug=False
  86.     {
  87.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_PRO_PGPSELECT::editTbl_getFieldEditArr","",0);
  88.         
  89.         $arr_ret parent::editTbl_getFieldEditArr($debug);
  90.                 
  91.         if (empty($this->lookupShowField))  $this->lookupShowField ="CONCAT(IFNULL(CONCAT(PGP_NUMBER,' '),''),PGP_NAME,' (',PGP_ID,')')";
  92.         
  93.         $arr_ret['DBLOOKUP']['FLD_LUTBL'array(
  94.             'FLDLAB' => t_admin("Tabellenwert"),
  95.             'FLDVAL' => "T_PRO_GROUP.PGP_ID"
  96.         );
  97.         unset($arr_ret['DBLOOKUP']['FLD_VALFLD']);
  98.         
  99.         $str_projSel  "
  100.             <select name=\"projId\" size=\"1\">
  101.                 <option value=\"-2\" " (($this->projId == -2"selected=\"selected\"" "".">Alle</option>
  102.                 <option value=\"-1\" " (($this->projId == -1"selected=\"selected\"" "".">HTTP_GET/DBVAL</option>
  103.                 <option value=\"0\" " .  (($this->projId == 0)  "selected=\"selected\"" "".">default</option>            
  104.         ";
  105.         if ($arr_proj OCSP_OBJ::defaultReadDBObj()->getArray('T_CMS_PROJECT',Null,0,0,"PROJ_SORTORDER",$debug))
  106.         {
  107.             foreach($arr_proj as $arr_row)
  108.             {
  109.                 $str_projSel .= "<option value=\"{$arr_row['PROJ_ID']}\" (($this->projId == $arr_row['PROJ_ID'])  "selected=\"selected\"" """>{$arr_row['PROJ_NAME']}</option>";
  110.             }
  111.         }
  112.         $str_projSel .= "</select>";
  113.          
  114.         $arr_ret['DBLOOKUP']['FLD_PRGPROJ'array(
  115.             'FLDLAB' => t_admin("Projekt"),
  116.             'FLDVAL' => $str_projSel "<br />
  117.                     <input type=\"checkbox\" name=\"incDefaultProj\" value=\"1\" " (intval($this->incDefaultProj"checked=\"checked\"" ""." />
  118.                         Default Projekt einschlie&szlig;en                    
  119.                 "
  120.         );
  121.                 
  122.         unset($arr_ret['DBLOOKUP']['FLD_WHEREFLD']);
  123.         
  124.         
  125.         return $arr_ret;
  126.         
  127.     }
  128.     
  129.     /*
  130.       * echos the filed definition form
  131.             <tr>
  132.                 <td class="fldName">Wurzel zulassen</td>
  133.                 <td class="fldValue">
  134.                     <input
  135.                         name="ALLOWMENROOT"
  136.                         type="checkbox"
  137.                         value="1"
  138.                         <?php echo ($this->allowNullSelect ? "checked" : "");?> > ja
  139.                 </td>
  140.             <tr>
  141.     }
  142.     */
  143.  
  144.     /**
  145.       * save the filed definition form
  146.       *
  147.       * @returns boolean
  148.       *
  149.       * @version pk-05-12-08
  150.       * @version pk-06-01-17
  151.       *
  152.       ***/
  153.     function save({
  154.         $ret parent::save();
  155.  
  156.         //$this->lookupShowField      ="CONCAT(IFNULL(CONCAT(PGP_NUMBER,' '),''),PGP_NAME,' (',PGP_ID,')')";
  157.         $this->lookupField          ="PGP_ID";
  158.         $this->lookupTable          ="PGP_PARENT";
  159.         $this->projId               =intval($_POST['projId']);
  160.         $this->incDefaultProj       =((isset($_POST['incDefaultProj']&& intval($_POST['incDefaultProj'])) True False);
  161.  
  162.         if ($this->projId==-1{
  163.             $this->lookupWhere = "(PROJ_ID='\$*PROJ_ID\$' OR PROJ_ID='\$^PROJ_ID\$')";
  164.         else if ($this->projId == -2{
  165.              $this->lookupWhere = "";   
  166.         else {
  167.             $this->lookupWhere = "PROJ_ID=".intval($this->projId);
  168.         }
  169.             
  170.         if (($this->incDefaultProj&& ($this->projId != -2)) {
  171.             $this->lookupWhere ="(".$this->lookupWhere." OR PROJ_ID=0)";
  172.             $this->sortField            ="PROJ_ID,PGP_SORTORDER";
  173.         else {
  174.             $this->sortField            ="PGP_SORTORDER";
  175.         }
  176.  
  177.         //$this->allowNullSelect      =(intval($_POST['ALLOWMENROOT']) ? TRUE : FALSE );
  178.         $this->nullLabel            ="Wurzel";
  179.  
  180.         return $ret;
  181.     }
  182.  
  183.     // ###########################################################
  184.     // OBJECT DATA METHODS
  185.     // ###########################################################
  186.  
  187.     // ###########################################################
  188.     // OBJECT HTML FORM METHODS
  189.     // ###########################################################
  190.  
  191.     // ###########################################################
  192.     // SEARCH FORM METHODS
  193.     // ###########################################################
  194.  
  195.  
  196.     // ###########################################################
  197.     // OBJECT HTML FORM METHODS
  198.     // ###########################################################
  199.  
  200.  
  201.     // ###########################################################
  202.     // OBJECT VALUE CHECK METHODS
  203.     // ###########################################################
  204.  
  205.  
  206. // end class DBMS_FIELD_PRO_PGPSELECT
  207. ?>

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