From 00db16e0deab03cb0fcf85458db42d6f7d1acfe4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 08:49:00 +0200 Subject: [PATCH 01/13] Fix: force jquery cal if MAIN_POPUP_CALENDAR=eldy (showDP commented) --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93c24990af0..7c4948789b1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4742,7 +4742,9 @@ class Form // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' $usecalendar='combo'; - if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) $usecalendar=empty($conf->global->MAIN_POPUP_CALENDAR)?'jquery':$conf->global->MAIN_POPUP_CALENDAR; + if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) { + $usecalendar = ((empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == 'eldy')?'jquery':$conf->global->MAIN_POPUP_CALENDAR); + } //if (! empty($conf->browser->phone)) $usecalendar='combo'; if ($d) From f51c0db7059862c78ecd5fb8d9e4941f9e19c732 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 09:16:14 +0200 Subject: [PATCH 02/13] NEW add translation and possibility to change month and year --- htdocs/core/class/html.form.class.php | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7c4948789b1..4af8364a751 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4790,7 +4790,54 @@ class Form $retstring.="'."\n"; - // Add datepicker default options - /*if (! defined('DISABLE_DATE_PICKER')) + // Add datepicker default options (needed by jquery datepicker!) + if (! defined('DISABLE_DATE_PICKER')) { print ''."\n"; - }*/ + } // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) From 4530f94fa67b93675619a4903771a21c097c37ac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 10:07:52 +0200 Subject: [PATCH 06/13] Fix: restore parameters, needed for save in place --- htdocs/core/js/datepicker.js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php index a763533f9b3..3de57f0543f 100644 --- a/htdocs/core/js/datepicker.js.php +++ b/htdocs/core/js/datepicker.js.php @@ -119,7 +119,9 @@ $(document).ready(function() { $.datepicker.setDefaults({ autoSize: true, changeMonth: true, - changeYear: true + changeYear: true, + altField: '#timestamp', + altFormat: '@' // Gives a timestamp dateformat }); }); From 572a64bdbf67021cf4e12105cbf9ba9e509cf455 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 10 Oct 2017 10:19:04 +0200 Subject: [PATCH 07/13] display mobile picto runs with #6617 --- htdocs/core/lib/functions.lib.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1d173d103fb..cbad1ab7e62 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2194,9 +2194,21 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")); } $rep=''; + $picto = ''; + if($withpicto){ + if($withpicto=='fax'){ + $picto = 'phoning_fax'; + }elseif($withpicto=='phone'){ + $picto = 'phoning'; + }elseif($withpicto=='mobile'){ + $picto = 'phoning_mobile'; + }else{ + $picto = ''; + } + } if ($adddivfloat) $rep.='
'; else $rep.=''; - $rep.=($withpicto?img_picto($titlealt, 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone; + $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone; if ($adddivfloat) $rep.='
'; else $rep.=''; return $rep; @@ -6776,4 +6788,4 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield=' if ($id > 0) return $id; return ''; } -} \ No newline at end of file +} From ce6d6dcfbc7bc31604ad5c52717fc5e81fcd5d96 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 10:37:57 +0200 Subject: [PATCH 08/13] NEW add image object_phoning_mobile.png --- htdocs/theme/eldy/img/object_phoning_mobile.png | Bin 0 -> 435 bytes htdocs/theme/md/img/object_phoning_mobile.png | Bin 0 -> 435 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/theme/eldy/img/object_phoning_mobile.png create mode 100644 htdocs/theme/md/img/object_phoning_mobile.png diff --git a/htdocs/theme/eldy/img/object_phoning_mobile.png b/htdocs/theme/eldy/img/object_phoning_mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..c94fd72ae14fdf3d710071304d1bcdf8e8e51c36 GIT binary patch literal 435 zcmV;k0ZjghP)DJU3+O^@f!8|0tDT3y z=U_0P+wJ1QZntB(TmrlRU(NfED2j9oVHgT{Kan140;bpNIXl&a%bp)5;`F;23zmi2mlQ9R}H{F{+FEdWGOM3N-5S}jJS5tGRTfFwzXOPDg-(AdoTUwuSL{OrGZ$ zW0=q9WLXA4p65)b)3dJiDOfoEbX8SIV!z*WI2-_|stRlEsrK7tVaVU7@az(R<2sjD dh$W46{sB@}vq%b)znTC5002ovPDHLkV1ig?w`c$W literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/object_phoning_mobile.png b/htdocs/theme/md/img/object_phoning_mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..c94fd72ae14fdf3d710071304d1bcdf8e8e51c36 GIT binary patch literal 435 zcmV;k0ZjghP)DJU3+O^@f!8|0tDT3y z=U_0P+wJ1QZntB(TmrlRU(NfED2j9oVHgT{Kan140;bpNIXl&a%bp)5;`F;23zmi2mlQ9R}H{F{+FEdWGOM3N-5S}jJS5tGRTfFwzXOPDg-(AdoTUwuSL{OrGZ$ zW0=q9WLXA4p65)b)3dJiDOfoEbX8SIV!z*WI2-_|stRlEsrK7tVaVU7@az(R<2sjD dh$W46{sB@}vq%b)znTC5002ovPDHLkV1ig?w`c$W literal 0 HcmV?d00001 From 0abc16b27fc926a0dfb60ed59bb13742445fd96d Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 10 Oct 2017 14:55:42 +0200 Subject: [PATCH 09/13] Add class Add oddeven class to tr tag --- htdocs/admin/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 06f7af5b8d6..ce5d4ec55eb 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -623,7 +623,7 @@ if ($mode == 'common') $imginfo="info_black"; } - print ''."\n"; + print ''."\n"; // Picto + Name of module print ' '; From 7e79c3a79526d59002f309f5ea4e80e004c32bf9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 11 Oct 2017 10:10:27 +0200 Subject: [PATCH 10/13] Fix: label not translated if special lang file used --- htdocs/core/class/extrafields.class.php | 2 +- .../core/tpl/admin_extrafields_view.tpl.php | 62 ++++++++++--------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 277ff7a3895..43af66e51e7 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -747,7 +747,7 @@ class ExtraFields $this->attribute_pos[$tab->name]=$tab->pos; $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; $this->attribute_perms[$tab->name]=$tab->perms; - $this->attribute_langfile[$tab->langs]=$tab->langs; + $this->attribute_langfile[$tab->name]=$tab->langs; $this->attribute_list[$tab->name]=$tab->list; $this->attribute_hidden[$tab->name]=$tab->ishidden; $this->attribute_entityid[$tab->name]=$tab->entity; diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 30b4299a21e..04037368fbc 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012-2017 Regis Houssin * * 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 @@ -61,39 +61,43 @@ print "\n"; if (count($extrafields->attribute_type)) { - foreach($extrafields->attribute_type as $key => $value) - { + foreach($extrafields->attribute_type as $key => $value) + { + // Load language if required + if (! empty($extrafields->attribute_langfile[$key])) { + $langs->load($extrafields->attribute_langfile[$key]); + } - print ''; - print "".$extrafields->attribute_pos[$key]."\n"; - print "".$extrafields->attribute_label[$key]."\n"; - print "".$key."\n"; - print "".$type2label[$extrafields->attribute_type[$key]]."\n"; - print ''.$extrafields->attribute_size[$key]."\n"; - print ''.yn($extrafields->attribute_unique[$key])."\n"; - print ''.dol_trunc($extrafields->attribute_computed[$key], 20)."\n"; - print ''.yn($extrafields->attribute_required[$key])."\n"; - print ''.yn($extrafields->attribute_alwayseditable[$key])."\n"; - print ''.$extrafields->attribute_list[$key]."\n"; - if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print ''.yn($extrafields->attribute_hidden[$key])."\n"; // Add hidden option on not working feature. Why hide if user can't see it. - if ($conf->multicompany->enabled) { - print ''.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).''; - } - print ''.img_edit().''; - print "  ".img_delete()."\n"; - print ""; - } + print ''; + print "".$extrafields->attribute_pos[$key]."\n"; + print "".$langs->trans($extrafields->attribute_label[$key])."\n"; + print "".$key."\n"; + print "".$type2label[$extrafields->attribute_type[$key]]."\n"; + print ''.$extrafields->attribute_size[$key]."\n"; + print ''.yn($extrafields->attribute_unique[$key])."\n"; + print ''.dol_trunc($extrafields->attribute_computed[$key], 20)."\n"; + print ''.yn($extrafields->attribute_required[$key])."\n"; + print ''.yn($extrafields->attribute_alwayseditable[$key])."\n"; + print ''.$extrafields->attribute_list[$key]."\n"; + if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print ''.yn($extrafields->attribute_hidden[$key])."\n"; // Add hidden option on not working feature. Why hide if user can't see it. + if (! empty($conf->multicompany->enabled)) { + print ''.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).''; + } + print ''.img_edit().''; + print "  ".img_delete()."\n"; + print ""; + } } else { - $colspan=9; - if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++; + $colspan=9; + if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++; - print ''; - print ''; - print $langs->trans("None"); - print ''; - print ''; + print ''; + print ''; + print $langs->trans("None"); + print ''; + print ''; } print ""; From 1b3f746ce0dd52b5d4820c62af01300d258135e0 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Wed, 11 Oct 2017 11:16:01 +0200 Subject: [PATCH 11/13] Fix translation error InvoiceProForma translation is available in bills.lang --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index cdff9317446..2d5a27bb3df 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1566,7 +1566,7 @@ class pdf_crabe extends ModelePDFFactures if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); - if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); + if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProForma"); if ($this->situationinvoice) $title=$outputlangs->transnoentities("InvoiceSituation"); $pdf->MultiCell($w, 3, $title, '', 'R'); From 5aa3352e58b1a29f8ad33e572a552cbffb4ea74a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:48:38 +0200 Subject: [PATCH 12/13] Restore TODO for future feature --- htdocs/core/js/datepicker.js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php index 3de57f0543f..32b7ca43f5e 100644 --- a/htdocs/core/js/datepicker.js.php +++ b/htdocs/core/js/datepicker.js.php @@ -139,7 +139,9 @@ jQuery(function($){ weekHeader: 'trans("Week"); ?>', dateFormat: 'trans("FormatDateShortJQuery"); ?>', firstDay: global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, - isRTL: trans("DIRECTION")=='rtl'?'true':'false'); ?> + isRTL: trans("DIRECTION")=='rtl'?'true':'false'); ?>, + showMonthAfterYear: false, /* TODO add specific to country */ + yearSuffix: '' /* TODO add specific to country */ }; $.datepicker.setDefaults($.datepicker.regional['defaultlang ?>']); }); From 118b3cdf7918da49a92b32003349a819bf78341e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:56:22 +0200 Subject: [PATCH 13/13] Update admin_extrafields_view.tpl.php --- htdocs/core/tpl/admin_extrafields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 04037368fbc..4975e00279d 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -70,7 +70,7 @@ if (count($extrafields->attribute_type)) print ''; print "".$extrafields->attribute_pos[$key]."\n"; - print "".$langs->trans($extrafields->attribute_label[$key])."\n"; + print "".$extrafields->attribute_label[$key]."\n"; // We don't translate here, we want admin to know what is the key not translated value print "".$key."\n"; print "".$type2label[$extrafields->attribute_type[$key]]."\n"; print ''.$extrafields->attribute_size[$key]."\n";