@@ -28,7 +28,9 @@ |
||
28 | 28 | // Load translation files required by the page |
29 | 29 | $langs->loadLangs(array("admin", "user", "install")); |
30 | 30 | |
31 | -if (!$user->admin) accessforbidden(); |
|
31 | +if (!$user->admin) { |
|
32 | + accessforbidden(); |
|
33 | +} |
|
32 | 34 | |
33 | 35 | |
34 | 36 | /* |
@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | $langs->load("admin"); |
28 | 28 | |
29 | -if (!$user->admin) accessforbidden(); |
|
29 | +if (!$user->admin) { |
|
30 | + accessforbidden(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | /* |
@@ -63,10 +65,12 @@ discard block |
||
63 | 65 | // Web user group real (detected by 'id' external command) |
64 | 66 | $arrayout = array(); $varout = 0; |
65 | 67 | exec('id', $arrayout, $varout); |
66 | -if (empty($varout)) // Test command is ok. Work only on Linux OS. |
|
68 | +if (empty($varout)) { |
|
69 | + // Test command is ok. Work only on Linux OS. |
|
67 | 70 | { |
68 | 71 | print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n"; |
69 | 72 | } |
73 | +} |
|
70 | 74 | print '</table>'; |
71 | 75 | print '</div>'; |
72 | 76 |
@@ -44,11 +44,21 @@ |
||
44 | 44 | |
45 | 45 | global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; |
46 | 46 | |
47 | -if (empty($dateSelector)) $dateSelector = 0; |
|
48 | -if (empty($forceall)) $forceall = 0; |
|
49 | -if (empty($senderissupplier)) $senderissupplier = 0; |
|
50 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0; |
|
51 | -if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax = 0; |
|
47 | +if (empty($dateSelector)) { |
|
48 | + $dateSelector = 0; |
|
49 | +} |
|
50 | +if (empty($forceall)) { |
|
51 | + $forceall = 0; |
|
52 | +} |
|
53 | +if (empty($senderissupplier)) { |
|
54 | + $senderissupplier = 0; |
|
55 | +} |
|
56 | +if (empty($inputalsopricewithtax)) { |
|
57 | + $inputalsopricewithtax = 0; |
|
58 | +} |
|
59 | +if (empty($outputalsopricetotalwithtax)) { |
|
60 | + $outputalsopricetotalwithtax = 0; |
|
61 | +} |
|
52 | 62 | |
53 | 63 | // add html5 elements |
54 | 64 | $domData = ' data-element="'.$line->element.'"'; |
@@ -41,7 +41,9 @@ |
||
41 | 41 | |
42 | 42 | global $forceall; |
43 | 43 | |
44 | -if (empty($forceall)) $forceall = 0; |
|
44 | +if (empty($forceall)) { |
|
45 | + $forceall = 0; |
|
46 | +} |
|
45 | 47 | |
46 | 48 | |
47 | 49 | // Define colspan for the button 'Add' |
@@ -53,7 +53,9 @@ |
||
53 | 53 | |
54 | 54 | // Load object |
55 | 55 | 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 |
56 | -if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id; |
|
56 | +if ($id > 0 || !empty($ref)) { |
|
57 | + $upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id; |
|
58 | +} |
|
57 | 59 | |
58 | 60 | $permissionnote = 1; |
59 | 61 | //$permissionnote=$user->rights->bom->creer; // Used by the include of actions_setnotes.inc.php |
@@ -77,9 +77,10 @@ |
||
77 | 77 | $morehtmlref .= '<br>'.$langs->trans('Project').' '; |
78 | 78 | if ($user->rights->facture->creer) |
79 | 79 | { |
80 | - if ($action != 'classify') |
|
81 | - //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
80 | + if ($action != 'classify') { |
|
81 | + //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
82 | 82 | $morehtmlref .= ' : '; |
83 | + } |
|
83 | 84 | if ($action == 'classify') { |
84 | 85 | //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); |
85 | 86 | $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
@@ -8,7 +8,10 @@ |
||
8 | 8 | * Please visit http://opensource.org/licenses/MIT for more information |
9 | 9 | */ |
10 | 10 | |
11 | -if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> |
|
11 | +if (!defined('ISLOADEDBYSTEELSHEET')) { |
|
12 | + die('Must be call by steelsheet'); |
|
13 | +} |
|
14 | +?> |
|
12 | 15 | /* <style type="text/css" > */ |
13 | 16 | |
14 | 17 |
@@ -36,17 +36,25 @@ discard block |
||
36 | 36 | $offset = $limit * $page; |
37 | 37 | $pageprev = $page - 1; |
38 | 38 | $pagenext = $page + 1; |
39 | -if (!$sortfield) $sortfield = "f.rowid"; // Set here default search field |
|
40 | -if (!$sortorder) $sortorder = "ASC"; |
|
39 | +if (!$sortfield) { |
|
40 | + $sortfield = "f.rowid"; |
|
41 | +} |
|
42 | +// Set here default search field |
|
43 | +if (!$sortorder) { |
|
44 | + $sortorder = "ASC"; |
|
45 | +} |
|
41 | 46 | |
42 | 47 | // Load translation files required by the page |
43 | 48 | $langs->loadLangs(array("admin", "compta")); |
44 | 49 | |
45 | 50 | // Security check |
46 | -if ($user->socid > 0) |
|
51 | +if ($user->socid > 0) { |
|
47 | 52 | accessforbidden(); |
48 | -if (!$user->rights->accounting->fiscalyear->write) // If we can read accounting records, we should be able to see fiscal year. |
|
53 | +} |
|
54 | +if (!$user->rights->accounting->fiscalyear->write) { |
|
55 | + // If we can read accounting records, we should be able to see fiscal year. |
|
49 | 56 | accessforbidden(); |
57 | +} |
|
50 | 58 | |
51 | 59 | $error = 0; |
52 | 60 | |
@@ -58,8 +66,9 @@ discard block |
||
58 | 66 | $statut2label = array( |
59 | 67 | '' |
60 | 68 | ); |
61 | -foreach ($tmpstatut2label as $key => $val) |
|
69 | +foreach ($tmpstatut2label as $key => $val) { |
|
62 | 70 | $statut2label[$key] = $langs->trans($val); |
71 | +} |
|
63 | 72 | |
64 | 73 | $errors = array(); |
65 | 74 | |
@@ -95,9 +104,11 @@ discard block |
||
95 | 104 | { |
96 | 105 | $result = $db->query($sql); |
97 | 106 | $nbtotalofrecords = $db->num_rows($result); |
98 | - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 |
|
107 | + if (($page * $limit) > $nbtotalofrecords) { |
|
108 | + // if total resultset is smaller then paging size (filtering), goto and load page 0 |
|
99 | 109 | { |
100 | 110 | $page = 0; |
111 | + } |
|
101 | 112 | $offset = 0; |
102 | 113 | } |
103 | 114 | } |
@@ -65,4 +65,6 @@ |
||
65 | 65 | print '<br><br><span class="opacitymedium">'.$langs->trans("SomeTranslationAreUncomplete").'</span>'; |
66 | 66 | |
67 | 67 | // If there's no error, we display the next step button |
68 | -if ($err == 0) pFooter(0); |
|
68 | +if ($err == 0) { |
|
69 | + pFooter(0); |
|
70 | +} |