[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Users/ -> UpdateDefaultFieldLevelAccess.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  require_once ('include/database/PearDatabase.php');
  13  require_once ('include/utils/UserInfoUtil.php');
  14  require_once ('include/utils/utils.php');
  15  global $adb;
  16  
  17  $field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq');
  18  foreach($field_module as $fld_module)
  19  {
  20      $fieldListResult = getDefOrgFieldList($fld_module);
  21      $noofrows = $adb->num_rows($fieldListResult);
  22      $tab_id = getTabid($fld_module);
  23      for($i=0; $i<$noofrows; $i++)
  24      {
  25          $fieldid =  $adb->query_result($fieldListResult,$i,"fieldid");
  26          $visible = $_REQUEST[$fieldid];
  27          if($visible == 'on')
  28          {
  29              $visible_value = 0;
  30          }
  31          else
  32          {
  33              $visible_value = 1;
  34          }
  35          //Updating the Mandatory vtiger_fields
  36          $uitype = $adb->query_result($fieldListResult,$i,"uitype");
  37          if($uitype == 2 || $uitype == 6 || $uitype == 22 || $uitype == 73 || $uitype == 24 || $uitype == 81 || $uitype == 50 || $uitype == 23 || $uitype == 16)
  38          {
  39              $visible_value = 0; 
  40          }        
  41  
  42          //Updating the database
  43          $update_query = "update vtiger_def_org_field set visible=".$visible_value." where fieldid='".$fieldid."' and tabid=".$tab_id;
  44          $adb->query($update_query);
  45  
  46      }
  47  }
  48  $loc = "Location: index.php?action=DefaultFieldPermissions&module=Users&parenttab=Settings&fld_module=".$_REQUEST['fld_module'];
  49  header($loc);
  50  
  51  ?>


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