@@ -82,7 +82,9 @@ |
||
82 | 82 | } |
83 | 83 | } |
84 | 84 | } |
85 | - if ($printerfound == 0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); |
|
85 | + if ($printerfound == 0) { |
|
86 | + setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); |
|
87 | + } |
|
86 | 88 | } else { |
87 | 89 | setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); |
88 | 90 | } |
@@ -130,7 +130,9 @@ |
||
130 | 130 | $line++; |
131 | 131 | } |
132 | 132 | |
133 | - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center opacitymedium"', 'text'=>$langs->trans("None")); |
|
133 | + if ($num == 0) { |
|
134 | + $this->info_box_contents[$line][0] = array('td' => 'class="center opacitymedium"', 'text'=>$langs->trans("None")); |
|
135 | + } |
|
134 | 136 | |
135 | 137 | $this->db->free($result); |
136 | 138 | } else { |
@@ -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("BoxCustomersInvoicesPerMonth", $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 (!$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 (!$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 | { |
@@ -119,7 +126,9 @@ discard block |
||
119 | 126 | } |
120 | 127 | if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; } |
121 | 128 | $nowarray = dol_getdate(dol_now(), true); |
122 | - if (empty($endyear)) $endyear = $nowarray['year']; |
|
129 | + if (empty($endyear)) { |
|
130 | + $endyear = $nowarray['year']; |
|
131 | + } |
|
123 | 132 | $startyear = $endyear - 1; |
124 | 133 | $mode = 'customer'; |
125 | 134 | $WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320'; |
@@ -135,7 +144,9 @@ discard block |
||
135 | 144 | $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; |
136 | 145 | // default value for customer mode |
137 | 146 | $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; |
138 | - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; |
|
147 | + if ($mode == 'supplier') { |
|
148 | + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; |
|
149 | + } |
|
139 | 150 | |
140 | 151 | $px1 = new DolGraph(); |
141 | 152 | $mesg = $px1->isGraphKo(); |
@@ -180,7 +191,9 @@ discard block |
||
180 | 191 | $filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png"; |
181 | 192 | // default value for customer mode |
182 | 193 | $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; |
183 | - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; |
|
194 | + if ($mode == 'supplier') { |
|
195 | + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; |
|
196 | + } |
|
184 | 197 | |
185 | 198 | $px2 = new DolGraph(); |
186 | 199 | $mesg = $px2->isGraphKo(); |
@@ -251,13 +264,17 @@ discard block |
||
251 | 264 | $stringtoshow .= '<div class="fichecenter">'; |
252 | 265 | $stringtoshow .= '<div class="fichehalfleft">'; |
253 | 266 | } |
254 | - if ($shownb) $stringtoshow .= $px1->show(); |
|
267 | + if ($shownb) { |
|
268 | + $stringtoshow .= $px1->show(); |
|
269 | + } |
|
255 | 270 | if ($shownb && $showtot) |
256 | 271 | { |
257 | 272 | $stringtoshow .= '</div>'; |
258 | 273 | $stringtoshow .= '<div class="fichehalfright">'; |
259 | 274 | } |
260 | - if ($showtot) $stringtoshow .= $px2->show(); |
|
275 | + if ($showtot) { |
|
276 | + $stringtoshow .= $px2->show(); |
|
277 | + } |
|
261 | 278 | if ($shownb && $showtot) |
262 | 279 | { |
263 | 280 | $stringtoshow .= '</div>'; |
@@ -74,7 +74,9 @@ discard block |
||
74 | 74 | include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; |
75 | 75 | |
76 | 76 | $startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1; |
77 | - if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1; |
|
77 | + if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) { |
|
78 | + $startmonth = 1; |
|
79 | + } |
|
78 | 80 | |
79 | 81 | $text = $langs->trans("BoxSuppliersOrdersPerMonth", $max); |
80 | 82 | $this->info_box_head = array( |
@@ -91,8 +93,13 @@ discard block |
||
91 | 93 | $dir = ''; // We don't need a path because image file will not be saved into disk |
92 | 94 | $prefix = ''; |
93 | 95 | $socid = 0; |
94 | - if ($user->socid) $socid = $user->socid; |
|
95 | - if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user |
|
96 | + if ($user->socid) { |
|
97 | + $socid = $user->socid; |
|
98 | + } |
|
99 | + if (!$user->rights->societe->client->voir || $socid) { |
|
100 | + $prefix .= 'private-'.$user->id.'-'; |
|
101 | + } |
|
102 | + // If user has no permission to see all, output dir is specific to user |
|
96 | 103 | |
97 | 104 | if ($user->rights->fournisseur->commande->lire) |
98 | 105 | { |
@@ -118,7 +125,9 @@ discard block |
||
118 | 125 | } |
119 | 126 | if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; } |
120 | 127 | $nowarray = dol_getdate(dol_now(), true); |
121 | - if (empty($endyear)) $endyear = $nowarray['year']; |
|
128 | + if (empty($endyear)) { |
|
129 | + $endyear = $nowarray['year']; |
|
130 | + } |
|
122 | 131 | $startyear = $endyear - 1; |
123 | 132 | $mode = 'supplier'; |
124 | 133 | $WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320'; |
@@ -134,7 +143,9 @@ discard block |
||
134 | 143 | $filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png"; |
135 | 144 | // default value for customer mode |
136 | 145 | $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; |
137 | - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png'; |
|
146 | + if ($mode == 'supplier') { |
|
147 | + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png'; |
|
148 | + } |
|
138 | 149 | |
139 | 150 | $px1 = new DolGraph(); |
140 | 151 | $mesg = $px1->isGraphKo(); |
@@ -177,7 +188,9 @@ discard block |
||
177 | 188 | $filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png"; |
178 | 189 | // default value for customer mode |
179 | 190 | $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; |
180 | - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png'; |
|
191 | + if ($mode == 'supplier') { |
|
192 | + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png'; |
|
193 | + } |
|
181 | 194 | |
182 | 195 | $px2 = new DolGraph(); |
183 | 196 | $mesg = $px2->isGraphKo(); |
@@ -246,13 +259,17 @@ discard block |
||
246 | 259 | $stringtoshow .= '<div class="fichecenter">'; |
247 | 260 | $stringtoshow .= '<div class="fichehalfleft">'; |
248 | 261 | } |
249 | - if ($shownb) $stringtoshow .= $px1->show(); |
|
262 | + if ($shownb) { |
|
263 | + $stringtoshow .= $px1->show(); |
|
264 | + } |
|
250 | 265 | if ($shownb && $showtot) |
251 | 266 | { |
252 | 267 | $stringtoshow .= '</div>'; |
253 | 268 | $stringtoshow .= '<div class="fichehalfright">'; |
254 | 269 | } |
255 | - if ($showtot) $stringtoshow .= $px2->show(); |
|
270 | + if ($showtot) { |
|
271 | + $stringtoshow .= $px2->show(); |
|
272 | + } |
|
256 | 273 | if ($shownb && $showtot) |
257 | 274 | { |
258 | 275 | $stringtoshow .= '</div>'; |
@@ -62,8 +62,14 @@ discard block |
||
62 | 62 | $this->db = $db; |
63 | 63 | |
64 | 64 | // disable box for such cases |
65 | - if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled = 0; // disabled by this option |
|
66 | - if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) $this->enabled = 0; // not enabled by default. Very slow on large database |
|
65 | + if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
|
66 | + $this->enabled = 0; |
|
67 | + } |
|
68 | + // disabled by this option |
|
69 | + if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) { |
|
70 | + $this->enabled = 0; |
|
71 | + } |
|
72 | + // not enabled by default. Very slow on large database |
|
67 | 73 | |
68 | 74 | $this->hidden = !($user->rights->societe->lire); |
69 | 75 | } |
@@ -142,10 +148,12 @@ discard block |
||
142 | 148 | $line++; |
143 | 149 | } |
144 | 150 | |
145 | - if ($num == 0) $this->info_box_contents[$line][0] = array( |
|
151 | + if ($num == 0) { |
|
152 | + $this->info_box_contents[$line][0] = array( |
|
146 | 153 | 'td' => 'class="center opacitymedium"', |
147 | 154 | 'text'=>$langs->trans("NoRecordedCustomers") |
148 | 155 | ); |
156 | + } |
|
149 | 157 | |
150 | 158 | $this->db->free($result); |
151 | 159 | } else { |
@@ -75,7 +75,9 @@ discard block |
||
75 | 75 | //$propalstatic=new Propal($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 | $langs->load("propal"); |
81 | 83 | |
@@ -94,8 +96,13 @@ discard block |
||
94 | 96 | $dir = ''; // We don't need a path because image file will not be saved into disk |
95 | 97 | $prefix = ''; |
96 | 98 | $socid = 0; |
97 | - if ($user->socid) $socid = $user->socid; |
|
98 | - if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user |
|
99 | + if ($user->socid) { |
|
100 | + $socid = $user->socid; |
|
101 | + } |
|
102 | + if (!$user->rights->societe->client->voir || $socid) { |
|
103 | + $prefix .= 'private-'.$user->id.'-'; |
|
104 | + } |
|
105 | + // If user has no permission to see all, output dir is specific to user |
|
99 | 106 | |
100 | 107 | if ($user->rights->propale->lire) |
101 | 108 | { |
@@ -119,7 +126,9 @@ discard block |
||
119 | 126 | } |
120 | 127 | if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; } |
121 | 128 | $nowarray = dol_getdate(dol_now(), true); |
122 | - if (empty($endyear)) $endyear = $nowarray['year']; |
|
129 | + if (empty($endyear)) { |
|
130 | + $endyear = $nowarray['year']; |
|
131 | + } |
|
123 | 132 | $startyear = $endyear - 1; |
124 | 133 | $WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320'; |
125 | 134 | $HEIGHT = '192'; |
@@ -176,8 +185,12 @@ discard block |
||
176 | 185 | //$datatype2 = array('lines','bars'); |
177 | 186 | |
178 | 187 | $filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png"; |
179 | - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png'; |
|
180 | - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png'; |
|
188 | + if ($mode == 'customer') { |
|
189 | + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png'; |
|
190 | + } |
|
191 | + if ($mode == 'supplier') { |
|
192 | + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png'; |
|
193 | + } |
|
181 | 194 | |
182 | 195 | $px2 = new DolGraph(); |
183 | 196 | $mesg = $px2->isGraphKo(); |
@@ -247,13 +260,17 @@ discard block |
||
247 | 260 | $stringtoshow .= '<div class="fichecenter">'; |
248 | 261 | $stringtoshow .= '<div class="fichehalfleft">'; |
249 | 262 | } |
250 | - if ($shownb) $stringtoshow .= $px1->show(); |
|
263 | + if ($shownb) { |
|
264 | + $stringtoshow .= $px1->show(); |
|
265 | + } |
|
251 | 266 | if ($shownb && $showtot) |
252 | 267 | { |
253 | 268 | $stringtoshow .= '</div>'; |
254 | 269 | $stringtoshow .= '<div class="fichehalfright">'; |
255 | 270 | } |
256 | - if ($showtot) $stringtoshow .= $px2->show(); |
|
271 | + if ($showtot) { |
|
272 | + $stringtoshow .= $px2->show(); |
|
273 | + } |
|
257 | 274 | if ($shownb && $showtot) |
258 | 275 | { |
259 | 276 | $stringtoshow .= '</div>'; |
@@ -23,14 +23,30 @@ |
||
23 | 23 | * \brief Wrapper that receive any search. Depending on input field, make a redirect to correct URL. |
24 | 24 | */ |
25 | 25 | |
26 | -if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); |
|
27 | -if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); |
|
28 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
29 | -if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); |
|
30 | -if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); |
|
31 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); |
|
32 | -if (!defined('NOLOGIN')) define('NOLOGIN', 1); |
|
33 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1); |
|
26 | +if (!defined('NOREQUIREUSER')) { |
|
27 | + define('NOREQUIREUSER', '1'); |
|
28 | +} |
|
29 | +if (!defined('NOREQUIREDB')) { |
|
30 | + define('NOREQUIREDB', '1'); |
|
31 | +} |
|
32 | +if (!defined('NOREQUIRESOC')) { |
|
33 | + define('NOREQUIRESOC', '1'); |
|
34 | +} |
|
35 | +if (!defined('NOREQUIRETRAN')) { |
|
36 | + define('NOREQUIRETRAN', '1'); |
|
37 | +} |
|
38 | +if (!defined('NOCSRFCHECK')) { |
|
39 | + define('NOCSRFCHECK', 1); |
|
40 | +} |
|
41 | +if (!defined('NOTOKENRENEWAL')) { |
|
42 | + define('NOTOKENRENEWAL', 1); |
|
43 | +} |
|
44 | +if (!defined('NOLOGIN')) { |
|
45 | + define('NOLOGIN', 1); |
|
46 | +} |
|
47 | +if (!defined('NOREQUIREMENU')) { |
|
48 | + define('NOREQUIREMENU', 1); |
|
49 | +} |
|
34 | 50 | |
35 | 51 | require_once '../main.inc.php'; |
36 | 52 |
@@ -14,13 +14,19 @@ |
||
14 | 14 | while ($i < $totalarray['nbfield']) |
15 | 15 | { |
16 | 16 | $i++; |
17 | - if (!empty($totalarray['pos'][$i])) print '<td class="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>'; |
|
18 | - else { |
|
17 | + if (!empty($totalarray['pos'][$i])) { |
|
18 | + print '<td class="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>'; |
|
19 | + } else { |
|
19 | 20 | if ($i == 1) |
20 | 21 | { |
21 | - if ($num < $limit) print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
22 | - else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>'; |
|
23 | - } else print '<td></td>'; |
|
22 | + if ($num < $limit) { |
|
23 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
24 | + } else { |
|
25 | + print '<td class="left">'.$langs->trans("Totalforthispage").'</td>'; |
|
26 | + } |
|
27 | + } else { |
|
28 | + print '<td></td>'; |
|
29 | + } |
|
24 | 30 | } |
25 | 31 | } |
26 | 32 | print '</tr>'; |
@@ -51,8 +51,9 @@ |
||
51 | 51 | print '</div>'; |
52 | 52 | } else { |
53 | 53 | $class = ''; |
54 | - if ($linked_resource['rowid'] == GETPOST('lineid')) |
|
55 | - $class = 'highlight'; |
|
54 | + if ($linked_resource['rowid'] == GETPOST('lineid')) { |
|
55 | + $class = 'highlight'; |
|
56 | + } |
|
56 | 57 | |
57 | 58 | print '<div class="tagtr oddeven'.($class ? ' '.$class : '').'">'; |
58 | 59 |