From 73ee655dde2ef8483e8a0eb3d3f64ae17c13ef69 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Wed, 22 Jan 2020 08:13:00 +0100 Subject: [PATCH 01/26] fix minimum quantity on stock movement by fixing another issue on the batch management in the API, I introduced a bug on the stock quantity decrease. [see: X] --- htdocs/product/stock/class/api_stockmovements.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index 9951c05d323..721744d0c55 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -164,7 +164,7 @@ class StockMovements extends DolibarrApi * * @param int $product_id Id product id {@min 1} {@from body} {@required true} * @param int $warehouse_id Id warehouse {@min 1} {@from body} {@required true} - * @param float $qty Qty to add (Use negative value for a stock decrease) {@min 0} {@message qty must be higher than 0} {@from body} {@required true} + * @param float $qty Qty to add (Use negative value for a stock decrease) {@from body} {@required true} * @param string $lot Lot {@from body} * @param string $movementcode Movement code {@example INV123} {@from body} * @param string $movementlabel Movement label {@example Inventory number 123} {@from body} From 40febd27810af57d0cf68d1ffc24c61cf197f709 Mon Sep 17 00:00:00 2001 From: gti-eu <60189441+gti-eu@users.noreply.github.com> Date: Thu, 23 Jan 2020 11:48:44 +0100 Subject: [PATCH 02/26] Fix reference check on emailcollector ObjectType is on reg[1] ObjectId is on reg[2] --- .../class/emailcollector.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 7e957385e60..0844cff2057 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1243,34 +1243,34 @@ class EmailCollector extends CommonObject $objectid = 0; $objectemail = null; - if ($reg[0] == 'inv') + if ($reg[1] == 'inv') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Facture($this->db); } - if ($reg[0] == 'proj') + if ($reg[1] == 'proj') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Project($this->db); } - if ($reg[0] == 'con') + if ($reg[1] == 'con') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Contact($this->db); } - if ($reg[0] == 'thi') + if ($reg[1] == 'thi') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Societe($this->db); } - if ($reg[0] == 'use') + if ($reg[1] == 'use') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new User($this->db); } - if ($reg[0] == 'tic') + if ($reg[1] == 'tic') { - $objectid = $reg[1]; + $objectid = $reg[2]; $objectemail = new Ticket($this->db); } From 67e57b8da2fc550fd95562984517eb8dbe59e63a Mon Sep 17 00:00:00 2001 From: gti-eu <60189441+gti-eu@users.noreply.github.com> Date: Thu, 23 Jan 2020 12:53:24 +0100 Subject: [PATCH 03/26] Add trackid to Ticket message mail --- htdocs/ticket/class/ticket.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index cf1e2502676..f5132809dd1 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2753,7 +2753,8 @@ class Ticket extends CommonObject $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $receiver, $from, $message_to_send, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + $trackid = "tic".$this->id; + $mailfile = new CMailFile($subject, $receiver, $from, $message_to_send, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid); if ($mailfile->error) { setEventMessages($mailfile->error, null, 'errors'); } else { From d302f190a72b458409cbf78e35b6fa58c103fc91 Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Thu, 23 Jan 2020 13:29:28 +0100 Subject: [PATCH 04/26] Fix: strict mode mysql compatibility --- htdocs/comm/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3ce6d2f00fa..00e30b88c0f 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1047,7 +1047,7 @@ if ($object->id > 0) $sql .= " AND f.entity = ".$conf->entity; $sql .= ' GROUP BY f.rowid, f.titre, f.amount, f.total, f.tva, f.total_ttc,'; $sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,'; - $sql .= ' f.suspended,'; + $sql .= ' f.suspended, f.date_when,'; $sql .= ' s.nom, s.rowid'; $sql .= " ORDER BY f.date_last_gen, f.datec DESC"; From fd0daad9592849c21c443ff01f3774d1c7e086a4 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 16:49:06 +0100 Subject: [PATCH 05/26] fix SEPA line with limit select and working pagination --- htdocs/compta/prelevement/card.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index b7850fb8dc0..0b8a441dea2 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -63,7 +63,7 @@ $object = new BonPrelevement($db, ""); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -$hookmanager->initHooks(array('directdebitprevcard', 'globalcard')); +$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); /* * Actions @@ -362,10 +362,19 @@ if ($id > 0 || $ref) $urladd = "&id=".$id; - print_barre_liste($langs->trans("Lines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); + print '
' . "\n"; + print ''; + print ''; + if (! empty($page)) { + print ''; + } + if (! empty($limit)) { + print ''; + } + print_barre_liste($langs->trans("Lines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print ''; + print '
'; print ''; print_liste_field_titre("Lines", $_SERVER["PHP_SELF"], "pl.rowid", '', $urladd); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $urladd); @@ -375,7 +384,7 @@ if ($id > 0 || $ref) $total = 0; - while ($i < min($num, $conf->liste_limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); @@ -433,6 +442,7 @@ if ($id > 0 || $ref) print "
"; print '
'; + print '
'; $db->free($result); } From 210e0511d0fdf95e78efb4ecef2e2bf5ee0d6098 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:45:16 +0100 Subject: [PATCH 06/26] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/create.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 34da3336bcc..66dd6338c9d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -193,6 +193,7 @@ else } print "\n"; +print ''; print '
'; @@ -221,6 +222,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -236,11 +242,12 @@ if ($resql) if($socid) $param .= '&socid='.urlencode($socid); if($option) $param .= "&option=".urlencode($option); - if(! empty($page) && $num <= $nbtotalofrecords) $page = 0; - print '
'; print ''; - print ''; + print ''; + if (! empty($limit)) { + print ''; + } print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); @@ -300,6 +307,7 @@ if ($resql) } else print ''.$langs->trans("None").''; print ""; + print ''; print "
"; print "
\n"; } From 5ad5578f4059d0952fe6672c18a00c67a5ab384c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:47:00 +0100 Subject: [PATCH 07/26] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/create.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 66dd6338c9d..eec72ee4b1e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -307,7 +307,6 @@ if ($resql) } else print ''.$langs->trans("None").''; print ""; - print ''; print ""; print "
\n"; } From 62caf3cbfc1d6f1e72514a57ea6a11156c87c61c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:59:50 +0100 Subject: [PATCH 08/26] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/demandes.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 6c1ea278430..da1b3663d21 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -140,8 +140,6 @@ else $newcardbutton = ''.$langs->trans("Back").''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); - print '
'; if ($optioncss != '') print ''; print ''; @@ -152,6 +150,7 @@ print ''; print ''; print ''; +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); print ''; From 1f18c93b9f79fd1542b68e5da02de4e97b28432f Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 24 Jan 2020 12:06:22 +0100 Subject: [PATCH 09/26] FIX : thirdparty alias name desappeared if we change country with THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION conf --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3f7b97fee73..d277632c348 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -950,6 +950,7 @@ else if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); From dc3eafccb9f75e1062d3693956dfd4676b86c3a7 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 24 Jan 2020 13:22:04 +0100 Subject: [PATCH 10/26] add hook into withdraw list --- htdocs/compta/prelevement/demandes.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index d21815acfac..aa0538341e6 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -57,6 +57,16 @@ if (! $sortfield) $sortfield="f.ref"; $massactionbutton = ''; +$hookmanager->initHooks(array('withdrawalstodolist')); + + +/* + * Actions + */ + +$parameters = array('socid' => $socid, 'limit' => $limit, 'page' => $page, 'offset' => $offset); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * View @@ -142,7 +152,7 @@ $newcardbutton = ''.$lan print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); -print ''; +print ''; if ($optioncss != '') print ''; print ''; print ''; From f5395fa859bf6423e46faaa06e4db60cc1f4def1 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 24 Jan 2020 14:28:08 +0100 Subject: [PATCH 11/26] fix lost name_alias on country selection --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3f7b97fee73..d277632c348 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -950,6 +950,7 @@ else if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); From f63893a90cf4600b5436e17cf71def45e9bbd647 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 24 Jan 2020 15:10:57 +0100 Subject: [PATCH 12/26] FIX date filter not used if no operator --- htdocs/contrat/services_list.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 07b5cceee1a..93c09d7f256 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -242,9 +242,17 @@ if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract). if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; $filter_dateouvertureprevue=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); +if ($filter_dateouvertureprevue != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = '='; + $filter_date1=dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); +if ($filter_date1 != '' && $filter_op1 == -1) $filter_op1 = '='; + $filter_date2=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); +if ($filter_date2 != '' && $filter_op2 == -1) $filter_op2 = '='; + $filter_datecloture=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); +if ($filter_datecloture != '' && $filter_opcloture == -1) $filter_opcloture = '='; + if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'"; if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'"; if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; @@ -253,6 +261,8 @@ if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $sql .= $db->order($sortfield, $sortorder); +//print $sql; + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { From 4222639702d0bab73fd1a0f2576caa2a06af7a89 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 24 Jan 2020 15:32:59 +0100 Subject: [PATCH 13/26] FIX : Extrafield position in export field list must respect "pos" field --- htdocs/core/extrafieldsinexport.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 78dbba9934e..e9d10138d1e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -8,7 +8,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) } // Add extra fields -$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.')'; +$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.') ORDER BY pos ASC'; //print $sql; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) From c64acb1a9c414c577fc275e2382174b0ec5a8438 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Sat, 25 Jan 2020 15:19:46 +0100 Subject: [PATCH 14/26] Permissions Issue fixes an issue that displayed the "restricted area" banner despite user permissions. --- htdocs/compta/tva/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 8e4962a6351..8ea2de95efa 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -49,7 +49,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'tax', $id, 'vat', 'charges'); +$result = restrictedArea($user, 'tax', '', 'vat', 'charges'); // Get parameters From 68f5aee432d2ba2bae931ec18a121776cb6b9d5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jan 2020 19:38:19 +0100 Subject: [PATCH 15/26] Fix global stats for holiday --- htdocs/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 23f02ed95b3..250a0c1736b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -115,6 +115,7 @@ $boxstatFromHook = ''; // Load translation files required by page $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); +// Load global statistics of objects if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { $object = new stdClass(); @@ -201,7 +202,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'contacts', 'members', 'products', - 'services', + 'services', 'proposals', 'orders', 'invoices', @@ -212,7 +213,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'askprice', 'projects', 'expensereports', - 'holiday', + 'holidays', 'donations' ); // Dashboard Icon lines @@ -348,9 +349,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) -/* - * Dolibarr Working Board with weather - */ +// Dolibarr Working Board with weather + if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; @@ -701,6 +701,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $openedDashBoard .= ' '."\n"; $openedDashBoard .= ' '."\n"; + // Show the span for the total of record if (!empty($groupElement['globalStats'])) { $globalStatInTopOpenedDashBoard[] = $globalStatsKey; $openedDashBoard .= ' '.$nbTotal.''."\n"; From cb0986db8b645f36d004b43ec3af04d92183edb7 Mon Sep 17 00:00:00 2001 From: javierybar <36415318+javierybar@users.noreply.github.com> Date: Fri, 24 Jan 2020 09:22:46 +0100 Subject: [PATCH 16/26] TakePOS price rounding --- htdocs/takepos/receipt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 462f9a830b0..185302e3a16 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -138,7 +138,7 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME else echo $line->description;?> - + Date: Sun, 26 Jan 2020 22:12:26 +0100 Subject: [PATCH 17/26] Update receipt.php --- htdocs/takepos/receipt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 185302e3a16..8489f97c5db 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -138,8 +138,8 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME else echo $line->description;?> - - + + Date: Sun, 26 Jan 2020 22:12:52 +0100 Subject: [PATCH 18/26] Update receipt.php --- htdocs/takepos/receipt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 8489f97c5db..1ae64888095 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -138,7 +138,7 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME else echo $line->description;?> - + Date: Sun, 26 Jan 2020 23:22:47 +0100 Subject: [PATCH 19/26] FIX #12875 --- htdocs/core/tpl/objectline_create.tpl.php | 69 ++++++++++++----------- htdocs/fourn/ajax/getSupplierPrices.php | 9 +-- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 9056f3bde9d..b60c48da09c 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -670,46 +670,47 @@ if (!empty($usemargins) && $user->rights->margins->creer) var i = 0; $(data).each(function() { - if (this.id != 'pmpprice' && this.id != 'costprice') - { - i++; - this.price = parseFloat(this.price); // to fix when this.price >0 - // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0) - //console.log("id="+this.id+"-price="+this.price+"-"+(this.price > 0)); - if (bestpricefound == 0 && this.price > 0) { defaultkey = this.id; defaultprice = this.price; bestpriceid = this.id; bestpricevalue = this.price; bestpricefound=1; } // bestpricefound is used to take the first price > 0 - } - if (this.id == 'pmpprice') - { - // If margin is calculated on PMP, we set it by defaut (but only if value is not 0) - //console.log("id="+this.id+"-price="+this.price); - if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice) - { - if (this.price > 0) { - defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price; - //console.log("pmppricevalue="+pmppricevalue); - } - } - } - if (this.id == 'costprice') - { - // If margin is calculated on Cost price, we set it by defaut (but only if value is not 0) - //console.log("id="+this.id+"-price="+this.price+"-pmppricevalue="+pmppricevalue); - if ('costprice' == defaultbuyprice) - { - if (this.price > 0) { defaultkey = this.id; defaultprice = this.price; costpriceid = this.id; costpricevalue = this.price; } - else if (pmppricevalue > 0) { defaultkey = pmppriceid; defaultprice = pmppricevalue; } - } - } - options += ''; - }); - options += ''; + /* Warning: Lines must be processed in order: best supplier price, then pmpprice line then costprice */ + if (this.id != 'pmpprice' && this.id != 'costprice') + { + i++; + this.price = parseFloat(this.price); // to fix when this.price >0 + // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0) + //console.log("id="+this.id+"-price="+this.price+"-"+(this.price > 0)); + if (bestpricefound == 0 && this.price > 0) { defaultkey = this.id; defaultprice = this.price; bestpriceid = this.id; bestpricevalue = this.price; bestpricefound=1; } // bestpricefound is used to take the first price > 0 + } + if (this.id == 'pmpprice') + { + // If margin is calculated on PMP, we set it by defaut (but only if value is not 0) + console.log("id="+this.id+"-price="+this.price); + if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice) + { + if (this.price > 0) { + defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price; + //console.log("pmppricevalue="+pmppricevalue); + } + } + } + if (this.id == 'costprice') + { + // If margin is calculated on Cost price, we set it by defaut (but only if value is not 0) + console.log("id="+this.id+"-price="+this.price+"-pmppricevalue="+pmppricevalue); + if ('costprice' == defaultbuyprice) + { + if (this.price > 0) { defaultkey = this.id; defaultprice = this.price; costpriceid = this.id; costpricevalue = this.price; } + else if (pmppricevalue > 0) { defaultkey = 'pmpprice'; defaultprice = pmppricevalue; } + } + } + options += ''; + }); + options += ''; console.log("finally selected defaultkey="+defaultkey+" defaultprice="+defaultprice); $("#fournprice_predef").html(options).show(); if (defaultkey != '') { - $("#fournprice_predef").val(defaultkey); + $("#fournprice_predef").val(defaultkey); } /* At loading, no product are yet selected, so we hide field of buying_price */ diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 24c68a6aced..2d18c6ea86e 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -84,16 +84,17 @@ if ($idprod > 0) } } - // Add price for costprice - $price=$producttmp->cost_price; - $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() - + // After best supplier prices and before costprice if(!empty($conf->stock->enabled)) { // Add price for pmp $price=$producttmp->pmp; $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } + + // Add price for costprice (at end) + $price=$producttmp->cost_price; + $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } echo json_encode($prices); From ecaacc9543d023babf437bfdd4c0918f5dd8b6c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jan 2020 23:27:47 +0100 Subject: [PATCH 20/26] FIX #12875 --- htdocs/fourn/ajax/getSupplierPrices.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 85b0ed37155..495337ade14 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -84,16 +84,16 @@ if ($idprod > 0) } } - // Add price for costprice - $price=$producttmp->cost_price; - $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() - if(!empty($conf->stock->enabled)) { // Add price for pmp $price=$producttmp->pmp; $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } + + // Add price for costprice + $price=$producttmp->cost_price; + $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } echo json_encode($prices); From 6744fc4279fe42867f537e6aae406af66c428392 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 00:38:28 +0100 Subject: [PATCH 21/26] Fix takepos permissions --- htdocs/install/upgrade2.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 12d9ef9b734..dd9e3b1ed95 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -489,6 +489,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_SYSLOG'=>'newboxdefonly', 'MAIN_MODULE_SOCIETE'=>'newboxdefonly', 'MAIN_MODULE_SERVICE'=>'newboxdefonly', + 'MAIN_MODULE_TAKEPOS'=>'newboxdefonly', 'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version) 'MAIN_MODULE_VARIANTS'=>'newboxdefonly', 'MAIN_MODULE_WEBSITE'=>'newboxdefonly', @@ -4746,8 +4747,19 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->init($reloadmode); } } + elseif ($moduletoreload == 'MAIN_MODULE_TAKEPOS') // Permission has changed into 10.0 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Takepos module"); + $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modTakePos.class.php'; + if ($res) { + $mod = new modTakePos($db); + $mod->remove('noboxes'); // We need to remove because menu entries has changed + $mod->init($reloadmode); + } + } else { + $reg = array(); $tmp = preg_match('/MAIN_MODULE_([a-zA-Z0-9]+)/', $moduletoreload, $reg); if (!empty($reg[1])) { From 89e9b9391b70e7d72d1c39fbc4175ac9c52f7b0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 02:26:07 +0100 Subject: [PATCH 22/26] Fix responsive --- htdocs/takepos/admin/setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 895b82ac033..ba066241d1f 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -128,7 +128,7 @@ print ''; print ''; print ''; -print '
'; +print '
'; print '
qty;?>total_ttc/$line->qty;?>total_ttc, 'MT'), 1);?> total_ttc);?>
qty;?>total_ttc, 'MT'), 1);?>total_ttc);?>total_ttc/$line->qty, 'MT'), 1);?>total_ttc, 1);?>
qty;?>total_ttc/$line->qty, 'MT'), 1);?>total_ttc / $line->qty, 'MT'), 1);?> total_ttc, 1);?>
'; print ''; @@ -283,7 +283,7 @@ print ''; if ($conf->global->TAKEPOS_ENABLE_SUMUP) { print '
'; - print '
'; + print '
'; print '
'; print ''; From c103ff58cfcb5e0d7fd18af534b02fc4e29ad7af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 12:40:20 +0100 Subject: [PATCH 23/26] FIX update of llx_societe_account for stripe customer key. --- htdocs/societe/paymentmodes.php | 47 +++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 41bda75b2b5..1952fb8304c 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -569,30 +569,38 @@ if (empty($reshook)) $db->begin(); if (empty($newcu)) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; } else { - $sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account"; - $sql .= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."'"; - $sql .= " WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX."societe_account"; + $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! } $resql = $db->query($sql); - $num = $db->num_rows($resql); - if (empty($num) && !empty($newcu)) - { - $societeaccount = new SocieteAccount($db); - $societeaccount->fk_soc = $object->id; - $societeaccount->login = ''; - $societeaccount->pass_encoding = ''; - $societeaccount->site = 'stripe'; - $societeaccount->status = $servicestatus; - $societeaccount->key_account = $newcu; - $result = $societeaccount->create($user); - if ($result < 0) + $num = $db->num_rows($resql); // Note: $num is always 0 on an update and delete, it is defined for select only. + if (!empty($newcu)) { + if (empty($num)) { - $error++; + $societeaccount = new SocieteAccount($db); + $societeaccount->fk_soc = $object->id; + $societeaccount->login = ''; + $societeaccount->pass_encoding = ''; + $societeaccount->site = 'stripe'; + $societeaccount->status = $servicestatus; + $societeaccount->key_account = $newcu; + $societeaccount->site_account = $site_account; + $result = $societeaccount->create($user); + if ($result < 0) + { + $error++; + } + } else { + $sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account"; + $sql .= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."', site_account = '".$site_account."'"; + $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! + $resql = $db->query($sql); } } + //var_dump($sql); var_dump($newcu); var_dump($num); exit; if (!$error) { @@ -615,6 +623,8 @@ if (empty($reshook)) if (empty($newsup)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; + // TODO Add site and site_account on oauth_token table + //$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; } else { try { $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); @@ -622,6 +632,8 @@ if (empty($reshook)) $tokenstring['type'] = $stripesup->type; $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; $sql .= " SET tokenstring = '".dol_json_encode($tokenstring)."'"; + $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$site_account."') AND fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! + // TODO Add site and site_account on oauth_token table $sql .= " WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! } catch (Exception $e) { $error++; @@ -639,6 +651,7 @@ if (empty($reshook)) $tokenstring['type'] = $stripesup->type; $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, fk_soc, entity, tokenstring)"; $sql .= " VALUES ('".$service."', ".$object->id.", ".$conf->entity.", '".dol_json_encode($tokenstring)."')"; + // TODO Add site and site_account on oauth_token table } catch (Exception $e) { $error++; setEventMessages($e->getMessage(), null, 'errors'); From 90d255d3c4cd7b81c4ba4d3ade9055edf7f53ad1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 13:42:31 +0100 Subject: [PATCH 24/26] Look and feel v11 --- htdocs/public/members/new.php | 32 ++++++++++++++++++++++------ htdocs/public/payment/newpayment.php | 10 +++++---- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 75dfce81a3c..0649a937822 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -48,11 +48,11 @@ $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['ent if (is_numeric($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Init vars $errmsg = ''; @@ -96,27 +96,45 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ global $user, $conf, $langs, $mysoc; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; - // Print logo + print ''; + + // Define urllogo + $width = 0; $urllogo = DOL_URL_ROOT.'/theme/login_logo.png'; if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + $width = 150; } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - $width = 128; + $width = 150; } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $width = 150; } - print '
'; - print 'Logo'; - print '

'; + + print '
'; print '
'; } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 2e160139dec..9a9c3fff27d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -34,8 +34,9 @@ * \brief File to offer a way to make a payment for a particular Dolibarr object */ -define("NOLOGIN", 1); // This means this output page does not require to be logged. -define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. +if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip // For MultiCompany module. // Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php @@ -49,11 +50,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data + // Security check // No check on module enabled. Done later according to $validpaymentmethod -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data - $action = GETPOST('action', 'aZ09'); // Input are: From 29853b5fbd4b5b396c3203060de0a68149405ed4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 14:01:35 +0100 Subject: [PATCH 25/26] Fix responsive for public interface of tickets --- htdocs/core/lib/ticket.lib.php | 37 ++++++++++++++++++++------ htdocs/public/ticket/create_ticket.php | 2 ++ htdocs/public/ticket/index.php | 1 + htdocs/theme/eldy/global.inc.php | 5 ++-- htdocs/theme/md/style.css.php | 3 ++- htdocs/ticket/css/styles.css.php | 8 ++++-- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index fd2d56c946b..b7c741bd839 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -216,8 +216,9 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; + // Define urllogo + $width = 0; if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { - print '
'; // Print logo if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO)) { @@ -225,21 +226,41 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode('logos/thumbs/'.$mysoc->logo_small); + $width = 150; } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode('logos/'.$mysoc->logo); - $width = 128; + $width = 150; } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.png')) { $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png'; } - print 'Logo
'; } - if (! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) - { - print '' . ($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . ''; - } - print '

'; } + print '
'; + // Output html code for logo + if ($urllogo || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) + { + print '
'; + print '
'; + if ($urllogo) { + print ''; + print ''; + print ''; + } + if (! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { + print '
' . ($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . ''; + } + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + + print '
'; + print '
'; } diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index c4a3b71e6ad..b3e94d5ceb2 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -28,6 +28,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php'; @@ -53,6 +54,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); + /* * Actions */ diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 031ef2793b5..bbe831c1a84 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -25,6 +25,7 @@ if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 0f96bb15d62..fe42bcfc995 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5501,11 +5501,12 @@ div.tabsElem a.tab { width: 70%; } .publicnewticketform { - margin-top: 25px !important; + /* margin-top: 25px !important; */ } .ticketlargemargin { padding-left: 50px; padding-right: 50px; + padding-top: 10px; } @media only screen and (max-width: 767px) { @@ -5513,7 +5514,7 @@ div.tabsElem a.tab { padding-left: 5px; padding-right: 5px; } .ticketpublicarea { - width: 100%; + width: 100% !important; } } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0806cb47d1e..fe23020991f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5649,11 +5649,12 @@ border-top-right-radius: 6px; width: 70%; } .publicnewticketform { - margin-top: 25px !important; + /* margin-top: 25px !important; */ } .ticketlargemargin { padding-left: 50px; padding-right: 50px; + padding-top: 10px; } @media only screen and (max-width: 767px) { diff --git a/htdocs/ticket/css/styles.css.php b/htdocs/ticket/css/styles.css.php index 15eadf8ffb8..914a3dba119 100644 --- a/htdocs/ticket/css/styles.css.php +++ b/htdocs/ticket/css/styles.css.php @@ -146,5 +146,9 @@ div.ticketform .blue:hover { background-color: #f8f8f8; } -#form_create_ticket input.text, -#form_create_ticket textarea { width:450px;} +#form_create_ticket input.text, #form_create_ticket textarea { width:450px;} + +@media only screen and (max-width: 767px) +{ + #form_create_ticket input.text, #form_create_ticket textarea { width: unset;} +} From 5feea89a94a5df6acd3d2bd8b758d71b8b2c0a13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 14:11:40 +0100 Subject: [PATCH 26/26] Fix responsive for public interface --- htdocs/public/onlinesign/newonlinesign.php | 44 ++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index dd4845111e1..83e757b78f8 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -15,9 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For paypal test: https://developer.paypal.com/ - * For paybox test: ??? */ /** @@ -26,8 +23,9 @@ * \brief File to offer a way to make an online signature for a particular Dolibarr entity */ -define("NOLOGIN", 1); // This means this output page does not require to be logged. -define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. +if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php @@ -41,12 +39,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); + // Security check // No check on module enabled. Done later according to $validpaymentmethod -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); - -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'aZ09'); // Input are: // type ('invoice','order','contractline'), @@ -55,7 +54,7 @@ $action = GETPOST('action', 'alpha'); // tag (a free text, required if type is empty) // currency (iso code) -$suffix = GETPOST("suffix", 'alpha'); +$suffix = GETPOST("suffix", 'aZ09'); $source = GETPOST("source", 'alpha'); $ref = $REF = GETPOST("ref", 'alpha'); @@ -71,9 +70,6 @@ if (!$action) } -$paymentmethod = ''; -$validpaymentmethod = array(); - @@ -133,7 +129,8 @@ if (!empty($conf->global->MAIN_SIGN_CSS_URL)) $head = 'dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; -llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'); +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); // Check link validity if (!empty($source) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) @@ -171,23 +168,32 @@ elseif (!empty($conf->global->ONLINE_SIGN_LOGO)) $logosmall = $conf->global->ONL //print ''."\n"; // Define urllogo $urllogo = ''; +$urllogofull = ''; if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $width = 150; } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $width = 96; + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $width = 150; } // Output html code for logo if ($urllogo) { - print '
'; - print ''; - print ''."\n"; + print '>'; + print ''; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print ''; } // Output introduction text @@ -209,7 +215,7 @@ print $text; // Output payment summary form print '
'; + print '
'; + print '
'; print ''; -print ''."\n"; +print ''."\n"; $found = false; $error = 0;
'.$langs->trans("ThisIsInformationOnDocumentToSign").' :
'.$langs->trans("ThisIsInformationOnDocumentToSign").' :