@@ -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 |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | /* Use $context singleton to modify menu, */ |
155 | 155 | $parameters['controller'] = $context->controller; |
156 | 156 | |
157 | - $reshook = $hookmanager->executeHooks('doActions', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
157 | + $reshook = $hookmanager->executeHooks('doActions', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
158 | 158 | if ($reshook < 0) { |
159 | 159 | $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
160 | 160 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | /* Use $context singleton to modify menu, */ |
178 | 178 | $parameters['controller'] = $context->controller; |
179 | 179 | |
180 | - $reshook = $hookmanager->executeHooks('PrintPageView', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
180 | + $reshook = $hookmanager->executeHooks('PrintPageView', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
181 | 181 | if ($reshook < 0) { |
182 | 182 | $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
183 | 183 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | return $this->LibStatut($this->status, $this->need_subscription, $this->datefin, $mode); |
391 | 391 | } |
392 | 392 | |
393 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
393 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
394 | 394 | |
395 | 395 | /** |
396 | 396 | * Renvoi le libelle d'un statut donne |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | */ |
404 | 404 | public function LibStatut($status, $need_subscription, $date_end_subscription, $mode = 0) |
405 | 405 | { |
406 | - // phpcs:enable |
|
406 | + // phpcs:enable |
|
407 | 407 | return $this->getMemberStatic()->LibStatut($status, $need_subscription, $date_end_subscription, $mode); |
408 | 408 | } |
409 | 409 |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | return $this->LibStatut($this->fk_statut, $mode); |
316 | 316 | } |
317 | 317 | |
318 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
318 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
319 | 319 | /** |
320 | 320 | * Return the label of a given status |
321 | 321 | * |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function LibStatut($status, $mode = 0) |
327 | 327 | { |
328 | - // phpcs:enable |
|
328 | + // phpcs:enable |
|
329 | 329 | return $this->getPropalStatic()->LibStatut($status, $mode); |
330 | 330 | } |
331 | 331 | } |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | return $this->LibStatut($this->status, $mode); |
351 | 351 | } |
352 | 352 | |
353 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
353 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
354 | 354 | |
355 | 355 | /** |
356 | 356 | * Return the status |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function LibStatut($status, $mode = 0) |
363 | 363 | { |
364 | - // phpcs:enable |
|
364 | + // phpcs:enable |
|
365 | 365 | return $this->getPartnershipStatic()->LibStatut($status, $mode); |
366 | 366 | } |
367 | 367 | } |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | return $this->LibStatut($this->status, $mode); |
827 | 827 | } |
828 | 828 | |
829 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
829 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
830 | 830 | /** |
831 | 831 | * Return the label of a given status |
832 | 832 | * |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | */ |
837 | 837 | public function LibStatut($status, $mode = 0) |
838 | 838 | { |
839 | - // phpcs:enable |
|
839 | + // phpcs:enable |
|
840 | 840 | global $langs; |
841 | 841 | |
842 | 842 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -1126,7 +1126,7 @@ discard block |
||
1126 | 1126 | $stringtoexport = str_replace('medias/image/' . $website->ref . '/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); |
1127 | 1127 | $stringtoexport = str_replace('medias/js/' . $website->ref . '/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); |
1128 | 1128 | $stringtoexport = str_replace('"image/' . $website->ref . '/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
1129 | - $stringtoexport = str_replace('"/image/' . $website->ref . '/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1129 | + $stringtoexport = str_replace('"/image/' . $website->ref . '/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1130 | 1130 | $stringtoexport = str_replace('"js/' . $website->ref . '/', '"js/__WEBSITE_KEY__/', $stringtoexport); |
1131 | 1131 | $stringtoexport = str_replace('"/js/' . $website->ref . '/', '"/js/__WEBSITE_KEY__/', $stringtoexport); |
1132 | 1132 | |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | $filetpl = $pathofwebsite . '/page' . $object->fk_default_home . '.tpl.php'; |
1456 | 1456 | } |
1457 | 1457 | $filewrapper = $pathofwebsite . '/wrapper.php'; |
1458 | - dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1458 | + dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1459 | 1459 | } |
1460 | 1460 | |
1461 | 1461 | if ($error) { |
@@ -1901,7 +1901,7 @@ discard block |
||
1901 | 1901 | $destContent = file_get_contents($fileNeeded['fullname']); |
1902 | 1902 | |
1903 | 1903 | $numOfPageDest = $this->extractNumberFromFilename($fileNeeded['name']); |
1904 | - $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest,$numOfPageSource)); |
|
1904 | + $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest, $numOfPageSource)); |
|
1905 | 1905 | $differences['file_destination'] = $fileNeeded; |
1906 | 1906 | } else { |
1907 | 1907 | $differences = array(); |
@@ -1944,7 +1944,7 @@ discard block |
||
1944 | 1944 | $linefound = array(); |
1945 | 1945 | $countNumPage = count($exceptNumPge); |
1946 | 1946 | |
1947 | - for ($i = 0;$i < $countNumPage; $i++) { |
|
1947 | + for ($i = 0; $i < $countNumPage; $i++) { |
|
1948 | 1948 | $linefound[$i] = array(); |
1949 | 1949 | $linefound[$i]['meta'] = '/content="' . preg_quote($exceptNumPge[$i], '/') . '" \/>/'; |
1950 | 1950 | $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote($exceptNumPge[$i], '/') . '\);/'; |
@@ -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) { |
@@ -82,7 +82,7 @@ |
||
82 | 82 | return parent::fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias, $is_client, $is_supplier); |
83 | 83 | } |
84 | 84 | |
85 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
85 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
86 | 86 | /** |
87 | 87 | * Load indicators into this->nb for board |
88 | 88 | * |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | /** |
254 | 254 | * @var string external payment site |
255 | 255 | */ |
256 | - public $ext_payment_site; // Name of the external payment system ('StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...) |
|
256 | + public $ext_payment_site; // Name of the external payment system ('StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...) |
|
257 | 257 | |
258 | 258 | /** |
259 | 259 | * @var string comment |
@@ -544,9 +544,9 @@ discard block |
||
544 | 544 | $this->rum = $obj->rum; |
545 | 545 | $this->frstrecur = $obj->frstrecur; |
546 | 546 | $this->date_rum = $this->db->jdate($obj->date_rum); |
547 | - $this->stripe_card_ref = $obj->stripe_card_ref; // External system payment mode ID |
|
548 | - $this->stripe_account = $obj->stripe_account; // External system customer ID |
|
549 | - $this->ext_payment_site = $obj->ext_payment_site; // External system name ('StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...) |
|
547 | + $this->stripe_card_ref = $obj->stripe_card_ref; // External system payment mode ID |
|
548 | + $this->stripe_account = $obj->stripe_account; // External system customer ID |
|
549 | + $this->ext_payment_site = $obj->ext_payment_site; // External system name ('StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...) |
|
550 | 550 | $this->last_main_doc = $obj->last_main_doc; |
551 | 551 | $this->model_pdf = $obj->model_pdf; |
552 | 552 | } |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | return $this->LibStatut($this->status, $mode); |
639 | 639 | } |
640 | 640 | |
641 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
641 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
642 | 642 | /** |
643 | 643 | * Return the status |
644 | 644 | * |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | */ |
649 | 649 | public function LibStatut($status, $mode = 0) |
650 | 650 | { |
651 | - // phpcs:enable |
|
651 | + // phpcs:enable |
|
652 | 652 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
653 | 653 | global $langs; |
654 | 654 | //$langs->load("mymodule"); |
@@ -181,9 +181,9 @@ |
||
181 | 181 | public $max_total_amount_of_all_payments; |
182 | 182 | public $preapproval_key; |
183 | 183 | public $total_amount_of_all_payments; |
184 | - public $stripe_card_ref; // External system payment mode ID |
|
185 | - public $stripe_account; // External system customer ID |
|
186 | - public $ext_payment_site; // External system 'StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ... |
|
184 | + public $stripe_card_ref; // External system payment mode ID |
|
185 | + public $stripe_account; // External system customer ID |
|
186 | + public $ext_payment_site; // External system 'StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ... |
|
187 | 187 | |
188 | 188 | /** |
189 | 189 | * @var int Status |