diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c7d99fae998..38449d1fba1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1662,8 +1662,8 @@ abstract class CommonObject * Looks for an object with ref matching the wildcard provided * It does only work when $this->table_ref_field is set * - * @param string $ref Wildcard - * @return int >1 = OK, 0 = Not found or table_ref_field not defined, <0 = KO + * @param string $ref Wildcard + * @return int >1 = OK, 0 = Not found or table_ref_field not defined, <0 = KO */ public function fetchOneLike($ref) { diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index bb47e71aea8..0ee7eb118ac 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -347,8 +347,7 @@ class EmailSenderProfile extends CommonObject */ public function info($id) { - $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; - $sql .= ' fk_user_creat, fk_user_modif'; + $sql = 'SELECT rowid, date_creation as datec, tms as datem'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.rowid = '.((int) $id); $result = $this->db->query($sql); @@ -356,27 +355,9 @@ class EmailSenderProfile extends CommonObject if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); } $this->db->free($result); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 56b81dd5114..184b97a3c98 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -925,6 +925,7 @@ class ExtraFields // Old usage $label = $this->attribute_label[$key]; $type = $this->attribute_type[$key]; + $list = $this->attribute_list[$key]; $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index cff6b48d25e..7f9e28f5b4a 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1646,6 +1646,7 @@ class FormFile print ''."\n"; // To show ref or specific information according to view to show (defined by $module) + $object_instance = null; if ($modulepart == 'company') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $object_instance = new Societe($this->db); @@ -1813,21 +1814,26 @@ class FormFile if (!$id && !$ref) { continue; } + $found = 0; if (!empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) { $found = 1; } else { //print 'Fetch '.$id." - ".$ref.' class='.get_class($object_instance).'
'; - if ($id) { - $result = $object_instance->fetch($id); - } else { - //fetchOneLike looks for objects with wildcards in its reference. - //It is useful for those masks who get underscores instead of their actual symbols - //fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned - //that's why we look only into fetchOneLike when fetch returns 0 - if (!$result = $object_instance->fetch('', $ref)) { - $result = $object_instance->fetchOneLike($ref); + $result = 0; + if (is_object($object_instance)) { + if ($id) { + $result = $object_instance->fetch($id); + } else { + if (!($result = $object_instance->fetch('', $ref))) { + //fetchOneLike looks for objects with wildcards in its reference. + //It is useful for those masks who get underscores instead of their actual symbols (because the _ had replaced a forbiddn char) + //fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned + //that's why we look only into fetchOneLike when fetch returns 0 + // TODO Remove this part ? + $result = $object_instance->fetchOneLike($ref); + } } } diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index c4296dc63a8..b07c3d96a52 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -39,6 +39,13 @@ class ActionsCardService public $field_list = array(); public $list_datas = array(); + public $id; + public $ref; + public $description; + public $note; + public $price; + public $price_min; + /** * Constructor @@ -196,6 +203,7 @@ class ActionsCardService } // Duration + $dur = array(); if ($this->object->duration_value > 1) { $dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($this->object->duration_value > 0) { @@ -286,6 +294,7 @@ class ActionsCardService if ($search_categ) { $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; } + $fourn_id = 0; if (GETPOST("fourn_id", 'int') > 0) { $fourn_id = GETPOST("fourn_id", 'int'); $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";