From 89be120764a4d68ee7d35e7da2441f930d096529 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Mar 2012 22:44:59 +0800 Subject: [PATCH] Fix: missing actiontype of canvas --- htdocs/core/class/canvas.class.php | 4 ++-- .../canvas/actions_card_common.class.php | 24 +++++++------------ htdocs/societe/class/societe.class.php | 3 ++- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 73713118b51..41bab9dee8a 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -132,7 +132,7 @@ class Canvas { if (empty($this->template_dir)) return 0; - if (file_exists($this->template_dir.($this->card?$this->card.'_':'').$this->action.'.tpl.php')) return 1; + if (file_exists($this->template_dir.($this->card?$this->card.'_':'').$this->actiontype.'.tpl.php')) return 1; else return 0; } @@ -148,7 +148,7 @@ class Canvas global $db, $conf, $langs, $user, $canvas; global $form, $formfile; - include($this->template_dir.($this->card?$this->card.'_':'').$this->action.'.tpl.php'); // Include native PHP template + include($this->template_dir.($this->card?$this->card.'_':'').$this->actiontype.'.tpl.php'); // Include native PHP template } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index fc239fb69a3..15bb0519539 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -80,17 +80,9 @@ abstract class ActionsCardCommon { $ret = $this->getInstanceDao(); - if (is_object($this->object) && method_exists($this->object,'fetch')) - { - if (! empty($id) || ! empty($ref)) $this->object->fetch($id,$ref); - } - else - { - // TODO Keep only this part of code. Previous in this method is useless - $object = new Societe($this->db); - if (! empty($id) || ! empty($ref)) $object->fetch($id,$ref); - $this->object = $object; - } + $object = new Societe($this->db); + if (! empty($id) || ! empty($ref)) $object->fetch($id,$ref); + $this->object = $object; } /** @@ -398,14 +390,14 @@ abstract class ActionsCardCommon if ($conf->use_javascript_ajax) { $this->tpl['ajax_selecttype'] = "\n".'