From 6338b04ac0e64b914ff44d4552ed36900a2397f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 11:27:39 +0200 Subject: [PATCH 01/19] Remove call of a deprecated function --- htdocs/comm/action/card.php | 2 +- htdocs/comm/propal/card.php | 6 +----- htdocs/commande/card.php | 2 +- htdocs/compta/paiement/cheque/card.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/don/card.php | 12 +++++------- htdocs/expedition/card.php | 2 +- htdocs/exports/export.php | 12 +++++++----- htdocs/fichinter/card.php | 2 +- htdocs/livraison/card.php | 2 +- htdocs/projet/card.php | 2 +- htdocs/projet/tasks/task.php | 12 +++++++----- htdocs/societe/canvas/company/tpl/card_view.tpl.php | 2 +- .../societe/canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 15 files changed, 31 insertions(+), 33 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f4c610a0613..d52edaa14d9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1472,7 +1472,7 @@ if ($id > 0) $var=true; - $somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); + print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 68b59f528bd..bbdb503b873 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2340,8 +2340,6 @@ if ($action == 'create') if ($action != 'presend') { print '
'; - // print '
'; - // print ''; // ancre /* * Documents generes @@ -2354,7 +2352,7 @@ if ($action == 'create') $var = true; - $somethingshown = $formfile->show_documents('propal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + print $formfile->showdocuments('propal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('propal')); @@ -2362,14 +2360,12 @@ if ($action == 'create') print '
'; - // print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, 'propal', $socid); - // print '
'; print '
'; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 6730bf99750..313fef16e2c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2563,7 +2563,7 @@ if ($action == 'create' && $user->rights->commande->creer) $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->commande->creer; $delallowed = $user->rights->commande->supprimer; - $somethingshown = $formfile->show_documents('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); // Show links to link elements diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 3ca8eb21e6e..94686162687 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -801,7 +801,7 @@ if ($action != 'new') $filedir=$dir.get_exdir($object->ref,0,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref); $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1); + print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1); print '
'; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e8b8a990417..86e45ade086 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2038,7 +2038,7 @@ else $var = true; - $somethingshown = $formfile->show_documents('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); // Show links to link elements diff --git a/htdocs/don/card.php b/htdocs/don/card.php index c5c5c402af8..125f6ea656e 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -805,7 +805,7 @@ if (! empty($id) && $action != 'edit') print "
"; - print ''; - - print '
'; + print '
'; /* * Documents generes @@ -818,13 +818,11 @@ if (! empty($id) && $action != 'edit') $var=true; - print '
'; - $formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); - - print '
 
'; + print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); + print '
'; + + print '
'; } llxFooter(); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b64d40eeb4a..37b9f8a7248 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1909,7 +1909,7 @@ else if ($id || $ref) $genallowed=$user->rights->expedition->lire; $delallowed=$user->rights->expedition->supprimer; - $somethingshown=$formfile->show_documents('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); + print $formfile->showdocuments('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); // Show links to link elements diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 09a2ffe56f3..7b51aa02f15 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -1170,6 +1170,7 @@ if ($step == 5 && $datatoexport) print ''; + print ''; if ($sqlusedforexport && $user->admin) @@ -1180,17 +1181,18 @@ if ($step == 5 && $datatoexport) } print '
'; - print ''; - print '
'; + + print '
'; if (! is_dir($conf->export->dir_temp)) dol_mkdir($conf->export->dir_temp); // Affiche liste des documents // NB: La fonction show_documents rescanne les modules qd genallowed=1, sinon prend $liste - $formfile->show_documents('export','',$upload_dir,$_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport,$liste,1,(! empty($_POST['model'])?$_POST['model']:'csv'),1,1); - - print '
 
'; + print $formfile->showdocuments('export','',$upload_dir,$_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport,$liste,1,(! empty($_POST['model'])?$_POST['model']:'csv'),1,1); + print '
'; + + print '
'; } print '
'; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index bfea0d64bd5..567e2660b94 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1773,7 +1773,7 @@ else if ($id > 0 || ! empty($ref)) $var=true; //print "
\n"; - $somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); + print $somethingshown=$formfile->showdocuments('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); // Show links to link elements diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index ff541f45d93..e3d2c03970b 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -670,7 +670,7 @@ else $genallowed=$user->rights->expedition->livraison->creer; $delallowed=$user->rights->expedition->livraison->supprimer; - $somethingshown=$formfile->show_documents('livraison',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); + print $formfile->showdocuments('livraison',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); /* * Linked object block (of linked shipment) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 5817f44db65..8f1d77b7b6c 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1132,7 +1132,7 @@ else $var=true; - $somethingshown=$formfile->show_documents('project',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); + print $formfile->showdocuments('project',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); print '
'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 55838675920..9c785e08e6b 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -562,9 +562,9 @@ if ($id > 0 || ! empty($ref)) print '
'; } - print '
'; - print ''; // ancre - + print '
'; + print ''; // ancre + /* * Documents generes */ @@ -576,9 +576,11 @@ if ($id > 0 || ! empty($ref)) $var=true; - $somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); + print $formfile->showdocuments('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); - print '
'; + print '
'; + + print '
'; } } } diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 26c1e77742f..fa58b02413c 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -260,7 +260,7 @@ $urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid; $genallowed=$user->rights->societe->creer; $delallowed=$user->rights->societe->supprimer; -$somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang); +print $formfile->showdocuments('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index bc83f2955da..7249c752c1c 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -204,7 +204,7 @@ $urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid; $genallowed=$user->rights->societe->creer; $delallowed=$user->rights->societe->supprimer; -$somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang); +print $formfile->showdocuments('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang); ?> diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 83fcedad131..0658416797e 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1840,7 +1840,7 @@ if ($action == 'create') $var = true; - $somethingshown = $formfile->show_documents('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + print $formfile->showdocuments('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); // Show links to link elements From 3b05d00163fbc4cd22254957b2480dd761c22101 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 11:59:19 +0200 Subject: [PATCH 02/19] Better responsive design --- htdocs/core/class/html.form.class.php | 16 +++++++--- htdocs/core/class/html.formfile.class.php | 15 +++++---- htdocs/core/lib/functions.lib.php | 39 +++++++++++++++-------- htdocs/societe/soc.php | 2 +- htdocs/theme/eldy/style.css.php | 13 ++++++++ htdocs/theme/md/style.css.php | 14 ++++++++ 6 files changed, 75 insertions(+), 24 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b5d9ead05e3..69d8adc7352 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3274,7 +3274,7 @@ class Form * @param string $selectedchoice "" or "no" or "yes" * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box - * @param int $width Force width of bow + * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form */ function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=200, $width=500) @@ -3289,7 +3289,8 @@ class Form // Clean parameters $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; - + if ($conf->browser->layout == 'phone') $width='95%'; + if (is_array($formquestion) && ! empty($formquestion)) { // First add hidden fields and value @@ -5523,7 +5524,11 @@ class Form //print "xx".$previous_ref."x".$next_ref; $ret.='
'; - if ($morehtmlleft) $ret.='
'.$morehtmlleft.'
'; + if ($morehtmlleft) + { + if ($conf->browser->layout == 'phone') $ret.='
'.$morehtmlleft.'
'; + else $ret.='
'.$morehtmlleft.'
'; + } $ret.='
'; @@ -5727,7 +5732,10 @@ class Form } else { - $ret.='No photo'; + if ($conf->browser->layout != 'phone') + { + $ret.='No photo'; + } } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 61f4f459091..3ad02cf60c2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1454,13 +1454,16 @@ class FormFile global $langs, $conf; $out=''; - $urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath); - if ($urladvancedpreview) + if ($conf->browser->layout != 'phone') { - $out.= ''; - if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); - else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']); - $out.= ''; + $urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath); // Return if a file is qualified for preview + if ($urladvancedpreview) + { + $out.= ''; + if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); + else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']); + $out.= ''; + } } return $out; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 892c6c1fc2b..921571a478c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -944,7 +944,6 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'user') $modulepart='userphoto'; if ($object->element == 'product') $modulepart='product'; - print '
'; if ($object->element == 'product') { $width=80; $cssclass='photoref'; @@ -958,7 +957,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $nophoto=''; $morehtmlleft.='
'; } - else { + elseif ($conf->browser->layout != 'phone') { // Show no photo link $nophoto='/public/theme/common/nophoto.png'; $morehtmlleft.='
No photo
'; } @@ -969,21 +968,33 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { if ($showimage) { - $morehtmlleft.='
'; - if ($modulepart != 'unknown') $morehtmlleft.=$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos); - else if ($object->element == 'action') + if ($modulepart != 'unknown') { - $cssclass='photorefcenter'; - $nophoto=img_picto('', 'title_agenda', '', false, 1); - $morehtmlleft.='
No photo
'; + $phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos); + if ($phototoshow) + { + $morehtmlleft.='
'; + $morehtmlleft.=$phototoshow; + $morehtmlleft.='
'; + } } - else + elseif ($conf->browser->layout != 'phone') // Show no photo link { - $width=14; $cssclass='photorefcenter'; - $nophoto=img_picto('', 'object_'.$object->picto, '', false, 1); - $morehtmlleft.='
No photo
'; + $morehtmlleft.='
'; + if ($object->element == 'action') + { + $cssclass='photorefcenter'; + $nophoto=img_picto('', 'title_agenda', '', false, 1); + $morehtmlleft.='
No photo
'; + } + else + { + $width=14; $cssclass='photorefcenter'; + $nophoto=img_picto('', 'object_'.$object->picto, '', false, 1); + $morehtmlleft.='
No photo
'; + } + $morehtmlleft.='
'; } - $morehtmlleft.='
'; } } if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; @@ -1035,6 +1046,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $morehtmlref.=$langs->trans("TechnicalID").': '.$object->id; $morehtmlref.='
'; } + + print '
'; print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright); print '
'; print '
'; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 9709b4ecbac..e9896fc61af 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1931,7 +1931,7 @@ else ) ); - print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 190); + print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 200); } dol_htmloutput_errors($error,$errors); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e176ebcaaee..6da9077d5d2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4637,6 +4637,19 @@ img.demothumb { max-width: 100px; min-width: 0 !important; } + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ef751d882f7..016cb4f05c3 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4445,6 +4445,20 @@ img.demothumb { position: absolute; width: px; } + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } + } From 8222f7a78be71ab39ff4d04d88c6e3afe7cf0e3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 12:24:46 +0200 Subject: [PATCH 03/19] Fix translation --- htdocs/langs/en_US/withdrawals.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 5a8583cdc71..a0706fe11a9 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -23,7 +23,7 @@ WithdrawalsSetup=Direct debit payment setup WithdrawStatistics=Direct debit payment statistics WithdrawRejectStatistics=Direct debit payment reject statistics LastWithdrawalReceipt=Latest %s direct debit receipts -MakeWithdrawRequest=Make a withdraw request +MakeWithdrawRequest=Make a direct debit payment request ThirdPartyBankCode=Third party bank code NoInvoiceCouldBeWithdrawed=No invoice withdrawed with success. Check that invoice are on companies with a valid BAN. ClassCredited=Classify credited From 0ae5a3799c25a051556a2abe84e83d4545c54d6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 12:42:37 +0200 Subject: [PATCH 04/19] Fix html --- htdocs/comm/card.php | 4 +- htdocs/contact/card.php | 2 +- htdocs/contact/document.php | 16 +- htdocs/fourn/facture/card.php | 18 -- htdocs/societe/soc.php | 345 +++++++++++++++++----------------- 5 files changed, 190 insertions(+), 195 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 1bdf4e75e5d..cc4b7719069 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -264,13 +264,13 @@ if ($id > 0) // Local Taxes if ($mysoc->useLocalTax(1)) { - print ''.$langs->trans("LocalTax1IsUsedES").''; + print ''.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print yn($object->localtax1_assuj); print ''; } if ($mysoc->useLocalTax(2)) { - print ''.$langs->trans("LocalTax2IsUsedES").''; + print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print yn($object->localtax2_assuj); print ''; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 31eb96d633f..23242559f1f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -54,7 +54,6 @@ $confirm = GETPOST('confirm','alpha'); $backtopage = GETPOST('backtopage','alpha'); $id = GETPOST('id','int'); $socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; $object = new Contact($db); $extrafields = new ExtraFields($db); @@ -74,6 +73,7 @@ if (! empty($canvas)) } // Security check +if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 8c79dfd1580..825c1e8dab5 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -37,9 +37,22 @@ $id = GETPOST('id','int'); $action = GETPOST("action"); $confirm = GETPOST('confirm', 'alpha'); +$object = new Contact($db); + +// Get object canvas (By default, this is not defined, so standard usage of dolibarr) +$object->getCanvas($id); +$objcanvas=null; +$canvas = (! empty($object->canvas)?$object->canvas:GETPOST("canvas")); +if (! empty($canvas)) +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; + $objcanvas = new Canvas($db, $action); + $objcanvas->getCanvas('contact', 'contactcard', $canvas); +} + // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $id, '',''); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission // Get parameters $sortfield = GETPOST("sortfield",'alpha'); @@ -54,7 +67,6 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; -$object = new Contact($db); if ($id > 0) $object->fetch($id); $upload_dir = $conf->societe->dir_output.'/contact/'.dol_sanitizeFileName($object->ref); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 78fbe392774..f637caec3cb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2030,24 +2030,6 @@ else print ''; - // Ref - /* - print ''; - print "\n"; - - // Ref supplier - print ''; - - // Third party - print ''; - print ''; - */ - // Type print ''; - // Assujeti TVA + // Vat is used print ''; print ''; - // VAT payers - print ''; + // Local Taxes + //TODO: Place into a function to control showing by country or study better option + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") + { + print ''; + + } + elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") + { + print ''; + + } + elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") + { + print ''; + } + // VAT Code print ''; - print ''; print ''; - // Local Taxes - //TODO: Place into a function to control showing by country or study better option - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; - - } - elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") - { - print ''; - - } - elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") - { - print ''; - } - // Type - Size print ''; - // VAT payers + // VAT is used print ''; print ''; + // Local Taxes + //TODO: Place into a function to control showing by country or study better option + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") + { + print ''; + + if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) + { + print ''; + print ''; + print ''; + print ''; + if($action == 'editRE') + { + print ''; + } + else + { + print ''; + } + print ''; + } + if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) + { + print ''; + print ''; + print ''; + print ''; + if($action == 'editIRPF'){ + print ''; + }else{ + print ''; + } + print ''; + } + } + elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") + { + print ''; + if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) + { + print ''; + print ''; + print ''; + print ''; + if($action == 'editRE'){ + print ''; + }else{ + print ''; + } + print ''; + + } + } + elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") + { + print ''; + if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) + { + + print ''; + print ''; + print ''; + print ''; + if($action == 'editIRPF'){ + print ''; + }else{ + print ''; + } + print ''; + + } + } + /* + if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1) + { + print ''; + } + */ + // VAT Code print ''; print ''; print ''; - // Local Taxes - //TODO: Place into a function to control showing by country or study better option - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; - - if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) - { - print ''; - print ''; - print ''; - print ''; - if($action == 'editRE') - { - print ''; - } - else - { - print ''; - } - print ''; - } - if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) - { - print ''; - print ''; - print ''; - print ''; - if($action == 'editIRPF'){ - print ''; - }else{ - print ''; - } - print ''; - } - } - elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") - { - print ''; - if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) - { - print ''; - print ''; - print ''; - print ''; - if($action == 'editRE'){ - print ''; - }else{ - print ''; - } - print ''; - - } - } - elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") - { - print ''; - if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) - { - - print ''; - print ''; - print ''; - print ''; - if($action == 'editIRPF'){ - print ''; - }else{ - print ''; - } - print ''; - - } - } -/* - if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1) - { - print ''; - } -*/ // Type + Staff $arr = $formcompany->typent_array(1); $object->typent= $arr[$object->typent_code]; @@ -2185,6 +2186,26 @@ else print '
'; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)).''; - print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)); - print '
'.$langs->trans('Supplier').''.$societe->getNomUrl(1,'supplier'); - print '   ('.$langs->trans('OtherBills').')
'.$langs->trans('Type').''; print $object->getLibType(); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index e9896fc61af..71f2ae41536 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1132,7 +1132,7 @@ else } if ($j % 2 == 1) print '
'.fieldLabel('VATIsUsed','assujtva_value').''; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation @@ -1688,14 +1688,64 @@ else } if ($j % 2 == 1) print '
'.fieldLabel('VATIsUsed','assujtva_value').''; + // VAT is used + print '
'.fieldLabel('VATIsUsed','assujtva_value').''; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); + if(! isOnlyOneLocalTax(1)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''; + } + + print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); + if (! isOnlyOneLocalTax(2)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''; + } + print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); + if(! isOnlyOneLocalTax(1)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''; + } + print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); + if(! isOnlyOneLocalTax(2)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''; + } + print '
'.fieldLabel('VATIntra','intra_vat').''; + print ''; $s =''; if (empty($conf->global->MAIN_DISABLEVATCHECK)) @@ -1723,56 +1773,6 @@ else print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; - print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); - if(! isOnlyOneLocalTax(1)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''; - } - - print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; - print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); - if (! isOnlyOneLocalTax(2)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''; - } - print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; - print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); - if(! isOnlyOneLocalTax(1)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''; - } - print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; - print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); - if(! isOnlyOneLocalTax(2)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''; - } - print '
'.fieldLabel('ThirdPartyType','typent_id').''; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); @@ -2027,7 +2027,7 @@ else } //if ($j % 2 == 1) print '
'; print $langs->trans('VATIsUsed'); print ''; @@ -2035,6 +2035,104 @@ else print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print yn($object->localtax1_assuj); + print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''.$object->localtax1_value.'
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print yn($object->localtax1_assuj); + print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''.$object->localtax1_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->trans('VATIntra').''; @@ -2074,103 +2172,6 @@ else print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; - print yn($object->localtax1_assuj); - print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; - print yn($object->localtax2_assuj); - print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''.$object->localtax1_value.'
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; - print yn($object->localtax1_assuj); - print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''.$object->localtax1_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; - print yn($object->localtax2_assuj); - print '
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; - print yn($object->localtax2_assuj); - print '
'; + // Tags / categories + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) + { + // Customer + if ($object->prospect || $object->client) { + print ''; + print '"; + } + + // Supplier + if ($object->fournisseur) { + print ''; + print '"; + } + } + // Legal print ''; @@ -2207,26 +2228,6 @@ else print ''; } - // Tags / categories - if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) - { - // Customer - if ($object->prospect || $object->client) { - print ''; - print '"; - } - - // Supplier - if ($object->fournisseur) { - print ''; - print '"; - } - } - // Incoterms if (!empty($conf->incoterm->enabled)) { From f1421a2ee4393d62ba7bbbe48efcdabcf5537ff4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 13:10:35 +0200 Subject: [PATCH 05/19] Rename constant with english name --- htdocs/admin/ihm.php | 6 +- htdocs/comm/card.php | 144 ++++++++++-------- htdocs/fourn/card.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/install/mysql/data/llx_const.sql | 2 +- .../install/mysql/migration/3.8.0-3.9.0.sql | 2 +- .../install/mysql/migration/4.0.0-5.0.0.sql | 2 + htdocs/langs/en_US/companies.lang | 3 +- htdocs/langs/en_US/supplier_proposal.lang | 2 +- 9 files changed, 89 insertions(+), 76 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 989aa001131..42b5fc4056a 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -104,7 +104,7 @@ if ($action == 'update') else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); @@ -225,7 +225,7 @@ if ($action == 'edit') // Edit // Max size of short lists on customer card $var=!$var; - print ''; + print ''; print ''; print ''; @@ -408,7 +408,7 @@ else // Show print ""; $var=!$var; - print ''; + print ''; print ''; print ""; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index cc4b7719069..cebe1b60c80 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -217,14 +217,14 @@ if ($id > 0) print '
' . $langs->trans("CustomersCategoriesShort") . ''; + print $form->showCategories($object->id, 'customer', 1); + print "
' . $langs->trans("SuppliersCategoriesShort") . ''; + print $form->showCategories($object->id, 'supplier', 1); + print "
'.$langs->trans('JuridicalStatus').''.$object->forme_juridique.'
' . $langs->trans("CustomersCategoriesShort") . ''; - print $form->showCategories($object->id, 'customer', 1); - print "
' . $langs->trans("SuppliersCategoriesShort") . ''; - print $form->showCategories($object->id, 'supplier', 1); - print "
'.$langs->trans("DefaultMaxSizeShortList").'
'.$langs->trans("DefaultMaxSizeShortList").' 
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . ' 
'; // Prospect/Customer - print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; } @@ -234,7 +234,7 @@ if ($id > 0) $langs->load("compta"); print ''; @@ -242,7 +242,7 @@ if ($id > 0) print ''; print ''; print ''; @@ -251,12 +251,12 @@ if ($id > 0) // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; } // Assujeti a TVA ou pas print ''; - print ''; print ''; @@ -264,20 +264,20 @@ if ($id > 0) // Local Taxes if ($mysoc->useLocalTax(1)) { - print ''; } if ($mysoc->useLocalTax(2)) { - print ''; } // TVA Intra - print ''; @@ -289,7 +289,7 @@ if ($id > 0) print ''; print '
'.$langs->trans('ProspectCustomer').''; + print '
'.$langs->trans('ProspectCustomer').''; print $object->getLibCustProspStatut(); print '
'.$langs->trans("Prefix").''; + print '
'.$langs->trans("Prefix").''; print ($object->prefix_comm?$object->prefix_comm:' '); print '
'; - print $langs->trans('CustomerCode').''; + print $langs->trans('CustomerCode').''; print $object->code_client; if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; print '
'; print $form->editfieldkey("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer); - print ''; + print ''; print $form->editfieldval("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer); print '
'.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'
'.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'
'.$langs->trans('VATIsUsed').''; + print ''.$langs->trans('VATIsUsed').''; print yn($object->tva_assuj); print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print yn($object->localtax1_assuj); print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print yn($object->localtax2_assuj); print '
'.$langs->trans('VATIntra').''; + print '
'.$langs->trans('VATIntra').''; print $object->tva_intra; print '
'; if (($action != 'editconditions') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; - print ''; + print ''; if ($action == 'editconditions') { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id',1); @@ -308,7 +308,7 @@ if ($id > 0) print ''; if (($action != 'editmode') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetMode'),1).''; print ''; - print ''; + print ''; if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); @@ -323,11 +323,11 @@ if ($id > 0) // Compte bancaire par défaut print ''; print ''; print '
'; - print $langs->trans('BankAccount'); + print $langs->trans('PaymentBankAccount'); print ''; if (($action != 'editbankaccount') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; - print ''; + print ''; if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1); @@ -350,7 +350,7 @@ if ($id > 0) print ''.img_edit($langs->trans("Modify")).''; } print ''; - print ''.($object->remise_percent?''.$object->remise_percent.'%':'').''; + print ''.($object->remise_percent?''.$object->remise_percent.'%':'').''; print ''; // Absolute discounts (Discounts-Drawbacks-Rebates) @@ -365,7 +365,7 @@ if ($id > 0) } print ''; print ''; - print ''; + print ''; $amount_discount=$object->getAvailableDiscounts(); if ($amount_discount < 0) dol_print_error($db,$object->error); if ($amount_discount > 0) print ''.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).''; @@ -373,20 +373,6 @@ if ($id > 0) print ''; print ''; - if ($object->client) - { - print ''; - print ''; - print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer); - print ''; - $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; - print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); - //if (empty($object->outstanding_limit)) print $langs->trans("NoLimit"); - - print ''; - print ''; - } - // Multiprice level if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -399,7 +385,7 @@ if ($id > 0) print ''.img_edit($langs->trans("Modify")).''; } print ''; - print ''; + print ''; print $object->price_level; $keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$object->price_level; if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); @@ -407,36 +393,6 @@ if ($id > 0) print ''; } - if ($object->client == 2 || $object->client == 3) - { - // Level of prospect - print ''; - print ''; - print '
'; - print $langs->trans('ProspectLevel'); - print ''; - if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; - print ''; - if ($action == 'editlevel') - $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); - else - print $object->getLibProspLevel(); - print ""; - print ''; - - // Status - $object->loadCacheOfProspStatus(); - print ''.$langs->trans("StatusProsp").''.$object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']); - print '    
'; - foreach($object->cacheprospectstatus as $key => $val) - { - $titlealt='default'; - if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; - if ($object->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; - } - print '
'; - } - // Preferred shipping Method if (! empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { print ''; @@ -445,7 +401,7 @@ if ($id > 0) print ''; if (($action != 'editshipping') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetMode'),1).''; print ''; - print ''; + print ''; if ($action == 'editshipping') { $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->shipping_method_id,'shipping_method_id'); @@ -462,7 +418,7 @@ if ($id > 0) if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { $langs->load("categories"); print '' . $langs->trans("CustomersCategoriesShort") . ''; - print ''; + print ''; print $form->showCategories( $object->id, 'customer', 1 ); print ""; } @@ -484,8 +440,8 @@ if ($id > 0) { $langs->load("members"); $langs->load("users"); - print ''.$langs->trans("LinkedToDolibarrMember").''; - print ''; + print ''.$langs->trans("LinkedToDolibarrMember").''; + print ''; $adh=new Adherent($db); $result=$adh->fetch('','',$object->id); if ($result > 0) @@ -503,12 +459,47 @@ if ($id > 0) print ""; + print '
'; + print '
'; + print ''; + + if ($object->client == 2 || $object->client == 3) + { + // Level of prospect + print '"; + print ''; + + // Status + $object->loadCacheOfProspStatus(); + print ''; + } + print "
'; + print ''; + print '
'; + print $langs->trans('ProspectLevel'); + print ''; + if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; + print '
'; + if ($action == 'editlevel') + $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); + else + print $object->getLibProspLevel(); + print "
'.$langs->trans("StatusProsp").''.$object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']); + print '    
'; + foreach($object->cacheprospectstatus as $key => $val) + { + $titlealt='default'; + if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; + if ($object->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; + } + print '
"; + print '
'; // Nbre max d'elements des petites listes - $MAXLIST=$conf->global->MAIN_SIZE_SHORTLISTE_LIMIT; + $MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Lien recap $outstandingBills = $object->get_OutstandingBill(); @@ -519,14 +510,33 @@ if ($id > 0) } print ''; + print ''; print ''; print ''; print ''; - print ''; + + // Max outstanding bill + if ($object->client) + { + print ''; + print ''; + print ''; + } + + // Outstanding bill + print ''; print ''; - print ''; + print ''; print ''; + print '
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'; + print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer); + print ''; + $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; + print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); + //if (empty($object->outstanding_limit)) print $langs->trans("NoLimit"); + + print '
'.$langs->trans("CurrentOutstandingBill").''.price($outstandingBills).$warn.''.price($outstandingBills).$warn.'
'; print '
'; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 6f17d7825bb..5faf915f329 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -280,7 +280,7 @@ if ($object->id > 0) $var=true; - $MAXLIST=5; + $MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Lien recap print ''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index b8e90dbce10..ebe65f62122 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -435,7 +435,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy',0,'','',$limit); + print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy',0,'','',$limit); if ($search_all) { diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index d6286c8e120..0a31d3c3159 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -55,7 +55,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M -- IHM -- insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0); -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Longueur maximum des listes courtes (fiche client)',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0); diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 1a776c27e66..d5f7f636946 100644 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -61,7 +61,7 @@ update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN_DELAY_EXPENSEREPORTS_TO_PAY')__,__ENCRYPT('31')__,'chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0); -INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0); +INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Max length for small lists (tabs)',0); ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32); ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32); diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index 8b1c554ee1a..74527f33aa1 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -164,3 +164,5 @@ create table llx_resource_extrafields ) ENGINE=innodb; ALTER TABLE llx_resource_extrafields ADD INDEX idx_resource_extrafields (fk_object); + +INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Max length for small lists (tabs)',0); diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index e77b53db26f..73e9dab189c 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -76,7 +76,8 @@ DefaultLang=Language by default VATIsUsed=VAT is used VATIsNotUsed=VAT is not used CopyAddressFromSoc=Fill address with third party address -ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor supplier, no available refering objects +ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor supplier, no available refering objects +PaymentBankAccount=Payment bank account ##### Local Taxes ##### LocalTax1IsUsed=Use second tax LocalTax1IsUsedES= RE is used diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 6bb28be6a7a..94c0ef2e039 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -50,5 +50,5 @@ ListOfSupplierProposal=List of supplier proposal requests ListSupplierProposalsAssociatedProject=List of supplier proposals associated with project SupplierProposalsToClose=Supplier proposals to close SupplierProposalsToProcess=Supplier proposals to process -LastSupplierProposals=Last price requests +LastSupplierProposals=Latest %s price requests AllPriceRequests=All requests From bc2342e9a4aeae2992721ea58ca52981253b9b78 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 17:37:39 +0200 Subject: [PATCH 06/19] Fix bad link --- htdocs/core/lib/project.lib.php | 2 +- htdocs/projet/class/task.class.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index cb78502f78f..d009ac793a0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -840,7 +840,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ { // Thirdparty print ''; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f9220b6e555..e5b7a3f3031 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -575,7 +575,7 @@ class Task extends CommonObject $sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus,"; $sql.= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,"; $sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,"; - $sql.= " s.nom as thirdparty_name"; + $sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; if ($mode == 0) @@ -692,6 +692,7 @@ class Task extends CommonObject $tasks[$i]->date_end = $this->db->jdate($obj->date_end); $tasks[$i]->rang = $obj->rang; + $tasks[$i]->thirdparty_id = $obj->thirdparty_id; $tasks[$i]->thirdparty_name = $obj->thirdparty_name; } From 36c2b5afcdd635cea366dd4556a5dc667ab0b4fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 18:43:17 +0200 Subject: [PATCH 07/19] Responsive --- htdocs/core/class/html.form.class.php | 6 ++--- htdocs/core/lib/project.lib.php | 4 +-- htdocs/projet/tasks/time.php | 37 +++++++++++++++++++-------- htdocs/theme/eldy/style.css.php | 3 --- htdocs/theme/md/style.css.php | 5 ++++ 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 69d8adc7352..e4dc71fcb9a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4518,7 +4518,7 @@ class Form } } - if ($d && $h) $retstring.=' '; + if ($d && $h) $retstring.=($h==2?'
':' '); if ($h) { @@ -4685,7 +4685,7 @@ class Form } elseif ($typehour=='text') { - $retstring.=''; + $retstring.=''; } else return 'BadValueForParameterTypeHour'; @@ -4708,7 +4708,7 @@ class Form } elseif ($typehour=='text') { - $retstring.=''; + $retstring.=''; } $retstring.=' '.$langs->trans('MinuteShort'); $retstring.=" "; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d009ac793a0..173aee8ce26 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -406,14 +406,14 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Title of task print "
\n"; // Date start diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 1041f95640a..276fc1cd722 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -510,7 +510,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'; - $thirdpartystatic->id=$lines[$i]->socid; + $thirdpartystatic->id=$lines[$i]->thirdparty_id; $thirdpartystatic->name=$lines[$i]->thirdparty_name; print $thirdpartystatic->getNomUrl(1, 'project', 10); print '"; if ($showlineingray) print ''; - else print ''; + //else print ''; for ($k = 0 ; $k < $level ; $k++) { print "     "; } print $lines[$i]->label; if ($showlineingray) print ''; - else print ''; + //else print ''; print "
'; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -520,20 +520,20 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; // Date - print ''; // Contributor - print ''; // Note - print ''; // Progress declared @@ -582,7 +582,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $arrayfields['t.task_date']=array('label'=>$langs->trans("Date"), 'checked'=>1); if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task { - $arrayfields['t.task_ref']=array('label'=>$langs->trans("Task"), 'checked'=>1); + $arrayfields['t.task_ref']=array('label'=>$langs->trans("RefTask"), 'checked'=>1); + $arrayfields['t.task_label']=array('label'=>$langs->trans("LabelTask"), 'checked'=>1); } $arrayfields['author']=array('label'=>$langs->trans("By"), 'checked'=>1); $arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1); @@ -710,6 +711,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task { if (! empty($arrayfields['t.task_ref']['checked'])) print_liste_field_titre($arrayfields['t.task_ref']['label'],$_SERVER['PHP_SELF'],'pt.ref','',$params,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.task_label']['checked'])) print_liste_field_titre($arrayfields['t.task_label']['label'],$_SERVER['PHP_SELF'],'pt.label','',$params,'',$sortfield,$sortorder); } if (! empty($arrayfields['author']['checked'])) print_liste_field_titre($arrayfields['author']['label'],$_SERVER['PHP_SELF'],'','',$params,'',$sortfield,$sortorder); if (! empty($arrayfields['t.note']['checked'])) print_liste_field_titre($arrayfields['t.note']['label'],$_SERVER['PHP_SELF'],'t.note','',$params,'',$sortfield,$sortorder); @@ -742,9 +744,10 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task { if (! empty($arrayfields['t.task_ref']['checked'])) print ''; + if (! empty($arrayfields['t.task_label']['checked'])) print ''; } if (! empty($arrayfields['author']['checked'])) print ''; - if (! empty($arrayfields['t.note']['checked'])) print ''; + if (! empty($arrayfields['t.note']['checked'])) print ''; if (! empty($arrayfields['t.task_duration']['checked'])) print ''; if (! empty($arrayfields['value']['checked'])) print ''; // Extra fields @@ -812,7 +815,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if (! $i) $totalarray['nbfield']++; } - // Task + // Task ref if (! empty($arrayfields['t.task_ref']['checked'])) { if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task @@ -827,7 +830,19 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) } } - // User + // Task label + if (! empty($arrayfields['t.task_label']['checked'])) + { + if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + + // User if (! empty($arrayfields['author']['checked'])) { print '
'.$langs->trans("Date").''.$langs->trans("Date").''.$langs->trans("By").''.$langs->trans("Note").''.$langs->trans("ProgressDeclared").'
'; + print ''; //$newdate=dol_mktime(12,0,0,$_POST["timemonth"],$_POST["timeday"],$_POST["timeyear"]); $newdate=''; - print $form->select_date($newdate,'time',1,1,2,"timespent_date",1,0,1); + print $form->select_date($newdate, 'time', ($conf->browser->layout == 'phone'?2:1), 1, 2, "timespent_date", 1, 0, 1); print ''; + print ''; print img_object('','user','class="hideonsmartphone"'); $contactsoftask=$object->getListContactId('internal'); if (count($contactsoftask)>0) { $userid=$contactsoftask[0]; - print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask")); + print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask"), 'maxwidth200'); } else { @@ -542,8 +542,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; - print ''; + print ''; + print ''; print ''; + print $task_time->label; + print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 6da9077d5d2..c805106d784 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4574,9 +4574,6 @@ img.demothumb { background-size: 20px auto; margin-top: 2px; } - select { - width: 100%; - } } /* rule to reduce top menu - 3rd reduction */ @media only screen and (max-width: px) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 016cb4f05c3..d97f73045bc 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4445,6 +4445,11 @@ img.demothumb { position: absolute; width: px; } + select { + width: 100%; + max-width: 100px; + min-width: 0 !important; + } div.divphotoref { padding-right: 5px; } From aad4380689d25f32690fb2587c1a8806e5b5c9d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 20:52:21 +0200 Subject: [PATCH 08/19] Uniformise code --- htdocs/core/lib/sendings.lib.php | 10 +- htdocs/expedition/card.php | 14 +- htdocs/expedition/contact.php | 148 ++++++++++-------- htdocs/expedition/note.php | 116 +++++++------- .../product/class/html.formproduct.class.php | 2 +- htdocs/product/composition/card.php | 5 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stock/card.php | 90 ++--------- htdocs/product/stock/info.php | 26 ++- htdocs/product/stock/mouvement.php | 85 +++++----- htdocs/product/stock/replenish.php | 14 +- htdocs/projet/document.php | 4 +- htdocs/user/info.php | 1 - 13 files changed, 230 insertions(+), 287 deletions(-) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index a6091f8ebb0..06eb19de48e 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; */ function shipping_prepare_head($object) { - global $langs, $conf, $user; + global $db, $langs, $conf, $user; $langs->load("sendings"); $langs->load("deliveries"); @@ -64,7 +64,13 @@ function shipping_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { - $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $objectsrc = $object; + if ($object->origin == 'commande' && $object->origin_id > 0) + { + $objectsrc = new Commande($db); + $objectsrc->fetch($object->origin_id); + } + $nbContact = count($objectsrc->liste_contact(-1,'internal')) + count($objectsrc->liste_contact(-1,'external')); $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; $head[$h][1] = $langs->trans("ContactsAddresses"); if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 37b9f8a7248..fb45993f567 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1295,7 +1295,7 @@ else if ($id || $ref) $totalVolume=$tmparray['volume']; - // Warehouse card + // Shipment card $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; @@ -1348,18 +1348,6 @@ else if ($id || $ref) print ''; - // Ref - /* - print ''; - print ''; - - // Customer - print ''; - print ''; - print "";*/ - // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 039af2cd0ec..65a44cb64f9 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -155,83 +155,99 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'contact', $langs->trans("Shipment"), 0, 'sending'); - /* - * Facture synthese pour rappel - */ - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$langs->trans("Customer").''.$soc->getNomUrl(1).'
'; - + // Shipment card $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
'; + // Ref customer shipment + $morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + /* + if (! empty($conf->projet->enabled)) { + $langs->load("projects"); + $morehtmlref .= '
' . $langs->trans('Project') . ' '; + if ($user->rights->supplier_proposal->creer) { + if ($action != 'classify') { + $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + } + if ($action == 'classify') { + // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= ''; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ''; + $morehtmlref .= $proj->ref; + $morehtmlref .= ''; + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref.='
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + //print '
'; + print '
'; - // Ref - print '
"; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print "
'; - // Customer - print ''; - print ''; - print ""; - - // Linked documents + // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { - print ''; - print '\n"; - print ''; + print ''; + print '\n"; + print ''; } if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { - print ''; - print '\n"; - print ''; + print ''; + print '\n"; + print ''; } - - // Ref expedition client - print ''; - print ''; - - // Delivery address - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) - { - print ''; - } - + print "
'.$langs->trans("Customer").''.$object->thirdparty->getNomUrl(1).'
'; - $objectsrc=new Commande($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefOrder").''; - print $objectsrc->getNomUrl(1,'commande'); - print "
'; + $objectsrc=new Commande($db); + $objectsrc->fetch($object->$typeobject->id); + print $langs->trans("RefOrder").''; + print $objectsrc->getNomUrl(1,'commande'); + print "
'; - $objectsrc=new Propal($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefProposal").''; - print $objectsrc->getNomUrl(1,'expedition'); - print "
'; + $objectsrc=new Propal($db); + $objectsrc->fetch($object->$typeobject->id); + print $langs->trans("RefProposal").''; + print $objectsrc->getNomUrl(1,'expedition'); + print "
'; - print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print '
'; - print '
'; - print $objectsrc->ref_client; - print '
'; - print ''; - - if ($action != 'editdelivery_address' && $object->brouillon) print ''; - print '
'; - print $langs->trans('DeliveryAddress'); - print 'socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'
'; - print '
'; - - if ($action == 'editdelivery_address') - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','shipping',$object->id); - } - else - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','shipping',$object->id); - } - print '
"; + + //print '
'; + //print '
'; + //print '
'; + //print '
'; + + + //print '
'; + //print '
'; + print ''; + + print '
'; + + dol_fiche_end(); // Lignes de contacts diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 652b09453f7..849ec6e66bc 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -20,9 +20,9 @@ /** * \file htdocs/expedition/note.php -* \ingroup expedition -* \brief Note card expedition -*/ + * \ingroup expedition + * \brief Note card expedition + */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -99,65 +99,57 @@ if ($id > 0 || ! empty($ref)) $head=shipping_prepare_head($object); dol_fiche_head($head, 'note', $langs->trans("Shipment"), 0, 'sending'); - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - // Customer - print ''; - print ''; - print ""; - - // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) - { - print ''; - print '\n"; - print ''; - } - if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) - { - print ''; - print '\n"; - print ''; - } - - // Ref customer - print ''; - print '\n"; - print ''; - - // Date creation - print ''; - print '\n"; - print ''; - - // Delivery date planed - print ''; - print '\n"; - print ''; - - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$langs->trans("Customer").''.$soc->getNomUrl(1).'
'; - $objectsrc=new Commande($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefOrder").''; - print $objectsrc->getNomUrl(1,'commande'); - print "
'; - $objectsrc=new Propal($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefProposal").''; - print $objectsrc->getNomUrl(1,'expedition'); - print "
'.$langs->trans("RefCustomer").''.$object->ref_customer."
'.$langs->trans("DateCreation").''.dol_print_date($object->date_creation,"day")."
'.$langs->trans("DateDeliveryPlanned").''.dol_print_date($object->date_delivery,"dayhourtext")."
'; - - print '
'; - - $colwidth=20; + + // Shipment card + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
'; + // Ref customer shipment + $morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + /* + if (! empty($conf->projet->enabled)) { + $langs->load("projects"); + $morehtmlref .= '
' . $langs->trans('Project') . ' '; + if ($user->rights->supplier_proposal->creer) { + if ($action != 'classify') { + $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + } + if ($action == 'classify') { + // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ''; + $morehtmlref .= $proj->ref; + $morehtmlref .= ''; + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref.='
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + + $cssclass='titlefield'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; dol_fiche_end(); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index d1fe225ba0e..8ae04e61c91 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -105,7 +105,7 @@ class FormProduct if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.implode(',', $exclude).')'; - if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description"; + if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent"; $sql.= " ORDER BY e.label"; dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index e1644c241e5..3e3fc2d4414 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -207,12 +207,13 @@ if ($id > 0 || ! empty($ref)) dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - print ''; + print '
'; + print '
'; // Nature if($object->type!=Product::TYPE_SERVICE) { - print ''; } diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index ebb28b48287..3f92cd11b18 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -124,7 +124,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); dol_fiche_end(); } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 5adff357db1..f1097b331b9 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -191,7 +191,7 @@ if ($action == 'create') print '
'.$langs->trans("Nature").''; + print '
'.$langs->trans("Nature").''; print $object->getLibFinished(); print '
'; // Ref - print ''; + print ''; print ''; @@ -201,31 +201,32 @@ if ($action == 'create') print ''; // Description - print ''; - print ''; // Zip / Town print ''; + print ''; // Country - print ''; // Status - print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("Description").''; + print '
'.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('desc',(!empty($object->description)?$object->description:''),'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); $doleditor->Create(); print '
'.$langs->trans('Address').'
'.$langs->trans('Zip').''; print $formcompany->select_ziptown((!empty($object->zip)?$object->zip:''),'zipcode',array('town','selectcountry_id','state_id'),6); - print ''.$langs->trans('Town').''; + print '
'.$langs->trans('Town').''; print $formcompany->select_ziptown((!empty($object->town)?$object->town:''),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans('Country').''; + print '
'.$langs->trans('Country').''; print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans("Status").''; + print '
'.$langs->trans("Status").''; print ''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ $morehtmlref.=''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); - + print '
'; print '
'; @@ -347,15 +309,6 @@ else print ''; - - // Ref - /* - print '';*/ - - //print ''; - // Parent entrepot $e = new Entrepot($db); if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) { @@ -367,30 +320,7 @@ else } // Description - print ''; - - // Address - /* - print ''; - - // Town - print ''; - print ''; - - // Country - print '';*/ - - // Status - //print ''; + print ''; $calcproductsunique=$object->nb_different_products(); $calcproducts=$object->nb_products(); @@ -415,7 +345,7 @@ else print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle'); - print '
'.$langs->trans("LocationSummary").''.$object->lieu.'
'.$langs->trans("Description").''.nl2br($object->description).'
'.$langs->trans('Address').''; - print $object->address; - print '
'.$langs->trans('Zip').''.$object->zip.'
'.$langs->trans('Town').''.$object->town.'
'.$langs->trans('Country').''; - if (! empty($object->country_code)) - { - $img=picto_from_langcode($object->country_code); - print ($img?$img.' ':''); - } - print $object->country; - print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("Description").''.nl2br($object->description).'
'; // Value - print '"; diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index f9c5e163f4d..7f6a9f6031b 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -39,18 +39,30 @@ $result=restrictedArea($user,'stock'); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("",$langs->trans("Stocks"),$help_url); -$entrepot = new Entrepot($db); -$entrepot->fetch($_GET["id"]); -$entrepot->info($_GET["id"]); +$object = new Entrepot($db); +$object->fetch($_GET["id"]); +$object->info($_GET["id"]); -$head = stock_prepare_head($entrepot); +$head = stock_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Warehouse"), 0, 'stock'); -print '
'.$langs->trans("EstimatedStockValueShort").''; + print '
'.$langs->trans("EstimatedStockValueShort").''; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print "
'; -dol_print_object_info($entrepot); -print '
'; +$linkback = ''.$langs->trans("BackToList").''; + +$morehtmlref='
'; +$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; +$morehtmlref.='
'; + +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); + + +print '
'; +print '
'; + +print '
'; + +dol_print_object_info($object); print '
'; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 49b27e0fc74..aa9c7c2f566 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -410,8 +410,8 @@ if ($resql) if ($id > 0) { - $entrepot = new Entrepot($db); - $result = $entrepot->fetch($id); + $object = new Entrepot($db); + $result = $object->fetch($id); if ($result < 0) { dol_print_error($db); @@ -430,69 +430,60 @@ if ($resql) */ if ($id) { - $head = stock_prepare_head($entrepot); + $head = stock_prepare_head($object); dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), 0, 'stock'); - + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
'; + $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; + $morehtmlref.='
'; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - print ''; - // Description - print ''; + print ''; - // Address - print ''; - - // Town - print ''; - print ''; - - // Country - print ''; - - // Status - print ''; - - $calcproductsunique=$entrepot->nb_different_products(); - $calcproducts=$entrepot->nb_products(); + $calcproductsunique=$object->nb_different_products(); + $calcproducts=$object->nb_products(); // Total nb of different products - print '"; // Nb of products - print '"; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle'); - print '
'.$langs->trans("LocationSummary").''.$entrepot->lieu.'
'.$langs->trans("Description").''.dol_htmlentitiesbr($entrepot->description).'
'.$langs->trans("Description").''.dol_htmlentitiesbr($object->description).'
'.$langs->trans('Address').''; - print $entrepot->address; - print '
'.$langs->trans('Zip').''.$entrepot->zip.''.$langs->trans('Town').''.$entrepot->town.'
'.$langs->trans('Country').''; - if (! empty($entrepot->country_code)) - { - $img=picto_from_langcode($entrepot->country_code); - print ($img?$img.' ':''); - print $entrepot->country; - } - print '
'.$langs->trans("Status").''.$entrepot->getLibStatut(4).'
'.$langs->trans("NumberOfDifferentProducts").''; + print '
'.$langs->trans("NumberOfDifferentProducts").''; print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; print "
'.$langs->trans("NumberOfProducts").''; + print '
'.$langs->trans("NumberOfProducts").''; print empty($calcproducts['nb'])?'0':$calcproducts['nb']; print "
'; + + print '
'; + print '
'; + print '
'; + print '
'; + + print ''; + // Value - print '"; // Last movement $sql = "SELECT MAX(m.datem) as datem"; $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; - $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."'"; + $sql .= " WHERE m.fk_entrepot = '".$object->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) { @@ -504,7 +495,7 @@ if ($resql) dol_print_error($db); } - print '
'.$langs->trans("EstimatedStockValueShort").''; + print '
'.$langs->trans("EstimatedStockValueShort").''; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print "
'.$langs->trans("LastMovement").''; + print '
'.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour'); @@ -517,6 +508,12 @@ if ($resql) print "
"; + print '
'; + print '
'; + print '
'; + + print '
'; + dol_fiche_end(); } @@ -526,7 +523,6 @@ if ($resql) */ if ($action == "correction") { - if ($id) $object=$entrepot; include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stockcorrection.tpl.php'; print '
'; } @@ -536,7 +532,6 @@ if ($resql) */ if ($action == "transfert") { - if ($id) $object=$entrepot; include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stocktransfer.tpl.php'; print '
'; } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 3a9b601c2ec..a9b2dc57b1b 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -438,11 +438,15 @@ print ''; print ''; print ''; print ''; -print $langs->trans('Warehouse').' : '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); -print '
'; -print $langs->trans('Supplier').' : '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1); -print '
'; -print ' '; +print '
'; +print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); +print '
'; +print '
'; +print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1); +print '
'; +print '
'; +print ''; +print '
'; print ''; if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) { diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index c4f1f7df615..d5768c355a2 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -137,8 +137,8 @@ if ($object->id > 0) print ''; // Files infos - print ''; - print ''; + print ''; + print ''; print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
\n"; diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 1d10875b3eb..e27fcf56266 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -76,7 +76,6 @@ $object->info($id); // This overwrite ->ref with login instead of id print '
'; - print '
'; print '
'; From eb37c725138baaee8d2da557244f19341b91a02d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 20:56:48 +0200 Subject: [PATCH 09/19] Uniformise code --- htdocs/product/composition/card.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 3e3fc2d4414..230a3dbee23 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -205,13 +205,16 @@ if ($id > 0 || ! empty($ref)) { $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); - print '
'; - print ''; - + if ($object->type!=Product::TYPE_SERVICE || empty($conf->global->PRODUIT_MULTIPRICES)) + { + print '
'; + print '
'; + } + // Nature - if($object->type!=Product::TYPE_SERVICE) + if ($object->type!=Product::TYPE_SERVICE) { print ''; } - print '
'.$langs->trans("Nature").''; print $object->getLibFinished(); @@ -245,7 +248,10 @@ if ($id > 0 || ! empty($ref)) print '
'; + if ($object->type!=Product::TYPE_SERVICE || empty($conf->global->PRODUIT_MULTIPRICES)) + { + print '
'; + } dol_fiche_end(); From b15535c1f17e061c660ab27bdac8a9e03aba2247 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2016 02:04:46 +0200 Subject: [PATCH 10/19] Uniformize code --- htdocs/core/class/html.form.class.php | 35 ++++++++++++++++++++++----- htdocs/langs/en_US/admin.lang | 6 ++--- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/customerMargins.php | 4 +-- htdocs/margin/productMargins.php | 15 +++--------- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e4dc71fcb9a..da63720a69c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1615,9 +1615,11 @@ class Form * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) * @param array $ajaxoptions Options for ajax_autocompleter * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box * @return void */ - function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0) + function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0) { global $langs,$conf; @@ -1650,14 +1652,14 @@ class Form print img_picto($langs->trans("Search"), 'search'); } } - print 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + print 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; if ($hidelabel == 3) { print img_picto($langs->trans("Search"), 'search'); } } else { - print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid); + print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid,$showempty,$forcecombo); } } @@ -1674,9 +1676,11 @@ class Form * @param int $finished Filter on finished field: 2=No filter * @param int $outputmode 0=HTML select string, 1=Array * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box * @return array Array of keys for json */ - function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0) + function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0) { global $langs,$conf,$user,$db; @@ -1767,8 +1771,27 @@ class Form require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $num = $this->db->num_rows($result); - $out.=''; + + $textifempty=''; + // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. + //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + if (! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) + { + if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty); + else $textifempty.=$langs->trans("All"); + } + if ($showempty) $out.=''; $i = 0; while ($num && $i < $num) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ca53bc971a9..ad8f09205b7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -58,8 +58,8 @@ ErrorCodeCantContainZero=Code can't contain value 0 DisableJavascript=Disable JavaScript and Ajax functions (Recommended for blind person or text browsers) UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. -DelaiedFullListToSelectCompany=Wait you press a key before loading content of thirdparties combo list (This may increase performance if you have a large number of thirdparties) -DelaiedFullListToSelectContact=Wait you press a key before loading content of contact combo list (This may increase performance if you have a large number of contact) +DelaiedFullListToSelectCompany=Wait you press a key before loading content of thirdparties combo list (This may increase performance if you have a large number of thirdparties, but it is less convenient) +DelaiedFullListToSelectContact=Wait you press a key before loading content of contact combo list (This may increase performance if you have a large number of contact, but it is less convenient) NumberOfKeyToSearch=Nbr of characters to trigger search: %s NotAvailableWhenAjaxDisabled=Not available when Ajax disabled AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party @@ -1320,7 +1320,7 @@ ViewProductDescInFormAbility=Visualization of product descriptions in the forms MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the third party language UseSearchToSelectProductTooltip=Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. -UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list). +UseSearchToSelectProduct=Wait you press a key before loading content of product combo list (This may increase performance if you have a large number of products, but it is less convenient) SetDefaultBarcodeTypeProducts=Default barcode type to use for products SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties UseUnits=Define a unit of measure for Quantity during order, proposal or invoice lines edition diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 14a5219d31c..2675e3c95b0 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -94,7 +94,7 @@ dol_fiche_head($head, 'agentMargins', $titre, 0, $picto); print ''; print ''; -print ''; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 54b83aca42c..34463db14e2 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -90,7 +90,7 @@ if ($socid > 0) { if ($soc->client) { print ''; - print ''; @@ -102,7 +102,7 @@ if ($socid > 0) { } else { print ''; - print ''; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 7a2ac98a5f8..24150a1050c 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -105,20 +105,17 @@ print '
'.$langs->trans('SalesRepresentative').''; +print ''; print $form->select_dolusers($agentid, 'agentid', 1, '', $user->rights->margins->read->all ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '
'.$langs->trans('ThirdPartyName').''; + print ''; print $form->select_company($socid, 'socid', 'client=1 OR client=3', 1, 0, 0); //$form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,$socid,'socid','client=1 OR client=3',1,0,1); print '
'.$langs->trans('ThirdPartyName').''; + print ''; print $form->select_company(null, 'socid', 'client=1 OR client=3', 1, 0, 0); //$form->form_thirdparty($_SERVER['PHP_SELF'],null,'socid','client=1 OR client=3',1,0,1); print '
'; if ($id > 0) { print ''; - print ''; - print ''; - print ''; - if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="f.datef"; } else { print ''; - print ''; } @@ -339,10 +336,6 @@ print '
'.$langs->trans('ChooseProduct/Service').''; - print $form->select_produits($id,'id','',20,0,1,2,'',1); + print ''; + print $form->select_produits($id,'id','',20,0,1,2,'',1, array(), 0, 'All'); print '
'.$langs->trans('AllProducts').'
'.$langs->trans('ChooseProduct/Service').''; - print $form->select_produits('','id','',20,0,1,2,'',1); + print ''; + print $form->select_produits('','id','',20,0,1,2,'',1, array(), 0, 'All'); print '