本文整理汇总了PHP中parse_calendardate函数的典型用法代码示例。如果您正苦于以下问题:PHP parse_calendardate函数的具体用法?PHP parse_calendardate怎么用?PHP parse_calendardate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_calendardate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Process the request for Folder opertions
* @global <type> $list_max_entries_per_page
* @param MailManager_Request $request
* @return MailManager_Response
*/
function process(MailManager_Request $request)
{
global $list_max_entries_per_page, $current_user;
$response = new Vtiger_Response();
if ('open' == $request->getOperationArg()) {
$q = $request->get('q');
$foldername = $request->get('_folder');
$type = $request->get('type');
$connector = $this->getConnector($foldername);
$folder = $connector->folderInstance($foldername);
if (empty($q)) {
$connector->folderMails($folder, intval($request->get('_page', 0)), $list_max_entries_per_page);
} else {
if (empty($type)) {
$type = 'ALL';
}
if ($type == 'ON') {
$dateFormat = $current_user->date_format;
if ($dateFormat == 'mm-dd-yyyy') {
$dateArray = explode('-', $q);
$temp = $dateArray[0];
$dateArray[0] = $dateArray[1];
$dateArray[1] = $temp;
$q = implode('-', $dateArray);
}
$query = date('d M Y', strtotime($q));
$q = '' . $type . ' "' . vtlib_purify($query) . '"';
} else {
$q = '' . $type . ' "' . vtlib_purify($q) . '"';
}
$connector->searchMails($q, $folder, intval($request->get('_page', 0)), $list_max_entries_per_page);
}
$folderList = $connector->getFolderList();
$viewer = $this->getViewer();
$viewer->assign('TYPE', $type);
$viewer->assign('QUERY', $request->get('q'));
$viewer->assign('FOLDER', $folder);
$viewer->assign('FOLDERLIST', $folderList);
$viewer->assign('SEARCHOPTIONS', self::getSearchOptions());
$viewer->assign("JS_DATEFORMAT", parse_calendardate(getTranslatedString('NTC_DATE_FORMAT')));
$response->setResult($viewer->fetch($this->getModuleTpl('FolderOpen.tpl')));
} elseif ('drafts' == $request->getOperationArg()) {
$q = $request->get('q');
$type = $request->get('type');
$page = intval($request->get('_page', 0));
$connector = $this->getConnector('__vt_drafts');
$folder = $connector->folderInstance();
if (empty($q)) {
$draftMails = $connector->getDrafts($page, $list_max_entries_per_page, $folder);
} else {
$draftMails = $connector->searchDraftMails($q, $type, $page, $list_max_entries_per_page, $folder);
}
$viewer = $this->getViewer();
$viewer->assign('MAILS', $draftMails);
$viewer->assign('FOLDER', $folder);
$viewer->assign('SEARCHOPTIONS', MailManager_DraftController::getSearchOptions());
$response->setResult($viewer->fetch($this->getModuleTpl('FolderDrafts.tpl')));
}
return $response;
}
示例2: get_new_record_form
/**
* Create HTML form to enter a new record with the minimum necessary fields.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
*/
function get_new_record_form()
{
if (!ACLController::checkAccess('Tasks', 'edit', true)) {
return '';
}
require_once 'include/time.php';
global $app_strings, $mod_strings, $app_list_strings;
global $current_user;
global $theme;
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$user_id = $current_user->id;
$default_status = $mod_strings['LBL_DEFAULT_STATUS'];
$default_priority = $mod_strings['LBL_DEFAULT_PRIORITY'];
$default_parent_type = $app_list_strings['record_type_default_key'];
// Unimplemented until jscalendar language files are fixed
// $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
$cal_lang = "en";
$cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
$ntc_time_format = '(' . getDisplayTimeFormat() . ')';
$ampm = AMPMMenu('', '');
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
\t\t<form name="TaskSave" onSubmit="return check_form('TaskSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Tasks">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="status" value="{$default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="priority" value="{$default_priority}">
\t\t\t<input type="hidden" name="parent_type" value="{$default_parent_type}">
\t\t\t<input type="hidden" name="action" value="Save">
\t\t\t<input type="hidden" name="date_due_flag">
\t\t<p>{$mod_strings['LBL_NEW_FORM_SUBJECT']} <span class="required">{$app_strings['LBL_REQUIRED_SYMBOL']}</span><br>
\t\t<input name='name' type="text" value=""><br>
\t\t{$mod_strings['LBL_NEW_FORM_DUE_DATE']} <span class="dateFormat">{$app_strings['NTC_DATE_FORMAT']}</span><br>
\t\t<input name='date_due' maxlength="10" onblur="parseDate(this, '{$cal_dateformat}');" id='jscal_field' type="text" value=""> <img src="themes/{$theme}/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br>
\t\t{$mod_strings['LBL_NEW_FORM_DUE_TIME']} <span class="dateFormat">{$ntc_time_format}</span><br>
\t\t<input name='time_due' maxlength='5' type="text"> {$ampm}</p>
\t\t<p><input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}" accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}" class="button" type="submit" name="button" value="{$app_strings['LBL_SAVE_BUTTON_LABEL']}" ></p>
\t\t</form>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
\t\t});
\t\t</script>
EOQ;
require_once 'include/javascript/javascript.php';
require_once 'modules/Tasks/Task.php';
$javascript = new javascript();
$javascript->setFormName('TaskSave');
$javascript->setSugarBean(new Task());
$javascript->addRequiredFields('');
$javascript->addField('date_due', false, '');
$javascript->addField('time_due', false, '');
$the_form .= $javascript->getScript();
$the_form .= get_left_form_footer();
return $the_form;
}
示例3: ReportFilters
public static function ReportFilters(Vtiger_Request $request, $viewer)
{
require_once 'modules/ITS4YouReports/FilterUtils.php';
$adb = PearDatabase::getInstance();
$moduleName = $request->getModule();
$R_Data = $request->getAll();
$record = $request->get('record');
$viewer->assign("MODULE", $moduleName);
$reportModel = ITS4YouReports_Record_Model::getCleanInstance($record);
$Report_Informations = $reportModel->getReportInformations();
$primary_module = $reportModel->getPrimaryModule();
$primary_moduleid = $reportModel->getPrimaryModuleId();
$current_user = Users_Record_Model::getCurrentUserModel();
$viewer->assign("DATEFORMAT", $current_user->date_format);
$viewer->assign("JS_DATEFORMAT", parse_calendardate(vtranslate('NTC_DATE_FORMAT')));
// ITS4YOU-CR SlOl 10. 9. 2013 16:13:47
$LBL_INFORMATIONS_4YOU = vtranslate("LBL_STEP7_INFO", $moduleName);
$viewer->assign("LBL_INFORMATIONS_4YOU", $LBL_INFORMATIONS_4YOU);
// ITS4YOU-END 10. 9. 2013 16:13:50
$BLOCK1 = "<option selected value='Not Accessible'>" . vtranslate('LBL_NOT_ACCESSIBLE') . "</option>";
$user_privileges_path = 'user_privileges/user_privileges_' . $current_user->id . '.php';
if (file_exists($user_privileges_path)) {
require $user_privileges_path;
}
$related_modules = $reportModel->getReportRelatedModulesList();
$advft_criteria = array();
if ($record != "") {
$reportModel->getSelectedStandardCriteria($reportid);
$stdselectedcolumn = $reportModel->getSTDSelectedColumn();
$relatedmodulesstring = $reportModel->getRelatedModulesString();
$BLOCK1 .= getITSPrimaryStdFilterHTML($primary_module, $stdselectedcolumn);
$BLOCK1 .= getITSSecondaryStdFilterHTML($relatedmodulesstring, $stdselectedcolumn);
//added to fix the ticket #5117
$selectedcolumnvalue = '"' . $stdselectedcolumn . '"';
if (!$is_admin && isset($stdselectedcolumn) && strpos($BLOCK1, $selectedcolumnvalue) === false) {
$viewer->assign("BLOCK1_STD", $BLOCK1);
}
$stdselectedfilter = $reportModel->getSTDSelectedFilter();
$startdate = $reportModel->getStartDate();
$enddate = $reportModel->getEndDate();
if ($startdate != "") {
$viewer->assign("STARTDATE_STD", getValidDisplayDate($startdate));
}
if ($enddate != "") {
$viewer->assign("ENDDATE_STD", getValidDisplayDate($enddate));
}
$reportModel->getGroupFilterList($reportid);
$reportModel->getAdvancedFilterList($reportid);
$advft_criteria = $reportModel->getSelectedAdvancedFilter($reportid);
} else {
$primary_module = $R_Data["reportmodule"];
$BLOCK1 .= getITSPrimaryStdFilterHTML($primary_module);
if (!empty($related_modules[$primary_module])) {
foreach ($related_modules[$primary_module] as $key => $value) {
$BLOCK1 .= getITSSecondaryStdFilterHTML($R_Data["secondarymodule_" . $value]);
}
}
$viewer->assign("BLOCK1_STD", $BLOCK1);
$stdselectedfilter = "";
}
$BLOCKCRITERIA = $reportModel->getSelectedStdFilterCriteria($stdselectedfilter);
$viewer->assign("BLOCKCRITERIA_STD", $BLOCKCRITERIA);
$BLOCKJS = $reportModel->getCriteriaJS();
$viewer->assign("BLOCKJS_STD", $BLOCKJS);
///AdvancedFilter.php
$summaries_criteria = $reportModel->getSummariesCriteria();
$viewer->assign("CRITERIA_GROUPS", $advft_criteria);
$viewer->assign("EMPTY_CRITERIA_GROUPS", empty($advft_criteria));
$viewer->assign("SUMMARIES_CRITERIA", $summaries_criteria);
/*
if(isset($R_Data["mode"]) && $R_Data["mode"]!=""){
$mode = vtlib_purify($R_Data["mode"]);
}else{
$mode = "generate";
}
*/
if ($record != "") {
$viewer->assign('MODE', 'edit');
} else {
$viewer->assign('MODE', 'create');
}
$FILTER_OPTION = getAdvCriteriaHTML();
$viewer->assign("FOPTION", $FILTER_OPTION);
$secondarymodule = '';
$secondarymodules = array();
if (!empty($related_modules[$primary_module])) {
foreach ($related_modules[$primary_module] as $key => $value) {
if (isset($R_Data["secondarymodule_" . $value])) {
$secondarymodules[] = $R_Data["secondarymodule_" . $value];
}
}
}
$reportModel->getPriModuleColumnsList($primary_module);
if (!empty($related_modules[$primary_module])) {
foreach ($related_modules[$primary_module] as $key => $value) {
$secondarymodules[] = $value["id"];
}
$secondary_modules_str = implode(":", $secondarymodules);
}
$reportModel->getSecModuleColumnsList($secondary_modules_str);
//.........这里部分代码省略.........
示例4: vtWorkflowEdit
function vtWorkflowEdit($adb, $request, $requestUrl, $current_language, $app_strings)
{
global $theme, $current_user;
$util = new VTWorkflowUtils();
$image_path = "themes/{$theme}/images/";
$module = new VTWorkflowApplication("editworkflow");
$mod = return_module_language($current_language, $module->name);
if (!$util->checkAdminAccess()) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
return;
}
$smarty = new vtigerCRM_Smarty();
if ($request['source'] == 'from_template') {
$tm = new VTWorkflowTemplateManager($adb);
$template = $tm->retrieveTemplate($request['template_id']);
$workflow = $tm->createWorkflow($template);
} else {
$wfs = new VTWorkflowManager($adb);
if (isset($request["workflow_id"])) {
$workflow = $wfs->retrieve($request["workflow_id"]);
} else {
$moduleName = $request["module_name"];
$workflow = $wfs->newWorkflow($moduleName);
}
$smarty->assign('ScheduledWorkflowsCount', $wfs->getScheduledWorkflowsCount());
$smarty->assign('MaxAllowedScheduledWorkflows', $wfs->getMaxAllowedScheduledWorkflows());
$smarty->assign('schdtime_12h', date('h:ia', strtotime(substr($workflow->schtime, 0, strrpos($workflow->schtime, ':')))));
$schannualdates = json_decode($workflow->schannualdates);
if (count($schannualdates) > 0) {
$schannualdates = DateTimeField::convertToUserFormat($schannualdates[0]);
} else {
$schannualdates = '';
}
$smarty->assign('schdate', $schannualdates);
$smarty->assign('selected_days1_31', json_decode($workflow->schdayofmonth));
$smarty->assign('dayOfWeek', json_decode($workflow->schdayofweek));
}
if ($workflow == null) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_WORKFLOW']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_WORKFLOW']);
return;
}
$workflow->test = addslashes($workflow->test);
$tm = new VTTaskManager($adb);
$tasks = $tm->getTasksForWorkflow($workflow->id);
$smarty->assign("tasks", $tasks);
$taskTypes = $tm->getTaskTypes($workflow->moduleName);
$smarty->assign("taskTypes", $taskTypes);
$smarty->assign("newTaskReturnUrl", vtlib_purify($requestUrl));
$dayrange = array();
for ($d = 1; $d <= 31; $d++) {
$dayrange[$d] = $d;
}
$smarty->assign('days1_31', $dayrange);
$smarty->assign('wfnexttrigger_time', DateTimeField::convertToUserFormat($workflow->nexttrigger_time));
$smarty->assign("dateFormat", parse_calendardate($current_user->date_format));
$smarty->assign("returnUrl", vtlib_purify($request["return_url"]));
$smarty->assign("APP", $app_strings);
$smarty->assign("MOD", array_merge(return_module_language($current_language, 'Settings'), return_module_language($current_language, $module->name)));
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE_NAME", $module->label);
$smarty->assign("PAGE_NAME", $mod['LBL_EDIT_WORKFLOW']);
$smarty->assign("PAGE_TITLE", $mod['LBL_EDIT_WORKFLOW_TITLE']);
$smarty->assign("workflow", $workflow);
$smarty->assign("saveType", isset($workflow->id) ? "edit" : "new");
$smarty->assign("module", $module);
$smarty->assign("WORKFLOW_TRIGGER_TYPES_HELP_LINK", WORKFLOW_TRIGGER_TYPES);
$smarty->display("{$module->name}/EditWorkflow.tpl");
}
示例5: vtTaskEdit
function vtTaskEdit($adb, $request, $current_language, $app_strings)
{
global $theme;
$util = new VTWorkflowUtils();
$request = vtlib_purify($request);
// this cleans all values of the array
$image_path = "themes/{$theme}/images/";
$module = new VTWorkflowApplication('edittask');
$mod = return_module_language($current_language, $module->name);
if (!$util->checkAdminAccess()) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
return;
}
$smarty = new vtigerCRM_Smarty();
$tm = new VTTaskManager($adb);
$smarty->assign('edit', isset($request["task_id"]));
if (isset($request["task_id"])) {
$task = $tm->retrieveTask($request["task_id"]);
$taskClass = get_class($task);
$workflowId = $task->workflowId;
} else {
$workflowId = $request["workflow_id"];
$taskClass = vtlib_purifyForSql($request["task_type"]);
$task = $tm->createTask($taskClass, $workflowId);
}
if ($task == null) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_TASK']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_TASK']);
return;
}
$wm = new VTWorkflowManager($adb);
$workflow = $wm->retrieve($workflowId);
if ($workflow == null) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_WORKFLOW']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_WORKFLOW']);
return;
}
$smarty->assign("workflow", $workflow);
$smarty->assign("returnUrl", $request["return_url"]);
$smarty->assign("task", $task);
$smarty->assign("taskType", $taskClass);
$smarty->assign("saveType", $request['save_type']);
$taskTypeInstance = VTTaskType::getInstanceFromTaskType($taskClass);
$taskTemplateClass = $tm->retrieveTemplatePath($module->name, $taskTypeInstance);
$smarty->assign("taskTemplate", $taskTemplateClass);
$et = VTWSEntityType::usingGlobalCurrentUser($workflow->moduleName);
$smarty->assign("entityType", $et);
$smarty->assign('entityName', $workflow->moduleName);
$smarty->assign("fieldNames", $et->getFieldNames());
$repeat_date = $task->calendar_repeat_limit_date;
if (!empty($repeat_date)) {
$repeat_date = DateTimeField::convertToUserFormat($repeat_date);
}
$smarty->assign('REPEAT_DATE', $repeat_date);
$dateFields = array();
$fieldTypes = $et->getFieldTypes();
$fieldLabels = $et->getFieldLabels();
foreach ($fieldTypes as $name => $type) {
if ($type->type == 'Date' || $type->type == 'DateTime') {
$dateFields[$name] = $fieldLabels[$name];
}
}
$smarty->assign('dateFields', $dateFields);
if ($task->trigger != null) {
$trigger = $task->trigger;
$days = $trigger['days'];
if ($days < 0) {
$days *= -1;
$direction = 'before';
} else {
$direction = 'after';
}
$smarty->assign('trigger', array('days' => $days, 'direction' => $direction, 'field' => $trigger['field']));
}
$metaVariables = $task->getMetaVariables();
$date = new DateTimeField(null);
$time = substr($date->getDisplayTime(), 0, 5);
$smarty->assign("META_VARIABLES", $metaVariables);
$smarty->assign("SYSTEM_TIMEZONE", $db_timezone);
$smarty->assign("USER_TIME", $task->formatTimeForTimePicker($time));
$smarty->assign("USER_DATE", $date->getDisplayDate());
$smarty->assign("MOD", array_merge(return_module_language($current_language, 'Settings'), return_module_language($current_language, 'Calendar'), return_module_language($current_language, $module->name)));
$smarty->assign("APP", $app_strings);
$smarty->assign("dateFormat", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("THEME", $theme);
$smarty->assign("MODULE_NAME", $module->label);
$smarty->assign("PAGE_NAME", $mod['LBL_EDIT_TASK']);
$smarty->assign("PAGE_TITLE", $mod['LBL_EDIT_TASK_TITLE']);
$users = $group = array();
$users['user'] = get_user_array();
$users['group'] = get_group_array();
$smarty->assign('ASSIGNED_TO', $users);
$smarty->assign("module", $module);
$smarty->display("{$module->name}/EditTask.tpl");
}
示例6: getParentTab
* All Rights Reserved.
*
********************************************************************************/
require_once 'include/utils/CommonUtils.php';
require_once 'include/CustomFieldUtil.php';
require_once 'modules/Calendar/Activity.php';
require_once 'modules/Calendar/Calendar.php';
require_once 'modules/Calendar/CalendarCommon.php';
require_once "modules/Emails/mail.php";
global $theme, $mod_strings, $app_strings, $current_user, $currentModule;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$category = getParentTab();
$userDetails = getOtherUserName($current_user->id, true);
$to_email = getUserEmailId('id', $current_user->id);
$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
$taskassignedto = getAssignedTo(9);
$eventassignedto = getAssignedTo(16);
$mysel = vtlib_purify($_REQUEST['view']);
$calendar_arr = array();
$calendar_arr['IMAGE_PATH'] = $image_path;
if (empty($mysel)) {
if ($current_user->activity_view == "This Year") {
$mysel = 'year';
} else {
if ($current_user->activity_view == "This Month") {
$mysel = 'month';
} else {
if ($current_user->activity_view == "This Week") {
$mysel = 'week';
} else {
示例7: process
public function process(Vtiger_Request $request)
{
PDFMaker_Debugger_Model::GetInstance()->Init();
$adb = PearDatabase::getInstance();
$current_user = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
global $current_language;
$step = $request->get('step');
if ($step == "") {
$step = "1";
}
$mode = $request->get('mode');
$record = $request->get('record');
if (isset($mode) && $mode == "Delete") {
$sql1 = "SELECT module FROM vtiger_pdfmaker_relblocks WHERE relblockid = ?";
$rel_module = $adb->query_result($adb->pquery($sql1, array($record)), 0, "module");
$sql2 = "DELETE FROM vtiger_pdfmaker_relblocks WHERE relblockid = ?";
$result = $adb->pquery($sql2, array($record));
header("Location:index.php?module=PDFMaker&action=PDFMakerAjax&file=ListRelatedBlocks&parenttab=Tools&pdfmodule=" . $rel_module);
exit;
}
if (isset($mode) && $mode == "add") {
$sql = "SELECT * FROM vtiger_pdfmaker_relblocks WHERE relblockid = ?";
$result = $adb->pquery($sql, array($record));
$Blockdata = $adb->fetchByAssoc($result, 0);
$body = $Blockdata["block"];
$body = str_replace("RELBLOCK_START", "RELBLOCK" . $record . "_START", $body);
$body = str_replace("RELBLOCK_END", "RELBLOCK" . $record . "_END", $body);
//echo $body; exit;
echo "<div id='block' style='display:none;'>" . $body . "</div>";
echo "<script> \n\t\tvar oEditor = window.opener.CKEDITOR.instances.body; \n\t\t\n\t\tcontent = document.getElementById('block').innerHTML;\n\t\t\n\t\toEditor.insertHtml(content); \n\t\tself.close();\n\t\t</script>";
exit;
}
$viewer->assign("PARENTTAB", getParentTab());
$viewer->assign("DATEFORMAT", $current_user->get('date_format'));
$viewer->assign("JS_DATEFORMAT", parse_calendardate(vtranslate('NTC_DATE_FORMAT')));
$RelatedBlock = new PDFMaker_RelatedBlock_Model();
$columns1 = "";
if ($record) {
$sql = "SELECT * FROM vtiger_pdfmaker_relblocks WHERE relblockid = ?";
$result = $adb->pquery($sql, array($record));
$Blockdata = $adb->fetchByAssoc($result, 0);
$rel_module = $Blockdata["module"];
$sec_module = $Blockdata["secmodule"];
$blockname = $Blockdata["name"];
$block = $Blockdata["block"];
$sql2 = "SELECT * FROM vtiger_pdfmaker_relblockdatefilter WHERE datefilterid = ?";
$result2 = $adb->pquery($sql2, array($record));
$num_rows2 = $adb->num_rows($result2);
if ($num_rows2 > 0) {
$datecolumnname = $adb->query_result($result2, 0, "datecolumnname");
$stdselectedfilter = $adb->query_result($result2, 0, "datefilter");
$startdate = $adb->query_result($result2, 0, "startdate");
$enddate = $adb->query_result($result2, 0, "enddate");
if ($startdate != "" && $startdate != "0000-00-00") {
$viewer->assign("STARTDATE_STD", getValidDisplayDate($startdate));
}
if ($enddate != "" && $startdate != "0000-00-00") {
$viewer->assign("ENDDATE_STD", getValidDisplayDate($enddate));
}
}
$module_list = $RelatedBlock->getModuleList($sec_module);
$options1 = $RelatedBlock->getStdCriteriaByModule($sec_module, $module_list, $current_user);
if (count($options1) > 0) {
foreach ($options1 as $value => $label) {
if ($value == $datecolumnname) {
$sel = "selected";
} else {
$sel = "";
}
$columns1 .= "<option value='" . $value . "' " . $sel . ">" . $label . "</option>";
}
}
$columns2 = "";
foreach ($module_list as $blockid => $optgroup) {
$options2 = $RelatedBlock->getColumnsListbyBlock($sec_module, $blockid, $rel_module, $current_user);
if (count($options2) > 0) {
$columns2 .= "<optgroup label='" . $optgroup . "'>";
foreach ($options2 as $value => $label) {
$columns2 .= "<option value='" . $value . "'>" . $label . "</option>";
}
$columns2 .= "</optgroup>";
}
}
$selected_columns = $this->getSelectedColumnsList($rel_module, $sec_module, $record, $current_user);
list($sortCols, $sortOrder) = $this->getSortColumns($record, $selected_columns);
$step = 3;
$mode = 'edit';
$RelatedBlock->setId($record);
$reportModel = Reports_Record_Model::getCleanInstance('');
$reportModel->setPrimaryModule($rel_module);
$RelatedBlock->setPrimaryModule($rel_module);
if (!empty($sec_module)) {
$RelatedBlock->setSecondaryModule($sec_module);
$reportModel->setSecondaryModule($sec_module);
}
$viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $RelatedBlock->transformToNewAdvancedFilter());
$viewer->assign('PRIMARY_MODULE', $primaryModule);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
$primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
//.........这里部分代码省略.........
示例8: draw
function draw($extra_tools)
{
global $app_list_strings, $current_language, $sugar_config, $currentModule, $action, $theme;
$current_module_strings = return_module_language($current_language, 'Charts');
if (isset($_REQUEST['obm_refresh'])) {
$refresh = $_REQUEST['obm_refresh'];
} else {
$refresh = false;
}
$date_start = array();
$datax = array();
//get the dates to display
global $current_user;
$user_date_start = $current_user->getPreference('obm_date_start');
if (!empty($user_date_start) && !isset($_REQUEST['obm_date_start'])) {
$date_start = $user_date_start;
Log::debug("USER PREFERENCES['obm_date_start'] is:");
Log::debug($user_date_start);
} elseif (isset($_REQUEST['obm_year']) && $_REQUEST['obm_year'] != '') {
$date_start = $_REQUEST['obm_year'] . '-01-01';
$current_user->setPreference('obm_date_start', $date_start);
Log::debug("_REQUEST['obm_date_start'] is:");
Log::debug($_REQUEST['obm_date_start']);
Log::debug("_SESSION['obm_date_start'] is:");
Log::debug($current_user->getPreference('obm_date_start'));
} else {
$date_start = date('Y') . '-01-01';
}
$user_date_end = $current_user->getPreference('obm_date_end');
if (!empty($user_date_end) && !isset($_REQUEST['obm_date_end'])) {
$date_end = $user_date_end;
Log::debug("USER PREFERENCES['obm_date_end'] is:");
Log::debug($date_end);
} elseif (isset($_REQUEST['obm_year']) && $_REQUEST['obm_year'] != '') {
$date_end = $_REQUEST['obm_year'] . '-12-31';
$current_user->setPreference('obm_date_end', $date_end);
Log::debug("_REQUEST['obm_date_end'] is:");
Log::debug($_REQUEST['obm_date_end']);
Log::debug("USER PREFERENCES['obm_date_end'] is:");
Log::debug($current_user->getPreference('obm_date_end'));
} else {
$date_end = date('Y') . '-12-31';
}
$ids = array();
//get list of user ids for which to display data
$user_ids = $current_user->getPreference('obm_ids');
if (!empty($user_ids) && count($user_ids) != 0 && !isset($_REQUEST['obm_ids'])) {
$ids = $user_ids;
Log::debug("USER PREFERENCES['obm_ids'] is:");
Log::debug($user_ids);
} elseif (isset($_REQUEST['obm_ids']) && count($_REQUEST['obm_ids']) > 0) {
$ids = $_REQUEST['obm_ids'];
$current_user->setPreference('obm_ids', $_REQUEST['obm_ids']);
Log::debug("_REQUEST['obm_ids'] is:");
Log::debug($_REQUEST['obm_ids']);
Log::debug("USER PREFRENCES['obm_ids'] is:");
Log::debug($current_user->getPreference('obm_ids'));
} else {
$ids = get_user_array(false);
$ids = array_keys($ids);
}
//create unique prefix based on selected users for image files
$id_hash = '1';
if (isset($ids)) {
sort($ids);
$id_hash = crc32(implode('', $ids));
if ($id_hash < 0) {
$id_hash = $id_hash * -1;
}
}
Log::debug("ids is:");
Log::debug($ids);
$id_md5 = substr(md5($current_user->id), 0, 9);
// cn: format date_start|end to user's preferred
global $timedate;
$dateDisplayStart = strftime($timedate->get_user_date_format(), strtotime($date_start));
$dateDisplayEnd = strftime($timedate->get_user_date_format(), strtotime($date_end));
$seps = array("-", "/");
$dates = array($date_start, $date_end);
$dateFileNameSafe = str_replace($seps, "_", $dates);
$cache_file_name = sugar_cached("xml/") . $current_user->getUserPrivGuid() . "_outcome_by_month_" . $dateFileNameSafe[0] . "_" . $dateFileNameSafe[1] . ".xml";
Log::debug("cache file name is: {$cache_file_name}");
global $app_strings;
$tools = '<div align="right"><a href="index.php?module=' . $currentModule . '&action=' . $action . '&obm_refresh=true" class="tabFormAdvLink">' . SugarThemeRegistry::current()->getImage('refresh', 'border="0" align="absmiddle"', null, null, '.gif', $mod_strings['LBL_REFRESH']) . ' ' . $current_module_strings['LBL_REFRESH'] . '</a> <a href="javascript: toggleDisplay(\'outcome_by_month_edit\');" class="tabFormAdvLink">' . SugarThemeRegistry::current()->getImage('edit', 'border="0" align="absmiddle"', null, null, '.gif', $mod_strings['LBL_EDIT']) . ' ' . $current_module_strings['LBL_EDIT'] . '</a> ' . $extra_tools . '</div>';
?>
<?php
echo '<span onmouseover="this.style.cursor=\'move\'" id="chart_handle_' . $this->order . '">' . get_form_header($current_module_strings['LBL_YEAR_BY_OUTCOME'], $tools, false) . '</span>';
?>
<?php
$cal_lang = "en";
$cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
if (empty($_SESSION['obm_ids'])) {
$_SESSION['obm_ids'] = "";
}
?>
<p>
<div id='outcome_by_month_edit' style='display: none;'>
<form name="outcome_by_month" action="index.php" method="post" >
<input type="hidden" name="module" value="<?php
//.........这里部分代码省略.........
示例9: htmlspecialchars
$list_report_form->assign("MOD", $mod_strings);
$list_report_form->assign("APP", $app_strings);
$list_report_form->assign("IMAGE_PATH", $image_path);
$list_report_form->assign("REPORTID", $reportid);
$list_report_form->assign("IS_EDITABLE", $ogReport->is_editable);
$list_report_form->assign("REP_FOLDERS", $ogReport->sgetRptFldr());
$list_report_form->assign("REPORTNAME", htmlspecialchars($ogReport->reportname, ENT_QUOTES, $default_charset));
if (is_array($sshtml)) {
$list_report_form->assign("REPORTHTML", $sshtml);
} else {
$list_report_form->assign("ERROR_MSG", getTranslatedString('LBL_REPORT_GENERATION_FAILED', $currentModule) . "<br>" . $sshtml);
}
$list_report_form->assign("REPORTTOTHTML", $totalhtml);
$list_report_form->assign("FOLDERID", $folderid);
$list_report_form->assign("DATEFORMAT", $current_user->date_format);
$list_report_form->assign("JS_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
if ($modules_export_permitted == true) {
$list_report_form->assign("EXPORT_PERMITTED", "YES");
} else {
$list_report_form->assign("EXPORT_PERMITTED", "NO");
}
$rep_in_fldr = $ogReport->sgetRptsforFldr($folderid);
for ($i = 0; $i < count($rep_in_fldr); $i++) {
$rep_id = $rep_in_fldr[$i]['reportid'];
$rep_name = $rep_in_fldr[$i]['reportname'];
$reports_array[$rep_id] = $rep_name;
}
$list_report_form->assign('CHECK', Button_Check($ogReport->primodule));
if ($_REQUEST['mode'] != 'ajax') {
$list_report_form->assign("REPINFOLDER", $reports_array);
include 'modules/Vtiger/header.php';
示例10: getOutputHtml
/** This function returns the vtiger_field details for a given vtiger_fieldname.
* Param $uitype - UI type of the vtiger_field
* Param $fieldname - Form vtiger_field name
* Param $fieldlabel - Form vtiger_field label name
* Param $maxlength - maximum length of the vtiger_field
* Param $col_fields - array contains the vtiger_fieldname and values
* Param $generatedtype - Field generated type (default is 1)
* Param $module_name - module name
* Return type is an array
*/
function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields, $generatedtype, $module_name, $mode = '', $typeofdata = null)
{
global $log, $app_strings, $adb, $default_charset, $theme, $mod_strings, $current_user;
$log->debug("Entering getOutputHtml(" . $uitype . "," . $fieldname . "," . $fieldlabel . "," . $maxlength . "," . print_r($col_fields, true) . "," . $generatedtype . "," . $module_name . ") method ...");
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$fieldlabel = from_html($fieldlabel);
$fieldvalue = array();
$final_arr = array();
$value = $col_fields[$fieldname];
$custfld = '';
$ui_type[] = $uitype;
$editview_fldname[] = $fieldname;
// vtlib customization: Related type field
if ($uitype == '10') {
global $adb;
$fldmod_result = $adb->pquery('SELECT relmodule, status FROM vtiger_fieldmodulerel WHERE fieldid=
(SELECT fieldid FROM vtiger_field, vtiger_tab WHERE vtiger_field.tabid=vtiger_tab.tabid AND fieldname=? AND name=? and vtiger_field.presence in (0,2)) order by sequence', array($fieldname, $module_name));
$entityTypes = array();
$parent_id = $value;
for ($index = 0; $index < $adb->num_rows($fldmod_result); ++$index) {
$entityTypes[] = $adb->query_result($fldmod_result, $index, 'relmodule');
}
if (!empty($value)) {
if ($adb->num_rows($fldmod_result) == 1) {
$valueType = $adb->query_result($fldmod_result, 0, 0);
} else {
$valueType = getSalesEntityType($value);
}
$displayValueArray = getEntityName($valueType, $value);
if (!empty($displayValueArray)) {
foreach ($displayValueArray as $key => $value) {
$displayValue = $value;
}
}
} else {
$displayValue = '';
$valueType = '';
$value = '';
}
$editview_label[] = array('options' => $entityTypes, 'selected' => $valueType, 'displaylabel' => getTranslatedString($fieldlabel, $module_name));
$fieldvalue[] = array('displayvalue' => $displayValue, 'entityid' => $parent_id);
} else {
if ($uitype == 5 || $uitype == 6 || $uitype == 23) {
$log->info("uitype is " . $uitype);
if ($value == '') {
//modified to fix the issue in trac(http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/1469)
if ($fieldname != 'birthday' && $generatedtype != 2 && getTabid($module_name) != 14) {
$disp_value = getNewDisplayDate();
}
if (($module_name == 'Events' || $module_name == 'Calendar') && $uitype == 6) {
$curr_time = date('H:i', strtotime('+5 minutes'));
}
if (($module_name == 'Events' || $module_name == 'Calendar') && $uitype == 23) {
$curr_time = date('H:i', strtotime('+10 minutes'));
}
//Added to display the Contact - Support End Date as one year future instead of
//today's date -- 30-11-2005
if ($fieldname == 'support_end_date' && $_REQUEST['module'] == 'Contacts') {
$addyear = strtotime("+1 year");
$disp_value = DateTimeField::convertToUserFormat(date('Y-m-d', $addyear));
} elseif ($fieldname == 'validtill' && $_REQUEST['module'] == 'Quotes') {
$disp_value = '';
}
} else {
if ($uitype == 6) {
if ($col_fields['time_start'] != '' && ($module_name == 'Events' || $module_name == 'Calendar')) {
$curr_time = $col_fields['time_start'];
$value = $value . ' ' . $curr_time;
} else {
$curr_time = date('H:i', strtotime('+5 minutes'));
}
}
if (($module_name == 'Events' || $module_name == 'Calendar') && $uitype == 23) {
if ($col_fields['time_end'] != '') {
$curr_time = $col_fields['time_end'];
$value = $value . ' ' . $curr_time;
} else {
$curr_time = date('H:i', strtotime('+10 minutes'));
}
}
$disp_value = getValidDisplayDate($value);
}
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
if (!empty($curr_time)) {
if (($module_name == 'Events' || $module_name == 'Calendar') && ($uitype == 23 || $uitype == 6)) {
$curr_time = DateTimeField::convertToUserTimeZone($curr_time);
//.........这里部分代码省略.........
示例11: parse_calendardate
<!--*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
-->
<script src="include/js/json.js" type="text/javascript" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="include/js/advancefilter.js"></script>
<?php
if ($this->_tpl_vars['JS_DATEFORMAT'] == '') {
?>
<?php
$this->assign('JS_DATEFORMAT', parse_calendardate($this->_tpl_vars['APP']['NTC_DATE_FORMAT']));
}
?>
<input type="hidden" id="jscal_dateformat" name="jscal_dateformat" value="<?php
echo $this->_tpl_vars['JS_DATEFORMAT'];
?>
" />
<input type="hidden" id="image_path" name="image_path" value="<?php
echo $this->_tpl_vars['IMAGE_PATH'];
?>
" />
<input type="hidden" name="advft_criteria" id="advft_criteria" value="" />
<input type="hidden" name="advft_criteria_groups" id="advft_criteria_groups" value="" />
<script language="JavaScript" type="text/JavaScript">
function addColumnConditionGlue(columnIndex) {
示例12: get_new_record_form_old
/**
* Create HTML form to enter a new record with the minimum necessary fields.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
*/
function get_new_record_form_old()
{
require_once 'include/time.php';
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $current_user;
global $theme;
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_subject = $mod_strings['LBL_SUBJECT'];
$lbl_date = $mod_strings['LBL_DATE'];
$lbl_time = $mod_strings['LBL_TIME'];
$ntc_date_format = $app_strings['NTC_DATE_FORMAT'];
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$default_parent_type = $app_list_strings['record_type_default_key'];
$default_date_start = date('Y-m-d');
$default_time_start = to_display_time(date('H:i'));
$ntc_time_format = '(' . getDisplayTimeFormat() . ')';
$ampm = AMPMMenu('', date('H:i'));
$user_id = $current_user->id;
// Unimplemented until jscalendar language files are fixed
// $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
$cal_lang = "en";
$cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
\t\t<form name="EmailSave" onSubmit="return check_form('EmailSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Emails">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="action" value="Save">
\t\t\t<input type="hidden" name="parent_type" value="{$default_parent_type}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
<p>\t\t{$lbl_subject} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='name' type="text"><br>
\t\t{$lbl_date} <span class="required">{$lbl_required_symbol}</span> <span class="dateFormat">{$ntc_date_format}</span><br>
\t\t<input name='date_start' onblur="parseDate(this, {$cal_dateformat});" id='jscal_field' type="text" maxlength="10" value="{$default_date_start}"> <img src="themes/{$theme}/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br>
\t\t{$lbl_time} <span class="required">{$lbl_required_symbol}</span> <span class="dateFormat">{$ntc_time_format}</span><br>
\t\t<input name='time_start' maxlength='5' type="text" value="{$default_time_start}">{$ampm}</p>
<p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value=" {$lbl_save_button_label} " ></p>
\t\t</form>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
\t\t});
\t\t</script>
EOQ;
$the_form .= get_left_form_footer();
require_once 'include/javascript/javascript.php';
require_once 'modules/Emails/Email.php';
$javascript = new javascript();
$javascript->setFormName('EmailSave');
$javascript->setSugarBean(new Email());
$javascript->addRequiredFields('');
$the_form .= $javascript->getScript();
return $the_form;
}
示例13: getWideFormBody
function getWideFormBody($prefix, $mod = 'Quotes', $formname = '', $lead = '')
{
if (!ACLController::checkAccess('Quotes', 'edit', true)) {
return '';
}
if (empty($lead)) {
$lead = BeanFactory::getBean('Leads');
}
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
} else {
global $mod_strings;
}
global $app_strings;
global $app_list_strings;
global $theme;
global $current_user;
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_quote_name = $mod_strings['LBL_QUOTE_NAME'];
$lbl_sales_stage = $mod_strings['LBL_SALES_STAGE'];
$lbl_date_closed = $mod_strings['LBL_DATE_QUOTE_EXPECTED_CLOSED'];
$lbl_amount = $mod_strings['LBL_AMOUNT'];
$ntc_date_format = $app_strings['NTC_DATE_FORMAT'];
$user_id = $current_user->id;
// Unimplemented until jscalendar language files are fixed
// $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
$cal_lang = "en";
$cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
$jsCalendarImage = SugarThemeRegistry::current()->getImageURL("jscalendar.gif");
$the_form = <<<EOQ
\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t<input type="hidden" name="{$prefix}billing_account_name" value="skip_me">
\t\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="20%" scope="row">{$lbl_quote_name} <span class="required">{$lbl_required_symbol}</span></td>
<td width="80%" scope="row">{$mod_strings['LBL_DESCRIPTION']}</td>
</tr>
<tr>
<td ><input name='{$prefix}name' type="text" value="{$lead->quote_name}"></td>
\t<td rowspan="7"><textarea name='{$prefix}description' rows='5' cols='50'></textarea></td>
</tr>
<tr>
<td scope="row">{$lbl_date_closed} <span class="required">{$lbl_required_symbol}</span>
\t<br><span class="dateFormat">{$ntc_date_format}</span></td>
</tr>
<tr>
<td ><input name='{$prefix}date_quote_expected_closed' onblur="parseDate(this, '{$cal_dateformat}');" size='12' maxlength='10' id='{$prefix}jscal_field' type="text" value=""> <!--not_in_theme!--><img src="{$jsCalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="{$prefix}jscal_trigger" align="absmiddle"></td>
</tr>
<tr>
<td scope="row">{$lbl_sales_stage} <span class="required">{$lbl_required_symbol}</span></td>
</tr>
<tr>
<td ><select name='{$prefix}sales_stage'>
EOQ;
$the_form .= get_select_options_with_id($app_list_strings['sales_stage_dom'], "");
$the_form .= <<<EOQ
\t\t</select></td>
</tr>
<tr>
<td scope="row">{$lbl_amount} <span class="required">{$lbl_required_symbol}</span></td>
</tr>
<tr>
<td ><input name='{$prefix}amount' type="text" value='{$lead->quote_amount}'></td>
</tr>
</table>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "{$prefix}jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "{$prefix}jscal_trigger", singleClick : true, step : 1, weekNumbers:false
\t\t});
\t\t</script>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(BeanFactory::getBean('Quotes'));
$javascript->addRequiredFields($prefix);
$the_form .= $javascript->getScript();
return $the_form;
}
示例14: vtTaskEdit
function vtTaskEdit($adb, $request, $current_language, $app_strings)
{
global $theme;
$util = new VTWorkflowUtils();
$image_path = "themes/{$theme}/images/";
$module = new VTWorkflowApplication('edittask');
$mod = return_module_language($current_language, $module->name);
if (!$util->checkAdminAccess()) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
return;
}
$smarty = new vtigerCRM_Smarty();
$tm = new VTTaskManager($adb);
$smarty->assign('edit', isset($request["task_id"]));
if (isset($request["task_id"])) {
$task = $tm->retrieveTask($request["task_id"]);
$workflowId = $task->workflowId;
} else {
$workflowId = $request["workflow_id"];
$taskClass = $request["task_type"];
$task = $tm->createTask($taskClass, $workflowId);
}
if ($task == null) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_TASK']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_TASK']);
return;
}
$wm = new VTWorkflowManager($adb);
$workflow = $wm->retrieve($workflowId);
if ($workflow == null) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_WORKFLOW']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_WORKFLOW']);
return;
}
$smarty->assign("workflow", $workflow);
$smarty->assign("returnUrl", $request["return_url"]);
$smarty->assign("task", $task);
$smarty->assign("taskType", $taskClass);
$smarty->assign("saveType", $request['save_type']);
$taskClass = get_class($task);
$smarty->assign("taskTemplate", "{$module->name}/taskforms/{$taskClass}.tpl");
$et = VTWSEntityType::usingGlobalCurrentUser($workflow->moduleName);
$smarty->assign("entityType", $et);
$smarty->assign('entityName', $workflow->moduleName);
$smarty->assign("fieldNames", $et->getFieldNames());
$dateFields = array();
$fieldTypes = $et->getFieldTypes();
$fieldLabels = $et->getFieldLabels();
foreach ($fieldTypes as $name => $type) {
if ($type->type == 'Date' || $type->type == 'DateTime') {
$dateFields[$name] = $fieldLabels[$name];
}
}
$smarty->assign('dateFields', $dateFields);
if ($task->trigger != null) {
$trigger = $task->trigger;
$days = $trigger['days'];
if ($days < 0) {
$days *= -1;
$direction = 'before';
} else {
$direction = 'after';
}
$smarty->assign('trigger', array('days' => $days, 'direction' => $direction, 'field' => $trigger['field']));
}
$curr_date = "(general : (__VtigerMeta__) date)";
$curr_time = '(general : (__VtigerMeta__) time)';
$smarty->assign("DATE", $curr_date);
$smarty->assign("TIME", $curr_time);
$smarty->assign("MOD", array_merge(return_module_language($current_language, 'Settings'), return_module_language($current_language, 'Calendar'), return_module_language($current_language, $module->name)));
$smarty->assign("APP", $app_strings);
$smarty->assign("dateFormat", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("THEME", $theme);
$smarty->assign("MODULE_NAME", $module->label);
$smarty->assign("PAGE_NAME", $mod['LBL_EDIT_TASK']);
$smarty->assign("PAGE_TITLE", $mod['LBL_EDIT_TASK_TITLE']);
$smarty->assign("module", $module);
$smarty->display("{$module->name}/EditTask.tpl");
}
示例15: getOutputHtml
//.........这里部分代码省略.........
}
$value = $currentuser_group;
}
$key = "picklist_array_group";
$picklist_array = getSqlCacheData($key);
if (!$picklist_array) {
$pick_query = "select * from ec_groups order by groupid";
$pickListResult = $adb->getList($pick_query);
$picklist_array = array();
foreach ($pickListResult as $row) {
$picklist_array[] = $row["groupname"];
}
setSqlCacheData($key, $picklist_array);
}
$editview_label[] = $mod_strings[$fieldlabel];
foreach ($picklist_array as $pickListValue) {
if ($value == $pickListValue) {
$chk_val = "selected";
} else {
$chk_val = '';
}
$options[] = array($pickListValue => $chk_val);
}
$fieldvalue[] = $options;
} elseif ($uitype == 59) {
if ($value != '') {
$product_name = getProductName($value);
}
$editview_label[] = $mod_strings[$fieldlabel];
$fieldvalue[] = $product_name;
$fieldvalue[] = $value;
} elseif ($uitype == 64) {
$editview_label[] = $mod_strings[$fieldlabel];
$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
$fieldvalue[] = $value;
} elseif ($uitype == 56) {
$editview_label[] = $mod_strings[$fieldlabel];
$fieldvalue[] = $value;
} elseif ($uitype == 57) {
$accountid = $col_fields['account_id'];
if (empty($accountid)) {
$convertmode = "";
if (isset($_REQUEST['convertmode'])) {
$convertmode = $_REQUEST['convertmode'];
}
if ($convertmode != 'update_quote_val' && $convertmode != 'update_so_val') {
if (isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '') {
$accountid = $_REQUEST['account_id'];
}
}
}
$contact_name = '';
// if(trim($value) != '')
// {
// $contact_name = getContactName($value);
// }
// elseif(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id'] != '')
// {
// if(isset($_REQUEST['module']) && $_REQUEST['module'] == 'Contacts' && $fieldname = 'contact_id')
// {
// $contact_name = '';
// }
// else
// {
// $value = $_REQUEST['contact_id'];
// $contact_name = getContactName($value);