本文整理汇总了PHP中Vtiger_DependencyPicklist类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_DependencyPicklist类的具体用法?PHP Vtiger_DependencyPicklist怎么用?PHP Vtiger_DependencyPicklist使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_DependencyPicklist类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例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);
}
示例3: 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);
}
示例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);
}
示例5: checkCyclicDependency
public function checkCyclicDependency(Vtiger_Request $request)
{
$module = $request->get('sourceModule');
$sourceField = $request->get('sourcefield');
$targetField = $request->get('targetfield');
$result = Vtiger_DependencyPicklist::checkCyclicDependency($module, $sourceField, $targetField);
$response = new Vtiger_Response();
$response->setResult(array('result' => $result));
$response->emit();
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: getListViewEntries
/**
* Function to get the list view entries
* @param Vtiger_Paging_Model $pagingModel
* @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance.
*/
public function getListViewEntries($pagingModel)
{
$forModule = $this->get('formodule');
$dependentPicklists = Vtiger_DependencyPicklist::getDependentPicklistFields($forModule);
$noOfRecords = count($dependentPicklists);
$recordModelClass = Vtiger_Loader::getComponentClassName('Model', 'Record', 'Settings:PickListDependency');
$listViewRecordModels = array();
for ($i = 0; $i < $noOfRecords; $i++) {
$record = new $recordModelClass();
$module = $dependentPicklists[$i]['module'];
unset($dependentPicklists[$i]['module']);
$record->setData($dependentPicklists[$i]);
$record->set('sourceModule', $module);
$record->set('sourceLabel', vtranslate($module, $module));
$listViewRecordModels[] = $record;
}
$pagingModel->calculatePageRange($listViewRecordModels);
return $listViewRecordModels;
}
示例10: Events
//.........这里部分代码省略.........
} else {
if (!empty($record)) {
$recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
$viewer->assign('MODE', 'edit');
$viewer->assign('RECORD_ID', $record);
} else {
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$viewer->assign('MODE', '');
}
}
$eventModule = Vtiger_Module_Model::getInstance($moduleName);
$recordModel->setModuleFromInstance($eventModule);
$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 (empty($record) && ($fieldName == 'time_start' || $fieldName == 'time_end') && !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 (empty($record) && ($fieldName == 'date_start' || $fieldName == 'due_date') && !empty($fieldValue)) {
if ($fieldName == 'date_start') {
$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);
} else {
$endTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_end']);
$endDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $endTime);
list($endDate, $endTime) = explode(' ', $endDateTime);
$fieldValue = Vtiger_Date_UIType::getDisplayDateValue($endDate);
}
}
if ($fieldModel->isEditable() || $specialField) {
$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);
}
$userChangedEndDateTime = $request->get('userChangedEndDateTime');
//If followup value is passed from request to process the value and sent to client
$requestFollowUpDate = $request->get('followup_date_start');
$requestFollowUpTime = $request->get('followup_time_start');
$followUpStatus = $request->get('followup');
$eventStatus = $request->get('eventstatus');
if (!empty($requestFollowUpDate)) {
$followUpDate = $requestFollowUpDate;
}
if (!empty($requestFollowUpTime)) {
$followUpTime = $requestFollowUpTime;
}
if ($followUpStatus == 'on') {
$viewer->assign('FOLLOW_UP_STATUS', TRUE);
}
if ($eventStatus == 'Held') {
$viewer->assign('SHOW_FOLLOW_UP', TRUE);
} else {
$viewer->assign('SHOW_FOLLOW_UP', FALSE);
}
$viewer->assign('USER_CHANGED_END_DATE_TIME', $userChangedEndDateTime);
$viewer->assign('FOLLOW_UP_DATE', $followUpDate);
$viewer->assign('FOLLOW_UP_TIME', $followUpTime);
$viewer->assign('RECURRING_INFORMATION', $recordModel->getRecurrenceInformation());
$viewer->assign('TOMORROWDATE', Vtiger_Date_UIType::getDisplayDateValue(date('Y-m-d', time() + 86400)));
$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());
$existingRelatedContacts = $recordModel->getRelatedContactInfo();
//To add contact ids that is there in the request . Happens in gotoFull form mode of quick create
$requestContactIdValue = $request->get('contact_id');
if (!empty($requestContactIdValue)) {
$existingRelatedContacts[] = array('name' => Vtiger_Util_Helper::getRecordName($requestContactIdValue), 'id' => $requestContactIdValue);
}
$viewer->assign('RELATED_CONTACTS', $existingRelatedContacts);
$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'));
}
$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
$accessibleUsers = $currentUser->getAccessibleUsers();
$viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
$viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
$viewer->assign('INVITIES_SELECTED', $recordModel->getInvities());
$viewer->assign('CURRENT_USER', $currentUser);
$viewer->view('EditView.tpl', $moduleName);
}
示例11: delete
public function delete()
{
Vtiger_DependencyPicklist::deletePickListDependencies($this->get('sourceModule'), $this->get('sourcefield'), $this->get('targetfield'));
return true;
}
示例12: 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());
//.........这里部分代码省略.........
示例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', '');
$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);
}
示例14: 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");
示例15: 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();