@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -188,13 +188,19 @@ |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | // Security check (enable the most restrictive one) |
191 | -if ($user->socid > 0) accessforbidden(); |
|
191 | +if ($user->socid > 0) { |
|
192 | + accessforbidden(); |
|
193 | +} |
|
192 | 194 | //if ($user->socid > 0) accessforbidden(); |
193 | 195 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
194 | 196 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
195 | 197 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
196 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
197 | -if (!$permissiontoread) accessforbidden(); |
|
198 | +if (empty($conf->hrm->enabled)) { |
|
199 | + accessforbidden(); |
|
200 | +} |
|
201 | +if (!$permissiontoread) { |
|
202 | + accessforbidden(); |
|
203 | +} |
|
198 | 204 | |
199 | 205 | |
200 | 206 |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -75,7 +75,9 @@ discard block |
||
75 | 75 | //$facturestatic=new Facture($this->db); |
76 | 76 | |
77 | 77 | $startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1; |
78 | - if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1; |
|
78 | + if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) { |
|
79 | + $startmonth = 1; |
|
80 | + } |
|
79 | 81 | |
80 | 82 | $text = $langs->trans("Turnover", $max); |
81 | 83 | $this->info_box_head = array( |
@@ -92,8 +94,13 @@ discard block |
||
92 | 94 | $dir = ''; // We don't need a path because image file will not be saved into disk |
93 | 95 | $prefix = ''; |
94 | 96 | $socid = 0; |
95 | - if ($user->socid) $socid = $user->socid; |
|
96 | - if (empty($user->rights->societe->client->voir) || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user |
|
97 | + if ($user->socid) { |
|
98 | + $socid = $user->socid; |
|
99 | + } |
|
100 | + if (empty($user->rights->societe->client->voir) || $socid) { |
|
101 | + $prefix .= 'private-'.$user->id.'-'; |
|
102 | + } |
|
103 | + // If user has no permission to see all, output dir is specific to user |
|
97 | 104 | |
98 | 105 | if ($user->rights->facture->lire) { |
99 | 106 | $mesg = ''; |
@@ -114,7 +121,9 @@ discard block |
||
114 | 121 | } |
115 | 122 | if (empty($showtot)) { $showtot = 1; } |
116 | 123 | $nowarray = dol_getdate(dol_now(), true); |
117 | - if (empty($endyear)) $endyear = $nowarray['year']; |
|
124 | + if (empty($endyear)) { |
|
125 | + $endyear = $nowarray['year']; |
|
126 | + } |
|
118 | 127 | $numberyears = (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH); |
119 | 128 | $startyear = $endyear - $numberyears; |
120 | 129 |