diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index cdc70cf0cd1..5a75fdbae2e 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -99,7 +99,7 @@ class Subscription extends CommonObject 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>20), 'fk_adherent' =>array('type'=>'integer', 'label'=>'Member', 'enabled'=>1, 'visible'=>-1, 'position'=>25), 'dateadh' =>array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'datef' =>array('type'=>'date', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'datef' =>array('type'=>'datetime', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35), 'subscription' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'position'=>40, 'isameasure'=>1), 'fk_bank' =>array('type'=>'integer', 'label'=>'BankId', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'note' =>array('type'=>'text', 'label'=>'Note', 'enabled'=>1, 'visible'=>-1, 'position'=>50), diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 56d77aa22c9..17b1307fb89 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -440,7 +440,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on $s .= ''."\n"; // Local calendar - $s .= '
'.$langs->trans("LocalAgenda").'  
'; + $s .= '
'.$langs->trans("LocalAgenda").'  
'; // External calendars if (is_array($showextcals) && count($showextcals) > 0) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 29ccbde0f02..96c99ebba36 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -319,6 +319,10 @@ class FormMail extends Form // phpcs:enable global $conf, $langs, $user, $hookmanager, $form; + // Required to show preview of mail attachments + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new Formfile($this->db); + if (!is_object($form)) $form = new Form($this->db); // Load translation files required by the page @@ -845,7 +849,10 @@ class FormMail extends Form foreach ($listofpaths as $key => $val) { $out .= '
'; + // Preview of attachment + preg_match('#^(/)(\w+)(/)(.+)$#', substr($val, (strlen(DOL_DATA_ROOT)-strlen($val))), $formfile_params); $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); if (!$this->withfilereadonly) { $out .= ' '; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index a8654f6bfc5..8dcd4965c65 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -987,12 +987,12 @@ class FormTicket print ''; } - // MESSAGE - $defaultmessage = ""; - if (is_array($arraydefaultmessage) && count($arraydefaultmessage) > 0 && $arraydefaultmessage->content) { + // MESSAGE + $defaultmessage=""; + if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) { $defaultmessage = $arraydefaultmessage->content; } - $defaultmessage = str_replace('\n', "\n", $defaultmessage); + $defaultmessage = str_replace('\n', "\n", $defaultmessage); // Deal with format differences between message and signature (text / HTML) if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3f6e8563a50..f9849cded57 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1408,7 +1408,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $langs->load("mails"); $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; - $sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id"; + $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8f1f54edaa1..119a981891c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7474,23 +7474,6 @@ function printCommonFooter($zone = 'private') print '});'."\n"; - // Google Analytics - // TODO Add a hook here - if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) - { - print "\n"; - print "/* JS CODE TO ENABLE for google analtics tag */\n"; - print ' var _gaq = _gaq || [];'."\n"; - print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n"; - print ' _gaq.push([\'_trackPageview\']);'."\n"; - print ''."\n"; - print ' (function() {'."\n"; - print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n"; - print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n"; - print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n"; - print ' })();'."\n"; - } - // End of tuning if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) || !empty($conf->global->MAIN_SHOW_TUNING_INFO)) { @@ -7519,6 +7502,28 @@ function printCommonFooter($zone = 'private') } print "\n".''."\n"; + + // Google Analytics + // TODO Add a hook here + if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) + { + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "\n"; + print " + + + "; + print "\n"; + } + } } // Add Xdebug coverage of code diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index dbd26cc1f75..df2b1a086c8 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -410,7 +410,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $langs->load("mails"); $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; - $sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id"; + $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname"; diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index b3fa0dfb023..f0d380c58b7 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -763,7 +763,8 @@ function getSocialNetworkSharingLinks() // Reddit $out .= '
'."\n"; $out .= ''; - $out .= ''; + $out .= ''; + $out .= ''; $out .= '
'."\n"; // Facebook diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index d3b1c56b054..31c7a136aac 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -220,7 +220,7 @@ class modContrat extends DolibarrModules */ public function init($options = '') { - global $conf; + global $conf, $langs; // Nettoyage avant activation $this->remove($options); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 5d2374a9f60..6f2ca762a7c 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -334,23 +334,25 @@ if (!empty($morelogincontent) && is_array($morelogincontent)) { echo $moreloginextracontent; } -// Google Analytics (need Google module) +// Google Analytics +// TODO Add a hook here if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { - if (empty($conf->dol_use_jmobile)) - { + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "\n"; + print " + + + "; print "\n"; - print ''."\n"; } } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 1e90b04fba7..742a7862100 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -272,13 +272,19 @@ if ($line->special_code == 3) { ?> $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht); $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva); if (!$senderissupplier && is_object($object->thirdparty)) { - if ($object->thirdparty->useLocalTax(1)) { - if (price2num($line->total_localtax1)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); - else $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + if ($mysoc->useLocalTax(1)) { + if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(1)) { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); + } else { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + } } - if ($object->thirdparty->useLocalTax(1)) { - if (price2num($line->total_localtax2)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); - else $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + if ($mysoc->useLocalTax(2)) { + if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(2)) { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); + } else { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + } } } $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc); diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index ad62ad43686..4a37ea8ab3e 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -205,7 +205,13 @@ if (!empty($morelogincontent)) {
- + +global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; + +if (!empty($morelogincontent) && is_array($morelogincontent)) { foreach ($morelogincontent as $format => $option) { if ($format == 'js') { @@ -217,8 +223,53 @@ if (!empty($morelogincontent)) { echo ''; echo $moreloginextracontent; } + +// Google Analytics +// TODO Add a hook here +if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) +{ + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "\n"; + print " + + + "; + print "\n"; + } +} + +// Google Adsense +if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) +{ + if (empty($conf->dol_use_jmobile)) + { + ?> +

+ + +
+ + diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1e0e64fb695..3e5f0ddb8af 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; } if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index ab9d8bc858a..d4f4a9a645b 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -46,4 +46,7 @@ UPDATE llx_establishment SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_establishment MODIFY COLUMN ref varchar(30) NOT NULL; ALTER TABLE llx_establishment MODIFY COLUMN name varchar(128); -INSERT INTO llx_const (rowid, name, entity, value, type, visible, note, tms) VALUES (NULL, 'PRODUCT_PRICE_BASE_TYPE', '1', 'HT', 'string', '0', NULL, CURRENT_TIMESTAMP); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('PRODUCT_PRICE_BASE_TYPE', '0', 'HT', 'string', '0', NULL); + +ALTER TABLE llx_subscription MODIFY COLUMN datef DATETIME; + diff --git a/htdocs/install/mysql/tables/llx_subscription.sql b/htdocs/install/mysql/tables/llx_subscription.sql index a3562f12c57..03d24c68f6e 100644 --- a/htdocs/install/mysql/tables/llx_subscription.sql +++ b/htdocs/install/mysql/tables/llx_subscription.sql @@ -24,7 +24,7 @@ create table llx_subscription fk_adherent integer, fk_type integer, dateadh datetime, - datef date, + datef datetime, subscription double(24,8), fk_bank integer DEFAULT NULL, fk_user_creat integer DEFAULT NULL, diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 010a7521846..760ff884fa0 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -43,3 +43,5 @@ ProductQtyInSuppliersReceptionAlreadyRecevied=Product quantity from open supplie ValidateOrderFirstBeforeReception=You must first validate the order before being able to make receptions. ReceptionsNumberingModules=Numbering module for receptions ReceptionsReceiptModel=Document templates for receptions +NoMorePredefinedProductToDispatch=No more predefined products to dispatch + diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index be786a3b20a..cfb30f066c9 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -713,7 +713,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', $notnull = ($obj->Null == 'YES' ? 0 : 1); if ($fieldname == 'fk_user_modif') $notnull = -1; // label - $label = preg_replace('/_/', ' ', ucfirst($fieldname)); + $label = preg_replace('/_/', '', ucfirst($fieldname)); if ($fieldname == 'rowid') $label = 'TechnicalID'; if ($fieldname == 'import_key') $label = 'ImportId'; if ($fieldname == 'fk_soc') $label = 'ThirdParty'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3a7f94f4f84..c6f1e44f113 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3766,7 +3766,6 @@ class Societe extends CommonObject elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; elseif ($localTaxNum == 2) $sql .= " AND t.localtax2_type <> '0'"; - dol_syslog("useLocalTax", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 54e5de37a5c..49b99daf280 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -95,8 +95,8 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_ADDON".$terminaltouse, GETPOST('TAKEPOS_ADDON'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity); // add free text on each terminal of cash desk - $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'restricthtml'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'restricthtml'), 'chaine', 0, '', $conf->entity); dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 28ed396bac3..df3ed9987d8 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -155,6 +155,9 @@ input[name=duration_value] input[type=submit], input[type=submit]:hover { margin-left: 5px; } +input[type=checkbox], input[type=radio] { + margin: 0 3px 0 3px; +} input, input.flat, form.flat select, select, select.flat, .dataTables_length label select { border: none; } diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index b77dc86765c..2286f19e355 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -124,7 +124,7 @@ div.mainmenu.tools::before { } div.mainmenu.website::before { - content: "\f542"; + content: "\f57d"; } div.mainmenu.generic1::before { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e2607ef1d09..4555884c536 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2364,8 +2364,9 @@ class Ticket extends CommonObject // If destination file already exists, we add a suffix to avoid to overwrite if (is_file($destfile)) { + $pathinfo = pathinfo($filename[$i]); $now = dol_now(); - $destfile .= '.'.dol_print_date($now, 'dayhourlog'); + $destfile = $destdir.'/'.$pathinfo['filename'].' - '.dol_print_date($now, 'dayhourlog').'.'.$pathinfo['extension']; } $res = dol_move($filepath[$i], $destfile, 0, 1);