@@ -20,10 +20,17 @@ discard block |
||
20 | 20 | * \brief File to load vat rates combobox |
21 | 21 | */ |
22 | 22 | |
23 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal |
|
24 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); |
|
23 | +if (! defined('NOTOKENRENEWAL')) { |
|
24 | + define('NOTOKENRENEWAL','1'); |
|
25 | +} |
|
26 | +// Disables token renewal |
|
27 | +if (! defined('NOREQUIREMENU')) { |
|
28 | + define('NOREQUIREMENU','1'); |
|
29 | +} |
|
25 | 30 | //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); |
26 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
31 | +if (! defined('NOREQUIREAJAX')) { |
|
32 | + define('NOREQUIREAJAX','1'); |
|
33 | +} |
|
27 | 34 | //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
28 | 35 | //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
29 | 36 | |
@@ -55,8 +62,7 @@ discard block |
||
55 | 62 | { |
56 | 63 | $seller = $mysoc; |
57 | 64 | $buyer = $soc; |
58 | - } |
|
59 | - else |
|
65 | + } else |
|
60 | 66 | { |
61 | 67 | $buyer = $mysoc; |
62 | 68 | $seller = $soc; |
@@ -20,20 +20,20 @@ discard block |
||
20 | 20 | * \brief File to load vat rates combobox |
21 | 21 | */ |
22 | 22 | |
23 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal |
|
24 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); |
|
23 | +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal |
|
24 | +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); |
|
25 | 25 | //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); |
26 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
26 | +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
27 | 27 | //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
28 | 28 | //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
29 | 29 | |
30 | 30 | require '../../main.inc.php'; |
31 | 31 | |
32 | -$id = GETPOST('id','int'); |
|
33 | -$action = GETPOST('action','alpha'); |
|
34 | -$htmlname = GETPOST('htmlname','alpha'); |
|
35 | -$selected = (GETPOST('selected')?GETPOST('selected'):'-1'); |
|
36 | -$productid = (GETPOST('productid','int')?GETPOST('productid','int'):0); |
|
32 | +$id = GETPOST('id', 'int'); |
|
33 | +$action = GETPOST('action', 'alpha'); |
|
34 | +$htmlname = GETPOST('htmlname', 'alpha'); |
|
35 | +$selected = (GETPOST('selected') ?GETPOST('selected') : '-1'); |
|
36 | +$productid = (GETPOST('productid', 'int') ?GETPOST('productid', 'int') : 0); |
|
37 | 37 | |
38 | 38 | /* |
39 | 39 | * View |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | //print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n"; |
45 | 45 | |
46 | 46 | // Load original field value |
47 | -if (! empty($id) && ! empty($action) && ! empty($htmlname)) |
|
47 | +if (!empty($id) && !empty($action) && !empty($htmlname)) |
|
48 | 48 | { |
49 | 49 | $form = new Form($db); |
50 | 50 | $soc = new Societe($db); |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | $seller = $soc; |
63 | 63 | } |
64 | 64 | |
65 | - $return=array(); |
|
65 | + $return = array(); |
|
66 | 66 | |
67 | - $return['value'] = $form->load_tva('tva_tx',$selected,$seller,$buyer,$productid,0,'',true); |
|
68 | - $return['num'] = $form->num; |
|
67 | + $return['value'] = $form->load_tva('tva_tx', $selected, $seller, $buyer, $productid, 0, '', true); |
|
68 | + $return['num'] = $form->num; |
|
69 | 69 | $return['error'] = $form->error; |
70 | 70 | |
71 | 71 | echo json_encode($return); |
@@ -18,13 +18,27 @@ |
||
18 | 18 | * Library javascript to enable Browser notifications |
19 | 19 | */ |
20 | 20 | |
21 | -if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); |
|
22 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
23 | -if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); |
|
24 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); |
|
25 | -if (!defined('NOLOGIN')) define('NOLOGIN', 1); |
|
26 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1); |
|
27 | -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); |
|
21 | +if (!defined('NOREQUIREUSER')) { |
|
22 | + define('NOREQUIREUSER', '1'); |
|
23 | +} |
|
24 | +if (!defined('NOREQUIRESOC')) { |
|
25 | + define('NOREQUIRESOC', '1'); |
|
26 | +} |
|
27 | +if (!defined('NOCSRFCHECK')) { |
|
28 | + define('NOCSRFCHECK', 1); |
|
29 | +} |
|
30 | +if (!defined('NOTOKENRENEWAL')) { |
|
31 | + define('NOTOKENRENEWAL', 1); |
|
32 | +} |
|
33 | +if (!defined('NOLOGIN')) { |
|
34 | + define('NOLOGIN', 1); |
|
35 | +} |
|
36 | +if (!defined('NOREQUIREMENU')) { |
|
37 | + define('NOREQUIREMENU', 1); |
|
38 | +} |
|
39 | +if (!defined('NOREQUIREHTML')) { |
|
40 | + define('NOREQUIREHTML', 1); |
|
41 | +} |
|
28 | 42 | |
29 | 43 | require_once '../../main.inc.php'; |
30 | 44 |
@@ -29,33 +29,33 @@ discard block |
||
29 | 29 | require_once '../../main.inc.php'; |
30 | 30 | |
31 | 31 | if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/index.php' |
32 | - || preg_match('/getmenu_div\.php/', $_SERVER['HTTP_REFERER']))) |
|
32 | + || preg_match('/getmenu_div\.php/', $_SERVER['HTTP_REFERER']))) |
|
33 | 33 | { |
34 | - global $langs, $conf; |
|
34 | + global $langs, $conf; |
|
35 | 35 | |
36 | - top_httphead('text/javascript; charset=UTF-8'); |
|
36 | + top_httphead('text/javascript; charset=UTF-8'); |
|
37 | 37 | |
38 | - $nowtime = time(); |
|
39 | - //$nowtimeprevious = floor($nowtime / 60) * 60; // auto_check_events_not_before is rounded to previous minute |
|
38 | + $nowtime = time(); |
|
39 | + //$nowtimeprevious = floor($nowtime / 60) * 60; // auto_check_events_not_before is rounded to previous minute |
|
40 | 40 | |
41 | - // TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when. |
|
42 | - /* session already started into main |
|
41 | + // TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when. |
|
42 | + /* session already started into main |
|
43 | 43 | session_cache_limiter(FALSE); |
44 | 44 | header('Cache-Control: no-cache'); |
45 | 45 | session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
46 | 46 | session_start();*/ |
47 | - if (! isset($_SESSION['auto_check_events_not_before'])) |
|
48 | - { |
|
49 | - print 'console.log("_SESSION[auto_check_events_not_before] is not set");'."\n"; |
|
50 | - // Round to eliminate the seconds |
|
51 | - $_SESSION['auto_check_events_not_before'] = $nowtime; |
|
52 | - } |
|
53 | - print 'var nowtime = ' . $nowtime . ';' . "\n"; |
|
54 | - print 'var login = \'' . $_SESSION['dol_login'] . '\';' . "\n"; |
|
55 | - print 'var auto_check_events_not_before = '.$_SESSION['auto_check_events_not_before']. ';'."\n"; |
|
56 | - print 'var time_js_next_test = Math.max(nowtime, auto_check_events_not_before);'."\n"; |
|
57 | - print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined |
|
58 | - ?> |
|
47 | + if (! isset($_SESSION['auto_check_events_not_before'])) |
|
48 | + { |
|
49 | + print 'console.log("_SESSION[auto_check_events_not_before] is not set");'."\n"; |
|
50 | + // Round to eliminate the seconds |
|
51 | + $_SESSION['auto_check_events_not_before'] = $nowtime; |
|
52 | + } |
|
53 | + print 'var nowtime = ' . $nowtime . ';' . "\n"; |
|
54 | + print 'var login = \'' . $_SESSION['dol_login'] . '\';' . "\n"; |
|
55 | + print 'var auto_check_events_not_before = '.$_SESSION['auto_check_events_not_before']. ';'."\n"; |
|
56 | + print 'var time_js_next_test = Math.max(nowtime, auto_check_events_not_before);'."\n"; |
|
57 | + print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined |
|
58 | + ?> |
|
59 | 59 | |
60 | 60 | /* Check if permission ok */ |
61 | 61 | if (Notification.permission !== "granted") { |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | if (arr.length > 0) { |
91 | 91 | var audio = null; |
92 | 92 | <?php |
93 | - if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { |
|
94 | - print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');'; |
|
95 | - } |
|
96 | - ?> |
|
93 | + if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { |
|
94 | + print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');'; |
|
95 | + } |
|
96 | + ?> |
|
97 | 97 | |
98 | 98 | $.each(arr, function (index, value) { |
99 | 99 | var url="notdefined"; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | require_once '../../main.inc.php'; |
30 | 30 | |
31 | -if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/index.php' |
|
31 | +if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/index.php' |
|
32 | 32 | || preg_match('/getmenu_div\.php/', $_SERVER['HTTP_REFERER']))) |
33 | 33 | { |
34 | 34 | global $langs, $conf; |
@@ -44,17 +44,17 @@ discard block |
||
44 | 44 | header('Cache-Control: no-cache'); |
45 | 45 | session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
46 | 46 | session_start();*/ |
47 | - if (! isset($_SESSION['auto_check_events_not_before'])) |
|
47 | + if (!isset($_SESSION['auto_check_events_not_before'])) |
|
48 | 48 | { |
49 | 49 | print 'console.log("_SESSION[auto_check_events_not_before] is not set");'."\n"; |
50 | 50 | // Round to eliminate the seconds |
51 | 51 | $_SESSION['auto_check_events_not_before'] = $nowtime; |
52 | 52 | } |
53 | - print 'var nowtime = ' . $nowtime . ';' . "\n"; |
|
54 | - print 'var login = \'' . $_SESSION['dol_login'] . '\';' . "\n"; |
|
55 | - print 'var auto_check_events_not_before = '.$_SESSION['auto_check_events_not_before']. ';'."\n"; |
|
53 | + print 'var nowtime = '.$nowtime.';'."\n"; |
|
54 | + print 'var login = \''.$_SESSION['dol_login'].'\';'."\n"; |
|
55 | + print 'var auto_check_events_not_before = '.$_SESSION['auto_check_events_not_before'].';'."\n"; |
|
56 | 56 | print 'var time_js_next_test = Math.max(nowtime, auto_check_events_not_before);'."\n"; |
57 | - print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined |
|
57 | + print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined |
|
58 | 58 | ?> |
59 | 59 | |
60 | 60 | /* Check if permission ok */ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (arr.length > 0) { |
91 | 91 | var audio = null; |
92 | 92 | <?php |
93 | - if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { |
|
93 | + if (!empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { |
|
94 | 94 | print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');'; |
95 | 95 | } |
96 | 96 | ?> |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | |
26 | 26 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language |
27 | 27 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
28 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
28 | +if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
29 | 29 | //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations |
30 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); |
|
31 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); |
|
32 | -if (! defined('NOLOGIN')) define('NOLOGIN',1); |
|
33 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); |
|
34 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); |
|
35 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
30 | +if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); |
|
31 | +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); |
|
32 | +if (!defined('NOLOGIN')) define('NOLOGIN', 1); |
|
33 | +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1); |
|
34 | +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); |
|
35 | +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
36 | 36 | |
37 | 37 | session_cache_limiter(FALSE); |
38 | 38 | |
@@ -1121,8 +1121,8 @@ discard block |
||
1121 | 1121 | if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { |
1122 | 1122 | $thousand = $langs->transnoentitiesnoconv("SeparatorThousand"); |
1123 | 1123 | } |
1124 | - if ($thousand == 'Space') $thousand=' '; |
|
1125 | - print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript |
|
1124 | + if ($thousand == 'Space') $thousand = ' '; |
|
1125 | + print "var dec='".dol_escape_js($dec)."'; var thousand='".dol_escape_js($thousand)."';\n"; // Set var in javascript |
|
1126 | 1126 | ?> |
1127 | 1127 | |
1128 | 1128 | var main_max_dec_shown = <?php echo (int) str_replace('.', '', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>; |
@@ -25,14 +25,28 @@ discard block |
||
25 | 25 | |
26 | 26 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language |
27 | 27 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
28 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
28 | +if (! defined('NOREQUIRESOC')) { |
|
29 | + define('NOREQUIRESOC','1'); |
|
30 | +} |
|
29 | 31 | //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations |
30 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); |
|
31 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); |
|
32 | -if (! defined('NOLOGIN')) define('NOLOGIN',1); |
|
33 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); |
|
34 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); |
|
35 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
32 | +if (! defined('NOCSRFCHECK')) { |
|
33 | + define('NOCSRFCHECK',1); |
|
34 | +} |
|
35 | +if (! defined('NOTOKENRENEWAL')) { |
|
36 | + define('NOTOKENRENEWAL',1); |
|
37 | +} |
|
38 | +if (! defined('NOLOGIN')) { |
|
39 | + define('NOLOGIN',1); |
|
40 | +} |
|
41 | +if (! defined('NOREQUIREMENU')) { |
|
42 | + define('NOREQUIREMENU',1); |
|
43 | +} |
|
44 | +if (! defined('NOREQUIREHTML')) { |
|
45 | + define('NOREQUIREHTML',1); |
|
46 | +} |
|
47 | +if (! defined('NOREQUIREAJAX')) { |
|
48 | + define('NOREQUIREAJAX','1'); |
|
49 | +} |
|
36 | 50 | |
37 | 51 | session_cache_limiter(FALSE); |
38 | 52 | |
@@ -41,8 +55,11 @@ discard block |
||
41 | 55 | // Define javascript type |
42 | 56 | top_httphead('text/javascript; charset=UTF-8'); |
43 | 57 | // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. |
44 | -if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate'); |
|
45 | -else header('Cache-Control: no-cache'); |
|
58 | +if (empty($dolibarr_nocache)) { |
|
59 | + header('Cache-Control: max-age=3600, public, must-revalidate'); |
|
60 | +} else { |
|
61 | + header('Cache-Control: no-cache'); |
|
62 | +} |
|
46 | 63 | ?> |
47 | 64 | // Javascript libraries for Dolibarr ERP CRM (https://www.dolibarr.org) |
48 | 65 | |
@@ -1179,7 +1196,9 @@ discard block |
||
1179 | 1196 | if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { |
1180 | 1197 | $thousand = $langs->transnoentitiesnoconv("SeparatorThousand"); |
1181 | 1198 | } |
1182 | - if ($thousand == 'Space') $thousand=' '; |
|
1199 | + if ($thousand == 'Space') { |
|
1200 | + $thousand=' '; |
|
1201 | + } |
|
1183 | 1202 | print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript |
1184 | 1203 | ?> |
1185 | 1204 |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | |
24 | 24 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language |
25 | 25 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
26 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
26 | +if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
27 | 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'); |
|
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 | 34 | |
35 | 35 | session_cache_limiter(FALSE); |
36 | 36 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | |
46 | 46 | // Define tradMonths javascript array (we define this in datepicker AND in parent page to avoid errors with IE8) |
47 | -$tradMonths=array( |
|
47 | +$tradMonths = array( |
|
48 | 48 | dol_escape_js($langs->transnoentitiesnoconv("January")), |
49 | 49 | dol_escape_js($langs->transnoentitiesnoconv("February")), |
50 | 50 | dol_escape_js($langs->transnoentitiesnoconv("March")), |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | dol_escape_js($langs->transnoentitiesnoconv("December")) |
60 | 60 | ); |
61 | 61 | |
62 | -$tradMonthsShort=array( |
|
62 | +$tradMonthsShort = array( |
|
63 | 63 | $langs->trans("JanuaryMin"), |
64 | 64 | $langs->trans("FebruaryMin"), |
65 | 65 | $langs->trans("MarchMin"), |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $langs->trans("DecemberMin") |
75 | 75 | ); |
76 | 76 | |
77 | -$tradDays=array( |
|
77 | +$tradDays = array( |
|
78 | 78 | $langs->trans("Sunday"), |
79 | 79 | $langs->trans("Monday"), |
80 | 80 | $langs->trans("Tuesday"), |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $langs->trans("Saturday") |
85 | 85 | ); |
86 | 86 | |
87 | -$tradDaysShort=array( |
|
87 | +$tradDaysShort = array( |
|
88 | 88 | $langs->trans("ShortSunday"), |
89 | 89 | $langs->trans("ShortMonday"), |
90 | 90 | $langs->trans("ShortTuesday"), |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $langs->trans("ShortSaturday") |
95 | 95 | ); |
96 | 96 | |
97 | -$tradDaysMin=array( |
|
97 | +$tradDaysMin = array( |
|
98 | 98 | $langs->trans("SundayMin"), |
99 | 99 | $langs->trans("MondayMin"), |
100 | 100 | $langs->trans("TuesdayMin"), |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | dayNamesMin: tradDaysMin, |
139 | 139 | weekHeader: '<?php echo $langs->trans("Week"); ?>', |
140 | 140 | dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>', |
141 | - firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, |
|
142 | - isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>, |
|
141 | + firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'); ?>, |
|
142 | + isRTL: <?php echo ($langs->trans("DIRECTION") == 'rtl' ? 'true' : 'false'); ?>, |
|
143 | 143 | showMonthAfterYear: false, // TODO add specific to country |
144 | 144 | yearSuffix: '' // TODO add specific to country |
145 | 145 | }; |
@@ -23,14 +23,28 @@ discard block |
||
23 | 23 | |
24 | 24 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language |
25 | 25 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
26 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
26 | +if (! defined('NOREQUIRESOC')) { |
|
27 | + define('NOREQUIRESOC','1'); |
|
28 | +} |
|
27 | 29 | //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'); |
|
30 | +if (! defined('NOCSRFCHECK')) { |
|
31 | + define('NOCSRFCHECK',1); |
|
32 | +} |
|
33 | +if (! defined('NOTOKENRENEWAL')) { |
|
34 | + define('NOTOKENRENEWAL',1); |
|
35 | +} |
|
36 | +if (! defined('NOLOGIN')) { |
|
37 | + define('NOLOGIN',1); |
|
38 | +} |
|
39 | +if (! defined('NOREQUIREMENU')) { |
|
40 | + define('NOREQUIREMENU',1); |
|
41 | +} |
|
42 | +if (! defined('NOREQUIREHTML')) { |
|
43 | + define('NOREQUIREHTML',1); |
|
44 | +} |
|
45 | +if (! defined('NOREQUIREAJAX')) { |
|
46 | + define('NOREQUIREAJAX','1'); |
|
47 | +} |
|
34 | 48 | |
35 | 49 | session_cache_limiter(FALSE); |
36 | 50 | |
@@ -39,8 +53,11 @@ discard block |
||
39 | 53 | // Define javascript type |
40 | 54 | top_httphead('text/javascript; charset=UTF-8'); |
41 | 55 | // 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'); |
|
56 | +if (empty($dolibarr_nocache)) { |
|
57 | + header('Cache-Control: max-age=3600, public, must-revalidate'); |
|
58 | +} else { |
|
59 | + header('Cache-Control: no-cache'); |
|
60 | +} |
|
44 | 61 | |
45 | 62 | |
46 | 63 | // Define tradMonths javascript array (we define this in datepicker AND in parent page to avoid errors with IE8) |
@@ -148,4 +165,6 @@ discard block |
||
148 | 165 | |
149 | 166 | |
150 | 167 | <?php |
151 | -if (is_object($db)) $db->close(); |
|
168 | +if (is_object($db)) { |
|
169 | + $db->close(); |
|
170 | +} |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | |
24 | 24 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language |
25 | 25 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
26 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
26 | +if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
27 | 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'); |
|
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 | 34 | |
35 | 35 | session_cache_limiter(FALSE); |
36 | 36 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | timeFormat: 'HH:mm', |
59 | 59 | amNames: ['AM', 'A'], |
60 | 60 | pmNames: ['PM', 'P'], |
61 | - isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?> |
|
61 | + isRTL: <?php echo ($langs->trans("DIRECTION") == 'rtl' ? 'true' : 'false'); ?> |
|
62 | 62 | }; |
63 | 63 | $.timepicker.setDefaults($.timepicker.regional['<?php echo $langs->defaultlang ?>']); |
64 | 64 | }); |
@@ -23,14 +23,28 @@ discard block |
||
23 | 23 | |
24 | 24 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language |
25 | 25 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
26 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
26 | +if (! defined('NOREQUIRESOC')) { |
|
27 | + define('NOREQUIRESOC','1'); |
|
28 | +} |
|
27 | 29 | //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'); |
|
30 | +if (! defined('NOCSRFCHECK')) { |
|
31 | + define('NOCSRFCHECK',1); |
|
32 | +} |
|
33 | +if (! defined('NOTOKENRENEWAL')) { |
|
34 | + define('NOTOKENRENEWAL',1); |
|
35 | +} |
|
36 | +if (! defined('NOLOGIN')) { |
|
37 | + define('NOLOGIN',1); |
|
38 | +} |
|
39 | +if (! defined('NOREQUIREMENU')) { |
|
40 | + define('NOREQUIREMENU',1); |
|
41 | +} |
|
42 | +if (! defined('NOREQUIREHTML')) { |
|
43 | + define('NOREQUIREHTML',1); |
|
44 | +} |
|
45 | +if (! defined('NOREQUIREAJAX')) { |
|
46 | + define('NOREQUIREAJAX','1'); |
|
47 | +} |
|
34 | 48 | |
35 | 49 | session_cache_limiter(FALSE); |
36 | 50 | |
@@ -39,8 +53,11 @@ discard block |
||
39 | 53 | // Define javascript type |
40 | 54 | top_httphead('text/javascript; charset=UTF-8'); |
41 | 55 | // 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'); |
|
56 | +if (empty($dolibarr_nocache)) { |
|
57 | + header('Cache-Control: max-age=3600, public, must-revalidate'); |
|
58 | +} else { |
|
59 | + header('Cache-Control: no-cache'); |
|
60 | +} |
|
44 | 61 | ?> |
45 | 62 | |
46 | 63 | // For JQuery Timepicker |
@@ -64,4 +81,6 @@ discard block |
||
64 | 81 | }); |
65 | 82 | |
66 | 83 | <?php |
67 | -if (is_object($db)) $db->close(); |
|
84 | +if (is_object($db)) { |
|
85 | + $db->close(); |
|
86 | +} |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | 21 | |
22 | -define('NOTOKENRENEWAL',1); // Disables token renewal |
|
22 | +define('NOTOKENRENEWAL', 1); // Disables token renewal |
|
23 | 23 | |
24 | 24 | require '../../../../main.inc.php'; |
25 | 25 | ?> |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | <button style="WIDTH: 100%" type="button"> |
105 | 105 | <table cellSpacing="0" cellPadding="0" width="100%" border="0"> |
106 | 106 | <tr> |
107 | - <td><?php echo img_picto_common('','treemenu/folder.gif','width="16" height="16"'); ?></td> |
|
107 | + <td><?php echo img_picto_common('', 'treemenu/folder.gif', 'width="16" height="16"'); ?></td> |
|
108 | 108 | <td> </td> |
109 | 109 | <td id="tdName" width="100%" class="ActualFolder nowrap">/</td> |
110 | 110 | <td> </td> |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | 21 | |
22 | -define('NOTOKENRENEWAL',1); // Disables token renewal |
|
22 | +define('NOTOKENRENEWAL', 1); // Disables token renewal |
|
23 | 23 | |
24 | 24 | require '../../../../main.inc.php'; |
25 | 25 | ?> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | 21 | |
22 | -define('NOTOKENRENEWAL',1); // Disables token renewal |
|
22 | +define('NOTOKENRENEWAL', 1); // Disables token renewal |
|
23 | 23 | |
24 | 24 | require '../../../../main.inc.php'; |
25 | 25 | ?> |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <button type="button" style="WIDTH: 100%" onclick="CreateFolder();"> |
127 | 127 | <table cellSpacing="0" cellPadding="0" border="0"> |
128 | 128 | <tr> |
129 | - <td><?php echo img_picto_common('','treemenu/folder.gif','width="16" height="16"'); ?></td> |
|
129 | + <td><?php echo img_picto_common('', 'treemenu/folder.gif', 'width="16" height="16"'); ?></td> |
|
130 | 130 | <td> </td> |
131 | 131 | <td class="nowrap">Create New Folder</td> |
132 | 132 | </tr> |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | //define('NOTOKENRENEWAL',1); // Disables token renewal |
23 | 23 | //require '../../../../main.inc.php'; |
24 | -require '../../connectors/php/config.php'; // This include the define('NOTOKENRENEWAL',1) and the require main.in.php |
|
24 | +require '../../connectors/php/config.php'; // This include the define('NOTOKENRENEWAL',1) and the require main.in.php |
|
25 | 25 | |
26 | 26 | global $Config; |
27 | 27 |