@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> |
|
2 | +if (!defined('ISLOADEDBYSTEELSHEET')) { |
|
3 | + die('Must be call by steelsheet'); |
|
4 | +} |
|
5 | +?> |
|
3 | 6 | /* <style type="text/css" > */ |
4 | 7 | |
5 | 8 | :root { |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> |
|
2 | +if (!defined('ISLOADEDBYSTEELSHEET')) { |
|
3 | + die('Must be call by steelsheet'); |
|
4 | +} |
|
5 | +?> |
|
3 | 6 | |
4 | 7 | /* <style type="text/css" > dont remove this line it's an ide hack */ |
5 | 8 | /* |
@@ -27,17 +27,31 @@ |
||
27 | 27 | // Load Dolibarr environment |
28 | 28 | $res = 0; |
29 | 29 | // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) |
30 | -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; |
|
30 | +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { |
|
31 | + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; |
|
32 | +} |
|
31 | 33 | // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME |
32 | 34 | $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; |
33 | 35 | while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } |
34 | -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; |
|
35 | -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; |
|
36 | +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { |
|
37 | + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; |
|
38 | +} |
|
39 | +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { |
|
40 | + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; |
|
41 | +} |
|
36 | 42 | // Try main.inc.php using relative path |
37 | -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; |
|
38 | -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; |
|
39 | -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; |
|
40 | -if (!$res) die("Include of main fails"); |
|
43 | +if (!$res && file_exists("../main.inc.php")) { |
|
44 | + $res = @include "../main.inc.php"; |
|
45 | +} |
|
46 | +if (!$res && file_exists("../../main.inc.php")) { |
|
47 | + $res = @include "../../main.inc.php"; |
|
48 | +} |
|
49 | +if (!$res && file_exists("../../../main.inc.php")) { |
|
50 | + $res = @include "../../../main.inc.php"; |
|
51 | +} |
|
52 | +if (!$res) { |
|
53 | + die("Include of main fails"); |
|
54 | +} |
|
41 | 55 | |
42 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
43 | 57 |
@@ -37,7 +37,9 @@ |
||
37 | 37 | <?php |
38 | 38 | |
39 | 39 | // Other attributes |
40 | -if (!isset($parameters)) $parameters = array(); |
|
40 | +if (!isset($parameters)) { |
|
41 | + $parameters = array(); |
|
42 | +} |
|
41 | 43 | $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
42 | 44 | print $hookmanager->resPrint; |
43 | 45 | if (empty($reshook)) { |
@@ -37,13 +37,17 @@ |
||
37 | 37 | <?php |
38 | 38 | |
39 | 39 | // Other attributes |
40 | -if (!isset($parameters)) $parameters = array(); |
|
40 | +if (!isset($parameters)) { |
|
41 | + $parameters = array(); |
|
42 | +} |
|
41 | 43 | |
42 | 44 | $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
43 | 45 | print $hookmanager->resPrint; |
44 | 46 | if (empty($reshook)) { |
45 | 47 | $params = array(); |
46 | - if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; |
|
48 | + if (isset($tpl_context)) { |
|
49 | + $params['tpl_context'] = $tpl_context; |
|
50 | + } |
|
47 | 51 | $params['cols'] = $parameters['colspanvalue']; |
48 | 52 | print $object->showOptionals($extrafields, 'create', $params); |
49 | 53 | } |
@@ -92,10 +92,18 @@ |
||
92 | 92 | global $langs; |
93 | 93 | $langs->load("admin"); |
94 | 94 | |
95 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
96 | - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
97 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
98 | - if ($this->version) return $this->version; |
|
95 | + if ($this->version == 'development') { |
|
96 | + return $langs->trans("VersionDevelopment"); |
|
97 | + } |
|
98 | + if ($this->version == 'experimental') { |
|
99 | + return $langs->trans("VersionExperimental"); |
|
100 | + } |
|
101 | + if ($this->version == 'dolibarr') { |
|
102 | + return DOL_VERSION; |
|
103 | + } |
|
104 | + if ($this->version) { |
|
105 | + return $this->version; |
|
106 | + } |
|
99 | 107 | return $langs->trans("NotAvailable"); |
100 | 108 | } |
101 | 109 | } |
@@ -107,10 +107,18 @@ |
||
107 | 107 | global $langs; |
108 | 108 | $langs->load("admin"); |
109 | 109 | |
110 | - if ($this->version == 'development') return $langs->trans('VersionDevelopment'); |
|
111 | - if ($this->version == 'experimental') return $langs->trans('VersionExperimental'); |
|
112 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
113 | - if ($this->version) return $this->version; |
|
110 | + if ($this->version == 'development') { |
|
111 | + return $langs->trans('VersionDevelopment'); |
|
112 | + } |
|
113 | + if ($this->version == 'experimental') { |
|
114 | + return $langs->trans('VersionExperimental'); |
|
115 | + } |
|
116 | + if ($this->version == 'dolibarr') { |
|
117 | + return DOL_VERSION; |
|
118 | + } |
|
119 | + if ($this->version) { |
|
120 | + return $this->version; |
|
121 | + } |
|
114 | 122 | return $langs->trans('NotAvailable'); |
115 | 123 | } |
116 | 124 | } |
@@ -30,7 +30,9 @@ |
||
30 | 30 | $langs->loadLangs(array('admin', 'cron')); |
31 | 31 | |
32 | 32 | // Security check |
33 | -if (!$user->rights->cron->read) accessforbidden(); |
|
33 | +if (!$user->rights->cron->read) { |
|
34 | + accessforbidden(); |
|
35 | +} |
|
34 | 36 | |
35 | 37 | $id = GETPOST('id', 'int'); |
36 | 38 |
@@ -39,8 +39,9 @@ discard block |
||
39 | 39 | $l = $langs->defaultlang; |
40 | 40 | } |
41 | 41 | // Access control |
42 | -if (!$user->admin) |
|
42 | +if (!$user->admin) { |
|
43 | 43 | accessforbidden(); |
44 | +} |
|
44 | 45 | |
45 | 46 | /* |
46 | 47 | * Actions |
@@ -62,8 +63,9 @@ discard block |
||
62 | 63 | $result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity); |
63 | 64 | $sub = "DATAPOLICIESREFUSE_".$l; |
64 | 65 | $result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity); |
65 | - if (!$result > 0) |
|
66 | - $error++; |
|
66 | + if (!$result > 0) { |
|
67 | + $error++; |
|
68 | + } |
|
67 | 69 | if (!$error) { |
68 | 70 | $db->commit(); |
69 | 71 | setEventMessage($langs->trans("SetupSaved")); |