@@ -53,11 +53,17 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // Security check (enable the most restrictive one) |
56 | -if ($user->socid > 0) accessforbidden(); |
|
56 | +if ($user->socid > 0) { |
|
57 | + accessforbidden(); |
|
58 | +} |
|
57 | 59 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
58 | 60 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
59 | -if (!isModEnabled('asset')) accessforbidden(); |
|
60 | -if (!empty($object->not_depreciated)) accessforbidden(); |
|
61 | +if (!isModEnabled('asset')) { |
|
62 | + accessforbidden(); |
|
63 | +} |
|
64 | +if (!empty($object->not_depreciated)) { |
|
65 | + accessforbidden(); |
|
66 | +} |
|
61 | 67 | |
62 | 68 | $object->asset_depreciation_options = &$assetdepreciationoptions; |
63 | 69 | $result = $assetdepreciationoptions->fetchDeprecationOptions($object->id); |
@@ -76,12 +76,20 @@ |
||
76 | 76 | $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]; |
77 | 77 | |
78 | 78 | // Security check (enable the most restrictive one) |
79 | -if ($user->socid > 0) accessforbidden(); |
|
80 | -if ($user->socid > 0) $socid = $user->socid; |
|
79 | +if ($user->socid > 0) { |
|
80 | + accessforbidden(); |
|
81 | +} |
|
82 | +if ($user->socid > 0) { |
|
83 | + $socid = $user->socid; |
|
84 | +} |
|
81 | 85 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
82 | 86 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
83 | -if (!isModEnabled('asset')) accessforbidden(); |
|
84 | -if (!$permissiontoread) accessforbidden(); |
|
87 | +if (!isModEnabled('asset')) { |
|
88 | + accessforbidden(); |
|
89 | +} |
|
90 | +if (!$permissiontoread) { |
|
91 | + accessforbidden(); |
|
92 | +} |
|
85 | 93 | |
86 | 94 | |
87 | 95 | /* |
@@ -76,12 +76,20 @@ |
||
76 | 76 | $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]; |
77 | 77 | |
78 | 78 | // Security check (enable the most restrictive one) |
79 | -if ($user->socid > 0) accessforbidden(); |
|
80 | -if ($user->socid > 0) $socid = $user->socid; |
|
79 | +if ($user->socid > 0) { |
|
80 | + accessforbidden(); |
|
81 | +} |
|
82 | +if ($user->socid > 0) { |
|
83 | + $socid = $user->socid; |
|
84 | +} |
|
81 | 85 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
82 | 86 | restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
83 | -if (!isModEnabled('asset')) accessforbidden(); |
|
84 | -if (!$permissiontoread) accessforbidden(); |
|
87 | +if (!isModEnabled('asset')) { |
|
88 | + accessforbidden(); |
|
89 | +} |
|
90 | +if (!$permissiontoread) { |
|
91 | + accessforbidden(); |
|
92 | +} |
|
85 | 93 | |
86 | 94 | |
87 | 95 | /* |
@@ -140,8 +140,12 @@ discard block |
||
140 | 140 | } |
141 | 141 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
142 | 142 | restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
143 | -if (!isModEnabled('asset')) accessforbidden(); |
|
144 | -if (!$permissiontoread) accessforbidden(); |
|
143 | +if (!isModEnabled('asset')) { |
|
144 | + accessforbidden(); |
|
145 | +} |
|
146 | +if (!$permissiontoread) { |
|
147 | + accessforbidden(); |
|
148 | +} |
|
145 | 149 | |
146 | 150 | /* |
147 | 151 | * Actions |
@@ -169,7 +173,9 @@ discard block |
||
169 | 173 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
170 | 174 | foreach ($object->fields as $key => $val) { |
171 | 175 | $search[$key] = ''; |
172 | - if ($key == 'fk_pays') $search[$key] = $mysoc->country_id; |
|
176 | + if ($key == 'fk_pays') { |
|
177 | + $search[$key] = $mysoc->country_id; |
|
178 | + } |
|
173 | 179 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
174 | 180 | $search[$key.'_dtstart'] = ''; |
175 | 181 | $search[$key.'_dtend'] = ''; |
@@ -130,12 +130,20 @@ |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | // Security check (enable the most restrictive one) |
133 | -if ($user->socid > 0) accessforbidden(); |
|
134 | -$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
|
133 | +if ($user->socid > 0) { |
|
134 | + accessforbidden(); |
|
135 | +} |
|
136 | +$socid = 0; if ($user->socid > 0) { |
|
137 | + $socid = $user->socid; |
|
138 | +} |
|
135 | 139 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
136 | 140 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
137 | -if (!isModEnabled('asset')) accessforbidden(); |
|
138 | -if (!$permissiontoread) accessforbidden(); |
|
141 | +if (!isModEnabled('asset')) { |
|
142 | + accessforbidden(); |
|
143 | +} |
|
144 | +if (!$permissiontoread) { |
|
145 | + accessforbidden(); |
|
146 | +} |
|
139 | 147 | |
140 | 148 | |
141 | 149 |
@@ -75,10 +75,14 @@ |
||
75 | 75 | $permissiontoadd = $user->rights->asset->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php |
76 | 76 | |
77 | 77 | // Security check (enable the most restrictive one) |
78 | -if ($user->socid > 0) accessforbidden(); |
|
78 | +if ($user->socid > 0) { |
|
79 | + accessforbidden(); |
|
80 | +} |
|
79 | 81 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
80 | 82 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
81 | -if (!isModEnabled('asset')) accessforbidden(); |
|
83 | +if (!isModEnabled('asset')) { |
|
84 | + accessforbidden(); |
|
85 | +} |
|
82 | 86 | |
83 | 87 | |
84 | 88 | /* |
@@ -100,7 +100,9 @@ |
||
100 | 100 | * View |
101 | 101 | */ |
102 | 102 | |
103 | -if (isModEnabled('project')) $formproject = new FormProjets($db); |
|
103 | +if (isModEnabled('project')) { |
|
104 | + $formproject = new FormProjets($db); |
|
105 | +} |
|
104 | 106 | |
105 | 107 | $title = $langs->trans('Salary')." - ".$langs->trans('Info'); |
106 | 108 | $help_url = ""; |
@@ -132,7 +132,9 @@ |
||
132 | 132 | */ |
133 | 133 | |
134 | 134 | $form = new Form($db); |
135 | -if (isModEnabled('project')) $formproject = new FormProjets($db); |
|
135 | +if (isModEnabled('project')) { |
|
136 | + $formproject = new FormProjets($db); |
|
137 | +} |
|
136 | 138 | |
137 | 139 | $title = $langs->trans('Salary')." - ".$langs->trans('Documents'); |
138 | 140 | $help_url = ""; |
@@ -48,8 +48,12 @@ discard block |
||
48 | 48 | $offset = $limit * $page; |
49 | 49 | $pageprev = $page - 1; |
50 | 50 | $pagenext = $page + 1; |
51 | -if (!$sortorder) $sortorder = "ASC"; |
|
52 | -if (!$sortfield) $sortfield = "name"; |
|
51 | +if (!$sortorder) { |
|
52 | + $sortorder = "ASC"; |
|
53 | +} |
|
54 | +if (!$sortfield) { |
|
55 | + $sortfield = "name"; |
|
56 | +} |
|
53 | 57 | //if (! $sortfield) $sortfield="position_name"; |
54 | 58 | |
55 | 59 | // Initialize technical objects |
@@ -64,7 +68,9 @@ discard block |
||
64 | 68 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
65 | 69 | |
66 | 70 | //if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity?$object->entity:$conf->entity] . "/stocktransfer/" . dol_sanitizeFileName($object->id); |
67 | -if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref); |
|
71 | +if ($id > 0 || !empty($ref)) { |
|
72 | + $upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref); |
|
73 | +} |
|
68 | 74 | |
69 | 75 | // Security check - Protection if external user |
70 | 76 | //if ($user->socid > 0) accessforbidden(); |