diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index b4d5b6807f8..0c9b4113c2a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1027,6 +1027,12 @@ class BookKeeping extends CommonObject $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); + } elseif ($key == 't.code_journal' && !empty($value)) { + if (is_array($value)) { + $sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1); + } else { + $sqlwhere[] = natural_search("t.code_journal", $value, 3, 1); + } } else { $sqlwhere[] = natural_search($key, $value, 0, 1); } diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index c0c6b45464f..4c1df0fa938 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -47,7 +47,7 @@ $error = 0; */ // Action to update or add a constant -if ($action == 'settemplates') { +if ($action == 'settemplates' && $user->admin) { $db->begin(); if (!$error && is_array($_POST)) { @@ -192,7 +192,8 @@ print "\n"; print ''; print $langs->trans("NotificationEMailFrom").''; print ''; -print ''; +print img_picto('', 'email', 'class="pictofixedwidth"'); +print ''; if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) { print ' '.img_warning($langs->trans("ErrorBadEMail")); } @@ -270,7 +271,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { } $helptext = ''; - form_constantes($constantes, 3, $helptext); + form_constantes($constantes, 3, $helptext, 'EmailTemplate'); + + print '
'; + print '* '.$langs->trans("GoOntoUserCardToAddMore").'
'; + if (!empty($conf->societe->enabled)) { + print '** '.$langs->trans("GoOntoContactCardToAddMore").'
'; + } + print '
'; print '
'; } else { @@ -316,15 +324,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ''; print ''; -} - -print '
'; -print '* '.$langs->trans("GoOntoUserCardToAddMore").'
'; -if (!empty($conf->societe->enabled)) { - print '** '.$langs->trans("GoOntoContactCardToAddMore").'
'; + print '
'; + print '* '.$langs->trans("GoOntoUserCardToAddMore").'
'; + if (!empty($conf->societe->enabled)) { + print '** '.$langs->trans("GoOntoContactCardToAddMore").'
'; + } + print '
'; } -print '
'; print ''; @@ -335,6 +342,7 @@ print '

'; print '
'; print ''; print ''; +print ''; print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', ''); @@ -376,6 +384,12 @@ foreach ($listofnotifiedevents as $notifiedevent) { $elementLabel = $langs->trans('ExpenseReport'); } + $labelfortrigger = 'AmountHT'; + $codehasnotrigger = 0; + if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) { + $codehasnotrigger++; + } + print ''; print ''; print img_picto('', $elementPicto, 'class="pictofixedwidth"'); @@ -384,6 +398,7 @@ foreach ($listofnotifiedevents as $notifiedevent) { print ''.$notifiedevent['code'].''; print ''.$label.''; print ''; + $inputfieldalreadyshown = 0; // Notification with threshold foreach ($conf->global as $key => $val) { if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) { @@ -407,24 +422,35 @@ foreach ($listofnotifiedevents as $notifiedevent) { } print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'
'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2); print '
'; + + $inputfieldalreadyshown++; } // New entry input fields - $s = ''; // Do not use type="email" here, we must be able to enter a list of email with , separator. - print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'
'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2); + if (empty($inputfieldalreadyshown) || !$codehasnotrigger) { + $s = ''; // Do not use type="email" here, we must be able to enter a list of email with , separator. + print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'
'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2); + } print ''; print ''; // Notification with threshold + $inputfieldalreadyshown = 0; foreach ($conf->global as $key => $val) { if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) { continue; } - print $langs->trans("AmountHT").' >= '; - print '
'; + if (!$codehasnotrigger) { + print $langs->trans($labelfortrigger).' >= '; + print '
'; + + $inputfieldalreadyshown++; + } } // New entry input fields - print $langs->trans("AmountHT").' >= '; + if (!$codehasnotrigger) { + print $langs->trans($labelfortrigger).' >= '; + } print ''; print ''; @@ -437,7 +463,7 @@ print ''; print '
'; -print '
'; +print '
'; print '
'; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 8368bffbab2..5a93f3fde33 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; // Load translation files required by the page $langs->loadLangs(array('products', 'contracts', 'companies')); +$optioncss = GETPOST('optioncss', 'aZ09'); + $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -58,7 +60,6 @@ $search_name = GETPOST("search_name", 'alpha'); $search_contract = GETPOST("search_contract", 'alpha'); $search_service = GETPOST("search_service", 'alpha'); $search_status = GETPOST("search_status", 'alpha'); -$statut = GETPOST('statut', 'int') ?GETPOST('statut', 'int') : 1; $search_product_category = GETPOST('search_product_category', 'int'); $socid = GETPOST('socid', 'int'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contractservicelist'.$mode; @@ -412,16 +413,16 @@ if (!empty($filter_op2) && $filter_op2 != -1) { if (!empty($filter_opcloture) && $filter_opcloture != -1) { $param .= '&filter_opcloture='.urlencode($filter_opcloture); } -if ($filter_dateouvertureprevue != '') { +if ($filter_dateouvertureprevue_start != '') { $param .= '&opouvertureprevueday='.$opouvertureprevueday.'&opouvertureprevuemonth='.$opouvertureprevuemonth.'&opouvertureprevueyear='.$opouvertureprevueyear; } -if ($filter_date1 != '') { +if ($filter_date1_start != '') { $param .= '&op1day='.$op1day.'&op1month='.$op1month.'&op1year='.$op1year; } -if ($filter_date2 != '') { +if ($filter_date2_start != '') { $param .= '&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; } -if ($filter_datecloture != '') { +if ($filter_datecloture_start != '') { $param .= '&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; } if ($optioncss != '') { diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 2e0a71460ba..bb37293354e 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -515,7 +515,7 @@ class Notify case 'SHIPPING_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment'); - $object_type = 'expedition'; + $object_type = 'shipping'; $labeltouse = $conf->global->SHIPPING_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 683b92fb8d9..ef5b3eab061 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1528,10 +1528,11 @@ function complete_elementList_with_modules(&$elementList) * @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label) * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) - * @param string $helptext Help + * @param string $helptext Tooltip help to use for the column name of values + * @param string $text Text to use for the column name of values * @return void */ -function form_constantes($tableau, $strictw3c = 0, $helptext = '') +function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Value') { global $db, $langs, $conf, $user; global $_Avery_Labels; @@ -1552,7 +1553,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ''; print ''.$langs->trans("Description").''; print ''; - $text = $langs->trans("Value"); + $text = $langs->trans($text); print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext'); print ''; if (empty($strictw3c)) { diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 54bbc0a7666..12022ed178c 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/lib/barcode.lib.php - * \brief Set of functions used for barcode generation + * \brief Set of functions used for barcode generation (internal lib, also code 'phpbarcode') * \ingroup core */ @@ -69,7 +69,7 @@ if (defined('PHP-BARCODE_PATH_COMMAND')) { * Print barcode * * @param string $code Code - * @param string $encoding Encoding + * @param string $encoding Encoding ('EAN13', 'ISBN', 'C128', 'UPC', 'CBR', 'QRCODE', 'DATAMATRIX', 'ANY'...) * @param integer $scale Scale * @param string $mode 'png' or 'jpg' ... * @return array|string $bars array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info) or string with error message @@ -149,12 +149,10 @@ function barcode_encode($code, $encoding) dol_syslog("barcode.lib.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding); $bars = barcode_encode_genbarcode($code, $encoding); } else { - print "barcode_encode needs an external programm for encodings other then EAN/ISBN (code=".$code.", encoding=".$encoding.")
\n"; + print "barcode_encode needs an external program for encodings other then EAN/ISBN (code=".dol_escape_htmltag($code).", encoding=".dol_escape_htmltag($encoding).")
\n"; print "\n"; print "
\n"; diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index fe36f7604c2..443e3f436f8 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/modules/barcode/doc/phpbarcode.modules.php * \ingroup barcode - * \brief File with class to generate barcode images using php barcode generator + * \brief File with class to generate barcode images using php internal lib barcode generator */ require_once DOL_DOCUMENT_ROOT.'/core/modules/barcode/modules_barcode.class.php'; @@ -126,7 +126,7 @@ class modPhpbarcode extends ModeleBarCode * * @param string $code Value to encode * @param string $encoding Mode of encoding - * @param string $readable Code can be read + * @param string $readable Code can be read (What is this ? is this used ?) * @param integer $scale Scale * @param integer $nooutputiferror No output if error * @return int <0 if KO, >0 if OK @@ -163,7 +163,7 @@ class modPhpbarcode extends ModeleBarCode if (!is_array($result)) { $this->error = $result; if (empty($nooutputiferror)) { - print $this->error; + print dol_escape_htmltag($this->error); } return -1; } diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index df9ec39546d..ed32667a67e 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -100,7 +100,7 @@ class modTcpdfbarcode extends ModeleBarCode * * @param string $code Value to encode * @param string $encoding Mode of encoding - * @param string $readable Code can be read + * @param string $readable Code can be read (What is this ? is this used ?) * @param integer $scale Scale (not used with this engine) * @param integer $nooutputiferror No output if error (not used with this engine) * @return int <0 if KO, >0 if OK diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5c29d9a31a0..14475095dab 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1372,7 +1372,7 @@ AccountCodeManager=Options for automatic generation of customer/vendor accountin NotificationsDesc=Email notifications can be sent automatically for some Dolibarr events.
Recipients of notifications can be defined: NotificationsDescUser=* per user, one user at a time. NotificationsDescContact=* per third-party contacts (customers or vendors), one contact at a time. -NotificationsDescGlobal=* or by setting global email addresses in this setup page. +NotificationsDescGlobal=* or by setting global email addresses in the setup page of the module. ModelModules=Document Templates DocumentModelOdt=Generate documents from OpenDocument templates (.ODT / .ODS files from LibreOffice, OpenOffice, KOffice, TextEdit,...) WatermarkOnDraft=Watermark on draft document diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 3acad0ac0c3..73c9d817ae8 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -226,13 +226,14 @@ if ($result > 0) { // List of notifications enabled for contacts $sql = "SELECT n.rowid, n.type,"; $sql .= " a.code, a.label,"; - $sql .= " c.rowid as userid, c.lastname, c.firstname, c.email"; + $sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql .= " ".MAIN_DB_PREFIX."notify_def as n,"; $sql .= " ".MAIN_DB_PREFIX."user c"; $sql .= " WHERE a.rowid = n.fk_action"; $sql .= " AND c.rowid = n.fk_user"; $sql .= " AND c.rowid = ".$object->id; + $sql .= " AND c.entity IN (".getEntity('user').')'; $resql = $db->query($sql); if ($resql) { @@ -311,6 +312,9 @@ if ($result > 0) { $userstatic->id = $obj->userid; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->email; + $userstatic->statut = $obj->status; + print ''.$userstatic->getNomUrl(1); if ($obj->type == 'email') { if (isValidEmail($obj->email)) { diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index e01bad39d77..9c584f5b8bb 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -282,10 +282,14 @@ if (preg_match('/\.\./', $fullpath_original_file) || preg_match('/[<>|]/', $full if ($modulepart == 'barcode') { - $generator = GETPOST("generator", "alpha"); - $code = GETPOST("code", 'none'); // This can be rich content (qrcode, datamatrix, ...) - $encoding = GETPOST("encoding", "alpha"); - $readable = GETPOST("readable", 'alpha') ?GETPOST("readable", "alpha") : "Y"; + $generator = GETPOST("generator", "aZ09"); + $encoding = GETPOST("encoding", "aZ09"); + $readable = GETPOST("readable", 'aZ09') ? GETPOST("readable", "aZ09") : "Y"; + if (in_array($encoding, array('EAN8', 'EAN13'))) { + $code = GETPOST("code", 'alphanohtml'); + } else { + $code = GETPOST("code", 'none'); // This can be rich content (qrcode, datamatrix, ...) + } if (empty($generator) || empty($encoding)) { print 'Error: Parameter "generator" or "encoding" not defined';