From 3c0da7e2d767b8185b0a090c7de598d9f889bbd4 Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 26 May 2015 10:54:31 +0200 Subject: [PATCH 1/6] FIX : extrafields required on thirdparty --- htdocs/societe/soc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 065bbbc0ac8..b0c54f00c8f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -195,7 +195,11 @@ if (empty($reshook)) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - if ($ret < 0) $error++; + if ($ret < 0) + { + $error++; // This increment output "1" as text error + $action = ($action=='add'?'create':'edit'); + } if (GETPOST('deletephoto')) $object->logo = ''; else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']); From 74c4db0f57364a9cd8c73fc1d6b6326229c4c6d3 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Tue, 26 May 2015 11:23:25 +0200 Subject: [PATCH 2/6] Remove comment This comment is false, my $_SESSION was wrong --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b0c54f00c8f..2a9e159558c 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -197,7 +197,7 @@ if (empty($reshook)) $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) { - $error++; // This increment output "1" as text error + $error++; $action = ($action=='add'?'create':'edit'); } From 087b026f54d06332326ef6ddc01c4944628444bc Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 26 May 2015 12:40:49 +0200 Subject: [PATCH 3/6] Add fetch extrafields in contact's fetch function --- htdocs/contact/class/contact.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e2118a9dbaa..63204d158cc 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -628,6 +628,13 @@ class Contact extends CommonObject } } + // Retreive all extrafield for contact + // fetch optionals attributes and labels + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); + $this->fetch_optionals($this->id,$extralabels); + return 1; } else From 5a006d824ebe1f89b27701713fa0ae3f2a919b8d Mon Sep 17 00:00:00 2001 From: phf Date: Wed, 27 May 2015 10:52:23 +0200 Subject: [PATCH 4/6] FIX : top links menu have target attribute with wrong value --- htdocs/product/reassort.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index d0b8c961afa..e824cd06b13 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -190,7 +190,7 @@ if ($resql) $texte.=' ('.$langs->trans("Stocks").')'; - llxHeader("",$title,$helpurl,$texte); + llxHeader("",$texte,$helpurl); if ($sref || $snom || $sall || GETPOST('search')) { From a707d4025161c05539d402e9c39ca5268f76dc92 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Fri, 29 May 2015 14:32:50 +0200 Subject: [PATCH 5/6] FIX : when we create an agenda event with "Not applicable" status, it is automatically saved with "To do" status --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 447d2264f41..8dce1b39df0 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -149,7 +149,7 @@ if ($action == 'add') exit; } - $percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status + $percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters $datep=dol_mktime($fulldayevent?'00':GETPOST("aphour"), $fulldayevent?'00':GETPOST("apmin"), 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear")); From 9f52b9e800fde722b57677c11c78774583261647 Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 29 May 2015 17:27:05 +0200 Subject: [PATCH 6/6] FIX : #2901 --- htdocs/compta/dons/card.php | 10 +++++++++- htdocs/compta/dons/class/don.class.php | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/dons/card.php b/htdocs/compta/dons/card.php index 7bf909378b4..41b129a4cc6 100644 --- a/htdocs/compta/dons/card.php +++ b/htdocs/compta/dons/card.php @@ -554,7 +554,15 @@ if (! empty($id) && $action != 'edit') if ($user->rights->don->supprimer) { - print '"; + if ($don->statut == -1 || $don->statut == 0) + { + print '"; + } + else + { + print '"; + } + } else { diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index a8f7c11d92b..06d383e1c50 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -449,10 +449,11 @@ class Don extends CommonObject */ function delete($rowid) { - + global $user; + $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0 OR fk_statut = -1"; $resql=$this->db->query($sql); if ($resql)