[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Reports/ -> StandardFilter.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9  *
  10   ********************************************************************************/
  11  
  12  if(isset($_REQUEST["record"]) == false)
  13  {
  14          $oReport = new Reports();
  15          $primarymodule = $_REQUEST["primarymodule"];
  16          $secondarymodule = $_REQUEST["secondarymodule"];
  17  
  18      $BLOCK1 = getPrimaryStdFilterHTML($primarymodule);
  19      $BLOCK1 .= getSecondaryStdFilterHTML($secondarymodule);
  20  
  21          $report_std_filter->assign("BLOCK1_STD",$BLOCK1);
  22          $BLOCKJS = $oReport->getCriteriaJS();
  23          $report_std_filter->assign("BLOCKJS_STD",$BLOCKJS);
  24          $BLOCKCRITERIA = $oReport->getSelectedStdFilterCriteria();
  25          $report_std_filter->assign("BLOCKCRITERIA_STD",$BLOCKCRITERIA);
  26  
  27  }elseif(isset($_REQUEST["record"]) == true)
  28  {
  29          $reportid = $_REQUEST["record"];
  30          $oReport = new Reports($reportid);
  31          $oReport->getSelectedStandardCriteria($reportid);
  32      
  33          $BLOCK1 = getPrimaryStdFilterHTML($oReport->primodule,$oReport->stdselectedcolumn);
  34          $BLOCK1 .= getSecondaryStdFilterHTML($oReport->secmodule,$oReport->stdselectedcolumn);
  35          $report_std_filter->assign("BLOCK1_STD",$BLOCK1);
  36  
  37          $BLOCKJS = $oReport->getCriteriaJS();
  38          $report_std_filter->assign("BLOCKJS_STD",$BLOCKJS);
  39  
  40          $BLOCKCRITERIA = $oReport->getSelectedStdFilterCriteria($oReport->stdselectedfilter);
  41          $report_std_filter->assign("BLOCKCRITERIA_STD",$BLOCKCRITERIA);
  42  
  43          $startdate = $oReport->startdate;
  44          $report_std_filter->assign("STARTDATE_STD",$startdate);    
  45  
  46          $enddate = $oReport->enddate;
  47          $report_std_filter->assign("ENDDATE_STD",$enddate);
  48  }
  49  
  50  
  51      /** Function to get the HTML strings for the primarymodule standard filters
  52       * @ param $module : Type String
  53       * @ param $selected : Type String(optional)
  54       *  This Returns a HTML combo srings
  55       */
  56  function getPrimaryStdFilterHTML($module,$selected="")
  57  {
  58      global $app_list_strings;
  59      global $ogReport;
  60      global $current_language;
  61  
  62          $mod_strings = return_module_language($current_language,$module);
  63  
  64      $result = $ogReport->getStdCriteriaByModule($module);
  65      
  66      if(isset($result))
  67      {
  68          foreach($result as $key=>$value)
  69          {
  70              if(isset($mod_strings[$value]))
  71              {
  72                  if($key == $selected)
  73                  {
  74                      $shtml .= "<option selected value=\"".$key."\">".$app_list_strings['moduleList'][$module]." - ".$mod_strings[$value]."</option>";
  75                  }else
  76                  {
  77                      $shtml .= "<option value=\"".$key."\">".$app_list_strings['moduleList'][$module]." - ".$mod_strings[$value]."</option>";
  78                  }
  79              }else
  80              {
  81                  if($key == $selected)
  82                  {
  83                      $shtml .= "<option selected value=\"".$key."\">".$app_list_strings['moduleList'][$module]." - ".$value."</option>";
  84                  }else
  85                  {
  86                      $shtml .= "<option value=\"".$key."\">".$app_list_strings['moduleList'][$module]." - ".$value."</option>";
  87                  }
  88              }
  89          }
  90      }
  91      
  92      return $shtml;
  93  }
  94  
  95      /** Function to get the HTML strings for the secondary  standard filters
  96       * @ param $module : Type String
  97       * @ param $selected : Type String(optional)
  98       *  This Returns a HTML combo srings for the secondary modules
  99       */
 100  function getSecondaryStdFilterHTML($module,$selected="")
 101  {
 102      global $app_list_strings;
 103      global $ogReport;
 104      global $current_language;
 105      if($module != "")
 106          {
 107              $secmodule = explode(":",$module);
 108              for($i=0;$i < count($secmodule) ;$i++)
 109              {
 110              $result = $ogReport->getStdCriteriaByModule($secmodule[$i]);
 111              $mod_strings = return_module_language($current_language,$secmodule[$i]);
 112                  if(isset($result))
 113                  {
 114                          foreach($result as $key=>$value)
 115                          {
 116                                  if(isset($mod_strings[$value]))
 117                                          {
 118                          if($key == $selected)
 119                          {
 120                              $shtml .= "<option selected value=\"".$key."\">".$app_list_strings['moduleList'][$secmodule[$i]]." - ".$mod_strings[$value]."</option>";
 121                          }else
 122                          {
 123                              $shtml .= "<option value=\"".$key."\">".$app_list_strings['moduleList'][$secmodule[$i]]." - ".$mod_strings[$value]."</option>";
 124                          }
 125                      }else
 126                      {
 127                          if($key == $selected)
 128                          {
 129                              $shtml .= "<option selected value=\"".$key."\">".$app_list_strings['moduleList'][$secmodule[$i]]." - ".$value."</option>";
 130                          }else
 131                          {
 132                              $shtml .= "<option value=\"".$key."\">".$app_list_strings['moduleList'][$secmodule[$i]]." - ".$value."</option>";
 133                          }
 134                      }
 135                          }
 136                  }
 137          
 138          }
 139      }
 140      return $shtml;
 141  }
 142  ?>
 143  


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7