diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 043fc603226..7709ce518b7 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -220,7 +220,7 @@ function societe_admin_prepare_head($object) * @param DoliDB $dbtouse Database handler (using in global way may fail because of conflicts with some autoload features) * @param Translate $outputlangs Langs object for output translation * @param int $entconv 0=Return value without entities and not converted to output charset - * @return string String with country code or translated country name + * @return mixed String with country code or translated country name or Array('id','code','label') */ function getCountry($id,$withcode='',$dbtouse=0,$outputlangs='',$entconv=1) { diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index a89ea74941c..3a04e75c43e 100755 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -60,35 +60,9 @@ class ActionsCardProduct extends Product $this->name = "product"; $this->definition = "Product canvas (défaut)"; $this->fieldListName = "product_default"; - - $this->next_prev_filter = "canvas='default'"; + $this->next_prev_filter = "canvas='product'"; } - /** - * Return the title of card - * - * @return string Label of card - */ - private function getTitle() - { - global $langs; - - return $langs->trans("Products"); - } - - /** - * Get object from id or ref and save it into this->object - * - * @param int $id Object id - * @param string $ref Ojbect ref - * @return Object Object loaded - */ - function getObject($id,$ref='') - { - $object = new Product($this->db); - if (! empty($id) || ! empty($ref)) $object->fetch($id,$ref); - $this->object = $object; - } /** * Assign custom values for canvas (for example into this->tpl to be used by templates) @@ -103,7 +77,9 @@ class ActionsCardProduct extends Product global $conf, $langs, $user, $mysoc, $canvas; global $html, $formproduct; - $ret = $this->getObject($id,$ref); + $tmpobject = new Product($this->db); + if (! empty($id) || ! empty($ref)) $tmpobject->fetch($id,$ref); + $this->object = $object; //parent::assign_values($action); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index f8262beae6a..42003219528 100755 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -62,32 +62,6 @@ class ActionsCardService extends Product $this->next_prev_filter = "canvas='service'"; } - /** - * Return the title of card - * - * @return string Label of card - */ - private function getTitle() - { - global $langs; - - return $langs->trans("Products"); - } - - - /** - * Get object from id or ref and save it into this->object - * - * @param int $id Object id - * @param string $ref Ojbect ref - * @return Object Object loaded - */ - function getObject($id,$ref='') - { - $object = new Product($this->db); - if (! empty($id) || ! empty($ref)) $object->fetch($id,$ref); - $this->object = $object; - } /** * Assign custom values for canvas (for example into this->tpl to be used by templates) @@ -102,7 +76,9 @@ class ActionsCardService extends Product global $conf, $langs, $user, $mysoc, $canvas; global $html, $formproduct; - $ret = $this->getObject($id,$ref); + $tmpobject = new Product($this->db); + if (! empty($id) || ! empty($ref)) $tmpobject->fetch($id,$ref); + $this->object = $object; //parent::assign_values($action);