@@ -22,11 +22,11 @@ |
||
22 | 22 | |
23 | 23 | use DoliDB; |
24 | 24 | |
25 | - /** |
|
26 | - * \file htdocs/webportal/class/controller.class.php |
|
27 | - * \ingroup webportal |
|
28 | - * \brief File of controller class for WebPortal |
|
29 | - */ |
|
25 | + /** |
|
26 | + * \file htdocs/webportal/class/controller.class.php |
|
27 | + * \ingroup webportal |
|
28 | + * \brief File of controller class for WebPortal |
|
29 | + */ |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Class to manage pages |
@@ -124,8 +124,8 @@ |
||
124 | 124 | */ |
125 | 125 | public $newid; // offline |
126 | 126 | /** |
127 | - * @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
|
128 | - */ |
|
127 | + * @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
|
128 | + */ |
|
129 | 129 | public $fields = array( |
130 | 130 | 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), |
131 | 131 | 'pageurl' => array('type' => 'varchar(16)', 'label' => 'WEBSITE_PAGENAME', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'comment' => 'Ref/alias of page'), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * @var int ID |
66 | 66 | */ |
67 | - public $fk_website; // If translation of another page |
|
67 | + public $fk_website; // If translation of another page |
|
68 | 68 | public $fk_page; |
69 | 69 | public $pageurl; |
70 | 70 | public $aliasalt; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | /** |
123 | 123 | * @var int Another ID that is the $id but with an offset so that ID of pages of the website start at 1 |
124 | 124 | */ |
125 | - public $newid; // offline |
|
125 | + public $newid; // offline |
|
126 | 126 | /** |
127 | 127 | * @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
128 | 128 | */ |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'index' => 1, 'position' => 1000, 'notnull' => -1), |
154 | 154 | 'object_type' => array('type' => 'varchar(255)', 'label' => 'ObjectType', 'enabled' => 1, 'visible' => 0, 'position' => 46, 'searchall' => 0, 'help' => ''), |
155 | 155 | 'fk_object' => array('type' => 'varchar(255)', 'label' => 'ObjectId', 'enabled' => 1, 'visible' => 0, 'position' => 47, 'searchall' => 0, 'help' => '') |
156 | - ); // online |
|
156 | + ); // online |
|
157 | 157 | |
158 | 158 | |
159 | 159 | /** |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $sql .= " t.fk_object"; |
244 | 244 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
245 | 245 | if (!empty($websiteid)) { |
246 | - $sql .= ' WHERE t.fk_website = ' . ((int)$websiteid); |
|
246 | + $sql .= ' WHERE t.fk_website = ' . ((int) $websiteid); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | // Deprecated. If we receive an array, we use it. Prefer using the USF syntax. |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | if (count($filter) > 0) { |
254 | 254 | foreach ($filter as $key => $value) { |
255 | 255 | if ($key == 't.rowid' || $key == 'rowid' || $key == 't.fk_website' || $key == 'fk_website' || $key == 'status' || $key == 't.status') { |
256 | - $sqlwhere[] = $key . " = " . ((int)$value); |
|
256 | + $sqlwhere[] = $key . " = " . ((int) $value); |
|
257 | 257 | } elseif ($key == 'type_container' || $key == 't.type_container') { |
258 | 258 | $sqlwhere[] = $key . " = '" . $this->db->escape($value) . "'"; |
259 | 259 | } elseif ($key == 'lang' || $key == 't.lang') { |
@@ -364,14 +364,14 @@ discard block |
||
364 | 364 | |
365 | 365 | $sql = 'SELECT COUNT(t.rowid) as nb'; |
366 | 366 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
367 | - $sql .= ' WHERE t.fk_website = ' . ((int)$websiteid); |
|
367 | + $sql .= ' WHERE t.fk_website = ' . ((int) $websiteid); |
|
368 | 368 | |
369 | 369 | // Manage filter (same than into fetchAll) |
370 | 370 | $sqlwhere = array(); |
371 | 371 | if (count($filter) > 0) { |
372 | 372 | foreach ($filter as $key => $value) { |
373 | 373 | if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { |
374 | - $sqlwhere[] = $key . " = " . ((int)$value); |
|
374 | + $sqlwhere[] = $key . " = " . ((int) $value); |
|
375 | 375 | } elseif ($key == 'type_container') { |
376 | 376 | $sqlwhere[] = $key . " = '" . $this->db->escape($value) . "'"; |
377 | 377 | } elseif ($key == 'lang' || $key == 't.lang') { |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | //$sql .= ' WHERE entity IN ('.getEntity('website').')'; // entity is on website level |
500 | 500 | $sql .= ' WHERE 1 = 1'; |
501 | 501 | if ($id > 0) { |
502 | - $sql .= ' AND t.rowid = ' . ((int)$id); |
|
502 | + $sql .= ' AND t.rowid = ' . ((int) $id); |
|
503 | 503 | } else { |
504 | 504 | if ($id < 0) { |
505 | 505 | $sql .= ' AND t.rowid <> ' . abs($id); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | if (!$error) { |
596 | 596 | foreach ($this->childtablesoncascade as $table) { |
597 | 597 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . $table; |
598 | - $sql .= " WHERE fk_website_page = " . (int)$this->id; |
|
598 | + $sql .= " WHERE fk_website_page = " . (int) $this->id; |
|
599 | 599 | |
600 | 600 | $result = $this->db->query($sql); |
601 | 601 | if (!$result) { |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $sql .= ' t.rowid'; |
404 | 404 | // TODO Get all fields |
405 | 405 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
406 | - $sql .= ' WHERE t.entity = ' . ((int)$conf->entity); |
|
406 | + $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); |
|
407 | 407 | |
408 | 408 | // Manage filter |
409 | 409 | $errormessage = ''; |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; |
612 | 612 | $sql .= ' fk_user_creat, fk_user_modif'; |
613 | 613 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
614 | - $sql .= ' WHERE t.rowid = ' . ((int)$id); |
|
614 | + $sql .= ' WHERE t.rowid = ' . ((int) $id); |
|
615 | 615 | $result = $this->db->query($sql); |
616 | 616 | if ($result) { |
617 | 617 | if ($this->db->num_rows($result)) { |
@@ -300,14 +300,14 @@ |
||
300 | 300 | $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticket_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields |
301 | 301 | $sql .= ' WHERE t.entity IN (' . getEntity('ticket', 1) . ')'; |
302 | 302 | if ($socid > 0) { |
303 | - $sql .= " AND t.fk_soc = " . ((int)$socid); |
|
303 | + $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
304 | 304 | } |
305 | 305 | // Search on sale representative |
306 | 306 | if ($search_sale && $search_sale != '-1') { |
307 | 307 | if ($search_sale == -2) { |
308 | 308 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)"; |
309 | 309 | } elseif ($search_sale > 0) { |
310 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
310 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 | // Add sql filters |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | |
246 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
246 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
247 | 247 | /** |
248 | 248 | * Add line into array ->lines |
249 | 249 | * |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function add_product($idproduct, $qty, $remise_percent = 0) |
258 | 258 | { |
259 | - // phpcs:enable |
|
259 | + // phpcs:enable |
|
260 | 260 | global $conf, $mysoc; |
261 | 261 | |
262 | 262 | if (!$qty) { |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | return -1; |
301 | 301 | } |
302 | 302 | |
303 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
303 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
304 | 304 | /** |
305 | 305 | * Adding line of fixed discount in the proposal in DB |
306 | 306 | * |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function insert_discount($idremise) |
311 | 311 | { |
312 | - // phpcs:enable |
|
312 | + // phpcs:enable |
|
313 | 313 | global $langs; |
314 | 314 | |
315 | 315 | include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; |
@@ -1508,7 +1508,7 @@ discard block |
||
1508 | 1508 | } |
1509 | 1509 | } |
1510 | 1510 | |
1511 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1511 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1512 | 1512 | /** |
1513 | 1513 | * Set delivery date |
1514 | 1514 | * |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | */ |
1520 | 1520 | public function set_date_livraison($user, $delivery_date) |
1521 | 1521 | { |
1522 | - // phpcs:enable |
|
1522 | + // phpcs:enable |
|
1523 | 1523 | return $this->setDeliveryDate($user, $delivery_date); |
1524 | 1524 | } |
1525 | 1525 | |
@@ -1549,7 +1549,7 @@ discard block |
||
1549 | 1549 | return 0; |
1550 | 1550 | } |
1551 | 1551 | |
1552 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1552 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1553 | 1553 | /** |
1554 | 1554 | * Set an overall discount on the proposal |
1555 | 1555 | * |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | } |
1583 | 1583 | */ |
1584 | 1584 | |
1585 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1585 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1586 | 1586 | /** |
1587 | 1587 | * Set an absolute overall discount on the proposal |
1588 | 1588 | * |
@@ -1880,7 +1880,7 @@ discard block |
||
1880 | 1880 | return 1; |
1881 | 1881 | } |
1882 | 1882 | |
1883 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1883 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1884 | 1884 | /** |
1885 | 1885 | * Set draft status |
1886 | 1886 | * |
@@ -1889,7 +1889,7 @@ discard block |
||
1889 | 1889 | */ |
1890 | 1890 | public function setDraft($user) |
1891 | 1891 | { |
1892 | - // phpcs:enable |
|
1892 | + // phpcs:enable |
|
1893 | 1893 | global $conf, $langs; |
1894 | 1894 | |
1895 | 1895 | $error = 0; |
@@ -1931,7 +1931,7 @@ discard block |
||
1931 | 1931 | } |
1932 | 1932 | |
1933 | 1933 | |
1934 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1934 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1935 | 1935 | /** |
1936 | 1936 | * Return list of askprice (eventually filtered on user) into an array |
1937 | 1937 | * |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | */ |
1948 | 1948 | public function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datec', $sortorder = 'DESC') |
1949 | 1949 | { |
1950 | - // phpcs:enable |
|
1950 | + // phpcs:enable |
|
1951 | 1951 | global $user; |
1952 | 1952 | |
1953 | 1953 | $ga = array(); |
@@ -2166,7 +2166,7 @@ discard block |
||
2166 | 2166 | return $this->LibStatut((isset($this->statut) ? $this->statut : $this->status), $mode); |
2167 | 2167 | } |
2168 | 2168 | |
2169 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2169 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2170 | 2170 | /** |
2171 | 2171 | * Return label of a status (draft, validated, ...) |
2172 | 2172 | * |
@@ -2176,7 +2176,7 @@ discard block |
||
2176 | 2176 | */ |
2177 | 2177 | public function LibStatut($status, $mode = 1) |
2178 | 2178 | { |
2179 | - // phpcs:enable |
|
2179 | + // phpcs:enable |
|
2180 | 2180 | |
2181 | 2181 | // Init/load array of translation of status |
2182 | 2182 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -2211,7 +2211,7 @@ discard block |
||
2211 | 2211 | } |
2212 | 2212 | |
2213 | 2213 | |
2214 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2214 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2215 | 2215 | /** |
2216 | 2216 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
2217 | 2217 | * |
@@ -2221,7 +2221,7 @@ discard block |
||
2221 | 2221 | */ |
2222 | 2222 | public function load_board($user, $mode) |
2223 | 2223 | { |
2224 | - // phpcs:enable |
|
2224 | + // phpcs:enable |
|
2225 | 2225 | global $conf, $user, $langs; |
2226 | 2226 | |
2227 | 2227 | $now = dol_now(); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | // Number of supplier proposals open (expired) |
231 | - if (isModEnabled('supplier_proposal') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('supplier_proposal', 'lire')) { |
|
231 | + if (isModEnabled('supplier_proposal') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('supplier_proposal', 'lire')) { |
|
232 | 232 | $langs->load("supplier_proposal"); |
233 | 233 | $board = new SupplierProposal($db); |
234 | 234 | $dashboardlines[$board->element . '_opened'] = $board->load_board($user, "opened"); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | // Number of sales orders |
240 | - if (isModEnabled('order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) { |
|
240 | + if (isModEnabled('order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) { |
|
241 | 241 | $board = new Commande($db); |
242 | 242 | // Number of customer orders to be shipped (validated and in progress) |
243 | 243 | $dashboardlines[$board->element . '_toship'] = $board->load_board($user, 'toship'); |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | // Number of suppliers orders |
253 | - if (isModEnabled('supplier_order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('fournisseur', 'commande', 'lire')) { |
|
253 | + if (isModEnabled('supplier_order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('fournisseur', 'commande', 'lire')) { |
|
254 | 254 | $board = new CommandeFournisseur($db); |
255 | 255 | $dashboardlines[$board->element . '_opened'] = $board->load_board($user, "opened"); |
256 | 256 | $dashboardlines[$board->element . '_awaiting'] = $board->load_board($user, 'awaiting'); |
257 | 257 | } |
258 | 258 | |
259 | 259 | // Number of contract / services enabled (delayed) |
260 | - if (isModEnabled('contract') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) { |
|
260 | + if (isModEnabled('contract') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) { |
|
261 | 261 | $board = new Contrat($db); |
262 | 262 | $dashboardlines[$board->element . '_inactive'] = $board->load_board($user, "inactive"); |
263 | 263 | // Number of active services (expired) |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | // Number of tickets open |
268 | - if (isModEnabled('ticket') && !getDolGlobalString('MAIN_DISABLE_BLOCK_TICKET') && $user->hasRight('ticket', 'read')) { |
|
268 | + if (isModEnabled('ticket') && !getDolGlobalString('MAIN_DISABLE_BLOCK_TICKET') && $user->hasRight('ticket', 'read')) { |
|
269 | 269 | $board = new Ticket($db); |
270 | 270 | $dashboardlines[$board->element . '_opened'] = $board->load_board($user, "opened"); |
271 | 271 | // Number of active services (expired) |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | // Number of transactions to conciliate |
288 | - if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { |
|
288 | + if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { |
|
289 | 289 | $board = new Account($db); |
290 | 290 | $nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate |
291 | 291 | if ($nb > 0) { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | |
297 | 297 | // Number of cheque to send |
298 | - if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { |
|
298 | + if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { |
|
299 | 299 | if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT')) { |
300 | 300 | $board = new RemiseCheque($db); |
301 | 301 | $dashboardlines[$board->element] = $board->load_board($user); |
@@ -311,26 +311,26 @@ discard block |
||
311 | 311 | } |
312 | 312 | |
313 | 313 | // Number of foundation members |
314 | - if (isModEnabled('member') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) { |
|
314 | + if (isModEnabled('member') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) { |
|
315 | 315 | $board = new Adherent($db); |
316 | 316 | $dashboardlines[$board->element . '_shift'] = $board->load_board($user, 'shift'); |
317 | 317 | $dashboardlines[$board->element . '_expired'] = $board->load_board($user, 'expired'); |
318 | 318 | } |
319 | 319 | |
320 | 320 | // Number of expense reports to approve |
321 | - if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'approve')) { |
|
321 | + if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'approve')) { |
|
322 | 322 | $board = new ExpenseReport($db); |
323 | 323 | $dashboardlines[$board->element . '_toapprove'] = $board->load_board($user, 'toapprove'); |
324 | 324 | } |
325 | 325 | |
326 | 326 | // Number of expense reports to pay |
327 | - if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'to_paid')) { |
|
327 | + if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'to_paid')) { |
|
328 | 328 | $board = new ExpenseReport($db); |
329 | 329 | $dashboardlines[$board->element . '_topay'] = $board->load_board($user, 'topay'); |
330 | 330 | } |
331 | 331 | |
332 | 332 | // Number of holidays to approve |
333 | - if (isModEnabled('holiday') && !getDolGlobalString('MAIN_DISABLE_BLOCK_HOLIDAY') && $user->hasRight('holiday', 'approve')) { |
|
333 | + if (isModEnabled('holiday') && !getDolGlobalString('MAIN_DISABLE_BLOCK_HOLIDAY') && $user->hasRight('holiday', 'approve')) { |
|
334 | 334 | $board = new Holiday($db); |
335 | 335 | $dashboardlines[$board->element] = $board->load_board($user); |
336 | 336 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $search_address = GETPOST("search_address", 'alpha'); |
75 | 75 | $search_zip = GETPOST("search_zip", 'alpha'); |
76 | 76 | $search_town = GETPOST("search_town", 'alpha'); |
77 | -$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
77 | +$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
78 | 78 | $search_country = GETPOST("search_country", 'alpha'); |
79 | 79 | $search_phone = GETPOST("search_phone", 'alpha'); |
80 | 80 | $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | $search_filter = GETPOST("search_filter", 'alpha'); |
94 | -$search_status = GETPOST("search_status", 'intcomma'); // status |
|
94 | +$search_status = GETPOST("search_status", 'intcomma'); // status |
|
95 | 95 | $search_datec_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datec_start_month'), GETPOSTINT('search_datec_start_day'), GETPOSTINT('search_datec_start_year')); |
96 | 96 | $search_datec_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datec_end_month'), GETPOSTINT('search_datec_end_day'), GETPOSTINT('search_datec_end_year')); |
97 | 97 | $search_datem_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datem_start_month'), GETPOSTINT('search_datem_start_day'), GETPOSTINT('search_datem_start_year')); |
@@ -205,18 +205,18 @@ discard block |
||
205 | 205 | // If $val['visible']==0, then we never show the field |
206 | 206 | |
207 | 207 | if (!empty($val['visible'])) { |
208 | - $visible = (int)dol_eval($val['visible'], 1); |
|
208 | + $visible = (int) dol_eval($val['visible'], 1); |
|
209 | 209 | $arrayfields[$tableprefix . '.' . $key] = array( |
210 | 210 | 'label' => $val['label'], |
211 | 211 | 'checked' => (($visible < 0) ? 0 : 1), |
212 | - 'enabled' => (abs($visible) != 3 && (int)dol_eval($val['enabled'], 1)), |
|
212 | + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), |
|
213 | 213 | 'position' => $val['position'], |
214 | 214 | 'help' => isset($val['help']) ? $val['help'] : '' |
215 | 215 | ); |
216 | 216 | } |
217 | 217 | } |
218 | 218 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
219 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
219 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
220 | 220 | //var_dump($arrayfields);exit; |
221 | 221 | |
222 | 222 | // Security check |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $sqlfields = $sql; // $sql fields to remove for count total |
445 | 445 | |
446 | 446 | // SQL Alias adherent |
447 | -$sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d"; // maybe better to use ad (adh) instead of d |
|
447 | +$sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d"; // maybe better to use ad (adh) instead of d |
|
448 | 448 | if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
449 | 449 | $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (d.rowid = ef.fk_object)"; |
450 | 450 | } |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_categorie FROM " . MAIN_DB_PREFIX . "categorie_member as ck WHERE d.rowid = ck.fk_member)"; |
468 | 468 | } elseif (intval($searchCategoryContact) > 0) { |
469 | 469 | if ($searchCategoryContactOperator == 0) { |
470 | - $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM " . MAIN_DB_PREFIX . "categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = " . ((int)$searchCategoryContact) . ")"; |
|
470 | + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM " . MAIN_DB_PREFIX . "categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = " . ((int) $searchCategoryContact) . ")"; |
|
471 | 471 | } else { |
472 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryContact); |
|
472 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryContact); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $sql .= natural_search(array_keys($fieldstosearchall), $search_all); |
493 | 493 | } |
494 | 494 | if ($search_type > 0) { |
495 | - $sql .= " AND t.rowid=" . ((int)$search_type); |
|
495 | + $sql .= " AND t.rowid=" . ((int) $search_type); |
|
496 | 496 | } |
497 | 497 | if ($search_filter == 'withoutsubscription') { |
498 | 498 | $sql .= " AND (datefin IS NULL)"; |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | // Output page |
637 | 637 | // -------------------------------------------------------------------- |
638 | 638 | |
639 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
639 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
640 | 640 | |
641 | 641 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
642 | 642 | |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | $param .= '&contextpage=' . urlencode($contextpage); |
657 | 657 | } |
658 | 658 | if ($limit > 0 && $limit != $conf->liste_limit) { |
659 | - $param .= '&limit=' . ((int)$limit); |
|
659 | + $param .= '&limit=' . ((int) $limit); |
|
660 | 660 | } |
661 | 661 | if ($optioncss != '') { |
662 | 662 | $param .= '&optioncss=' . urlencode($optioncss); |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | $param .= "&search_email=" . urlencode($search_email); |
687 | 687 | } |
688 | 688 | if ($search_categ > 0 || $search_categ == -2) { |
689 | - $param .= "&search_categ=" . urlencode((string)($search_categ)); |
|
689 | + $param .= "&search_categ=" . urlencode((string) ($search_categ)); |
|
690 | 690 | } |
691 | 691 | if ($search_company) { |
692 | 692 | $param .= "&search_company=" . urlencode($search_company); |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | } |
833 | 833 | |
834 | 834 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
835 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
835 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
836 | 836 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
837 | 837 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
838 | 838 |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
626 | 626 | print '</div>'; |
627 | 627 | } elseif ($key == 'lang') { |
628 | - $formadmin = new FormAdmin($db); |
|
628 | + $formadmin = new FormAdmin($db); |
|
629 | 629 | print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2); |
630 | 630 | } else { |
631 | 631 | print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | $hidegeneratedfilelistifempty = 0; |
894 | 894 | } |
895 | 895 | |
896 | - $formfile = new FormFile($db); |
|
896 | + $formfile = new FormFile($db); |
|
897 | 897 | |
898 | 898 | // Show list of available documents |
899 | 899 | $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | |
153 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
153 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
154 | 154 | /** |
155 | 155 | * Function to build pdf onto disk |
156 | 156 | * |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) |
166 | 166 | { |
167 | - // phpcs:enable |
|
167 | + // phpcs:enable |
|
168 | 168 | global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines; |
169 | 169 | |
170 | 170 | dol_syslog("write_file outputlangs->defaultlang=" . (is_object($outputlangs) ? $outputlangs->defaultlang : 'null')); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | if (file_exists($dir)) { |
281 | 281 | // Add pdfgeneration hook |
282 | 282 | if (!is_object($hookmanager)) { |
283 | - $hookmanager = new HookManager($this->db); |
|
283 | + $hookmanager = new HookManager($this->db); |
|
284 | 284 | } |
285 | 285 | $hookmanager->initHooks(array('pdfgeneration')); |
286 | 286 | $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | } |
825 | 825 | } |
826 | 826 | |
827 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
827 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
828 | 828 | /** |
829 | 829 | * Return list of active generation modules |
830 | 830 | * |
@@ -834,11 +834,11 @@ discard block |
||
834 | 834 | */ |
835 | 835 | public static function liste_modeles($db, $maxfilenamelength = 0) |
836 | 836 | { |
837 | - // phpcs:enable |
|
837 | + // phpcs:enable |
|
838 | 838 | return parent::liste_modeles($db, $maxfilenamelength); // TODO: Change the autogenerated stub |
839 | 839 | } |
840 | 840 | |
841 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
841 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
842 | 842 | /** |
843 | 843 | * Show table for lines |
844 | 844 | * |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | } |
900 | 900 | } |
901 | 901 | |
902 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
902 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
903 | 903 | /** |
904 | 904 | * Show top header of page. |
905 | 905 | * |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | */ |
913 | 913 | protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) |
914 | 914 | { |
915 | - // phpcs:enable |
|
915 | + // phpcs:enable |
|
916 | 916 | global $conf, $langs; |
917 | 917 | |
918 | 918 | $ltrdirection = 'L'; |
@@ -1163,7 +1163,7 @@ discard block |
||
1163 | 1163 | return $top_shift; |
1164 | 1164 | } |
1165 | 1165 | |
1166 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
1166 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
1167 | 1167 | /** |
1168 | 1168 | * Show footer of page. Need this->emetteur object |
1169 | 1169 | * |