@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
| 691 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 691 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 692 | 692 | /** |
| 693 | 693 | * Mise a jour du lien entre le paiement de salaire et la ligne dans llx_bank generee |
| 694 | 694 | * |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | */ |
| 698 | 698 | public function update_fk_bank($id_bank) |
| 699 | 699 | { |
| 700 | - // phpcs:enable |
|
| 700 | + // phpcs:enable |
|
| 701 | 701 | $sql = "UPDATE " . MAIN_DB_PREFIX . "payment_salary SET fk_bank = " . ((int) $id_bank) . " WHERE rowid = " . ((int) $this->id); |
| 702 | 702 | |
| 703 | 703 | dol_syslog(get_class($this) . "::update_fk_bank", LOG_DEBUG); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | return $this->LibStatut($this->statut, $mode); |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 779 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 780 | 780 | /** |
| 781 | 781 | * Return the status |
| 782 | 782 | * |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | */ |
| 787 | 787 | public function LibStatut($status, $mode = 0) |
| 788 | 788 | { |
| 789 | - // phpcs:enable |
|
| 789 | + // phpcs:enable |
|
| 790 | 790 | global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage |
| 791 | 791 | |
| 792 | 792 | $langs->load('compta'); |
@@ -294,7 +294,7 @@ |
||
| 294 | 294 | $this->amount = $totalamount; |
| 295 | 295 | $this->total = $totalamount; // deprecated |
| 296 | 296 | $this->db->commit(); |
| 297 | - return $this->id; // id of the last payment inserted |
|
| 297 | + return $this->id; // id of the last payment inserted |
|
| 298 | 298 | } else { |
| 299 | 299 | $this->error = $this->db->error(); |
| 300 | 300 | $this->db->rollback(); |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | return $paymentsalary; |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 458 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 459 | 459 | /** |
| 460 | 460 | * Clean sensible object datas |
| 461 | 461 | * |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | protected function _cleanObjectDatas($object) |
| 466 | 466 | { |
| 467 | - // phpcs:enable |
|
| 467 | + // phpcs:enable |
|
| 468 | 468 | $object = parent::_cleanObjectDatas($object); |
| 469 | 469 | |
| 470 | 470 | unset($object->rowid); |
@@ -445,7 +445,9 @@ |
||
| 445 | 445 | { |
| 446 | 446 | $paymentsalary = array(); |
| 447 | 447 | $fields = Salaries::$FIELDSPAYMENT; |
| 448 | - if (isModEnabled("bank")) array_push($fields, "accountid"); |
|
| 448 | + if (isModEnabled("bank")) { |
|
| 449 | + array_push($fields, "accountid"); |
|
| 450 | + } |
|
| 449 | 451 | foreach ($fields as $field) { |
| 450 | 452 | if (!isset($data[$field])) { |
| 451 | 453 | throw new RestException(400, "$field field missing"); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 451 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 452 | 452 | /** |
| 453 | 453 | * Update link between payment salary and line generate into llx_bank |
| 454 | 454 | * |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | */ |
| 458 | 458 | public function update_fk_bank($id_bank) |
| 459 | 459 | { |
| 460 | - // phpcs:enable |
|
| 460 | + // phpcs:enable |
|
| 461 | 461 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'salary SET fk_bank = ' . ((int) $id_bank); |
| 462 | 462 | $sql .= " WHERE rowid = " . ((int) $this->id); |
| 463 | 463 | $result = $this->db->query($sql); |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | } |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 668 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 669 | 669 | /** |
| 670 | 670 | * Tag social contribution as paid completely |
| 671 | 671 | * |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | */ |
| 677 | 677 | public function set_paid($user) |
| 678 | 678 | { |
| 679 | - // phpcs:enable |
|
| 679 | + // phpcs:enable |
|
| 680 | 680 | dol_syslog(get_class($this) . "::set_paid is deprecated, use setPaid instead", LOG_NOTICE); |
| 681 | 681 | return $this->setPaid($user); |
| 682 | 682 | } |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | } |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 706 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 707 | 707 | /** |
| 708 | 708 | * Remove tag paid on social contribution |
| 709 | 709 | * |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | */ |
| 713 | 713 | public function set_unpaid($user) |
| 714 | 714 | { |
| 715 | - // phpcs:enable |
|
| 715 | + // phpcs:enable |
|
| 716 | 716 | $sql = "UPDATE " . MAIN_DB_PREFIX . "salary SET"; |
| 717 | 717 | $sql .= " paye = 0"; |
| 718 | 718 | $sql .= " WHERE rowid = " . ((int) $this->id); |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | return $this->LibStatut($this->paye, $mode, $alreadypaid); |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 743 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 744 | 744 | /** |
| 745 | 745 | * Return label of a given status |
| 746 | 746 | * |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | */ |
| 752 | 752 | public function LibStatut($status, $mode = 0, $alreadypaid = -1) |
| 753 | 753 | { |
| 754 | - // phpcs:enable |
|
| 754 | + // phpcs:enable |
|
| 755 | 755 | global $langs; |
| 756 | 756 | |
| 757 | 757 | // Load translation files required by the page |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | return $return; |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 837 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 838 | 838 | /** |
| 839 | 839 | * Create a withdrawal request for a direct debit order or a credit transfer order. |
| 840 | 840 | * Use the remain to pay excluding all existing open direct debit requests. |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | */ |
| 849 | 849 | public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'salaire', $checkduplicateamongall = 0) |
| 850 | 850 | { |
| 851 | - // phpcs:enable |
|
| 851 | + // phpcs:enable |
|
| 852 | 852 | global $conf, $mysoc; |
| 853 | 853 | |
| 854 | 854 | $error = 0; |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | } |
| 957 | 957 | } |
| 958 | 958 | |
| 959 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 959 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 960 | 960 | /** |
| 961 | 961 | * Remove a direct debit request or a credit transfer request |
| 962 | 962 | * |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | */ |
| 967 | 967 | public function demande_prelevement_delete($fuser, $did) |
| 968 | 968 | { |
| 969 | - // phpcs:enable |
|
| 969 | + // phpcs:enable |
|
| 970 | 970 | $sql = 'DELETE FROM ' . $this->db->prefix() . 'prelevement_demande'; |
| 971 | 971 | $sql .= ' WHERE rowid = ' . ((int) $did); |
| 972 | 972 | $sql .= ' AND traite = 0'; |
@@ -619,7 +619,7 @@ |
||
| 619 | 619 | } elseif ($multicurrency) { |
| 620 | 620 | //$this->sumpayed_multicurrency = $obj->multicurrency_amount; |
| 621 | 621 | //return (float) $obj->multicurrency_amount; |
| 622 | - return -1; // Not yet supported |
|
| 622 | + return -1; // Not yet supported |
|
| 623 | 623 | } else { |
| 624 | 624 | //$this->sumpayed = $obj->amount; |
| 625 | 625 | return (float) $obj->amount; |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | // Create a line of payments |
| 109 | 109 | $paiement = new PaymentSalary($db); |
| 110 | 110 | $paiement->fk_salary = $id; |
| 111 | - $paiement->chid = $id; // deprecated |
|
| 111 | + $paiement->chid = $id; // deprecated |
|
| 112 | 112 | $paiement->datep = $datepaye; |
| 113 | 113 | $paiement->amounts = $amounts; // Tableau de montant |
| 114 | 114 | $paiement->fk_typepayment = GETPOSTINT("paiementtype"); |
@@ -91,10 +91,10 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | |
| 93 | 93 | $parameters = array(); |
| 94 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 94 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 95 | 95 | // Delete Link |
| 96 | 96 | $permissiondellink = $user->hasRight('expedition', 'delivery', 'supprimer'); // Used by the include of actions_dellink.inc.php |
| 97 | -include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
| 97 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
| 98 | 98 | |
| 99 | 99 | if ($action == 'add') { |
| 100 | 100 | $db->begin(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $label = (string) GETPOST('label', 'alphanohtml'); |
| 51 | 51 | |
| 52 | 52 | $exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES |
| 53 | -$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml'); // 'introduction' or 'expedition' |
|
| 53 | +$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml'); // 'introduction' or 'expedition' |
|
| 54 | 54 | |
| 55 | 55 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 56 | 56 | |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if ($action == 'add' && $permissiontoadd) { |
| 126 | 126 | $object->label = trim($label); |
| 127 | - $object->exporttype = trim($exporttype); // 'des' or 'deb' |
|
| 128 | - $object->type_declaration = $type_declaration; // 'introduction' or 'expedition' |
|
| 127 | + $object->exporttype = trim($exporttype); // 'des' or 'deb' |
|
| 128 | + $object->type_declaration = $type_declaration; // 'introduction' or 'expedition' |
|
| 129 | 129 | //$object->subscription = (int) $subscription; |
| 130 | 130 | |
| 131 | 131 | // Fill array 'array_options' with data from add form |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 143 | 143 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 144 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 144 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 145 | 145 | |
| 146 | 146 | // Security check |
| 147 | 147 | if ($search_type == '0') { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 436 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 436 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 437 | 437 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
| 438 | 438 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 439 | 439 | |
@@ -72,12 +72,12 @@ |
||
| 72 | 72 | /** |
| 73 | 73 | * @var string |
| 74 | 74 | */ |
| 75 | - public $exporttype; // deb or des |
|
| 75 | + public $exporttype; // deb or des |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * @var string |
| 79 | 79 | */ |
| 80 | - public $type_declaration; // 'introduction' or 'expedition' |
|
| 80 | + public $type_declaration; // 'introduction' or 'expedition' |
|
| 81 | 81 | public $numero_declaration; |
| 82 | 82 | |
| 83 | 83 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | return $line; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 381 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 382 | 382 | /** |
| 383 | 383 | * Select a database |
| 384 | 384 | * PostgreSQL does not have an equivalent for `mysql_select_db` |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | */ |
| 390 | 390 | public function select_db($database) |
| 391 | 391 | { |
| 392 | - // phpcs:enable |
|
| 392 | + // phpcs:enable |
|
| 393 | 393 | if ($database == $this->database_name) { |
| 394 | 394 | return true; |
| 395 | 395 | } else { |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | return $ret; |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 589 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 590 | 590 | /** |
| 591 | 591 | * Returns the current line (as an object) for the resultset cursor |
| 592 | 592 | * |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | */ |
| 596 | 596 | public function fetch_object($resultset) |
| 597 | 597 | { |
| 598 | - // phpcs:enable |
|
| 598 | + // phpcs:enable |
|
| 599 | 599 | // If resultset not provided, we take the last used by connection |
| 600 | 600 | if (!is_resource($resultset) && !is_object($resultset)) { |
| 601 | 601 | $resultset = $this->_results; |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | return pg_fetch_object($resultset); |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 606 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 607 | 607 | /** |
| 608 | 608 | * Return datas as an array |
| 609 | 609 | * |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | */ |
| 613 | 613 | public function fetch_array($resultset) |
| 614 | 614 | { |
| 615 | - // phpcs:enable |
|
| 615 | + // phpcs:enable |
|
| 616 | 616 | // If resultset not provided, we take the last used by connection |
| 617 | 617 | if (!is_resource($resultset) && !is_object($resultset)) { |
| 618 | 618 | $resultset = $this->_results; |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | return pg_fetch_array($resultset); |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 623 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 624 | 624 | /** |
| 625 | 625 | * Return datas as an array |
| 626 | 626 | * |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | */ |
| 630 | 630 | public function fetch_row($resultset) |
| 631 | 631 | { |
| 632 | - // phpcs:enable |
|
| 632 | + // phpcs:enable |
|
| 633 | 633 | // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connection |
| 634 | 634 | if (!is_resource($resultset) && !is_object($resultset)) { |
| 635 | 635 | $resultset = $this->_results; |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | return pg_fetch_row($resultset); |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 640 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 641 | 641 | /** |
| 642 | 642 | * Return number of lines for result of a SELECT |
| 643 | 643 | * |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | */ |
| 648 | 648 | public function num_rows($resultset) |
| 649 | 649 | { |
| 650 | - // phpcs:enable |
|
| 650 | + // phpcs:enable |
|
| 651 | 651 | // If resultset not provided, we take the last used by connection |
| 652 | 652 | if (!is_resource($resultset) && !is_object($resultset)) { |
| 653 | 653 | $resultset = $this->_results; |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | return pg_num_rows($resultset); |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 658 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 659 | 659 | /** |
| 660 | 660 | * Return the number of lines in the result of a request INSERT, DELETE or UPDATE |
| 661 | 661 | * |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | */ |
| 666 | 666 | public function affected_rows($resultset) |
| 667 | 667 | { |
| 668 | - // phpcs:enable |
|
| 668 | + // phpcs:enable |
|
| 669 | 669 | // If resultset not provided, we take the last used by connection |
| 670 | 670 | if (!is_resource($resultset) && !is_object($resultset)) { |
| 671 | 671 | $resultset = $this->_results; |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | return pg_last_error($this->db); |
| 847 | 847 | } |
| 848 | 848 | |
| 849 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 849 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 850 | 850 | /** |
| 851 | 851 | * Get last ID after an insert INSERT |
| 852 | 852 | * |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | */ |
| 857 | 857 | public function last_insert_id($tab, $fieldid = 'rowid') |
| 858 | 858 | { |
| 859 | - // phpcs:enable |
|
| 859 | + // phpcs:enable |
|
| 860 | 860 | //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); |
| 861 | 861 | $result = pg_query($this->db, "SELECT currval('" . $tab . "_" . $fieldid . "_seq')"); |
| 862 | 862 | if (!$result) { |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | |
| 915 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 915 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 916 | 916 | /** |
| 917 | 917 | * Return connection ID |
| 918 | 918 | * |
@@ -920,13 +920,13 @@ discard block |
||
| 920 | 920 | */ |
| 921 | 921 | public function DDLGetConnectId() |
| 922 | 922 | { |
| 923 | - // phpcs:enable |
|
| 923 | + // phpcs:enable |
|
| 924 | 924 | return '?'; |
| 925 | 925 | } |
| 926 | 926 | |
| 927 | 927 | |
| 928 | 928 | |
| 929 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 929 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 930 | 930 | /** |
| 931 | 931 | * Create a new database |
| 932 | 932 | * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | */ |
| 941 | 941 | public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') |
| 942 | 942 | { |
| 943 | - // phpcs:enable |
|
| 943 | + // phpcs:enable |
|
| 944 | 944 | if (empty($charset)) { |
| 945 | 945 | $charset = $this->forcecharset; |
| 946 | 946 | } |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | return $ret; |
| 961 | 961 | } |
| 962 | 962 | |
| 963 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 963 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 964 | 964 | /** |
| 965 | 965 | * List tables into a database |
| 966 | 966 | * |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | */ |
| 971 | 971 | public function DDLListTables($database, $table = '') |
| 972 | 972 | { |
| 973 | - // phpcs:enable |
|
| 973 | + // phpcs:enable |
|
| 974 | 974 | $listtables = array(); |
| 975 | 975 | |
| 976 | 976 | $escapedlike = ''; |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | return $listtables; |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 991 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 992 | 992 | /** |
| 993 | 993 | * List tables into a database |
| 994 | 994 | * |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | */ |
| 999 | 999 | public function DDLListTablesFull($database, $table = '') |
| 1000 | 1000 | { |
| 1001 | - // phpcs:enable |
|
| 1001 | + // phpcs:enable |
|
| 1002 | 1002 | $listtables = array(); |
| 1003 | 1003 | |
| 1004 | 1004 | $escapedlike = ''; |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | return $listtables; |
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1019 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1020 | 1020 | /** |
| 1021 | 1021 | * List information of columns into a table. |
| 1022 | 1022 | * |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | */ |
| 1026 | 1026 | public function DDLInfoTable($table) |
| 1027 | 1027 | { |
| 1028 | - // phpcs:enable |
|
| 1028 | + // phpcs:enable |
|
| 1029 | 1029 | $infotables = array(); |
| 1030 | 1030 | |
| 1031 | 1031 | $sql = "SELECT "; |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | |
| 1057 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1057 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1058 | 1058 | /** |
| 1059 | 1059 | * Create a table into database |
| 1060 | 1060 | * |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | */ |
| 1070 | 1070 | public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) |
| 1071 | 1071 | { |
| 1072 | - // phpcs:enable |
|
| 1072 | + // phpcs:enable |
|
| 1073 | 1073 | // @TODO: $fulltext_keys parameter is unused |
| 1074 | 1074 | |
| 1075 | 1075 | $sqlk = array(); |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | } |
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1149 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1150 | 1150 | /** |
| 1151 | 1151 | * Drop a table into database |
| 1152 | 1152 | * |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | */ |
| 1156 | 1156 | public function DDLDropTable($table) |
| 1157 | 1157 | { |
| 1158 | - // phpcs:enable |
|
| 1158 | + // phpcs:enable |
|
| 1159 | 1159 | $tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table); |
| 1160 | 1160 | |
| 1161 | 1161 | $sql = "DROP TABLE " . $this->sanitize($tmptable); |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | } |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1170 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1171 | 1171 | /** |
| 1172 | 1172 | * Return a pointer of line with description of a table or field |
| 1173 | 1173 | * |
@@ -1177,7 +1177,7 @@ discard block |
||
| 1177 | 1177 | */ |
| 1178 | 1178 | public function DDLDescTable($table, $field = "") |
| 1179 | 1179 | { |
| 1180 | - // phpcs:enable |
|
| 1180 | + // phpcs:enable |
|
| 1181 | 1181 | $sql = "SELECT attname FROM pg_attribute, pg_type WHERE typname = '" . $this->escape($table) . "' AND attrelid = typrelid"; |
| 1182 | 1182 | $sql .= " AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')"; |
| 1183 | 1183 | if ($field) { |
@@ -1189,7 +1189,7 @@ discard block |
||
| 1189 | 1189 | return $this->_results; |
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1192 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1193 | 1193 | /** |
| 1194 | 1194 | * Create a new field into table |
| 1195 | 1195 | * |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | */ |
| 1202 | 1202 | public function DDLAddField($table, $field_name, $field_desc, $field_position = "") |
| 1203 | 1203 | { |
| 1204 | - // phpcs:enable |
|
| 1204 | + // phpcs:enable |
|
| 1205 | 1205 | // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra |
| 1206 | 1206 | // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); |
| 1207 | 1207 | $sql = "ALTER TABLE " . $this->sanitize($table) . " ADD " . $this->sanitize($field_name) . " "; |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | return 1; |
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 1241 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1241 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1242 | 1242 | /** |
| 1243 | 1243 | * Update format of a field into a table |
| 1244 | 1244 | * |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | */ |
| 1250 | 1250 | public function DDLUpdateField($table, $field_name, $field_desc) |
| 1251 | 1251 | { |
| 1252 | - // phpcs:enable |
|
| 1252 | + // phpcs:enable |
|
| 1253 | 1253 | $sql = "ALTER TABLE " . $this->sanitize($table); |
| 1254 | 1254 | $sql .= " ALTER COLUMN " . $this->sanitize($field_name) . " TYPE " . $this->sanitize($field_desc['type']); |
| 1255 | 1255 | if (isset($field_desc['value']) && preg_match("/^[^\s]/i", $field_desc['value'])) { |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | return 1; |
| 1285 | 1285 | } |
| 1286 | 1286 | |
| 1287 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1287 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1288 | 1288 | /** |
| 1289 | 1289 | * Drop a field from table |
| 1290 | 1290 | * |
@@ -1294,7 +1294,7 @@ discard block |
||
| 1294 | 1294 | */ |
| 1295 | 1295 | public function DDLDropField($table, $field_name) |
| 1296 | 1296 | { |
| 1297 | - // phpcs:enable |
|
| 1297 | + // phpcs:enable |
|
| 1298 | 1298 | $tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name); |
| 1299 | 1299 | |
| 1300 | 1300 | $sql = "ALTER TABLE " . $this->sanitize($table) . " DROP COLUMN " . $this->sanitize($tmp_field_name); |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | return 1; |
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1308 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1309 | 1309 | /** |
| 1310 | 1310 | * Create a user to connect to database |
| 1311 | 1311 | * |
@@ -1317,7 +1317,7 @@ discard block |
||
| 1317 | 1317 | */ |
| 1318 | 1318 | public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) |
| 1319 | 1319 | { |
| 1320 | - // phpcs:enable |
|
| 1320 | + // phpcs:enable |
|
| 1321 | 1321 | // Note: using ' on user does not works with pgsql |
| 1322 | 1322 | $sql = "CREATE USER " . $this->sanitize($dolibarr_main_db_user) . " with password '" . $this->escape($dolibarr_main_db_pass) . "'"; |
| 1323 | 1323 | |
@@ -1110,7 +1110,7 @@ |
||
| 1110 | 1110 | $sqlfields[$i] .= " " . $this->sanitize($field_desc['extra'], 0, 0, 1); |
| 1111 | 1111 | } |
| 1112 | 1112 | if (!empty($primary_key) && $primary_key == $field_name) { |
| 1113 | - $sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late |
|
| 1113 | + $sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late |
|
| 1114 | 1114 | } |
| 1115 | 1115 | $i++; |
| 1116 | 1116 | } |