From 460778818cb5ce7ef6c2a3b8c88624a543211b8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 00:09:42 +0200 Subject: [PATCH 01/28] Fix: automatic ecm for supplier invoices --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index b79b3ef22c6..127323ecc97 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -836,7 +836,7 @@ class FormFile // To show ref or specific information according to view to show (defined by $module) if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'invoice_supplier') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } From 154cd1fcf9956120c8a94f89c038dd7576e12a26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 00:40:22 +0200 Subject: [PATCH 02/28] Fix: Sort on ref for supplier invoice into ged --- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/lib/files.lib.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 127323ecc97..b4103974a03 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -758,7 +758,7 @@ class FormFile print ''; print ''; $sortref="fullname"; - if ($modulepart == 'invoice_supplier') $sortref=''; // No sort for supplier invoices as path name is not + if ($modulepart == 'invoice_supplier') $sortref='level1name'; print_liste_field_titre($langs->trans("Ref"),$url,$sortref,"",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Documents2"),$url,"name","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8ff9e6bbc47..8946ed14654 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -135,8 +135,11 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil if (! $filter || preg_match('/'.$filter.'/i',$file)) // We do not search key $filter into $path, only into $file { + preg_match('/([^\/]+)\/[^\/]+$/',$path.'/'.$file,$reg); + $level1name=(isset($reg[1])?$reg[1]:''); $file_list[] = array( "name" => $file, + "level1name" => $level1name, "fullname" => $path.'/'.$file, "date" => $filedate, "size" => $filesize, @@ -159,8 +162,11 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil if (! $filter || preg_match('/'.$filter.'/i',$file)) // We do not search key $filter into $path, only into $file { + preg_match('/([^\/]+)\/[^\/]+$/',$path.'/'.$file,$reg); + $level1name=(isset($reg[1])?$reg[1]:''); $file_list[] = array( "name" => $file, + "level1name" => $level1name, "fullname" => $path.'/'.$file, "date" => $filedate, "size" => $filesize, From 57ab24bacaa50ffb8a04c79ccdcdedfdd9674592 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 01:08:53 +0200 Subject: [PATCH 03/28] Fix: bad sort order into ecm module --- htdocs/ecm/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index c671fa2e29b..3ca6ccb2221 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -63,6 +63,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="fullname"; +if ($module == 'invoice_supplier' && $sortfield == "fullname") $sortfield="level1name"; $ecmdir = new EcmDirectory($db); if ($section) From 0a3bd586459146b12d102ffd1e106f265043c37a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 03:28:19 +0200 Subject: [PATCH 04/28] Fix: Duplicate button --- htdocs/compta/paiement/cheque/fiche.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 3251b4a1ab6..ae0469d581c 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -344,8 +344,8 @@ if ($action == 'new') $sql.= " AND ba.entity = ".$conf->entity; $sql.= " AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; - if ($filterdate) $sql.=" AND b.dateo = '".$db->idate($filterdate)."'"; - if ($filteraccountid) $sql.=" AND ba.rowid= '".$filteraccountid."'"; + if ($filterdate) $sql.=" AND b.dateo = '".$db->idate($filterdate)."'"; + if ($filteraccountid > 0) $sql.=" AND ba.rowid= '".$filteraccountid."'"; $sql.= $db->order("b.dateo,b.rowid","ASC"); $resql = $db->query($sql); @@ -602,10 +602,10 @@ else print '
'; -if ($user->societe_id == 0 && count($accounts) == 1 && $action == 'new' && $user->rights->banque->cheque) +/*if ($user->societe_id == 0 && count($accounts) == 1 && $action == 'new' && $user->rights->banque->cheque) { print ''.$langs->trans('NewCheckReceipt').''; -} +}*/ if ($user->societe_id == 0 && ! empty($object->id) && $object->statut == 0 && $user->rights->banque->cheque) { From cc124e03c1c7fa964f316ee140eafc1e7a74f82c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 03:38:07 +0200 Subject: [PATCH 05/28] Fix: Missing comma --- build/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/debian/control b/build/debian/control index 8810a7d189c..3fb705087a8 100755 --- a/build/debian/control +++ b/build/debian/control @@ -13,7 +13,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | libphp-adodb, libnusoap-php, libphp-pclzip, - libfpdi-php, libfpdf-tpl-php, php-fpdf + libfpdi-php, libfpdf-tpl-php, php-fpdf, libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor, ttf-dejavu-core, xdg-utils, From f4dfac045a2f39b267c19de3ae22b9bd53da819f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 20:20:52 +0200 Subject: [PATCH 06/28] Fix: Bad default mysql driver --- htdocs/install/inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 7d4a22fffa2..fe7dd58cabc 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -82,7 +82,7 @@ if (! defined('DONOTLOADCONF') && file_exists($conffile)) $result=include_once $conffile; // Load conf file if ($result) { - if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // For backward compatibility + if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysqli'; // For backward compatibility // Clean parameters $dolibarr_main_data_root =isset($dolibarr_main_data_root)?trim($dolibarr_main_data_root):''; @@ -323,7 +323,7 @@ function conf($dolibarr_main_document_root) { throw new Exception('Missing log handler file '.$handler.'.php'); } - + require_once $file; $loghandlerinstance = new $handler(); if (!$loghandlerinstance instanceof LogHandlerInterface) @@ -333,7 +333,7 @@ function conf($dolibarr_main_document_root) if (empty($conf->loghandlers[$handler])) $conf->loghandlers[$handler]=$loghandlerinstance; } - + return 1; } From dc5ad1a0f3ce4d4acfcbe281e23c5ca188dfd480 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 20:29:07 +0200 Subject: [PATCH 07/28] Fix: Total missing --- htdocs/compta/facture/impayees.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 48c0f5c1e9e..975211b11bf 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -400,7 +400,7 @@ if ($resql) print '
'; print ''; print ''; - print ''; + print ''; print ''; print ''; print "\n"; From 5fb707f918fbdaaa108c9915509585c651a2bc32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2013 21:02:00 +0200 Subject: [PATCH 08/28] Fix: Restore disappeared feature --- htdocs/compta/facture/impayees.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index bd207b7dbfc..79838cbe86b 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -283,7 +283,7 @@ if ($resql) print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$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("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("Remain"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print "\n"; @@ -300,7 +300,9 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; + print ''; print ''; // Remain to receive - //print ''; + print ''; // Status of invoice print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Town'),$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('DateEndPropalShort'),$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder); @@ -280,6 +288,7 @@ if ($result) print ''; + print ''; print ''; @@ -344,9 +353,12 @@ if ($result) print ''; - + + print ''; // Customer ref - print ''; @@ -399,14 +411,14 @@ if ($result) if($num<$limit){ $var=!$var; print ''; - print ''; } else { $var=!$var; print ''; - print ''; } From 3dac43f27a772c03c3543b6dd75863610e3e3989 Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Tue, 9 Jul 2013 10:55:58 +0200 Subject: [PATCH 15/28] Possibility to edit the ref_client when we want --- htdocs/comm/propal.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 155e2cc0e78..8b0ba5e259f 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1595,9 +1595,13 @@ else print ''; // Ref client + print '
'.price($total_tva).' '.getCurrencySymbol($conf->currency).''.price($total_ttc).' '.getCurrencySymbol($conf->currency).''.price($total_paid).' '.getCurrencySymbol($conf->currency).' '.price($total_ttc - $total_paid).' '.getCurrencySymbol($conf->currency).'  
 '; + print '  '; print ''; print ''; @@ -382,7 +384,7 @@ if ($resql) print ''.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):' ').''.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):' ').''; From 2ae1e787c94a8de8b059b352a5e5a262d2e9e23e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2013 21:49:54 +0200 Subject: [PATCH 09/28] Fix: Bad date ranges Conflicts: scripts/invoices/rebuild_merge_pdf.php --- htdocs/core/lib/invoice2.lib.php | 6 +++--- scripts/invoices/rebuild_merge_pdf.php | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index d4373fcd204..9c6ccc1268f 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -37,8 +37,8 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); * @param array $filter Array with filters * @param date $dateafterdate Invoice after date * @param date $datebeforedate Invoice before date - * @param date $paymentdateafter Payment after date - * @param date $paymentdatebefore Payment before date + * @param date $paymentdateafter Payment after date (must includes hour) + * @param date $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template * @param string $option Suffix to add into file name of generated PDF @@ -264,4 +264,4 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte else return $result; } -?> \ No newline at end of file +?> diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 6360735ab67..1e5d137dff5 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -107,7 +107,7 @@ foreach ($argv as $key => $value) $dateafterdate=dol_stringtotime($argv[$key+1]); $datebeforedate=dol_stringtotime($argv[$key+2]); - print 'Rebuild PDF for invoices validated between '.dol_print_date($dateafterdate,'day')." and ".dol_print_date($datebeforedate,'day').".\n"; + print 'Rebuild PDF for invoices validated between '.dol_print_date($dateafterdate,'day','gmt')." and ".dol_print_date($datebeforedate,'day','gmt').".\n"; } if ($value == 'filter=payments') @@ -116,9 +116,14 @@ foreach ($argv as $key => $value) $option.=(empty($option)?'':'_').'payments_'.$argv[$key+1].'_'.$argv[$key+2]; $filter[]='payments'; - $paymentdateafter=dol_stringtotime($argv[$key+1]); - $paymentdatebefore=dol_stringtotime($argv[$key+2]); - print 'Rebuild PDF for invoices with at least one payment between '.dol_print_date($paymentdateafter,'day')." and ".dol_print_date($paymentdatebefore,'day').".\n"; + $paymentdateafter=dol_stringtotime($argv[$key+1].'000000'); + $paymentdatebefore=dol_stringtotime($argv[$key+2].'235959'); + if (empty($paymentdateafter) || empty($paymentdatebefore)) + { + print 'Error: Bad date format or value'."\n"; + exit(-1); + } + print 'Rebuild PDF for invoices with at least one payment between '.dol_print_date($paymentdateafter,'day','gmt')." and ".dol_print_date($paymentdatebefore,'day','gmt').".\n"; } if ($value == 'filter=nopayment') From aa8e43cd1beb0f37dab7481f804c9f17404e3719 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 01:09:19 +0200 Subject: [PATCH 10/28] Task 149 : Add number of notes and attached files into tab. Started with thirdparty --- htdocs/core/lib/company.lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 64d8f50c9c7..1d938cee9e3 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -86,9 +86,13 @@ function societe_prepare_head($object) if ($user->societe_id == 0) { - // Notes + // Notes + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; @@ -101,8 +105,10 @@ function societe_prepare_head($object) } // Attached files + $nbFiles = count(dol_dir_list($upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id)); $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'document'; $h++; From c0feda49216ddc5e46db4bdaaf79eaa6ae41ddaa Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 01:28:24 +0200 Subject: [PATCH 11/28] Task 149 : added on product --- htdocs/core/lib/company.lib.php | 3 ++- htdocs/core/lib/product.lib.php | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1d938cee9e3..b85d805fe38 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -105,7 +105,8 @@ function societe_prepare_head($object) } // Attached files - $nbFiles = count(dol_dir_list($upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id)); + $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id; + $nbFiles = count(dol_dir_list($upload_dir)); $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 9b6f48519fa..ccebd10cea5 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -116,8 +116,14 @@ function product_prepare_head($object, $user) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf,$langs,$object,$head,$h,'product'); + // Attachments + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); + elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir)); $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'documents'; $h++; From a6a058ddae594fa2bc74f674fde1f547fb21b87f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 18:45:40 +0200 Subject: [PATCH 12/28] Fix by including lib files --- htdocs/core/lib/company.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index b85d805fe38..774e16e6e68 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -105,6 +105,7 @@ function societe_prepare_head($object) } // Attached files + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id; $nbFiles = count(dol_dir_list($upload_dir)); $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; From 4fee61beb02f8e1d178e3461df0cd0adc9018ceb Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Tue, 16 Jul 2013 21:34:24 +0200 Subject: [PATCH 13/28] Fix adding email into mailing module source_id is already added --- htdocs/core/modules/mailings/modules_mailings.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 9d84058fa87..74d79547e2f 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -169,7 +169,6 @@ class MailingTargets // This can't be abstract as it is used for some method $sql .= "'".$this->db->escape($targetarray['email'])."',"; $sql .= "'".$this->db->escape($targetarray['other'])."',"; $sql .= "'".$this->db->escape($targetarray['source_url'])."',"; - $sql .= "'".$this->db->escape($targetarray['source_id'])."',"; $sql .= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").","; if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) { $sql .= "'".$this->db->escape(md5($targetarray['email'].';'.$targetarray['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',"; From 29094c9623dd5ea6e7485413d3ff4a8dfbdcee3b Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Thu, 18 Jul 2013 09:20:18 +0200 Subject: [PATCH 14/28] Put the town in the list of propal --- htdocs/comm/propal/list.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index c3cc5fbb7cb..e15f22220f1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -54,6 +54,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_author=GETPOST('search_author','alpha'); +$search_ville=GETPOST('search_ville','alpha'); $sall=GETPOST("sall"); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); @@ -101,6 +102,7 @@ if (GETPOST("button_removefilter_x")) $search_societe=''; $search_montant_ht=''; $search_author=''; + $search_ville=''; $year=''; $month=''; } @@ -137,7 +139,7 @@ if (! $sortfield) $sortfield='p.datep'; if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; -$sql = 'SELECT s.rowid, s.nom, s.client, '; +$sql = 'SELECT s.rowid, s.nom, s.town, s.client, '; $sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; @@ -157,6 +159,10 @@ if (! $user->rights->societe->client->voir && ! $socid) //restriction { $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } +if ($search_ville) //restriction +{ + $sql.= " AND s.town LIKE '%".$db->escape(trim($search_ville))."%'"; +} if ($search_ref) { $sql.= " AND p.ref LIKE '%".$db->escape(trim($search_ref))."%'"; @@ -229,6 +235,7 @@ if ($result) if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_author) $param.='&search_author='.$search_author; + if ($search_ville) $param.='&search_ville='.$search_ville; print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); // Lignes des champs de filtre @@ -264,6 +271,7 @@ if ($result) print '
'; print ''; print ''; print ''; print ''; print $companystatic->getNomUrl(1,'customer'); print ''; + print $objp->town; + print ''; + print ''; print $objp->ref_client; print '
'.$langs->trans("Total HT").''.price($total).''; + print ''.price($total).''; print '
'.$langs->trans("Total HT for this page").''.price($total).''; + print ''.price($total).''; print '
'; - print ''; print ''; - // Company print ''; print ''; From 913f4d94cc3ccb466a0c494d2bda2226fa9d3776 Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Tue, 9 Jul 2013 12:20:01 +0200 Subject: [PATCH 16/28] Put the ref_client in the subject mail --- htdocs/comm/propal.php | 12 +++++++++--- htdocs/commande/fiche.php | 10 +++++++++- htdocs/compta/facture.php | 10 +++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 155e2cc0e78..dd9f8edee71 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2263,7 +2263,14 @@ else $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -2272,6 +2279,7 @@ else // Tableau des substitutions $formmail->substit['__PROPREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; @@ -2299,8 +2307,6 @@ else $formmail->param['models']='propal_send'; $formmail->param['id']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files if (GETPOST("mode")=='init') { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 74ed72d835c..89b2fe5181e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2566,7 +2566,14 @@ else $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -2574,6 +2581,7 @@ else // Tableau des substitutions $formmail->substit['__ORDERREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b8bc0b1ed10..21dc0852d9e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3763,7 +3763,14 @@ else if ($id > 0 || ! empty($ref)) $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -3771,6 +3778,7 @@ else if ($id > 0 || ! empty($ref)) // Tableau des substitutions $formmail->substit['__FACREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; From d5ca2f9f4057607847340b050e5a740cc764b3a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Jul 2013 15:37:14 +0200 Subject: [PATCH 17/28] Fix: forged select for stats where wrong when filtering on a thirdparty Conflicts: htdocs/compta/facture/class/facturestats.class.php --- .../comm/propal/class/propalestats.class.php | 48 ++++++++--------- htdocs/commande/class/commandestats.class.php | 51 ++++++++++--------- .../facture/class/facturestats.class.php | 25 +++++---- 3 files changed, 64 insertions(+), 60 deletions(-) diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 34584c7f99e..5b5b0dd7279 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -1,6 +1,6 @@ - * Copyright (c) 2005 Laurent Destailleur + * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (c) 2011 Juanjo Menent * @@ -30,8 +30,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** - * \class PropaleStats - * \brief Classe permettant la gestion des stats des propales + * Class to manage proposal statistics */ class PropaleStats extends Stats { @@ -49,7 +48,7 @@ class PropaleStats extends Stats * Constructor * * @param DoliDB $db Database handler - * @param int $socid Id third party + * @param int $socid Id third party for filter * @param int $userid Id user for filter (creation user) */ function __construct($db, $socid=0, $userid=0) @@ -63,16 +62,17 @@ class PropaleStats extends Stats $object=new Propal($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as p"; - $this->from.= ", ".MAIN_DB_PREFIX."societe as s"; + //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; $this->field='total_ht'; $this->where.= " p.fk_statut > 0"; - $this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->societe_id) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; + //$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; + $this->where.= " AND p.entity = ".$conf->entity; + if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if($this->socid) { - $this->where .= " AND p.fk_soc = ".$this->socid; + $this->where.=" AND p.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where.=' AND fk_user_author = '.$this->userid; } @@ -81,14 +81,14 @@ class PropaleStats extends Stats /** * Return propals number by month for a year * - * @param int $year year for stats - * @return array array with number by month + * @param int $year Year to scan + * @return array Array with number by month */ function getNbByMonth($year) { global $user; - $sql = "SELECT date_format(p.datep,'%m') as dm, count(*)"; + $sql = "SELECT date_format(p.datep,'%m') as dm, COUNT(*) as nb"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -96,22 +96,23 @@ class PropaleStats extends Stats $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); - return $this->_getNbByMonth($year, $sql); + $res=$this->_getNbByMonth($year, $sql); + return $res; } /** - * Return propals number by year + * Return propals number per year * - * @return array array with number by year + * @return array Array with number by year * */ function getNbByYear() { global $user; - $sql = "SELECT date_format(p.datep,'%Y') as dm, count(*)"; + $sql = "SELECT date_format(p.datep,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql.= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); @@ -122,22 +123,23 @@ class PropaleStats extends Stats /** * Return the propals amount by month for a year * - * @param int $year year for stats - * @return array array with number by month + * @param int $year Year to scan + * @return array Array with amount by month */ function getAmountByMonth($year) { global $user; - $sql = "SELECT date_format(p.datep,'%m') as dm, sum(p.".$this->field.")"; + $sql = "SELECT date_format(p.datep,'%m') as dm, SUM(p.".$this->field.")"; $sql.= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); - return $this->_getAmountByMonth($year, $sql); + $res=$this->_getAmountByMonth($year, $sql); + return $res; } /** @@ -150,7 +152,7 @@ class PropaleStats extends Stats { global $user; - $sql = "SELECT date_format(p.datep,'%m') as dm, avg(p.".$this->field.")"; + $sql = "SELECT date_format(p.datep,'%m') as dm, AVG(p.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -170,7 +172,7 @@ class PropaleStats extends Stats { global $user; - $sql = "SELECT date_format(p.datep,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg"; + $sql = "SELECT date_format(p.datep,'%Y') as year, COUNT(*) as nb, SUM(".$this->field.") as total, AVG(".$this->field.") as avg"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 6de20836f35..c5923edbb55 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -1,6 +1,6 @@ - * Copyright (c) 2005 Laurent Destailleur + * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * @@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** - * Class to manage order statistics + * Class to manage order statistics (customer and supplier) */ class CommandeStats extends Stats { @@ -49,7 +49,7 @@ class CommandeStats extends Stats * * @param DoliDB $db Database handler * @param int $socid Id third party for filter - * @param string $mode Option + * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ function __construct($db, $socid, $mode, $userid=0) @@ -60,12 +60,13 @@ class CommandeStats extends Stats $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; - + $this->cachefilesuffix = $mode; + if ($mode == 'customer') { $object=new Commande($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; - $this->from.= ", ".MAIN_DB_PREFIX."societe as s"; + //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; $this->field='total_ht'; $this->where.= " c.fk_statut > 0"; // Not draft and not cancelled } @@ -73,16 +74,16 @@ class CommandeStats extends Stats { $object=new CommandeFournisseur($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; - $this->from.= ", ".MAIN_DB_PREFIX."societe as s"; + //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; $this->field='total_ht'; $this->where.= " c.fk_statut > 2"; // Only approved & ordered } - $this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; - + //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; + $this->where.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; - if($this->socid) + if ($this->socid) { - $this->where .= " AND c.fk_soc = ".$this->socid; + $this->where.=" AND c.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where.=' AND c.fk_user_author = '.$this->userid; } @@ -90,14 +91,14 @@ class CommandeStats extends Stats /** * Return orders number by month for a year * - * @param int $year year for stats - * @return array array with number by month + * @param int $year Year to scan + * @return array Array with number by month */ function getNbByMonth($year) { global $user; - $sql = "SELECT date_format(c.date_commande,'%m') as dm, count(*) nb"; + $sql = "SELECT date_format(c.date_commande,'%m') as dm, COUNT(*) as nb"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -105,20 +106,21 @@ class CommandeStats extends Stats $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); - return $this->_getNbByMonth($year, $sql); + $res=$this->_getNbByMonth($year, $sql); + return $res; } /** - * Return orders number by year + * Return orders number per year * - * @return array array with number by year + * @return array Array with number by year * */ function getNbByYear() { global $user; - $sql = "SELECT date_format(c.date_commande,'%Y') as dm, count(*), sum(c.".$this->field.")"; + $sql = "SELECT date_format(c.date_commande,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; @@ -131,14 +133,14 @@ class CommandeStats extends Stats /** * Return the orders amount by month for a year * - * @param int $year year for stats - * @return array array with number by month + * @param int $year Year to scan + * @return array Array with amount by month */ function getAmountByMonth($year) { global $user; - $sql = "SELECT date_format(c.date_commande,'%m') as dm, sum(c.".$this->field.")"; + $sql = "SELECT date_format(c.date_commande,'%m') as dm, SUM(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -146,7 +148,8 @@ class CommandeStats extends Stats $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); - return $this->_getAmountByMonth($year, $sql); + $res=$this->_getAmountByMonth($year, $sql); + return $res; } /** @@ -159,7 +162,7 @@ class CommandeStats extends Stats { global $user; - $sql = "SELECT date_format(c.date_commande,'%m') as dm, avg(c.".$this->field.")"; + $sql = "SELECT date_format(c.date_commande,'%m') as dm, AVG(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -179,7 +182,7 @@ class CommandeStats extends Stats { global $user; - $sql = "SELECT date_format(c.date_commande,'%Y') as year, count(*) as nb, sum(c.".$this->field.") as total, avg(".$this->field.") as avg"; + $sql = "SELECT date_format(c.date_commande,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; @@ -190,4 +193,4 @@ class CommandeStats extends Stats } } -?> +?> \ No newline at end of file diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index c2e42addbb5..a168e483d7c 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -1,6 +1,6 @@ - * Copyright (c) 2005-2012 Laurent Destailleur + * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -46,10 +46,9 @@ class FactureStats extends Stats * Constructor * * @param DoliDB $db Database handler - * @param int $socid Id third party - * @param string $mode Option + * @param int $socid Id third party for filter + * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) - * @return FactureStats */ function __construct($db, $socid, $mode, $userid=0) { @@ -74,7 +73,7 @@ class FactureStats extends Stats $this->where = " f.fk_statut > 0"; $this->where.= " AND f.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->societe_id) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; + if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($mode == 'customer') $this->where.=" AND (f.fk_statut <> 3 OR f.close_code <> 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons) if ($this->socid) { @@ -85,7 +84,7 @@ class FactureStats extends Stats /** - * Renvoie le nombre de facture par mois pour une annee donnee + * Return orders number by month for a year * * @param int $year Year to scan * @return array Array of values @@ -94,7 +93,7 @@ class FactureStats extends Stats { global $user; - $sql = "SELECT MONTH(f.datef) as dm, COUNT(*)"; + $sql = "SELECT date_format(f.datef,'%m') as dm, COUNT(*) as nb"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -109,15 +108,15 @@ class FactureStats extends Stats /** - * Renvoie le nombre de facture par annee + * Return invoices number per year * - * @return array Array of values + * @return array Array with number by year */ function getNbByYear() { global $user; - $sql = "SELECT YEAR(f.datef) as dm, COUNT(*)"; + $sql = "SELECT date_format(f.datef,'%Y') as dm, COUNT(*), SUM(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; @@ -129,10 +128,10 @@ class FactureStats extends Stats /** - * Renvoie le montant de facture par mois pour une annee donnee + * Return the invoices amount by month for a year * * @param int $year Year to scan - * @return array Array of values + * @return array Array with amount by month */ function getAmountByMonth($year) { @@ -140,7 +139,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")"; $sql.= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; From 3896cde2998ca736f74735e0f465b34756214933 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 13:38:57 +0200 Subject: [PATCH 18/28] Removed useless method. Prefer using generic method. --- .../cheque/class/remisecheque.class.php | 73 +++++-------------- htdocs/compta/paiement/cheque/fiche.php | 6 +- htdocs/core/class/commonobject.class.php | 24 +++--- 3 files changed, 36 insertions(+), 67 deletions(-) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 7ccb75793aa..aec7c54d53a 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -21,13 +21,13 @@ /** * \file htdocs/compta/paiement/cheque/class/remisecheque.class.php * \ingroup compta - * \brief Fichier de la classe des bordereau de remise de cheque + * \brief File with class to manage cheque delivery receipts */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - * Classe permettant la gestion des remises de cheque + * Class to manage cheque delivery receipts */ class RemiseCheque extends CommonObject { @@ -580,25 +580,25 @@ class RemiseCheque extends CommonObject if ( $resql ) { while ( $row = $this->db->fetch_row($resql) ) - { - $total += $row[0]; - $nb++; - } + { + $total += $row[0]; + $nb++; + } - $this->db->free($resql); + $this->db->free($resql); - $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " SET amount = '".price2num($total)."'"; - $sql.= ", nbcheque = ".$nb; - $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; + $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; + $sql.= " SET amount = '".price2num($total)."'"; + $sql.= ", nbcheque = ".$nb; + $sql.= " WHERE rowid = ".$this->id; + $sql.= " AND entity = ".$conf->entity; - $resql = $this->db->query($sql); - if (!$resql) - { - $this->errno = -1030; - dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); - } + $resql = $this->db->query($sql); + if (!$resql) + { + $this->errno = -1030; + dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); + } } else { @@ -724,41 +724,6 @@ class RemiseCheque extends CommonObject return -2; } } - - /** - * Set the external ref - * - * @param User $user Object user - * @param timestamp $ref_rext External ref - * @return int <0 if KO, >0 if OK - */ - function set_ref_ext($user, $ref_ext) - { - if ($user->rights->banque->cheque) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " SET ref_ext = '".$ref_ext."'"; - $sql.= " WHERE rowid = ".$this->id; - - dol_syslog("RemiseCheque::set_ref_ext sql=$sql",LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->ref_ext = $ref_ext; - return 1; - } - else - { - $this->error=$this->db->error(); - dol_syslog("RemiseCheque::set_ref_ext ".$this->error,LOG_ERR); - return -1; - } - } - else - { - return -2; - } - } /** @@ -780,7 +745,7 @@ class RemiseCheque extends CommonObject if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; - + return $result; } diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index ff20fe04fea..8c55161ca73 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -100,7 +100,7 @@ if ($action == 'setrefext' && $user->rights->banque->cheque) { $ref_ext = GETPOST('ref_ext'); - $result=$object->set_ref_ext($user, $ref_ext); + $result=$object->setValueFrom('ref_ext', $ref_ext); if ($result < 0) { $mesg='
'.$object->error.'
'; @@ -514,10 +514,10 @@ else print ''; print ''; - + // External ref print '
'; - print $langs->trans('RefCustomer').''; + print ''; + + + print ''; print ''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; print '
'; + print $langs->trans('RefCustomer').''.img_edit($langs->transnoentitiesnoconv('RefCustomer')).''.img_edit($langs->trans('Modify')).'
'; @@ -1617,7 +1621,6 @@ else } print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'; - + print ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c1b75793220..4cb0f68959e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -736,31 +736,35 @@ abstract class CommonObject } /** - * Update a specific field from an object + * Update a specific field into database * * @param string $field Field to update * @param mixte $value New value - * @param string $table To force other table element or element line - * @param int $id To force other object id - * @param string $format Data format ('text' by default, 'date') - * @param string $id_field To force rowid field name + * @param string $table To force other table element or element line (should not be used) + * @param int $id To force other object id (should not be used) + * @param string $format Data format ('text', 'date'). 'text' is used if not defined + * @param string $id_field To force rowid field name. 'rowid' is used it not defined + * @param string $user Update last update fields also if user object provided * @return int <0 if KO, >0 if OK */ - function setValueFrom($field, $value, $table='', $id='', $format='text', $id_field='rowid') + function setValueFrom($field, $value, $table='', $id='', $format='', $id_field='', $user='') { global $conf; - if (empty($table)) $table=$this->table_element; - if (empty($id)) $id=$this->id; + if (empty($table)) $table=$this->table_element; + if (empty($id)) $id=$this->id; + if (empty($format)) $format='text'; + if (empty($id_field)) $id_field='rowid'; $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET "; if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'"; else if ($format == 'date') $sql.= $field." = '".$this->db->idate($value)."'"; + if (is_object($user)) $sql.=", fk_user_modif = ".$user->id; $sql.= " WHERE ".$id_field." = ".$id; - dol_syslog(get_class($this)."::setValueFrom sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::".__FUNCTION__." sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2296,7 +2300,7 @@ abstract class CommonObject }); }); } - + setListDependencies(); }); '; From 442c2cab8f405842e1728af165213a7461f77721 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 13:42:19 +0200 Subject: [PATCH 19/28] Update doc --- build/debian/README.howto | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build/debian/README.howto b/build/debian/README.howto index 44cfb21ab81..d98fd4648a3 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -98,17 +98,26 @@ END * Staying into git root directory, run git-import-orig -vv ../tcpdf_6.0.020+dfsg.orig.tar.xz +git-commit -* Add an entry into debian/changelog and commit by amending previous commit. +* Add an entry into debian/changelog +date -R will return formated string date to use into changelog * We try to build package git-buildpackage -us -uc * If package .deb is ok: +git-commit (but do not use option "amend" previous commit) git-buildpackage --git-tag git push git push --tags -* Then ??? +* Compilation par un développeur debian et envoi par +sbuild ... +dput ... + +* Go into page. You should see new package into unstable. http://packages.qa.debian.org/t/tcpdf.html +* Package will be into release when test will be moved as stable. + From 83b5c193f76646f0b62ce088fb1173b2886515c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 14:00:08 +0200 Subject: [PATCH 20/28] Fix: move search_ville into search_town (search_ville no more used into 3.5). --- htdocs/comm/propal/list.php | 28 +++++++++++++++------------- htdocs/comm/prospect/list.php | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e15f22220f1..a911797fd49 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -54,7 +54,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_author=GETPOST('search_author','alpha'); -$search_ville=GETPOST('search_ville','alpha'); +$search_town=GETPOST('search_town','alpha'); $sall=GETPOST("sall"); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); @@ -102,7 +102,7 @@ if (GETPOST("button_removefilter_x")) $search_societe=''; $search_montant_ht=''; $search_author=''; - $search_ville=''; + $search_town=''; $year=''; $month=''; } @@ -159,9 +159,9 @@ if (! $user->rights->societe->client->voir && ! $socid) //restriction { $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } -if ($search_ville) //restriction +if ($search_town) //restriction { - $sql.= " AND s.town LIKE '%".$db->escape(trim($search_ville))."%'"; + $sql.= " AND s.town LIKE '%".$db->escape(trim($search_town))."%'"; } if ($search_ref) { @@ -235,7 +235,7 @@ if ($result) if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_author) $param.='&search_author='.$search_author; - if ($search_ville) $param.='&search_ville='.$search_ville; + if ($search_town) $param.='&search_town='.$search_town; print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); // Lignes des champs de filtre @@ -288,7 +288,7 @@ if ($result) print ''; - print ''; + print ''; print ''; @@ -302,7 +302,7 @@ if ($result) print ''; - + print ''; @@ -353,16 +353,18 @@ if ($result) print ''; - + + // Town print ''; + // Customer ref - print ''; - // Date propale + // Date proposal print '\n"; - // Date fin validite + // Date end validity if ($objp->dfv) { print ''; } - + } - + print '
'; print $langs->trans('RefExt'); print ''; print ''; print ' '; print ''; print ''; print ''; print ''; print ''; print ''; print $companystatic->getNomUrl(1,'customer'); print ''; print $objp->town; print ''; + print ''; print $objp->ref_client; print ''; $y = dol_print_date($db->jdate($objp->dp),'%Y'); $m = dol_print_date($db->jdate($objp->dp),'%m'); @@ -374,7 +376,7 @@ if ($result) print ' '; print $y."'.dol_print_date($db->jdate($objp->dfv),'day'); @@ -421,9 +423,9 @@ if ($result) print ''.price($total).''; print '
'; print ''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 873ef051612..ab42c2ffdaa 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -243,7 +243,7 @@ if ($resql) llxHeader('',$langs->trans("ThirdParty"),$help_url); } - $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_ville='.urlencode($search_ville); + $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_town='.urlencode($search_town); // Store the status filter in the URL if (isSet($search_cstc)) { From e3b38cf3bb1fe55b1a283fa0a7318c3653024d7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 14:09:17 +0200 Subject: [PATCH 21/28] Fix: SQL Syntax error. Fix: A ref_ext can not be NOT NULL. New: Add tms field into table llx_bordereau_cheque. --- htdocs/install/mysql/migration/3.4.0-3.5.0.sql | 6 ++++-- htdocs/install/mysql/tables/llx_bordereau_cheque.sql | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 76137d75b7f..f13042bff2e 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -276,5 +276,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN23', 1001, '', 0, '', 'Tunis', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN24', 1001, '', 0, '', 'Zaghouan', 1); -# Add ref_ext on bordereau_cheque -ALTER TABLE `llx_bordereau_cheque` ADD `ref_ext` VARCHAR( 255 ) NOT NULL; +-- Add ref_ext on bordereau_cheque +ALTER TABLE llx_bordereau_cheque ADD ref_ext VARCHAR(255); +ALTER TABLE llx_bordereau_cheque ADD tms timestamp; + diff --git a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql index 60365665932..cbaea000c33 100644 --- a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql +++ b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql @@ -24,16 +24,16 @@ create table llx_bordereau_cheque ( rowid integer AUTO_INCREMENT PRIMARY KEY, + number varchar(16) NOT NULL, -- ref + ref_ext varchar(255), -- ref_ext datec datetime NOT NULL, - date_bordereau date, -- A quoi sert cette date ? - number varchar(16) NOT NULL, - entity integer DEFAULT 1 NOT NULL, -- multi company id + date_bordereau date, -- A quoi sert cette date ? amount double(24,8) NOT NULL, nbcheque smallint NOT NULL, fk_bank_account integer, fk_user_author integer, - note text, statut smallint NOT NULL DEFAULT 0, - ref_ext varchar(255) - + tms timestamp, + note text, + entity integer DEFAULT 1 NOT NULL -- multi company id )ENGINE=innodb; From d802470aae145f1b51062ee930cb2b149d8e6940 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 14:23:42 +0200 Subject: [PATCH 22/28] I killed
. Hello ! --- htdocs/admin/livraison.php | 2 +- htdocs/admin/propal.php | 2 +- htdocs/categories/categorie.php | 2 +- htdocs/comm/action/document.php | 4 +-- htdocs/comm/action/fiche.php | 6 ++-- htdocs/comm/fiche.php | 22 ++++++------ htdocs/comm/index.php | 8 ++--- htdocs/comm/mailing/index.php | 4 +-- htdocs/comm/propal/apercu.php | 2 +- htdocs/comm/propal/contact.php | 2 +- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/note.php | 2 +- htdocs/comm/prospect/index.php | 2 +- htdocs/commande/apercu.php | 2 +- htdocs/commande/contact.php | 2 +- htdocs/commande/index.php | 2 +- htdocs/commande/note.php | 2 +- htdocs/commande/orderstoinvoice.php | 2 +- htdocs/compta/bank/search.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/compta/facture/impayees.php | 4 +-- htdocs/compta/index.php | 2 +- htdocs/compta/localtax/clients.php | 28 +++++++-------- htdocs/compta/localtax/index.php | 8 ++--- htdocs/compta/localtax/reglement.php | 4 +-- htdocs/compta/prelevement/ligne.php | 4 +-- htdocs/compta/tva/clients.php | 28 +++++++-------- htdocs/compta/tva/index.php | 8 ++--- htdocs/compta/tva/quadri.php | 10 +++--- htdocs/compta/tva/quadri_detail.php | 36 +++++++++---------- htdocs/compta/tva/reglement.php | 4 +-- .../default/tpl/contactcard_edit.tpl.php | 2 +- .../default/tpl/contactcard_view.tpl.php | 2 +- htdocs/contact/fiche.php | 4 +-- htdocs/contrat/index.php | 6 ++-- .../browser/default/frmcreatefolder.php | 2 +- htdocs/core/modules/dons/html_cerfafr.html | 6 ++-- htdocs/expedition/contact.php | 2 +- htdocs/expedition/shipment.php | 2 +- htdocs/fourn/commande/fiche.php | 8 ++--- htdocs/fourn/commande/index.php | 2 +- htdocs/fourn/facture/impayees.php | 8 ++--- htdocs/fourn/fiche.php | 2 +- htdocs/install/repair.php | 2 +- htdocs/install/upgrade.php | 4 +-- htdocs/product/fiche.php | 8 ++--- htdocs/projet/admin/project.php | 2 +- htdocs/user/home.php | 4 +-- 49 files changed, 139 insertions(+), 139 deletions(-) diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 3fd00c5727b..0235c7adc39 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -214,7 +214,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''."\n"; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 954ec82a9c2..5ca73fa0de3 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -261,7 +261,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'; print ''; print '\n"; print '\n"; -print '\n"; +print '\n"; print ''; print ''; print ''."\n"; diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 7b88fa1bd6f..1bd177a3015 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -550,7 +550,7 @@ else if ($id || $ref) if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; + print ''; print ''; } else diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 7ad74302655..2bb710b310f 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -191,7 +191,7 @@ if ($act->id > 0) print ''; // Status - print ''; @@ -246,7 +246,7 @@ if ($act->id > 0) } // Priority - print ''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 59b2e6c0a80..81a635e4d9f 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -537,7 +537,7 @@ if ($action == 'create') // Realised by if ($conf->global->AGENDA_ENABLE_DONEBY) { - print ''; } @@ -570,7 +570,7 @@ if ($action == 'create') // If company is forced, we propose contacts (may be contact is also forced) if (GETPOST("contactid") > 0 || GETPOST('socid','int') > 0) { - print ''; } @@ -600,7 +600,7 @@ if ($action == 'create') } // Priority - print ''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 811e4a8d211..f5409681be8 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -293,7 +293,7 @@ if ($id > 0) } // TVA Intra - print ''; @@ -319,8 +319,8 @@ if ($id > 0) print ''; // Mode de reglement par defaut - print '
'.$langs->trans("Name")."'.$langs->trans("Description")."'.$langs->trans("Example")."'.$langs->trans("Example")."'.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print $act->getLibStatut(4); print '
'.$langs->trans("Priority").''; + print '
'.$langs->trans("Priority").''; print ($act->priority?$act->priority:''); print '
'.$langs->trans("ActionDoneBy").''; + print '
'.$langs->trans("ActionDoneBy").''; $form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1); print '
'.$langs->trans("ActionOnContact").''; + print '
'.$langs->trans("ActionOnContact").''; $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); print '
'.$langs->trans("Priority").''; + print '
'.$langs->trans("Priority").''; print ''; print '
'.$langs->trans('VATIntra').''; + print '
'.$langs->trans('VATIntra').''; print $object->tva_intra; print '
'; - print '
'; + print '
'; + print ''; @@ -338,8 +338,8 @@ if ($id > 0) print ''; // Relative discounts (Discounts-Drawbacks-Rebates) - print '
'; print $langs->trans('PaymentMode'); print ''; if (($action != 'editmode') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; - print '
'; + print '
'; + print ''; // Absolute discounts (Discounts-Drawbacks-Rebates) - print '
'; print $langs->trans("CustomerRelativeDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) @@ -351,9 +351,9 @@ if ($id > 0) print '
'; + print '
'; print ''; - print '
'; + print '
'; print $langs->trans("CustomerAbsoluteDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) @@ -373,8 +373,8 @@ if ($id > 0) // Multiprice level if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - print '
'; - print '
'; + print '
'; + print '
'; print $langs->trans("PriceLevel"); print ''; if ($user->rights->societe->creer) @@ -389,8 +389,8 @@ if ($id > 0) // Level of prospect if ($object->client == 2 || $object->client == 3) { - print '
'; - print '
'; + print '
'; + print ''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index f32fa89b59b..dff264b6f25 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -98,9 +98,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print '
'; print $langs->trans('ProspectLevel'); print ''; if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print "
'.$langs->trans("SearchAProposal").'
'.$langs->trans("Ref").':'.$langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':
\n"; print "
\n"; @@ -117,9 +117,9 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print "
'.$langs->trans("SearchAContract").'
'.$langs->trans("Ref").':'.$langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':
\n"; print "
"; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 42944afabef..ac7cbdccb5d 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -55,10 +55,10 @@ print '
'; print ''; print ''; print ''; -print ''; print ''; -print ''; print "
'.$langs->trans("SearchAMailing").'
'; +print '
'; print $langs->trans("Ref").':
'; +print '
'; print $langs->trans("Other").':

\n"; diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index 2fd7c86fb9a..0e14848d1e8 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -80,7 +80,7 @@ if ($id > 0 || ! empty($ref)) // Ref client print '
'; - print ' - +
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 7e94ec5a912..2d7d432a51d 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -166,7 +166,7 @@ if ($object->id > 0) // Ref client print '
'; - print '"; - print ''; + print ''; $x_coll = 0; foreach($coll_listsell as $vatrate=>$val) @@ -166,7 +166,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_coll+=$val['vat']; } $subtotalcoll = $subtotalcoll + $x_coll; - print ""; + print ""; $x_paye = 0; foreach($coll_listbuy as $vatrate=>$val) @@ -174,13 +174,13 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_paye+=$val['vat']; } $subtotalpaye = $subtotalpaye + $x_paye; - print ""; + print ""; $diff = $x_coll - $x_paye; $total = $total + $diff; $subtotal = $subtotal + $diff; - print "\n"; + print "\n"; print "\n"; print "\n"; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index d283f877817..b97eca7bacb 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -263,11 +263,11 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES") $var=!$var; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; print ""; print ""; @@ -286,7 +286,7 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES") $var=!$var; print ""; print ''; - print "\n"; + print "\n"; print "\n"; $i++; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 88c1be06409..0d859d96c06 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -342,7 +342,7 @@ else print ''; // Ref - print ''; + print ''; // Description print ''; // VAT - print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } @@ -450,11 +450,11 @@ else print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } @@ -499,7 +499,7 @@ else print ''; // Ref - print ''; + print ''; // Description print ''; // VAT - print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } @@ -601,11 +601,11 @@ else print ''; if ($modetax == 0) { - print ''; + print ''; print ''; } print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 4ca5f298514..ea9f7ea445d 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -60,9 +60,9 @@ if ($result) print '
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index b0eca76345b..b1b91cfb89c 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -133,7 +133,7 @@ if ($object->id > 0) // Ref client print '
'; - print ''; print ''; -print ''; +print ''; print ''; print "
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 70eb2e49092..45a594c12cd 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -69,7 +69,7 @@ print ''; print '
'.$langs->trans("SearchPropal").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 633c0dd4cf4..a9ee5b6a839 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref)) // Ref client print '
'; - print ''; print ''; - print ''; + print ''; print ''; print "
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index e6496c32a58..1f3e0fc4c0c 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -60,7 +60,7 @@ if (! empty($conf->propal->enabled)) print '
'.$langs->trans("SearchAProposal").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; } diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index b4b92e760c5..10bc0b500f4 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) // Ref cde client print '
'; - print '"; - print ''; + print ''; $x_coll = 0; foreach($coll_listsell as $vatrate=>$val) @@ -157,7 +157,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_coll+=$val['localtax2']; } $subtotalcoll = $subtotalcoll + $x_coll; - print ""; + print ""; $x_paye = 0; foreach($coll_listbuy as $vatrate=>$val) @@ -165,13 +165,13 @@ for ($m = 1 ; $m < 13 ; $m++ ) $x_paye+=$val['localtax2']; } $subtotalpaye = $subtotalpaye + $x_paye; - print ""; + print ""; $diff = $x_coll - $x_paye; $total = $total + $diff; $subtotal = $subtotal + $diff; - print "\n"; + print "\n"; print "\n"; print "\n"; diff --git a/htdocs/compta/localtax/reglement.php b/htdocs/compta/localtax/reglement.php index e750403bf2c..07d81d81df8 100644 --- a/htdocs/compta/localtax/reglement.php +++ b/htdocs/compta/localtax/reglement.php @@ -56,9 +56,9 @@ if ($result) print '
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index cde8d1d4a35..055d4a42787 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -162,7 +162,7 @@ if ($id > 0 || ! empty($ref)) // Ref commande client print '
'; - print ''; print ''; -print ''; +print ''; print ''; print "
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 3c69388c8c9..2327c2063be 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -70,7 +70,7 @@ print ''; print '
'.$langs->trans("SearchOrder").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index c9ca34854b7..58023beec33 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -97,7 +97,7 @@ if ($id > 0 || ! empty($ref)) // Ref commande client print '
'; - print ''; // Payment term - print ''; // Payment mode diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 9a3a55bfaf4..cc3f0cd548d 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -227,7 +227,7 @@ if ($resql) print "\n"; // Num - print '\n"; + print '\n"; // Description print "'; // Payment term - print ''; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index d2dbceea47f..b334053c5b4 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -363,8 +363,8 @@ if ($resql) print "\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index f26b9a06089..6340e00c28f 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -288,7 +288,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); - print '"; - print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->localtax2; print "\n"; @@ -194,8 +194,8 @@ if (is_array($coll_list)) $x_coll_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } else @@ -245,15 +245,15 @@ if (is_array($coll_list)) } } print ""; - print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->localtax2; print "\n"; @@ -263,8 +263,8 @@ if (is_array($coll_list)) $x_paye_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 72599d11840..16696430d40 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -416,7 +416,7 @@ if ($action == 'create' && empty($mesgs)) $html->select_date(0,'','','','',"add",1,1); print '
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id'); print '
'.($objp->num_chq?$objp->num_chq:"")."'.($objp->num_chq?$objp->num_chq:"").""; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b8bc0b1ed10..d51cac1399e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2253,7 +2253,7 @@ if ($action == 'create') print '
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $form->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id'); print '
'.dol_print_date($db->jdate($objp->df),'day').''.dol_print_date($db->jdate($objp->datelimite),'day').''.dol_print_date($db->jdate($objp->df),'day').''.dol_print_date($db->jdate($objp->datelimite),'day').''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,28).'
'; + print '
'; $facturesupplierstatic->ref=$obj->ref; $facturesupplierstatic->id=$obj->rowid; $facturesupplierstatic->type=$obj->type; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index e2eb5ab610c..72b02194bc1 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -176,15 +176,15 @@ if (is_array($coll_list)) } } print "
".$i."'.$i."'.$company_static->getNomUrl(1).''.$company_static->getNomUrl(1).'".$intra."".price($coll->amount)."".price($coll->localtax2)."'.$intra."".price($coll->amount)."".price($coll->localtax2)."
'.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
".$i."'.$i."'.$company_static->getNomUrl(1).''.$company_static->getNomUrl(1).'".$intra."".price($coll->amount)."".price($coll->localtax2)."'.$intra."".price($coll->amount)."".price($coll->localtax2)."
'.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
'; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 3f0cb9828d5..8acfe896fed 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -149,7 +149,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) $var=!$var; print "
'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price($x_coll)."".price($x_paye)."".price($x_paye)."".price($diff)."".price($diff)." 
'; print ''; - print ''; + print ''; print ""; - print ''; + print ''; print ""; print "\n"; $var=1; diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index a0e2d498ee0..d242deedb38 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -196,13 +196,13 @@ if ($id) print ''; //Date - print ''; + print ''; print ''; //Reason - print ''; + print ''; print ''; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 83f248a39be..871e8a583ef 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -207,16 +207,16 @@ if (is_array($coll_list)) } } print ""; - print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; $company_static->client=1; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->tva; print "\n"; @@ -226,8 +226,8 @@ if (is_array($coll_list)) $x_coll_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } else @@ -285,16 +285,16 @@ if (is_array($coll_list)) } } print ""; - print ""; + print '"; $company_static->id=$coll->socid; $company_static->nom=$coll->nom; $company_static->fournisseur=1; - print ''; + print ''; $find = array(' ','.'); $replace = array('',''); - print ""; - print ""; - print ""; + print '"; + print ""; + print ""; $totalamount = $totalamount + $coll->amount; $total = $total + $coll->tva; print "\n"; @@ -304,8 +304,8 @@ if (is_array($coll_list)) $x_paye_sum = $total; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
'.$langs->trans("Ref").''.$langs->trans("Ref").'".$langs->trans("Label")."'.$langs->trans("DatePayment").''.$langs->trans("DatePayment").'".$langs->trans("PayedByThisPayment")."
'.$langs->trans("RefusedData").'
'.$langs->trans("RefusedData").''; print $form->select_date('','','','','',"confirm_rejet"); print '
'.$langs->trans("RefusedReason").'
'.$langs->trans("RefusedReason").''; print $form->selectarray("motif", $rej->motifs); print '
".$i."'.$i."'.$company_static->getNomUrl(1,'customer').''.$company_static->getNomUrl(1,'customer').'".$intra."".price($coll->amount)."".price($coll->tva)."'.$intra."".price($coll->amount)."".price($coll->tva)."
'.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
".$i."'.$i."'.$company_static->getNomUrl(1,'supplier').''.$company_static->getNomUrl(1,'supplier').'".$intra."".price($coll->amount)."".price($coll->tva)."'.$intra."".price($coll->amount)."".price($coll->tva)."
'.$langs->trans("Total").':'.price($totalamount).''.price($total).''.price($totalamount).''.price($total).'
'; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 7f23b6cfded..9bd05274f0a 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -158,7 +158,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) $var=!$var; print "
'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price($x_coll)."".price($x_paye)."".price($x_paye)."".price($diff)."".price($diff)." 
$rate%".price($both['coll']['totalht'])."".price($both['coll']['vat'])."".price($both['coll']['totalht'])."".price($both['coll']['vat'])."".$both['coll']['links']."".price($both['paye']['totalht'])."".price($both['paye']['vat'])."".price($both['paye']['totalht'])."".price($both['paye']['vat'])."".$both['paye']['links']."
".price($diff)."".price($diff)."
'.$fields['link'].''.$fields['link'].''; @@ -374,7 +374,7 @@ else // Total HT if ($modetax == 0) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { @@ -390,7 +390,7 @@ else if ($modetax == 0) { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - print ''; + print ''; //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { @@ -409,14 +409,14 @@ else } // Total collected - print ''; + print ''; $temp_ht=$fields['totalht']; if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; print price(price2num($temp_ht,'MT')); print ''; + print ''; $temp_vat=$fields['vat']; if ($type == 1) $temp_vat=$fields['vat']*$ratiopaymentinvoice; print price(price2num($temp_vat,'MT')); @@ -435,11 +435,11 @@ else print ''.$langs->trans("Total").':   '.price(price2num($subtot_coll_total_ht,'MT')).''.price(price2num($subtot_coll_vat,'MT')).''.price(price2num($subtot_coll_vat,'MT')).'
'.$langs->trans("Total").':   '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
'.$fields['link'].''.$fields['link'].''; @@ -525,7 +525,7 @@ else // Total HT if ($modetax == 0) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { @@ -541,7 +541,7 @@ else if ($modetax == 0) { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - print ''; + print ''; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { $paymentfourn_static->id=$fields['payment_id']; @@ -560,14 +560,14 @@ else } // VAT paid - print ''; + print ''; $temp_ht=$fields['totalht']; if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; print price(price2num($temp_ht,'MT')); print ''; + print ''; $temp_vat=$fields['vat']; if ($type == 1) $temp_vat=$fields['vat']*$ratiopaymentinvoice; print price(price2num($temp_vat,'MT')); @@ -586,11 +586,11 @@ else print ''.$langs->trans("Total").':   '.price(price2num($subtot_paye_total_ht,'MT')).''.price(price2num($subtot_paye_vat,'MT')).''.price(price2num($subtot_paye_vat,'MT')).'
'.$langs->trans("Total").':   '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
'; print ''; - print ''; + print ''; print ""; - print ''; + print ''; print ""; print "\n"; $var=1; diff --git a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php index 0810624eb4c..a445444e42c 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php @@ -111,7 +111,7 @@ echo $this->control->tpl['ajax_selectcountry']; control->tpl['nb_emailing']) { ?> - + diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index d0ad081e92e..d7556f09f9f 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -96,7 +96,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors'] control->tpl['nb_emailing']) { ?> - + diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 94e8fadf3bf..7a88eb7d8cd 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -678,7 +678,7 @@ else if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; + print ''; print ''; } else @@ -879,7 +879,7 @@ else if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; + print ''; print ''; } else diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 845eaad86bb..05ee288b42c 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -80,9 +80,9 @@ if (! empty($conf->contrat->enabled)) print '
'.$langs->trans("Ref").''.$langs->trans("Ref").'".$langs->trans("Label")."'.$langs->trans("DatePayment").''.$langs->trans("DatePayment").'".$langs->trans("PayedByThisPayment")."
trans("Email"); ?> trans("NbOfEMailingsReceived"); ?>trans("NbOfEMailingsReceived"); ?> control->tpl['nb_emailing']; ?>  trans("EMail"); ?> control->tpl['email']; ?> trans("NbOfEMailingsReceived"); ?>trans("NbOfEMailingsReceived"); ?> control->tpl['nb_emailing']; ?>  '.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().''.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().'
'; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print "
'.$langs->trans("SearchAContract").'
'.$langs->trans("Ref").':'.$langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':
\n"; print "
"; @@ -255,7 +255,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); - print '
'; + print '
'; $staticcontrat->ref=$obj->ref; $staticcontrat->id=$obj->rowid; print $staticcontrat->getNomUrl(1,''); diff --git a/htdocs/core/filemanagerdol/browser/default/frmcreatefolder.php b/htdocs/core/filemanagerdol/browser/default/frmcreatefolder.php index c19c0d5ec43..44b00b2154c 100755 --- a/htdocs/core/filemanagerdol/browser/default/frmcreatefolder.php +++ b/htdocs/core/filemanagerdol/browser/default/frmcreatefolder.php @@ -128,7 +128,7 @@ window.onload = function()
 Create New FolderCreate New Folder
diff --git a/htdocs/core/modules/dons/html_cerfafr.html b/htdocs/core/modules/dons/html_cerfafr.html index 2f21e1c0afe..ebdd30c9376 100644 --- a/htdocs/core/modules/dons/html_cerfafr.html +++ b/htdocs/core/modules/dons/html_cerfafr.html @@ -22,7 +22,7 @@ __DonationRef__ -
+ @@ -45,7 +45,7 @@
No: -
+ __DonationRecipient__ @@ -79,7 +79,7 @@ -
+ __Donor__ diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index c907cf89ba0..bd396f0e8f5 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -199,7 +199,7 @@ if ($id > 0 || ! empty($ref)) // Ref expedition client print '
'; - print '
'; + print ''; print '
'; print $langs->trans('RefCustomer').''; print '
'; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index f381b5bbd1c..33cf13ffc6f 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -185,7 +185,7 @@ if ($id > 0 || ! empty($ref)) // Ref commande client print '
'; - print '
'; + print ''; if ($action != 'RefCustomerOrder' && $commande->brouillon) print ''; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 516a975e5ab..00d7589448a 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1226,8 +1226,8 @@ elseif (! empty($object->id)) // Conditions de reglement par defaut $langs->load('bills'); $form = new Form($db); - print '
'; print $langs->trans('RefCustomer').''; print ''.img_edit($langs->trans('Modify')).'
'; - print '
'; + print '
'; + print ''; @@ -1247,8 +1247,8 @@ elseif (! empty($object->id)) // Mode of payment $langs->load('bills'); $form = new Form($db); - print '
'; print $langs->trans('PaymentConditions'); print ''; if ($action != 'editconditions') print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; - print '"; $classname = "impayee"; - print '\n"; - print "\n"; + print '\n"; - print "\n"; - print "\n"; + print '\n"; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 5899870b955..d61d49476bc 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -190,7 +190,7 @@ if ($object->fetch($id)) } // TVA Intra - print ''; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 2751c963158..a6c0975ec97 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -180,7 +180,7 @@ if ($ok) // Loop on each file foreach($filelist as $file) { - print ''; $name = substr($file, 0, dol_strlen($file) - 4); diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 886276197e3..904144cad66 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -369,7 +369,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) foreach($filelist as $file) { print ''; - print ''."\n"; + print ''."\n"; // Run sql script $ok=run_sql($dir.$file, 0, '', 1); @@ -399,7 +399,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) foreach ($modulesfile as $modulefilelong => $modulefileshort) { print ''; - print ''."\n"; + print ''."\n"; // Run sql script $okmodule=run_sql($modulefilelong, 0, '', 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not. diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index c5aa1916f70..aa262f9a6c2 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -1070,8 +1070,8 @@ else if ($showbarcode) { // Barcode type - print '
'; + print '
'; + print ''; if ($action != 'editmode') print ''; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 52064cb39eb..9a1aaf4164f 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -64,7 +64,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print "
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'),1).'
'.$langs->trans("SearchOrder").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 4a7b61f2768..87c3c7e6dc8 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -237,16 +237,16 @@ if ($user->rights->fournisseur->facture->lire) print "
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->ref; print $facturestatic->getNomUrl(1); print "".dol_trunc($objp->ref_supplier,12)."'.dol_trunc($objp->ref_supplier,12)."".dol_print_date($db->jdate($objp->df),'day')."".dol_print_date($db->jdate($objp->datelimite),'day'); + print ''.dol_print_date($db->jdate($objp->df),'day')."'.dol_print_date($db->jdate($objp->datelimite),'day'); if ($objp->datelimite && $db->jdate($objp->datelimite) < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print "
'.$langs->trans('VATIntra').''; + print '
'.$langs->trans('VATIntra').''; print $object->tva_intra; print '
'; + print '
'; print $langs->trans("Script").''.$file.'

'.$langs->trans("ChoosedMigrateScript").''.$file.'
'.$langs->trans("ChoosedMigrateScript").''.$file.'

'.$langs->trans("ChoosedMigrateScript").' (external modules)'.$modulefileshort.'
'.$langs->trans("ChoosedMigrateScript").' (external modules)'.$modulefileshort.'
'; - print '
'; + print '
'; + print ''; @@ -1091,8 +1091,8 @@ else print ''."\n"; // Barcode value - print '
'; print $langs->trans("BarcodeType"); print ''; if (($action != 'editbarcodetype') && $user->rights->barcode->creer) print 'id.'">'.img_edit($langs->trans('Edit'),1).'
'; - print ''; print ''; print ''; - print ''; // Ref client - print '
'; + print '
'; + print ''; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 136e5124ca5..658d87fff0d 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -444,7 +444,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering module - print ''; print ''; - print ''; + print ''; print "
'; print $langs->trans("BarcodeValue"); print ''; if (($action != 'editbarcode') && $user->rights->barcode->creer) print 'id.'">'.img_edit($langs->trans('Edit'),1).''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index a8a62df999a..3f43e40e43a 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -69,7 +69,7 @@ print ''; print ''; print ''; -print ''; +print ''; print "
'.$langs->trans("SearchAUser").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; print ''; @@ -83,7 +83,7 @@ if ($canreadperms) print '
'.$langs->trans("SearchAGroup").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; print ''; } From e119a5c650c1283b50e1b81c12576e1141bc0fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 19 Jul 2013 15:07:21 +0200 Subject: [PATCH 23/28] Avoid printing errors on documents that are fine without --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index acb3f51f6d2..9965b525dd6 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -695,13 +695,7 @@ class pdf_crabe extends ModelePDFFactures && ! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER) { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetTextColor(200,0,0); - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->MultiCell(80, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0); - $pdf->SetTextColor(0,0,0); - - $posy=$pdf->GetY()+1; + $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } // Show payment mode From ed52dd963668a6311a912554ee239c6e187f2d92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 15:29:40 +0200 Subject: [PATCH 24/28] New: A more responsive desgin for statistic box of home page Qual: Hook for statistics now match specifications. --- ChangeLog | 15 +- htdocs/core/class/hookmanager.class.php | 3 +- htdocs/index.php | 252 +++++++++++++----------- htdocs/theme/amarok/style.css.php | 20 +- htdocs/theme/auguria/style.css.php | 19 ++ htdocs/theme/bureau2crea/style.css.php | 23 ++- htdocs/theme/cameleo/style.css.php | 19 ++ htdocs/theme/eldy/style.css.php | 19 ++ 8 files changed, 239 insertions(+), 131 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0375d554b22..c028d285b35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,12 +29,12 @@ For users: - New: Can add an event automatically when a projet is create. - New: Add option MAIN_GENERATE_DOCUMENT_WITH_PICTURE. - New: Add option excludethirdparties and onlythirdparties into merge pdf scripts. +- New : [ task #925 ] Add ODT document generation for Tasks in project module. +- New : [ task #924 ] Add numbering rule on task. +- New : [ task #165 ] Add import/export of multiprices. +- New: Add Maghreb regions and departments. +- New: A more responsive desgin for statistic box of home page. - Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). -- New : [ task #925 ] Add ODT document generation for Tasks in project module -- New : [ task #924 ] Add numbering rule on task -- New : [ task #165 ] Add import/export of multiprices -- New: Add Maghreb regions and departments - For translators: @@ -55,6 +55,7 @@ For developers: key to use a specific language file. - New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables. Fix also several bugs with old code. +- Qual: All nowrap properties are now using CSS class nowrap. WARNING: This may create regression for some external modules, but was necessary to make Dolibarr better: @@ -65,8 +66,8 @@ If your action class for hook was returning a string or an array, instead your m set $actionclassinstance->results (to return array) or $actionclassinstance->resprints (to return string) to return same thing. The return value must be replaced by a "return 0"; -Goal is to fix old compatibility code that does not match hook -specification: http://wiki.dolibarr.org/index.php/Hooks_system +Goal is to fix old compatibility code that does not match hook specifications: + http://wiki.dolibarr.org/index.php/Hooks_system - Some methods object->addline used a first parameter that was object->id, some not. Of course this was not a good pratice, since object->id is already known so no need to provide it as diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index e41334a30e0..bd13cc238b1 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -131,7 +131,8 @@ class HookManager // Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated. $hooktype='output'; if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win. - if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices','printSearchForm', 'formattachOptions', 'formBuilddocLineOptions'))) $hooktype='addreplace'; + if (in_array($method,array('addStatisticLine','doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices', + 'printSearchForm', 'formattachOptions', 'formBuilddocLineOptions'))) $hooktype='addreplace'; // Loop on each hook to qualify modules that declared context $modulealreadyexecuted=array(); diff --git a/htdocs/index.php b/htdocs/index.php index 6108985a0b6..adb35c29f4d 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -109,7 +109,7 @@ $langs->load("orders"); $langs->load("contracts"); //print memory_get_usage(); -if ($user->societe_id == 0) +if (empty($user->societe_id)) { print '
'; print ''; @@ -117,132 +117,146 @@ if ($user->societe_id == 0) print ''; print ''; print ''; + print ''; - print ''; - print ''; - print ''; - } - } - $object=new stdClass(); $parameters=array(); $action=''; $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + // Condition to be checked for each display line dashboard + $conditions=array( + ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + ! empty($conf->adherent->enabled) && $user->rights->adherent->lire, + ! empty($conf->product->enabled) && $user->rights->produit->lire, + ! empty($conf->service->enabled) && $user->rights->service->lire, + ! empty($conf->propal->enabled) && $user->rights->propale->lire, + ! empty($conf->commande->enabled) && $user->rights->commande->lire, + ! empty($conf->facture->enabled) && $user->rights->facture->lire, + ! empty($conf->contrat->enabled) && $user->rights->contrat->activer); + // Class file containing the method load_state_board for each line + $includes=array(DOL_DOCUMENT_ROOT."/societe/class/client.class.php", + DOL_DOCUMENT_ROOT."/comm/prospect/class/prospect.class.php", + DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php", + DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php", + DOL_DOCUMENT_ROOT."/product/class/product.class.php", + DOL_DOCUMENT_ROOT."/product/class/service.class.php", + DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php", + DOL_DOCUMENT_ROOT."/commande/class/commande.class.php", + DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php", + DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); + // Name class containing the method load_state_board for each line + $classes=array('Client', + 'Prospect', + 'Fournisseur', + 'Adherent', + 'Product', + 'Service', + 'Propal', + 'Commande', + 'Facture', + 'Contrat'); + // Cle array returned by the method load_state_board for each line + $keys=array('customers', + 'prospects', + 'suppliers', + 'members', + 'products', + 'services', + 'proposals', + 'orders', + 'invoices', + 'Contracts'); + // Dashboard Icon lines + $icons=array('company', + 'company', + 'company', + 'user', + 'product', + 'service', + 'propal', + 'order', + 'bill', + 'order'); + // Translation keyword + $titres=array("ThirdPartyCustomersStats", + "ThirdPartyProspectsStats", + "Suppliers", + "Members", + "Products", + "Services", + "CommercialProposals", + "CustomersOrders", + "BillsCustomers", + "Contracts"); + // Dashboard Link lines + $links=array(DOL_URL_ROOT.'/comm/list.php', + DOL_URL_ROOT.'/comm/prospect/list.php', + DOL_URL_ROOT.'/fourn/liste.php', + DOL_URL_ROOT.'/adherents/liste.php?statut=1&mainmenu=members', + DOL_URL_ROOT.'/product/liste.php?type=0&mainmenu=products', + DOL_URL_ROOT.'/product/liste.php?type=1&mainmenu=products', + DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial', + DOL_URL_ROOT.'/commande/liste.php?mainmenu=commercial', + DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy', + DOL_URL_ROOT.'/contrat/liste.php'); + // Translation lang files + $langfile=array("companies", + "prospects", + "suppliers", + "members", + "products", + "produts", + "propal", + "orders", + "bills", + "contracts"); + + + // Loop and displays each line of table + foreach ($keys as $key=>$val) + { + if ($conditions[$key]) + { + $classe=$classes[$key]; + // Search in cache if load_state_board is already realized + if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe])) + { + include_once $includes[$key]; // Loading a class cost around 1Mb + + $board=new $classe($db); + $board->load_state_board($user); + $boardloaded[$classe]=$board; + } + else $board=$boardloaded[$classe]; + + $var=!$var; + if ($langfile[$key]) $langs->load($langfile[$key]); + $title=$langs->trans($titres[$key]); + /*print ''; + print ''; + print ''; + print ''; + */ + print ''; + print ''; + } + } + } + + print ''; print '
'.$langs->trans("DolibarrStateBoard").' 
'; $var=true; - // Condition to be checked for each display line dashboard - $conditions=array( - ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - ! empty($conf->adherent->enabled) && $user->rights->adherent->lire, - ! empty($conf->product->enabled) && $user->rights->produit->lire, - ! empty($conf->service->enabled) && $user->rights->service->lire, - ! empty($conf->propal->enabled) && $user->rights->propale->lire, - ! empty($conf->commande->enabled) && $user->rights->commande->lire, - ! empty($conf->facture->enabled) && $user->rights->facture->lire, - ! empty($conf->contrat->enabled) && $user->rights->contrat->activer); - // Class file containing the method load_state_board for each line - $includes=array(DOL_DOCUMENT_ROOT."/societe/class/client.class.php", - DOL_DOCUMENT_ROOT."/comm/prospect/class/prospect.class.php", - DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php", - DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php", - DOL_DOCUMENT_ROOT."/product/class/product.class.php", - DOL_DOCUMENT_ROOT."/product/class/service.class.php", - DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php", - DOL_DOCUMENT_ROOT."/commande/class/commande.class.php", - DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php", - DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); - // Name class containing the method load_state_board for each line - $classes=array('Client', - 'Prospect', - 'Fournisseur', - 'Adherent', - 'Product', - 'Service', - 'Propal', - 'Commande', - 'Facture', - 'Contrat'); - // Cle array returned by the method load_state_board for each line - $keys=array('customers', - 'prospects', - 'suppliers', - 'members', - 'products', - 'services', - 'proposals', - 'orders', - 'invoices', - 'Contracts'); - // Dashboard Icon lines - $icons=array('company', - 'company', - 'company', - 'user', - 'product', - 'service', - 'propal', - 'order', - 'bill', - 'order'); - // Translation keyword - $titres=array("ThirdPartyCustomersStats", - "ThirdPartyProspectsStats", - "Suppliers", - "Members", - "Products", - "Services", - "CommercialProposals", - "CustomersOrders", - "BillsCustomers", - "Contracts"); - // Dashboard Link lines - $links=array(DOL_URL_ROOT.'/comm/list.php', - DOL_URL_ROOT.'/comm/prospect/list.php', - DOL_URL_ROOT.'/fourn/liste.php', - DOL_URL_ROOT.'/adherents/liste.php?statut=1&mainmenu=members', - DOL_URL_ROOT.'/product/liste.php?type=0&mainmenu=products', - DOL_URL_ROOT.'/product/liste.php?type=1&mainmenu=products', - DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial', - DOL_URL_ROOT.'/commande/liste.php?mainmenu=commercial', - DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy', - DOL_URL_ROOT.'/contrat/liste.php'); - // Translation lang files - $langfile=array("companies", - "prospects", - "suppliers", - "members", - "products", - "produts", - "propal", - "orders", - "bills", - "contracts"); - - - // Loop and displays each line of table - foreach ($keys as $key=>$val) - { - if ($conditions[$key]) - { - $classe=$classes[$key]; - // Search in cache if load_state_board is already realized - if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe])) - { - include_once $includes[$key]; // Loading a class cost around 1Mb - - $board=new $classe($db); - $board->load_state_board($user); - $boardloaded[$classe]=$board; - } - else $board=$boardloaded[$classe]; - - $var=!$var; - if ($langfile[$key]) $langs->load($langfile[$key]); - $title=$langs->trans($titres[$key]); - print '
'.img_object($title,$icons[$key]).''.$title.''.$board->nb[$val].'
'.img_object($title,$icons[$key]).''.$title.''.$board->nb[$val].'
'; } diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 2866da54411..e8b168f4507 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -333,7 +333,12 @@ th .button { .nowrap { white-space: ; } - +.nobold { + font-weight: normal !important; +} +.nounderline { + text-decoration: none; +} .blockvmenubookmarks .menu_contenu { background-color: transparent; @@ -1298,6 +1303,19 @@ tr.impair table.nobordernopadding td, tr.pair table.nobordernopadding td { paddi * Boxes */ +.boxstats { + + margin: 4px; + padding: 4px; + /*-moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; + margin-bottom: 8px !important;*/ + border: 1px solid #AAA; + text-align: center; + border-radius: 5px; +} + .boxtable { -moz-box-shadow:2px 4px 2px #cccccc; -webkit-box-shadow:2px 4px 2px #cccccc; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 3e0390b91c0..e2d8523a5b2 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -219,6 +219,12 @@ div.inline-block .nowrap { white-space: ; } +.nobold { + font-weight: normal !important; +} +.nounderline { + text-decoration: none; +} /* ============================================================================== */ @@ -1432,6 +1438,19 @@ div.tabBar .noborder { * Boxes */ +.boxstats { + + margin: 4px; + padding: 4px; + /*-moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; + margin-bottom: 8px !important;*/ + border: 1px solid #AAA; + text-align: center; + border-radius: 5px; +} + .boxtable { -moz-box-shadow: 4px 4px 4px #CCC; -webkit-box-shadow: 4px 4px 4px #CCC; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 7de1adf9cdb..bc4a8bde676 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -246,9 +246,13 @@ div.inline-block .nowrap { white-space: ; } -/*.dolibarrcombobox { - height: 22px; -}*/ +.nobold { + font-weight: normal !important; +} +.nounderline { + text-decoration: none; +} + /* ============================================================================== */ /* Styles to hide objects */ @@ -1570,6 +1574,19 @@ tr.pair td.nohover { * Boxes */ +.boxstats { + + margin: 4px; + padding: 4px; + /*-moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; + margin-bottom: 8px !important;*/ + border: 1px solid #AAA; + text-align: center; + border-radius: 5px; +} + .box { padding-right: 0px; padding-left: 0px; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 316d8515158..9d4e3bef96a 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -224,6 +224,12 @@ div.inline-block .nowrap { white-space: ; } +.nobold { + font-weight: normal !important; +} +.nounderline { + text-decoration: none; +} /* ============================================================================== */ @@ -1558,6 +1564,19 @@ border: 0px; * Boxes */ +.boxstats { + + margin: 4px; + padding: 4px; + /*-moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; + margin-bottom: 8px !important;*/ + border: 1px solid #AAA; + text-align: center; + border-radius: 5px; +} + .box { padding-right: 0px; padding-left: 0px; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8a49ac69e3b..130a6fa8706 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -381,6 +381,12 @@ th .button { .nowrap { white-space: ; } +.nobold { + font-weight: normal !important; +} +.nounderline { + text-decoration: none; +} /* ============================================================================== */ @@ -1818,6 +1824,19 @@ div.tabBar .noborder { * Boxes */ +.boxstats { + + margin: 3px; + padding: 3px; + /*-moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; + margin-bottom: 8px !important;*/ + border: 1px solid #AAA; + text-align: center; + border-radius: 5px; +} + .boxtable { -moz-box-shadow: 4px 4px 4px #DDD; -webkit-box-shadow: 4px 4px 4px #DDD; From 91b51f1f58c5e65d7c9680415d012ab0a0898d16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 15:52:49 +0200 Subject: [PATCH 25/28] Fix: Some td cells must not have hover styles. --- htdocs/core/boxes/box_graph_invoices_permonth.php | 4 ++-- .../boxes/box_graph_invoices_supplier_permonth.php | 4 ++-- htdocs/core/boxes/box_graph_orders_permonth.php | 4 ++-- .../boxes/box_graph_orders_supplier_permonth.php | 4 ++-- htdocs/core/boxes/box_graph_propales_permonth.php | 4 ++-- htdocs/index.php | 2 +- htdocs/theme/cameleo/style.css.php | 12 ++++++++++++ 7 files changed, 23 insertions(+), 11 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 17c44b8b479..63140c64c28 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -192,11 +192,11 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow.=''; $stringtoshow.=''; } - $this->info_box_contents[0][0] = array('td' => 'align="center"','textnoformat'=>$stringtoshow); + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg); } diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 38d12179ea5..d66bffefe10 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -192,11 +192,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow.=''; $stringtoshow.=''; } - $this->info_box_contents[0][0] = array('td' => 'align="center"','textnoformat'=>$stringtoshow); + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg); } diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 987c224d423..1f292364aa2 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -192,11 +192,11 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow.=''; $stringtoshow.=''; } - $this->info_box_contents[0][0] = array('td' => 'align="center"','textnoformat'=>$stringtoshow); + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg); } diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 59b778983a7..f54fc336577 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -192,11 +192,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow.=''; $stringtoshow.=''; } - $this->info_box_contents[0][0] = array('td' => 'align="center"','textnoformat'=>$stringtoshow); + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg); } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index da564fb4c71..182639da994 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -192,11 +192,11 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow.=''; $stringtoshow.=''; } - $this->info_box_contents[0][0] = array('td' => 'align="center"','textnoformat'=>$stringtoshow); + $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg); } diff --git a/htdocs/index.php b/htdocs/index.php index adb35c29f4d..f6d476dade8 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -117,7 +117,7 @@ if (empty($user->societe_id)) print '
'.$langs->trans("DolibarrStateBoard").' 
'; + print '
'; $var=true; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 9d4e3bef96a..07bae5caf48 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1538,6 +1538,10 @@ background: #c0c4c7; border: 0px; } +tr.impair td.nohover, form.impair div.nohover { + background: #eaeaea; +} + .pair { background: #FFFFFF; font-family: ; @@ -1549,6 +1553,10 @@ background: #c0c4c7; border: 0px; } +tr.pair td.nohover { + background: #FFFFFF; +} + .pair td, .impair td { padding: 2px; } @@ -1610,6 +1618,10 @@ background: #c0c4c7; border: 0px; } +tr.box_impair .nohover { +background: #eaeaea; +} + tr.box_pair { /* background: #d0d4d7; */ background: #f4f4f4; From 9e283f98e8bc8d15d26724968ce17c4f10210cc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 15:58:07 +0200 Subject: [PATCH 26/28] Fix: removed deprecated nowrap tag Add changelog entry --- ChangeLog | 1 + htdocs/comm/propal.php | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index c028d285b35..69a2957f767 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5 compared to 3.4 ***** For users: +- New: Can edit customer ref at eny time. - New: [ task #877 ] Reorganize menus. - New: [ task #858 ] Holiday module: note on manual holiday assignation. - New: [ task #892 ] Add hidden option in thirdparty customer/supplier module to hide non active diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 8b0ba5e259f..d316334374e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1595,12 +1595,9 @@ else print '
'; - print '
'; + print ''; - - print ''; print ''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; @@ -1935,7 +1932,7 @@ else // Amount HT print ''; - print ''; + print ''; print ''; // Margin Infos @@ -1948,27 +1945,27 @@ else // Amount VAT print ''; - print ''; + print ''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1") //Localtax1 { print ''; - print ''; + print ''; print ''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 { print ''; - print ''; + print ''; print ''; } // Amount TTC print ''; - print ''; + print ''; print ''; // Statut From c7aadfcf65f8d32bbf0ab41c42c8cdfa2b15fffe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 17:18:44 +0200 Subject: [PATCH 27/28] Fix: syntax error --- htdocs/core/modules/facture/modules_facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 865d1f578bd..31ec4698bb8 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -238,7 +238,7 @@ function facture_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_BUILDDOC',$object,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers return 1; From 486920958c212768cdbc4fa476ecc204c8ae1f4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2013 17:19:35 +0200 Subject: [PATCH 28/28] Fix: Restore error message, but only when required. --- .../modules/facture/doc/pdf_crabe.modules.php | 19 +++++++++++++++++-- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9965b525dd6..3541160ef52 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -692,11 +692,26 @@ class pdf_crabe extends ModelePDFFactures { // Check a payment mode is defined if (empty($object->mode_reglement_code) - && ! $conf->global->FACTURE_CHQ_NUMBER - && ! $conf->global->FACTURE_RIB_NUMBER) + && empty($conf->global->FACTURE_CHQ_NUMBER) + && empty($conf->global->FACTURE_RIB_NUMBER)) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } + // Avoid having any valid PDF with setup that is not complete + elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) + || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) + { + $outputlangs->load("errors"); + + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetTextColor(200,0,0); + $pdf->SetFont('','B', $default_font_size - 2); + $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code); + $pdf->MultiCell(80, 3, $this->error,0,'L',0); + $pdf->SetTextColor(0,0,0); + + $posy=$pdf->GetY()+1; + } // Show payment mode if ($object->mode_reglement_code diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3089dfb0510..913f8f71b5a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -124,6 +124,7 @@ ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check Mysql server is running (in most cases, you can launch it from command line with 'sudo /etc/init.d/mysql start'). ErrorFailedToAddContact=Failed to add contact ErrorDateMustBeBeforeToday=The date can not be greater than today +ErrorPaymentModeDefinedToWithoutSetup=A payment mode was set to type %s but setup of module Invoice was not completed to define information to show for this payment mode. # Warnings WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index f3bcee9c4d9..76888ab7179 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -125,6 +125,7 @@ ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe ErrorToConnectToMysqlCheckInstance=Echec de la connection au serveur de base de donnée. Vérifier que Mysql est bien lancé (dans la plupart des cas, vous pouvez le lancer depuis la ligne de commande par la commande 'sudo /etc/init.d/mysql start'). ErrorFailedToAddContact=Echec à l'ajout du contact ErrorDateMustBeBeforeToday=La date ne peut pas être supérieure à aujourd'hui +ErrorPaymentModeDefinedToWithoutSetup=Un mode de paiement a été défini de type %s mais la configuration du module Facture n'a pas été complété pour définir les informations afficher pour ce mode de paiment. # Warnings WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées
'; print $langs->trans('RefCustomer').''.img_edit($langs->transnoentitiesnoconv('RefCustomer')).''.img_edit($langs->trans('Modify')).'
'.$langs->trans('AmountHT').''.price($object->total_ht).''.price($object->total_ht).''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva).''.price($object->total_tva).''.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc).''.price($object->total_ttc).''.$langs->trans("Currency".$conf->currency).'