diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 4fafb8a19aa..ef105b6709a 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -292,7 +292,7 @@ if ($action == 'setjournal') { } if ($action == 'setdocref') { - $refdoc = trim(GETPOST('doc_ref', 'alpha')); + $refdoc = GETPOST('doc_ref', 'alpha'); $result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index c55e4a1afd5..5d23bbb08a1 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -231,7 +231,7 @@ print ''; dol_fiche_end(); -print '
'; +//print ''; print ''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 53110b9cad8..94632dc0184 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -108,7 +108,7 @@ if ($actionsave) // Save colors while ($i <= 2) { - $color = trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha')); + $color = GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha'); if ($color == '-1') $color = ''; $res = dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index fb08286e0a3..0c74b19b424 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -62,7 +62,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index a9db23a062a..ef00ece52fc 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -86,7 +86,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'emailcollector', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 89f9e23fdca..2de3c436826 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -80,7 +80,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'mymodule', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 83c8f583450..3414f00b5d1 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -168,6 +168,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementL if ($conf->projet->enabled) $elementList['project'] = $langs->trans('MailToProject'); if ($conf->ticket->enabled && $user->rights->ticket->read) $elementList['ticket_send'] = $langs->trans('MailToTicket'); if ($conf->recruitment->enabled && $user->rights->recruitment->recruitmentjobposition->read) $elementList['recruitmentcandidature_send'] = $langs->trans('RecruitmentCandidatures'); +if ($conf->agenda->enabled) $elementList['actioncomm_send'] = $langs->trans('MailToSendEventPush'); $elementList['user'] = $langs->trans('MailToUser'); $parameters = array('elementList'=>$elementList); diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 91c4003ec92..9499f0b0f22 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -52,7 +52,7 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", GETPOST("MAIN_DISABLE_ALL_SMS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphahtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", GETPOST("MAIN_MAIL_SMS_FROM", 'alphanohtml'), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 85e3b2b2e5c..e8b60eba5fb 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -33,7 +33,7 @@ $langs->load("admin"); $action = GETPOST('action', 'alpha'); $what = GETPOST('what', 'alpha'); $export_type = GETPOST('export_type', 'alpha'); -$file = trim(GETPOST('zipfilename_template', 'alpha')); +$file = GETPOST('zipfilename_template', 'alpha'); $compression = GETPOST('compression'); $file = dol_sanitizeFileName($file); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 7d2bf379282..311531a52de 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "workflow", "propal", "workflow", "orders", "supplier_proposals", "receptions")); +$langs->loadLangs(array("admin", "workflow", "propal", "workflow", "orders", "supplier_proposal", "receptions")); if (!$user->admin) accessforbidden(); @@ -80,16 +80,22 @@ $workflowcodes = array( // Automatic classification of proposal 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify_proposal', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'propal', 'warning'=>''), 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify_proposal', 'position'=>31, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'propal', 'warning'=>''), + 'separator2'=>array('family'=>'separator', 'position'=>35), // Automatic classification of order 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array('family'=>'classify_order', 'position'=>40, 'enabled'=>'! empty($conf->expedition->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify_order', 'position'=>41, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order', 'warning'=>''), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. - 'separator2'=>array('family'=>'separator', 'position'=>50), + 'separator3'=>array('family'=>'separator', 'position'=>50), // Automatic classification supplier proposal 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'propal', 'warning'=>''), + 'separator4'=>array('family'=>'separator', 'position'=>61), // Automatic classification supplier order 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)', 'picto'=>'order', 'warning'=>''), - //Automatic classification reception + 'separator5'=>array('family'=>'separator', 'position'=>63), + // Automatic classification reception 'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'bill'), + 'separator6'=>array('family'=>'separator', 'position'=>90), + // Automatic classification of intervention + 'WORKFLOW_TICKET_CLOSE_INTERVENTION'=>array('family'=>'classify_intervention', 'position'=>100, 'enabled'=>'! empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)', 'picto'=>'intervention'), ); if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) @@ -131,8 +137,8 @@ foreach ($workflowcodes as $key => $params) { print '| '; + print ' | '; print $facturestatic->getLibType(); print " | "; if (!$i) $totalarray['nbfield']++; @@ -1251,7 +1251,7 @@ if ($resql) // Date if (!empty($arrayfields['f.date']['checked'])) { - print ''; + print ' | '; print dol_print_date($db->jdate($obj->df), 'day'); print ' | '; if (!$i) $totalarray['nbfield']++; @@ -1260,7 +1260,7 @@ if ($resql) // Date if (!empty($arrayfields['f.date_valid']['checked'])) { - print ''; + print ' | '; print dol_print_date($db->jdate($obj->date_valid), 'day'); print ' | '; if (!$i) $totalarray['nbfield']++; @@ -1269,7 +1269,7 @@ if ($resql) // Date limit if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''.dol_print_date($datelimit, 'day'); + print ' | '.dol_print_date($datelimit, 'day'); if ($facturestatic->hasDelay()) { print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); @@ -1281,7 +1281,7 @@ if ($resql) // Project ref if (!empty($arrayfields['p.ref']['checked'])) { - print ' | '; + print ' | '; if ($obj->project_id > 0) { print $projectstatic->getNomUrl(1); @@ -1293,7 +1293,7 @@ if ($resql) // Project title if (!empty($arrayfields['p.title']['checked'])) { - print ' | '; + print ' | '; if ($obj->project_id > 0) { print $projectstatic->title; @@ -1326,7 +1326,7 @@ if ($resql) // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ' | '; + print ' | '; print $obj->zip; print ' | '; if (!$i) $totalarray['nbfield']++; @@ -1368,7 +1368,7 @@ if ($resql) // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; + print ' | '; $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); print ' | '; if (!$i) $totalarray['nbfield']++; @@ -1404,7 +1404,7 @@ if ($resql) // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)." | \n"; + print ''.price($obj->total_ht)." | \n"; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; $totalarray['val']['f.total_ht'] += $obj->total_ht; @@ -1412,7 +1412,7 @@ if ($resql) // Amount VAT if (!empty($arrayfields['f.total_vat']['checked'])) { - print ''.price($obj->total_vat)." | \n"; + print ''.price($obj->total_vat)." | \n"; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_vat'; $totalarray['val']['f.total_vat'] += $obj->total_vat; @@ -1420,7 +1420,7 @@ if ($resql) // Amount LocalTax1 if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print ''.price($obj->total_localtax1)." | \n"; + print ''.price($obj->total_localtax1)." | \n"; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax1'; $totalarray['val']['f.total_localtax1'] += $obj->total_localtax1; @@ -1428,7 +1428,7 @@ if ($resql) // Amount LocalTax2 if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print ''.price($obj->total_localtax2)." | \n"; + print ''.price($obj->total_localtax2)." | \n"; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax2'; $totalarray['val']['f.total_localtax2'] += $obj->total_localtax2; @@ -1436,7 +1436,7 @@ if ($resql) // Amount TTC if (!empty($arrayfields['f.total_ttc']['checked'])) { - print ''.price($obj->total_ttc)." | \n"; + print ''.price($obj->total_ttc)." | \n"; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc'; $totalarray['val']['f.total_ttc'] += $obj->total_ttc; @@ -1461,7 +1461,7 @@ if ($resql) if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''.(!empty($totalpay) ?price($totalpay, 0, $langs) : ' ').' | '; // TODO Use a denormalized field + print ''.(!empty($totalpay) ?price($totalpay, 0, $langs) : ' ').' | '; // TODO Use a denormalized field if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalam'; $totalarray['val']['totalam'] += $totalpay; @@ -1470,7 +1470,7 @@ if ($resql) // Pending amount if (!empty($arrayfields['rtp']['checked'])) { - print ''; + print ' | '; print (!empty($remaintopay) ? price($remaintopay, 0, $langs) : ' '); print ' | '; // TODO Use a denormalized field if (!$i) $totalarray['nbfield']++; @@ -1482,14 +1482,14 @@ if ($resql) // Currency if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print ''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)." | \n"; + print ''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)." | \n"; if (!$i) $totalarray['nbfield']++; } // Currency rate if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print ''; + print ' | '; $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); print " | \n"; if (!$i) $totalarray['nbfield']++; @@ -1497,31 +1497,31 @@ if ($resql) // Amount HT if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print ''.price($obj->multicurrency_total_ht)." | \n"; + print ''.price($obj->multicurrency_total_ht)." | \n"; if (!$i) $totalarray['nbfield']++; } // Amount VAT if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print ''.price($obj->multicurrency_total_vat)." | \n"; + print ''.price($obj->multicurrency_total_vat)." | \n"; if (!$i) $totalarray['nbfield']++; } // Amount TTC if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print ''.price($obj->multicurrency_total_ttc)." | \n"; + print ''.price($obj->multicurrency_total_ttc)." | \n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').' | '; // TODO Use a denormalized field + print ''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').' | '; // TODO Use a denormalized field if (!$i) $totalarray['nbfield']++; } // Pending amount if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; + print ' | '; print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ' '); print ' | '; // TODO Use a denormalized field if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 4eea16f706b..4390c9c1cb0 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -107,7 +107,7 @@ if (empty($reshook)) if (substr($key, 0, 7) == 'amount_' && GETPOST($key) != '') { $cursorfacid = substr($key, 7); - $amounts[$cursorfacid] = price2num(trim(GETPOST($key))); + $amounts[$cursorfacid] = price2num(GETPOST($key)); $totalpayment = $totalpayment + $amounts[$cursorfacid]; if (!empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++; $result = $tmpinvoice->fetch($cursorfacid); @@ -134,7 +134,7 @@ if (empty($reshook)) } elseif (substr($key, 0, 21) == 'multicurrency_amount_') { $cursorfacid = substr($key, 21); - $multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key))); + $multicurrency_amounts[$cursorfacid] = price2num(GETPOST($key)); $multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid]; if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++; $result = $tmpinvoice->fetch($cursorfacid); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 53934deaac1..c6c0f24497a 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -47,7 +47,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $type = GETPOST('type', 'aZ09'); $search_facture = GETPOST('search_facture', 'alpha'); -$search_societe = trim(GETPOST('search_societe', 'alpha')); +$search_societe = GETPOST('search_societe', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9eeae17280f..cb81d30798a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -62,7 +62,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars $search_phone = GETPOST("search_phone", 'alpha'); -$search_id = trim(GETPOST("search_id", "int")); +$search_id = GETPOST("search_id", "int"); $search_firstlast_only = GETPOST("search_firstlast_only", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); $search_firstname = GETPOST("search_firstname", 'alpha'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7904bd321ae..f703ccd4b65 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1897,7 +1897,7 @@ if ($action == 'create') print '
| '.$langs->trans("Comment").' | '; + print ' | '.$langs->trans("Comment").' | '; print ' | '; print ' '; print ''; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8afc2f0e335..e15d6467755 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -50,13 +50,13 @@ $search_name = GETPOST('search_name', 'alpha'); $search_email = GETPOST('search_email', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state", 'alpha')); +$search_state = GETPOST("search_state", 'alpha'); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_contract = GETPOST('search_contract', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search_status = GETPOST('search_status', 'alpha'); $socid = GETPOST('socid', 'int'); $search_user = GETPOST('search_user', 'int'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c8a38dd0ea6..d3b1589410e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1753,43 +1753,39 @@ class Form $out .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); // Complete name with more info - $moreinfo = 0; + $moreinfo = ''; if (!empty($conf->global->MAIN_SHOW_LOGIN)) { - $out .= ($moreinfo ? ' - ' : ' (').$obj->login; - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$obj->login; } if ($showstatus >= 0) { if ($obj->statut == 1 && $showstatus == 1) { - $out .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); } if ($obj->statut == 0) { - $out .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); } } if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { if (!$obj->entity) { - $out .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); } else { - $out .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); - $moreinfo++; + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); } } - $out .= ($moreinfo ? ')' : ''); + $moreinfo .= ($moreinfo ? ')' : ''); if ($disableline && $disableline != '1') { - $out .= ' - '.$disableline; // This is text from $enableonlytext parameter + $moreinfo .= ' - '.$disableline; // This is text from $enableonlytext parameter } + $out .= $moreinfo; $out .= ''; - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; $i++; } @@ -5598,9 +5594,11 @@ class Form if ($addnowlink == 1) { $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H', 'tzuser').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; } elseif ($addnowlink == 2) { $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; } if ($fullday) $reset_scripts .= ' } '; @@ -5613,9 +5611,11 @@ class Form if ($addnowlink == 1) { $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M', 'tzuser').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; } elseif ($addnowlink == 2) { $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; } if ($fullday) $reset_scripts .= ' } '; } @@ -5673,6 +5673,40 @@ class Form return $retstring; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * select_type_duration + * + * @param string $prefix Prefix + * @param string $selected Selected type + * @return string HTML select string + */ + public function select_type_duration($prefix, $selected = 'minute') + { + // phpcs:enable + global $langs; + + $retstring = ''; + + $TDurationTypes = array('year'=>$langs->trans('Years'), 'month'=>$langs->trans('Month'), 'week'=>$langs->trans('Weeks'), 'day'=>$langs->trans('Days'), 'hour'=>$langs->trans('Hours'), 'minute'=>$langs->trans('Minutes')); + + $retstring .= '"; + + return $retstring; + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Function to show a form to select a duration on a page @@ -6378,7 +6412,7 @@ class Form * @param string $htmlname Name of select * @param array $array Array with key+value * @param array $selected Array with key+value preselected - * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" + * @param int $key_in_label 1 to show key like in "[key] value" * @param int $value_as_key 1 to use value as key * @param string $morecss Add more css style * @param int $translate Translate and encode value @@ -6404,7 +6438,7 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { - $out .= "\n".' + $out .= "\n".' | |||||||||||||||||||||||||||||||||||||||