2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
39 require_once('include/DetailView/DetailView.php');
45 /* start standard DetailView layout process */
46 $GLOBALS['log']->info("Schedulers DetailView");
47 $focus = new Scheduler();
49 $detailView = new DetailView();
51 if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
52 $result = $detailView->processSugarBean("SCHEDULER", $focus, $offset);
54 sugar_die($app_strings['ERROR_NO_RECORD']);
58 header("Location: index.php?module=Schedulers&action=index");
60 if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
65 $params[] = "<a href='index.php?module=Schedulers&action=index'>{$mod_strings['LBL_MODULE_TITLE']}</a>";
66 $params[] = $focus->name;
68 echo getClassicModuleTitle("Schedulers", $params, true);
70 /* end standard DetailView layout process */
72 $focus->parseInterval();
73 $focus->setIntervalHumanReadable();
76 $xtpl = new XTemplate('modules/Schedulers/DetailView.html');
78 $focus->date_time_end = empty($focus->date_time_end) ? 0 : $focus->date_time_end; // this value is often emtpy/null
79 if(strtotime($focus->date_time_end) < strtotime('2016-01-01 00:00:00')) {
80 $xtpl->assign('DATE_TIME_END', $mod_strings['LBL_PERENNIAL']);
81 } elseif($focus->date_time_end != '') {
82 $xtpl->assign('DATE_TIME_END', $mod_strings['LBL_PERENNIAL']);
84 $xtpl->assign('DATE_TIME_END', $focus->date_time_end);
86 if($focus->last_run != '') {
87 $xtpl->assign('LAST_RUN', $focus->last_run);
89 $xtpl->assign('LAST_RUN', $mod_strings['LBL_NEVER']);
91 if($focus->time_from != '') {
92 $xtpl->assign('TIME_FROM', $focus->time_from);
94 $xtpl->assign('TIME_FROM', $mod_strings['LBL_ALWAYS']);
96 if($focus->time_to != '') {
97 $xtpl->assign('TIME_TO', $focus->time_to);
99 $xtpl->assign('TIME_TO', $mod_strings['LBL_ALWAYS']);
101 if($focus->catch_up == 1) {
102 $xtpl->assign('CATCH_UP', $mod_strings['LBL_ALWAYS']);
104 $xtpl->assign('CATCH_UP', $mod_strings['LBL_NEVER']);
107 $focus->created_by_name = get_assigned_user_name($focus->created_by);
108 $focus->modified_by_name = get_assigned_user_name($focus->modified_user_id);
110 $xtpl->assign('MOD', $mod_strings);
111 $xtpl->assign('APP', $app_strings);
112 $xtpl->assign('CREATED_BY', $focus->created_by_name);
113 $xtpl->assign('MODIFIED_BY', $focus->modified_by_name);
114 $xtpl->assign('GRIDLINE', $gridline);
115 $xtpl->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
116 $xtpl->assign('ID', $focus->id);
117 $xtpl->assign('NAME', $focus->name);
118 $xtpl->assign('JOB', $focus->job);
119 $xtpl->assign('STATUS', isset($app_list_strings['scheduler_status_dom'][$focus->status]) ? $app_list_strings['scheduler_status_dom'][$focus->status] : $focus->status);
120 $xtpl->assign('DATE_TIME_START', $focus->date_time_start);
121 $xtpl->assign('DATE_ENTERED', $focus->date_entered);
122 $xtpl->assign('DATE_MODIFIED', $focus->date_modified);
123 $xtpl->assign('MODIFIED_USER_ID', $focus->modified_by_name);
124 $xtpl->assign('CREATED_BY', $focus->created_by_name);
125 $xtpl->assign('JOB_INTERVAL', $focus->intervalHumanReadable);
127 $xtpl->parse('main');
130 require_once('include/SubPanel/SubPanelTiles.php');
131 $subpanel = new SubPanelTiles($focus, 'Schedulers');
132 echo $subpanel->display();
134 //$focus->displayCronInstructions();