From 87a00d6924ff34014eb74acf6373410f6d1db6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 15:02:05 +0200 Subject: [PATCH 01/13] FIX Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI --- ChangeLog | 1 + htdocs/core/lib/report.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..0ab6cf0563d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2976 ] "Report" tab is the current tab but it is not marked as selected by the UI ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 13c30976a98..5cc810cc83f 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -39,7 +39,7 @@ */ function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='') { - global $langs, $hselected; + global $langs; print "\n\n\n"; @@ -48,7 +48,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat $head[$h][1] = $langs->trans("Report"); $head[$h][2] = 'report'; - dol_fiche_head($head, $hselected); + dol_fiche_head($head, 'report'); print '
'; foreach($moreparam as $key => $value) From 03358925215f3b512fcee4d18e4e1402b1188482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 18:31:49 +0200 Subject: [PATCH 02/13] FIX Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0 --- htdocs/install/upgrade2.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 2bcb244690e..59f1864837c 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3661,8 +3661,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; + if ($res) { $mod=new modService($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3671,8 +3671,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; + if ($res) { $mod=new modCommande($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3681,8 +3681,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; + if ($res) { $mod=new modFacture($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3732,8 +3732,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; + if ($res) { $mod=new modECM($db); $mod->remove('noboxes'); // We need to remove because a permission id has been removed $mod->init('newboxdefonly'); From e3aa63f3c3bc319672008e430ddb72398d9ce79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 18:33:37 +0200 Subject: [PATCH 03/13] Added log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..cf279e5160c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2861 ] Undefined variable $res when migrating ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 From 2051a66cd736ddf8cb671a5084d8b9e29bc037b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 18:46:05 +0200 Subject: [PATCH 04/13] FIX Close #2837 Product list table column header does not match column body --- ChangeLog | 1 + htdocs/product/liste.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..4a3a3ced9fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2837 ] Product list table column header does not match column body ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 28563edc5eb..c25ff6bbf7f 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -459,7 +459,7 @@ else } // Better buy price - if ($user->rights->produit->creer) { + if ($user->rights->fournisseur->lire) { print ''; if ($objp->minsellprice != '') { From f9574fa4588fb94491ec2b8c65dc2450000c3747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 19:03:34 +0200 Subject: [PATCH 05/13] FIX Close #2835 Customer prices of a product shows incorrect history order --- ChangeLog | 1 + htdocs/product/price.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..690d4a1abdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 0a245093057..f53833b45d7 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -670,7 +670,7 @@ $sql.= " WHERE fk_product = ".$object->id; $sql.= " AND p.entity IN (".getEntity('productprice', 1).")"; $sql.= " AND p.fk_user_author = u.rowid"; if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql.= " AND p.price_level = ".$soc->price_level; -$sql.= " ORDER BY p.date_price DESC, p.price_level ASC"; +$sql.= " ORDER BY p.date_price DESC, p.price_level ASC, p.rowid DESC"; dol_syslog("sql=".$sql); $result = $db->query($sql); From 12155029279fe748da1ce78275739f38230f1639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 13 Jun 2015 03:09:54 +0200 Subject: [PATCH 06/13] Fix Close bug #2814 JPEG photos are not displayed in Product photos page --- ChangeLog | 1 + htdocs/product/class/product.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..727b8952d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 10762d4e271..8fa11d15059 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2856,7 +2856,7 @@ class Product extends CommonObject if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory - if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) + if (dol_is_file($dir.$file) && preg_match('/(\.jp(e?)g|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) { $nbphoto++; $photo = $file; From b96ed082605596c03b8befdc9246926918aa97a9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 14 Jun 2015 12:29:47 +0200 Subject: [PATCH 07/13] Fix: select date problem with mobile device (#3039) --- htdocs/compta/bank/virement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 07541732bb0..a38e5a3e8a7 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2005-2015 Regis Houssin * Copytight (C) 2012 Juanjo Menent * Copyright (C) 2015 Marcos GarcĂ­a * @@ -180,7 +180,7 @@ print $form->select_comptes($account_to,'account_to',0,'',1); print "\n"; print ""; -$form->select_date($dateo,'','','','','add'); +$form->select_date((! empty($dateo)?$dateo:''),'','','','','add'); print "\n"; print ''; print ''; From 14a8a2269ba4e8ac452c9b50bc46676de646b173 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jun 2015 16:59:35 +0200 Subject: [PATCH 08/13] FIX End log must use same level then start log. --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/main.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7a07125f811..c530f612d29 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -165,7 +165,7 @@ function dol_shutdown() global $conf,$user,$langs,$db; $disconnectdone=false; $depth=0; if (is_object($db) && ! empty($db->connected)) { $depth=$db->transaction_opened; $disconnectdone=$db->close(); } - dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_DEBUG)); + dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_INFO)); } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index da407b29ccc..b45d672b385 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -531,7 +531,7 @@ if (! defined('NOLOGIN')) { // We are already into an authenticated session $login=$_SESSION["dol_login"]; - dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login); + dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login, LOG_DEBUG); $resultFetchUser=$user->fetch('',$login); if ($resultFetchUser <= 0) From 06962cb4e6de35ac7ffde6b239347ebe887c71b2 Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 23 Jun 2015 16:26:05 +0200 Subject: [PATCH 09/13] FIX : tool export handle the type "select" extrafields and return the value instead of id --- htdocs/core/modules/export/export_csv.modules.php | 7 +++++++ htdocs/core/modules/export/export_excel.modules.php | 9 ++++++++- htdocs/core/modules/export/export_tsv.modules.php | 9 ++++++++- htdocs/core/modules/modSociete.class.php | 3 +++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index ce058a93455..58f4f036d5e 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -252,6 +252,13 @@ class ExportCsv extends ModeleExports $newvalue=$this->csv_clean($newvalue,$outputlangs->charset_output); + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) + { + $array = unserialize($typefield); + $array = $array['options']; + $newvalue = $array[$newvalue]; + } + fwrite($this->handle,$newvalue.$this->separator); $this->col++; } diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 46ab465f42e..6cad56f07bb 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -305,7 +305,14 @@ class ExportExcel extends ModeleExports $newvalue=$this->excel_clean($newvalue); $typefield=isset($array_types[$code])?$array_types[$code]:''; - + + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) + { + $array = unserialize($typefield); + $array = $array['options']; + $newvalue = $array[$newvalue]; + } + // Traduction newvalue if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) { diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index 409102fd857..a077cc1772e 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -226,7 +226,14 @@ class ExportTsv extends ModeleExports if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) $newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output); - + + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) + { + $array = unserialize($typefield); + $array = $array['options']; + $newvalue = $array[$newvalue]; + } + fwrite($this->handle,$newvalue.$this->separator); $this->col++; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 4367aae3789..ea77a39e21b 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -355,6 +355,9 @@ class modSociete extends DolibarrModules case 'sellist': $typeFilter="List:".$obj->param; break; + case 'select': + $typeFilter="Select:".$obj->param; + break; } $this->export_fields_array[$r][$fieldname]=$fieldlabel; $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; From 582f9cd214b49a0124ce37e0688fc84a1f3cfce0 Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 26 Jun 2015 11:04:08 +0200 Subject: [PATCH 10/13] FIX : keep filter by category or by not enough stock if we switch page --- htdocs/product/reassort.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index e824cd06b13..35e7044157f 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -194,11 +194,11 @@ if ($resql) if ($sref || $snom || $sall || GETPOST('search')) { - print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num); } else { - print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"").(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num); } if (! empty($catid)) @@ -342,11 +342,11 @@ if ($resql) { if ($sref || $snom || $sall || GETPOST('search')) { - print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, ''); + print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, 0, ''); } else { - print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, ''); + print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, 0, ''); } } From ee643ed2a72b6ea648b15f058a9d6a6c0d3f9cfe Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 2 Jul 2015 14:08:16 +0200 Subject: [PATCH 11/13] Fix : Project list was not keeping parameters on sorts --- htdocs/projet/liste.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index 39fcdb64a01..857d8949c9d 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -119,16 +119,23 @@ if ($resql) if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'

'; else print $langs->trans("ProjectsPublicDesc").'

'; } + + $param=''; + if ($mine) $param.='mode=mine'; + if ($socid) $param.='&socid='.$socid; + if ($search_ref) $param.='&search_ref='.$search_ref; + if ($search_label) $param.='&search_label='.$search_label; + if ($search_societe) $param.='&search_societe='.$search_societe; print ''; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder); print "\n"; print ''; From c87328b362ec6624ddaa8fc7e914c09d7d5bcf79 Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 2 Jul 2015 17:00:37 +0200 Subject: [PATCH 12/13] FIX : contact country had wrong display if the country dont have translate --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a5c3764fd28..fc6d8ee7ad1 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -555,7 +555,7 @@ class Contact extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; + $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; $this->socid = $obj->fk_soc; $this->socname = $obj->socname; From 5d14d05ce11870e474172fba10198addd7871aa7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 3 Jul 2015 16:38:54 +0200 Subject: [PATCH 13/13] Fix : Social contribution payment deletion was not deleting the bank line --- htdocs/compta/bank/class/account.class.php | 2 +- .../class/paymentsocialcontribution.class.php | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8bcabf7f17b..6d1e417f4ea 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1152,7 +1152,7 @@ class AccountLine extends CommonObject if ($this->rappro) { // Protection to avoid any delete of consolidated lines - $this->error="DeleteNotPossibleLineIsConsolidated"; + $this->error="ErrorDeleteNotPossibleLineIsConsolidated"; return -1; } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index e89f2a273f8..a2640bcbc9c 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -313,17 +313,20 @@ class PaymentSocialContribution extends CommonObject { global $conf, $langs; $error=0; + + dol_syslog(get_class($this)."::delete"); $this->db->begin(); - if (! $error) + if ($this->bank_line > 0) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; - $sql.= " WHERE type='payment_sc' AND url_id=".$this->id; - - dol_syslog(get_class($this)."::delete sql=".$sql); - $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + $accline = new AccountLine($this->db); + $accline->fetch($this->bank_line); + $result = $accline->delete(); + if($result < 0) { + $this->errors[] = $accline->error; + $error++; + } } if (! $error)