@@ -2637,7 +2637,9 @@ discard block |
||
| 2637 | 2637 | $sql.= ' WHERE cd.fk_contrat = c.rowid'; |
| 2638 | 2638 | $sql.= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; |
| 2639 | 2639 | $sql.= " AND cd.statut = 4"; |
| 2640 | - if ($thirdparty_id > 0) $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); |
|
| 2640 | + if ($thirdparty_id > 0) { |
|
| 2641 | + $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); |
|
| 2642 | + } |
|
| 2641 | 2643 | //print $sql; |
| 2642 | 2644 | |
| 2643 | 2645 | $resql = $this->db->query($sql); |
@@ -2682,7 +2684,10 @@ discard block |
||
| 2682 | 2684 | //dol_sort_array($contract->linkedObjects['facture'], 'date'); |
| 2683 | 2685 | $someinvoicenotpaid=0; |
| 2684 | 2686 | foreach ($object->linkedObjects['facture'] as $idinvoice => $invoice) { |
| 2685 | - if ($invoice->statut == Facture::STATUS_DRAFT) continue; // Draft invoice are not invoice not paid |
|
| 2687 | + if ($invoice->statut == Facture::STATUS_DRAFT) { |
|
| 2688 | + continue; |
|
| 2689 | + } |
|
| 2690 | + // Draft invoice are not invoice not paid |
|
| 2686 | 2691 | |
| 2687 | 2692 | if (empty($invoice->paye)) { |
| 2688 | 2693 | $someinvoicenotpaid++; |
@@ -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 = ""; |