[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
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/Webservices/VtigerCRMObjectMeta.php"; 13 14 /** 15 * Description of VtigerInventoryMeta 16 */ 17 class VtigerInventoryMeta extends VtigerCRMObjectMeta { 18 private $metaTableList = array('vtiger_inventorytaxinfo','vtiger_shippingtaxinfo'); 19 private $metaTablePrefix = array('vtiger_inventorytaxinfo'=>'', 'vtiger_shippingtaxinfo'=>'S & H '); 20 21 public function retrieveMeta() { 22 parent::retrieveMeta(); 23 $this->retrieveMetaForTables(); 24 } 25 26 function retrieveMetaForTables() { 27 $db = PearDatabase::getInstance(); 28 foreach ($this->metaTableList as $tableName) { 29 $sql = "SELECT * FROM $tableName WHERE deleted=0"; 30 $params = array(); 31 $result = $db->pquery($sql, $params); 32 if(!empty($result)){ 33 $it = new SqlResultIterator($db, $result); 34 foreach ($it as $row) { 35 $fieldArray = $this->getFieldArrayFromTaxRow($row,$tableName, 36 $this->metaTablePrefix[$tableName]); 37 $webserviceField = WebserviceField::fromArray($db, $fieldArray); 38 $webserviceField->setDefault($row->percentage); 39 $this->moduleFields[$webserviceField->getFieldName()] = $webserviceField; 40 } 41 } 42 } 43 } 44 45 function getFieldArrayFromTaxRow($row, $tableName, $prefix) { 46 $field = array(); 47 $field['fieldname'] = $row->taxname; 48 $field['columnname'] = $row->taxname; 49 $field['tablename'] = $tableName; 50 $field['fieldlabel'] = $prefix.$row->taxlabel; 51 $field['displaytype'] = 1; 52 $field['uitype'] = 1; 53 $fieldDataType = 'V'; 54 $typeOfData = $fieldType.'~O'; 55 56 $field['typeofdata'] = $typeOfData; 57 $field['tabid'] = null; 58 $field['fieldid'] = null; 59 $field['masseditable'] = 0; 60 return $field; 61 } 62 63 } 64 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |