From e47dda72e7f2fc99f33860f847b89801ca09ae85 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 14 Mar 2018 11:08:38 +0100 Subject: [PATCH 1/3] Fix: Activate all also if there are inactive services --- htdocs/contrat/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 08c43551509..0ad017a94c8 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014-2016 Ferran Marcet + * Copyright (C) 2014-2018 Ferran Marcet * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Jean-François Ferry * @@ -2115,7 +2115,7 @@ else print ''; } - if ($object->nbofservicesclosed > 0) + if ($object->nbofservicesclosed > 0 || $object->nbofserviceswait > 0) { print ''; } From 5140c1c5d2002451cedf88aebc6848a6ba6e316a Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 14 Mar 2018 13:25:05 +0100 Subject: [PATCH 2/3] Fix: Merge categories when merging thirds --- htdocs/societe/card.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 090afd3e935..c28d0d9db68 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -11,6 +11,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -180,9 +181,12 @@ if (empty($reshook)) // Merge categories $static_cat = new Categorie($db); - $custcats = $static_cat->containing($soc_origin->id, 'customer', 'id'); + $custcats_ori = $static_cat->containing($soc_origin->id, 'customer', 'id'); + $custcats = $static_cat->containing($object->id, 'customer', 'id'); + $custcats = array_merge($custcats,$custcats_ori); $object->setCategories($custcats, 'customer'); - $suppcats = $static_cat->containing($soc_origin->id, 'supplier', 'id'); + $suppcats_ori = $static_cat->containing($soc_origin->id, 'supplier', 'id'); + $suppcats = $static_cat->containing($object->id, 'supplier', 'id'); $object->setCategories($suppcats, 'supplier'); // If thirdparty has a new code that is same than origin, we clean origin code to avoid duplicate key from database unique keys. @@ -210,7 +214,7 @@ if (empty($reshook)) $objects = array( 'Adherent' => '/adherents/class/adherent.class.php', 'Societe' => '/societe/class/societe.class.php', - 'Categorie' => '/categories/class/categorie.class.php', + //'Categorie' => '/categories/class/categorie.class.php', 'ActionComm' => '/comm/action/class/actioncomm.class.php', 'Propal' => '/comm/propal/class/propal.class.php', 'Commande' => '/commande/class/commande.class.php', From c69f5843da46934c9a83e4ac2b72d42815587576 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Mar 2018 00:36:56 +0100 Subject: [PATCH 3/3] Update card.php --- htdocs/societe/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index c28d0d9db68..92da2393f28 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -181,12 +181,15 @@ if (empty($reshook)) // Merge categories $static_cat = new Categorie($db); + $custcats_ori = $static_cat->containing($soc_origin->id, 'customer', 'id'); $custcats = $static_cat->containing($object->id, 'customer', 'id'); $custcats = array_merge($custcats,$custcats_ori); $object->setCategories($custcats, 'customer'); + $suppcats_ori = $static_cat->containing($soc_origin->id, 'supplier', 'id'); $suppcats = $static_cat->containing($object->id, 'supplier', 'id'); + $suppcats = array_merge($suppcats,$suppcats_ori); $object->setCategories($suppcats, 'supplier'); // If thirdparty has a new code that is same than origin, we clean origin code to avoid duplicate key from database unique keys.