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")); 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) 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 diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index c8480d6e65a..decbba143da 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')) { diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 065bbbc0ac8..2a9e159558c 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++; + $action = ($action=='add'?'create':'edit'); + } if (GETPOST('deletephoto')) $object->logo = ''; else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);