@@ -29,13 +29,15 @@ |
||
29 | 29 | global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; |
30 | 30 | $theme_bordercolor = array(235, 235, 224); |
31 | 31 | $theme_datacolor = array(array(137, 86, 161), array(60, 147, 183), array(250, 190, 80), array(191, 75, 57), array(80, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); |
32 | -if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php page, not by the style sheet, if the constant is not defined. |
|
32 | +if (!defined('ISLOADEDBYSTEELSHEET')) { |
|
33 | + // File is run after an include of a php page, not by the style sheet, if the constant is not defined. |
|
33 | 34 | { |
34 | 35 | if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php |
35 | 36 | { |
36 | 37 | if ($conf->global->MAIN_OPTIMIZEFORCOLORBLIND == 'flashy') |
37 | 38 | { |
38 | 39 | $theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); |
40 | +} |
|
39 | 41 | } else { |
40 | 42 | // for now we use the same configuration for all types of color blind |
41 | 43 | $theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); |
@@ -28,21 +28,36 @@ discard block |
||
28 | 28 | |
29 | 29 | //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language |
30 | 30 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url. |
31 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
31 | +if (!defined('NOREQUIRESOC')) { |
|
32 | + define('NOREQUIRESOC', '1'); |
|
33 | +} |
|
32 | 34 | //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations |
33 | -if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); |
|
34 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); |
|
35 | -if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login |
|
35 | +if (!defined('NOCSRFCHECK')) { |
|
36 | + define('NOCSRFCHECK', 1); |
|
37 | +} |
|
38 | +if (!defined('NOTOKENRENEWAL')) { |
|
39 | + define('NOTOKENRENEWAL', 1); |
|
40 | +} |
|
41 | +if (!defined('NOLOGIN')) { |
|
42 | + define('NOLOGIN', 1); |
|
43 | +} |
|
44 | +// File must be accessed by logon page so without login |
|
36 | 45 | //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content |
37 | -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); |
|
38 | -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
46 | +if (!defined('NOREQUIREHTML')) { |
|
47 | + define('NOREQUIREHTML', 1); |
|
48 | +} |
|
49 | +if (!defined('NOREQUIREAJAX')) { |
|
50 | + define('NOREQUIREAJAX', '1'); |
|
51 | +} |
|
39 | 52 | |
40 | 53 | |
41 | 54 | define('ISLOADEDBYSTEELSHEET', '1'); |
42 | 55 | |
43 | 56 | |
44 | 57 | require __DIR__.'/theme_vars.inc.php'; |
45 | -if (defined('THEME_ONLY_CONSTANT')) return; |
|
58 | +if (defined('THEME_ONLY_CONSTANT')) { |
|
59 | + return; |
|
60 | +} |
|
46 | 61 | |
47 | 62 | session_cache_limiter('public'); |
48 | 63 | |
@@ -62,11 +77,20 @@ discard block |
||
62 | 77 | // Define css type |
63 | 78 | top_httphead('text/css'); |
64 | 79 | // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. |
65 | -if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate'); |
|
66 | -else header('Cache-Control: no-cache'); |
|
80 | +if (empty($dolibarr_nocache)) { |
|
81 | + header('Cache-Control: max-age=10800, public, must-revalidate'); |
|
82 | +} else { |
|
83 | + header('Cache-Control: no-cache'); |
|
84 | +} |
|
67 | 85 | |
68 | -if (GETPOST('theme', 'alpha')) $conf->theme = GETPOST('theme', 'alpha'); // If theme was forced on URL |
|
69 | -if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL |
|
86 | +if (GETPOST('theme', 'alpha')) { |
|
87 | + $conf->theme = GETPOST('theme', 'alpha'); |
|
88 | +} |
|
89 | +// If theme was forced on URL |
|
90 | +if (GETPOST('lang', 'aZ09')) { |
|
91 | + $langs->setDefaultLang(GETPOST('lang', 'aZ09')); |
|
92 | +} |
|
93 | +// If language was forced on URL |
|
70 | 94 | |
71 | 95 | $langs->load("main", 0, 1); |
72 | 96 | $right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right'); |
@@ -94,15 +118,33 @@ discard block |
||
94 | 118 | $borderwidth = 2; |
95 | 119 | |
96 | 120 | // Case of option always editable |
97 | -if (!isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY = $colorbackbody; |
|
98 | -if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1; |
|
99 | -if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1; |
|
100 | -if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1; |
|
101 | -if (!isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover; |
|
102 | -if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked; |
|
103 | -if (!isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak; |
|
104 | -if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab; |
|
105 | -if (!isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK = $colortextlink; |
|
121 | +if (!isset($conf->global->THEME_ELDY_BACKBODY)) { |
|
122 | + $conf->global->THEME_ELDY_BACKBODY = $colorbackbody; |
|
123 | +} |
|
124 | +if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) { |
|
125 | + $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1; |
|
126 | +} |
|
127 | +if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) { |
|
128 | + $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1; |
|
129 | +} |
|
130 | +if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) { |
|
131 | + $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1; |
|
132 | +} |
|
133 | +if (!isset($conf->global->THEME_ELDY_USE_HOVER)) { |
|
134 | + $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover; |
|
135 | +} |
|
136 | +if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) { |
|
137 | + $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked; |
|
138 | +} |
|
139 | +if (!isset($conf->global->THEME_ELDY_LINEBREAK)) { |
|
140 | + $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak; |
|
141 | +} |
|
142 | +if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) { |
|
143 | + $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab; |
|
144 | +} |
|
145 | +if (!isset($conf->global->THEME_ELDY_TEXTLINK)) { |
|
146 | + $conf->global->THEME_ELDY_TEXTLINK = $colortextlink; |
|
147 | +} |
|
106 | 148 | |
107 | 149 | // Case of option editable only if option THEME_ELDY_ENABLE_PERSONALIZED is on |
108 | 150 | if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) |
@@ -145,14 +187,19 @@ discard block |
||
145 | 187 | $colorbacklinepairchecked = ((!isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED === '255,255,255') ? '' : ($user->conf->THEME_ELDY_USE_CHECKED === '1' ? 'edf4fb' : $user->conf->THEME_ELDY_USE_CHECKED)); |
146 | 188 | } |
147 | 189 | |
148 | -if (empty($colortopbordertitle1)) $colortopbordertitle1 = $colorbackhmenu1; |
|
190 | +if (empty($colortopbordertitle1)) { |
|
191 | + $colortopbordertitle1 = $colorbackhmenu1; |
|
192 | +} |
|
149 | 193 | |
150 | 194 | // Set text color to black or white |
151 | 195 | $colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' |
152 | 196 | $tmppart = explode(',', $colorbackhmenu1); |
153 | 197 | $tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0); |
154 | -if ($tmpval <= 460) $colortextbackhmenu = 'FFFFFF'; |
|
155 | -else $colortextbackhmenu = '000000'; |
|
198 | +if ($tmpval <= 460) { |
|
199 | + $colortextbackhmenu = 'FFFFFF'; |
|
200 | +} else { |
|
201 | + $colortextbackhmenu = '000000'; |
|
202 | +} |
|
156 | 203 | |
157 | 204 | $colorbackvmenu1 = join(',', colorStringToArray($colorbackvmenu1)); // Normalize value to 'x,y,z' |
158 | 205 | $tmppart = explode(',', $colorbackvmenu1); |
@@ -165,7 +212,9 @@ discard block |
||
165 | 212 | { |
166 | 213 | $tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0); |
167 | 214 | if ($tmpval <= 460) { $colortexttitle = 'FFFFFF'; $colorshadowtitle = '888888'; } else { $colortexttitle = '101010'; $colorshadowtitle = 'FFFFFF'; } |
168 | -} else $colorshadowtitle = '888888'; |
|
215 | +} else { |
|
216 | + $colorshadowtitle = '888888'; |
|
217 | +} |
|
169 | 218 | |
170 | 219 | $colorbacktabcard1 = join(',', colorStringToArray($colorbacktabcard1)); // Normalize value to 'x,y,z' |
171 | 220 | $tmppart = explode(',', $colorbacktabcard1); |
@@ -182,8 +231,12 @@ discard block |
||
182 | 231 | $colorbacklineimpair2 = join(',', colorStringToArray($colorbacklineimpair2)); |
183 | 232 | $colorbacklinepair1 = join(',', colorStringToArray($colorbacklinepair1)); |
184 | 233 | $colorbacklinepair2 = join(',', colorStringToArray($colorbacklinepair2)); |
185 | -if ($colorbacklinepairhover != '') $colorbacklinepairhover = join(',', colorStringToArray($colorbacklinepairhover)); |
|
186 | -if ($colorbacklinepairchecked != '') $colorbacklinepairchecked = join(',', colorStringToArray($colorbacklinepairchecked)); |
|
234 | +if ($colorbacklinepairhover != '') { |
|
235 | + $colorbacklinepairhover = join(',', colorStringToArray($colorbacklinepairhover)); |
|
236 | +} |
|
237 | +if ($colorbacklinepairchecked != '') { |
|
238 | + $colorbacklinepairchecked = join(',', colorStringToArray($colorbacklinepairchecked)); |
|
239 | +} |
|
187 | 240 | $colorbackbody = join(',', colorStringToArray($colorbackbody)); |
188 | 241 | $colortexttitlenotab = join(',', colorStringToArray($colortexttitlenotab)); |
189 | 242 | $colortexttitle = join(',', colorStringToArray($colortexttitle)); |
@@ -191,7 +244,9 @@ discard block |
||
191 | 244 | $colortextlink = join(',', colorStringToArray($colortextlink)); |
192 | 245 | |
193 | 246 | $nbtopmenuentries = $menumanager->showmenu('topnb'); |
194 | -if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 10); |
|
247 | +if ($conf->browser->layout == 'phone') { |
|
248 | + $nbtopmenuentries = max($nbtopmenuentries, 10); |
|
249 | +} |
|
195 | 250 | |
196 | 251 | print '/*'."\n"; |
197 | 252 | print 'colorbackbody='.$colorbackbody."\n"; |
@@ -1068,7 +1123,8 @@ discard block |
||
1068 | 1123 | } |
1069 | 1124 | |
1070 | 1125 | .flexcontainer { |
1071 | - <?php if (in_array($conf->browser->name, array('chrome', 'firefox'))) echo 'display: inline-flex;' ?> |
|
1126 | + <?php if (in_array($conf->browser->name, array('chrome', 'firefox'))) { |
|
1127 | + echo 'display: inline-flex;' ?> |
|
1072 | 1128 | flex-flow: row wrap; |
1073 | 1129 | justify-content: flex-start; |
1074 | 1130 | } |
@@ -1118,7 +1174,9 @@ discard block |
||
1118 | 1174 | .minwidth50 { min-width: 50px; } |
1119 | 1175 | .minwidth75 { min-width: 75px; } |
1120 | 1176 | /* rule for not too small screen only */ |
1121 | -@media only screen and (min-width: <?php echo round($nbtopmenuentries * $fontsize * 3.4, 0) + 7; ?>px) |
|
1177 | +@media only screen and (min-width: <?php echo round($nbtopmenuentries * $fontsize * 3.4, 0) + 7; |
|
1178 | +} |
|
1179 | +?>px) |
|
1122 | 1180 | { |
1123 | 1181 | .width20 { width: 20px; } |
1124 | 1182 | .width25 { width: 25px; } |
@@ -1573,7 +1631,10 @@ discard block |
||
1573 | 1631 | div.fiche { |
1574 | 1632 | margin-<?php print $left; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print' ? 6 : (empty($conf->dol_optimize_smallscreen) ? '24' : '6')); ?>px; |
1575 | 1633 | margin-<?php print $right; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print' ? 6 : (empty($conf->dol_optimize_smallscreen) ? '22' : '6')); ?>px; |
1576 | - <?php if (!empty($dol_hide_leftmenu) && !empty($dol_hide_topmenu)) print 'margin-top: 12px;'; ?> |
|
1634 | + <?php if (!empty($dol_hide_leftmenu) && !empty($dol_hide_topmenu)) { |
|
1635 | + print 'margin-top: 12px;'; |
|
1636 | +} |
|
1637 | +?> |
|
1577 | 1638 | margin-bottom: 15px; |
1578 | 1639 | } |
1579 | 1640 | body.onlinepaymentbody div.fiche { /* For online payment page */ |
@@ -1625,7 +1686,10 @@ discard block |
||
1625 | 1686 | div.fiche { |
1626 | 1687 | margin-<?php print $left; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print' ? 6 : ($dol_hide_leftmenu ? '4' : '20')); ?>px; |
1627 | 1688 | margin-<?php print $right; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print' ? 8 : 16); ?>px; |
1628 | - <?php if (!empty($conf->dol_hide_leftmenu) && !empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?> |
|
1689 | + <?php if (!empty($conf->dol_hide_leftmenu) && !empty($conf->dol_hide_topmenu)) { |
|
1690 | + print 'margin-top: 4px;'; |
|
1691 | +} |
|
1692 | +?> |
|
1629 | 1693 | margin-bottom: 15px; |
1630 | 1694 | } |
1631 | 1695 | div.fichecenter { |
@@ -2120,8 +2184,12 @@ discard block |
||
2120 | 2184 | $divnotrequired = array('multicurrency', 'salaries', 'ticket', 'margin', 'opensurvey', 'paybox', 'expensereport', 'incoterm', 'prelevement', 'propal', 'workflow', 'notification', 'supplier_proposal', 'cron', 'product', 'productbatch', 'expedition'); |
2121 | 2185 | foreach ($mainmenuusedarray as $val) |
2122 | 2186 | { |
2123 | - if (empty($val) || in_array($val, $divalreadydefined)) continue; |
|
2124 | - if (in_array($val, $divnotrequired)) continue; |
|
2187 | + if (empty($val) || in_array($val, $divalreadydefined)) { |
|
2188 | + continue; |
|
2189 | + } |
|
2190 | + if (in_array($val, $divnotrequired)) { |
|
2191 | + continue; |
|
2192 | + } |
|
2125 | 2193 | //print "XXX".$val; |
2126 | 2194 | |
2127 | 2195 | // Search img file in module dir |
@@ -6303,9 +6371,13 @@ discard block |
||
6303 | 6371 | include dol_buildpath($path.'/theme/'.$theme.'/progress.inc.php', 0); |
6304 | 6372 | include dol_buildpath($path.'/theme/eldy/timeline.inc.php', 0); // actually md use same style as eldy theme |
6305 | 6373 | |
6306 | -if (!empty($conf->global->THEME_CUSTOM_CSS)) print $conf->global->THEME_CUSTOM_CSS; |
|
6374 | +if (!empty($conf->global->THEME_CUSTOM_CSS)) { |
|
6375 | + print $conf->global->THEME_CUSTOM_CSS; |
|
6376 | +} |
|
6307 | 6377 | |
6308 | -if (is_object($db)) $db->close(); |
|
6378 | +if (is_object($db)) { |
|
6379 | + $db->close(); |
|
6380 | +} |
|
6309 | 6381 | ?> |
6310 | 6382 | |
6311 | 6383 | /* This must be at end */ |
@@ -25,11 +25,13 @@ discard block |
||
25 | 25 | if (session_id() == "") |
26 | 26 | { |
27 | 27 | session_start(); |
28 | - if (ini_get('register_globals')) // To solve bug in using $_SESSION |
|
28 | + if (ini_get('register_globals')) { |
|
29 | + // To solve bug in using $_SESSION |
|
29 | 30 | { |
30 | 31 | foreach ($_SESSION as $key=>$value) |
31 | 32 | { |
32 | 33 | if (isset($GLOBALS[$key])) unset($GLOBALS[$key]); |
34 | + } |
|
33 | 35 | } |
34 | 36 | } |
35 | 37 | } |
@@ -48,9 +50,11 @@ discard block |
||
48 | 50 | ' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token= |
49 | 51 | ' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token= |
50 | 52 | */ |
51 | -if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha')) // We can force sand box with param 'forcesandbox' |
|
53 | +if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha')) { |
|
54 | + // We can force sand box with param 'forcesandbox' |
|
52 | 55 | { |
53 | 56 | $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; |
57 | +} |
|
54 | 58 | $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; |
55 | 59 | } else { |
56 | 60 | $API_Endpoint = "https://api-3t.paypal.com/nvp"; |
@@ -59,13 +63,21 @@ discard block |
||
59 | 63 | |
60 | 64 | // Clean parameters |
61 | 65 | $PAYPAL_API_USER = ""; |
62 | -if (!empty($conf->global->PAYPAL_API_USER)) $PAYPAL_API_USER = $conf->global->PAYPAL_API_USER; |
|
66 | +if (!empty($conf->global->PAYPAL_API_USER)) { |
|
67 | + $PAYPAL_API_USER = $conf->global->PAYPAL_API_USER; |
|
68 | +} |
|
63 | 69 | $PAYPAL_API_PASSWORD = ""; |
64 | -if (!empty($conf->global->PAYPAL_API_PASSWORD)) $PAYPAL_API_PASSWORD = $conf->global->PAYPAL_API_PASSWORD; |
|
70 | +if (!empty($conf->global->PAYPAL_API_PASSWORD)) { |
|
71 | + $PAYPAL_API_PASSWORD = $conf->global->PAYPAL_API_PASSWORD; |
|
72 | +} |
|
65 | 73 | $PAYPAL_API_SIGNATURE = ""; |
66 | -if (!empty($conf->global->PAYPAL_API_SIGNATURE)) $PAYPAL_API_SIGNATURE = $conf->global->PAYPAL_API_SIGNATURE; |
|
74 | +if (!empty($conf->global->PAYPAL_API_SIGNATURE)) { |
|
75 | + $PAYPAL_API_SIGNATURE = $conf->global->PAYPAL_API_SIGNATURE; |
|
76 | +} |
|
67 | 77 | $PAYPAL_API_SANDBOX = ""; |
68 | -if (!empty($conf->global->PAYPAL_API_SANDBOX)) $PAYPAL_API_SANDBOX = $conf->global->PAYPAL_API_SANDBOX; |
|
78 | +if (!empty($conf->global->PAYPAL_API_SANDBOX)) { |
|
79 | + $PAYPAL_API_SANDBOX = $conf->global->PAYPAL_API_SANDBOX; |
|
80 | +} |
|
69 | 81 | |
70 | 82 | // Proxy |
71 | 83 | $PROXY_HOST = $conf->global->MAIN_PROXY_HOST; |
@@ -70,7 +70,9 @@ discard block |
||
70 | 70 | $hookmanager->initHooks(array('resource', 'resource_card', 'globalcard')); |
71 | 71 | $parameters = array('resource_id'=>$id); |
72 | 72 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
73 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
73 | +if ($reshook < 0) { |
|
74 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
75 | +} |
|
74 | 76 | |
75 | 77 | if (empty($reshook)) |
76 | 78 | { |
@@ -107,7 +109,9 @@ discard block |
||
107 | 109 | |
108 | 110 | // Fill array 'array_options' with data from add form |
109 | 111 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
110 | - if ($ret < 0) $error++; |
|
112 | + if ($ret < 0) { |
|
113 | + $error++; |
|
114 | + } |
|
111 | 115 | |
112 | 116 | $result = $object->create($user); |
113 | 117 | if ($result > 0) |
@@ -220,7 +224,9 @@ discard block |
||
220 | 224 | |
221 | 225 | if ($action == 'create' || $action == 'edit') |
222 | 226 | { |
223 | - if (!$user->rights->resource->write) accessforbidden('', 0, 1); |
|
227 | + if (!$user->rights->resource->write) { |
|
228 | + accessforbidden('', 0, 1); |
|
229 | + } |
|
224 | 230 | |
225 | 231 | // Create/Edit object |
226 | 232 | |
@@ -251,7 +257,9 @@ discard block |
||
251 | 257 | // Origin country |
252 | 258 | print '<tr><td>'.$langs->trans("CountryOrigin").'</td><td>'; |
253 | 259 | print $form->select_country($object->country_id, 'country_id'); |
254 | - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
260 | + if ($user->admin) { |
|
261 | + print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
262 | + } |
|
255 | 263 | print '</td></tr>'; |
256 | 264 | |
257 | 265 | // Other attributes |
@@ -44,7 +44,9 @@ discard block |
||
44 | 44 | $confirm = GETPOST('confirm', 'alpha'); |
45 | 45 | |
46 | 46 | // Security check |
47 | -if ($user->socid) $socid = $user->socid; |
|
47 | +if ($user->socid) { |
|
48 | + $socid = $user->socid; |
|
49 | +} |
|
48 | 50 | $result = restrictedArea($user, 'resource', $id, 'resource'); |
49 | 51 | |
50 | 52 | |
@@ -57,8 +59,12 @@ discard block |
||
57 | 59 | $offset = $limit * $page; |
58 | 60 | $pageprev = $page - 1; |
59 | 61 | $pagenext = $page + 1; |
60 | -if (!$sortorder) $sortorder = "ASC"; |
|
61 | -if (!$sortfield) $sortfield = "name"; |
|
62 | +if (!$sortorder) { |
|
63 | + $sortorder = "ASC"; |
|
64 | +} |
|
65 | +if (!$sortfield) { |
|
66 | + $sortfield = "name"; |
|
67 | +} |
|
62 | 68 | |
63 | 69 | |
64 | 70 | $object = new DolResource($db); |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | $confirm = GETPOST('confirm', 'alpha'); |
44 | 44 | |
45 | 45 | // Security check |
46 | -if ($user->socid) $socid = $user->socid; |
|
46 | +if ($user->socid) { |
|
47 | + $socid = $user->socid; |
|
48 | +} |
|
47 | 49 | $result = restrictedArea($user, 'deplacement', $id, ''); |
48 | 50 | |
49 | 51 | |
@@ -56,8 +58,12 @@ discard block |
||
56 | 58 | $offset = $limit * $page; |
57 | 59 | $pageprev = $page - 1; |
58 | 60 | $pagenext = $page + 1; |
59 | -if (!$sortorder) $sortorder = "ASC"; |
|
60 | -if (!$sortfield) $sortfield = "name"; |
|
61 | +if (!$sortorder) { |
|
62 | + $sortorder = "ASC"; |
|
63 | +} |
|
64 | +if (!$sortfield) { |
|
65 | + $sortfield = "name"; |
|
66 | +} |
|
61 | 67 | |
62 | 68 | |
63 | 69 | $object = new Deplacement($db); |
@@ -32,7 +32,9 @@ |
||
32 | 32 | $langs->loadLangs(array('banks', 'categories', 'compta', 'bills')); |
33 | 33 | |
34 | 34 | // Security check |
35 | -if ($user->socid) $socid = $user->socid; |
|
35 | +if ($user->socid) { |
|
36 | + $socid = $user->socid; |
|
37 | +} |
|
36 | 38 | $result = restrictedArea($user, 'banque', '', ''); |
37 | 39 | |
38 | 40 |
@@ -140,19 +140,36 @@ |
||
140 | 140 | return $langs->trans($this->statuts[$status]); |
141 | 141 | } elseif ($mode == 1) |
142 | 142 | { |
143 | - if ($status == 0) return img_picto($langs->trans($this->statuts[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]); // Waiting |
|
144 | - elseif ($status == 2) return img_picto($langs->trans($this->statuts[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); // Credited |
|
145 | - elseif ($status == 3) return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]); // Refused |
|
143 | + if ($status == 0) { |
|
144 | + return img_picto($langs->trans($this->statuts[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]); |
|
145 | + } |
|
146 | + // Waiting |
|
147 | + elseif ($status == 2) { |
|
148 | + return img_picto($langs->trans($this->statuts[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); |
|
149 | + } |
|
150 | + // Credited |
|
151 | + elseif ($status == 3) { |
|
152 | + return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]); |
|
153 | + } |
|
154 | + // Refused |
|
146 | 155 | } elseif ($mode == 2) |
147 | 156 | { |
148 | - if ($status == 0) return img_picto($langs->trans($this->statuts[$status]), 'statut1'); |
|
149 | - elseif ($status == 2) return img_picto($langs->trans($this->statuts[$status]), 'statut6'); |
|
150 | - elseif ($status == 3) return img_picto($langs->trans($this->statuts[$status]), 'statut8'); |
|
157 | + if ($status == 0) { |
|
158 | + return img_picto($langs->trans($this->statuts[$status]), 'statut1'); |
|
159 | + } elseif ($status == 2) { |
|
160 | + return img_picto($langs->trans($this->statuts[$status]), 'statut6'); |
|
161 | + } elseif ($status == 3) { |
|
162 | + return img_picto($langs->trans($this->statuts[$status]), 'statut8'); |
|
163 | + } |
|
151 | 164 | } elseif ($mode == 3) |
152 | 165 | { |
153 | - if ($status == 0) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut1'); |
|
154 | - elseif ($status == 2) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6'); |
|
155 | - elseif ($status == 3) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8'); |
|
166 | + if ($status == 0) { |
|
167 | + return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut1'); |
|
168 | + } elseif ($status == 2) { |
|
169 | + return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6'); |
|
170 | + } elseif ($status == 3) { |
|
171 | + return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8'); |
|
172 | + } |
|
156 | 173 | } |
157 | 174 | } |
158 | 175 |
@@ -54,7 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | // Security check |
56 | 56 | $socid = GETPOST('socid', 'int'); |
57 | -if ($user->socid) $socid = $user->socid; |
|
57 | +if ($user->socid) { |
|
58 | + $socid = $user->socid; |
|
59 | +} |
|
58 | 60 | $result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); |
59 | 61 | |
60 | 62 | $object = new ChargeSociales($db); |
@@ -98,17 +100,19 @@ discard block |
||
98 | 100 | { |
99 | 101 | $object->fetch($id); |
100 | 102 | $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); |
101 | - if ($result < 0) |
|
102 | - setEventMessages($object->error, $object->errors, 'errors'); |
|
103 | -} |
|
103 | + if ($result < 0) { |
|
104 | + setEventMessages($object->error, $object->errors, 'errors'); |
|
105 | + } |
|
106 | + } |
|
104 | 107 | |
105 | 108 | // payment mode |
106 | 109 | if ($action == 'setmode' && $user->rights->tax->charges->creer) { |
107 | 110 | $object->fetch($id); |
108 | 111 | $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); |
109 | - if ($result < 0) |
|
110 | - setEventMessages($object->error, $object->errors, 'errors'); |
|
111 | -} |
|
112 | + if ($result < 0) { |
|
113 | + setEventMessages($object->error, $object->errors, 'errors'); |
|
114 | + } |
|
115 | + } |
|
112 | 116 | |
113 | 117 | // bank account |
114 | 118 | if ($action == 'setbankaccount' && $user->rights->tax->charges->creer) { |
@@ -242,8 +246,12 @@ discard block |
||
242 | 246 | } else { |
243 | 247 | $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); |
244 | 248 | $newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int')); |
245 | - if ($newdateperiod) $object->periode = $newdateperiod; |
|
246 | - if ($newdateech) $object->date_ech = $newdateech; |
|
249 | + if ($newdateperiod) { |
|
250 | + $object->periode = $newdateperiod; |
|
251 | + } |
|
252 | + if ($newdateech) { |
|
253 | + $object->date_ech = $newdateech; |
|
254 | + } |
|
247 | 255 | } |
248 | 256 | |
249 | 257 | if ($object->check()) |
@@ -534,8 +542,9 @@ discard block |
||
534 | 542 | print '<table class="nobordernopadding" width="100%"><tr><td>'; |
535 | 543 | print $langs->trans('PaymentMode'); |
536 | 544 | print '</td>'; |
537 | - if ($action != 'editmode') |
|
538 | - print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
545 | + if ($action != 'editmode') { |
|
546 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
547 | + } |
|
539 | 548 | print '</tr></table>'; |
540 | 549 | print '</td><td>'; |
541 | 550 | if ($action == 'editmode') { |
@@ -552,8 +561,9 @@ discard block |
||
552 | 561 | print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; |
553 | 562 | print $langs->trans('BankAccount'); |
554 | 563 | print '<td>'; |
555 | - if ($action != 'editbankaccount' && $user->rights->tax->charges->creer) |
|
556 | - print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; |
|
564 | + if ($action != 'editbankaccount' && $user->rights->tax->charges->creer) { |
|
565 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; |
|
566 | + } |
|
557 | 567 | print '</tr></table>'; |
558 | 568 | print '</td><td>'; |
559 | 569 | if ($action == 'editbankaccount') { |
@@ -641,8 +651,9 @@ discard block |
||
641 | 651 | } |
642 | 652 | |
643 | 653 | print '<td class="right">'; |
644 | - if ($bankaccountstatic->id) |
|
645 | - print $bankaccountstatic->getNomUrl(1, 'transactions'); |
|
654 | + if ($bankaccountstatic->id) { |
|
655 | + print $bankaccountstatic->getNomUrl(1, 'transactions'); |
|
656 | + } |
|
646 | 657 | print '</td>'; |
647 | 658 | } |
648 | 659 | print '<td class="right">'.price($objp->amount)."</td>\n"; |
@@ -690,7 +701,9 @@ discard block |
||
690 | 701 | print '</div>'; |
691 | 702 | } |
692 | 703 | |
693 | - if ($action == 'edit') print "</form>\n"; |
|
704 | + if ($action == 'edit') { |
|
705 | + print "</form>\n"; |
|
706 | + } |
|
694 | 707 | |
695 | 708 | |
696 | 709 |