diff --git a/ChangeLog b/ChangeLog index 256b92bb912..07cd416c214 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,10 @@ Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice docume 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/htdocs/adherents/note.php b/htdocs/adherents/note.php index d92447434d4..9b9a466dbdd 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 dbbfc83b8ea..b7e2ed030ab 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -46,7 +46,7 @@ class Categorie 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 @@ -296,7 +296,7 @@ class Categorie if (! $error) { $sql = "UPDATE ".MAIN_DB_PREFIX."categorie"; - $sql.= " SET fk_parent = ".$this->fk_parent; + $sql.= " SET fk_parent = ".$this->fk_parent; $sql.= " WHERE fk_parent = ".$this->id; if (!$this->db->query($sql)) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 0b2cc3ea709..637c426d7c9 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,7 +172,8 @@ if ($_GET["action"] == 'create') print '
'; print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -184,7 +186,6 @@ if ($_GET["action"] == 'create') print '\n"; print '\n"; print '\n"; - print ''; $sql = "SELECT sum(p.amount) as total"; @@ -198,43 +199,50 @@ if ($_GET["action"] == 'create') $db->free(); } print ''; - print "'; + print "'; - print "'; + print ''; - print ""; + print "'; - print '"; - print ''; + print ''; - print '\n"; - - print ''; + print ''; print ''; print ''; - print ''; print '\n"; + print ''."\n"; + + print ''; + print ''; + print ''; + print ''; + + print '
'.$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("AmountTTC")."".price($charge->amount).' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("AlreadyPaid").''.price($sumpaid).' '.$langs->trans("Currency".$conf->currency).'
".$langs->trans("RemainderToPay")."".price($total - $sumpaid).' '.$langs->trans("Currency".$conf->currency).'
".$langs->trans("RemainderToPay").''.price($total - $sumpaid).' '.$langs->trans("Currency".$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 ''; @@ -303,17 +311,6 @@ if ($_GET["action"] == 'create') print ''; print "\n"; } - print "
'.$langs->trans("SocialContribution").''.$langs->trans("DateDue").' 
\n"; - // } - // $db->free(); - // } - // else - // { - // print $sql ."
".$db->error(); - // } - /* - * - */ print ""; diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index adc5fb8ae74..0b938510365 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -256,7 +256,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') @@ -303,8 +303,8 @@ if ($id > 0) print ''; /* - * Paiements - */ + * Payments + */ $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; $sql.= "c.libelle as paiement_type"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; @@ -324,8 +324,12 @@ if ($id > 0) $i = 0; $total = 0; echo ''; print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; $var=True; while ($i < $num) @@ -333,15 +337,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 '\n"; print ""; $totalpaye += $objp->amount; $i++; } - + if ($object->paye == 0) { print "\n"; @@ -363,7 +367,7 @@ if ($id > 0) print ""; - // Period end date + // Period end date print ""; print ""; - + // Due date if ($action == 'edit') { @@ -406,7 +410,7 @@ if ($id > 0) if ($action == 'edit') print "\n"; - print ''; + dol_fiche_end(); /* diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index f636831952c..12348afbeaf 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -118,7 +118,10 @@ abstract class CommonDocGenerator 'mycompany_idprof5'=>$mysoc->idprof5, 'mycompany_idprof6'=>$mysoc->idprof6, 'mycompany_vatnumber'=>$mysoc->tva_intra, - 'mycompany_note'=>$mysoc->note + // Only private not exists for "mysoc" + 'mycompany_note'=>$mysoc->note_private + //'mycompany_note_private'=>$mysoc->note_private, + //'mycompany_note_public'=>$mysoc->note_public, ); } diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index abf124b02f3..3b80199f914 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 923f04f992a..227a70a020f 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -257,7 +257,7 @@ class DoliDBMysql extends DoliDB { return explode('.',$this->getVersion()); } - + /** * Return version of database client driver * @@ -267,7 +267,7 @@ class DoliDBMysql extends DoliDB { return mysqli_get_client_info(); } - + /** * Close database connexion @@ -651,6 +651,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 2ed4c74bb17..c2400a43b7e 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -262,7 +262,7 @@ class DoliDBMysqli extends DoliDB { return mysqli_get_client_info($this->db); } - + /** * Close database connexion @@ -650,6 +650,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/member.lib.php b/htdocs/core/lib/member.lib.php index 8ec1fdd4070..2c775b6d739 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/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 9c4a6137d61..f21b2d82ec8 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -103,7 +103,7 @@ class modExpedition extends DolibarrModules $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"; @@ -270,7 +270,7 @@ class modExpedition extends DolibarrModules $sql = array( "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, + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[3][2]."' AND entity = ".$conf->entity, "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[3][2]."','delivery',".$conf->entity.")", ); 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 41b230516d5..5525a80c6f7 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -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.
'.$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)."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("PeriodEndDate").""; if ($action == 'edit') @@ -375,7 +379,7 @@ if ($id > 0) print dol_print_date($object->periode,"day"); } print "