[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Settings/ -> EditComboField.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  require_once ('include/database/PearDatabase.php');
  12  require_once ('Smarty_setup.php');
  13  global $mod_strings;
  14  global $app_strings;
  15  global $app_list_strings, $current_language;
  16  
  17  $tableName=$_REQUEST["fieldname"];
  18  $moduleName=$_REQUEST["fld_module"];
  19  $uitype=$_REQUEST["uitype"];
  20  
  21  
  22  global $theme;
  23  $theme_path="themes/".$theme."/";
  24  $image_path=$theme_path."images/";
  25  require_once ($theme_path.'layout_utils.php');
  26  
  27  $smarty = new vtigerCRM_Smarty;
  28  
  29  //Added to get the strings from language files if present
  30  if($moduleName == 'Events')
  31      $temp_module_strings = return_module_language($current_language, 'Calendar');
  32  else
  33      $temp_module_strings = return_module_language($current_language, $moduleName);
  34  
  35  //To get the Editable Picklist Values 
  36  if($uitype != 111)
  37  {
  38      $query = "select * from vtiger_".$tableName ;
  39      $result = $adb->query($query);
  40      $fldVal='';
  41  
  42      while($row = $adb->fetch_array($result))
  43      {
  44          if($temp_module_strings[$row[$tableName]] != '')
  45              $fldVal .= $temp_module_strings[$row[$tableName]];
  46          else
  47              $fldVal .= $row[$tableName];
  48          $fldVal .= "\n";    
  49      }
  50  }
  51  else
  52  {
  53      $query = "select * from vtiger_".$tableName." where presence=0"; 
  54      $result = $adb->query($query);
  55      $fldVal='';
  56  
  57      while($row = $adb->fetch_array($result))
  58      {
  59          if($temp_module_strings[$row[$tableName]] != '')
  60              $fldVal .= $temp_module_strings[$row[$tableName]];
  61          else
  62              $fldVal .= $row[$tableName];
  63          $fldVal .= "\n";    
  64      }
  65  }
  66  
  67  //To get the Non Editable Picklist Entries
  68  if($uitype == 111) 
  69  {
  70      $qry = "select * from vtiger_".$tableName." where presence=1"; 
  71      $res = $adb->query($qry);
  72      $nonedit_fldVal='';
  73  
  74      while($row = $adb->fetch_array($res))
  75      {
  76          if($temp_module_strings[$row[$tableName]] != '')
  77              $nonedit_fldVal .= $temp_module_strings[$row[$tableName]];
  78          else
  79              $nonedit_fldVal .= $row[$tableName];
  80          $nonedit_fldVal .= "<br>";    
  81      }
  82  }
  83  $query = 'select fieldlabel from vtiger_tab inner join vtiger_field on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.name="'.$moduleName.'" and fieldname="'.$tableName.'"';
  84  $fieldlabel = $adb->query_result($adb->query($query),0,'fieldlabel'); 
  85  
  86  if($nonedit_fldVal == '')
  87          $smarty->assign("EDITABLE_MODE","edit");
  88      else
  89          $smarty->assign("EDITABLE_MODE","nonedit");
  90  $smarty->assign("NON_EDITABLE_ENTRIES", $nonedit_fldVal);
  91  $smarty->assign("ENTRIES",$fldVal);
  92  $smarty->assign("MODULE",$moduleName);
  93  $smarty->assign("FIELDNAME",$tableName);
  94  //First look into app_strings and then mod_strings and if not available then original label will be displayed
  95  $temp_label = isset($app_strings[$fieldlabel])?$app_strings[$fieldlabel]:(isset($mod_strings[$fieldlabel])?$mod_strings[$fieldlabel]:$fieldlabel);
  96  $smarty->assign("FIELDLABEL",$temp_label);
  97  $smarty->assign("UITYPE", $uitype);
  98  $smarty->assign("MOD", return_module_language($current_language,'Settings'));
  99  $smarty->assign("IMAGE_PATH",$image_path);
 100  $smarty->assign("APP", $app_strings);
 101  $smarty->assign("CMOD", $mod_strings);
 102  $smarty->assign("TEMP_MOD", $temp_module_strings);
 103  
 104  $smarty->display("Settings/EditPickList.tpl");
 105  ?>


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