From 85a58f666ae01939c5a62c77ac67451d59f24b3a Mon Sep 17 00:00:00 2001 From: arnaud Date: Wed, 18 Nov 2015 17:22:53 +0100 Subject: [PATCH 1/4] FIX product link in project box --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 57863100999..6546f39d5cf 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -95,7 +95,7 @@ class box_project extends ModeleBoxes $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->ref, - 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid); + 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid); $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->title From f615927d241a6e004a364afcf3a686f46eb8766e Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 18 Nov 2015 17:56:04 +0100 Subject: [PATCH 2/4] FIX Not use localtaxes when invoice some orders --- htdocs/commande/orderstoinvoice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 9a98b389bd0..905bcb8c211 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -6,6 +6,7 @@ * Copyright (C) 2012 Andreu Bisquerra Gaya * Copyright (C) 2012 David Rodriguez Martinez * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2015 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 @@ -179,6 +180,7 @@ if (($action == 'create' || $action == 'add') && !$error) $object->origin_id = $orders_id[$ii]; $object->linked_objects = $orders_id; $id = $object->create($user); + $object->fetch_thirdparty(); if ($id>0) { From 4233d24f4bc22daf0e15caa8ab4fa023f4e2973d Mon Sep 17 00:00:00 2001 From: arnaud Date: Thu, 19 Nov 2015 18:01:58 +0100 Subject: [PATCH 3/4] FIX export with category contact extrafields --- htdocs/core/modules/modCategorie.class.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 24a9ee5ef94..039a3d60a63 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -229,6 +229,45 @@ class modCategorie extends DolibarrModules 'p.note_private' => 'contact', 'p.note_public' => 'contact' ); // We define here only fields that use another picto + + // Add extra fields + $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'"; + $resql=$this->db->query($sql); + if ($resql) // This can fail when class is used on old database (during migration for example) + { + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $typeFilter="Text"; + switch($obj->type) + { + case 'int': + case 'double': + case 'price': + $typeFilter="Numeric"; + break; + case 'date': + case 'datetime': + $typeFilter="Date"; + break; + case 'boolean': + $typeFilter="Boolean"; + break; + 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; + $this->export_entities_array[$r][$fieldname]='contact'; + } + } + // End add axtra fields + $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p'; $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_pays as country ON p.fk_pays = country.rowid'; From 07226d32ec23bd9da39bc11c67ef0fd380b007dd Mon Sep 17 00:00:00 2001 From: arnaud Date: Fri, 20 Nov 2015 16:11:48 +0100 Subject: [PATCH 4/4] FIX NB task and percent progress in box project --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 6546f39d5cf..45ba9c6a04f 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -104,7 +104,7 @@ class box_project extends ModeleBoxes $sql ="SELECT count(*) as nb, sum(progress) as totprogress"; $sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid"; $sql.=" WHERE p.entity = ".$conf->entity; - + $sql.=" AND p.rowid = ".$objp->rowid; $resultTask = $db->query($sql); if ($resultTask) {