]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Schedulers/DetailView.php
Release 6.2.0
[Github/sugarcrm.git] / modules / Schedulers / DetailView.php
1 <?php
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-2011 SugarCRM Inc.
6  * 
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.
13  * 
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
17  * details.
18  * 
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
22  * 02110-1301 USA.
23  * 
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.
26  * 
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.
30  * 
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  ********************************************************************************/
37
38
39 require_once('include/DetailView/DetailView.php');
40
41 global $mod_strings;
42 global $app_strings;
43 global $timedate;
44
45 /* start standard DetailView layout process */
46 $GLOBALS['log']->info("Schedulers DetailView");
47 $focus = new Scheduler();
48 $focus->checkCurl();
49 $detailView = new DetailView();
50 $offset=0;
51 if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
52         $result = $detailView->processSugarBean("SCHEDULER", $focus, $offset);
53         if($result == null) {
54             sugar_die($app_strings['ERROR_NO_RECORD']);
55         }
56         $focus=$result;
57 } else {
58         header("Location: index.php?module=Schedulers&action=index");
59 }
60 if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
61         $focus->id = "";
62 }
63
64 $params = array();
65 $params[] = "<a href='index.php?module=Schedulers&action=index'>{$mod_strings['LBL_MODULE_TITLE']}</a>";
66 $params[] = $focus->name;
67
68 echo getClassicModuleTitle("Schedulers", $params, true);
69
70 /* end standard DetailView layout process */
71
72 $focus->parseInterval();
73 $focus->setIntervalHumanReadable();
74
75
76 $xtpl = new XTemplate('modules/Schedulers/DetailView.html');
77 // custom assigns
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']);
83 } else {
84         $xtpl->assign('DATE_TIME_END', $focus->date_time_end);
85 }
86 if($focus->last_run != '') {
87         $xtpl->assign('LAST_RUN', $focus->last_run);
88 } else {
89         $xtpl->assign('LAST_RUN', $mod_strings['LBL_NEVER']);
90 }
91 if($focus->time_from != '') {
92         $xtpl->assign('TIME_FROM', $focus->time_from);
93 } else {
94         $xtpl->assign('TIME_FROM', $mod_strings['LBL_ALWAYS']);
95 }
96 if($focus->time_to != '') {
97         $xtpl->assign('TIME_TO', $focus->time_to);
98 } else {
99         $xtpl->assign('TIME_TO', $mod_strings['LBL_ALWAYS']);
100 }
101 if($focus->catch_up == 1) {
102         $xtpl->assign('CATCH_UP', $mod_strings['LBL_ALWAYS']);
103 } else {
104         $xtpl->assign('CATCH_UP', $mod_strings['LBL_NEVER']);
105 }
106
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);
109
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);
126
127 $xtpl->parse('main');
128 $xtpl->out('main');
129
130 require_once('include/SubPanel/SubPanelTiles.php');
131 $subpanel = new SubPanelTiles($focus, 'Schedulers');
132 echo $subpanel->display();
133
134 //$focus->displayCronInstructions();
135 ?>