Merge remote-tracking branch 'upstream/develop' into 14a36
This commit is contained in:
commit
44133166de
@ -155,42 +155,10 @@ if ($result) {
|
||||
$db->free();
|
||||
}
|
||||
|
||||
$searchbox = '';
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo
|
||||
// Search contact/address
|
||||
if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) {
|
||||
$listofsearchfields['search_member'] = array('text'=>'Member');
|
||||
}
|
||||
|
||||
if (count($listofsearchfields)) {
|
||||
$searchbox .='<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||
$searchbox .='<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$searchbox .='<div class="div-table-responsive-no-min">';
|
||||
$searchbox .='<table class="noborder nohover centpercent">';
|
||||
$i = 0;
|
||||
foreach ($listofsearchfields as $key => $value) {
|
||||
if ($i == 0) {
|
||||
$searchbox .='<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
}
|
||||
$searchbox .='<tr class="oddeven">';
|
||||
$searchbox .='<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) {
|
||||
$searchbox .='<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
}
|
||||
$searchbox .='</tr>';
|
||||
$i++;
|
||||
}
|
||||
$searchbox .='</table>';
|
||||
$searchbox .='</div>';
|
||||
$searchbox .='</form>';
|
||||
$searchbox .='<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
*/
|
||||
|
||||
$boxgraph = '';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
$boxgraph .='<div class="div-table-responsive-no-min">';
|
||||
@ -258,7 +226,7 @@ print '<div class="fichecenter fichecenterbis">';
|
||||
print '<div class="twocolumns">';
|
||||
|
||||
print '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
||||
print $searchbox;
|
||||
|
||||
print $boxgraph;
|
||||
|
||||
print $resultboxes['boxlista'];
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -60,7 +60,7 @@ $arrayofparameters = array(
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
@ -75,7 +75,6 @@ if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||
$maskorder = GETPOST('maskorder', 'alpha');
|
||||
@ -198,6 +197,7 @@ print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, 'even
|
||||
// Setup page goes here
|
||||
echo '<span class="opacitymedium">'.$langs->trans("EventOrganizationSetupPage").'</span><br><br>';
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -100,59 +100,6 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// This is useless due to the global search combo
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) {
|
||||
// Search proposal
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$listofsearchfields['search_proposal'] = array('text'=>'Proposal');
|
||||
}
|
||||
// Search customer order
|
||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$listofsearchfields['search_customer_order'] = array('text'=>'CustomerOrder');
|
||||
}
|
||||
// Search supplier proposal
|
||||
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
|
||||
$listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
|
||||
}
|
||||
// Search supplier order
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||
$listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
|
||||
}
|
||||
// Search intervention
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
|
||||
$listofsearchfields['search_intervention'] = array('text'=>'Intervention');
|
||||
}
|
||||
// Search contract
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||
$listofsearchfields['search_contract'] = array('text'=>'Contract');
|
||||
}
|
||||
|
||||
if (count($listofsearchfields)) {
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
$i = 0;
|
||||
foreach ($listofsearchfields as $key => $value) {
|
||||
if ($i == 0) {
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
}
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) {
|
||||
print '<td class="noborderbottom" rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button "></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Draft customer proposals
|
||||
*/
|
||||
|
||||
@ -104,9 +104,9 @@ if ($action == 'add') {
|
||||
}
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("XTargetsAdded", $result), null, 'mesgs');
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
//header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
//exit;
|
||||
$action = '';
|
||||
}
|
||||
if ($result == 0) {
|
||||
setEventMessages($langs->trans("WarningNoEMailsAdded"), null, 'warnings');
|
||||
@ -655,21 +655,21 @@ if ($object->fetch($id) >= 0) {
|
||||
print '</td>';
|
||||
|
||||
// Date last update
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($obj->tms, 'dayhour');
|
||||
print '</td>';
|
||||
|
||||
// Status of recipient sending email (Warning != status of emailing)
|
||||
if ($obj->statut == 0) {
|
||||
// Date sent
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="center"></td>';
|
||||
|
||||
print '<td class="nowrap right">';
|
||||
print $object::libStatutDest($obj->statut, 2, '');
|
||||
print '</td>';
|
||||
} else {
|
||||
// Date sent
|
||||
print '<td class="center">'.$obj->date_envoi.'</td>';
|
||||
print '<td class="center nowraponall">'.$obj->date_envoi.'</td>';
|
||||
|
||||
print '<td class="nowrap right">';
|
||||
print $object::libStatutDest($obj->statut, 2, $obj->error_text);
|
||||
|
||||
@ -57,7 +57,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
//if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||
//{
|
||||
// Recherche emails
|
||||
// Search into emailings
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
||||
@ -65,32 +65,10 @@ print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal');
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichethirdleft">';
|
||||
|
||||
// This is useless due to the global search combo
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) {
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("Search").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("Proposal").':</td>';
|
||||
print '<td><input type="text" class="flat" name="sall" size=18></td>';
|
||||
print '<td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
*/
|
||||
|
||||
$listofstatus = array(Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED);
|
||||
|
||||
$sql = "SELECT count(p.rowid) as nb, p.fk_statut as status";
|
||||
|
||||
@ -50,6 +50,12 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
||||
// Maximum elements of the tables
|
||||
$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
|
||||
$maxLatestEditCount = 5;
|
||||
$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
|
||||
|
||||
|
||||
/*
|
||||
@ -70,19 +76,6 @@ print load_fiche_titre($langs->trans("OrdersArea"), '', 'order');
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo
|
||||
// Search customer orders
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("CustomerOrder").':</td><td><input type="text" class="flat" name="sall" size=18></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print "</table></div></form><br>\n";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
*/
|
||||
|
||||
@ -199,10 +199,6 @@ class BankAccounts extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
if ($bankaccount_from_id === $bankaccount_to_id) {
|
||||
throw new RestException(422, 'bankaccount_from_id and bankaccount_to_id must be different !');
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$accountfrom = new Account($this->db);
|
||||
@ -227,6 +223,14 @@ class BankAccounts extends DolibarrApi
|
||||
}
|
||||
}
|
||||
|
||||
if ($amount_to < 0) {
|
||||
throw new RestException(422, 'You must provide a positive value for amount.');
|
||||
}
|
||||
|
||||
if ($accountto->id == $accountfrom->id) {
|
||||
throw new RestException(422, 'bankaccount_from_id and bankaccount_to_id must be different !');
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$error = 0;
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -535,7 +535,7 @@ foreach ($accounts as $key => $type) {
|
||||
|
||||
// Account type
|
||||
if (!empty($arrayfields['accountype']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).'">';
|
||||
print $objecttmp->type_lib[$objecttmp->type];
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -553,13 +553,15 @@ foreach ($accounts as $key => $type) {
|
||||
|
||||
// Account number
|
||||
if (!empty($arrayfields['b.account_number']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax300">';
|
||||
if (!empty($conf->accounting->enabled) && !empty($objecttmp->account_number)) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $objecttmp->account_number, 1);
|
||||
print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
|
||||
print '<span title="'.dol_escape_htmltag($accountingaccount->account_number.' - '.$accountingaccount->label).'">';
|
||||
print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
|
||||
print '</span>';
|
||||
} else {
|
||||
print $objecttmp->account_number;
|
||||
print '<span title="'.dol_escape_htmltag($objecttmp->account_number).'">'.$objecttmp->account_number.'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
||||
@ -46,9 +46,11 @@ $error = 0;
|
||||
|
||||
$hookmanager->initHooks(array('banktransfer'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
@ -95,8 +97,17 @@ if ($action == 'add') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")), null, 'errors');
|
||||
}
|
||||
}
|
||||
if ($amountto < 0) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("AmountMustBePositive"), null, 'errors');
|
||||
}
|
||||
|
||||
if (($accountto->id != $accountfrom->id) && empty($error)) {
|
||||
if ($accountto->id == $accountfrom->id) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors');
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$db->begin();
|
||||
|
||||
$bank_line_id_from = 0;
|
||||
@ -148,9 +159,6 @@ if ($action == 'add') {
|
||||
setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -255,7 +263,8 @@ print '<input type="hidden" name="action" value="add">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("Amount").'</td>';
|
||||
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -271,13 +280,13 @@ print "<td>";
|
||||
print $form->selectDate((!empty($dateo) ? $dateo : ''), '', '', '', '', 'add');
|
||||
print "</td>\n";
|
||||
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
||||
print '<td><input name="amount" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
||||
print '<td class="right"><input name="amount" class="flat right" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
||||
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></div>';
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -75,29 +75,9 @@ llxHeader();
|
||||
print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract');
|
||||
|
||||
|
||||
//print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo
|
||||
// Search contract
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">'.$langs->trans("Contract").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||
print '<td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print "</table></div></form>\n";
|
||||
print "<br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
*/
|
||||
@ -250,8 +230,6 @@ foreach ($listofstatus as $status) {
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("ServicesRunning").')</td><td class="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||
print "</table></div><br>";
|
||||
|
||||
@ -320,7 +298,6 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||
}
|
||||
|
||||
|
||||
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
@ -645,7 +622,6 @@ if ($resql) {
|
||||
}
|
||||
|
||||
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
|
||||
$parameters = array('user' => $user);
|
||||
|
||||
@ -47,20 +47,20 @@ class FormAdmin
|
||||
/**
|
||||
* Return html select list with available languages (key='en_US', value='United States' for example)
|
||||
*
|
||||
* @param string $selected Language pre-selected
|
||||
* @param string $htmlname Name of HTML select
|
||||
* @param int $showauto Show 'auto' choice
|
||||
* @param array $filter Array of keys to exclude in list (opposite of $onlykeys)
|
||||
* @param string $showempty '1'=Add empty value or 'string to show'
|
||||
* @param int $showwarning Show a warning if language is not complete
|
||||
* @param int $disabled Disable edit of select
|
||||
* @param string $morecss Add more css styles
|
||||
* @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end
|
||||
* @param int $forcecombo Force to use combo box (so no ajax beautify effect)
|
||||
* @param int $multiselect Make the combo a multiselect
|
||||
* @param array $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...)
|
||||
* @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
|
||||
* @return string Return HTML select string with list of languages
|
||||
* @param string|array $selected Language pre-selected. Can be an array if $multiselect is 1.
|
||||
* @param string $htmlname Name of HTML select
|
||||
* @param int $showauto Show 'auto' choice
|
||||
* @param array $filter Array of keys to exclude in list (opposite of $onlykeys)
|
||||
* @param string $showempty '1'=Add empty value or 'string to show'
|
||||
* @param int $showwarning Show a warning if language is not complete
|
||||
* @param int $disabled Disable edit of select
|
||||
* @param string $morecss Add more css styles
|
||||
* @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end
|
||||
* @param int $forcecombo Force to use combo box (so no ajax beautify effect)
|
||||
* @param int $multiselect Make the combo a multiselect
|
||||
* @param array $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...)
|
||||
* @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
|
||||
* @return string Return HTML select string with list of languages
|
||||
*/
|
||||
public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0, $multiselect = 0, $onlykeys = null, $mainlangonly = 0)
|
||||
{
|
||||
@ -129,7 +129,7 @@ class FormAdmin
|
||||
}
|
||||
|
||||
$valuetoshow = picto_from_langcode($key, 'class="saturatemedium"').' '.$valuetoshow;
|
||||
if ((string) $selected == (string) $keytouse) {
|
||||
if ((is_string($selected) && (string) $selected == (string) $keytouse) || (is_array($selected) && in_array($keytouse, $selected))) {
|
||||
$out .= '<option value="'.$keytouse.'" selected data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';
|
||||
} else {
|
||||
$out .= '<option value="'.$keytouse.'" data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user