From 5fe0d601da9067de2d8b3ef04780407391613af5 Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Tue, 2 Aug 2016 03:35:22 +0200 Subject: [PATCH 01/24] New: Preview documents --- htdocs/core/class/html.formfile.class.php | 33 +++++++++++++ htdocs/core/js/lib_head.js.php | 59 +++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 0e57118f4bb..bd7ee30c277 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -619,6 +619,9 @@ class FormFile $out.= ' target="_blank">'; $out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); $out.= ''."\n"; + + $out.= $this->showPreview($file,$modulepart,$relativepath); + $out.= ''; // Show file size @@ -739,6 +742,8 @@ class FormFile $out.= img_mime($relativepath, $file["name"]); $out.= ''."\n"; + $out.= $this->showPreview($file,$modulepart,$relativepath); + $this->infofiles['nboffiles']++; $this->infofiles['files'][]=$file['fullname']; $ext=pathinfo($file["name"], PATHINFO_EXTENSION); @@ -859,6 +864,9 @@ class FormFile //print dol_trunc($file['name'],$maxlength,'middle'); print $file['name']; print ''; + + print $this->showPreview($file,$modulepart,$filepath); + print "\n"; print ''.dol_print_size($file['size'],1,1).''; print ''.dol_print_date($file['date'],"dayhour","tzuser").''; @@ -1320,5 +1328,30 @@ class FormFile return $nboflinks; } + /** + * Show detail icon with link for preview + * @param array $file File + * @param string $modulepart propal, facture, facture_fourn, ... + * @param string $relativepath Relative path of docs + * @return string $out Output string with HTML + */ + public function showPreview($file, $modulepart, $relativepath){ + global $langs, $conf; + + if (empty($conf->use_javascript_ajax)) return ''; + + $out=''; + + $mime_preview = array('jpeg', 'png', 'gif', 'tiff', 'pdf', 'plain', 'css'); + $num_mime = array_search(dol_mimetype($file['name'], '', 1), $mime_preview); + + if( $num_mime!== false){ + $out.= ' '; + $out.= img_picto($langs->trans('Preview'), 'detail').''; + + return $out; + } + } + } diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 0baea91412f..d64b05ccd8c 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -948,6 +948,65 @@ function copyToClipboard(text,text2) return false; } +/* + * Function show document preview + * @params string file File path + * @params string type mime file + * @params string title + */ +function document_preview(file, type, title){ + + var ValidImageTypes = ["image/gif", "image/jpeg", "image/png"]; + + if ($.inArray(type, ValidImageTypes) < 0) { + var width='85%'; + var object_width='100%'; + var height = $( window ).height()*0.90; + var object_height='98%'; + + show_preview(); + + } else { + var object_width=0; + var object_height=0; + + var img = new Image(); + + img.onload = function() { + object_width = this.width; + object_height = this.height; + + width = $( window ).width()*0.90; + if(object_width < width){ + width = object_width + 30 + } + height = $( window ).height()*0.85; + if(object_height < height){ + height = object_height + 80 + } + + show_preview(); + + }; + img.src = file; + + } + function show_preview(){ + + var newElem = ''; + + $("#dialogforpopup").html(newElem); + $("#dialogforpopup").dialog({ + closeOnEscape: true, + resizable: true, + width: width, + height: height, + modal: true, + title: title + }); + } +} + /* * Provide a function to get an URL GET parameter in javascript * From dd2e43754ef894aa04cce2fbc3b8f0e564c404bc Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 2 Aug 2016 06:02:01 +0200 Subject: [PATCH 02/24] Uniformize presentation in Thirdparty --- htdocs/margin/tabs/thirdpartyMargins.php | 5 ++++- htdocs/societe/note.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 29bdd16b21e..1d4d1f8f0ca 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -50,6 +50,7 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="f.datef"; $object = new Societe($db); +if ($socid > 0) $object->fetch($socid); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('thirdpartymargins','globalcard')); @@ -72,8 +73,10 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e $invoicestatic=new Facture($db); $form = new Form($db); +$title=$langs->trans("ThirdParty").' - '.$langs->trans("Margins"); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files"); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_url); +llxHeader('',$title,$help_url); if ($socid > 0) { diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 156a4620634..5c9bc15328f 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -57,8 +57,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, $form = new Form($db); +$title=$langs->trans("ThirdParty").' - '.$langs->trans("Notes"); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files"); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Notes"),$help_url); +llxHeader('',$title,$help_url); if ($id > 0) { From f232ae9160c5804faca5c8768ecee45739d2a354 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 2 Aug 2016 07:47:15 +0200 Subject: [PATCH 03/24] Fix Expense report | VAT disable in Dolibarr, traduction of code_libelle & presentation --- htdocs/expensereport/card.php | 28 +++++++++++++++++----------- htdocs/expensereport/info.php | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 25688bf6e6e..df2fe11bfbd 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -831,6 +831,7 @@ if ($action == "addline" && $user->rights->expensereport->creer) $object_ligne = new ExpenseReportLine($db); + $vatrate = GETPOST('vatrate'); $object_ligne->comments = GETPOST('comments'); $qty = GETPOST('qty','int'); if (empty($qty)) $qty=1; @@ -843,10 +844,13 @@ if ($action == "addline" && $user->rights->expensereport->creer) $object_ligne->fk_c_type_fees = GETPOST('fk_c_type_fees'); - $object_ligne->fk_c_tva = GETPOST('fk_c_tva'); + // if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary. + if (empty($vatrate)) $vatrate = "0.000"; + $object_ligne->vatrate = price2num($vatrate); $object_ligne->fk_projet = $fk_projet; + if (! GETPOST('fk_c_type_fees') > 0) { @@ -854,10 +858,11 @@ if ($action == "addline" && $user->rights->expensereport->creer) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action=''; } - if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') + + if ($vatrate < 0 || $vatrate == '') { $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("VAT")), null, 'errors'); $action=''; } @@ -1096,7 +1101,7 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -1211,7 +1216,7 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''; @@ -1374,7 +1379,7 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''; @@ -1683,7 +1688,8 @@ else } print ''; } - print ''; + // print ''; + print ''; print ''; print ''; print ''; @@ -1789,7 +1795,7 @@ else print ''; if (! empty($conf->projet->enabled)) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1807,7 +1813,7 @@ else // Select project if (! empty($conf->projet->enabled)) { - print ''; } @@ -1818,7 +1824,7 @@ else print ''; // Add comments - print ''; diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php index b4302631c78..a5a3c830975 100644 --- a/htdocs/expensereport/info.php +++ b/htdocs/expensereport/info.php @@ -40,7 +40,7 @@ $result = restrictedArea($user, 'expensereport', $id, ''); * View */ -llxHeader(); +llxHeader('', $langs->trans("ExpenseReport")); if ($id) { From 88dcb279813aa5aa36beb04409b20224040bf2f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Aug 2016 21:24:14 +0200 Subject: [PATCH 04/24] Fix option not visible when it should --- htdocs/admin/fckeditor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index e244941ff58..3cb111c4d53 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -56,7 +56,7 @@ $conditions = array( 'SOCIETE' => 1, 'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'MAILING' => ! empty($conf->mailing->enabled), -'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)), +'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)), 'USERSIGN' => 1, 'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)) ); From 216ec6ac4bc2ef5fb7b07dd900f2f5ddb0fd64e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Aug 2016 23:33:31 +0200 Subject: [PATCH 05/24] Label week too long with some language --- htdocs/langs/en_US/main.lang | 1 + htdocs/projet/activity/perweek.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index bb8ffeb6b4f..150abc1b4b8 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -256,6 +256,7 @@ DurationDays=days Year=Year Month=Month Week=Week +WeekShort=Week Day=Day Hour=Hour Minute=Minute diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 53b9ba151b4..4a4a0a27713 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -291,7 +291,7 @@ $param=($mode?'&mode='.$mode:''); // Show navigation bar $nav ="".img_previous($langs->trans("Previous"))."\n"; -$nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week." \n"; +$nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("WeekShort")." ".$week." \n"; $nav.="".img_next($langs->trans("Next"))."\n"; $nav.="   (".$langs->trans("Today").")"; $nav.='
'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' '; From 6ae8d26a89bc6d5a748c8683504276d2ecaf4bfa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Aug 2016 00:04:38 +0200 Subject: [PATCH 06/24] Fix max width on combo of tasks --- htdocs/core/class/html.formprojet.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index a588fc8f241..4c4c1486d51 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -149,7 +149,7 @@ class FormProjets $resql=$this->db->query($sql); if ($resql) { - $minmax=''; + $minmax='maxwidth500'; // Use select2 selector $nodatarole=''; @@ -314,7 +314,7 @@ class FormProjets $resql=$this->db->query($sql); if ($resql) { - $minmax=''; + $minmax='maxwidth500'; // Use select2 selector $nodatarole=''; @@ -324,7 +324,7 @@ class FormProjets $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); $out.=$comboenhancement; $nodatarole=($comboenhancement?' data-role="none"':''); - $minmax='minwidth200'; + $minmax='minwidth200 maxwidth500'; } if (empty($option_only)) { From abbe204c97fb644aa0381e1a41d53491e219d08d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Aug 2016 01:42:05 +0200 Subject: [PATCH 07/24] Fix design of option PROJECT_ADD_SUBTOTAL_LINES --- htdocs/fourn/class/fournisseur.commande.class.php | 2 ++ htdocs/fourn/commande/card.php | 3 ++- htdocs/projet/element.php | 2 +- htdocs/theme/eldy/style.css.php | 3 +++ htdocs/theme/md/style.css.php | 4 +++- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 306dfbbb9a7..5021061ec19 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1078,6 +1078,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ", note_public"; $sql.= ", entity"; $sql.= ", fk_soc"; + $sql.= ", fk_projet"; $sql.= ", date_creation"; $sql.= ", date_livraison"; $sql.= ", fk_user_author"; @@ -1099,6 +1100,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ", '".$this->db->escape($this->note_public)."'"; $sql.= ", ".$conf->entity; $sql.= ", ".$this->socid; + $sql.= ", ".($this->fk_project > 0 ? $this->fk_project : "null"); $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null"); $sql.= ", ".$user->id; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 500b240fa16..afaff18734c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -971,7 +971,8 @@ if (empty($reshook)) $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); - + $object->fk_project = GETPOST('projectid'); + // Fill array 'array_options' with data from add form if (! $error) { diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 85ffae8b4b6..80b9499ed9e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -876,7 +876,7 @@ foreach ($listofreferent as $key => $value) if (canApplySubtotalOn($tablename)) { - $breakline='
'; + $breakline=''; $breakline.=''; $breakline.=''; - + $ret.='
'.$langs->trans("DateStart").''.$langs->trans("DateStart").''; $form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1); print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).''.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).''.($langs->trans(($objp->type_fees_code)) == $objp->type_fees_code ? $objp->type_fees_libelle : $langs->trans(($objp->type_fees_code))).''.$objp->comments.''.vatrate($objp->vatrate,true).''.price($objp->value_unit).''.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Type').''.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''; + print ''; $formproject->select_projects(-1, $fk_projet, 'fk_projet', 0, 0, 1, 1); print ''; + print ''; print ''; print '
'; $breakline.=''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 570dab7e959..092188f5616 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2760,6 +2760,9 @@ input.liste_titre { form.liste_total div { border-top: 1px solid #DDDDDD; } +tr.liste_sub_total, tr.liste_sub_total td { + border-bottom: 2px solid #aaa; +} .tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair { background: #FFF; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 157beca791f..0a54d06b1ac 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2634,7 +2634,9 @@ input.liste_titre { padding: 4px; height: 20px; } - +tr.liste_sub_total, tr.liste_sub_total td { + border-bottom: 2px solid #aaa; +} .tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair { background: #FFF; From b97223edd7a3ae6f1839fd18be23da12a02a9699 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Aug 2016 19:01:51 +0200 Subject: [PATCH 08/24] Fix: link to link to objects not visible --- htdocs/core/class/html.form.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3354aa01209..813e1aa9a12 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5266,8 +5266,8 @@ class Form * Show block with links to link to other objects. * * @param CommonObject $object Object we want to show links to - * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order') - * @return string <0 if KO, >0 if OK + * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction. + * @return string <0 if KO, >0 if OK */ function showLinkToObjectBlock($object, $restrictlinksto=array()) { @@ -5278,8 +5278,7 @@ class Form if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); - - if (((! is_array($restrictlinksto)) || in_array('order',$restrictlinksto)) + if ((empty($restrictlinksto) || in_array('order',$restrictlinksto)) && ! empty($conf->commande->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; @@ -5346,7 +5345,7 @@ class Form print ''; } - if ((in_array('fichinter',$restrictlinksto)) && ! empty($conf->ficheinter->enabled)) + if ((empty($restrictlinksto) || (in_array('fichinter',$restrictlinksto))) && ! empty($conf->ficheinter->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedFichinter') . ''; @@ -5407,7 +5406,7 @@ class Form print ''; } - if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto)) + if ((empty($restrictlinksto) || in_array('supplier_order',$restrictlinksto)) && ! empty($conf->fournisseur->enabled)) { $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; From 7c97bf900f26fdaf7c0b58477361d05e4fcd0d3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Aug 2016 20:52:50 +0200 Subject: [PATCH 09/24] Neutral colors --- htdocs/theme/eldy/img/puce.png | Bin 504 -> 223 bytes htdocs/theme/md/img/puce.png | Bin 193 -> 223 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/theme/eldy/img/puce.png b/htdocs/theme/eldy/img/puce.png index 8c116b0dc4218939fcb62ee4087b2f2a353f6d03..55046304094972d0793a1d8d682c201037fafd00 100644 GIT binary patch delta 195 zcmeyte4lZGO1*1(>A_xJZn}AFP21!XtV`F0Fdh=fP-1cm_c}syE0Iru&0Y-2*>s0gaxt>9zIkIZBSxh Y&?sTZjV^6|1(as+boFyt=akR{07{5IGynhq literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~e!3-p0EYEHRQs)DFLR<~Kq6~wQErX&ggR(87 zvMrN~or02`fMjyDQ#KH_cmYvyk5~1SpzPwH>N!CzK(sU}yE+O;_NzuvkmhQc_^w_<%$Iflt3j)Wk-8%;a*RGwr_x#+w_vfC! zzxMq3wde2e0l{++cn<{MA>jY_{~&Pc%Ss8L*IY}2{DQ#(6cP-Z-fgr18aUb0#W92< zn)P5bS5tsU+r{;d1NWpvIx2j55;5yPgOtNwk=CHDH~-&UyA{LuciPN7uNagJe3hSV zdREhvlTfwf*xkwJ&nI~|lxt}+UdUB3=+)6-NXTdEzHPPcnZ*)u!SJ*PlTOPjwQ@VG z+j2?ZMVZ>kNi!=qsyqFk%c#2fLU;;uWpvGwlr7Vf-C17!Dww`$**fnZ%ym*B!7NOT Rj6mlxc)I$ztaD0e0st>n9KQen diff --git a/htdocs/theme/md/img/puce.png b/htdocs/theme/md/img/puce.png index 9bd70dccb731658e40d16ba29f4c09174d35c5ec..55046304094972d0793a1d8d682c201037fafd00 100644 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~e!3-p0EYEHRQmz3$A+G-!82$qxhyc+*qMiYW zAOwhR0x}sGBqb${jg5VLeA3d=>g(%g&YZbv)21_L&OCkk^#A|=eKS%n0u?cq1o;Is zI6S+N2I3@nySp%Su*!M>Ih+L^k;M!Q+`=Ht$S`Y;1W=H@#M9T6{Q(EFkTHYs9Cu}) tkg%tVV+hCfwJ?4sjygS@*6UV$`p=OU}W|`P`E>nNbW^*u1E}vst(w2g3%gran6&F1} sp;E6RlKqGGbkhXYo-;l?CVRdzXLGLK=BO9b1auRFr>mdKI;Vst0EEX)`Tzg` From a013e84e0ecc0f072b075610a050145c7d9b9d85 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 4 Aug 2016 09:21:04 +0200 Subject: [PATCH 10/24] NEW : Add color regarding stock even on ajax autocompleter product selector --- htdocs/core/class/html.form.class.php | 182 +++++++++++++------------- 1 file changed, 92 insertions(+), 90 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fbc544b2a14..f8baa72d4cc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -203,7 +203,7 @@ class Form $ret.=$doleditor->Create(1); } $ret.=''; $ret.=''; if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='
'."\n"; @@ -493,7 +493,7 @@ class Form /** * Generate select HTML to choose massaction - * + * * @param string $selected Selected value * @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. * @return string Select list @@ -501,9 +501,9 @@ class Form function selectMassAction($selected, $arrayofaction) { global $conf,$langs,$hookmanager; - + if (count($arrayofaction) == 0) return; - + $disabled=0; $ret='
'; $ret.='
'; - + $ret.=' '; - + return $ret; } - + /** * Return combo list of activated countries, into language of user * @@ -1029,9 +1029,9 @@ class Form $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->COMPANY_USE_SEARCH_TO_SELECT)) + if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { - if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty); + if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty); else $textifempty.=$langs->trans("All"); } if ($showempty) $out.= ''."\n"; @@ -1350,7 +1350,7 @@ class Form * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list * @param string $enableonlytext If option $enableonly is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css - * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). + * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). * @return string HTML select string * @see select_dolgroups */ @@ -1881,7 +1881,7 @@ class Form $outlabel=$objp->label; $outdesc=$objp->description; $outbarcode=$objp->barcode; - + $outtype=$objp->fk_product_type; $outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration,0,dol_strlen($objp->duration)-1):''; $outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration,-1):''; @@ -1898,13 +1898,13 @@ class Form $opt.= $objp->ref; if ($outbarcode) $opt.=' ('.$outbarcode.')'; $opt.=' - '.dol_trunc($label,$maxlengtharticle).' - '; - + $objRef = $objp->ref; if (! empty($filterkey) && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i','$1',$objRef,1); $outval.=$objRef; if ($outbarcode) $outval.=' ('.$outbarcode.')'; $outval.=' - '.dol_trunc($label,$maxlengtharticle).' - '; - + $found=0; // Multiprice @@ -1986,9 +1986,9 @@ class Form } // Price by customer - if (empty($hidepriceinlabel) && !empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + if (empty($hidepriceinlabel) && !empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { - if (!empty($objp->idprodcustprice)) + if (!empty($objp->idprodcustprice)) { $found = 1; @@ -2032,7 +2032,9 @@ class Form if (! empty($conf->stock->enabled) && isset($objp->stock) && $objp->fk_product_type == 0) { $opt.= ' - '.$langs->trans("Stock").':'.$objp->stock; - $outval.=' - '.$langs->transnoentities("Stock").':'.$objp->stock; + + if ($objp->stock > 0) $outval.= ''.' - '.$langs->transnoentities("Stock").':'.$objp->stock.''; + else if ($objp->stock <= 0) $outval.= ''.' - '.$langs->transnoentities("Stock").':'.$objp->stock.''; } if ($outdurationvalue && $outdurationunit) @@ -2066,7 +2068,7 @@ class Form { global $langs,$conf; global $price_level, $status, $finished; - + $selected_input_value=''; if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { @@ -2198,11 +2200,11 @@ class Form if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','$1',$label,1); $opt.=$objp->ref; - if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) $opt.=' ('.$objp->ref_fourn.')'; $opt.=' - '; $outval.=$objRef; - if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) $outval.=' ('.$objRefFourn.')'; $outval.=' - '; $opt.=dol_trunc($label, 72).' - '; @@ -2805,7 +2807,7 @@ class Form { // If not good status if ($active >= 0 && $arraytypes['active'] != $active) continue; - + // On passe si on a demande de filtrer sur des modes de paiments particuliers if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue; @@ -3168,13 +3170,13 @@ class Form $langs->load("categories"); include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - + // For backward compatibility if (is_numeric($type)) { dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); } - + $cat = new Categorie($this->db); $cate_arbo = $cat->get_full_arbo($type,$excludeafterid); @@ -3794,7 +3796,7 @@ class Form } } } - + /** * Show form with multicurrency code * @@ -3824,7 +3826,7 @@ class Form print !empty($selected) ? currency_name($selected,1) : ' '; } } - + /** * Show form with multicurrency rate * @@ -3837,7 +3839,7 @@ class Form function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='') { global $langs, $mysoc, $conf; - + if ($htmlname != "none") { print '
'; @@ -4068,7 +4070,7 @@ class Form /** * Return array of currencies in user language - * + * * @param string $selected preselected currency code * @param string $htmlname name of HTML select list * @param integer $useempty 1=Add empty line @@ -4081,7 +4083,7 @@ class Form $langs->loadCacheCurrencies(''); // Load ->cache_currencies $TCurrency = array(); - + $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency'; $sql.= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; $resql = $db->query($sql); @@ -4089,7 +4091,7 @@ class Form { while ($obj = $db->fetch_object($resql)) $TCurrency[$obj->code] = $obj->code; } - + $out=''; $out.= ''; return $out; } - + /** * Load into the cache vat rates of a country * @@ -4204,7 +4206,7 @@ class Form $defaulttx=preg_replace('/\s*\(.*\)/','',$defaulttx); } //var_dump($selectedrate.'-'.$defaulttx.'-'.$defaultnpr.'-'.$defaultcode); - + // Check parameters if (is_object($societe_vendeuse) && ! $societe_vendeuse->country_code) { @@ -4263,7 +4265,7 @@ class Form // Now we get list $num = $this->load_cache_vatrates($code_country); // If no vat defined, return -1 with message into this->error - + if ($num > 0) { // Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '') @@ -4304,7 +4306,7 @@ class Form $return.= '"'; if ($defaultcode) // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag { - if ($defaultcode == $rate['code']) $return.= ' selected'; + if ($defaultcode == $rate['code']) $return.= ' selected'; } elseif ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr) { @@ -4313,7 +4315,7 @@ class Form $return.= '>'.vatrate($rate['libtva']); //$return.=($rate['code']?' '.$rate['code']:''); $return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used) - + $return.= ''; } @@ -4617,7 +4619,7 @@ class Form { $tmparray=dol_getdate($adddateof); $retstring.=' -
'; print '
     
'; - + print ''; $this->db->free($resqlorderlist); } else { @@ -5607,9 +5609,9 @@ class Form //print "xx".$previous_ref."x".$next_ref; $ret.='
'; - + if ($morehtmlleft) $ret.='
'.$morehtmlleft.'
'; - + $ret.='
'; // For thirdparty and contact, the ref is the id, so we show something else @@ -5629,7 +5631,7 @@ class Form $ret.='
'; if ($morehtmlright) $ret.='
'.$morehtmlright.'
'; - + if ($previous_ref || $next_ref || $morehtml) { $ret.=''; - + return $ret; } @@ -5708,7 +5710,7 @@ class Form if ($modulepart=='societe') { $dir=$conf->societe->multidir_output[$entity]; - if (! empty($object->logo)) + if (! empty($object->logo)) { if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small'); @@ -5743,7 +5745,7 @@ class Form else if ($modulepart=='memberphoto') { $dir=$conf->adherent->dir_output; - if (! empty($object->photo)) + if (! empty($object->photo)) { if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); @@ -5752,11 +5754,11 @@ class Form } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; - } - else + } + else { $dir=$conf->$modulepart->dir_output; - if (! empty($object->photo)) + if (! empty($object->photo)) { if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); @@ -5934,10 +5936,10 @@ class Form * @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this * @param string $cssclass CSS class * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes - * @return string + * @return string */ function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0) - { + { global $conf, $langs; $out=''; From 13f33ab9c7c6c638fffde01480d2d53d26ebd985 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 4 Aug 2016 09:23:10 +0200 Subject: [PATCH 11/24] syntax --- htdocs/core/class/html.form.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f8baa72d4cc..a75fd5aa28f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2033,8 +2033,11 @@ class Form { $opt.= ' - '.$langs->trans("Stock").':'.$objp->stock; - if ($objp->stock > 0) $outval.= ''.' - '.$langs->transnoentities("Stock").':'.$objp->stock.''; - else if ($objp->stock <= 0) $outval.= ''.' - '.$langs->transnoentities("Stock").':'.$objp->stock.''; + if ($objp->stock > 0) { + $outval.= ' - '.$langs->transnoentities("Stock").':'.$objp->stock.''; + }elseif ($objp->stock <= 0) { + $outval.= ' - '.$langs->transnoentities("Stock").':'.$objp->stock.''; + } } if ($outdurationvalue && $outdurationunit) From f0622139ffde6856d31f271cf053693786dc5b65 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 4 Aug 2016 09:55:16 +0200 Subject: [PATCH 12/24] NEW : Add workflow to classifed propal bill on invoice validation --- htdocs/admin/workflow.php | 5 +++-- ...ace_20_modWorkflow_WorkflowManager.class.php | 17 +++++++++++++++-- htdocs/langs/en_US/workflow.lang | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 28feb8ab23e..717a25aa8b3 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -76,6 +76,7 @@ $workflowcodes=array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'), 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), + 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), // For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card. 'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), @@ -110,8 +111,8 @@ foreach($workflowcodes as $key => $params) print ' '.$langs->trans("Status").''; print "\n"; $oldfamily = $family; - } - + } + $var = !$var; print "\n"; print "".img_object('', $picto).$langs->trans('desc'.$key); diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index b0b4893d485..fd97edc8089 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -64,7 +64,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $newobject->context['createfrompropal'] = 'createfrompropal'; $newobject->context['origin'] = $object->element; $newobject->context['origin_id'] = $object->id; - + $ret=$newobject->createFromProposal($object); if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; } return $ret; @@ -83,7 +83,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $newobject->context['createfromorder'] = 'createfromorder'; $newobject->context['origin'] = $object->element; $newobject->context['origin_id'] = $object->id; - + $ret=$newobject->createFromOrder($object); if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; } return $ret; @@ -144,6 +144,19 @@ class InterfaceWorkflowManager extends DolibarrTriggers } return $ret; } + + if (! empty($conf->propal->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL)) + { + $object->fetchObjectLinked('','propal',$object->id,$object->element); + if (! empty($object->linkedObjects)) + { + foreach($object->linkedObjects['propal'] as $element) + { + $ret=$element->classifyBilled($user); + } + } + return $ret; + } } return 0; diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index 1c59a3651ec..688938f28ea 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -9,3 +9,4 @@ descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice af descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated +descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer invoice is validated From da84fac390306ebe5f7c7cadc68c9df89b6b1fb3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 10:08:58 +0200 Subject: [PATCH 13/24] Fix: data were lost if creation failed --- htdocs/langs/en_US/projects.lang | 2 +- htdocs/projet/card.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index fe21b3558ba..8c23135ddbd 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -174,7 +174,7 @@ ProjectOpenedProjectByOppStatus=Open project/lead by opportunity status ProjectsStatistics=Statistics on projects/leads TaskAssignedToEnterTime=Task assigned. Entering time on this task should be possible. IdTaskTime=Id task time -YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label. +YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label. But best practice may be to add a dedicated field, also called complementary attributes. OpenedProjectsByThirdparties=Open projects by thirdparties OnlyOpportunitiesShort=Only opportunities OpenedOpportunitiesShort=Open opportunities diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1b43eb1dd39..dd111b62396 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -492,7 +492,7 @@ if ($action == 'create' && $user->rights->projet->creer) // Public print ''.$langs->trans("Visibility").''; $array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject")); - print $form->selectarray('public',$array,$object->public); + print $form->selectarray('public',$array,GETPOST('public')?GETPOST('public'):(isset($conf->global->PROJECT_DEFAULT_PUBLIC)?$conf->global->PROJECT_DEFAULT_PUBLIC:$object->public)); print ''; // Date start @@ -510,7 +510,7 @@ if ($action == 'create' && $user->rights->projet->creer) // Opportunity status print ''.$langs->trans("OpportunityStatus").''; print ''; - print $formproject->selectOpportunityStatus('opp_status',$object->opp_status); + print $formproject->selectOpportunityStatus('opp_status', GETPOST('opp_status')?GETPOST('opp_status'):$object->opp_status); print ''; // Opportunity probability From caa987fb613c8643787e06e27029603ba7bc55b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 10:13:27 +0200 Subject: [PATCH 14/24] Clean obsolete comment --- htdocs/fourn/facture/list.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8ffd81c8ea4..574501276be 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -546,19 +546,7 @@ if ($resql) if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); -/* - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref,f.rowid","",$param,"",$sortfield,$sortorder); - if (empty($conf->global->SUPPLIER_INVOICE_HIDE_REF_SUPPLIER)) print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef,f.rowid","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"f.libelle","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); -*/ print "\n"; + print "\n"; // Line for filters From af150c35fc227fb5e4d2ee32437cdae9ce9d19b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 10:19:30 +0200 Subject: [PATCH 15/24] Fix no picto on setup pages --- htdocs/admin/supplier_payment.php | 2 +- htdocs/projet/admin/project.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index bc960c7bd2c..b5732d1f1c9 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -94,7 +94,7 @@ dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), 0, 'company if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMENT_ADDON = 'mod_supplier_payment_bronan'; -print load_fiche_titre($langs->trans("PaymentsNumberingModule")); +print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', ''); print ''; print ''; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 5233832ea05..fca5eeb22f6 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Laurent Destailleur + * Copyright (C) 2011-2016 Laurent Destailleur * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2013 Florian Henry @@ -373,7 +373,7 @@ print '
'; * Projects Numbering model */ -print load_fiche_titre($langs->trans("ProjectsNumberingModules")); +print load_fiche_titre($langs->trans("ProjectsNumberingModules"), '', ''); print '
'; print ''; @@ -477,7 +477,7 @@ print '

'; if (empty($conf->global->PROJECT_HIDE_TASKS)) { // Task numbering module - print load_fiche_titre($langs->trans("TasksNumberingModules")); + print load_fiche_titre($langs->trans("TasksNumberingModules"), '', ''); print ''; print ''; @@ -583,7 +583,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) * Document templates generators */ -print load_fiche_titre($langs->trans("ProjectsModelModule")); +print load_fiche_titre($langs->trans("ProjectsModelModule"), '', ''); // Defini tableau def de modele $type='project'; @@ -742,7 +742,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) * Modeles documents for Task */ - print load_fiche_titre($langs->trans("TaskModelModule")); + print load_fiche_titre($langs->trans("TaskModelModule"), '', ''); // Defini tableau def de modele $type='project_task'; @@ -894,7 +894,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) } -print load_fiche_titre($langs->trans("Other")); +print load_fiche_titre($langs->trans("Other"), '', ''); // Other options $form=new Form($db); From 11ab49d85da58ac265018bff6f60f1903b421a29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 10:27:19 +0200 Subject: [PATCH 16/24] Fix bad help --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 369dde1cf1c..8672056858b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -179,7 +179,7 @@ FeatureDisabledInDemo=Feature disabled in demo Rights=Permissions BoxesDesc=Widgets are components showing some information that you can add to personalize some pages. You can choose between showing the widget or not by selecting target page and clicking 'Activate', or by clicking the dustbin to disable it. OnlyActiveElementsAreShown=Only elements from enabled modules are shown. -ModulesDesc=Dolibarr modules define which functionality is enabled in software. Some modules require permissions you must grant to users, after enabling module. Click on button on/off in column "Status" to enable a module/feature. +ModulesDesc=Dolibarr modules define which functionality is enabled in software. Some modules require permissions you must grant to users, after enabling module. Click on button on/off to enable a module/feature. ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet... ModulesMarketPlaces=More modules... DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external modules From e0b9496f9e18568cf3d14bc1f9bbd53384bb6477 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 10:44:17 +0200 Subject: [PATCH 17/24] Fix link sometimes fails because of id not defined --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 61a999f7a04..2929044a858 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5312,6 +5312,7 @@ class Form $i = 0; print '
'; + print ''; print '
'; print ''; print ''; From 5247faf50f7a52c83063e13e0e2c20a33395349f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 10:48:19 +0200 Subject: [PATCH 18/24] Fix align --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index df2fe11bfbd..d3b25d2277f 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1813,7 +1813,7 @@ else // Select project if (! empty($conf->projet->enabled)) { - print ''; } From 7f6e2a277a32aeabce0d88f569ee441e5535665e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 11:57:37 +0200 Subject: [PATCH 19/24] NEW Link between objects can be done on both side and on all objects --- htdocs/adherents/fiche_subscription.php | 2 +- htdocs/comm/propal/card.php | 6 +- htdocs/commande/card.php | 6 +- htdocs/compta/facture.php | 14 +- htdocs/contrat/card.php | 4 +- htdocs/core/actions_dellink.inc.php | 17 +- htdocs/core/class/commonobject.class.php | 28 ++- htdocs/core/class/html.form.class.php | 266 +++++++---------------- htdocs/expedition/card.php | 4 +- htdocs/expensereport/card.php | 8 +- htdocs/fichinter/card.php | 6 +- htdocs/fourn/commande/card.php | 4 +- htdocs/fourn/facture/card.php | 6 +- htdocs/langs/fr_FR/main.lang | 8 + htdocs/product/stock/productlot_card.php | 4 +- htdocs/supplier_proposal/card.php | 5 +- 16 files changed, 147 insertions(+), 241 deletions(-) diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 28fb2268d4c..2e149dbc028 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -424,7 +424,7 @@ if ($rowid && $action != 'edit') // Show links to link elements /*$linktoelem = $form->showLinkToObjectBlock($object,array('order')); - if ($linktoelem) print '
'.$linktoelem; + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; // Link for paypal payment if (! empty($conf->paypal->enabled) && $object->statut != 0) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 1e580826e96..0e2a4219e55 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2324,9 +2324,9 @@ if ($action == 'create') $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object); - if ($linktoelem) print '
'.$linktoelem; - + $linktoelem = $form->showLinkToObjectBlock($object, null, array('propal')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + print '
'; // print '
'; + print ''; $formproject->select_projects(-1, $fk_projet, 'fk_projet', 0, 0, 1, 1); print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f3240443a6e..21a6ed5fc97 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2614,9 +2614,9 @@ if ($action == 'create' && $user->rights->commande->creer) $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - //$linktoelem = $form->showLinkToObjectBlock($object); - //if ($linktoelem) print '
'.$linktoelem; - + $linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + print '
'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6535cee7c98..7a7cb0c8e62 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -134,14 +134,6 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - // Link invoice to order - if (GETPOST('linkedOrder') && empty($cancel) && $id > 0) - { - $object->fetch($id); - $object->fetch_thirdparty(); - $result = $object->add_object_linked('commande', GETPOST('linkedOrder')); - } - // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->creer) { // if (1 == 0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"])) { @@ -4103,9 +4095,9 @@ else if ($id > 0 || ! empty($ref)) $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object,array('order')); - if ($linktoelem) print '
'.$linktoelem; - + $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + // Link for paypal payment if (! empty($conf->paypal->enabled) && $object->statut != 0) { include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php'; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 5a87d3b3d51..dfa61513f9e 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2021,8 +2021,8 @@ else $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object); - if ($linktoelem) print '
'.$linktoelem; + $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; print '
'; diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 45fb8c5f9ec..63218dde739 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2016 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,22 +18,29 @@ /** * \file htdocs/core/actions_dellink.inc.php - * \brief Code for actions on deleting link between elements + * \brief Code for actions on linking and deleting link between elements */ // $action must be defined // $object must be defined // $permissiondellink must be defined -// $uploaddir (example $conf->projet->dir_output . "/";) $dellinkid = GETPOST('dellinkid','int'); +$addlinkid = GETPOST('idtolinkto','int'); -// Set public note +// Link invoice to order +if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $id > 0 && $addlinkid > 0) +{ + $object->fetch($id); + $object->fetch_thirdparty(); + $result = $object->add_object_linked(GETPOST('addlink'), $addlinkid); +} + +// Delete link if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $dellinkid > 0) { $result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid); if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); } - diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 71540cf16d7..221e9c83062 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2364,6 +2364,10 @@ abstract class CommonObject $origin = (! empty($origin) ? $origin : $this->origin); $origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id); + // Special case + if ($origin == 'order') $origin='commande'; + if ($origin == 'invoice') $origin='facture'; + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; @@ -2548,7 +2552,10 @@ abstract class CommonObject // Set classfile $classfile = strtolower($subelement); $classname = ucfirst($subelement); - if ($objecttype == 'invoice_supplier') { + if ($objecttype == 'order') { + $classfile = 'commande'; $classname = 'Commande'; + } + else if ($objecttype == 'invoice_supplier') { $classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur'; } else if ($objecttype == 'order_supplier') { @@ -2568,15 +2575,18 @@ abstract class CommonObject if ($conf->$module->enabled && (($element != $this->element) || $alsosametype)) { dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); - - foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element + //print '/'.$classpath.'/'.$classfile.'.class.php'; + if (class_exists($classname)) { - $object = new $classname($this->db); - $ret = $object->fetch($objectid); - if ($ret >= 0) - { - $this->linkedObjects[$objecttype][$i] = $object; - } + foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element + { + $object = new $classname($this->db); + $ret = $object->fetch($objectid); + if ($ret >= 0) + { + $this->linkedObjects[$objecttype][$i] = $object; + } + } } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 813e1aa9a12..ccc6c7b2d0f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5264,12 +5264,13 @@ class Form /** * Show block with links to link to other objects. - * + * * @param CommonObject $object Object we want to show links to * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction. + * @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion. * @return string <0 if KO, >0 if OK */ - function showLinkToObjectBlock($object, $restrictlinksto=array()) + function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinksto=array()) { global $conf, $langs, $hookmanager; global $bc; @@ -5278,201 +5279,90 @@ class Form if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); - if ((empty($restrictlinksto) || in_array('order',$restrictlinksto)) - && ! empty($conf->commande->enabled)) + $possiblelinks=array( + 'propal'=>array('enabled'=>$conf->propale->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), + 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id) + ); + + foreach($possiblelinks as $key => $possiblelink) { - $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; - - print ' - - '; - - print '
global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>'; - - $sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_client, c.total_ht"; - $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; - $sql .= ", " . MAIN_DB_PREFIX . "commande as c"; - $sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $object->thirdparty->id . ''; - - $resqlorderlist = $this->db->query($sql); - if ($resqlorderlist) + $num = 0; + + if (! empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || ! in_array($key, $excludelinksto))) { - $num = $this->db->num_rows($resqlorderlist); - $i = 0; - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - while ($i < $num) + print '
global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>'; + $sql = $possiblelink['sql']; + $resqllist = $this->db->query($sql); + if ($resqllist) { - $objp = $this->db->fetch_object($resqlorderlist); - - $var = ! $var; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; + $num = $this->db->num_rows($resqllist); + $i = 0; + + print '
'; + print ''; + print ''; + print ''; + print '
' . $langs->trans("Ref") . '' . $langs->trans("RefCustomer") . '' . $langs->trans("AmountHTShort") . '' . $langs->trans("Company") . '
'; - print ''; - print '' . $objp->ref . '' . $objp->ref_client . '' . price($objp->total_ht) . '' . $objp->name . '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; - - $i ++; + while ($i < $num) + { + $objp = $this->db->fetch_object($resqlorderlist); + + $var = ! $var; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $i++; + } + print '
' . $langs->trans("Ref") . '' . $langs->trans("RefCustomer") . '' . $langs->trans("AmountHTShort") . '' . $langs->trans("Company") . '
'; + print ''; + print '' . $objp->ref . '' . $objp->ref_client . '' . price($objp->total_ht) . '' . $objp->name . '
'; + print '
     
'; + + print ''; + $this->db->free($resqllist); + } else { + dol_print_error($this->db); } - print '
'; - print '
     
'; - - print ''; - $this->db->free($resqlorderlist); - } else { - dol_print_error($this->db); + print '
'; + if ($num > 0) + { + print ' + + + '; + } } - print ''; + $linktoelem.=($linktoelem?'   ':''); + if ($num > 0) $linktoelem.='' . $langs->trans($possiblelink['label']) .' ('.$num.')'; + //else $linktoelem.=$langs->trans($possiblelink['label']); + else $linktoelem.='' . $langs->trans($possiblelink['label']) . ''; } - if ((empty($restrictlinksto) || (in_array('fichinter',$restrictlinksto))) && ! empty($conf->ficheinter->enabled)) - { - $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedFichinter') . ''; - - print ' - - '; - - print '
global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>'; - - $sql = "SELECT s.rowid as socid, s.nom as name, s.client, f.rowid, f.ref"; - $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; - $sql .= ", " . MAIN_DB_PREFIX . "fichinter as f"; - $sql .= ' WHERE f.fk_soc = s.rowid'; - - $resqlorderlist = $this->db->query($sql); - if ($resqlorderlist) - { - $num = $this->db->num_rows($resqlorderlist); - $i = 0; - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - while ($i < $num) - { - $objp = $this->db->fetch_object($resqlorderlist); - - $var = ! $var; - print ''; - print ''; - print ''; - print ''; - print ''; - - $i ++; - } - print '
' . $langs->trans("Ref") . '' . $langs->trans("Company") . '
'; - print ''; - print '' . $objp->ref . '' . $objp->name . '
'; - print '
     
'; - print '
'; - $this->db->free($resqlorderlist); - } else { - dol_print_error($this->db); - } - - print '
'; - } - - if ((empty($restrictlinksto) || in_array('supplier_order',$restrictlinksto)) - && ! empty($conf->fournisseur->enabled)) - { - $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; - - print ' - - '; - - print '
global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>'; - - $sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_supplier, c.total_ht"; - $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; - $sql .= ", " . MAIN_DB_PREFIX . "commande_fournisseur as c"; - $sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $object->thirdparty->id; - - $resqlorderlist = $this->db->query($sql); - if ($resqlorderlist) - { - $num = $this->db->num_rows($resqlorderlist); - $i = 0; - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - while ($i < $num) - { - $objp = $this->db->fetch_object($resqlorderlist); - - $var = ! $var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $i ++; - } - print '
' . $langs->trans("Ref") . '' . $langs->trans("RefSupplier") . '' . $langs->trans("AmountHTShort") . '' . $langs->trans("Company") . '
'; - print ''; - print '' . $objp->ref . '' . $objp->ref_supplier . '' . price($objp->total_ht) . '' . $objp->name . '
'; - print '
 
'; - print '
'; - $this->db->free($resqlorderlist); - } else { - dol_print_error($this->db); - } - - print '
'; - } - - return $linktoelem; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e38ebd977e1..cbcee84451f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1836,8 +1836,8 @@ else if ($id || $ref) // Show links to link elements //$linktoelem = $form->showLinkToObjectBlock($object); - //if ($linktoelem) print '
'.$linktoelem; - + //if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + print '
'; // List of actions on element diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index e177312a7d6..1b9bd2592ea 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2099,11 +2099,9 @@ if ($action != 'create' && $action != 'edit' && ($id || $ref)) // Show links to link elements $linktoelements=array(); - if($conf->global->EXPENSES_LINK_TO_INTERVENTION) $linktoelements[]='fichinter'; - $linktoelem=''; - $linktoelem = $form->showLinkToObjectBlock($object,$linktoelements); - if ($linktoelem) print '
'.$linktoelem; - + if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION)) $linktoelements[]='fichinter'; + $linktoelem = $form->showLinkToObjectBlock($object, $linktoelements, array('expensereport')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; } llxFooter(); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 2a4ec4337f2..833f2140de9 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1667,9 +1667,9 @@ else if ($id > 0 || ! empty($ref)) $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - //$linktoelem = $form->showLinkToObjectBlock($object); - //if ($linktoelem) print '
'.$linktoelem; - + $linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + print '
'; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fa93be5020d..a642855a241 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2834,8 +2834,8 @@ elseif (! empty($object->id)) $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - //$linktoelem = $form->showLinkToObjectBlock($object); - //if ($linktoelem) print '
'.$linktoelem; + $linktoelem = $form->showLinkToObjectBlock($object, null, array('order_supplier')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; print '
'; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 280664ea421..b2c823d68fd 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2239,9 +2239,9 @@ else $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object,array('supplier_order')); - if ($linktoelem) print '
'.$linktoelem; - + $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + print '
'; //print ''; diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 5eb99eb0f43..fd7d8068f15 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -640,6 +640,14 @@ NewAttribute=Nouvel attribut AttributeCode=Code de l'attribut URLPhoto=URL de la photo/logo SetLinkToAnotherThirdParty=Lier vers un autre tiers +LinkToProposal=Link to proposal +LinkToOrder=Link to order +LinkToInvoice=Link to invoice +LinkToSupplierOrder=Link to supplier order +LinkToSupplierProposal=Link to supplier proposal +LinkToSupplierInvoice=Link to supplier invoice +LinkToContract=Link to contract +LinkToIntervention=Link to intervention CreateDraft=Créer brouillon SetToDraft=Retour en brouillon ClickToEdit=Cliquer ici pour éditer diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 4af5b8a4d59..d1346088692 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -366,8 +366,8 @@ print ''.$langs->trans("Fieldimport_key").'showLinkedObjectBlock($object); //$linktoelem = $form->showLinkToObjectBlock($object); - //if ($linktoelem) print '
'.$linktoelem; - + //if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 3e7871b2c4a..16029c5a95e 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1809,9 +1809,10 @@ if ($action == 'create') $somethingshown = $form->showLinkedObjectBlock($object); // Show links to link elements - //$linktoelem = $form->showLinkToObjectBlock($object); - //if ($linktoelem) print '
'.$linktoelem; + $linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_proposal')); + if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + print '
'; // List of actions on element From 26f553a1a8be46c95223bd55eb08a15e6204a4b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 12:04:43 +0200 Subject: [PATCH 20/24] Fix bad position of test --- htdocs/core/class/html.form.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eaf4ddd4d94..83f10b469c0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5358,12 +5358,12 @@ class Form '; } + + $linktoelem.=($linktoelem?'   ':''); + if ($num > 0) $linktoelem.='' . $langs->trans($possiblelink['label']) .' ('.$num.')'; + //else $linktoelem.=$langs->trans($possiblelink['label']); + else $linktoelem.='' . $langs->trans($possiblelink['label']) . ''; } - - $linktoelem.=($linktoelem?'   ':''); - if ($num > 0) $linktoelem.='' . $langs->trans($possiblelink['label']) .' ('.$num.')'; - //else $linktoelem.=$langs->trans($possiblelink['label']); - else $linktoelem.='' . $langs->trans($possiblelink['label']) . ''; } return $linktoelem; From d6886816059d8f5ce7af7e9f38191f0a0a50a1df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 15:45:55 +0200 Subject: [PATCH 21/24] Use standard prefix for supplier order for new install --- .../supplier_order/mod_commande_fournisseur_muguet.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 563e1b6fe1a..0a017e3bc51 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -37,6 +37,16 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders var $prefix='CF'; + /** + * Constructor + */ + function __construct() + { + global $conf; + + if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 5.0) $this->prefix = 'PO'; // We use correct standard code "PO = Purchase Order" + } + /** * Return description of numbering module * From 5126786d60b27e6590bfac02c616539e8d25f05a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 15:46:31 +0200 Subject: [PATCH 22/24] NEW Add option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED --- htdocs/admin/supplier_order.php | 16 ++++++++-------- htdocs/core/modules/modFournisseur.class.php | 4 ++-- .../fourn/class/fournisseur.commande.class.php | 8 ++++---- htdocs/fourn/commande/card.php | 8 ++++---- htdocs/langs/en_US/admin.lang | 2 ++ htdocs/langs/en_US/suppliers.lang | 1 - 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 50eb9c9a322..b19831502f9 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -169,11 +169,11 @@ else if ($action == 'addcat') else if ($action == 'set_SUPPLIER_ORDER_OTHER') { $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string - $doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL','alpha'); + $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED','alpha'); $doubleapproval = price2num($doubleapproval ); $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_DOUBLE_APPROVAL",$doubleapproval,'chaine',0,'',$conf->entity); + $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED",$doubleapproval,'chaine',0,'',$conf->entity); // TODO We add/delete permission here until permission can have a condition on a global var include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; @@ -189,7 +189,7 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER') $newmodule->rights[$r][4] = 'commande'; $newmodule->rights[$r][5] = 'approve2'; - if ($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) + if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { $newmodule->insert_permissions(1); } @@ -474,18 +474,18 @@ print ''.$langs->trans("Value").''; print ' '; print "\n"; $var=false; -if ($conf->global->MAIN_FEATURES_LEVEL > 0) -{ +//if ($conf->global->MAIN_FEATURES_LEVEL > 0) +//{ print ''; - print $langs->trans("UseDoubleApproval").'
'; + print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
'; print $langs->trans("IfSetToYesDontForgetPermission"); print ''; - print ''; + print ''; print ''; print ''; print "\n"; $var=!$var; -} +//} print ''; print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')
'; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 794b6cb50ff..7d5d6752281 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -261,7 +261,7 @@ class modFournisseur extends DolibarrModules $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'export'; - if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)) + if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) { $r++; $this->rights[$r][0] = 1190; @@ -449,7 +449,7 @@ class modFournisseur extends DolibarrModules $this->export_permission[$r]=array(array("fournisseur","commande","export")); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.date_approve'=>'DateApprove','f.date_approve2'=>'DateApprove2','f.note_public'=>"NotePublic",'f.note_private'=>"NotePrivate",'ua1.login'=>'ApprovedBy','ua2.login'=>'ApprovedBy2','fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel'); - if (empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)) + if (empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) { unset($this->export_fields_array['f.date_approve2']); unset($this->export_fields_array['ua2.login']); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 29670e28dc8..54241a36eee 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -71,7 +71,7 @@ class CommandeFournisseur extends CommonOrder public $date; public $date_valid; public $date_approve; - public $date_approve2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set + public $date_approve2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set public $date_commande; /** @@ -101,7 +101,7 @@ class CommandeFournisseur extends CommonOrder public $user_author_id; public $user_valid_id; public $user_approve_id; - public $user_approve_id2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set + public $user_approve_id2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set //Incoterms public $fk_incoterms; @@ -718,7 +718,7 @@ class CommandeFournisseur extends CommonOrder * * @param User $user Object user * @param int $idwarehouse Id of warhouse for stock change - * @param int $secondlevel 0=Standard approval, 1=Second level approval (used when option SUPPLIER_ORDER_DOUBLE_APPROVAL is set) + * @param int $secondlevel 0=Standard approval, 1=Second level approval (used when option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set) * @return int <0 if KO, >0 if OK */ public function approve($user, $idwarehouse=0, $secondlevel=0) @@ -761,7 +761,7 @@ class CommandeFournisseur extends CommonOrder { $sql.= " date_approve='".$this->db->idate($now)."',"; $sql.= " fk_user_approve = ".$user->id; - if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) + if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { if (empty($this->user_approve_id2)) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 500b240fa16..a316aaf0f6a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2659,7 +2659,7 @@ elseif (! empty($object->id)) { if ($user->rights->fournisseur->commande->approuver) { - if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL && ! empty($object->user_approve_id)) + if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && ! empty($object->user_approve_id)) { print ''.$langs->trans("ApproveOrder").''; } @@ -2674,8 +2674,8 @@ elseif (! empty($object->id)) } } - // Second approval (if option SUPPLIER_ORDER_DOUBLE_APPROVAL is set) - if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) + // Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set) + if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { if ($object->statut == 1) { @@ -2732,7 +2732,7 @@ elseif (! empty($object->id)) $buttonshown++; } } - if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)) + if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) { if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2)) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index df79240c4b4..6ce618f5bbd 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -390,6 +390,8 @@ EnableAndSetupModuleCron=If you want to have this recurring invoice beeing gener ModuleCompanyCodeAquarium=Return an accountancy code built by:
%s followed by third party supplier code for a supplier accountancy code,
%s followed by third party customer code for a customer accountancy code. ModuleCompanyCodePanicum=Return an empty accountancy code. ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. +Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to validate and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce an third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1 validation, 2=first approval and 3=second approval). Set this to 0 if only one approval is required, set it to a very low value (0.1) if second approval is always required. +UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... # Modules Module0Name=Users & groups diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index abacb3d7660..6e554c6545e 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -36,7 +36,6 @@ ListOfSupplierOrders=List of supplier orders MenuOrdersSupplierToBill=Supplier orders to invoice NbDaysToDelivery=Delivery delay in days DescNbDaysToDelivery=The biggest deliver delay of the products from this order -UseDoubleApproval=Use double approval when amount (without tax) is higher than (The second approval can be done by any user with the dedicated permission. Set to 0 for no double approval) SupplierReputation=Supplier reputation DoNotOrderThisProductToThisSupplier=Do not order NotTheGoodQualitySupplier=Wrong quality From 4b5cae0af842e414bc707791518650c698482650 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Aug 2016 17:09:49 +0200 Subject: [PATCH 23/24] Fix help --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6ce618f5bbd..afd205e6a61 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -390,7 +390,7 @@ EnableAndSetupModuleCron=If you want to have this recurring invoice beeing gener ModuleCompanyCodeAquarium=Return an accountancy code built by:
%s followed by third party supplier code for a supplier accountancy code,
%s followed by third party customer code for a customer accountancy code. ModuleCompanyCodePanicum=Return an empty accountancy code. ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. -Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to validate and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce an third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1 validation, 2=first approval and 3=second approval). Set this to 0 if only one approval is required, set it to a very low value (0.1) if second approval is always required. +Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce an third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1 validation, 2=first approval and 3=second approval if amount is enough).
Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval is always required. UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... # Modules From 63562beb368331e451e67d5160ff2fb6ab31af22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Aug 2016 01:19:20 +0200 Subject: [PATCH 24/24] Fix move translation key into source language --- htdocs/langs/en_US/main.lang | 8 ++++++++ htdocs/langs/fr_FR/main.lang | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 9cd397fe47f..666e29a276d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -644,6 +644,14 @@ NewAttribute=New attribute AttributeCode=Attribute code URLPhoto=URL of photo/logo SetLinkToAnotherThirdParty=Link to another third party +LinkToProposal=Link to proposal +LinkToOrder=Link to order +LinkToInvoice=Link to invoice +LinkToSupplierOrder=Link to supplier order +LinkToSupplierProposal=Link to supplier proposal +LinkToSupplierInvoice=Link to supplier invoice +LinkToContract=Link to contract +LinkToIntervention=Link to intervention CreateDraft=Create draft SetToDraft=Back to draft ClickToEdit=Click to edit diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 506707a294f..e4dca048a78 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -641,14 +641,6 @@ NewAttribute=Nouvel attribut AttributeCode=Code de l'attribut URLPhoto=URL de la photo/logo SetLinkToAnotherThirdParty=Lier vers un autre tiers -LinkToProposal=Link to proposal -LinkToOrder=Link to order -LinkToInvoice=Link to invoice -LinkToSupplierOrder=Link to supplier order -LinkToSupplierProposal=Link to supplier proposal -LinkToSupplierInvoice=Link to supplier invoice -LinkToContract=Link to contract -LinkToIntervention=Link to intervention CreateDraft=Créer brouillon SetToDraft=Retour en brouillon ClickToEdit=Cliquer ici pour éditer