From 55410a55ef0f83f294783275fb6d12350746b592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 4 Oct 2019 00:45:57 +0200 Subject: [PATCH 01/41] Update list.php --- htdocs/expensereport/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 0014cb7999c..699276ed683 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -272,7 +272,7 @@ $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.tota $sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,"; $sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo"; // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +foreach ($extralabels as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook From 37f6aa3395316006f239a1dceec8ebc718960552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Oct 2019 15:52:33 +0200 Subject: [PATCH 02/41] Update list.php --- htdocs/expensereport/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 699276ed683..db36aacf542 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -272,7 +272,7 @@ $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.tota $sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,"; $sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo"; // Add fields from extrafields -foreach ($extralabels as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +foreach ($extrafields->attributes['expensereport']['type'] as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook From 8c024b3786eb34537fd7c662063fd9dd3dee4419 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 7 Oct 2019 11:26:10 +0200 Subject: [PATCH 03/41] FIX : missing "$this->id" in "fetch" function --- htdocs/core/class/link.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 8413725ab11..db2c1009a3f 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -334,6 +334,7 @@ class Link extends CommonObject if($this->db->num_rows($resql) > 0) { $obj = $this->db->fetch_object($resql); + $this->id = $obj->rowid; $this->entity = $obj->entity; $this->datea = $this->db->jdate($obj->datea); $this->url = $obj->url; From 2b9be13a7cd38906edf0d3ce40bbfdcd6fc06e6e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 9 Oct 2019 15:26:55 +0200 Subject: [PATCH 04/41] Update card.php --- htdocs/product/card.php | 60 ++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index ef144c10e0d..22a8af0d270 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -17,6 +17,7 @@ * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -297,16 +298,18 @@ if (empty($reshook)) $object->duration_unit = $duration_unit; $object->fk_default_warehouse = GETPOST('fk_default_warehouse'); $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0; - $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; + $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; $object->canvas = GETPOST('canvas'); + $object->net_measure = GETPOST('net_measure'); + $object->net_measure_units = GETPOST('net_measure_units'); // This is not the fk_unit but the power of unit $object->weight = GETPOST('weight'); $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit $object->length = GETPOST('size'); $object->length_units = GETPOST('size_units'); // This is not the fk_unit but the power of unit $object->width = GETPOST('sizewidth'); $object->height = GETPOST('sizeheight'); - $object->surface = GETPOST('surface'); - $object->surface_units = GETPOST('surface_units'); // This is not the fk_unit but the power of unit + $object->surface = GETPOST('surface'); + $object->surface_units = GETPOST('surface_units'); // This is not the fk_unit but the power of unit $object->volume = GETPOST('volume'); $object->volume_units = GETPOST('volume_units'); // This is not the fk_unit but the power of unit $object->finished = GETPOST('finished', 'alpha'); @@ -403,6 +406,8 @@ if (empty($reshook)) $object->duration_unit = GETPOST('duration_unit', 'alpha'); $object->canvas = GETPOST('canvas'); + $object->net_measure = GETPOST('net_measure'); + $object->net_measure_units = GETPOST('net_measure_units'); // This is not the fk_unit but the power of unit $object->weight = GETPOST('weight'); $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit $object->length = GETPOST('size'); @@ -1053,13 +1058,20 @@ else $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1); print ''; + + // Net Measure + print ''.$langs->trans("NetMeasure").''; + print ''; + print $formproduct->selectMeasuringUnits("net_measure_units", "net_measure", GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); + print ''; - // Weight + // Brut Weight print ''.$langs->trans("Weight").''; print ''; print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units')?GETPOST('weight_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); print ''; - // Length + + // Brut Length if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; @@ -1071,7 +1083,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { - // Surface + // Brut Surface print ''.$langs->trans("Surface").''; print ''; print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units')?GETPOST('surface_units', 'alpha'):'0', 0, 2); @@ -1079,7 +1091,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { - // Volume + // Brut Volume print ''.$langs->trans("Volume").''; print ''; print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units')?GETPOST('volume_units', 'alpha'):'0', 0, 2); @@ -1426,15 +1438,22 @@ else $statutarray=array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); print $form->selectarray('finished', $statutarray, $object->finished); print ''; + + // Net Measure + print ''.$langs->trans("NetMeasure").''; + print ' '; + print $form->selectUnits($object->net_measure_units, 'units'); + //print $formproduct->selectMeasuringUnits("net_measure_units", "weight", $object->net_measure_units, 0, 2); + print ''; - // Weight + // Brut Weight print ''.$langs->trans("Weight").''; print ' '; print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2); print ''; if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { - // Length + // Brut Length print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; print 'x'; print 'x'; @@ -1444,7 +1463,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { - // Surface + // Brut Surface print ''.$langs->trans("Surface").''; print ' '; print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2); @@ -1452,7 +1471,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { - // Volume + // Brut Volume print ''.$langs->trans("Volume").''; print ' '; print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2); @@ -1833,8 +1852,19 @@ else print ''.$langs->trans("Nature").''; print $object->getLibFinished(); print ''; + + // Net Measure + print ''.$langs->trans("NetMeasure").''; + if ($object->net_measure != '') + { + print $object->net_measure." ".measuring_units_string(0, "weight", $object->net_measure_units); + } + else + { + print ' '; + } - // Weight + // Brut Weight print ''.$langs->trans("Weight").''; if ($object->weight != '') { @@ -1847,7 +1877,7 @@ else print "\n"; if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { - // Length + // Brut Length print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; if ($object->length != '' || $object->width != '' || $object->height != '') { @@ -1864,7 +1894,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { - // Surface + // Brut Surface print ''.$langs->trans("Surface").''; if ($object->surface != '') { @@ -1878,7 +1908,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { - // Volume + // Brut Volume print ''.$langs->trans("Volume").''; if ($object->volume != '') { From 04dc9e957f1dfc1f049b97d8fc5a89ebd1f99841 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 9 Oct 2019 16:33:57 +0200 Subject: [PATCH 05/41] Update new LDCompta Export --- .../class/accountancyexport.class.php | 202 +++++++++++------- 1 file changed, 121 insertions(+), 81 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index dac238f97d6..f90d5797d09 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -926,91 +926,131 @@ class AccountancyExport * * @return void */ - public function exportLDCompta($objectLines) - { + public function exportLDCompta($objectLines) + { - $separator = ';'; - $end_line = "\n"; + $separator = ';'; + $end_line = "\r\n"; - foreach ($objectLines as $line) { + foreach ($objectLines as $line) { - $date_document = dol_print_date($line->doc_date, '%Y%m%d'); - $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); + $date_document = dol_print_date($line->doc_date, '%Y%m%d'); + $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); - // TYPE - $type_enregistrement = 'E'; // For write movement - print $type_enregistrement . $separator; - // JNAL - print substr($line->code_journal, 0, 2) . $separator; - // NECR - print $line->id . $separator; - // NPIE - print $line->piece_num . $separator; - // DATP - print $date_document . $separator; - // LIBE - print $line->label_operation . $separator; - // DATH - print $line->date_lim_reglement . $separator; - // CNPI - if ($line->doc_type == 'supplier_invoice') { - if ($line->montant < 0) { - $nature_piece = 'AF'; - } else { - $nature_piece = 'FF'; - } - } elseif ($line->doc_type == 'customer_invoice') { - if ($line->montant < 0) { - $nature_piece = 'AC'; - } else { - $nature_piece = 'FC'; - } - } else { - $nature_piece = ''; - } - print $nature_piece . $separator; - // RACI - /* - if (! empty($line->subledger_account)) { - if ($line->doc_type == 'supplier_invoice') { - $racine_subledger_account = '40'; - } elseif ($line->doc_type == 'customer_invoice') { - $racine_subledger_account = '41'; - } else { - $nature_piece = ''; - } - print $racine_subledger_account . $separator; - } else { - print $separator; - } - */ - // MONT - print price(abs($line->montant)) . $separator; - // CODC - print $line->sens . $separator; - // CPTG - print length_accountg($line->numero_compte) . $separator; - // DATE - print $date_creation . $separator; - // CLET - print $line->lettering_code . $separator; - // DATL - print $line->date_lettering . $separator; - // CPTA - if (! empty($line->subledger_account)) { - print length_accounta($line->subledger_account) . $separator; - } - // CNAT - if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) { - print 'F'; - } elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) { - print 'C'; - } else { - print ''; - } - print $end_line; - } - } + // TYPE + $type_enregistrement = 'E'; // For write movement + print $type_enregistrement . $separator; + // JNAL + print substr($line->code_journal, 0, 2) . $separator; + // NECR + print $line->id . $separator; + // NPIE + print $line->piece_num . $separator; + // DATP + print $date_document . $separator; + // LIBE + print $line->label_operation . $separator; + // DATH + print $line->date_lim_reglement . $separator; + // CNPI + if ($line->doc_type == 'supplier_invoice') { + if ($line->montant < 0) { + $nature_piece = 'AF'; + } else { + $nature_piece = 'FF'; + } + } elseif ($line->doc_type == 'customer_invoice') { + if ($line->montant < 0) { + $nature_piece = 'AC'; + } else { + $nature_piece = 'FC'; + } + } else { + $nature_piece = ''; + } + print $nature_piece . $separator; + // RACI + /* + if (! empty($line->subledger_account)) { + if ($line->doc_type == 'supplier_invoice') { + $racine_subledger_account = '40'; + } elseif ($line->doc_type == 'customer_invoice') { + $racine_subledger_account = '41'; + } else { + $nature_piece = ''; + } + print $racine_subledger_account . $separator; + } else { + print $separator; + } + */ + print $separator; // deprecated CPTG & CPTA use instead + // MONT + print price(abs($line->montant), 0, '', 1, 2) . $separator; + // CODC + print $line->sens . $separator; + // CPTG + print length_accountg($line->numero_compte) . $separator; + // DATE + print $date_creation . $separator; + // CLET + print $line->lettering_code . $separator; + // DATL + print $line->date_lettering . $separator; + // CPTA + if (! empty($line->subledger_account)) { + print length_accounta($line->subledger_account) . $separator; + } else { + print $separator; + } + // CNAT + if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) { + print 'F' . $separator; + } elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) { + print 'C' . $separator; + } else { + print $separator; + } + // SECT + print $separator; + // CTRE + print $separator; + // NORL + print $separator; + // DATV + print $separator; + // REFD + print $line->doc_ref . $separator; + // CODH + print $separator; + // NSEQ + print $separator; + // MTDV + print '0' . $separator; + // CODV + print $separator; + // TXDV + print '0' . $separator; + // MOPM + print $separator; + // BONP + print $separator; + // BQAF + print $separator; + // ECES + print $separator; + // TXTL + print $separator; + // ECRM + print $separator; + // DATK + print $separator; + // HEUK + print $separator; + + print $end_line; + } + } /** * Export format : Charlemagne From 0c8331b6d798eb83a1ad3c05059dcc0c79803102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Oct 2019 18:47:25 +0200 Subject: [PATCH 06/41] doxygen --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e4140357370..adf00d69d82 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3506,7 +3506,7 @@ class Facture extends CommonInvoice * @param int $offset For pagination * @param string $sortfield Sort criteria * @param string $sortorder Sort order - * @return int -1 if KO, array with result if OK + * @return array|int -1 if KO, array with result if OK */ function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') { @@ -3577,7 +3577,7 @@ class Facture extends CommonInvoice * (Status validated or abandonned for a reason 'other') + not payed + no payment at all + not already replaced * * @param int $socid Id thirdparty - * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + * @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ function list_replacable_invoices($socid=0) { From 6f7e4fd15c9f8919d43c701638a4a0ba1895324d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Oct 2019 22:02:58 +0200 Subject: [PATCH 07/41] Update list.php --- htdocs/holiday/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 1854cce2800..882f59dbee6 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2018 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -273,7 +274,9 @@ $sql.= " ua.login as validator_login,"; $sql.= " ua.statut as validator_statut,"; $sql.= " ua.photo as validator_photo"; // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +if (! empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +} // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook From 6bb14bdb0c4d36e7f849ffc5f1ad3a91e2fe8e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Oct 2019 22:07:52 +0200 Subject: [PATCH 08/41] Update list.php --- htdocs/expensereport/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index daadfa913ec..2b4a2a9a983 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -7,6 +7,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -279,7 +280,9 @@ $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.tota $sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,"; $sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo"; // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +if (! empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +} // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook From d4757a0b5be7220ee35f015943d4c4c871764e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Oct 2019 23:20:15 +0200 Subject: [PATCH 09/41] globe fontawesome --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ded274a8683..7c907885d27 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3032,7 +3032,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', 'bookmark', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top', 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic', @@ -3126,11 +3126,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (preg_match('/selected/', $pictowithouttext)) $facolor = '#888'; $marginleftonlyshort = 1; } - elseif ($pictowithouttext == 'sign-out') { + elseif ($pictowithouttext == 'sign-out') { $fakey = 'fa-sign-out-alt'; $marginleftonlyshort=0; } - elseif ($pictowithouttext == 'unlink') { + elseif ($pictowithouttext == 'unlink') { $fakey = 'fa-chain-broken'; $facolor = '#555'; } From 43c7917108097c0d504e4546786e80930a03d77b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Oct 2019 23:59:12 +0200 Subject: [PATCH 10/41] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4536cdc5bbd..56ad1f9481f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -684,7 +684,7 @@ class CommandeFournisseur extends CommonOrder $billedtext = ' - '.$langs->trans("Billed"); } - $statusLong = $langs->trans($this->statuts_long[$status]).$billedtext; + $statusLong = $langs->trans($this->statuts[$status]).$billedtext; $statusShort = $langs->trans($this->statutshort[$status]); return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); From 90257dc08714c6e8317ac8d6efd9daa48160e2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Oct 2019 08:09:39 +0200 Subject: [PATCH 11/41] Update box_factures_imp.php --- htdocs/core/boxes/box_factures_imp.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 494950927a9..3c4ba1c9736 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,6 +82,8 @@ class box_factures_imp extends ModeleBoxes $facturestatic = new Facture($this->db); $societestatic = new Societe($this->db); + $langs->load("bills"); + $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $max)); if ($user->rights->facture->lire) From be005767174c10c171b8f4b3c8abb50a971829b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Oct 2019 08:22:14 +0200 Subject: [PATCH 12/41] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ded274a8683..b0dc822bb56 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3031,7 +3031,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', 'bookmark', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', + 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top', @@ -3046,7 +3046,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', - 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'bookmark'=>'star', + 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'bookmark'=>'star', 'stats' => 'chart-bar', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork', 'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', @@ -3081,6 +3081,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $facolor = '#444'; } + elseif ($pictowithouttext == 'stats') { + $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; + $facolor = '#444'; + } elseif ($pictowithouttext == 'delete') { $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $facolor = '#444'; From d43f2bbfaec85c10cdb3893d1d6d22912393a083 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 10 Oct 2019 11:44:21 +0200 Subject: [PATCH 13/41] NEW : Accountancy - List by account - Modify sortfield, nowrap on amount and sum of sous-total --- htdocs/accountancy/bookkeeping/listbyaccount.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index d3dc9b4a190..2b9fc4fde29 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -71,7 +71,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if ($sortorder == "") $sortorder = "ASC"; -if ($sortfield == "") $sortfield = "t.rowid"; +if ($sortfield == "") $sortfield = "t.doc_date"; if (empty($search_date_start) && empty($search_date_end)) { $sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; @@ -376,8 +376,8 @@ while ($i < min($num, $limit)) print strlen(length_accounta($line->subledger_account)) == 0 ? '' . $line->label_operation . '' : '' . $line->label_operation . '
(' . length_accounta($line->subledger_account) . ')'; - print '' . ($line->debit ? price($line->debit) :''). ''; - print '' . ($line->credit ? price($line->credit) : '') . ''; + print '' . ($line->debit ? price($line->debit) :''). ''; + print '' . ($line->credit ? price($line->credit) : '') . ''; $accountingjournal = new AccountingJournal($db); $result = $accountingjournal->fetch('', $line->code_journal); @@ -400,18 +400,19 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total du dernier compte comptable affiché print ''; print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; -print " \n"; -print " \n"; +print ''; +print price($sous_total_debit - $sous_total_credit); +print '\n'; print ''; // Affiche le Total print ''; print ''.$langs->trans("Total").':'; -print ''; +print ''; print price($total_debit); print ''; -print ''; +print ''; print price($total_credit); print ''; print ''; From 9a2fabff6fb77949be0ec027d82ed424f71dde58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Oct 2019 18:42:29 +0200 Subject: [PATCH 14/41] doxygen --- .../modules/security/generate/modGeneratePassPerso.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index 5a7d22670c7..8abcc41c263 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -177,7 +177,7 @@ class modGeneratePassPerso extends ModeleGenPassword * Validate a password * * @param string $password Password to check - * @return int 0 if KO, >0 if OK + * @return bool false if KO, true if OK */ public function validatePassword($password) { From ebf73c857c325c931a32b93d55bcbd574b44622a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Oct 2019 21:09:08 +0200 Subject: [PATCH 15/41] get relative path for favicon --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2d612f5808d..aa778a111bc 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1224,7 +1224,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; // Favicon - $favicon = DOL_MAIN_URL_ROOT . '/theme/'.$conf->theme.'/img/favicon.ico'; + $favicon = dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1); if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; if (empty($conf->dol_use_jmobile)) print ''."\n"; // Not required into an Android webview //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; From af88f44fd9ab99fc1b62ae1f3144cd230bef7618 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 11 Oct 2019 09:51:17 +0200 Subject: [PATCH 16/41] fix some translations --- htdocs/core/class/commondocgenerator.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 74253a19f51..cd117f3ca07 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -316,7 +316,7 @@ abstract class CommonDocGenerator // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Define array with couple subtitution key => subtitution value + * Define array with couple substitution key => substitution value * * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code @@ -445,7 +445,7 @@ abstract class CommonDocGenerator $array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs), $array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'), - // Remain to pay with all know infrmation (except open direct debit requests) + // Remain to pay with all know information (except open direct debit requests) $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs), $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT') ); @@ -479,7 +479,7 @@ abstract class CommonDocGenerator $totalUp = 0; foreach ($object->lines as $line) { - // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility + // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward compatibility if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0; $resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; $resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); @@ -868,7 +868,7 @@ abstract class CommonDocGenerator /** - * uasort callback function to Sort colums fields + * uasort callback function to Sort columns fields * * @param array $a PDF lines array fields configs * @param array $b PDF lines array fields configs @@ -907,7 +907,7 @@ abstract class CommonDocGenerator // Positionning $curX = $this->page_largeur-$this->marge_droite; // start from right - // Array witdh + // Array width $arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche; // Count flexible column @@ -915,10 +915,10 @@ abstract class CommonDocGenerator $countFlexCol = 0; foreach ($this->cols as $colKey =>& $colDef) { - if(!$this->getColumnStatus($colKey)) continue; // continue if desable + if(!$this->getColumnStatus($colKey)) continue; // continue if desabled if(!empty($colDef['scale'])){ - // In case of column widht is defined by percentage + // In case of column width is defined by percentage $colDef['width'] = abs($arrayWidth * $colDef['scale'] / 100); } From 13115a55a209d7fb70f5d6f6dbdde10d4e69a8cc Mon Sep 17 00:00:00 2001 From: John Botella Date: Fri, 11 Oct 2019 10:02:59 +0200 Subject: [PATCH 17/41] Fix logo background and hidden conf --- htdocs/core/menus/standard/eldy.lib.php | 9 ++++++++- htdocs/theme/eldy/global.inc.php | 10 ++++++---- htdocs/theme/md/style.css.php | 10 ++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index dbf56429086..878d7e13cd1 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -480,6 +480,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = { $mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI); $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI); + + $logoContainerAdditionalClass = 'backgroundforcompanylogo'; + if(!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_NO_BACKGROUND)){ + $logoContainerAdditionalClass = ''; + } + if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); @@ -497,7 +503,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = print "\n".''."\n"; print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); - print ''."\n"; + + print ''."\n"; print_end_menu_entry(4); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ddd865cbbb2..2fef266ab2e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1085,19 +1085,21 @@ div.blockvmenulogo { border-bottom: 0 !important; } -.backgroundforcompanylogo { +.menu-logo-container { margin: px; margin-left: 8px; margin-right: 8px; - background-color: rgba(255,255,255,0.7); padding: 0; - border-radius: 5px; height: px; /* width: 100px; */ max-width: 100px; vertical-align: middle; } -.backgroundforcompanylogo img.mycompany { +.backgroundforcompanylogo { + background-color: rgba(255,255,255,0.7); + border-radius: 5px; +} +.menu-logo-container img.mycompany { object-fit: contain; width: inherit; height: inherit; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 72974ded51f..9ee1f3d56e7 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2253,19 +2253,21 @@ div.blockvmenulogo { border-bottom: 0 !important; } -.backgroundforcompanylogo { +.menu-logo-container { margin: px; margin-left: 12px; margin-right: 6px; - background-color: rgba(255,255,255,0.7); padding: 0; - border-radius: 5px; height: px; /* width: 100px; */ max-width: 100px; vertical-align: middle; } -.backgroundforcompanylogo img.mycompany { +.backgroundforcompanylogo { + background-color: rgba(255,255,255,0.7); + border-radius: 5px; +} +.menu-logo-container img.mycompany { object-fit: contain; width: inherit; height: inherit; From 4873cbd071664e3a2f9d735c7f39a9c3afe88ad8 Mon Sep 17 00:00:00 2001 From: John Botella Date: Fri, 11 Oct 2019 10:10:12 +0200 Subject: [PATCH 18/41] Fix css name --- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 878d7e13cd1..d1ec07a2152 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -504,7 +504,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); - print ''."\n"; + print ''."\n"; print_end_menu_entry(4); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2fef266ab2e..fe4dcd376f2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1085,7 +1085,7 @@ div.blockvmenulogo { border-bottom: 0 !important; } -.menu-logo-container { +.menulogocontainer { margin: px; margin-left: 8px; margin-right: 8px; @@ -1099,7 +1099,7 @@ div.blockvmenulogo background-color: rgba(255,255,255,0.7); border-radius: 5px; } -.menu-logo-container img.mycompany { +.menulogocontainer img.mycompany { object-fit: contain; width: inherit; height: inherit; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9ee1f3d56e7..87d39529e92 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2253,7 +2253,7 @@ div.blockvmenulogo { border-bottom: 0 !important; } -.menu-logo-container { +.menulogocontainer { margin: px; margin-left: 12px; margin-right: 6px; @@ -2267,7 +2267,7 @@ div.blockvmenulogo background-color: rgba(255,255,255,0.7); border-radius: 5px; } -.menu-logo-container img.mycompany { +.menulogocontainer img.mycompany { object-fit: contain; width: inherit; height: inherit; From bcb7365a5a371142af6db2d4ae08117568ed3fc7 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 11 Oct 2019 10:13:21 +0200 Subject: [PATCH 19/41] Update commondocgenerator.class.php --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index cd117f3ca07..84f49bafe3f 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -915,7 +915,7 @@ abstract class CommonDocGenerator $countFlexCol = 0; foreach ($this->cols as $colKey =>& $colDef) { - if(!$this->getColumnStatus($colKey)) continue; // continue if desabled + if(!$this->getColumnStatus($colKey)) continue; // continue if disabled if(!empty($colDef['scale'])){ // In case of column width is defined by percentage From 25b9be9de7b6db279a0797e2a9429f53c1c32d76 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 11 Oct 2019 10:19:58 +0200 Subject: [PATCH 20/41] update code --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c678f0380fd..3049214679e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -198,13 +198,9 @@ class pdf_cyan extends ModelePDFPropales if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); - $outputlangs->load("propal"); - $outputlangs->load("products"); + + // Translations + $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); $nblines = count($object->lines); From de107fb02e93431ecfad06f8e8606767124d572b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 11:27:05 +0200 Subject: [PATCH 21/41] NEW Can set a squarred icon on your company setup --- htdocs/admin/company.php | 212 ++++++++++++------ .../install/mysql/migration/10.0.0-11.0.0.sql | 2 + htdocs/install/mysql/tables/llx_societe.sql | 1 + htdocs/langs/en_US/admin.lang | 3 + htdocs/societe/class/societe.class.php | 16 +- htdocs/theme/eldy/global.inc.php | 16 +- htdocs/theme/md/style.css.php | 4 + 7 files changed, 182 insertions(+), 72 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index a3534d3bc5a..9da2e550501 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -105,69 +105,79 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode", 'alpha'), 'chaine', 0, '', $conf->entity); - $varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; - if ($_FILES[$varforimage]["tmp_name"]) + $dirforimage=$conf->mycompany->dir_output.'/logos/'; + + $arrayofimages = array('logo', 'logo_squarred'); + + foreach($arrayofimages as $varforimage) { - if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) + if ($_FILES[$varforimage]["tmp_name"]) { - $original_file=$reg[1]; - - $isimage=image_format_supported($original_file); - if ($isimage >= 0) + $reg = array(); + if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { - dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); - if (! is_dir($dirforimage)) - { - dol_mkdir($dirforimage); - } - $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); - if ($result > 0) - { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO", $original_file, 'chaine', 0, '', $conf->entity); + $original_file=$reg[1]; - // Create thumbs of logo (Note that PDF use original file and not thumbs) - if ($isimage > 0) + $isimage=image_format_supported($original_file); + if ($isimage >= 0) + { + dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); + if (! is_dir($dirforimage)) { - // Create thumbs - //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... - - // Create small thumb, Used on logon for example - $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) - { - $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbSmall); - - // Create mini thumb, Used on menu or for setup page for example - $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); - if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) - { - $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbMini); + dol_mkdir($dirforimage); + } + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); + if ($result > 0) + { + $constant = "MAIN_INFO_SOCIETE_LOGO"; + if ($varforimage == 'logo_squarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; + + dolibarr_set_const($db, $constant, $original_file, 'chaine', 0, '', $conf->entity); + + // Create thumbs of logo (Note that PDF use original file and not thumbs) + if ($isimage > 0) + { + // Create thumbs + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + + // Create small thumb, Used on logon for example + $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) + { + $imgThumbSmall = $reg[1]; // Save only basename + dolibarr_set_const($db, $constant."_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); + } + else dol_syslog($imgThumbSmall); + + // Create mini thumb, Used on menu or for setup page for example + $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); + if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) + { + $imgThumbMini = $reg[1]; // Save only basename + dolibarr_set_const($db, $constant."_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); + } + else dol_syslog($imgThumbMini); + } + else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); + } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { + $error++; + $langs->load("errors"); + $tmparray=explode(':', $result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); + } + else + { + $error++; + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } - else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); - } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { - $error++; - $langs->load("errors"); - $tmparray=explode(':', $result); - setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } else { $error++; - setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); } } - else - { - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); - } } } @@ -247,7 +257,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) } } -if ($action == 'addthumb') // Regenerate thumbs +if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumbs { if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"])) { @@ -256,15 +266,20 @@ if ($action == 'addthumb') // Regenerate thumbs // Create thumbs of logo if ($isimage > 0) { + $constant = "MAIN_INFO_SOCIETE_LOGO"; + if ($action == 'addthumbsquarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; + + $reg = array(); + // Create thumbs - //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... // Create small thumb. Used on logon for example $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small', $quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) { $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, $constant."_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbSmall); @@ -273,7 +288,7 @@ if ($action == 'addthumb') // Regenerate thumbs if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) { $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, $constant."_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbMini); @@ -297,24 +312,37 @@ if ($action == 'addthumb') // Regenerate thumbs } } -if ($action == 'removelogo') + +if ($action == 'removelogo' || $action == 'removelogosquarred') { + $constant = "MAIN_INFO_SOCIETE_LOGO"; + if ($action == 'removelogosquarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; - if ($mysoc->logo != '') dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO", $conf->entity); - $mysoc->logo=''; + $logofilename = $mysoc->logo; + if ($action == 'removelogosquarred') $logofilename = $mysoc->logo_squarred; + $logofile=$conf->mycompany->dir_output.'/logos/'.$logofilename; + if ($logofilename != '') dol_delete_file($logofile); + dolibarr_del_const($db, $constant, $conf->entity); + if ($action == 'removelogosquarred') $mysoc->logo_squarred=''; + else $mysoc->logo=''; - $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; - if ($mysoc->logo_small != '') dol_delete_file($logosmallfile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); - $mysoc->logo_small=''; + $logofilename = $mysoc->logo_small; + if ($action == 'removelogosquarred') $logofilename = $mysoc->logo_squarred_small; + $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; + if ($logofilename != '') dol_delete_file($logosmallfile); + dolibarr_del_const($db, $constant."_SMALL", $conf->entity); + if ($action == 'removelogosquarred') $mysoc->logo_squarred_small=''; + else $mysoc->logo_small=''; - $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; - if ($mysoc->logo_mini != '') dol_delete_file($logominifile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); - $mysoc->logo_mini=''; + $logofilename = $mysoc->logo_mini; + if ($action == 'removelogosquarred') $logofilename = $mysoc->logo_squarred_mini; + $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; + if ($logofilename != '') dol_delete_file($logominifile); + dolibarr_del_const($db, $constant."_MINI", $conf->entity); + if ($action == 'removelogosquarred') $mysoc->logo_squarred_mini=''; + else $mysoc->logo_mini=''; } @@ -434,7 +462,7 @@ if ($action == 'edit' || $action == 'updateedit') // Logo print ''; print '
'; - print ''; + print ''; print ''; if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; @@ -448,6 +476,23 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; print ''; + // Logo (squarred) + print ''; + print '
'; + print ''; + print ''; + if (! empty($mysoc->logo_squarred_mini)) { + print ''.img_delete($langs->trans("Delete")).''; + if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { + print '   '; + print ''; + } + } else { + print ''; + } + print '
'; + print ''; + // Note print ''; print ''; @@ -829,7 +874,7 @@ else // Logo - print ''.$langs->trans("Logo").''; + print ''.$form->textwithpicto($langs->trans("Logo"), $langs->trans("LogoDesc")).''; $tagtd='tagtd '; if ($conf->browser->layout == 'phone') $tagtd=''; @@ -854,7 +899,34 @@ else print ''; + // Logo (squarred) + print ''.$form->textwithpicto($langs->trans("LogoSquarred"), $langs->trans("LogoSquarredDesc")).''; + + $tagtd='tagtd '; + if ($conf->browser->layout == 'phone') $tagtd=''; + print '
'; + print $mysoc->logo_squarred; + print '
'; + + // It offers the generation of the thumbnail if it does not exist + if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i', $mysoc->logo_squarred)) + { + print '  '; + } + elseif ($mysoc->logo_squarred_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) + { + print ''; + } + else + { + print ''; + } + print '
'; + + print ''; + + // Note print ''.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . ''; print ''; diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 1948ce28a57..a857898f5dc 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -76,6 +76,8 @@ ALTER TABLE llx_holiday_extrafields ADD INDEX idx_holiday_extrafields (fk_object ALTER TABLE llx_societe_rib MODIFY label varchar(200); +ALTER TABLE llx_societe ADD COLUMN logo_squarred varchar(255); + insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); create table llx_entrepot_extrafields diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 4db88defc68..f312015a662 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -107,6 +107,7 @@ create table llx_societe supplier_order_min_amount double(24,8) DEFAULT NULL, -- min amount for supplier orders default_lang varchar(6), -- default language logo varchar(255) DEFAULT NULL, + logo_squarred varchar(255) DEFAULT NULL, canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default) fk_entrepot integer DEFAULT 0, -- if we need a link between third party and warehouse webservices_url varchar(255), -- supplier webservice url diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index afce2e4fa34..b34ca99013d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1070,6 +1070,9 @@ CompanyCountry=Country CompanyCurrency=Main currency CompanyObject=Object of the company Logo=Logo +LogoDesc=Main logo of company. Will be used into generated documents (PDF, ...) +LogoSquarred=Logo (squarred) +LogoSquarredDesc=Must be a squarred icon (width = height). This logo will be used as the favorite icon or other need like for the top menu bar (if not disabled into disaply setup). DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined OwnerOfBankAccount=Owner of bank account %s diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c4c702bc73b..2b4ae2bb7a0 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -465,6 +465,9 @@ class Societe extends CommonObject public $logo; public $logo_small; public $logo_mini; + public $logo_squarred; + public $logo_squarred_small; + public $logo_squarred_mini; public $array_options; @@ -1072,6 +1075,7 @@ class Societe extends CommonObject $sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null"); $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->db->escape($this->default_lang)."'":"null"); $sql .= ",logo = ".(! empty($this->logo)?"'".$this->db->escape($this->logo)."'":"null"); + $sql .= ",logo_squarred = ".(! empty($this->logo_squarred)?"'".$this->db->escape($this->logo_squarred)."'":"null"); $sql .= ",outstanding_limit= ".($this->outstanding_limit!=''?$this->outstanding_limit:'null'); $sql .= ",order_min_amount= ".($this->order_min_amount!=''?$this->order_min_amount:'null'); $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount!=''?$this->supplier_order_min_amount:'null'); @@ -1266,7 +1270,7 @@ class Societe extends CommonObject $sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement as state_id, s.fk_pays as country_id, s.fk_stcomm, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; - $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; + $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo, s.logo_squarred'; $sql .= ', s.fk_shipping_method'; $sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms'; $sql .= ', s.order_min_amount, s.supplier_order_min_amount'; @@ -1420,6 +1424,7 @@ class Societe extends CommonObject $this->modelpdf = $obj->model_pdf; $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; + $this->logo_squarred = $obj->logo_squarred; $this->webservices_url = $obj->webservices_url; $this->webservices_key = $obj->webservices_key; @@ -2110,6 +2115,12 @@ class Societe extends CommonObject $label.= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. $label.= '
'; } + elseif (! empty($this->logo_squarred) && class_exists('Form')) + { + /*$label.= '
'; + $label.= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. + $label.= '
';*/ + } $label.= '
'; @@ -3522,6 +3533,9 @@ class Societe extends CommonObject $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + $this->logo_squarred=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED; + $this->logo_squarred_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL; + $this->logo_squarred_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; // Define if company use vat or not $this->tva_assuj=$conf->global->FACTURE_TVAOPTION; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ddd865cbbb2..1e69bdf1ecc 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -902,6 +902,17 @@ table[summary="list_of_modules"] .fa-cog { font-size: !important; } + div#login_left, div#login_right { + min-width: 150px !important; + max-width: 200px !important; + padding-left: 5px !important; + padding-right: 5px !important; + } + + div.login_block { + height: 64px !important; + } + .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } .tdoverflowonsmartphone { @@ -923,11 +934,14 @@ table[summary="list_of_modules"] .fa-cog { padding-bottom: 5px; } + .login_table .tdinputlogin { + min-width: unset !important; + } input, input[type=text], input[type=password], select, textarea { min-width: 20px; } .trinputlogin input[type=text], input[type=password] { - max-width: 180px; + max-width: 140px; } .vmenu .searchform input { max-width: 138px; /* length of input text in the quick search box when using a smartphone and without dolidroid */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 72974ded51f..ba97c329073 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1061,6 +1061,10 @@ table[summary="list_of_modules"] .fa-cog { font-size: px !important; } + .login_vertical_align { + padding-left: 0; + } + .divmainbodylarge { margin-left: 20px; margin-right: 20px; } .tdoverflowonsmartphone { From fc886b9950b03088597a58dc16825d08835fc021 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 11:29:39 +0200 Subject: [PATCH 22/41] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 1e69bdf1ecc..22515f9a76f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1105,7 +1105,7 @@ div.blockvmenulogo margin-right: 8px; background-color: rgba(255,255,255,0.7); padding: 0; - border-radius: 5px; + border-radius: 4px; height: px; /* width: 100px; */ max-width: 100px; From ab8199f71aa00a2e4b32d7130f84c2a2f877fa00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 11:38:49 +0200 Subject: [PATCH 23/41] Fix avoid deletion of file if we still need it --- htdocs/admin/company.php | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 9da2e550501..46bd2352b46 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -321,25 +321,43 @@ if ($action == 'removelogo' || $action == 'removelogosquarred') require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $logofilename = $mysoc->logo; - if ($action == 'removelogosquarred') $logofilename = $mysoc->logo_squarred; + $logofilenamebis = $mysoc->logo_squarred; + if ($action == 'removelogosquarred') + { + $logofilename = $mysoc->logo_squarred; + $logofilenamebis = $mysoc->logo; + } + $logofile=$conf->mycompany->dir_output.'/logos/'.$logofilename; - if ($logofilename != '') dol_delete_file($logofile); + if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logofile); dolibarr_del_const($db, $constant, $conf->entity); if ($action == 'removelogosquarred') $mysoc->logo_squarred=''; else $mysoc->logo=''; $logofilename = $mysoc->logo_small; - if ($action == 'removelogosquarred') $logofilename = $mysoc->logo_squarred_small; + $logofilenamebis = $mysoc->logo_squarred_small; + if ($action == 'removelogosquarred') + { + $logofilename = $mysoc->logo_squarred_small; + $logofilenamebis = $mysoc->logo_small; + } + $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; - if ($logofilename != '') dol_delete_file($logosmallfile); + if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logosmallfile); dolibarr_del_const($db, $constant."_SMALL", $conf->entity); if ($action == 'removelogosquarred') $mysoc->logo_squarred_small=''; else $mysoc->logo_small=''; $logofilename = $mysoc->logo_mini; - if ($action == 'removelogosquarred') $logofilename = $mysoc->logo_squarred_mini; + $logofilenamebis = $mysoc->logo_squarred_mini; + if ($action == 'removelogosquarred') + { + $logofilename = $mysoc->logo_squarred_mini; + $logofilenamebis = $mysoc->logo_mini; + } + $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; - if ($logofilename != '') dol_delete_file($logominifile); + if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logominifile); dolibarr_del_const($db, $constant."_MINI", $conf->entity); if ($action == 'removelogosquarred') $mysoc->logo_squarred_mini=''; else $mysoc->logo_mini=''; From 4db57f53f9e77d831351c94820ab2ea8200e3c1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 11:39:33 +0200 Subject: [PATCH 24/41] typo --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b34ca99013d..93bf4b90f94 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1072,7 +1072,7 @@ CompanyObject=Object of the company Logo=Logo LogoDesc=Main logo of company. Will be used into generated documents (PDF, ...) LogoSquarred=Logo (squarred) -LogoSquarredDesc=Must be a squarred icon (width = height). This logo will be used as the favorite icon or other need like for the top menu bar (if not disabled into disaply setup). +LogoSquarredDesc=Must be a squarred icon (width = height). This logo will be used as the favorite icon or other need like for the top menu bar (if not disabled into display setup). DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined OwnerOfBankAccount=Owner of bank account %s From 5801d09dbeb7480e59bb59d6b31249e1f6fe7390 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 12:28:13 +0200 Subject: [PATCH 25/41] NEW Use the squarre logo as favicon of pages --- ChangeLog | 1 + htdocs/core/lib/security2.lib.php | 5 +++- htdocs/core/menus/standard/eldy.lib.php | 6 ++-- htdocs/main.inc.php | 37 ++++++++++++------------- htdocs/public/test/test_arrays.php | 1 - htdocs/theme/eldy/manifest.json.php | 10 +++---- 6 files changed, 31 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8b7db19236..ede0e10a89f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ Following changes may create regressions for some external modules, but were nec * Removed function dol_micro_time. Use native PHP microtime instead. * The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS. +* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu. ***** ChangeLog for 10.0.2 compared to 10.0.1 ***** diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 07eecf0f352..c81ea9d98d7 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -282,8 +282,11 @@ if (! function_exists('dol_loginfunction')) // Set jquery theme $dol_loginmesg = (! empty($_SESSION["dol_loginmesg"])?$_SESSION["dol_loginmesg"]:''); - $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1); + + $favicon = DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png'; + if (! empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; + $jquerytheme = 'base'; if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index dbf56429086..0bfc9f9b7b9 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -478,16 +478,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Show logo company if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI); + //$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI); $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI); if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); } - elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + /*elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); - } + }*/ else { $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png'; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2d612f5808d..33c0e289aed 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1195,7 +1195,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) */ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disablejmobile = 0, $disablenofollow = 0) { - global $db, $conf, $langs, $user, $hookmanager; + global $db, $conf, $langs, $user, $mysoc, $hookmanager; top_httphead(); @@ -1224,9 +1224,11 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; // Favicon - $favicon = DOL_MAIN_URL_ROOT . '/theme/'.$conf->theme.'/img/favicon.ico'; + $favicon = DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png'; + if (! empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; if (empty($conf->dol_use_jmobile)) print ''."\n"; // Not required into an Android webview + //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; @@ -1614,9 +1616,6 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead print '