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


PHP Vtiger_Date_UIType::getDisplayDateValue方法代码示例

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


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

示例1: getListViewEntries

 public function getListViewEntries($pagingModel)
 {
     $db = PearDatabase::getInstance();
     $moduleModel = Vtiger_Module_Model::getInstance('Portal');
     $listQuery = $this->getQuery();
     $startIndex = $pagingModel->getStartIndex();
     $pageLimit = $pagingModel->getPageLimit();
     $orderBy = $this->get('orderby');
     $sortOrder = $this->get('sortorder');
     if (!empty($orderBy)) {
         $listQuery .= ' ORDER BY ' . $orderBy . ' ' . $sortOrder;
     }
     $listQuery .= " LIMIT {$startIndex}," . $pageLimit;
     $listResult = $db->pquery($listQuery, array());
     $listViewEntries = array();
     while ($row = $db->fetchByAssoc($listResult)) {
         $listViewEntries[$row['portalid']] = array();
         $listViewEntries[$row['portalid']]['portalname'] = $row['portalname'];
         $listViewEntries[$row['portalid']]['portalurl'] = $row['portalurl'];
         $listViewEntries[$row['portalid']]['createdtime'] = Vtiger_Date_UIType::getDisplayDateValue($row['createdtime']);
     }
     $index = 0;
     foreach ($listViewEntries as $recordId => $record) {
         $rawData = $db->query_result_rowdata($listResult, $index++);
         $record['id'] = $recordId;
         $listViewRecordModels[$recordId] = $moduleModel->getRecordFromArray($record, $rawData);
     }
     return $listViewRecordModels;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:29,代码来源:ListView.php

示例2: preProcess

 function preProcess(Vtiger_Request $request, $display = true)
 {
     parent::preProcess($request, false);
     $viewer = $this->getViewer($request);
     $menuModelsList = Vtiger_Menu_Model::getAll(true);
     $selectedModule = $request->getModule();
     $menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, $selectedModule);
     $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
     $companyLogo = $companyDetails->getLogo();
     $currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
     $viewer->assign('CURRENTDATE', $currentDate);
     $viewer->assign('MODULE', $selectedModule);
     $viewer->assign('MODULE_NAME', $selectedModule);
     $viewer->assign('QUALIFIED_MODULE', $selectedModule);
     $viewer->assign('PARENT_MODULE', $request->get('parent'));
     $viewer->assign('VIEW', $request->get('view'));
     // Order by pre-defined automation process for QuickCreate.
     uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
     $viewer->assign('MENUS', $menuModelsList);
     $viewer->assign('MENU_STRUCTURE', $menuStructure);
     $viewer->assign('MENU_SELECTED_MODULENAME', $selectedModule);
     $viewer->assign('MENU_TOPITEMS_LIMIT', $menuStructure->getLimit());
     $viewer->assign('COMPANY_LOGO', $companyLogo);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $homeModuleModel = Vtiger_Module_Model::getInstance('Home');
     $viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
     $viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
     $viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
     $viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
     if ($display) {
         $this->preProcessDisplay($request);
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:33,代码来源:Basic.php

示例3: preProcess

 function preProcess(Vtiger_Request $request, $display = true)
 {
     parent::preProcess($request, false);
     $viewer = $this->getViewer($request);
     $selectedModule = $request->getModule();
     $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
     $companyLogo = $companyDetails->getLogo();
     $currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
     $viewer->assign('CURRENTDATE', $currentDate);
     $viewer->assign('MODULE', $selectedModule);
     $viewer->assign('MODULE_NAME', $selectedModule);
     $viewer->assign('QUALIFIED_MODULE', $selectedModule);
     $viewer->assign('PARENT_MODULE', $request->get('parent'));
     $viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
     $viewer->assign('VIEW', $request->get('view'));
     $viewer->assign('COMPANY_LOGO', $companyLogo);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $homeModuleModel = Vtiger_Module_Model::getInstance('Home');
     $viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
     $viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
     $viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
     $viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
     $viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));
     if ($display) {
         $this->preProcessDisplay($request);
     }
 }
开发者ID:artisan4710,项目名称:YetiForceCRM,代码行数:27,代码来源:Basic.php

示例4: preProcess

	public function preProcess(Vtiger_Request $request, $display=true) {
		if($this->checkPermission($request)) {
			$viewer = $this->getViewer($request);
			$currentUser = Users_Record_Model::getCurrentUserModel();
			$selectedModule = $request->getModule();
			$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
			$companyLogo = $companyDetails->getLogo();
			$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
			$viewer->assign('CURRENTDATE', $currentDate);
			$viewer->assign('MODULE', $selectedModule);
			$viewer->assign('MODULE_NAME', $selectedModule);
			$viewer->assign('QUALIFIED_MODULE', $selectedModule);
			$viewer->assign('PARENT_MODULE', $request->get('parent'));
			$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
			$viewer->assign('VIEW', $request->get('view'));
			$viewer->assign('COMPANY_LOGO',$companyLogo);
			$viewer->assign('USER_MODEL', $currentUser);
			
			$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
			$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
			$viewer->assign('HEADER_LINKS',$this->getHeaderLinks());
			$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
			$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
			$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));

			//Additional parameters
			$recordId = $request->get('record');
			$moduleName = $request->getModule();
			$detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
			$recordModel = $detailViewModel->getRecord();
			$detailViewLinkParams = array('MODULE'=>$moduleName,'RECORD'=>$recordId);
			$detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
			$viewer->assign('RECORD', $recordModel);
			$viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
			$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
			$viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
			$viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));

			$linkParams = array('MODULE'=>$moduleName, 'ACTION'=>$request->get('view'));
			$linkModels = $detailViewModel->getSideBarLinks($linkParams);
			$viewer->assign('QUICK_LINKS', $linkModels);
			$viewer->assign('PAGETITLE', $this->getPageTitle($request));
			$viewer->assign('FOOTER_SCRIPTS',$this->getFooterScripts($request));
			$viewer->assign('STYLES',$this->getHeaderCss($request));
			$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
			$viewer->assign('CURRENT_VIEW', $request->get('view'));
			$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
			$viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
			$viewer->assign('LANGUAGE', $currentUser->get('language'));
			$viewer->assign('HEADER_SCRIPTS',$this->getHeaderScripts($request));
			if($display) {
				$this->preProcessDisplay($request);
			}
		}
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:55,代码来源:PreferenceDetail.php

示例5: preProcess

	public function preProcess(Vtiger_Request $request, $display = true)
	{
		if ($this->checkPermission($request)) {
			$currentUser = Users_Record_Model::getCurrentUserModel();
			$viewer = $this->getViewer($request);

			$selectedModule = $request->getModule();
			$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
			$companyLogo = $companyDetails->getLogo();
			$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
			$viewer->assign('CURRENTDATE', $currentDate);
			$viewer->assign('MODULE', $selectedModule);
			$viewer->assign('MODULE_NAME', $selectedModule);
			$viewer->assign('QUALIFIED_MODULE', $selectedModule);
			$viewer->assign('PARENT_MODULE', $request->get('parent'));
			$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
			$viewer->assign('VIEW', $request->get('view'));
			$viewer->assign('COMPANY_LOGO', $companyLogo);
			$viewer->assign('USER_MODEL', $currentUser);

			$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
			$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
			$viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
			$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
			$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
			$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));

			//Additional parameters
			$viewer->assign('CURRENT_VIEW', $request->get('view'));
			$viewer->assign('PAGETITLE', $this->getPageTitle($request));
			$viewer->assign('FOOTER_SCRIPTS', $this->getFooterScripts($request));
			$viewer->assign('STYLES', $this->getHeaderCss($request));
			$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
			$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
			$viewer->assign('IS_PREFERENCE', true);
			$viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
			$viewer->assign('LANGUAGE', $currentUser->get('language'));

			$allUsers = Users_Record_Model::getAll(true);
			$sharedUsers = Calendar_Module_Model::getCaledarSharedUsers($currentUser->id);
			$sharedType = Calendar_Module_Model::getSharedType($currentUser->id);
			$viewer->assign('ALL_USERS', $allUsers);
			$viewer->assign('SHAREDUSERS', $sharedUsers);
			$viewer->assign('SHARED_TYPE', $sharedType);
			$viewer->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request));
			if ($display) {
				$this->preProcessDisplay($request);
			}
		}
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:50,代码来源:PreferenceEdit.php

示例6: if

<?php if ($_valid && !is_callable('content_56059e760aa14')) {function content_56059e760aa14($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["dateFormat"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format'), null, 0);?>
<?php $_smarty_tpl->tpl_vars["currentDate"] = new Smarty_variable(Vtiger_Date_UIType::getDisplayDateValue(''), null, 0);?>
<?php $_smarty_tpl->tpl_vars["time"] = new Smarty_variable(Vtiger_Time_UIType::getDisplayTimeValue(null), null, 0);?>
<?php $_smarty_tpl->tpl_vars["currentTimeInVtigerFormat"] = new Smarty_variable(Vtiger_Time_UIType::getTimeValueInAMorPM($_smarty_tpl->tpl_vars['time']->value), null, 0);?>
<?php if ($_smarty_tpl->tpl_vars['COUNTER']->value==2){?>
</tr><tr class="<?php if (!($_smarty_tpl->tpl_vars['SHOW_FOLLOW_UP']->value)){?>hide <?php }?>followUpContainer massEditActiveField">
	<?php $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(1, null, 0);?>
<?php }else{ ?>
	<?php $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable($_smarty_tpl->tpl_vars['COUNTER']->value+1, null, 0);?>
<?php }?>
<?php ob_start();?><?php echo vtranslate('LBL_HOLD_FOLLOWUP_ON',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars['FOLLOW_UP_LABEL'] = new Smarty_variable($_tmp1, null, 0);?>
<td class="fieldLabel">
	<label class="muted pull-right marginRight10px">
		<input name="followup" type="checkbox" class="alignTop" <?php if ($_smarty_tpl->tpl_vars['FOLLOW_UP_STATUS']->value){?> checked<?php }?>/>
		<?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_LABEL']->value;?>

	</label>	
</td>
<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_LABEL']->value;?>
<?php $_tmp2=ob_get_clean();?><?php $_smarty_tpl->createLocalArrayVariable('FIELD_INFO', null, 0);
$_smarty_tpl->tpl_vars['FIELD_INFO']->value['label'] = $_tmp2;?>
<td class="fieldValue">
	<div>
		<div class="input-append row-fluid">
			<div class="span10 row-fluid date">
				<input name="followup_date_start" type="text" class="span9 dateField" data-date-format="<?php echo $_smarty_tpl->tpl_vars['dateFormat']->value;?>
" type="text"  data-fieldinfo= '<?php echo Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value));?>
'
					   value="<?php if (!empty($_smarty_tpl->tpl_vars['FOLLOW_UP_DATE']->value)){?><?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_DATE']->value;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['currentDate']->value;?>
<?php }?>" data-validation-engine="validate[funcCall[Vtiger_greaterThanDependentField_Validator_Js.invokeValidation]]" />
				<span class="add-on"><i class="icon-calendar"></i></span>
			</div>	
		</div>		
	</div>
	<div>
		<div class="input-append time">
			<input type="text" name="followup_time_start" class="timepicker-default input-small" 
				   value="<?php if (!empty($_smarty_tpl->tpl_vars['FOLLOW_UP_TIME']->value)){?><?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_TIME']->value;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['currentTimeInVtigerFormat']->value;?>
<?php }?>" />
			<span class="add-on cursorPointer">
				<i class="icon-time"></i>
			</span>
		</div>	
	</div>
</td>
<td></td><td></td><?php }} ?>
开发者ID:jeremyevans6,项目名称:kulturedTiger-,代码行数:50,代码来源:049059a7f7cc56add07f33ccecce5661b1f7109b.file.FollowUp.tpl.php

示例7: getDrafts

 public function getDrafts($page, $limit, $folder, $where = null)
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $handler = vtws_getModuleHandlerFromName('Emails', $currentUserModel);
     $meta = $handler->getMeta();
     if (!$meta->hasReadAccess()) {
         return false;
     }
     if (!empty($page)) {
         $limitClause = "LIMIT " . $limit * $page . ", " . $limit;
     } else {
         $limitClause = "LIMIT 0, " . $limit;
     }
     $query = "SELECT * FROM Emails where email_flag='SAVED' {$where} {$limitClause};";
     $draftMails = vtws_query($query, $currentUserModel);
     for ($i = 0; $i < count($draftMails); $i++) {
         foreach ($draftMails[$i] as $fieldname => $fieldvalue) {
             if ($fieldname == "saved_toid" || $fieldname == "ccmail" || $fieldname == "bccmail") {
                 if (!empty($fieldvalue)) {
                     $value = implode(',', Zend_Json::decode($fieldvalue));
                     if (strlen($value) > 45) {
                         $value = substr($value, 0, 45) . "....";
                     }
                     $draftMails[$i][$fieldname] = $value;
                 }
             } elseif ($fieldname == "date_start") {
                 if (!empty($fieldvalue)) {
                     $value = Vtiger_Date_UIType::getDisplayDateValue($fieldvalue);
                     $draftMails[$i][$fieldname] = $value;
                 }
             } elseif ($fieldname == "id") {
                 $emailId = vtws_getIdComponents($fieldvalue);
                 $draftMails[$i][$fieldname] = $emailId[1];
             }
         }
     }
     if ($where) {
         $folder->setPaging($limit * $page + 1, $limit * $page + $limit, $limit, count($draftMails), $page);
     } else {
         $total = $this->getTotalDraftCount();
         $folder->setPaging($limit * $page + 1, $limit * $page + $limit, $limit, $total, $page);
     }
     $folder->setMails($draftMails);
     return $draftMails;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:45,代码来源:Draft.php

示例8: process

    public function process(Vtiger_Request $request)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $qualifiedModuleName = $request->getModule(false);
        $recordId = $request->get('task_id');
        $workflowId = $request->get('for_workflow');
        $workflowModel = Settings_Workflows_Record_Model::getInstance($workflowId);
        $taskTypes = $workflowModel->getTaskTypes();
        if ($recordId) {
            $taskModel = Settings_Workflows_TaskRecord_Model::getInstance($recordId);
        } else {
            $taskType = $request->get('type');
            if (empty($taskType)) {
                $taskType = !empty($taskTypes[0]) ? $taskTypes[0]->getName() : 'VTEmailTask';
            }
            $taskModel = Settings_Workflows_TaskRecord_Model::getCleanInstance($workflowModel, $taskType);
        }
        $taskTypeModel = $taskModel->getTaskType();
        $viewer->assign('TASK_TYPE_MODEL', $taskTypeModel);
        $viewer->assign('TASK_TEMPLATE_PATH', $taskTypeModel->getTemplatePath());
        $recordStructureInstance = Settings_Workflows_RecordStructure_Model::getInstanceForWorkFlowModule($workflowModel, Settings_Workflows_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDITTASK);
        $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
        $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
        $moduleModel = $workflowModel->getModule();
        $dateTimeFields = $moduleModel->getFieldsByType(array('date', 'datetime'));
        $taskObject = $taskModel->getTaskObject();
        $taskType = get_class($taskObject);
        if ($taskType === 'VTCreateEntityTask') {
            if ($taskObject->entity_type) {
                $relationModuleModel = Vtiger_Module_Model::getInstance($taskObject->entity_type);
                $ownerFieldModels = $relationModuleModel->getFieldsByType('owner');
                $fieldMapping = Zend_Json::decode($taskObject->field_value_mapping);
                foreach ($fieldMapping as $key => $mappingInfo) {
                    if (array_key_exists($mappingInfo['fieldname'], $ownerFieldModels)) {
                        $userRecordModel = Users_Record_Model::getInstanceByName($mappingInfo['value']);
                        if ($userRecordModel) {
                            $ownerName = $userRecordModel->getId();
                        } else {
                            $groupRecordModel = Settings_Groups_Record_Model::getInstance($mappingInfo['value']);
                            $ownerName = $groupRecordModel->getId();
                        }
                        $fieldMapping[$key]['value'] = $ownerName;
                    }
                }
                $taskObject->field_value_mapping = Zend_Json::encode($fieldMapping);
            }
        }
        if ($taskType === 'VTUpdateFieldsTask') {
            if ($moduleModel->getName() == "Documents") {
                $restrictFields = array('folderid', 'filename', 'filelocationtype');
                $viewer->assign('RESTRICTFIELDS', $restrictFields);
            }
        }
        $viewer->assign('SOURCE_MODULE', $moduleModel->getName());
        $viewer->assign('MODULE_MODEL', $moduleModel);
        $viewer->assign('TASK_ID', $recordId);
        $viewer->assign('WORKFLOW_ID', $workflowId);
        $viewer->assign('DATETIME_FIELDS', $dateTimeFields);
        $viewer->assign('WORKFLOW_MODEL', $workflowModel);
        $viewer->assign('TASK_TYPES', $taskTypes);
        $viewer->assign('TASK_MODEL', $taskModel);
        $viewer->assign('CURRENTDATE', date('Y-n-j'));
        $metaVariables = Settings_Workflows_Module_Model::getMetaVariables();
        if ($moduleModel->getName() == 'Invoice' || $moduleModel->getName() == 'Quotes') {
            $metaVariables['Portal Pdf Url'] = '(general : (__VtigerMeta__) portalpdfurl)';
        }
        // Adding option Line Item block for Individual tax mode
        $individualTaxBlockLabel = vtranslate("LBL_LINEITEM_BLOCK_GROUP", $qualifiedModuleName);
        $individualTaxBlockValue = $viewer->view('LineItemsGroupTemplate.tpl', $qualifiedModuleName, $fetch = true);
        // Adding option Line Item block for group tax mode
        $groupTaxBlockLabel = vtranslate("LBL_LINEITEM_BLOCK_INDIVIDUAL", $qualifiedModuleName);
        $groupTaxBlockValue = $viewer->view('LineItemsIndividualTemplate.tpl', $qualifiedModuleName, $fetch = true);
        $templateVariables = array($individualTaxBlockValue => $individualTaxBlockLabel, $groupTaxBlockValue => $groupTaxBlockLabel);
        $viewer->assign('META_VARIABLES', $metaVariables);
        $viewer->assign('TEMPLATE_VARIABLES', $templateVariables);
        $viewer->assign('TASK_OBJECT', $taskObject);
        $viewer->assign('FIELD_EXPRESSIONS', Settings_Workflows_Module_Model::getExpressions());
        $repeat_date = $taskModel->getTaskObject()->calendar_repeat_limit_date;
        if (!empty($repeat_date)) {
            $repeat_date = Vtiger_Date_UIType::getDisplayDateValue($repeat_date);
        }
        $viewer->assign('REPEAT_DATE', $repeat_date);
        $userModel = Users_Record_Model::getCurrentUserModel();
        $viewer->assign('dateFormat', $userModel->get('date_format'));
        $viewer->assign('timeFormat', $userModel->get('hour_format'));
        $viewer->assign('MODULE', $moduleName);
        $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
        $emailFields = $recordStructureInstance->getAllEmailFields();
        foreach ($emailFields as $metaKey => $emailField) {
            $emailFieldoptions .= '<option value=",$' . $metaKey . '">' . $emailField->get('workflow_columnlabel') . '</option>';
        }
        $nameFields = $recordStructureInstance->getNameFields();
        $fromEmailFieldOptions = '<option value="">' . vtranslate('Optional', $qualifiedModuleName) . '</option>';
        $fromEmailFieldOptions .= '<option value="$(general : (__VtigerMeta__) supportName)<$(general : (__VtigerMeta__) supportEmailId)>"
									>' . vtranslate('LBL_HELPDESK_SUPPORT_EMAILID', $qualifiedModuleName) . '</option>';
        foreach ($emailFields as $metaKey => $emailField) {
            list($relationFieldName, $rest) = explode(' ', $metaKey);
            $value = '<$' . $metaKey . '>';
//.........这里部分代码省略.........
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:101,代码来源:EditTask.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: generateData

	function generateData() {
		$db = PearDatabase::getInstance();
		$chartSQL = $this->getQuery();

		$result = $db->pquery($chartSQL, array());
		$rows = $db->num_rows($result);
		$values = array();

		$queryColumnsByFieldModel = $this->getQueryColumnsByFieldModel();

		$recordCountLabel = '';
		if($this->isRecordCount()) {
			$recordCountLabel = 'RECORD_COUNT';
		}

		$groupByColumnsByFieldModel = $this->getGroupbyColumnsByFieldModel();

		$currentUserModel = Users_Record_Model::getCurrentUserModel();
		$currencyRateAndSymbol = getCurrencySymbolandCRate($currentUserModel->currency_id);
		$links = array();

		for($i = 0; $i < $rows; $i++) {
			$row = $db->query_result_rowdata($result, $i);

			if($recordCountLabel) {
				$values[$i][] = (int) $row[strtolower($recordCountLabel)];
			}

			if($queryColumnsByFieldModel) {
				foreach($queryColumnsByFieldModel as $fieldModel) {
					if($fieldModel->get('uitype') == '71' || $fieldModel->get('uitype') == '72') {
						$value = (float) ($row[strtolower($fieldModel->get('reportlabel'))]);
						$values[$i][] = CurrencyField::convertFromDollar($value, $currencyRateAndSymbol['rate']);
					} else {
						$values[$i][] = (int) $row[strtolower($fieldModel->get('reportlabel'))];
					}
				}
			}

			if($groupByColumnsByFieldModel) {
				foreach($groupByColumnsByFieldModel as $gFieldModel) {
					$fieldDataType = $gFieldModel->getFieldDataType();
					if($fieldDataType == 'picklist') {
						$label = vtranslate($row[strtolower($gFieldModel->get('reportlabel'))], $gFieldModel->getModuleName());
					} else if($fieldDataType == 'multipicklist') {
						$multiPicklistValue = $row[strtolower($gFieldModel->get('reportlabel'))];
						$multiPicklistValues = explode(' |##| ', $multiPicklistValue);
						foreach($multiPicklistValues as $multiPicklistValue) {
							$labelList[] = vtranslate($multiPicklistValue, $gFieldModel->getModuleName());
						}
						$label =  implode(',', $labelList);
					} else if($fieldDataType == 'date') {
						$label = Vtiger_Date_UIType::getDisplayDateValue($row[strtolower($gFieldModel->get('reportlabel'))]);
					} else if($fieldDataType == 'datetime') {
						$label = Vtiger_Date_UIType::getDisplayDateTimeValue($row[strtolower($gFieldModel->get('reportlabel'))]);
					} else {
                        // SalesPlatform.ru begin
                        $primaryModule = $this->getPrimaryModule();
                        if($primaryModule == 'PBXManager') {
                            $label = getUserFullName($row[strtolower($gFieldModel->get('reportlabel'))]);
                        } else {
                            $label = $row[strtolower($gFieldModel->get('reportlabel'))];
                        }
                        //$label = $row[strtolower($gFieldModel->get('reportlabel'))];
                        // SalesPlatform.ru end
					}
                                        //SalesPlatform.ru begin   
                                        $labels[] = (mb_strlen($label, 'UTF-8') > 30) ? mb_substr($label, 0, 30).'..' : $label; 
					//$labels[] = (strlen($label) > 30) ? substr($label, 0, 30).'..' : $label;
                                        //SalesPlatform.ru end
					$links[] = $this->generateLink($gFieldModel->get('reportcolumninfo'), $row[strtolower($gFieldModel->get('reportlabel'))]);
				}
			}
		}

		$data = array(	'labels' => $labels,
						'values' => $values,
						'links' => $links,
						'type' => (count($values[0]) == 1) ? 'singleBar' : 'multiBar',
						'data_labels' => $this->getDataLabels(),
						'graph_label' => $this->getGraphLabel()
					);
		return $data;
	}
开发者ID:Wasage,项目名称:werpa,代码行数:84,代码来源:Chart.php

示例11: formatDateIntoStrings

	/**
	 * Function to parses date into string format
	 * @param <Date> $date
	 * @param <Time> $time
	 * @return <String>
	 */
	public static function formatDateIntoStrings($date, $time = false) {
		$currentUser = Users_Record_Model::getCurrentUserModel();
		$dateTimeInUserFormat = Vtiger_Datetime_UIType::getDisplayDateTimeValue($date . ' ' . $time);

		list($dateInUserFormat, $timeInUserFormat) = explode(' ', $dateTimeInUserFormat);
		list($hours, $minutes, $seconds) = explode(':', $timeInUserFormat);

		$displayTime = $hours .':'. $minutes;
		if ($currentUser->get('hour_format') === '12') {
			$displayTime = Vtiger_Time_UIType::getTimeValueInAMorPM($displayTime);
		}

		$today = Vtiger_Date_UIType::getDisplayDateValue(date('Y-m-d H:i:s'));
		$tomorrow = Vtiger_Date_UIType::getDisplayDateValue(date('Y-m-d H:i:s', strtotime('tomorrow')));

		if ($dateInUserFormat == $today) {
			$formatedDate = vtranslate('LBL_TODAY');
			if ($time) {
				$formatedDate .= ' '. vtranslate('LBL_AT') .' '. $displayTime;
			}
		} elseif ($dateInUserFormat == $tomorrow) {
			$formatedDate = vtranslate('LBL_TOMORROW');
			if ($time) {
				$formatedDate .= ' '. vtranslate('LBL_AT') .' '. $displayTime;
			}
		} else {
			/**
			 * To support strtotime() for 'mm-dd-yyyy' format the seperator should be '/'
			 * For more referrences
			 * http://php.net/manual/en/datetime.formats.date.php
			 */
			if ($currentUser->get('date_format') === 'mm-dd-yyyy') {
				$dateInUserFormat = str_replace('-', '/', $dateInUserFormat);
			}

			$date = strtotime($dateInUserFormat);
			$formatedDate = vtranslate('LBL_'.date('D', $date)) . ' ' . date('d', $date) . ' ' . vtranslate('LBL_'.date('M', $date));
			if (date('Y', $date) != date('Y')) {
				$formatedDate .= ', '.date('Y', $date);
			}
		}
		return $formatedDate;
	}
开发者ID:jeremyevans6,项目名称:kulturedTiger-,代码行数:49,代码来源:Util.php

示例12: content_567aca6bd2404

    function content_567aca6bd2404($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars["dateFormat"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format'), null, 0);
        $_smarty_tpl->tpl_vars["currentDate"] = new Smarty_variable(Vtiger_Date_UIType::getDisplayDateValue(''), null, 0);
        $_smarty_tpl->tpl_vars["time"] = new Smarty_variable(Vtiger_Time_UIType::getDisplayTimeValue(null), null, 0);
        $_smarty_tpl->tpl_vars["currentTimeInVtigerFormat"] = new Smarty_variable(Vtiger_Time_UIType::getTimeValueInAMorPM($_smarty_tpl->tpl_vars['time']->value), null, 0);
        if ($_smarty_tpl->tpl_vars['COUNTER']->value == 2) {
            ?>
</tr><tr class="<?php 
            if (!$_smarty_tpl->tpl_vars['SHOW_FOLLOW_UP']->value) {
                ?>
hide <?php 
            }
            ?>
followUpContainer massEditActiveField">
	<?php 
            $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(1, null, 0);
        } else {
            ?>
	<?php 
            $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable($_smarty_tpl->tpl_vars['COUNTER']->value + 1, null, 0);
        }
        ?>
<td class="fieldLabel">
	<label class="muted pull-right marginRight10px">
		<input name="followup" type="checkbox" class="alignTop" <?php 
        if ($_smarty_tpl->tpl_vars['FOLLOW_UP_STATUS']->value) {
            ?>
 checked<?php 
        }
        ?>
/>
		<?php 
        echo vtranslate('LBL_HOLD_FOLLOWUP_ON', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>

	</label>	
</td>
<td class="fieldValue">
	<div>
		<div class="input-append row-fluid">
			<div class="span10 row-fluid date">
				<input name="followup_date_start" type="text" class="span9 dateField" data-date-format="<?php 
        echo $_smarty_tpl->tpl_vars['dateFormat']->value;
        ?>
" type="text"  
					   value="<?php 
        if (!empty($_smarty_tpl->tpl_vars['FOLLOW_UP_DATE']->value)) {
            echo $_smarty_tpl->tpl_vars['FOLLOW_UP_DATE']->value;
        } else {
            echo $_smarty_tpl->tpl_vars['currentDate']->value;
        }
        ?>
" />
				<span class="add-on"><i class="icon-calendar"></i></span>
			</div>	
		</div>		
	</div>
	<div>
		<div class="input-append time">
			<input type="text" name="followup_time_start" class="timepicker-default input-small" 
				   value="<?php 
        if (!empty($_smarty_tpl->tpl_vars['FOLLOW_UP_TIME']->value)) {
            echo $_smarty_tpl->tpl_vars['FOLLOW_UP_TIME']->value;
        } else {
            echo $_smarty_tpl->tpl_vars['currentTimeInVtigerFormat']->value;
        }
        ?>
" />
			<span class="add-on cursorPointer">
				<i class="icon-time"></i>
			</span>
		</div>	
	</div>
</td>
<td></td><td></td><?php 
    }
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:77,代码来源:0887e6951381aa013f381b73b6b23a8c495026b3.file.FollowUp.tpl.php

示例13: Events

 function Events($request, $moduleName)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $viewer = $this->getViewer($request);
     $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('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'));
     }
//.........这里部分代码省略.........
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:101,代码来源:Edit.php

示例14: formatDateIntoStrings

 /**
  * Function to parses date into string format
  * @param <Date> $date
  * @param <Time> $time
  * @return <String>
  */
 public static function formatDateIntoStrings($date, $time = false)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $dateTimeInUserFormat = Vtiger_Datetime_UIType::getDisplayDateTimeValue($date . ' ' . $time);
     list($dateInUserFormat, $timeInUserFormat) = explode(' ', $dateTimeInUserFormat);
     list($hours, $minutes, $seconds) = explode(':', $timeInUserFormat);
     $displayTime = $hours . ':' . $minutes;
     if ($currentUser->get('hour_format') === '12') {
         $displayTime = Vtiger_Time_UIType::getTimeValueInAMorPM($displayTime);
     }
     $today = Vtiger_Date_UIType::getDisplayDateValue(date('Y-m-d H:i:s'));
     $tomorrow = Vtiger_Date_UIType::getDisplayDateValue(date('Y-m-d H:i:s', strtotime('tomorrow')));
     $userDate = DateTimeField::__convertToUserFormat($date, $currentUser->get('date_format'));
     //var_dump($userDate);
     if ($dateInUserFormat == $today) {
         $todayInfo = vtranslate('LBL_TODAY');
         if ($time) {
             $todayInfo .= ' ' . vtranslate('LBL_AT') . ' ' . $displayTime;
         }
         $formatedDate = $userDate . " ({$todayInfo})";
     } elseif ($dateInUserFormat == $tomorrow) {
         $tomorrowInfo = vtranslate('LBL_TOMORROW');
         if ($time) {
             $tomorrowInfo .= ' ' . vtranslate('LBL_AT') . ' ' . $displayTime;
         }
         $formatedDate = $userDate . " ({$tomorrowInfo})";
     } else {
         //$formatToConvert = str_replace( array('/','.'), array('-','-'), $format);
         if ($currentUser->get('date_format') === 'mm-dd-yyyy') {
             $dateInUserFormat = str_replace('-', '/', $dateInUserFormat);
         }
         $date = strtotime($dateInUserFormat);
         $dayInfo = vtranslate('LBL_' . date('D', $date));
         if ($time) {
             $dayInfo .= ' ' . vtranslate('LBL_AT') . ' ' . $displayTime;
         }
         $formatedDate = $userDate . " ({$dayInfo})";
     }
     return $formatedDate;
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:46,代码来源:Util.php

示例15: 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


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