diff --git a/htdocs/admin/droitpret.php b/htdocs/admin/droitpret.php deleted file mode 100644 index 29f340a0cc1..00000000000 --- a/htdocs/admin/droitpret.php +++ /dev/null @@ -1,118 +0,0 @@ - - * Copyright (C) 2009 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. - */ - -/** - * \file htdocs/admin/droitpret.php - * \ingroup pret - * \brief Page d'administration/configuration du module DroitPret - * \version $Id$ - */ - -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); - -$langs->load("admin"); -$langs->load("categories"); - -if (!$user->admin) - accessforbidden(); - - -// positionne la variable pour le test d'affichage de l'icone - -$var=True; - - -// Action mise a jour ou ajout d'une constante -if ($_POST["action"] == 'update' || $_POST["action"] == 'add') -{ - - if (! dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$_POST["consttype"],0,isset($_POST["constnote"])?$_POST["constnote"]:'',$conf->entity)) - { - print $db->error(); - } - else - { - Header("Location: droitpret.php"); - exit; - } -} - - -llxHeader(); - -/* - * Interface de configuration de certaines variables de la partie adherent - */ - - -$linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("PretSetup"),$linkback,'setup'); -print "
"; - - -print_fiche_titre($langs->trans("MemberMainOptions"),'',''); -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -$var=true; -$form = new Form($db); - -// Categorie -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -print ''; - -// Adresse destination -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "'; - -print ''; - -print '\n"; -print ''; - -print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Action").'
".$langs->trans("catActive").''; - -print $form->select_all_categories(2,$conf->global->DROITPRET_CAT,"constvalue"); - -print ''; -print ''; -print "
".$langs->trans("mailDroitPret").''; -print ''; -print "
'; -print '
'; - -?> diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 8b99b962fe3..68786e142bb 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -3,7 +3,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006-2007 Rodolphe Quiedeville * Copyright (C) 2007 Auguria SARL - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-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 @@ -110,11 +110,7 @@ else if ($_POST["action"] == 'usesearchtoselectproduct') } else if ($_GET["action"] == 'set') { - // Create temp directory for smarty - if (! empty($dolibarr_smarty_compile)) create_exdir($dolibarr_smarty_compile); - if (! empty($dolibarr_smarty_cache)) create_exdir($dolibarr_smarty_cache); - - $const = "PRODUIT_SPECIAL_".strtoupper($_GET["spe"]); + $const = "PRODUCT_SPECIAL_".strtoupper($_GET["spe"]); if ($_GET["value"]) dolibarr_set_const($db, $const, $_GET["value"],'chaine',0,'',$conf->entity); else dolibarr_del_const($db, $const,$conf->entity); } @@ -278,64 +274,70 @@ print ""; print ''; print ''; - -// Add droitpret feature -if ($conf->droitpret->enabled) +if ($conf->global->PRODUCT_CANVAS_ABILITY) { - // Propose utilisation de canvas. - // Ces derniers ne sont geres que par le menu default + // Add canvas feature + $dir = DOL_DOCUMENT_ROOT . "/product/canvas/"; $var = false; - + print ''; - print " ".$langs->trans("ProductSpecial")."\n"; - print " ".$langs->trans("Value")."\n"; - print "  \n"; - - require_once(DOL_DOCUMENT_ROOT . "/product.class.php"); - $dir = DOL_DOCUMENT_ROOT . "/product/templates/"; - - if (is_dir($dir) ) + print ''.$langs->trans("ProductSpecial").''."\n"; + print ''.$langs->trans("Value").''."\n"; + print ' '."\n"; + + if (is_dir($dir)) { + require_once(DOL_DOCUMENT_ROOT . "/product.class.php"); + $handle=opendir($dir); - + while (($file = readdir($handle))!==false) { - if (substr($file, strlen($file) -10) == '.class.php' && substr($file,0,8) == 'product.') + if (file_exists($dir.$file.'/product.'.$file.'.class.php')) { - $parts = explode('.',$file); - $classname = 'Product'.ucfirst($parts[1]); - require_once($dir.$file); - $module = new $classname(); - - $var=!$var; - print ""; - - print $module->description; - - print ''; - - $const = "PRODUIT_SPECIAL_".strtoupper($parts[1]); - if ($conf->global->$const) + $classfile = $dir.$file.'/product.'.$file.'.class.php'; + $classname = 'Product'.ucfirst($file); + + require_once($classfile); + $object = new $classname(); + + $module = $object->module; + + if ($conf->$module->enabled) { - print img_tick(); + $var=!$var; + print ""; + + print $object->description; + print ''; - print ''.$langs->trans("Disable").''; + + $const = "PRODUCT_SPECIAL_".strtoupper($file); + + if ($conf->global->$const) + { + print img_tick(); + print ''; + print ''.$langs->trans("Disable").''; + } + else + { + print ' '; + print ''.$langs->trans("Activate").''; + } + + print ''; } - else - { - print ' '; - print ''.$langs->trans("Activate").''; - } - - print ''; } } + closedir($handle); } else { print "ERROR: $dir is not a directory !\n"; } + print ''; } diff --git a/htdocs/install/mysql/tables/llx_droitpret_rapport.sql b/htdocs/install/mysql/tables/llx_droitpret_rapport.sql deleted file mode 100644 index b0b260019be..00000000000 --- a/htdocs/install/mysql/tables/llx_droitpret_rapport.sql +++ /dev/null @@ -1,29 +0,0 @@ --- ======================================================================== --- Copyright (C) 2007 Patrick Raguin --- --- 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$ --- ======================================================================== - -CREATE TABLE llx_droitpret_rapport ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - date_envoie datetime NOT NULL, - format varchar(10) NOT NULL, - date_debut datetime NOT NULL, - date_fin datetime NOT NULL, - fichier varchar(255) NOT NULL, - nbfact integer NOT NULL -) type=innodb; diff --git a/htdocs/install/mysql/tables/llx_product_cnv_livre.sql b/htdocs/install/mysql/tables/llx_product_cnv_livre.sql deleted file mode 100644 index 8b37a12e2e1..00000000000 --- a/htdocs/install/mysql/tables/llx_product_cnv_livre.sql +++ /dev/null @@ -1,44 +0,0 @@ --- ============================================================================ --- Copyright (C) 2006-2007 Rodolphe Quiedeville --- --- 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$ --- ============================================================================ - --- --- Produit specifique livre --- -create table llx_product_cnv_livre -( - rowid integer PRIMARY KEY, - isbn varchar(13), -- code ISBN - ean varchar(13), -- code EAN - format varchar(7), -- format de l'ouvrage - - px_feuillet float(12,4), -- prix au feuillet - px_reliure float(12,4), -- prix de la reliure - px_couverture float(12,4), -- prix de la couverture - px_revient float(12,4), -- prix de revient - - pages smallint UNSIGNED, -- nombre de page - - fk_couverture integer, - fk_contrat integer, - fk_auteur integer DEFAULT 0 -- auteur lien vers llx_societe -)type=innodb; - - - diff --git a/htdocs/install/mysql/tables/llx_product_cnv_livre_contrat.sql b/htdocs/install/mysql/tables/llx_product_cnv_livre_contrat.sql deleted file mode 100644 index 2f5a45346a1..00000000000 --- a/htdocs/install/mysql/tables/llx_product_cnv_livre_contrat.sql +++ /dev/null @@ -1,36 +0,0 @@ --- ============================================================================ --- Copyright (C) 2006-2007 Rodolphe Quiedeville --- --- 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$ --- ============================================================================ - -create table llx_product_cnv_livre_contrat -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_cnv_livre integer, - - quantite integer, -- quantite achete - taux float(3,2), -- taux contractuel - - date_app datetime, -- date d'application - duree varchar(50), -- duree du contrat - fk_user integer, -- utilisateur qui a saisi le contrat - locked tinyint default 0 -- indique si le contrat est verrouille a la modification -)type=innodb; - - - diff --git a/htdocs/product/canvas/default/index.php b/htdocs/product/canvas/default/index.php new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/default/templates/index.php b/htdocs/product/canvas/default/templates/index.php new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/default/templates/liste.tpl b/htdocs/product/canvas/default/templates/liste.tpl new file mode 100644 index 00000000000..7bbcce22321 --- /dev/null +++ b/htdocs/product/canvas/default/templates/liste.tpl @@ -0,0 +1,102 @@ +{* Copyright (C) 2009 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}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +{section name=mysec loop=$datas} +{strip} + + + + + + + + + +{/strip} +{/section} + +
Référence + + A-Z + + + Z-A + + Libellé + + A-Z + + + Z-A + + Code barre + + A-Z + + + Z-A + + Date de modificationPrix de venteStockEtat
    + + +
{$datas[mysec].ref}{$datas[mysec].label}{$datas[mysec].barcode}{$datas[mysec].datem}{$datas[mysec].sellingprice}{$datas[mysec].stock}{$datas[mysec].status}
+
+ + \ No newline at end of file diff --git a/htdocs/product/canvas/index.php b/htdocs/product/canvas/index.php new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 46317f65b01..4c1cf01fec7 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006 Auguria SARL * @@ -120,10 +120,10 @@ if ($_POST["action"] == 'add' && ($user->rights->produit->creer || $user->rights if (! $error) { - if ($_POST["canvas"] <> '' && file_exists('templates/product.'.$_POST["canvas"].'.class.php') ) + if ($_POST["canvas"] <> '' && file_exists('canvas/'.$_POST["canvas"].'/product.'.$_POST["canvas"].'.class.php') ) { $class = 'Product'.ucfirst($_POST["canvas"]); - include_once('templates/product.'.$_POST["canvas"].'.class.php'); + include_once('canvas/'.$_POST["canvas"].'/product.'.$_POST["canvas"].'.class.php'); $product = new $class($db); } else @@ -248,10 +248,10 @@ if ($_POST["action"] == 'update' && ($user->rights->produit->creer || $user->rig } // Specific product - if ($product->canvas <> '' && file_exists('templates/product.'.$product->canvas.'.class.php') ) + if ($product->canvas <> '' && file_exists('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php') ) { $class = 'Product'.ucfirst($product->canvas); - include_once('templates/product.'.$product->canvas.'.class.php'); + include_once('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php'); $product = new $class($db); if ($product->FetchCanvas($_POST["id"])) @@ -613,22 +613,16 @@ $formproduct = new FormProduct($db); */ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->rights->service->creer)) { - if ($conf->droitpret->enabled) + if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php')) { if (! isset($product)) { - $filecanvas=DOL_DOCUMENT_ROOT.'/product/templates/product.'.$_GET["canvas"].'.class.php'; - if ($_GET["canvas"] && file_exists($filecanvas) ) - { - $class = 'Product'.ucfirst($_GET["canvas"]); - include_once($filecanvas); - - $product = new $class($db,0,$user); - } - else - { - $product = new Product($db); - } + $filecanvas = DOL_DOCUMENT_ROOT.'/product/canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php'; + $class = 'Product'.ucfirst($_GET["canvas"]); + + include_once($filecanvas); + + $product = new $class($db,0,$user); } $product->assign_smarty_values($smarty, 'create'); @@ -653,7 +647,17 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ if ($mesg) print $mesg."\n"; - if (empty($conf->droitpret->enabled) || empty($_GET["canvas"])) + if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php')) + { + // On assigne les valeurs meme en creation car elles sont definies si + // on revient en erreur + $smarty->template_dir = DOL_DOCUMENT_ROOT.'/product/canvas/'.$_GET["canvas"].'/templates/'; + $tvaarray = load_tva($db,"tva_tx",$conf->defaulttx,$mysoc,''); + $smarty->assign('tva_taux_value', $tvaarray['value']); + $smarty->assign('tva_taux_libelle', $tvaarray['label']); + $smarty->display($_GET["canvas"].'-create.tpl'); + } + else { print '
'; print ''; @@ -825,16 +829,6 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ print '
'; } - else - { - // On assigne les valeurs meme en creation car elles sont definies si - // on revient en erreur - $smarty->template_dir = DOL_DOCUMENT_ROOT.'/product/templates/'.$_GET["canvas"].'/'; - $tvaarray = load_tva($db,"tva_tx",$conf->defaulttx,$mysoc,''); - $smarty->assign('tva_taux_value', $tvaarray['value']); - $smarty->assign('tva_taux_libelle', $tvaarray['label']); - $smarty->display($_GET["canvas"].'-create.tpl'); - } } /** @@ -857,20 +851,17 @@ if ($_GET["id"] || $_GET["ref"]) } // Gestion des produits specifiques - if ($conf->droitpret->enabled) + if ($product->canvas <> '' && file_exists('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php') ) { - if ($product->canvas <> '' && file_exists('templates/product.'.$product->canvas.'.class.php') ) - { - $class = 'Product'.ucfirst($product->canvas); - include_once('templates/product.'.$product->canvas.'.class.php'); - $product = new $class($db); + $class = 'Product'.ucfirst($product->canvas); + include_once('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php'); + $product = new $class($db); - $result = $product->FetchCanvas($_GET["id"],'',$_GET["action"]); + $result = $product->FetchCanvas($_GET["id"],'',$_GET["action"]); - $smarty->template_dir = DOL_DOCUMENT_ROOT.'/product/templates/'.$product->canvas.'/'; + $smarty->template_dir = DOL_DOCUMENT_ROOT.'/product/canvas/'.$product->canvas.'/templates/'; - $product->assign_smarty_values($smarty,$_GET["action"]); - } + $product->assign_smarty_values($smarty,$_GET["action"]); } diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index ce2c6714eeb..8a7f5be243b 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-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 @@ -86,10 +86,10 @@ if ($conf->categorie->enabled && isset($_REQUEST['catid'])) $htmlother=new FormOther($db); -if ($_GET["canvas"] <> '' && file_exists('templates/product.'.$_GET["canvas"].'.class.php') ) +if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php') ) { $class = 'Product'.ucfirst($_GET["canvas"]); - include_once('templates/product.'.$_GET["canvas"].'.class.php'); + include_once('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php'); $object = new $class($db); $object->LoadListDatas($limit, $offset, $sortfield, $sortorder); @@ -213,7 +213,7 @@ if ($resql) print "
"; } - if ($conf->droitpret->enabled && isset($_GET["canvas"])) + if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php')) { $smarty->assign('datas', $object->list_datas); $smarty->assign('url_root', $dolibarr_main_url_root); @@ -226,14 +226,14 @@ if ($resql) // Check if a custom template is present if (file_exists(DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/templates/product/'.$_GET["canvas"].'/liste.tpl')) { - $smarty->template_dir = DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/templates/product/'; - $template = $_GET["canvas"].'/liste.tpl'; + $smarty->template_dir = DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/templates/product/'.$_GET["canvas"].'/'; + $template = 'liste.tpl'; } // Check if a default template is present - else if (file_exists(DOL_DOCUMENT_ROOT . '/product/templates/'.$_GET["canvas"].'/liste.tpl')) + else if (file_exists(DOL_DOCUMENT_ROOT . '/product/canvas/'.$_GET["canvas"].'/templates/liste.tpl')) { - $smarty->template_dir = DOL_DOCUMENT_ROOT . '/product/templates/'; - $template = $_GET["canvas"].'/liste.tpl'; + $smarty->template_dir = DOL_DOCUMENT_ROOT . '/product/canvas/'.$_GET["canvas"].'/templates/'; + $template = 'liste.tpl'; } // Error template else