diff --git a/ChangeLog b/ChangeLog index e384f3ade7c..7a5e1c7c5da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -231,6 +231,7 @@ Dolibarr better: - Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work - Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key - Fix: Bad SEPA xml file creation +- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index a0ab00b9db6..aa457470cc5 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1174,7 +1174,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $numicals[dol_string_nospecial($event->icalname)]++; } $color=$event->icalcolor; - $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unmovable'); + $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unmovable'); } else if ($event->type_code == 'BIRTHDAY') { diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 335fc491224..9d16ea0fc44 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -869,7 +869,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } $color=$event->icalcolor; - $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); + $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable'); } else if ($event->type_code == 'BIRTHDAY') { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 2674d30c57d..d6be5f4c0f4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1120,7 +1120,7 @@ else $ref = substr($object->ref, 1, 4); if ($ref == 'PROV' && !empty($modCodeContract->code_auto)) { - $numref = $object->getNextNumRef($soc); + $numref = $object->getNextNumRef($object->thirdparty); } else { diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 87ba0d57c98..1996717e506 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -121,7 +121,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes return 0; } - $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc->code_client,$object->date); + $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc,$object->date); return $numFinal; } diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index 289b474de5e..54da8fc55c4 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -112,7 +112,7 @@ class mod_contract_magre extends ModelNumRefContracts return 0; } - $numFinal=get_next_value($db,$mask,'contrat','ref','',$objsoc->code_client,$contract->date_contrat); + $numFinal=get_next_value($db,$mask,'contrat','ref','',$objsoc,$contract->date_contrat); return $numFinal; } diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index ab06d1417e6..278e20ae7de 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -120,7 +120,7 @@ class mod_arctic extends ModeleNumRefFicheinter return 0; } - $numFinal=get_next_value($db,$mask,'fichinter','ref','',$objsoc->code_client,$object->datec); + $numFinal=get_next_value($db,$mask,'fichinter','ref','',$objsoc,$object->datec); return $numFinal; } diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/livraison/mod_livraison_saphir.php index 5f8a6b93686..1192656bf8d 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/livraison/mod_livraison_saphir.php @@ -120,7 +120,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder return 0; } - $numFinal=get_next_value($db,$mask,'livraison','ref','',$objsoc->code_client,$object->date_livraison); + $numFinal=get_next_value($db,$mask,'livraison','ref','',$objsoc,$object->date_livraison); return $numFinal; } diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 503d8754684..25ccecb253c 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -123,7 +123,7 @@ class mod_propale_saphir extends ModeleNumRefPropales $date=$propal->datep; $customercode=$objsoc->code_client; - $numFinal=get_next_value($db,$mask,'propal','ref','',$customercode,$date); + $numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc,$date); return $numFinal; } diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 15bef66bf8f..ba31d979864 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -126,7 +126,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices } //Supplier invoices take invoice date instead of creation date for the mask - $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date); + $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc,$object->date); return $numFinal; } diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 7f74ce095c0..37b8adab22e 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -121,7 +121,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders return 0; } - $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); + $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc,$object->date_commande); return $numFinal; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 07f6a3ae43c..a2e6b9d22bc 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -32,9 +32,9 @@ */ require '../../main.inc.php'; -require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; -require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; $langs->load('companies'); $langs->load('bills'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5be67523a41..ea08019853e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2003 Brian Fraval * Copyright (C) 2006 Andre Cianfarani @@ -42,7 +42,7 @@ class Societe extends CommonObject public $element='societe'; public $table_element = 'societe'; public $fk_element='fk_soc'; - protected $childtables=array("askpricesupplier", "propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); // To test if we can delete object + protected $childtables=array("askpricesupplier","propal","commande","facture","contrat","facture_fourn","commande_fournisseur","projet"); // To test if we can delete object /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -352,7 +352,7 @@ class Societe extends CommonObject var $array_options; - // Incoterms + // Incoterms var $fk_incoterms; var $location_incoterms; var $libelle_incoterms; //Used into tooltip @@ -741,7 +741,7 @@ class Societe extends CommonObject //Incoterms $this->fk_incoterms = (int) $this->fk_incoterms; $this->location_incoterms = trim($this->location_incoterms); - + $this->db->begin(); // Check name is required and codes are ok or unique. @@ -1137,9 +1137,9 @@ class Societe extends CommonObject //Incoterms $this->fk_incoterms = $obj->fk_incoterms; - $this->location_incoterms = $obj->location_incoterms; + $this->location_incoterms = $obj->location_incoterms; $this->libelle_incoterms = $obj->libelle_incoterms; - + $result = 1; // Retreive all extrafield for thirdparty @@ -2089,7 +2089,7 @@ class Societe extends CommonObject $bac->fetch(0,$this->id); return $bac->getRibLabel(true); } - + /** * Return Array of RIB diff --git a/htdocs/user/card.php b/htdocs/user/card.php index f709b02f043..cc880878671 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Herve Prot * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -987,6 +987,15 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; print ''; print "\n"; + + // Accountancy code + if ($conf->salaries->enabled) + { + print ''.$langs->trans("AccountancyCode").''; + print ''; + print ''; + print ''; + } // User color if (! empty($conf->agenda->enabled)) @@ -1130,7 +1139,7 @@ else */ if ($action != 'edit') { - $rowspan=17; + $rowspan=19; print ''; @@ -1326,13 +1335,12 @@ else print "\n"; // Accountancy code - if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. + if ($conf->salaries->enabled) { - $rowspan++; - print ''; - print ''; + print ''; + print ''; } - + // Color user if (! empty($conf->agenda->enabled)) { @@ -1661,7 +1669,7 @@ else */ if ($action == 'edit' && ($canedituser || $caneditfield || $caneditpassword || ($user->id == $object->id))) { - $rowspan=15; + $rowspan=16; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; @@ -2028,23 +2036,23 @@ else print "\n"; // Accountancy code - if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. - { - print ""; - print ''; - print ''; - print ""; - } + if ($conf->salaries->enabled) + { + print ""; + print ''; + print ''; + print ""; + } // User color if (! empty($conf->agenda->enabled))
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("AccountancyCode").''; - if ($caneditfield) - { - print ''; - } - else - { - print ''; - print $object->accountancy_code; - } - print '
'.$langs->trans("AccountancyCode").''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print '