dolibarr  7.0.0-beta
timepicker.js.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
3  * Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
24 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
25 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
26 if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
27 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
28 if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
29 if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
30 if (! defined('NOLOGIN')) define('NOLOGIN',1);
31 if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
32 if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
33 if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
34 
35 session_cache_limiter(FALSE);
36 
37 require_once '../../main.inc.php';
38 
39 // Define javascript type
40 top_httphead('text/javascript; charset=UTF-8');
41 // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
42 if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
43 else header('Cache-Control: no-cache');
44 ?>
45 
46 // For JQuery Timepicker
47 jQuery(function($){
48  $.timepicker.regional['<?php echo $langs->defaultlang ?>'] = {
49  timeOnlyTitle: '<?php echo $langs->trans("TimeOnly") ?>',
50  timeText: '<?php echo $langs->trans("Time") ?>',
51  hourText: '<?php echo $langs->trans("Hour") ?>',
52  minuteText: '<?php echo $langs->trans("Minute") ?>',
53  secondText: '<?php echo $langs->trans("Second") ?>',
54  millisecText: '<?php echo $langs->trans("Millisecond") ?>',
55  timezoneText: '<?php echo $langs->trans("Timezone") ?>',
56  currentText: '<?php echo $langs->trans("Now") ?>',
57  closeText: '<?php echo $langs->trans("Close2") ?>',
58  timeFormat: 'HH:mm',
59  amNames: ['AM', 'A'],
60  pmNames: ['PM', 'P'],
61  isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>
62  };
63  $.timepicker.setDefaults($.timepicker.regional['<?php echo $langs->defaultlang ?>']);
64 });
65 
66 <?php
67 if (is_object($db)) $db->close();
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html')
Show HTTP header.
Definition: main.inc.php:1052