From 56295ed43819ea1b975021f31fde75be28065067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Mar 2015 11:28:23 +0100 Subject: [PATCH 01/19] Fixed delivery date in order list not showing up --- htdocs/commande/liste.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 55323b697f9..9f5f1e7fe58 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -6,6 +6,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,7 +113,7 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped llxHeader('',$langs->trans("Orders"),$help_url); $sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; -$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee'; +$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as facturee'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c'; // We'll need this table joined to the select in order to filter by sale From ea7f00e77756dad0980ad0d1254c3232755c1f98 Mon Sep 17 00:00:00 2001 From: Fab Date: Mon, 23 Mar 2015 20:05:31 +0100 Subject: [PATCH 02/19] Fix displaying of the warning image. Since last commit, $objp->date_livraison returns nothing ; max() will then returns wrong result, and the warning image will be displayed when it should not. --- htdocs/commande/liste.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 9f5f1e7fe58..6f009fa2eb0 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -341,7 +341,7 @@ if ($resql) print ''; print ''; - if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_delivery)) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); if(!empty($objp->note_private)) { From 456b11d148ebdfd676a945ada134bed221bb3759 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 25 Mar 2015 11:23:05 +0100 Subject: [PATCH 03/19] Fix: Not using where on sellist --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index cc602d08ed5..821ada820dc 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -766,7 +766,7 @@ class ExtraFields $sqlwhere.= ' WHERE 1'; } if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. - //$sql.=preg_replace('/^ AND /','',$sqlwhere); + $sql.=$sqlwhere; //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); From b250c5588ecb612df124c2a70c454bbe6509baa5 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 25 Mar 2015 16:11:36 +0100 Subject: [PATCH 04/19] Fix : Quantity displayed for virtual stock explanations was wrong --- htdocs/product/stock/product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 338169a6154..400c3c1f006 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -343,7 +343,7 @@ if ($id > 0 || $ref) if (! empty($conf->commande->enabled)) { if ($found) print '
'; else $found=1; - print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_sendings['qty']); + print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_expedition['qty']); $result=$product->load_stats_commande(0,'0'); if ($result < 0) dol_print_error($db,$product->error); print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')'; From e59fed9f380fc9b24437de735feef6329072c0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 26 Mar 2015 11:08:34 +0100 Subject: [PATCH 05/19] Corrected search box alignment in Customer orders list --- htdocs/commande/liste.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 6f009fa2eb0..21194f8b104 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -307,11 +307,11 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5); - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); From 1ca95acbd704568855903321462bb584587eeb10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2015 11:23:21 +0100 Subject: [PATCH 06/19] Fix pb during export of agenda events Conflicts: htdocs/exports/export.php --- htdocs/core/modules/modAgenda.class.php | 12 ++++++------ htdocs/exports/export.php | 2 +- htdocs/langs/en_US/agenda.lang | 2 ++ htdocs/langs/en_US/main.lang | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index c633734b227..9573ca5f018 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -367,24 +367,24 @@ class modAgenda extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="ExportDataset_event1"; $this->export_permission[$r]=array(array("agenda","export")); - $this->export_fields_array[$r]=array('ac.id'=>"ActionId",'ac.ref_ext'=>"ExternalRef",'ac.datec'=>"ActionDateCreation",'ac.datep'=>"DateActionBegin", - 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Title",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp", + $this->export_fields_array[$r]=array('ac.id'=>"IdAgenda",'ac.ref_ext'=>"ExternalRef",'ac.datec'=>"DateCreation",'ac.datep'=>"DateActionBegin", + 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Title",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"Duration", 'cac.libelle'=>"ActionType", 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town', - 'co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4', + 'co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6', 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra'); $this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date", 'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Number", 'ac.durationp'=>"Duree", - 'cac.libelle'=>"List:c_actioncomm:libelle:rowid", + 'cac.libelle'=>"List:c_actioncomm:libelle:id", 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text', - 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', + 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text', 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text'); $this->export_entities_array[$r]=array('ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action", 'ac.datep2'=>"action",'ac.label'=>"action",'ac.note'=>"action",'ac.percent'=>"action",'ac.durationp'=>"action", 'cac.libelle'=>"action", 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company', - 'co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company', + 'co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company', 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',); $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 45e78b2ecd3..d76350e878f 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -95,7 +95,7 @@ $entitytolang = array( 'project' => 'Projects', 'projecttask' => 'Tasks', 'task_time' => 'TaskTimeSpent', - 'action' => 'Action' + 'action' => 'Event' ); $array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array(); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 13de82c602f..48c284e2022 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -91,3 +91,5 @@ WorkingTimeRange=Working time range WorkingDaysRange=Working days range AddEvent=Create event MyAvailability=My availability +ActionType=Event type +DateActionBegin=Start event date \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index e53f0df5585..ddf581de1c0 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -347,6 +347,7 @@ Status=Status Favorite=Favorite ShortInfo=Info. Ref=Ref. +ExternalRef=Ref. extern RefSupplier=Ref. supplier RefPayment=Ref. payment CommercialProposalsShort=Commercial proposals From 42c2c81e28eb5a267fb375ff30c42a2d5797adf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2015 12:05:52 +0100 Subject: [PATCH 07/19] Fix detection of html was wrong with img --- htdocs/core/lib/functions.lib.php | 7 ++++--- test/phpunit/FunctionsLibTest.php | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e31c69a6d0c..de5ddc560b2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3972,9 +3972,10 @@ function dol_textishtml($msg,$option=0) if (preg_match('//i',$msg)) return true; - elseif (preg_match('/<(br|div|font|img|li|span|strong|table)>/i',$msg)) return true; - elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true; - elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true; + elseif (preg_match('/<(br|div|font|li|span|strong|table)>/i',$msg)) return true; + elseif (preg_match('/<(br|div|font|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true; + elseif (preg_match('/<(br|div|font|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true; + elseif (preg_match('/<(img)\s+[^<>]*>/i',$msg)) return true; // must accept elseif (preg_match('//i',$msg)) return true; elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp) elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 68ebd5d1703..746a41d3c96 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -204,6 +204,9 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $input='

abc

'; $after=dol_textishtml($input); $this->assertTrue($after); + $input=''; + $after=dol_textishtml($input); + $this->assertTrue($after,'Failure on test of img tag'); // False $input='xxx < br>'; From 26c29216d95787bccea56b05d952ca21528cc3b7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 26 Mar 2015 16:55:13 +0100 Subject: [PATCH 08/19] syntax --- htdocs/comm/action/class/actioncomm.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9a9417a4dac..bc66514940d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -413,7 +413,8 @@ class ActionComm extends CommonObject $resql=$this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) + $num=$this->db->num_rows($resql); + if ($num) { $obj = $this->db->fetch_object($resql); @@ -469,13 +470,15 @@ class ActionComm extends CommonObject $this->elementtype = $obj->elementtype; } $this->db->free($resql); - return 1; } else { $this->error=$this->db->lasterror(); return -1; } + + return $num; + } From 5e33068e298c34e580ea9bd2f7ff55a078398f0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2015 16:51:25 +0100 Subject: [PATCH 09/19] Update doc --- build/README | 3 --- build/makepack-howto.txt | 11 +++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/README b/build/README index 897a59c4eef..4816be8bc3a 100644 --- a/build/README +++ b/build/README @@ -28,9 +28,6 @@ Note: Prerequisites to build autoexe DoliWamp package: recommanded), open file build/exe/doliwamp.iss and click on button "Compile". The .exe file will be build into directory build. -- To build a translaction package, launch the script -> perl makepack-dolibarrlang.pl - - To build a theme package, launch the script > perl makepack-dolibarrtheme.pl diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 9e5004f4ba7..4e52c6a50eb 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -8,7 +8,7 @@ This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step. - Check all files are commited. -- Update version/info in /ChangeLog +- Update version/info in ChangeLog. To generate a changelog, you can do "git log x.y.z..HEAD --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIXED\|NEW'" - Update version number with x.y.z-w in htdocs/filefunc.inc.php - Update version number with x.y.z-w in build/debian/changelog - Update version number with x.y.z-w in build/rpm/*.spec @@ -17,10 +17,11 @@ beta version of Dolibarr, step by step. - Create a branch (x.y). - Run makepack-dolibarr.pl to generate all packages. + - Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files/lastbuild). -- Post a news on dolibarr.org/dolibarr.fr +- Post a news on dolibarr.org/dolibarr.fr + social networks - Send mail on mailings-list @@ -35,14 +36,16 @@ complete release of Dolibarr, step by step. - Update version number with x.y.z in build/rpm/*.spec - Commit all changes. -- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl +- Run makepack-dolibarr.pl to generate all packages. + - Check content of built packages. - Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files/stable). + - Run makepack-dolibarr.pl again with option to publish files on sourceforge. This will also add official tag. - Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx" on server to point to new files (used by some web sites). +- Post a news on dolibarr.org/dolibarr.fr + social networks - Send mail on mailings-list -- Send news on OpenSource web sites (if major beta or release) From ffe1ee0d84844cbab4fd50954fe491ff808203b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2015 17:12:31 +0100 Subject: [PATCH 10/19] Target 98 to publish of dolibarr sevrer is now working --- build/makepack-dolibarr.pl | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 27af49cb6f4..90f055da9df 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) -# \author (c)2004-2014 Laurent Destailleur +# \author (c)2004-2015 Laurent Destailleur # # This is list of constant you can set to have generated packages moved into a specific dir: #DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild' @@ -15,8 +15,12 @@ use Cwd; + +# Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; -$RPMSUBVERSION="auto"; # auto use value found into BUILD +$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; +$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; + @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages %REQUIREMENTPUBLISH=( @@ -41,6 +45,7 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD "makensis.exe"=>"NSIS" ); +$RPMSUBVERSION="auto"; # auto use value found into BUILD if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake @@ -59,8 +64,6 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/; $SOURCE="$DIR/.."; $DESTI="$SOURCE/build"; -$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/files"; if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"}) { print "Error: Missing environment variables.\n"; @@ -210,9 +213,9 @@ else { printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target}); } $cpt=98; - printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); + printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".$REQUIREMENTPUBLISH{"ASSO"}); $cpt=99; - printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); + printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"}); # Ask which target to build print "Choose one package number or several separated with space (0 - ".$cpt."): "; @@ -1026,9 +1029,16 @@ if ($nboftargetok) { if (! $filesize) { next; } print "\n"; - print "Publish file ".$file." to ".$filestoscan{$file}."\n"; - $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; + if ($target eq 'SF') { + $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; + print "Publish file ".$file." to $NEWPUBLISH/".$filestoscan{$file}."\n"; + } + else + { + $destFolder="$NEWPUBLISH"; + print "Publish file ".$file." to $NEWPUBLISH\n"; + } # mkdir #my $ssh = Net::SSH::Perl->new("frs.sourceforge.net"); From b60a56dc94e7d7d620346b598d8e28324554f977 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2015 17:17:55 +0100 Subject: [PATCH 11/19] Fix search on command --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 59df993b686..1fe0a728a22 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -43,7 +43,7 @@ $orderyear=GETPOST("orderyear","int"); $ordermonth=GETPOST("ordermonth","int"); $deliveryyear=GETPOST("deliveryyear","int"); $deliverymonth=GETPOST("deliverymonth","int"); -$search_ref=GETPOST('search_ref','alpha'); +$search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha'); $search_ref_customer=GETPOST('search_ref_customer','alpha'); $search_company=GETPOST('search_company','alpha'); $sall=GETPOST('sall'); From 043d11d78564ee0fb5c286e5ba4e4963eea93d79 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Sat, 28 Mar 2015 03:44:16 +0100 Subject: [PATCH 12/19] check if $mc is a valid global --- htdocs/core/login/functions_dolibarr.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 69aec814413..8654c866969 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -111,15 +111,22 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); } - if ($passok && ! empty($conf->multicompany->enabled)) // We must check entity + // We must check entity + if ($passok) { global $mc; - $ret=$mc->checkRight($obj->rowid, $entitytotest); - if ($ret < 0) - { - dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko entity '".$entitytotest."' not allowed for user '".$obj->rowid."'"); - $login=''; // force authentication failure + if (!isset($mc)) { + //Global not available, disable $conf->multicompany->enabled for safety + $conf->multicompany->enabled = false; + } + + if (! empty($conf->multicompany->enabled)) { + $ret = $mc->checkRight($obj->rowid, $entitytotest); + if ($ret < 0) { + dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko entity '" . $entitytotest . "' not allowed for user '" . $obj->rowid . "'"); + $login = ''; // force authentication failure + } } } } From b8bd27009e2a8ad6ad773abe18a5f6c3b8a00199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2015 18:32:53 +0100 Subject: [PATCH 13/19] Simplify code --- htdocs/core/login/functions_dolibarr.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 8654c866969..74da1f97ff0 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -112,18 +112,16 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= } // We must check entity - if ($passok) + if ($passok && ! empty($conf->multicompany->enabled)) // We must check entity { global $mc; - if (!isset($mc)) { - //Global not available, disable $conf->multicompany->enabled for safety - $conf->multicompany->enabled = false; - } - - if (! empty($conf->multicompany->enabled)) { + if (! isset($mc)) $conf->multicompany->enabled = false; // Global not available, disable $conf->multicompany->enabled for safety + else + { $ret = $mc->checkRight($obj->rowid, $entitytotest); - if ($ret < 0) { + if ($ret < 0) + { dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko entity '" . $entitytotest . "' not allowed for user '" . $obj->rowid . "'"); $login = ''; // force authentication failure } From 018a0d779f0b63dc931fc7d9087add1da1dd38c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Mar 2015 15:18:10 +0200 Subject: [PATCH 14/19] Fix translation --- htdocs/langs/en_US/admin.lang | 4 +- htdocs/langs/en_US/categories.lang | 152 ++++++++++++++--------------- htdocs/langs/en_US/main.lang | 4 +- 3 files changed, 79 insertions(+), 81 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b70f9fa8a84..353deba7c88 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -492,8 +492,8 @@ Module1200Name=Mantis Module1200Desc=Mantis integration Module1400Name=Accounting Module1400Desc=Accounting management (double parties) -Module1780Name=Categories -Module1780Desc=Category management (products, suppliers and customers) +Module1780Name=Tags/Categories +Module1780Desc=Create tags/category on products, customers, suppliers, contacts or members Module2000Name=WYSIWYG editor Module2000Desc=Allow to edit some text area using an advanced editor Module2300Name=Cron diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 7a3c7f0c288..11b1dc8eac0 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -1,64 +1,62 @@ # Dolibarr language file - Source file is en_US - categories -Category=Category -Categories=Categories -Rubrique=Category -Rubriques=Categories -categories=categories -TheCategorie=The category -NoCategoryYet=No category of this type created +Rubrique=Tag/Category +Rubriques=Tags/Categories +categories=tags/categories +TheCategorie=The tag/category +NoCategoryYet=No tag/category of this type created In=In AddIn=Add in modify=modify Classify=Classify -CategoriesArea=Categories area -ProductsCategoriesArea=Products/Services categories area -SuppliersCategoriesArea=Suppliers categories area -CustomersCategoriesArea=Customers categories area -ThirdPartyCategoriesArea=Third parties categories area -MembersCategoriesArea=Members categories area -ContactsCategoriesArea=Contacts categories area -MainCats=Main categories +CategoriesArea=Tags/Categories area +ProductsCategoriesArea=Products/Services tags/categories area +SuppliersCategoriesArea=Suppliers tags/categories area +CustomersCategoriesArea=Customers tags/categories area +ThirdPartyCategoriesArea=Third parties tags/categories area +MembersCategoriesArea=Members tags/categories area +ContactsCategoriesArea=Contacts tags/categories area +MainCats=Main tags/categories SubCats=Subcategories CatStatistics=Statistics -CatList=List of categories -AllCats=All categories -ViewCat=View category -NewCat=Add category -NewCategory=New category -ModifCat=Modify category -CatCreated=Category created -CreateCat=Create category -CreateThisCat=Create this category +CatList=List of tags/categories +AllCats=All tags/categories +ViewCat=View tag/category +NewCat=Add tag/category +NewCategory=New tag/category +ModifCat=Modify tag/category +CatCreated=Tag/category created +CreateCat=Create tag/category +CreateThisCat=Create this tag/category ValidateFields=Validate the fields NoSubCat=No subcategory. SubCatOf=Subcategory -FoundCats=Found categories -FoundCatsForName=Categories found for the name : -FoundSubCatsIn=Subcategories found in the category -ErrSameCatSelected=You selected the same category several times -ErrForgotCat=You forgot to choose the category +FoundCats=Found tags/categories +FoundCatsForName=Tags/categories found for the name : +FoundSubCatsIn=Subcategories found in the tag/category +ErrSameCatSelected=You selected the same tag/category several times +ErrForgotCat=You forgot to choose the tag/category ErrForgotField=You forgot to inform the fields ErrCatAlreadyExists=This name is already used -AddProductToCat=Add this product to a category? -ImpossibleAddCat=Impossible to add the category -ImpossibleAssociateCategory=Impossible to associate the category to +AddProductToCat=Add this product to a tag/category? +ImpossibleAddCat=Impossible to add the tag/category +ImpossibleAssociateCategory=Impossible to associate the tag/category to WasAddedSuccessfully=%s was added successfully. -ObjectAlreadyLinkedToCategory=Element is already linked to this category. -CategorySuccessfullyCreated=This category %s has been added with success. -ProductIsInCategories=Product/service owns to following categories -SupplierIsInCategories=Third party owns to following suppliers categories -CompanyIsInCustomersCategories=This third party owns to following customers/prospects categories -CompanyIsInSuppliersCategories=This third party owns to following suppliers categories -MemberIsInCategories=This member owns to following members categories -ContactIsInCategories=This contact owns to following contacts categories -ProductHasNoCategory=This product/service is not in any categories -SupplierHasNoCategory=This supplier is not in any categories -CompanyHasNoCategory=This company is not in any categories -MemberHasNoCategory=This member is not in any categories -ContactHasNoCategory=This contact is not in any categories -ClassifyInCategory=Classify in category +ObjectAlreadyLinkedToCategory=Element is already linked to this tag/category. +CategorySuccessfullyCreated=This tag/category %s has been added with success. +ProductIsInCategories=Product/service owns to following tags/categories +SupplierIsInCategories=Third party owns to following suppliers tags/categories +CompanyIsInCustomersCategories=This third party owns to following customers/prospects tags/categories +CompanyIsInSuppliersCategories=This third party owns to following suppliers tags/categories +MemberIsInCategories=This member owns to following members tags/categories +ContactIsInCategories=This contact owns to following contacts tags/categories +ProductHasNoCategory=This product/service is not in any tags/categories +SupplierHasNoCategory=This supplier is not in any tags/categories +CompanyHasNoCategory=This company is not in any tags/categories +MemberHasNoCategory=This member is not in any tags/categories +ContactHasNoCategory=This contact is not in any tags/categories +ClassifyInCategory=Classify in tag/category NoneCategory=None -NotCategorized=Without category +NotCategorized=Without tag/category CategoryExistsAtSameLevel=This category already exists with this ref ReturnInProduct=Back to product/service card ReturnInSupplier=Back to supplier card @@ -66,22 +64,22 @@ ReturnInCompany=Back to customer/prospect card ContentsVisibleByAll=The contents will be visible by all ContentsVisibleByAllShort=Contents visible by all ContentsNotVisibleByAllShort=Contents not visible by all -CategoriesTree=Categories tree -DeleteCategory=Delete category -ConfirmDeleteCategory=Are you sure you want to delete this category ? -RemoveFromCategory=Remove link with categorie -RemoveFromCategoryConfirm=Are you sure you want to remove link between the transaction and the category ? -NoCategoriesDefined=No category defined -SuppliersCategoryShort=Suppliers category -CustomersCategoryShort=Customers category -ProductsCategoryShort=Products category -MembersCategoryShort=Members category -SuppliersCategoriesShort=Suppliers categories -CustomersCategoriesShort=Customers categories +CategoriesTree=Tags/categories tree +DeleteCategory=Delete tag/category +ConfirmDeleteCategory=Are you sure you want to delete this tag/category ? +RemoveFromCategory=Remove link with tag/categorie +RemoveFromCategoryConfirm=Are you sure you want to remove link between the transaction and the tag/category ? +NoCategoriesDefined=No tag/category defined +SuppliersCategoryShort=Suppliers tags/category +CustomersCategoryShort=Customers tags/category +ProductsCategoryShort=Products tags/category +MembersCategoryShort=Members tags/category +SuppliersCategoriesShort=Suppliers tags/categories +CustomersCategoriesShort=Customers tags/categories CustomersProspectsCategoriesShort=Custo./Prosp. categories -ProductsCategoriesShort=Products categories -MembersCategoriesShort=Members categories -ContactCategoriesShort=Contacts categories +ProductsCategoriesShort=Products tags/categories +MembersCategoriesShort=Members tags/categories +ContactCategoriesShort=Contacts tags/categories ThisCategoryHasNoProduct=This category does not contain any product. ThisCategoryHasNoSupplier=This category does not contain any supplier. ThisCategoryHasNoCustomer=This category does not contain any customer. @@ -90,23 +88,23 @@ ThisCategoryHasNoContact=This category does not contain any contact. AssignedToCustomer=Assigned to a customer AssignedToTheCustomer=Assigned to the customer InternalCategory=Internal category -CategoryContents=Category contents -CategId=Category id -CatSupList=List of supplier categories -CatCusList=List of customer/prospect categories -CatProdList=List of products categories -CatMemberList=List of members categories -CatContactList=List of contact categories and contact -CatSupLinks=Links between suppliers and categories -CatCusLinks=Links between customers/prospects and categories -CatProdLinks=Links between products/services and categories -CatMemberLinks=Links between members and categories -DeleteFromCat=Remove from category +CategoryContents=Tag/category contents +CategId=Tag/category id +CatSupList=List of supplier tags/categories +CatCusList=List of customer/prospect tags/categories +CatProdList=List of products tags/categories +CatMemberList=List of members tags/categories +CatContactList=List of contact tags/categories and contact +CatSupLinks=Links between suppliers and tags/categories +CatCusLinks=Links between customers/prospects and tags/categories +CatProdLinks=Links between products/services and tags/categories +CatMemberLinks=Links between members and tags/categories +DeleteFromCat=Remove from tags/category DeletePicture=Picture delete ConfirmDeletePicture=Confirm picture deletion? ExtraFieldsCategories=Complementary attributes -CategoriesSetup=Categories setup -CategorieRecursiv=Link with parent category automatically +CategoriesSetup=Tags/categories setup +CategorieRecursiv=Link with parent tag/category automatically CategorieRecursivHelp=If activated, product will also linked to parent category when adding into a subcategory AddProductServiceIntoCategory=Add the following product/service -ShowCategory=Show category \ No newline at end of file +ShowCategory=Show tag/category \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ddf581de1c0..083154f5936 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -390,8 +390,8 @@ Available=Available NotYetAvailable=Not yet available NotAvailable=Not available Popularity=Popularity -Categories=Categories -Category=Category +Categories=Tags/categories +Category=Tag/category By=By From=From to=to From 5fe5ec939da6dccb515b20da2b6eb4bc144dd96c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Apr 2015 10:54:24 +0200 Subject: [PATCH 15/19] Fix: delivery date must not be autofill with current date --- htdocs/commande/card.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 27c333eec21..d205b3a603e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1279,7 +1279,7 @@ if ($action == 'create' && $user->rights->commande->creer) { $demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0)); $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; + $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:''; $datedelivery = (! empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); @@ -1300,7 +1300,7 @@ if ($action == 'create' && $user->rights->commande->creer) { $demand_reason_id = $soc->demand_reason_id; $remise_percent = $soc->remise_percent; $remise_absolue = 0; - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; + $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:''; $projectid = 0; } $absolute_discount=$soc->getAvailableDiscounts(); @@ -1368,7 +1368,8 @@ if ($action == 'create' && $user->rights->commande->creer) { } // Date print '' . $langs->trans('Date') . ''; - $form->select_date('', 're', '', '', '', "crea_commande", 1, 1); + //$form->select_date($dateorder, 're', '', '', '', "crea_commande", 1, 1); + $form->select_date('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print ''; // Date de livraison @@ -1376,7 +1377,7 @@ if ($action == 'create' && $user->rights->commande->creer) { if (empty($datedelivery)) { if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; + else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE_DELIVERY)?-1:''; } $form->select_date($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1); print ""; From 293495467f5457eb92e27355efea6ca7a7c20da3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Apr 2015 11:30:48 +0200 Subject: [PATCH 16/19] Fix: Bad ref used into notification message --- htdocs/commande/class/commande.class.php | 4 +-- htdocs/core/class/notify.class.php | 34 +++++++++++++----------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 519ba8cd43f..ba581a1ca7a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -109,7 +109,7 @@ class Commande extends CommonOrder // Pour board var $nbtodo; var $nbtodolate; - + /** * ERR Not engouch stock */ @@ -299,7 +299,7 @@ class Commande extends CommonOrder // Rename directory if dir was a temporary ref if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref) + // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) // in order not to lose the attachments $oldref = dol_sanitizeFileName($this->ref); $newref = dol_sanitizeFileName($num); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index ac63b3e48c5..b0d4b4e2690 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -171,6 +171,8 @@ class Notify return 0; } + $oldref=(empty($object->oldref)?$object->ref:$object->oldref); + $newref=(empty($object->newref)?$object->ref:$object->newref); // Check notification per third party $sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,"; @@ -215,32 +217,32 @@ class Notify $link='/compta/facture.php?facid='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref); break; case 'ORDER_VALIDATE': $link='/commande/card.php?id='.$object->id; $dir_output = $conf->commande->dir_output; $object_type = 'order'; - $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref); break; case 'PROPAL_VALIDATE': $link='/comm/propal.php?id='.$object->id; $dir_output = $conf->propal->dir_output; $object_type = 'propal'; - $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref); break; case 'FICHINTER_VALIDATE': $link='/fichinter/card.php?id='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'ficheinter'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref); break; case 'ORDER_SUPPLIER_APPROVE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->dir_output.'/commande/'; $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs)); + $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': @@ -248,16 +250,16 @@ class Notify $dir_output = $conf->fournisseur->dir_output.'/commande/'; $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs)); + $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref); break; } - $ref = dol_sanitizeFileName($object->ref); + $ref = dol_sanitizeFileName($newref); $pdf_path = $dir_output."/".$ref."/".$ref.".pdf"; if (! dol_is_file($pdf_path)) { @@ -344,32 +346,32 @@ class Notify $link='/compta/facture.php?facid='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref); break; case 'ORDER_VALIDATE': $link='/commande/card.php?id='.$object->id; $dir_output = $conf->commande->dir_output; $object_type = 'order'; - $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref); break; case 'PROPAL_VALIDATE': $link='/comm/propal.php?id='.$object->id; $dir_output = $conf->propal->dir_output; $object_type = 'propal'; - $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref); break; case 'FICHINTER_VALIDATE': $link='/fichinter/card.php?id='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'ficheinter'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref); break; case 'ORDER_SUPPLIER_APPROVE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->dir_output.'/commande/'; $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs)); + $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': @@ -377,16 +379,16 @@ class Notify $dir_output = $conf->fournisseur->dir_output.'/commande/'; $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs)); + $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref); break; } - $ref = dol_sanitizeFileName($object->ref); + $ref = dol_sanitizeFileName($newref); $pdf_path = $dir_output."/".$ref."/".$ref.".pdf"; if (! dol_is_file($pdf_path)) { From 1bc0f6c99f303336d706027782c5e83fd7c1e61b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Apr 2015 12:02:32 +0200 Subject: [PATCH 17/19] Fix: do not show end date when it is same than start date --- htdocs/core/class/html.formactions.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 333969fc3b3..ee26ca2ba7b 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -210,7 +210,10 @@ class FormActions { $tmpa=dol_getdate($action->datep); $tmpb=dol_getdate($action->datef); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) print '-'.dol_print_date($action->datef,'hour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) + { + if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef,'hour'); + } else print '-'.dol_print_date($action->datef,'dayhour'); } print ''; From ad1e4134a95198da3ef59405e5d8dbf1d8c5bc8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Apr 2015 12:22:50 +0200 Subject: [PATCH 18/19] Fix: bcc was lost if notif to bcc was also forced --- htdocs/core/actions_sendmails.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 49de1529321..590c805b8aa 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -132,9 +132,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; $message = $_POST['message']; $sendtobcc= GETPOST('sendtoccc'); - if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); - if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); - if ($mode == 'emailfrominvoice') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); + if ($mode == 'emailfromproposal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)); + if ($mode == 'emailfromorder') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)); + if ($mode == 'emailfrominvoice') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)); $deliveryreceipt = $_POST['deliveryreceipt']; From 16a620f926b4455efcc0d604bd3e15b3ed65a8db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Apr 2015 16:07:22 +0200 Subject: [PATCH 19/19] Fix: Deadlock situation (when order were canceled, no way to make nothing on it) Fix: Don't know how I forgot this events into trigger system. --- htdocs/comm/action/class/actioncomm.class.php | 4 +-- htdocs/commande/card.php | 8 +++-- htdocs/commande/class/commande.class.php | 6 ++-- ...terface_50_modAgenda_ActionsAuto.class.php | 35 ++++++++++++++++++- .../mysql/data/llx_c_action_trigger.sql | 17 +++++---- .../install/mysql/migration/3.6.0-3.7.0.sql | 3 ++ htdocs/langs/en_US/agenda.lang | 5 ++- 7 files changed, 61 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index bc66514940d..6ff654aadd1 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -476,9 +476,9 @@ class ActionComm extends CommonObject $this->error=$this->db->lasterror(); return -1; } - + return $num; - + } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d205b3a603e..a56f94e1a7e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -138,8 +138,10 @@ if (empty($reshook)) } // Reopen a closed order - else if ($action == 'reopen' && $user->rights->commande->creer) { - if ($object->statut == 3) { + else if ($action == 'reopen' && $user->rights->commande->creer) + { + if ($object->statut == -1 || $object->statut == 3) + { $result = $object->set_reopen($user); if ($result > 0) { @@ -2181,7 +2183,7 @@ if ($action == 'create' && $user->rights->commande->creer) { } // Reopen a closed order - if ($object->statut == 3 && $user->rights->commande->creer) { + if (($object->statut == 3 || $object->statut == -1) && $user->rights->commande->creer) { print ''; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ba581a1ca7a..0b7c6a19849 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -60,7 +60,7 @@ class Commande extends CommonOrder var $ref_int; var $contactid; var $fk_project; - var $statut; // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not) + var $statut; // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Delivered=Sent/Received, billed or not) var $facturee; // deprecated var $billed; // billed or not @@ -437,7 +437,7 @@ class Commande extends CommonOrder global $conf,$langs; $error=0; - if ($this->statut != 3) + if ($this->statut != -1 && $this->statut != 3) { dol_syslog(get_class($this)."::set_reopen order has not status closed", LOG_WARNING); return 0; @@ -461,7 +461,7 @@ class Commande extends CommonOrder else { $error++; - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); dol_print_error($this->db); } diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 346932ec61e..0ab64d406c8 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -182,7 +182,40 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->sendtoid=0; } - elseif ($action == 'ORDER_SENTBYMAIL') + elseif ($action == 'ORDER_CLOSE') + { + $langs->load("orders"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + } + elseif ($action == 'ORDER_CLASSIFY_BILLED') + { + $langs->load("orders"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderBilledInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("OrderBilledInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + } + elseif ($action == 'ORDER_CANCEL') + { + $langs->load("orders"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + } + elseif ($action == 'ORDER_SENTBYMAIL') { $langs->load("orders"); diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 29adb70c46e..1dde6d5d37c 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -32,25 +32,29 @@ -- List of all managed triggered events (used for trigger agenda and for notification) -- delete from llx_c_action_trigger; -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22); @@ -58,7 +62,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 7a432a1109e..aa3450e2ea5 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -27,6 +27,9 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5); -- VPGSQL8.2 ALTER TABLE llx_contrat ALTER COLUMN fk_commercial_signature DROP NOT NULL; -- VPGSQL8.2 ALTER TABLE llx_contrat ALTER COLUMN fk_commercial_suivi DROP NOT NULL; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 48c284e2022..3a3f24e2dc1 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -48,7 +48,10 @@ InvoiceValidatedInDolibarr=Invoice %s validated InvoiceValidatedInDolibarrFromPos=Invoice %s validated from POS InvoiceBackToDraftInDolibarr=Invoice %s go back to draft status InvoiceDeleteDolibarr=Invoice %s deleted -OrderValidatedInDolibarr= Order %s validated +OrderValidatedInDolibarr=Order %s validated +OrderDeliveredInDolibarr=Order %s classified delivered +OrderCanceledInDolibarr=Order %s canceled +OrderBilledInDolibarr=Order %s classified billed OrderApprovedInDolibarr=Order %s approved OrderRefusedInDolibarr=Order %s refused OrderBackToDraftInDolibarr=Order %s go back to draft status