diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 6452e3ca922..af829969789 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -164,6 +164,7 @@ class ActionComm extends CommonObject // Properties for links to other objects var $fk_element; // Id of record + var $elementid; // Id of record alternative for API var $elementtype; // Type of record. This if property ->element of object linked to. // Ical @@ -550,7 +551,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_author, a.fk_user_mod,"; $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; - $sql.= " a.fk_element, a.elementtype,"; + $sql.= " a.fk_element as elementid, a.elementtype,"; $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; $sql.= " s.nom as socname,"; @@ -624,7 +625,8 @@ class ActionComm extends CommonObject $this->societe->id = $obj->fk_soc; // deprecated $this->contact->id = $obj->fk_contact; // deprecated - $this->fk_element = $obj->fk_element; + $this->fk_element = $obj->elementid; + $this->elementid = $obj->elementid; $this->elementtype = $obj->elementtype; $this->fetchResources(); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 235f15d9010..52219e12d9f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3135,6 +3135,12 @@ class Commande extends CommonOrder // End call triggers } + if ($this->nb_expedition() != 0) + { + $this->errors[] = $langs->trans('SomeShipmentExists'); + $error++; + } + if (! $error) { // Delete order details diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 2b753a50468..8b791b7a9c7 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1137,9 +1137,12 @@ foreach ($listofreferent as $key => $value) print ' '; print ''; } - else // error + else { - print $elementarray; + if (! is_array($elementarray)) // error + { + print $elementarray; + } } print ""; print "
\n"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index beb351affe9..b296f65ad5e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -74,7 +74,9 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartycard','globalcard')); -if ($action == 'view' && $object->fetch($socid)<=0) +if ($socid > 0) $object->fetch($socid); + +if (! ($object->id > 0) && $action == 'view') { $langs->load("errors"); print($langs->trans('ErrorRecordNotFound')); @@ -118,8 +120,6 @@ if (empty($reshook)) if ($action == 'confirm_merge' && $confirm == 'yes' && $user->rights->societe->creer) { - $object->fetch($socid); - $error = 0; $soc_origin_id = GETPOST('soc_origin', 'int'); $soc_origin = new Societe($db);