diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 1faa9271623..6a2c69e32fe 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -659,8 +659,7 @@ class Adherent extends CommonObject
$nbrowsaffected = 0;
$error = 0;
- dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass." nosyncthirdparty=".$nosyncthirdparty.", email=".
- $this->email);
+ dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass." nosyncthirdparty=".$nosyncthirdparty.", email=".$this->email);
// Clean parameters
$this->lastname = trim($this->lastname) ? trim($this->lastname) : trim($this->lastname);
@@ -693,7 +692,9 @@ class Adherent extends CommonObject
$sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
$sql .= ", login = ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
$sql .= ", societe = ".($this->company ? "'".$this->db->escape($this->company)."'" : ($this->societe ? "'".$this->db->escape($this->societe)."'" : "null"));
- $sql .= ", fk_soc = ".($this->socid > 0 ? $this->db->escape($this->socid) : "null");
+ if ($this->socid) {
+ $sql .= ", fk_soc = ".($this->socid > 0 ? $this->db->escape($this->socid) : "null"); // Must be modified only when creating from a third-party
+ }
$sql .= ", address = ".($this->address ? "'".$this->db->escape($this->address)."'" : "null");
$sql .= ", zip = ".($this->zip ? "'".$this->db->escape($this->zip)."'" : "null");
$sql .= ", town = ".($this->town ? "'".$this->db->escape($this->town)."'" : "null");
@@ -713,9 +714,6 @@ class Adherent extends CommonObject
$sql .= ", fk_adherent_type = ".$this->db->escape($this->typeid);
$sql .= ", morphy = '".$this->db->escape($this->morphy)."'";
$sql .= ", birth = ".($this->birth ? "'".$this->db->idate($this->birth)."'" : "null");
- if ($this->socid) {
- $sql .= ", fk_soc = '".$this->db->escape($this->socid)."'"; // Must be modified only when creating from a third-party
- }
if ($this->datefin) {
$sql .= ", datefin = '".$this->db->idate($this->datefin)."'"; // Must be modified only when deleting a subscription
}
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 322c08bd77c..996f2d16c8d 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -307,7 +307,7 @@ $memberstatic = new Adherent($db);
$now = dol_now();
-if (!empty($search_categ) || !empty($catid)) {
+if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) {
$sql = "SELECT DISTINCT";
} else {
$sql = "SELECT";
@@ -336,7 +336,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
}
-if (!empty($search_categ) || !empty($catid)) {
+if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) {
// We need this table joined to the select in order to filter by categ
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member";
}
@@ -540,7 +540,7 @@ if ($search_login) {
if ($search_email) {
$param .= "&search_email=".urlencode($search_email);
}
-if ($search_categ) {
+if ($search_categ > 0 || $search_categ == -2) {
$param .= "&search_categ=".urlencode($search_categ);
}
if ($search_company) {
@@ -573,7 +573,7 @@ if ($search_phone_mobile != '') {
if ($search_filter && $search_filter != '-1') {
$param .= "&search_filter=".urlencode($search_filter);
}
-if ($search_status != "" && $search_status != Adherent::STATUS_DRAFT) {
+if ($search_status != "" && $search_status != -3) {
$param .= "&search_status=".urlencode($search_status);
}
if ($search_type > 0) {
diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php
index 36be1f273ff..a3c20d0dffc 100644
--- a/htdocs/admin/tools/export_files.php
+++ b/htdocs/admin/tools/export_files.php
@@ -173,7 +173,7 @@ if ($compression == 'zip') {
// We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
- $cmd = "tar -cf ".escapeshellcmd($outputdir."/".$file)." --exclude-vcs --exclude-caches-all --exclude='temp' --exclude='*.log' --exclude='*.pdf_preview-*.png' --exclude='documents/admin/documents' -C '".escapeshellcmd(dol_sanitizePathName($dirtoswitch))."' '".escapeshellcmd(dol_sanitizeFileName($dirtocompress))."'";
+ $cmd = "tar -cf '".escapeshellcmd($outputdir."/".$file)."' --exclude-vcs --exclude-caches-all --exclude='temp' --exclude='*.log' --exclude='*.pdf_preview-*.png' --exclude='documents/admin/documents' -C '".escapeshellcmd(dol_sanitizePathName($dirtoswitch))."' '".escapeshellcmd(dol_sanitizeFileName($dirtocompress))."'";
$result = $utils->executeCLI($cmd, $outputfile, 0, null, 1);
diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php
index 83b5b69283f..e5781d98561 100644
--- a/htdocs/bookmarks/bookmarks.lib.php
+++ b/htdocs/bookmarks/bookmarks.lib.php
@@ -66,7 +66,7 @@ function printDropdownBookmarksList()
// Url to list bookmark
- $listbtn = '';
// Url to go on create new bookmark page
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 45a4d2fdb57..9f902c51e29 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1955,7 +1955,7 @@ if ($action == 'create') {
// We verify whether the object is provisionally numbering
$ref = substr($object->ref, 1, 4);
- if ($ref == 'PROV') {
+ if ($ref == 'PROV' || $ref == '') {
$numref = $object->getNextNumRef($soc);
if (empty($numref)) {
$error++;
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 958ff542fed..990ec43c8ae 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1902,8 +1902,12 @@ if ($action == 'create' && $usercancreate) {
if ($action == 'validate') {
// We check that object has a temporary ref
$ref = substr($object->ref, 1, 4);
- if ($ref == 'PROV') {
+ if ($ref == 'PROV' || $ref == '') {
$numref = $object->getNextNumRef($soc);
+ if (empty($numref)) {
+ $error++;
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
} else {
$numref = $object->ref;
}
@@ -1954,8 +1958,9 @@ if ($action == 'create' && $usercancreate) {
if ($nbMandated > 0 ) $text .= '
'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'
';
-
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
+ if (!$error) {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
+ }
}
// Confirm back to draft status
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index f2b26c73242..1d57f9c13d4 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -734,7 +734,7 @@ if (empty($reshook)) {
}
if (!$error) {
- // On verifie si la facture a des paiements
+ // We check if invoice has payments
$sql = 'SELECT pf.amount';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
$sql .= ' WHERE pf.fk_facture = '.((int) $object->id);
@@ -984,7 +984,7 @@ if (empty($reshook)) {
$db->rollback();
}
}
- } elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $usercancreate) {
+ } elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $usercanissuepayment) {
// Delete payment
$object->fetch($id);
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0) {
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 635727233d3..96d482b33ae 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -75,6 +75,12 @@ $hookmanager->initHooks(array('paiementcard', 'globalcard'));
$formquestion = array();
+$usercanissuepayment = !empty($user->rights->facture->paiement);
+
+$fieldid = 'rowid';
+$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
+$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $fieldid, $isdraft);
+
/*
* Actions
@@ -87,7 +93,7 @@ if ($reshook < 0) {
}
if (empty($reshook)) {
- if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) {
+ if (($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) && $usercanissuepayment) {
$error = 0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
@@ -202,7 +208,7 @@ if (empty($reshook)) {
/*
* Action confirm_paiement
*/
- if ($action == 'confirm_paiement' && $confirm == 'yes') {
+ if ($action == 'confirm_paiement' && $confirm == 'yes' && $usercanissuepayment) {
$error = 0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
@@ -486,7 +492,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print ''.$langs->trans('AccountToDebit').' | ';
}
print '';
- $form->select_comptes($accountid, 'accountid', 0, '', 2);
+ print $form->select_comptes($accountid, 'accountid', 0, '', 2, '', 0, '', 1);
print ' | ';
} else {
print ' | ';
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index 93fdd415513..8ff229f7ba7 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -64,6 +64,8 @@ if ($socid && $socid != $object->thirdparty->id) {
accessforbidden();
}
+$error = 0;
+
/*
* Actions
@@ -191,6 +193,39 @@ if ($action == 'setdatep' && !empty($_POST['datepday'])) {
setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
}
}
+if ($action == 'createbankpayment' && !empty($user->rights->facture->paiement)) {
+ $db->begin();
+
+ // Create the record into bank for the amount of payment $object
+ if (!$error) {
+ $label = '(CustomerInvoicePayment)';
+ if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE) {
+ $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
+ }
+
+ $bankaccountid = GETPOST('accountid', 'int');
+ if ($bankaccountid > 0) {
+ $object->paiementcode = $object->type_code;
+ $object->amounts = $object->getAmountsArray();
+
+ $result = $object->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
+ }
+ } else {
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
+ $error++;
+ }
+ }
+
+
+ if (!$error) {
+ $db->commit();
+ } else {
+ $db->rollback();
+ }
+}
/*
@@ -315,7 +350,37 @@ if (!empty($conf->banque->enabled)) {
print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
} else {
$langs->load("admin");
- print ''.$langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name")).'';
+ print '';
+ print $langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name"));
+ print '';
+ if (!empty($user->rights->facture->paiement)) {
+ // Try to guess $bankaccountidofinvoices that is ID of bank account defined on invoice.
+ // Return null if not found, return 0 if it has different value for at least 2 invoices, return the value if same on all invoices where a bank is defined.
+ $amountofpayments = $object->getAmountsArray();
+ $bankaccountidofinvoices = null;
+ foreach ($amountofpayments as $idinvoice => $amountofpayment) {
+ $tmpinvoice = new Facture($db);
+ $tmpinvoice->fetch($idinvoice);
+ if ($tmpinvoice->fk_account > 0 && $bankaccountidofinvoices !== 0) {
+ if (is_null($bankaccountidofinvoices)) {
+ $bankaccountidofinvoices = $tmpinvoice->fk_account;
+ } elseif ($bankaccountidofinvoices != $tmpinvoice->fk_account) {
+ $bankaccountidofinvoices = 0;
+ }
+ }
+ }
+
+ print '';
+ }
}
print '';
print '';
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index ab68ac7f9b1..3abf38fb16e 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -951,6 +951,7 @@ class Paiement extends CommonObject
*
* @param string $filter Filter
* @return int|array <0 if KO or array of invoice id
+ * @see getAmountsArray()
*/
public function getBillsArray($filter = '')
{
@@ -984,6 +985,7 @@ class Paiement extends CommonObject
* Return list of amounts of payments.
*
* @return int|array Array of amount of payments
+ * @see getBillsArray()
*/
public function getAmountsArray()
{
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 342360bd454..30d4f4ce825 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -934,33 +934,29 @@ if ($modecompta == 'BOOKKEEPING') {
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
if ($modecompta == 'CREANCES-DETTES') {
- //$column = 's.dateep'; // We use the date of salary
- $column = 'p.datep';
+ $column = 's.dateep'; // We use the date of end of period of salary
+
+ $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, s.label as label, date_format($column,'%Y-%m') as dm, sum(s.amount) as amount";
+ $sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
+ $sql .= " WHERE s.entity IN (".getEntity('salary').")";
+ if (!empty($date_start) && !empty($date_end)) {
+ $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
+ }
+ $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, s.label, dm";
} else {
$column = 'p.datep';
- }
- $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
- $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
- $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
- $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
- $sql .= " WHERE s.entity IN (".getEntity('salary').")";
- if (!empty($date_start) && !empty($date_end)) {
- $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
+ $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
+ $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid = p.fk_salary";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
+ $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
+ if (!empty($date_start) && !empty($date_end)) {
+ $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
+ }
+ $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
}
- $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
-
- // For backward compatibility with old module salary
- $column = 'p.datep';
- $sql .= " UNION ";
- $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
- $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
- $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
- $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
- if (!empty($date_start) && !empty($date_end)) {
- $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
- }
- $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
$newsortfield = $sortfield;
if ($newsortfield == 's.nom, s.rowid') {
@@ -975,7 +971,7 @@ if ($modecompta == 'BOOKKEEPING') {
$sql .= $db->order($newsortfield, $sortorder);
}
- dol_syslog("get payment salaries");
+ dol_syslog("get salaries");
$result = $db->query($sql);
$subtotal_ht = 0;
$subtotal_ttc = 0;
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 6aab9093c05..ff770acf554 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -615,23 +615,31 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if ($modecompta == 'CREANCES-DETTES') {
- //$column = 's.dateep'; // we use the date of salary
- $column = 'p.datep';
+ $column = 's.dateep'; // we use the date of end of period of salary
+
+ $sql = "SELECT s.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(s.amount) as amount";
+ $sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
+ $sql .= " WHERE s.entity IN (".getEntity('salary').")";
+ if (!empty($date_start) && !empty($date_end)) {
+ $sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
+ }
+ $sql .= " GROUP BY s.label, dm";
}
if ($modecompta == "RECETTES-DEPENSES") {
$column = 'p.datep';
+
+ $sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
+ $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON p.fk_salary = s.rowid";
+ $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
+ if (!empty($date_start) && !empty($date_end)) {
+ $sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
+ }
+ $sql .= " GROUP BY p.label, dm";
}
$subtotal_ht = 0;
$subtotal_ttc = 0;
- $sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
- $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p, ".MAIN_DB_PREFIX."salary as s";
- $sql .= " WHERE p.fk_salary = s.rowid";
- $sql .= " AND s.entity IN (".getEntity('salary').")";
- if (!empty($date_start) && !empty($date_end)) {
- $sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
- }
- $sql .= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result = $db->query($sql);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 8dabc902e5c..4b3d6fca2d3 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7699,7 +7699,7 @@ abstract class CommonObject
if (empty($reshook)) {
if (key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
$out .= "\n";
- $out .= ' ';
+ $out .= ' ';
$out .= "\n";
$extrafields_collapse_num = '';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 8a0b66e0b78..f25c9aad9d3 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1599,7 +1599,7 @@ class Form
* @param string $exclude List of contacts id to exclude
* @param string $limitto Disable answers that are not id in this array list
* @param integer $showfunction Add function into label
- * @param string $moreclass Add more class to class style
+ * @param string $morecss Add more class to class style
* @param integer $showsoc Add company into label
* @param int $forcecombo Force to use combo box
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
@@ -1609,10 +1609,10 @@ class Form
* @return int <0 if KO, Nb of contact in list if OK
* @deprecated You can use selectcontacts directly (warning order of param was changed)
*/
- public function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '')
+ public function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '')
{
// phpcs:enable
- print $this->selectcontacts($socid, $selected, $htmlname, $showempty, $exclude, $limitto, $showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid);
+ print $this->selectcontacts($socid, $selected, $htmlname, $showempty, $exclude, $limitto, $showfunction, $morecss, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid);
return $this->num;
}
@@ -1629,7 +1629,7 @@ class Form
* @param string $exclude List of contacts id to exclude
* @param string $limitto Disable answers that are not id in this array list
* @param integer $showfunction Add function into label
- * @param string $moreclass Add more class to class style
+ * @param string $morecss Add more class to class style
* @param bool $options_only Return options only (for ajax treatment)
* @param integer $showsoc Add company into label
* @param int $forcecombo Force to use combo box (so no ajax beautify effect)
@@ -1640,7 +1640,7 @@ class Form
* @param integer $disableifempty Set tag 'disabled' on select if there is no choice
* @return int|string <0 if KO, HTML with select string if OK.
*/
- public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0)
+ public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0)
{
global $conf, $langs, $hookmanager, $action;
@@ -1687,7 +1687,7 @@ class Form
$num = $this->db->num_rows($resql);
if ($htmlname != 'none' && !$options_only) {
- $out .= '