当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_DependencyPicklist::getPicklistDependencyDatasource方法代码示例

本文整理汇总了PHP中Vtiger_DependencyPicklist::getPicklistDependencyDatasource方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_DependencyPicklist::getPicklistDependencyDatasource方法的具体用法?PHP Vtiger_DependencyPicklist::getPicklistDependencyDatasource怎么用?PHP Vtiger_DependencyPicklist::getPicklistDependencyDatasource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_DependencyPicklist的用法示例。


在下文中一共展示了Vtiger_DependencyPicklist::getPicklistDependencyDatasource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $moduleList = array('Calendar', 'Events');
     $quickCreateContents = array();
     foreach ($moduleList as $module) {
         $info = array();
         $recordModel = Vtiger_Record_Model::getCleanInstance($module);
         $moduleModel = $recordModel->getModule();
         $fieldList = $moduleModel->getFields();
         $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
         foreach ($requestFieldList as $fieldName => $fieldValue) {
             $fieldModel = $fieldList[$fieldName];
             if ($fieldModel->isEditable()) {
                 $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
             }
         }
         $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
         $info['recordStructureModel'] = $recordStructureInstance;
         $info['recordStructure'] = $recordStructureInstance->getStructure();
         $info['moduleModel'] = $moduleModel;
         $quickCreateContents[$module] = $info;
     }
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer = $this->getViewer($request);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('QUICK_CREATE_CONTENTS', $quickCreateContents);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
     $viewer->view('QuickCreate.tpl', $moduleName);
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:33,代码来源:QuickCreateAjax.php

示例2: process

 public function process(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/QuickCreateAjax.php::process");
     $moduleName = $request->getModule();
     $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer = $this->getViewer($request);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SINGLE_MODULE', 'SINGLE_' . $moduleName);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     echo $viewer->view('QuickCreate.tpl', $moduleName, true);
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:31,代码来源:QuickCreateAjax.php

示例3: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
     } else {
         if (!empty($record)) {
             $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
             $parentId = $request->get('parentId');
             $parentModule = $request->get('parentModule');
             if ($parentId && $parentModule === 'HelpDesk') {
                 $parentRecordModel = Vtiger_Record_Model::getInstanceById($parentId, $parentModule);
                 $recordModel = Faq_Record_Model::getInstanceFromHelpDesk($parentRecordModel);
             }
         }
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $viewMode = $request->get('view_mode');
     if (!empty($viewMode)) {
         $viewer->assign('VIEW_MODE', $viewMode);
     }
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     $viewer->view('EditView.tpl', $moduleName);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:60,代码来源:Edit.php

示例4: process

 public function process(Vtiger_Request $request)
 {
     $adb = PearDatabase::getInstance();
     // get min, max, allow_chars from vtiger_passwords_config
     $result = $adb->query("SELECT * FROM vtiger_passwords_config WHERE 1 LIMIT 1", true);
     $min = $adb->query_result($result, 0, 'pass_length_min');
     $max = $adb->query_result($result, 0, 'pass_length_max');
     $allow_chars = $adb->query_result($result, 0, 'pass_allow_chars');
     $moduleName = $request->getModule();
     $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
     $recordStructure = $recordStructureInstance->getStructure();
     $sourceRelatedField = $moduleModel->getValuesFromSource($moduleName, $request->get('sourceModule'), $request->get('sourceRecord'));
     foreach ($sourceRelatedField as $field => $value) {
         if (isset($recordStructure[$field])) {
             $fieldvalue = $recordStructure[$field]->get('fieldvalue');
             if (empty($fieldvalue)) {
                 $recordStructure[$field]->set('fieldvalue', $value);
                 unset($sourceRelatedField[$field]);
             }
         }
     }
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $relatedModule = 'OSSPasswords';
     $viewer = $this->getViewer($request);
     $viewer->assign('RELATEDMODULE', $relatedModule);
     $viewer->assign('GENERATEPASS', 'Generate Password');
     $viewer->assign('VIEW', $request->get('view'));
     $viewer->assign('GENERATEONCLICK', 'generate_password(' . $min . ',' . $max . ',\'' . $allow_chars . '\'); return false;');
     $viewer->assign('VALIDATE_STRINGS', vtranslate('Very Weak', $relatedModule) . ',' . vtranslate('Weak', $relatedModule) . ',' . vtranslate('Better', $relatedModule) . ',' . vtranslate('Medium', $relatedModule) . ',' . vtranslate('Strong', $relatedModule) . ',' . vtranslate('Very Strong', $relatedModule));
     $viewer->assign('Very Weak', 'Very Weak');
     $viewer->assign('Weak', 'Weak');
     $viewer->assign('Better', 'Better');
     $viewer->assign('Medium', 'Medium');
     $viewer->assign('Strong', 'Strong');
     $viewer->assign('Very Strong', 'Very Strong');
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SINGLE_MODULE', 'SINGLE_' . $moduleName);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructure);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('SCRIPTS', $this->getFooterScripts($request));
     echo $viewer->view('QuickCreate.tpl', $moduleName, true);
 }
开发者ID:HoererUndFlamme,项目名称:YetiForceCRM,代码行数:58,代码来源:QuickCreateAjax.php

示例5: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $moduleList = ['Calendar', 'Events'];
     $quickCreateContents = [];
     foreach ($moduleList as $module) {
         $info = [];
         $recordModel = Vtiger_Record_Model::getCleanInstance($module);
         $moduleModel = $recordModel->getModule();
         $fieldList = $moduleModel->getFields();
         $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
         foreach ($requestFieldList as $fieldName => $fieldValue) {
             $fieldModel = $fieldList[$fieldName];
             if ($fieldModel->isEditable()) {
                 $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
             }
         }
         $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
         $recordStructure = $recordStructureInstance->getStructure();
         $sourceRelatedField = $moduleModel->getValuesFromSource($moduleName, $request->get('sourceModule'), $request->get('sourceRecord'));
         foreach ($sourceRelatedField as $field => $value) {
             if (isset($recordStructure[$field])) {
                 $fieldvalue = $recordStructure[$field]->get('fieldvalue');
                 if (empty($fieldvalue)) {
                     $recordStructure[$field]->set('fieldvalue', $value);
                     unset($sourceRelatedField[$field]);
                 }
             }
         }
         $info['recordStructureModel'] = $recordStructureInstance;
         $info['recordStructure'] = $recordStructure;
         $info['moduleModel'] = $moduleModel;
         $quickCreateContents[$module] = $info;
     }
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer = $this->getViewer($request);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('SOURCE_RELATED_FIELD', $sourceRelatedField);
     $viewer->assign('PREVIOUSDATE', date('Y-n-j', strtotime('yesterday')));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('NEXTDATE', date('Y-n-j', strtotime('tomorrow')));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('QUICK_CREATE_CONTENTS', $quickCreateContents);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('SCRIPTS', $this->getFooterScripts($request));
     $viewer->view('QuickCreate.tpl', $moduleName);
 }
开发者ID:HoererUndFlamme,项目名称:YetiForceCRM,代码行数:49,代码来源:QuickCreateAjax.php

示例6: showMassEditForm

 /**
  * Function returns the mass edit form
  * @param Vtiger_Request $request
  */
 function showMassEditForm(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/MassActionAjax.php::showMassEditForm");
     $moduleName = $request->getModule();
     $cvId = $request->get('viewname');
     $selectedIds = $request->get('selected_ids');
     $excludedIds = $request->get('excluded_ids');
     $viewer = $this->getViewer($request);
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_MASSEDIT);
     $fieldInfo = array();
     $fieldList = $moduleModel->getFields();
     foreach ($fieldList as $fieldName => $fieldModel) {
         $fieldInfo[$fieldName] = $fieldModel->getFieldInfo();
     }
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODE', 'massedit');
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CVID', $cvId);
     $viewer->assign('SELECTED_IDS', $selectedIds);
     $viewer->assign('EXCLUDED_IDS', $excludedIds);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('MASS_EDIT_FIELD_DETAILS', $fieldInfo);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $searchKey = $request->get('search_key');
     $searchValue = $request->get('search_value');
     $operator = $request->get('operator');
     if (!empty($operator)) {
         $viewer->assign('OPERATOR', $operator);
         $viewer->assign('ALPHABET_VALUE', $searchValue);
         $viewer->assign('SEARCH_KEY', $searchKey);
     }
     $searchParams = $request->get('search_params');
     if (!empty($searchParams)) {
         $viewer->assign('SEARCH_PARAMS', $searchParams);
     }
     echo $viewer->view('MassEditForm.tpl', $moduleName, true);
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:48,代码来源:MassActionAjax.php

示例7: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer = $this->getViewer($request);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $recordStructure = $recordStructureInstance->getStructure();
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $sourceRelatedField = $moduleModel->getValuesFromSource($moduleName, $request->get('sourceModule'), $request->get('sourceRecord'));
     foreach ($sourceRelatedField as $field => &$value) {
         if (isset($recordStructure[$field])) {
             $fieldvalue = $recordStructure[$field]->get('fieldvalue');
             if (empty($fieldvalue)) {
                 $recordStructure[$field]->set('fieldvalue', $value);
                 unset($sourceRelatedField[$field]);
             }
         }
     }
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('SOURCE_RELATED_FIELD', $sourceRelatedField);
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SINGLE_MODULE', 'SINGLE_' . $moduleName);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructure);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('VIEW', $request->get('view'));
     $viewer->assign('SCRIPTS', $this->getFooterScripts($request));
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     echo $viewer->view('QuickCreate.tpl', $moduleName, true);
 }
开发者ID:HoererUndFlamme,项目名称:YetiForceCRM,代码行数:44,代码来源:QuickCreateAjax.php

示例8: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $sourceRecord = $request->get('sourceRecord');
     $sourceModule = $request->get('sourceModule');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = Inventory_Record_Model::getInstanceById($record, $moduleName);
         $currencyInfo = $recordModel->getCurrencyInfo();
         $taxes = $recordModel->getProductTaxes();
         $relatedProducts = $recordModel->getProducts();
         $viewer->assign('MODE', '');
         //While Duplicating record, If the related record is deleted then we are removing related record info in record model
         $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels();
         foreach ($mandatoryFieldModels as $fieldModel) {
             if ($fieldModel->isReferenceField()) {
                 $fieldName = $fieldModel->get('name');
                 if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) {
                     $recordModel->set($fieldName, '');
                 }
             }
         }
     } elseif (!empty($record)) {
         $recordModel = Inventory_Record_Model::getInstanceById($record, $moduleName);
         $currencyInfo = $recordModel->getCurrencyInfo();
         $taxes = $recordModel->getProductTaxes();
         $relatedProducts = $recordModel->getProducts();
         $viewer->assign('RECORD_ID', $record);
         $viewer->assign('MODE', 'edit');
     } elseif ($request->get('salesorder_id') || $request->get('quote_id')) {
         if ($request->get('salesorder_id')) {
             $referenceId = $request->get('salesorder_id');
         } else {
             $referenceId = $request->get('quote_id');
         }
         $parentRecordModel = Inventory_Record_Model::getInstanceById($referenceId);
         $currencyInfo = $parentRecordModel->getCurrencyInfo();
         $taxes = $parentRecordModel->getProductTaxes();
         $relatedProducts = $parentRecordModel->getProducts();
         $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
         $recordModel->setRecordFieldValues($parentRecordModel);
     } else {
         $taxes = Inventory_Module_Model::getAllProductTaxes();
         $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
         $viewer->assign('MODE', '');
         //The creation of Inventory record from action and Related list of product/service detailview the product/service details will calculated by following code
         if ($request->get('product_id') || $sourceModule === 'Products') {
             if ($sourceRecord) {
                 $productRecordModel = Products_Record_Model::getInstanceById($sourceRecord);
             } else {
                 $productRecordModel = Products_Record_Model::getInstanceById($request->get('product_id'));
             }
             $relatedProducts = $productRecordModel->getDetailsForInventoryModule($recordModel);
         } elseif ($request->get('service_id') || $sourceModule === 'Services') {
             if ($sourceRecord) {
                 $serviceRecordModel = Services_Record_Model::getInstanceById($sourceRecord);
             } else {
                 $serviceRecordModel = Services_Record_Model::getInstanceById($request->get('service_id'));
             }
             $relatedProducts = $serviceRecordModel->getDetailsForInventoryModule($recordModel);
         } elseif ($sourceRecord && ($sourceModule === 'Accounts' || $sourceModule === 'Contacts' || $sourceModule === 'Potentials' || $sourceModule === 'Vendors' && $moduleName === 'PurchaseOrder')) {
             $parentRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
             $recordModel->setParentRecordData($parentRecordModel);
         }
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     //get the inventory terms and conditions
     $inventoryRecordModel = Inventory_Record_Model::getCleanInstance($moduleName);
     $termsAndConditions = $inventoryRecordModel->getInventoryTermsandConditions();
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $viewer->assign('VIEW_MODE', "fullForm");
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $sourceModule);
         $viewer->assign('SOURCE_RECORD', $sourceRecord);
     }
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $viewer->assign('IS_DUPLICATE', true);
     } else {
         $viewer->assign('IS_DUPLICATE', false);
     }
     $currencies = Inventory_Module_Model::getAllCurrencies();
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
//.........这里部分代码省略.........
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:101,代码来源:Edit.php

示例9: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
         $recordModel->set('id', '');
         //While Duplicating record, If the related record is deleted then we are removing related record info in record model
         $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels();
         foreach ($mandatoryFieldModels as $fieldModel) {
             if ($fieldModel->isReferenceField()) {
                 $fieldName = $fieldModel->get('name');
                 if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) {
                     $recordModel->set($fieldName, '');
                 }
             }
         }
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $referenceId = $request->get('reference_id');
             if ($referenceId) {
                 $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId);
                 $recordModel->setRecordFieldValues($parentRecordModel);
             }
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('MODULE_TYPE', $moduleModel->getModuleType());
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('APIADDRESS', Settings_ApiAddress_Module_Model::getInstance('Settings:ApiAddress')->getConfig());
     $viewer->assign('APIADDRESS_ACTIVE', Settings_ApiAddress_Module_Model::isActive());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     $viewer->view('EditView.tpl', $moduleName);
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:87,代码来源:Edit.php

示例10: vtlib_purify

    $smarty->assign("viewOption", vtlib_purify($_REQUEST['viewOption']));
}
if (isset($_REQUEST['subtab']) && $_REQUEST['subtab'] != '') {
    $smarty->assign("subtab", vtlib_purify($_REQUEST['subtab']));
}
if (isset($_REQUEST['maintab']) && $_REQUEST['maintab'] != '') {
    $smarty->assign("maintab", vtlib_purify($_REQUEST['maintab']));
}
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=" . session_id() . $GLOBALS['request_string']);
$smarty->assign("ID", $focus->id);
$tabid = getTabid($tab_type);
$validationData = getDBValidationData($focus->tab_name, $tabid);
$data = split_validationdataArray($validationData);
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->assign("DUPLICATE", vtlib_purify($_REQUEST['isDuplicate']));
if ($activity_mode == 'Task') {
    $custom_fields_data = getCalendarCustomFields(getTabid('Calendar'), 'edit', $focus->column_fields);
} else {
    $custom_fields_data = getCalendarCustomFields(getTabid('Events'), 'edit', $focus->column_fields);
}
$smarty->assign("CUSTOM_FIELDS_DATA", $custom_fields_data);
$smarty->assign("REPEAT_LIMIT_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($tab_type);
$smarty->assign("PICKIST_DEPENDENCY_DATASOURCE", Zend_Json::encode($picklistDependencyDatasource));
// Gather the help information associated with fields
$smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule));
// END
$smarty->display("ActivityEditView.tpl");
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:31,代码来源:EditView.php

示例11: FieldDependencies

</div>
<script>
	//for move addEventUI
	var theEventHandle = document.getElementById("moveEvent");
	var theEventRoot   = document.getElementById("addEvent");
	Drag.init(theEventHandle, theEventRoot);

	//for move addToDo
	var theTodoHandle = document.getElementById("moveTodo");
	var theTodoRoot   = document.getElementById("createTodo");
	Drag.init(theTodoHandle, theTodoRoot);
</script>

<?php 
$picklistDependencyDSEvents = Vtiger_DependencyPicklist::getPicklistDependencyDatasource('Events');
$picklistDependencyDSCalendar = Vtiger_DependencyPicklist::getPicklistDependencyDatasource('Calendar');
?>
<script type="text/javascript" src="include/js/FieldDependencies.js"></script>
<script type="text/javascript" src="modules/com_vtiger_workflow/resources/jquery-1.2.6.js"></script>
<script type="text/javascript">
	jQuery.noConflict();
</script>
<script type="text/javascript">
	jQuery(document).ready(function() { 
		<?php 
if (!empty($picklistDependencyDSEvents)) {
    ?>
		(new FieldDependencies(<?php 
    echo Zend_Json::encode($picklistDependencyDSEvents);
    ?>
)).init();
开发者ID:jgjermeni,项目名称:corebos,代码行数:31,代码来源:addEventUI.php

示例12: getJSPicklistDependencyDatasource

 static function getJSPicklistDependencyDatasource($module)
 {
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($module);
     return Zend_Json::encode($picklistDependencyDatasource);
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:5,代码来源:DependentPickListUtils.php

示例13: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
         //While Duplicating record, If the related record is deleted then we are removing related record info in record model
         $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels();
         foreach ($mandatoryFieldModels as $fieldModel) {
             if ($fieldModel->isReferenceField()) {
                 $fieldName = $fieldModel->get('name');
                 if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) {
                     $recordModel->set($fieldName, '');
                 }
             }
         }
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     // SalesPlatform.ru begin Unifying method for EditView preparing
     $recordModel = prepareEditView($recordModel, $_REQUEST, $viewer);
     // SalesPlatform.ru end
     // SalesPlatform.ru begin Set company
     if ($request->get('relationOperation')) {
         $sourceRecordModel = Vtiger_Record_Model::getInstanceById($request->get('sourceRecord'));
         if ($sourceRecordModel->get('spcompany') != null && $sourceRecordModel->get('spcompany') != '') {
             if ($recordModel->getField('spcompany')) {
                 $recordModel->set('spcompany', $sourceRecordModel->get('spcompany'));
             }
         }
     }
     // SalesPlatform.ru end
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     // SalesPlatform.ru begin Field Validation Information
     $tabid = getTabid($moduleName);
     $validationData = getDBValidationData($recordModel->get('tab_name'), $tabid);
     $validationArray = split_validationdataArray($validationData);
     $viewer->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
     $viewer->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
     $viewer->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
     $viewer->assign('ID', $record);
     // SalesPlatform.ru end
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     // SalesPlatform.ru begin enable/disable button Import
     $instance = Vtiger_Module::getInstance('SPSocialConnector');
     $fl_import_button = true;
     if (empty($record) || $instance->presence == 1) {
         $fl_import_button = false;
     }
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:101,代码来源:Edit.php

示例14: process

 public function process(Vtiger_Request $request)
 {
     $adb = PearDatabase::getInstance();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('RECORD_MODEL', $recordModel);
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', vglobal('upload_maxsize') / 1000000);
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     // check if passwords are encrypted
     if (file_exists('modules/OSSPasswords/config.ini')) {
         // encryption key exists so passwords are encrypted
         $config = parse_ini_file('modules/OSSPasswords/config.ini');
         // let smarty know that passwords are encrypted
         $viewer->assign('ENCRYPTED', true);
         $viewer->assign('ENC_KEY', $config['key']);
         $viewer->assign('RECORD', $_GET['record']);
         $viewer->assign('VIEW', $_GET['view']);
     } else {
         $viewer->assign('ENCRYPTED', false);
         $viewer->assign('ENC_KEY', '');
         $viewer->assign('RECORD', $_GET['record']);
         $viewer->assign('VIEW', $_GET['view']);
     }
     // widget button
     // get min, max, allow_chars from vtiger_passwords_config
     $result = $adb->query("SELECT * FROM vtiger_passwords_config WHERE 1 LIMIT 1", true);
     $min = $adb->query_result($result, 0, 'pass_length_min');
     $max = $adb->query_result($result, 0, 'pass_length_max');
     $allow_chars = $adb->query_result($result, 0, 'pass_allow_chars');
     $GenerateButton = 'Generate Password';
     $ConfigureButton = 'LBL_ConfigurePass';
     $viewer = $this->getViewer($request);
     $viewer->assign('GENERATEPASS', $GenerateButton);
     $viewer->assign('GENERATEONCLICK', 'generate_password(' . $min . ',' . $max . ',\'' . $allow_chars . '\');');
     $viewer->view('EditView.tpl', $moduleName);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:95,代码来源:Edit.php

示例15: process


//.........这里部分代码省略.........
         $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
         $viewer->assign('MODE', '');
         //The creation of Inventory record from action and Related list of product/service detailview the product/service details will calculated by following code
         if ($request->get('product_id') || $sourceModule === 'Products') {
             if ($sourceRecord) {
                 $productRecordModel = Products_Record_Model::getInstanceById($sourceRecord);
             } else {
                 $productRecordModel = Products_Record_Model::getInstanceById($request->get('product_id'));
             }
             $relatedProducts = $productRecordModel->getDetailsForInventoryModule($recordModel);
         } elseif ($request->get('service_id') || $sourceModule === 'Services') {
             if ($sourceRecord) {
                 $serviceRecordModel = Services_Record_Model::getInstanceById($sourceRecord);
             } else {
                 $serviceRecordModel = Services_Record_Model::getInstanceById($request->get('service_id'));
             }
             $relatedProducts = $serviceRecordModel->getDetailsForInventoryModule($recordModel);
         } elseif ($sourceRecord && ($sourceModule === 'Accounts' || $sourceModule === 'Contacts' || $sourceModule === 'Potentials' || $sourceModule === 'Vendors' && $moduleName === 'PurchaseOrder')) {
             $parentRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
             $recordModel->setParentRecordData($parentRecordModel);
         }
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     //get the inventory terms and conditions
     $inventoryRecordModel = Inventory_Record_Model::getCleanInstance($moduleName);
     $termsAndConditions = $inventoryRecordModel->getInventoryTermsandConditions();
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     // SalesPlatform.ru begin Set default invoice status for SalesOrder
     if ($moduleName == "SalesOrder") {
         if (empty($record)) {
             $recordModel->set("invoicestatus", "AutoCreated");
         } else {
             $checkbox = $recordModel->get("enable_recurring");
             if ($checkbox != 1) {
                 $recordModel->set("invoicestatus", "AutoCreated");
             }
         }
     }
     // SalesPlatform.ru end
     // SalesPlatform.ru begin Unifying method for EditView preparing
     $recordModel = prepareEditView($recordModel, $_REQUEST, $viewer);
     // SalesPlatform.ru end
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     // SalesPlatform.ru begin Field Validation Information
     $tabid = getTabid($moduleName);
     $validationData = getDBValidationData($recordModel->get('tab_name'), $tabid);
     $validationArray = split_validationdataArray($validationData);
     $viewer->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
     $viewer->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
     $viewer->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
     $viewer->assign('ID', $record);
     // SalesPlatform.ru end
     $viewer->assign('VIEW_MODE', "fullForm");
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     //SalesPlatform.ru begin add relation create for Act from Invoice
     $isFromInvoiceCreate = $request->get('convertFromInvoice');
     $viewer->assign('IS_FROM_INVOICE_CREATE', $isFromInvoiceCreate);
     //SalesPlatform.ru end
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     //SalesPlatform.ru begin add relation create for Act from Invoice
     if ($isRelationOperation || $isFromInvoiceCreate) {
         //if($isRelationOperation)
         //SalesPlatform.ru end
         $viewer->assign('SOURCE_MODULE', $sourceModule);
         $viewer->assign('SOURCE_RECORD', $sourceRecord);
     }
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $viewer->assign('IS_DUPLICATE', true);
     } else {
         $viewer->assign('IS_DUPLICATE', false);
     }
     $currencies = Inventory_Module_Model::getAllCurrencies();
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('RELATED_PRODUCTS', $relatedProducts);
     $viewer->assign('SHIPPING_TAXES', $shippingTaxes);
     $viewer->assign('TAXES', $taxes);
     $viewer->assign('CURRENCINFO', $currencyInfo);
     $viewer->assign('CURRENCIES', $currencies);
     $viewer->assign('TERMSANDCONDITIONS', $termsAndConditions);
     $productModuleModel = Vtiger_Module_Model::getInstance('Products');
     $viewer->assign('PRODUCT_ACTIVE', $productModuleModel->isActive());
     $serviceModuleModel = Vtiger_Module_Model::getInstance('Services');
     $viewer->assign('SERVICE_ACTIVE', $serviceModuleModel->isActive());
     $viewer->view('EditView.tpl', 'Inventory');
 }
开发者ID:Wasage,项目名称:werpa,代码行数:101,代码来源:Edit.php


注:本文中的Vtiger_DependencyPicklist::getPicklistDependencyDatasource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。