diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 6ab65697745..765e536fec9 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -472,7 +472,7 @@ class AdherentType extends CommonObject } /** - * Function that retrieves the status of the member + * Function that retrieves the properties of a membership type * * @param int $rowid Id of member type to load * @return int <0 if KO, >0 if OK diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4f644ef01f3..191d3dcde39 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -683,14 +683,14 @@ if ($action == 'validate' && $permissiontoadd) { $idwarehouse = 0; } if ($objecttmp->valid($user, $idwarehouse)) { - setEventMessage($langs->trans('hasBeenValidated', $objecttmp->ref), 'mesgs'); + setEventMessages($langs->trans('hasBeenValidated', $objecttmp->ref), null, 'mesgs'); } else { - setEventMessage($objecttmp->error, $objecttmp->errors, 'errors'); + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; } } else { $langs->load("errors"); - setEventMessage($langs->trans('ErrorIsNotADraft', $objecttmp->ref), 'errors'); + setEventMessages($langs->trans('ErrorIsNotADraft', $objecttmp->ref), null, 'errors'); $error++; } } else { @@ -714,14 +714,14 @@ if ($action == 'shipped' && $permissiontoadd) { if ($objecttmp->fetch($checked)) { if ($objecttmp->statut == 1 || $objecttmp->statut == 2) { if ($objecttmp->cloture($user)) { - setEventMessage($langs->trans('PassedInClosedStatus', $objecttmp->ref), 'mesgs'); + setEventMessages($langs->trans('PassedInClosedStatus', $objecttmp->ref), null, 'mesgs'); } else { - setEventMessage($langs->trans('CantBeClosed'), 'errors'); + setEventMessages($langs->trans('CantBeClosed'), null, 'errors'); $error++; } } else { $langs->load("errors"); - setEventMessage($langs->trans('ErrorIsNotADraft', $objecttmp->ref), 'errors'); + setEventMessages($langs->trans('ErrorIsNotADraft', $objecttmp->ref), null, 'errors'); $error++; } } else { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index badc4f98e90..c8612eafd9c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1956,14 +1956,14 @@ class Facture extends CommonInvoice $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON f.fk_incoterms = i.rowid'; if ($rowid) { - $sql .= " WHERE f.rowid=".((int) $rowid); + $sql .= " WHERE f.rowid = ".((int) $rowid); } else { $sql .= ' WHERE f.entity IN ('.getEntity('invoice').')'; // Don't use entity if you use rowid if ($ref) { - $sql .= " AND f.ref='".$this->db->escape($ref)."'"; + $sql .= " AND f.ref = '".$this->db->escape($ref)."'"; } if ($ref_ext) { - $sql .= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; + $sql .= " AND f.ref_ext = '".$this->db->escape($ref_ext)."'"; } } diff --git a/htdocs/expensereport/payment/info.php b/htdocs/expensereport/payment/info.php index b5d87b81a51..c1e00ffa0fb 100644 --- a/htdocs/expensereport/payment/info.php +++ b/htdocs/expensereport/payment/info.php @@ -52,7 +52,7 @@ $confirm = GETPOST('confirm', 'alpha'); llxHeader('', $langs->trans("Payment")); $object = new PaymentExpenseReport($db); -$object->fetch($id, $ref); +$object->fetch($id); $object->info($object->id); $head = payment_expensereport_prepare_head($object); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index ad5e9505cfd..4906ae21a09 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -852,15 +852,18 @@ class FactureFournisseur extends CommonInvoice } /** - * Load object in memory from database + * Load object in memory from database * - * @param int $id Id supplier invoice - * @param string $ref Ref supplier invoice - * @return int <0 if KO, >0 if OK, 0 if not found + * @param int $id Id supplier invoice + * @param string $ref Ref supplier invoice + * @param string $ref_ext External reference of invoice + * @return int <0 if KO, >0 if OK, 0 if not found */ - public function fetch($id = '', $ref = '') + public function fetch($id = '', $ref = '', $ref_ext = '') { - global $langs; + if (empty($id) && empty($ref) && empty($ref_ext)) { + return -1; + } $sql = "SELECT"; $sql .= " t.rowid,"; @@ -911,10 +914,15 @@ class FactureFournisseur extends CommonInvoice $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON t.fk_mode_reglement = p.id"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid'; if ($id) { - $sql .= " WHERE t.rowid=".((int) $id); - } - if ($ref) { - $sql .= " WHERE t.ref='".$this->db->escape($ref)."' AND t.entity IN (".getEntity('supplier_invoice').")"; + $sql .= " WHERE t.rowid = ".((int) $id); + } else { + $sql .= ' WHERE t.entity IN ('.getEntity('supplier_invoice').')'; // Don't use entity if you use rowid + if ($ref) { + $sql .= " AND t.ref = '".$this->db->escape($ref)."'"; + } + if ($ref_ext) { + $sql .= " AND t.ref_ext = '".$this->db->escape($ref_ext)."'"; + } } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 81da058b919..9b3f0a1ce16 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1580,7 +1580,7 @@ class Holiday extends CommonObject // We add a log for each user $this->addLogCP($user->id, $userCounter['rowid'], $langs->trans('HolidaysMonthlyUpdate'), $newSolde, $userCounter['type']); - $result = $this->updateSoldeCP($userCounter['rowid'], $newSolde, $userCounter['type'], $langs->trans('HolidaysMonthlyUpdate')); + $result = $this->updateSoldeCP($userCounter['rowid'], $newSolde, $userCounter['type']); if ($result < 0) { $error++; diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 3a5fdbba4b5..095904bc2c2 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -207,6 +207,8 @@ ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) N -- VMYSQL4.3 ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN `rank` rankorder integer; -- VPGSQL8.2 ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; +-- VMYSQL4.3 ALTER TABLE llx_hrm_skillrank CHANGE COLUMN `rank` rankorder integer; +-- VPGSQL8.2 ALTER TABLE llx_hrm_skillrank CHANGE COLUMN rank rankorder integer; -- Rename const to hide public and private notes (fix allow notes const was used to hide) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index e79c39a1955..68bba46a3cb 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -335,7 +335,7 @@ class Contacts extends DolibarrApi $this->contact->setNoEmail($this->contact->no_email); } - if ($this->contact->update($id, DolibarrApiAccess::$user, 1, '', '', 'update')) { + if ($this->contact->update($id, DolibarrApiAccess::$user, 1, 'update')) { return $this->get($id); } diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index 981f6813acc..9597c7262e2 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -33,11 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->loadLangs(array("main"), "categories", "takepos", "printing"); - -if (!$user->rights->categorie->lire) { - accessforbidden(); -} +$langs->loadLangs(array("main", "categories", "takepos", "printing")); $id = GETPOST('id', 'int'); $type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT); @@ -51,9 +47,15 @@ if (is_numeric($type)) { $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility } +if (!$user->rights->categorie->lire) { + accessforbidden(); +} + + /* * Actions */ + if ($action == "SavePrinter1") { $printedcategories = ";"; if (is_array($printer1)) { diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 39fe2113071..3041c6f680e 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -81,7 +81,7 @@ $object->fetch($facid); // Call to external receipt modules if exist $parameters = array(); -$hookmanager->initHooks(array('takeposfrontend'), $facid); +$hookmanager->initHooks(array('takeposfrontend')); $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object); if (!empty($hookmanager->resPrint)) { print $hookmanager->resPrint; diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 634290ca187..5f1065f5171 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -305,7 +305,7 @@ if ($action == 'create') { // Show object lines $result = $object->getLinesArray(); - print load_fiche_titre($langs->trans("PossibleValues") . (!empty($object->lines) ? ' (' . count($object->lines) . ')' : '')); + print load_fiche_titre($langs->trans("PossibleValues") . (!empty($object->lines) ? '(' . count($object->lines) . ')' : '')); print '