本文整理汇总了PHP中DateTimeField::convertToUserFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeField::convertToUserFormat方法的具体用法?PHP DateTimeField::convertToUserFormat怎么用?PHP DateTimeField::convertToUserFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeField
的用法示例。
在下文中一共展示了DateTimeField::convertToUserFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWidgetTimeControl
public function getWidgetTimeControl($user, $time)
{
if (!$time) {
return array();
}
$db = PearDatabase::getInstance();
$param = array('OSSTimeControl', $user, $time['start'], $time['end']);
$sql = "SELECT SUM(sum_time) AS daytime, due_date FROM vtiger_osstimecontrol\n\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_osstimecontrol.osstimecontrolid = vtiger_crmentity.crmid\n\t\t\t\t\tWHERE vtiger_crmentity.setype = ? AND vtiger_crmentity.smownerid = ? ";
$sql .= "AND (vtiger_osstimecontrol.date_start >= ? AND vtiger_osstimecontrol.due_date <= ?) GROUP BY due_date";
$result = $db->pquery($sql, $param);
$data = array();
$countDays = 0;
$average = 0;
for ($i = 0; $i < $db->num_rows($result); $i++) {
$due_date = $db->query_result_raw($result, $i, 'due_date');
$daytime = $db->query_result_raw($result, $i, 'daytime');
$due_date = DateTimeField::convertToUserFormat($due_date);
$data[] = array($daytime, $due_date);
$countDays++;
$average = $average + $daytime;
}
if ($average > 0) {
$average = $average / $countDays;
}
return array('data' => $data, 'countDays' => $countDays, 'average' => number_format($average, 2, '.', ' '));
}
示例2: assignMessages
public static function assignMessages($crmid, $viewer)
{
$chwmfkvuq = "current_user";
$dpddjpchus = "row";
${"GLOBALS"}["pvcpgoobkx"] = "sql";
${"GLOBALS"}["dbjyloqr"] = "cu_model";
${$chwmfkvuq} = ${${"GLOBALS"}["dbjyloqr"]} = \Users_Record_Model::getCurrentUserModel();
${${"GLOBALS"}["gmbukkbbs"]} = \PearDatabase::getInstance();
$twasrbuxi = "result";
${${"GLOBALS"}["uxfpyp"]} = "SELECT * FROM vtiger_wf_messages WHERE\n (\n (crmid = " . ${${"GLOBALS"}["podklxc"]} . " AND target = \"record\") OR\n (crmid = " . $current_user->id . " AND target = \"user\")\n )\n AND (show_until = \"0000-00-00 00:00:00\" OR show_until >= NOW())";
${${"GLOBALS"}["ciokylfx"]} = $adb->query(${${"GLOBALS"}["pvcpgoobkx"]});
${"GLOBALS"}["esusgmf"] = "sql";
${${"GLOBALS"}["hbelbc"]} = array();
while (${$dpddjpchus} = $adb->fetchByAssoc(${$twasrbuxi})) {
$wyoevilr = "row";
${"GLOBALS"}["wtiuxgl"] = "messages";
${"GLOBALS"}["txeedjxevu"] = "row";
if (${$wyoevilr}["show_until"] != "0000-00-00 00:00:00") {
$ticepvccqsn = "row";
${"GLOBALS"}["kemkeniiqmz"] = "row";
${${"GLOBALS"}["kemkeniiqmz"]}["show_until"] = getTranslatedString("LBL_VISIBLE_UNTIL", "Workflow2") . ": " . \DateTimeField::convertToUserFormat(${$ticepvccqsn}["show_until"]);
} else {
${${"GLOBALS"}["wiurqquqjut"]}["show_until"] = "";
}
${${"GLOBALS"}["wtiuxgl"]}[] = ${${"GLOBALS"}["txeedjxevu"]};
}
$viewer->assign("messages", ${${"GLOBALS"}["hbelbc"]});
${${"GLOBALS"}["esusgmf"]} = "DELETE FROM vtiger_wf_messages WHERE\n (\n (crmid = " . intval($_REQUEST["record"]) . " AND target = 'record') OR\n (crmid = " . intval($current_user->id) . " AND target = 'user')\n ) AND\n (show_once = '1' OR (show_until != '0000-00-00 00:00:00' AND show_until < NOW()))";
$adb->query(${${"GLOBALS"}["uxfpyp"]});
}
示例3: preProcess
function preProcess(Vtiger_Request $request)
{
parent::preProcess($request);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$recordId = $request->get('record');
$page = $request->get('page');
$detailViewModel = Reports_DetailView_Model::getInstance($moduleName, $recordId);
$reportModel = $detailViewModel->getRecord();
$reportModel->setModule('Reports');
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $page);
$pagingModel->set('limit', self::REPORT_LIMIT);
$this->reportData = $reportModel->getReportData($pagingModel);
$this->calculationFields = $reportModel->getReportCalulationData();
$primaryModule = $reportModel->getPrimaryModule();
$secondaryModules = $reportModel->getSecondaryModules();
$primaryModuleModel = Vtiger_Module_Model::getInstance($primaryModule);
$currentUser = Users_Record_Model::getCurrentUserModel();
$userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
$permission = $userPrivilegesModel->hasModulePermission($primaryModuleModel->getId());
if (!$permission) {
$viewer->assign('MODULE', $primaryModule);
$viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
$viewer->view('OperationNotPermitted.tpl', $primaryModule);
exit;
}
$detailViewLinks = $detailViewModel->getDetailViewLinks();
// Advanced filter conditions
$viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
$viewer->assign('PRIMARY_MODULE', $primaryModule);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
$primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
$secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
$viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
$viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
$secondaryModuleIsCalendar = strpos($secondaryModules, 'Calendar');
if ($primaryModule == 'Calendar' || $secondaryModuleIsCalendar !== FALSE) {
$advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
} else {
$advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
}
$viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
$viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
$dateFilters = Vtiger_Field_Model::getDateFilterTypes();
foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
$comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
$comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
$comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
$dateFilters[$comparatorKey] = $comparatorInfo;
}
$viewer->assign('DATE_FILTERS', $dateFilters);
$viewer->assign('LINEITEM_FIELD_IN_CALCULATION', $reportModel->showLineItemFieldsInFilter(false));
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('REPORT_MODEL', $reportModel);
$viewer->assign('RECORD_ID', $recordId);
$viewer->assign('COUNT', count($this->reportData));
$viewer->assign('MODULE', $moduleName);
$viewer->view('ReportHeader.tpl', $moduleName);
}
示例4: process
public function process($module, $id, Vtiger_PDF_Model $pdf)
{
$db = PearDatabase::getInstance();
$query = 'SELECT `createdtime` FROM `vtiger_crmentity` WHERE `crmid` = ? LIMIT 1;';
$result = $db->pquery($query, [$id]);
$createdTime = $db->getSingleValue($result);
return DateTimeField::convertToUserFormat($createdTime);
}
示例5: preProcess
function preProcess(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$recordId = $request->get('record');
$this->record = $detailViewModel = Reports_DetailView_Model::getInstance($moduleName, $recordId);
parent::preProcess($request);
$reportModel = $detailViewModel->getRecord();
$reportModel->setModule('Reports');
$primaryModule = $reportModel->getPrimaryModule();
$secondaryModules = $reportModel->getSecondaryModules();
$primaryModuleModel = Vtiger_Module_Model::getInstance($primaryModule);
$currentUser = Users_Record_Model::getCurrentUserModel();
$userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
$permission = $userPrivilegesModel->hasModulePermission($primaryModuleModel->getId());
if (!$permission) {
$viewer->assign('MODULE', $primaryModule);
$viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
$viewer->view('OperationNotPermitted.tpl', $primaryModule);
exit;
}
$isAdmin = $currentUser->isAdminUser();
$viewer->assign('isAdmin', $isAdmin);
// Advanced filter conditions
$viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
$viewer->assign('PRIMARY_MODULE', $primaryModule);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
$primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
$secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
$viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
$viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
$secondaryModuleIsCalendar = strpos($secondaryModules, 'Calendar');
if ($primaryModule == 'Calendar' || $secondaryModuleIsCalendar !== FALSE) {
$advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
} else {
$advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
}
$viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
$viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
$dateFilters = Vtiger_Field_Model::getDateFilterTypes();
foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
$comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
$comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
$comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $moduleName);
$dateFilters[$comparatorKey] = $comparatorInfo;
}
$reportChartModel = Reports_Chart_Model::getInstanceById($reportModel);
$viewer->assign('PRIMARY_MODULE_FIELDS', $reportModel->getPrimaryModuleFieldsForAdvancedReporting());
$viewer->assign('SECONDARY_MODULE_FIELDS', $reportModel->getSecondaryModuleFieldsForAdvancedReporting());
$viewer->assign('CALCULATION_FIELDS', $reportModel->getModuleCalculationFieldsForReport());
$viewer->assign('DATE_FILTERS', $dateFilters);
$viewer->assign('REPORT_MODEL', $reportModel);
$viewer->assign('RECORD', $recordId);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('CHART_MODEL', $reportChartModel);
$viewer->view('ChartReportHeader.tpl', $moduleName);
}
示例6: renderFrontend
public function renderFrontend($data, $context)
{
if (!empty($data['config']['default'])) {
$data['config']['default'] = \Workflow\VTTemplate::parse($data['config']['default'], $context);
}
$html = '';
$script = '';
switch ($data['type']) {
case 'file':
$field = '<input type="file" id="reqfield_' . $data['name'] . '" data-filestoreid="' . $data['config']['default'] . '" style="width:400px;" name="' . $data['name'] . '" value="' . $data['config']["default"] . '">';
break;
case 'checkbox':
$field = '<input type="checkbox" name="' . $data['name'] . '" ' . ($data["config"]["default"] == 'On' ? "checked='checked'" : "") . ' value="on">';
break;
case 'textarea':
$field = '<textarea id="reqfield_' . $data['name'] . '" style="width:400px;height:100px;" name="' . $data['name'] . '">' . $data['config']["default"] . '</textarea>';
break;
case 'picklist':
$options = explode("\n", $data['config']['default']);
$field = '<select style="width:410px;" name="' . $data['name'] . '" class="select2">';
foreach ($options as $option) {
$option = trim($option);
if (strpos($option, '#~#') !== false) {
$parts = explode('#~#', $option);
$fieldValue = $parts[1];
$fieldLabel = $parts[0];
} else {
$fieldValue = $option;
$fieldLabel = $option;
}
$field .= '<option value="' . $fieldValue . '">' . $fieldLabel . '</option>';
}
$field .= '</select>';
break;
case 'date':
$current_user = \Users_Record_Model::getCurrentUserModel();
$field = '<div class="input-append pull-right" style="width:410px;">';
if (!empty($data['config']["default"])) {
$preset = \DateTimeField::convertToUserFormat($data['config']["default"]);
} else {
$preset = '';
}
$field .= '<input type="text" class="dateField span2" data-date-format="' . $current_user->date_format . '"id="reqfield_' . $data['name'] . '"name="' . $data['name'] . '" value="' . $preset . '">';
$field .= '<span class="add-on"><i class="icon-calendar"></i></span>';
$field .= '</div>';
break;
case 'text':
default:
$field = '<input type="text" id="reqfield_' . $data['name'] . '" style="width:400px;" name="' . $data['name'] . '" value="' . $data['config']["default"] . '">';
break;
}
$html = "<label><div style='min-height:26px;padding:2px 0;'><div style=''><strong>" . $data['label'] . "</strong></div><div style='text-align:right;'>" . $field . "</div></div></label>";
return array('html' => $html, 'javascript' => $script);
}
示例7: getDateFilter
public static function getDateFilter($moduleName)
{
$dateFilters = Vtiger_Field_Model::getDateFilterTypes();
foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
$comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
$comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
$comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $moduleName);
$dateFilters[$comparatorKey] = $comparatorInfo;
}
return $dateFilters;
}
示例8: getEditViewDisplayValue
/**
* Function to get Edit view display value
* @param <String> Data base value
* @return <String> value
*/
public function getEditViewDisplayValue($value)
{
$fieldName = $this->getName();
//Set the start date and end date
if (empty($value)) {
if ($fieldName === 'date_start') {
return DateTimeField::convertToUserFormat(date('Y-m-d'));
} elseif ($fieldName === 'due_date') {
//$currentUser = Users_Record_Model::getCurrentUserModel();
$minutes = 15;
return DateTimeField::convertToUserFormat(date('Y-m-d', strtotime("+{$minutes} minutes")));
}
}
return parent::getEditViewDisplayValue($value);
}
示例9: showAdvancedSearch
/**
* Function to display the UI for advance search on any of the module
* @param Vtiger_Request $request
*/
function showAdvancedSearch(Vtiger_Request $request)
{
//Modules for which search is excluded
$excludedModuleForSearch = array('Vtiger', 'Reports');
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
if ($request->get('source_module')) {
$moduleName = $request->get('source_module');
}
$saveFilterPermitted = true;
$saveFilterexcludedModules = array('ModComments', 'RSS', 'Portal', 'Integration', 'PBXManager', 'DashBoard');
if (in_array($moduleName, $saveFilterexcludedModules)) {
$saveFilterPermitted = false;
}
//See if it is an excluded module, If so search in home module
if (in_array($moduleName, $excludedModuleForSearch)) {
$moduleName = 'Home';
}
$module = $request->getModule();
$customViewModel = new CustomView_Record_Model();
$customViewModel->setModule($moduleName);
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
$viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
if ($moduleName == 'Calendar') {
$advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
} else {
$advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
}
$viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
$viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
$dateFilters = Vtiger_Field_Model::getDateFilterTypes();
foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
$comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
$comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
$comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
$dateFilters[$comparatorKey] = $comparatorInfo;
}
$viewer->assign('DATE_FILTERS', $dateFilters);
$viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
$viewer->assign('SOURCE_MODULE', $moduleName);
$viewer->assign('SOURCE_MODULE_MODEL', $moduleModel);
$viewer->assign('MODULE', $module);
$viewer->assign('SAVE_FILTER_PERMITTED', $saveFilterPermitted);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
echo $viewer->view('AdvanceSearch.tpl', $moduleName, true);
}
示例10: process
public function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->get('source_module');
$module = $request->getModule();
$record = $request->get('record');
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
if (!empty($record)) {
$customViewModel = CustomView_Record_Model::getInstanceById($record);
$viewer->assign('MODE', 'edit');
} else {
$customViewModel = new CustomView_Record_Model();
$customViewModel->setModule($moduleName);
$viewer->assign('MODE', '');
}
$viewer->assign('ADVANCE_CRITERIA', $customViewModel->transformToNewAdvancedFilter());
$viewer->assign('CURRENTDATE', date('Y-n-j'));
$viewer->assign('DATE_FILTERS', Vtiger_Field_Model::getDateFilterTypes());
if ($moduleName == 'Calendar') {
$advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
} else {
$advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
}
$viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
$viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
$dateFilters = Vtiger_Field_Model::getDateFilterTypes();
foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
$comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
$comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
$comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
$dateFilters[$comparatorKey] = $comparatorInfo;
}
$viewer->assign('DATE_FILTERS', $dateFilters);
$viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
$viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
$viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
$viewer->assign('RECORD_ID', $record);
$viewer->assign('MODULE', $module);
$viewer->assign('SOURCE_MODULE', $moduleName);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_PRIVATE);
$viewer->assign('CV_PENDING_VALUE', CustomView_Record_Model::CV_STATUS_PENDING);
$viewer->assign('CV_PUBLIC_VALUE', CustomView_Record_Model::CV_STATUS_PUBLIC);
$viewer->assign('MODULE_MODEL', $moduleModel);
echo $viewer->view('EditView.tpl', $module, true);
}
示例11: process
public function process(Vtiger_Request $request)
{
$primaryModule = $request->get('primodule');
$secondaryModules = $request->get('secmodule');
$record = $request->get('record');
$reportModel = Reports_Record_Model::getCleanInstance($record);
/*if (!empty($record)) {
$viewer->assign('SELECTED_STANDARD_FILTER_FIELDS', $reportModel->getSelectedStandardFilter());
$viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
}*/
$reportModel->setPrimaryModule($primaryModule);
if (!empty($secondaryModules)) {
$reportModel->setSecondaryModule($secondaryModules);
}
$viewer = $this->getViewer($request);
$viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
$viewer->assign('PRIMARY_MODULE', $primaryModule);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
$primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
$secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
$viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
$viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
//$viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $reportModel->getPrimaryModuleRecordStructure());
//$viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $reportModel->getSecondaryModuleRecordStructure());
$viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
$viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', Vtiger_Field_Model::getAdvancedFilterOpsByFieldType());
$dateFilters = Vtiger_Field_Model::getDateFilterTypes();
foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
$comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
$comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
$comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
$dateFilters[$comparatorKey] = $comparatorInfo;
}
$viewer->assign('DATE_FILTERS', $dateFilters);
echo $viewer->view('BlockFilters.tpl', 'PDFMaker', true);
/*
$content = $viewer->view('BlockFilters.tpl', 'PDFMaker',true);
echo "aaaaaaaaa";
/*
$response = new Vtiger_Response();
$response->setResult($content);
$response->emit();
*/
}
示例12: process
function process(Mobile_API_Request $request)
{
$current_user = $this->getActiveUser();
//$module = $request->get('module');
$module = $this->detectModuleName($request->get('record'));
$record = $this->processRetrieve($request);
$this->resolveRecordValues($record, $current_user);
$response = new Mobile_API_Response();
$ret_arr = array('record' => $record);
if ($request->get('module')) {
$module = $request->get('module');
$moduleWSFieldNames = Mobile_WS_Utils::getEntityFieldnames($module);
foreach ($moduleWSFieldNames as $key => $value) {
$relatedlistcontent[$key] = $record[$value];
}
$relatedlistcontent['id'] = $record['id'];
$ret_arr['relatedlistcontent'] = $relatedlistcontent;
} elseif (vtlib_isModuleActive('ModComments') and $module != 'HelpDesk') {
include_once 'include/Webservices/Query.php';
$comments = vtws_query("SELECT * FROM ModComments WHERE related_to = '" . $record['id'] . "' ORDER BY createdtime DESC LIMIT 5;", $current_user);
if (count($comments) > 0) {
foreach ($comments as &$comment) {
$comment['assigned_user_id'] = vtws_getName($comment['assigned_user_id'], $current_user);
$comment['createdtime'] = DateTimeField::convertToUserFormat($comment['createdtime']);
}
$ret_arr['comments'] = $comments;
} else {
$ret_arr['comments'] = array();
}
} elseif ($module == 'HelpDesk') {
//there is currently no vtws service for ticket comments
$comments = Mobile_WS_Utils::getTicketComments($record);
if (!empty($comments)) {
foreach ($comments as &$comment) {
$comment['assigned_user_id'] = vtws_getName($comment['assigned_user_id'], $current_user);
$comment['createdtime'] = DateTimeField::convertToUserFormat($comment['createdtime']);
}
$ret_arr['comments'] = $comments;
} else {
$ret_arr['comments'] = array();
}
}
$response->setResult($ret_arr);
return $response;
}
示例13: process
public function process($ModuleName, $ID, $record_form, $config)
{
$projectmilestoneid = $record_form['projectmilestoneid'];
if (!isset($projectmilestoneid) || $projectmilestoneid == 0 || $projectmilestoneid == '') {
return array('save_record' => true);
}
$moduleModel = Vtiger_Record_Model::getInstanceById($projectmilestoneid, 'ProjectMilestone');
$projectMilestoneDate = $moduleModel->get('projectmilestonedate');
if (!isset($projectMilestoneDate) || $projectMilestoneDate == 0 || $projectMilestoneDate == '') {
return array('save_record' => true);
}
$dateField = new DateTimeField($projectMilestoneDate);
$projectMilestoneDateUserFormat = $dateField->convertToUserFormat($projectMilestoneDate);
$dateField = new DateTimeField($record_form['targetenddate']);
$targetEndDateUserFormat = $dateField->convertToDBFormat($record_form['targetenddate']);
if (strtotime($targetEndDateUserFormat) > strtotime($projectMilestoneDate)) {
return array('save_record' => false, 'type' => 0, 'info' => array('text' => vtranslate('Date can not be greater', 'DataAccess') . ' ( ' . $record_form['targetenddate'] . ' < ' . $projectMilestoneDateUserFormat . ')', 'type' => 'error'));
} else {
return array('save_record' => true);
}
}
示例14: getContent
function getContent(Mobile_API_Request $request)
{
$comment = $request->get('comment');
$parentid = $request->get('parentid');
if (isset($comment) && !empty($comment)) {
$parentmodule = Mobile_WS_Utils::detectModulenameFromRecordId($parentid);
if ($parentmodule != 'HelpDesk') {
include_once 'include/Webservices/Create.php';
$current_user = $this->getActiveUser();
$userid = Mobile_WS_Utils::getEntityModuleWSId('Users') . "x" . $current_user->id;
$arr_comment = array('commentcontent' => $comment, 'related_to' => $parentid, 'creator' => $userid, 'assigned_user_id' => $userid);
$ele = vtws_create('ModComments', $arr_comment, $current_user);
} else {
$parentrecordid = vtws_getIdComponents($parentid);
$parentrecordid = $parentrecordid[1];
//there is currently no vtws service available for ticket comments
$current_user = $this->getActiveUser();
$current_user_id = $current_user->id;
$userrecordid = vtws_getIdComponents($current_user_id);
$userrecordid = $userrecordid[1];
$arr_comment = array('commentcontent' => $comment, 'related_to' => $parentrecordid, 'creator' => $current_user_id);
//$ele = vtws_create('ModComments', $arr_comment, $current_user);
$saverecord = Mobile_WS_Utils::createTicketComment($arr_comment);
if ($saverecord == true) {
$userid = Mobile_WS_Utils::getEntityModuleWSId('Users') . "x" . $current_user_id;
$ele['commentcontent'] = $arr_comment['commentcontent'];
$ele['creator'] = $userid;
$ele['assigned_user_id'] = $userid;
$ele['related_to'] = $parentid;
$ele['id'] = '';
$ele['createdtime'] = DateTimeField::convertToUserFormat(date('Y-m-d H:i:s'));
}
}
}
$response = new Mobile_API_Response();
$ele['assigned_user_id'] = vtws_getName($ele['creator'], $current_user);
$response->setResult(array('comment' => $ele));
return $response;
}
示例15: process
public function process(Vtiger_Request $request)
{
${"GLOBALS"}["dpplygv"] = "module";
$gdtleqjpkdsh = "crmid";
${"GLOBALS"}["auyafnnce"] = "waitingRST";
$haauhnidlo = "sql";
$ltqivoyu = "adb";
$tislpkpngsol = "request";
$itkrgfcibt = "waiting";
$brgjuxus = "crmid";
$ihjgddsfo = "cu_model";
${${"GLOBALS"}["pxuwujbkkm"]} = ${$ihjgddsfo} = Users_Record_Model::getCurrentUserModel();
${"GLOBALS"}["yemuhpxpdnq"] = "viewer";
${${"GLOBALS"}["kaqzwjtnc"]} = Vtiger_Language_Handler::getLanguage();
${$ltqivoyu} = PearDatabase::getInstance();
${${"GLOBALS"}["yemuhpxpdnq"]} = $this->getViewer(${$tislpkpngsol});
${${"GLOBALS"}["dpplygv"]} = $request->get("source_module");
${${"GLOBALS"}["nfzomvg"]} = (int) $request->get("crmid");
$lpkmsdfy = "row";
${$haauhnidlo} = "SELECT\n *\n FROM\n vtiger_wf_entityddata\n WHERE\n vtiger_wf_entityddata.crmid = " . ${$gdtleqjpkdsh} . "";
$jvcckdhwm = "waitingRST";
${${"GLOBALS"}["auyafnnce"]} = $adb->query(${${"GLOBALS"}["csoiribry"]}, true);
${$itkrgfcibt} = array();
while (${$lpkmsdfy} = $adb->fetchByAssoc(${$jvcckdhwm})) {
$qhlgfswqh = "row";
$nhzoipi = "row";
$kgtwmjpd = "row";
${"GLOBALS"}["zxbipozhknd"] = "row";
${$nhzoipi}["modified"] = DateTimeField::convertToUserFormat(${${"GLOBALS"}["zxbipozhknd"]}["modified"]);
${${"GLOBALS"}["llcomooxgjot"]}["value"] = @unserialize(html_entity_decode(${$qhlgfswqh}["value"]));
${${"GLOBALS"}["jyvlypyp"]}[] = ${$kgtwmjpd};
}
$viewer->assign("crmid", ${$brgjuxus});
$viewer->assign("entityData", ${${"GLOBALS"}["jyvlypyp"]});
$viewer->view("EntityData.tpl", "Workflow2");
}