diff --git a/htdocs/product/canvas/default/product.default.class.php b/htdocs/product/canvas/default/product.default.class.php
index 9fc10c127e6..1755195db32 100644
--- a/htdocs/product/canvas/default/product.default.class.php
+++ b/htdocs/product/canvas/default/product.default.class.php
@@ -81,6 +81,12 @@ class ProductDefault extends Product
global $html;
global $formproduct;
+ // canvas
+ $this->tpl['canvas'] = $this->canvas;
+
+ // id
+ $this->tpl['id'] = $this->id;
+
// Ref
$this->tpl['ref'] = $this->ref;
@@ -123,6 +129,11 @@ class ProductDefault extends Product
$this->tpl['tva_tx'] = $html->load_tva("tva_tx",$conf->defaulttx,$mysoc,'');
}
+ if ($action == 'edit')
+ {
+ $this->tpl['title'] = load_fiche_titre($langs->trans('Modify').' '.$langs->trans('Product').' : '.$this->ref, "");
+ }
+
if ($action == 'create' || $action == 'edit')
{
// Status
diff --git a/htdocs/product/canvas/default/tpl/edit.tpl.php b/htdocs/product/canvas/default/tpl/edit.tpl.php
new file mode 100644
index 00000000000..1634a5fadb8
--- /dev/null
+++ b/htdocs/product/canvas/default/tpl/edit.tpl.php
@@ -0,0 +1,113 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+?>
+
+
+
+tpl['title']; ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/product/canvas/default/tpl/list.tpl b/htdocs/product/canvas/default/tpl/list.tpl
deleted file mode 100644
index 4181ca9fa49..00000000000
--- a/htdocs/product/canvas/default/tpl/list.tpl
+++ /dev/null
@@ -1,104 +0,0 @@
-{* Copyright (C) 2009-2010 Regis Houssin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- *}
-
-
-
-
-
-
- {$title_picto}
-
-
-
{$title_text}
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/htdocs/product/canvas/service/product.service.class.php b/htdocs/product/canvas/service/product.service.class.php
index 8f411217e49..60535cd807a 100644
--- a/htdocs/product/canvas/service/product.service.class.php
+++ b/htdocs/product/canvas/service/product.service.class.php
@@ -32,6 +32,8 @@ class ProductService extends Product
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
+ var $tpl = array();
+
/**
* \brief Constructeur de la classe
* \param DB Handler acces base de donnees
@@ -45,7 +47,7 @@ class ProductService extends Product
$this->module = "service";
$this->canvas = "service";
$this->name = "service";
- $this->description = "Canvas des services";
+ $this->definition = "Canvas des services";
$this->next_prev_filter = "canvas='service'";
}
@@ -72,17 +74,122 @@ class ProductService extends Product
*/
function assign_values($action='')
{
- global $conf,$html;
+ global $conf,$langs;
+ global $html;
+ global $formproduct;
+
+ // canvas
+ $this->tpl['canvas'] = $this->canvas;
+
+ // id
+ $this->tpl['id'] = $this->id;
// Ref
- $this->tpl['showrefnav'] = $html->showrefnav($this,'ref','',1,'ref');
+ $this->tpl['ref'] = $this->ref;
+
// Label
$this->tpl['label'] = $this->libelle;
+
+ // Description
+ $this->tpl['description'] = nl2br($this->description);
+
// Statut
$this->tpl['status'] = $this->getLibStatut(2);
+ // Note
+ $this->tpl['note'] = nl2br($this->note);
+
+ // Duration
+ $this->tpl['duration_value'] = $this->duration_value;
+
+ // Hidden
+ if ($this->user->rights->service->hidden)
+ {
+ $this->tpl['hidden'] = yn($this->hidden);
+ }
+ else
+ {
+ $this->tpl['hidden'] = yn("No");
+ }
+
+ // Stock alert
+ $this->tpl['seuil_stock_alerte'] = $this->seuil_stock_alerte;
+
+ if ($action == 'create')
+ {
+ // Title
+ $this->tpl['title'] = load_fiche_titre($langs->trans("NewService"));
+
+ // Price
+ $this->tpl['price'] = $this->price;
+ $this->tpl['price_min'] = $this->price_min;
+ $this->tpl['price_base_type'] = $html->load_PriceBaseType($this->price_base_type, "price_base_type");
+
+ // VAT
+ $this->tpl['tva_tx'] = $html->load_tva("tva_tx",$conf->defaulttx,$mysoc,'');
+ }
+
+ if ($action == 'edit')
+ {
+ $this->tpl['title'] = load_fiche_titre($langs->trans('Modify').' '.$langs->trans('Service').' : '.$this->ref, "");
+ }
+
+ if ($action == 'create' || $action == 'edit')
+ {
+ // Status
+ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell"));
+ $this->tpl['status'] = $html->selectarray('statut',$statutarray,$this->status);
+
+ // Hidden
+ if ($this->user->rights->service->hidden)
+ {
+ $this->tpl['hidden'] = $html->selectyesno('hidden',$this->hidden);
+ }
+
+ // Duration unit
+ // TODO creer fonction
+ $duration_unit = 'duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour");
+ $duration_unit.= ' ';
+ $duration_unit.= 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day");
+ $duration_unit.= ' ';
+ $duration_unit.= 'duration_unit=='w'?' checked':'').'>'.$langs->trans("Week");
+ $duration_unit.= ' ';
+ $duration_unit.= 'duration_unit=='m'?' checked':'').'>'.$langs->trans("Month");
+ $duration_unit.= ' ';
+ $duration_unit.= 'duration_unit=='y'?' checked':'').'>'.$langs->trans("Year");
+ $this->tpl['duration_unit'] = $duration_unit;
+
+ // TODO creer fonction
+ if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
+ {
+ require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
+
+ $doleditor=new DolEditor('desc',$this->description,160,'dolibarr_notes','',false);
+ $this->tpl['doleditor_description'] = $doleditor;
+
+ $doleditor=new DolEditor('note',$this->note,180,'dolibarr_notes','',false);
+ $this->tpl['doleditor_note'] = $doleditor;
+ }
+ else
+ {
+ $textarea = '';
+ $this->tpl['textarea_description'] = $textarea;
+
+ $textarea = '';
+ $this->tpl['textarea_note'] = $textarea;
+ }
+ }
+
if ($action == 'view')
{
+ // Ref
+ $this->tpl['ref'] = $html->showrefnav($this,'ref','',1,'ref');
+
+ // Photo
$this->tpl['nblignes'] = 4;
if ($this->is_photo_available($conf->produit->dir_output))
{
@@ -97,9 +204,6 @@ class ProductService extends Product
$this->tpl['accountancySellCodeKey'] = $html->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer);
$this->tpl['accountancySellCodeVal'] = $html->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer);
- // Description
- $this->tpl['description'] = nl2br($this->description);
-
// Duration
if ($this->duration_value > 1)
{
@@ -109,20 +213,7 @@ class ProductService extends Product
{
$dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
}
- $this->tpl['duration'] = $langs->trans($dur[$this->duration_unit]);
-
- // Hidden
- if ($user->rights->service->hidden)
- {
- $this->tpl['hidden'] = yn($this->hidden);
- }
- else
- {
- $this->tpl['hidden'] = yn("No");
- }
-
- // Note
- $this->tpl['note'] = nl2br($this->note);
+ $this->tpl['duration_unit'] = $langs->trans($dur[$this->duration_unit]);
}
}
diff --git a/htdocs/product/canvas/service/tpl/create.tpl.php b/htdocs/product/canvas/service/tpl/create.tpl.php
new file mode 100644
index 00000000000..3311228f162
--- /dev/null
+++ b/htdocs/product/canvas/service/tpl/create.tpl.php
@@ -0,0 +1,102 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+?>
+
+
+
+tpl['title']; ?>
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/product/canvas/service/tpl/edit.tpl.php b/htdocs/product/canvas/service/tpl/edit.tpl.php
new file mode 100644
index 00000000000..f1aa027e172
--- /dev/null
+++ b/htdocs/product/canvas/service/tpl/edit.tpl.php
@@ -0,0 +1,86 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+?>
+
+
+
+tpl['title']; ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/product/canvas/service/tpl/list.tpl.php b/htdocs/product/canvas/service/tpl/list.tpl.php
new file mode 100644
index 00000000000..4c07d85159d
--- /dev/null
+++ b/htdocs/product/canvas/service/tpl/list.tpl.php
@@ -0,0 +1,102 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/product/canvas/service/tpl/liste.tpl b/htdocs/product/canvas/service/tpl/liste.tpl
deleted file mode 100644
index 773e909ee4b..00000000000
--- a/htdocs/product/canvas/service/tpl/liste.tpl
+++ /dev/null
@@ -1,102 +0,0 @@
-{* Copyright (C) 2009-2010 Regis Houssin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- *}
-
-
-
-
-
-
- {$title_picto}
-
-
-
{$title_text}
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/htdocs/product/canvas/service/tpl/view.tpl.php b/htdocs/product/canvas/service/tpl/view.tpl.php
new file mode 100644
index 00000000000..c42550507d6
--- /dev/null
+++ b/htdocs/product/canvas/service/tpl/view.tpl.php
@@ -0,0 +1,81 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+?>
+
+
+
+