diff --git a/ChangeLog b/ChangeLog index 4f7882f65bb..20d04e9186f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -107,9 +107,15 @@ Fix: Can disable features with PHPEXCEL (no DLSF compatible). Fix: Can disable features with CKEDITOR. Fix: Pb of records not correctly cleaned when module marge is uninstalled (conflict between 'margin' and 'margins'). -Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing -Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents -Fix: Suppliers invoice mask fails using {tttt} in numbering +Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing. +Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents. +Fix: Suppliers invoice mask fails using {tttt} in numbering. +Fix: pdf template name for typhon was not correctly et when enabling module. +Fix: Navigation on notes for shipments was not working. +Fix: [ bug #1353 ] Email notifications, wrong URL. +Fix: [ bug #1362 ] Note is not saved. +Fix: tr/td balance. +Fix: [ bug #1360 ] note indicator for member tab. ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/build/debian/changelog b/build/debian/changelog index eb2100922f4..d4a3c561ee0 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -3,7 +3,14 @@ dolibarr (3.6.0-1) unstable; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. - -- Laurent Destailleur (eldy) Sat, 8 Feb 2014 12:00:00 +0100 + -- Laurent Destailleur (eldy) Sat, 9 May 2014 12:00:00 +0100 + +dolibarr (3.5.3-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Fri, 2 May 2014 12:00:00 +0100 dolibarr (3.5.2-3) unstable; urgency=low diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index 2785eaa21cd..a6347863b1d 100755 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -36,7 +36,7 @@ $force_install_lockinstall='444'; //$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; -//$force_dolibarr_lib_PHPEXCEL_PATH=''; +//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled' //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled' //$force_dolibarr_js_JQUERY='/javascript/jquery'; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c5b3a6a991a..62c6c60fc9c 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -516,12 +516,13 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n"; - $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" $FILENAMETGZ"; + $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ"; + print "$cmd\n"; $ret=`$cmd`; # Move to final dir - print "Move $FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n"; - $ret=`mv "$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`; + print "Move $BUILDROOT/$FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n"; + $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`; next; } diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index dc149c5e0b8..c43d1769458 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -20,7 +20,8 @@ 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). +- Move build files into www.dolibarr.org web site + (/home/dolibarr/wwwroot/files/lastbuild). - Post a news on dolibarr.org/dolibarr.fr - Send mail on mailings-list @@ -36,17 +37,17 @@ complete release of Dolibarr, step by step. - Update version number with x.y.z in build/debian/changelog - Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z in build/rpm/*.spec -- Update PAD files. - Commit all changes. - Add a Tag (x.y.z) - Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl - Check content of built packages. -- Move build files (tgz+exe+deb+rpm...), ChangeLog and PAD files - into www.dolibarr.org web site (/home/dolibarr/wwwroot/files). -- Edit symbolic links in directory "/home/dolibarr/wwwroot/files" on server to - point to new files (used by PAD descriptor). -- Upload files dolibarr.*.tgz and doliwamp.*.exe on sourceforge. +- 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. +- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx" + on server to point to new files (used by some web sites). - Send mail on mailings-list - Send news on OpenSource web sites (if major beta or release) diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index c44481db736..e702c8d4530 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.6.0", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.6.0", "3.5.3", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index a4b1768e037..060cb6e04a2 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -332,7 +332,10 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog -* Fri Feb 21 2014 Laurent Destailleur 3.6.0-0.2.b +* Fri May 9 2014 Laurent Destailleur 3.6.0-0.2.b +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 - Upstream release * Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 551e6acf638..7df3bd5f43b 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -568,7 +568,10 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog -* Mon Feb 21 2014 Laurent Destailleur 3.6.0-0.2.b +* Fri May 9 2014 Laurent Destailleur 3.6.0-0.2.b +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 - Upstream release * Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index ddf4eff8d8f..30543c0e3f2 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -337,7 +337,10 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog -* Mon Feb 21 2014 Laurent Destailleur 3.6.0-0.2.b +* Fri May 9 2014 Laurent Destailleur 3.6.0-0.2.b +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 - Upstream release * Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 7ff41c5c6e7..eb26e5c807e 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -348,7 +348,10 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog -* Mon Feb 21 2014 Laurent Destailleur 3.6.0-0.2.b +* Fri May 9 2014 Laurent Destailleur 3.6.0-0.2.b +- Upstream release + +* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 - Upstream release * Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index c46b9a7640e..96ccd19b928 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ /** * \file htdocs/adherents/note.php * \ingroup member - * \brief Fiche de notes sur un adherent + * \brief Tabe for note of a member */ require '../main.inc.php'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f9d1222cb35..8d2c4ceed46 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -47,7 +47,7 @@ class Categorie extends CommonObject var $label; var $description; var $socid; - var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member + var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member, 4=Contact var $import_key; var $cats=array(); // Tableau en memoire des categories diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 635f28e318b..a54a0bcd935 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("bills"); -$chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"]; +$chid=GETPOST("id"); +$action=GETPOST('action'); $amounts = array(); // Security check @@ -43,7 +44,7 @@ if ($user->societe_id > 0) * Actions */ -if ($_POST["action"] == 'add_payment') +if ($action == 'add_payment') { $error=0; @@ -171,20 +172,19 @@ if ($_GET["action"] == 'create') print '
'; print ''; - print ''; + print ''; + print ''; print ''; print ''; print ""; - print ''; + print ''; print '\n"; print '\n"; print '\n"; print '\n"; - print ''; $sql = "SELECT sum(p.amount) as total"; @@ -198,44 +198,52 @@ if ($_GET["action"] == 'create') $db->free(); } print ''; - print "'; + print ''; - print "'; + print ''; + print "'; + print ''; - print ""; - - print '"; - print ''; + print ''; - print '\n"; - - print ''; + print ''; print ''; print ''; - print ''; // Number print ''."\n"; + print ''; + print ''."\n"; + + print ''; + print ''; + print ''; + print ''; + + print '
Charge
'.$langs->trans("Ref").''; - print ''.$chid.'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Type")."".$charge->type_libelle."
'.$langs->trans("Period")."".dol_print_date($charge->periode,'day')."
'.$langs->trans("Label").''.$charge->lib."
'.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."
'.$langs->trans("Amount")."".price($charge->amount,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("AlreadyPaid").''.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
".$langs->trans("RemainderToPay")."".price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
".$langs->trans("Payment").'
".$langs->trans("Payment").'
'.$langs->trans("Date").''; + print '
'.$langs->trans("Date").''; $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0; $form->select_date($datepayment,'','','','',"add_payment",1,1); print "'.$langs->trans("Comments").'
'.$langs->trans("PaymentMode").''; + print '
'.$langs->trans("PaymentMode").''; $form->select_types_paiements(isset($_POST["paiementtype"])?$_POST["paiementtype"]:$charge->paiementtype, "paiementtype"); print "
'.$langs->trans('AccountToDebit').''; + print ''; $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$charge->accountid, "accountid", 0, '',1); // Show opend bank account list print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; - print '
'.$langs->trans("Comments").'
'; + + print '
'; /* * Autres charges impayees */ $num = 1; $i = 0; - print ''; - print ''; + print '
'; print ''; //print ''; print ''; @@ -251,15 +259,12 @@ if ($_GET["action"] == 'create') while ($i < $num) { - //$objp = $db->fetch_object($result); $objp = $charge; $var=!$var; print ""; - //print '\n"; - if ($objp->date_ech > 0) { print "\n"; @@ -273,7 +278,7 @@ if ($_GET["action"] == 'create') print '"; - print '"; + print '"; print ''; print "\n"; } - print "
'.$langs->trans("SocialContribution").''.$langs->trans("DateDue").'
'.$charge->getNomUrl(1)."".dol_print_date($objp->date_ech,'day')."'.price($sumpaid)."'.price($objp->amount-$sumpaid)."'.price($objp->amount - $sumpaid)."'; if ($sumpaid < $objp->amount) @@ -304,7 +309,6 @@ if ($_GET["action"] == 'create') print ' 
\n"; print ""; diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index fcbf131cb88..48a8f656959 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -250,7 +250,7 @@ if ($id > 0) $head=tax_prepare_head($object); - print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); + dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); // Confirmation de la suppression de la charge if ($action == 'paid') @@ -297,7 +297,7 @@ if ($id > 0) print ''; /* - * Paiements + * Payments */ $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; $sql.= "c.libelle as paiement_type"; @@ -318,8 +318,12 @@ if ($id > 0) $i = 0; $total = 0; echo ''; print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; $var=True; while ($i < $num) @@ -327,15 +331,15 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print "\n"; + print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; + print '\n"; print "\n"; print '\n"; print ""; $totalpaye += $objp->amount; $i++; } - + if ($object->paye == 0) { print "\n"; @@ -369,7 +373,7 @@ if ($id > 0) print dol_print_date($object->periode,"day"); } print ""; - + // Due date if ($action == 'edit') { @@ -400,7 +404,7 @@ if ($id > 0) if ($action == 'edit') print "\n"; - print ''; + dol_fiche_end(); /* diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 705a39ab636..317b00dd33a 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -133,7 +133,7 @@ class Notify $langs->load("other"); - dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file"); + dol_syslog(get_class($this)."::send action=".$action.", socid=".$socid.", texte=".$texte.", objet_type=".$objet_type.", objet_id=".$objet_id.", file=".$file); $sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname,"; $sql.= " a.rowid as adid, a.label, a.code, n.rowid"; @@ -185,10 +185,10 @@ class Notify $link='/compta/facture.php?facid='.$objet_id; break; case 'order': - $link='/commande/fiche.php?facid='.$objet_id; + $link='/commande/fiche.php?id='.$objet_id; break; case 'order_supplier': - $link='/fourn/commande/fiche.php?facid='.$objet_id; + $link='/fourn/commande/fiche.php?id='.$objet_id; break; } // Define $urlwithroot diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 6bf25ba6a43..be898d8a114 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -397,6 +397,7 @@ class DoliDBMysql extends DoliDB 1006 => 'DB_ERROR_CANNOT_CREATE', 1007 => 'DB_ERROR_ALREADY_EXISTS', 1008 => 'DB_ERROR_CANNOT_DROP', + 1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', 1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP', 1044 => 'DB_ERROR_ACCESSDENIED', 1046 => 'DB_ERROR_NODBSELECTED', diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 6161c497b20..09199f84318 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -406,6 +406,7 @@ class DoliDBMysqli extends DoliDB 1006 => 'DB_ERROR_CANNOT_CREATE', 1007 => 'DB_ERROR_ALREADY_EXISTS', 1008 => 'DB_ERROR_CANNOT_DROP', + 1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', 1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP', 1044 => 'DB_ERROR_ACCESSDENIED', 1046 => 'DB_ERROR_NODBSELECTED', diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5d952c0a1c4..48ba0256ae7 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1286,6 +1286,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0) $sql.= " WHERE type = '".$type."'"; $sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")"; + dol_syslog(get_class($this).'::getListOfModels sql='.$sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index ca4358e4bb9..b3574e6c4cf 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -81,9 +81,14 @@ function member_prepare_head($object) // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf,$langs,$object,$head,$h,'member'); + $nbNote = 0; + if(!empty($object->note)) $nbNote++; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); $head[$h][2] = 'note'; + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $h++; $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id; @@ -130,7 +135,7 @@ function member_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsMember"); $head[$h][2] = 'attributes'; $h++; - + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_type_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsMemberType"); $head[$h][2] = 'attributes_type'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index b32536ed1ac..fec3095865b 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -846,8 +846,8 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass { $pdf->SetXY(-20,-$posy); //print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit; - if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); - else $pdf->MultiCell(11, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); + if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(13, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); + else $pdf->MultiCell(13, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); } return $marginwithfooter; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 3d9e6cfd87e..2bfb2ba7c17 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -110,16 +110,15 @@ function delivery_prepare_head($object) $head[$h][2] = 'delivery'; $h++; - /* We are on id of delivery, no shipment - $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->origin_id; $head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][2] = 'contact'; $h++; - $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->origin_id; $head[$h][1] = $langs->trans("Notes"); $head[$h][2] = 'note'; - $h++;*/ + $h++; // Show more tabs from modules // Entries must be declared in modules descriptor with line diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 3d04c422c88..b13177f9127 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -197,16 +197,16 @@ class pdf_typhon extends ModelePDFDeliveryOrder $tplidx = $pdf->importPage(1); } - // Complete object by loading several other informations + // We get the shipment that is the origin of delivery receipt $expedition=new Expedition($this->db); - $result = $expedition->fetch($object->expedition_id); - + $result = $expedition->fetch($object->origin_id); + // Now we get the order that is origin of shipment $commande = new Commande($this->db); if ($expedition->origin == 'commande') { $commande->fetch($expedition->origin_id); } - $object->commande=$commande; + $object->commande=$commande; // We set order of shipment onto delivery. $pdf->Open(); diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 3c192404e3c..3ed72bd2034 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -166,7 +166,7 @@ class mailing_xinputfile extends MailingTargets { $cibles[$j] = array( 'email' => $email, - 'name' => $name, + 'lastname' => $name, 'firstname' => $firstname, 'other' => $other, 'source_url' => '', diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 1fef6c09b46..c412db448a9 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -134,7 +134,7 @@ class mailing_xinputuser extends MailingTargets { $cibles[] = array( 'email' => $email, - 'name' => $lastname, + 'lastname' => $lastname, 'firstname' => $firstname, 'other' => $other, 'source_url' => '', diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 6af42b42033..e930916d72f 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -97,13 +97,13 @@ class modExpedition extends DolibarrModules $this->const[$r][4] = 0; $r++; - $r++; $this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipment"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; - + $r++; + $this->const[$r][0] = "LIVRAISON_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "typhon"; @@ -118,7 +118,6 @@ class modExpedition extends DolibarrModules $this->const[$r][4] = 0; $r++; - $r++; $this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/delivery"; @@ -272,7 +271,7 @@ class modExpedition extends DolibarrModules "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','shipping',".$conf->entity.")", "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[2][2]."' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[2][2]."','delivery',".$conf->entity.")", + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[3][2]."','delivery',".$conf->entity.")", ); return $this->_init($sql,$options); diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 6a244406996..b17d82d051d 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -42,7 +42,7 @@ class modMargin extends DolibarrModules // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). $this->numero = 59000; // Key text used to identify module (for permissions, menus, etc...) - $this->rights_class = 'margin'; + $this->rights_class = 'margins'; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page @@ -114,7 +114,6 @@ class modMargin extends DolibarrModules // Permissions $this->rights = array(); - $this->rights_class = 'margins'; $r=0; $r++; diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 54103e8edf7..27d53b03cd6 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -47,7 +47,30 @@ if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user, $origin, $origin_id); $object = new Expedition($db); -$object->fetch($id); +if ($id > 0 || ! empty($ref)) +{ + $object->fetch($id, $ref); + $object->fetch_thirdparty(); + + if (!empty($object->origin)) + { + $typeobject = $object->origin; + $origin = $object->origin; + $object->fetch_origin(); + } + + // Linked documents + if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) + { + $objectsrc=new Commande($db); + $objectsrc->fetch($object->$typeobject->id); + } + if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) + { + $objectsrc=new Propal($db); + $objectsrc->fetch($object->$typeobject->id); + } +} $permissionnote=$user->rights->expedition->creer; // Used by the include of actions_setnotes.inc.php 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 7a06eafb16a..bf48ab3207f 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 @@ -117,7 +117,6 @@ create table llx_links objectid INTEGER NOT NULL )ENGINE=innodb; - ALTER TABLE llx_categorie_contact ADD PRIMARY KEY pk_categorie_contact (fk_categorie, fk_socpeople); ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_socpeople (fk_socpeople); diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 1560fb350c8..a172b83a99b 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -3,9 +3,9 @@ -- when current version is 2.6.0 or higher. -- - -- Requests to clean corrupted database + -- delete foreign key that should never exists ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency; ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency; @@ -65,6 +65,7 @@ drop table tmp_categorie; delete from llx_categorie_product where fk_categorie not in (select rowid from llx_categorie where type = 0); delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type in (1, 2)); delete from llx_categorie_member where fk_categorie not in (select rowid from llx_categorie where type = 3); +delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4); -- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links. @@ -77,8 +78,9 @@ UPDATE llx_product SET canvas = NULL where canvas = 'service@product'; DELETE FROM llx_boxes where box_id NOT IN (SELECT rowid FROM llx_boxes_def); +update llx_document_model set nom = 'typhon' where (nom = '' OR nom is null) and type = 'delivery'; DELETE FROM llx_document_model WHERE nom ='elevement' AND type='delivery'; -DELETE FROM llx_document_model WHERE nom ='' AND type='delivery'; + -- Fix: It seems this is missing for some users insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 2); @@ -101,6 +103,10 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps -- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid; -- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note); +-- We delete old entries into menu for module margin (pb with margin and margins) +-- VMYSQL DELETE from llx_menu where module = 'margin' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); +-- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); + -- Requests to clean old tables or fields diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index a2b7b4e7e35..980bfe43138 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -54,8 +54,6 @@ class Livraison extends CommonObject var $note_public; var $note_private; - var $expedition_id; - var $date_delivery; // Date really received var $date_creation; var $date_valid; @@ -971,4 +969,4 @@ class LivraisonLigne } -?> \ No newline at end of file +?> diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 9fdb13ffe40..32c5c474ba1 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -46,6 +46,7 @@ $langs->load('orders'); $action=GETPOST('action', 'alpha'); $confirm=GETPOST('confirm', 'alpha'); +$backtourl=GETPOST('backtourl'); // Security check $id = GETPOST('id', 'int'); @@ -149,7 +150,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); + if (! empty($backtourl)) header("Location: ".$backtourl); + else header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); exit; } else @@ -183,7 +185,7 @@ if ($action == 'builddoc') // En get ou en post $object = new Livraison($db); $object->fetch($id); $object->fetch_thirdparty(); - + // Save last template used to generate document if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); @@ -464,11 +466,13 @@ else $result = $delivery->fetch($id); $delivery->fetch_thirdparty(); + // Origin of a 'livraison' (delivery) is ALWAYS 'expedition' (shipment). + // However, origin of shipment in future may differs (commande, proposal, ...) + $expedition=new Expedition($db); $result = $expedition->fetch($delivery->origin_id); - $typeobject = $expedition->origin; - - if ($delivery->origin_id) + $typeobject = $expedition->origin; // example: commande + if ($delivery->origin_id > 0) { $delivery->fetch_origin(); } @@ -487,14 +491,13 @@ else */ if ($action == 'delete') { - $expedition_id = $_GET["expid"]; - print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1); + $expedition_id = GETPOST("expid"); + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id.'&backtourl='.urlencode($backtourl),$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1); } /* * Confirmation de la validation - * */ if ($action == 'valid') { @@ -508,6 +511,20 @@ else */ print '
'.$langs->trans("Payments").''.$langs->trans("Type").''.$langs->trans("Amount").' 
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
"; - print ''.img_object($langs->trans("Payment"),"payment").' '; - print dol_print_date($db->jdate($objp->dp),'day')."'.dol_print_date($db->jdate($objp->dp),'day')."".$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->currency)."
'; + // Shipment + if (($delivery->origin == 'shipment' || $delivery->origin == 'expedition') && $delivery->origin_id > 0) + { + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + print ''; + } + // Ref print ''; print ''; @@ -721,7 +738,7 @@ else { if ($conf->expedition_bon->enabled) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } else { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7ee3b7d967e..ed70080d3c9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2721,7 +2721,17 @@ class Societe extends CommonObject $this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS; $this->zip=empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP; $this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN; - $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)?'':$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; + $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_STATE)?'':$conf->global->MAIN_INFO_SOCIETE_STATE; + + /* Disabled: we don't want any SQL request into method setMySoc. This method set object from env only. + If we need label, label must be loaded by output that need it from id (label depends on output language) + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; + if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) { + $this->state_id= $conf->global->MAIN_INFO_SOCIETE_STATE; + $this->state = getState($this->state_id); + } + */ + $this->note_private=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; $this->nom=$this->name; // deprecated @@ -2741,8 +2751,8 @@ class Societe extends CommonObject { dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - $country_code=getCountry($country_id,2,$this->db); // This need a SQL request, but it's the old feature - $country_label=getCountry($country_id,0,$this->db); // This need a SQL request, but it's the old feature + $country_code=getCountry($country_id,2,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore + $country_label=getCountry($country_id,0,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore } } $this->country_id=$country_id; diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index b56bed7862d..85a1aaa7caf 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -719,4 +719,4 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 9376c1d6189..916f870d874 100755 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -174,4 +174,4 @@ class LangTest extends PHPUnit_Framework_TestCase return; } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index bbd749fc1d1..73310291cf3 100755 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -254,4 +254,4 @@ class ScriptsTest extends PHPUnit_Framework_TestCase return $result; } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index a8c6a36842a..12c01eeba70 100755 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -181,4 +181,4 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index be83927431a..f2a47e2718a 100755 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -180,4 +180,4 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index 6ba1f8891da..b3462bb8ec9 100755 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -213,4 +213,4 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index a6e8c4c6cd7..8ef0c383955 100755 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -181,4 +181,4 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?> diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index b90e9a377e5..e5e5de6d1bd 100755 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -212,4 +212,4 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?>
'.$langs->trans("RefSending").''; + // Nav is hidden because on a delivery receipt of a shipment, if we go on next shipment, we may find no tab (a shipment may not have delivery receipt yet) + //print $form->showrefnav($expedition, 'refshipment', $linkback, 1, 'ref', 'ref'); + print $form->showrefnav($expedition, 'refshipment', $linkback, 0, 'ref', 'ref'); + print '
'.$langs->trans("Ref").''.$delivery->ref.'