diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 614fbe29e0f..afd7d45dd38 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -367,7 +367,8 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status")."\n"; print ''.$langs->trans("Default")."\n"; -print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index eb0b2e819a3..a5451248078 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -362,6 +362,7 @@ print ''.$langs->trans("Description").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("Default").''; print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); @@ -428,8 +429,13 @@ foreach ($dirmodels as $reldir) $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print ''; + print $form->textwithpicto('',$htmltooltip,-1,0); + print ''; + + // Preview $link='scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; - print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); + print ''; + print $link; print ''; print ''; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index d20c74f26f4..ffef57c9d66 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -486,7 +486,8 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("Default").''; -print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 79bbda823ca..fe02656d37a 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -346,6 +346,7 @@ print ''.$langs->trans("Description").''; print ''.$langs->trans("Status")."\n"; print ''.$langs->trans("Default")."\n"; print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); @@ -416,8 +417,13 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); print ''; + print $form->textwithpicto('',$htmltooltip,-1,0); + print ''; + + // Preview $link=''.img_object($langs->trans("Preview"),'intervention').''; - print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); + print ''; + print $link; print ''; print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 303f1d0d52f..3fd00c5727b 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -347,7 +347,8 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("Default").''; -print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; clearstatcache(); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 314fdbe4eeb..66d8fe1002c 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -346,7 +346,8 @@ print ''.$langs->trans("Name").''."\n"; print ''.$langs->trans("Description").''."\n"; print ''.$langs->trans("Status").''."\n"; print ''.$langs->trans("Default").''."\n"; -print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print ''."\n"; clearstatcache(); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 055b9c79280..d02db671ed6 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -344,7 +344,8 @@ print ''.$langs->trans("Name").''."\n"; print ''.$langs->trans("Description").''."\n"; print ''.$langs->trans("Status").''."\n"; print ''.$langs->trans("Default").''."\n"; -print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print ''."\n"; clearstatcache(); diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 2217e250347..3086fdb0f9d 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -1,179 +1,179 @@ - - * Copyright (C) 2004-2008 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin - * Copytight (C) 2013 Charles-Fr BENKE - * - * 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 3 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, see . - */ - -/** - * \file htdocs/compta/bank/categ.php - * \ingroup compta - * \brief Page ajout de categories bancaires - */ - -require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); - -if (!$user->rights->banque->configurer) - accessforbidden(); - - - -/* -* Actions ajout cat�gorie -*/ -if ($_POST["action"] == 'add') -{ - if ($_POST["label"]) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ ("; - $sql.= "label"; - $sql.= ", entity"; - $sql.= ") VALUES ("; - $sql.= "'".$db->escape($_POST["label"])."'"; - $sql.= ", ".$conf->entity; - $sql.= ")"; - - $result = $db->query($sql); - - if (!$result) - { - dol_print_error($db); - } - } -} - -/* -* Action modification catégorie -*/ -if ($_POST["action"] == 'update') -{ - if ($_POST["label"]) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."bank_categ "; - $sql.= "set label='".$db->escape($_POST["label"])."'";; - $sql.= " WHERE rowid = '".$_REQUEST['categid']."'"; - $sql.= " AND entity = ".$conf->entity; - $result = $db->query($sql); - - if (!$result) - { - dol_print_error($db); - } - } -} -/* -* Action suppression catégorie -*/ -if ( $_REQUEST['action'] == 'delete' ) -{ - if ( $_REQUEST['categid'] ) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ"; - $sql.= " WHERE rowid = '".$_REQUEST['categid']."'"; - $sql.= " AND entity = ".$conf->entity; - - $result = $db->query($sql); - - if (!$result) - { - dol_print_error($db); - } - } -} - - - -/* - * Affichage liste des cat�éories - */ - -llxHeader(); - - -print_fiche_titre($langs->trans("Rubriques")); - - - -print ''; -print ''; -print ''; -print "\n"; - -$sql = "SELECT rowid, label"; -$sql.= " FROM ".MAIN_DB_PREFIX."bank_categ"; -$sql.= " WHERE entity = ".$conf->entity; -$sql.= " ORDER BY label"; - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; $total = 0; - - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - print ''; - if (GETPOST("action") == 'edit' && GETPOST("categid")== $objp->rowid) - { - print ""; - } - else - { - print ""; - print ''; - } - print ""; - $i++; - } - $db->free($result); -} - -/* - * Affichage ligne ajout de categorie - */ -$var=!$var; -print ''; -print ''; -print ""; -print ""; -print ""; -print ''; -print ""; -print "
'.$langs->trans("Ref").''.$langs->trans("Label").'
'.$objp->rowid.'"; - print '
'; - print ''; - print ''; - print ''; - print ''; - - print "
"; - print "
".$objp->label."'; - print ''.img_edit().'  '; - print ''.img_delete().'
 
"; - - -$db->close(); - -llxFooter(); -?> + + * Copyright (C) 2004-2008 Laurent Destailleur + * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2013 Charles-Fr BENKE + * + * 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 3 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, see . + */ + +/** + * \file htdocs/compta/bank/categ.php + * \ingroup compta + * \brief Page ajout de categories bancaires + */ + +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); + +if (!$user->rights->banque->configurer) + accessforbidden(); + + + +/* +* Actions ajout catégorie +*/ +if ($_POST["action"] == 'add') +{ + if ($_POST["label"]) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ ("; + $sql.= "label"; + $sql.= ", entity"; + $sql.= ") VALUES ("; + $sql.= "'".$db->escape($_POST["label"])."'"; + $sql.= ", ".$conf->entity; + $sql.= ")"; + + $result = $db->query($sql); + + if (!$result) + { + dol_print_error($db); + } + } +} + +/* +* Action modification catégorie +*/ +if ($_POST["action"] == 'update') +{ + if ($_POST["label"]) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."bank_categ "; + $sql.= "set label='".$db->escape($_POST["label"])."'";; + $sql.= " WHERE rowid = '".$_REQUEST['categid']."'"; + $sql.= " AND entity = ".$conf->entity; + $result = $db->query($sql); + + if (!$result) + { + dol_print_error($db); + } + } +} +/* +* Action suppression catégorie +*/ +if ( $_REQUEST['action'] == 'delete' ) +{ + if ( $_REQUEST['categid'] ) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ"; + $sql.= " WHERE rowid = '".$_REQUEST['categid']."'"; + $sql.= " AND entity = ".$conf->entity; + + $result = $db->query($sql); + + if (!$result) + { + dol_print_error($db); + } + } +} + + + +/* + * Affichage liste des catégories + */ + +llxHeader(); + + +print_fiche_titre($langs->trans("Rubriques")); + + + +print ''; +print ''; +print ''; +print "\n"; + +$sql = "SELECT rowid, label"; +$sql.= " FROM ".MAIN_DB_PREFIX."bank_categ"; +$sql.= " WHERE entity = ".$conf->entity; +$sql.= " ORDER BY label"; + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; $total = 0; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + print ''; + if (GETPOST("action") == 'edit' && GETPOST("categid")== $objp->rowid) + { + print ""; + } + else + { + print ""; + print ''; + } + print ""; + $i++; + } + $db->free($result); +} + +/* + * Affichage ligne ajout de categorie + */ +$var=!$var; +print ''; +print ''; +print ""; +print ""; +print ""; +print ''; +print ""; +print "
'.$langs->trans("Ref").''.$langs->trans("Label").'
'.$objp->rowid.'"; + print '
'; + print ''; + print ''; + print ''; + print ''; + + print "
"; + print "
".$objp->label."'; + print ''.img_edit().'  '; + print ''.img_delete().'
 
"; + + +$db->close(); + +llxFooter(); +?> diff --git a/htdocs/langs/ca_ES/products.lang b/htdocs/langs/ca_ES/products.lang index b4cf11d44de..b808efa0b87 100644 --- a/htdocs/langs/ca_ES/products.lang +++ b/htdocs/langs/ca_ES/products.lang @@ -180,4 +180,17 @@ AddThisServiceCard=Crear fitxa servei HelpAddThisServiceCard=Aquesta opció permet crear o clonar una fitxa de servei en cas que no hi hagi CurrentProductPrice=Preu actual AlwaysUseNewPrice=Utilitzar sempre el preu actual -AlwaysUseFixedPrice=Utilitzar el preu fixat \ No newline at end of file +AlwaysUseFixedPrice=Utilitzar el preu fixat +PriceByQuantity=Preu per quantitat +PriceByQuantityRange=Rang quantitat +ProductsDashboard=Resum Productes/Serveis +UpdateOriginalProductLabel=Canviar etiqueta original +HelpUpdateOriginalProductLabel=Permet editar el nom del producte +### composition fabrication +Building=Fabricació +Build=Fabricar +BuildIt=Llançar la fabricació +BuildindListInfo=Cantitat disponible per magatzem, si indica zero no es fabricaran. +QtyNeed=Cantitat +UnitPmp=Preu de compra unitari +CostPmpHT=Cost de compra sense IVA diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 9b4a0b32e95..3f648f86e0f 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -184,6 +184,8 @@ AlwaysUseFixedPrice=Use the fixed price PriceByQuantity=Price by quantity PriceByQuantityRange=Quantity range ProductsDashboard=Products/Services summary +UpdateOriginalProductLabel=Modify original label +HelpUpdateOriginalProductLabel=Allows to edit the name of the product ### composition fabrication Building=Production and items dispatchment Build=Produce diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 0870293b79c..7c0f56ab2d0 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -180,4 +180,17 @@ AddThisServiceCard=Crear ficha servicio HelpAddThisServiceCard=Esta opción permite crear o clonar una ficha de servicio en caso de que no exista CurrentProductPrice=Precio actual AlwaysUseNewPrice=Usar siempre el precio actual -AlwaysUseFixedPrice=Usar el precio fijado \ No newline at end of file +AlwaysUseFixedPrice=Usar el precio fijado +PriceByQuantity=Precio por cantidad +PriceByQuantityRange=Rango cantidad +ProductsDashboard=Resumen Productos/Servicios +UpdateOriginalProductLabel=Modificar etiqueta original +HelpUpdateOriginalProductLabel=Permite editar el nombre del producto +### composition fabrication +Building=Fabricación +Build=Fabricar +BuildIt=Lanzar la fabricación +BuildindListInfo=Cantidad disponible por almacén, si indica cero no se fabricarán. +QtyNeed=Cantidad +UnitPmp=Precio de compra unitario +CostPmpHT=Coste de compra sin IVA diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 9aedcc3f820..dc9d1694ba4 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -184,6 +184,8 @@ AlwaysUseFixedPrice=Utiliser le prix fixé PriceByQuantity=Prix par quantité PriceByQuantityRange=Grille de quantités ProductsDashboard=Synthèse produits/services +UpdateOriginalProductLabel=Modifier étiquette d'origine +HelpUpdateOriginalProductLabel=Permet modifier le nom du produit ### composition fabrication Building=Fabrication Build=Fabriquer diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4f11e4872e2..c737e807df1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2013 Cedric GROSS * * 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 @@ -586,8 +587,12 @@ class Product extends CommonObject $error=0; - if ($user->rights->produit->supprimer) + if (($this->type==0 && !$user->rights->produit->supprimer) || ($this->type==1 && !$user->rights->service->supprimer)) { + $this->error = "ErrorForbidden"; + return 0; + } + $objectisused = $this->isObjectUsed($id); if (empty($objectisused)) { @@ -697,8 +702,6 @@ class Product extends CommonObject return 0; } } - return 0; - } /** * Update ou cree les traductions des infos produits diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 564e3fb4387..fecd918a29f 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -453,6 +453,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("ShortInfo").''; +print ''.$langs->trans("Preview").''; print "\n"; foreach ($dirsociete as $dirroot) @@ -536,8 +537,12 @@ foreach ($dirsociete as $dirroot) } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("WatermarkOnDraft").': '.yn((! empty($module->option_draft_watermark)?$module->option_draft_watermark:''), 1, 1); + + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; - + // Preview print ''; if ($module->type == 'pdf') { @@ -547,7 +552,7 @@ foreach ($dirsociete as $dirroot) { $linkspec=img_object($langs->trans("PreviewNotAvailable"),'generic'); } - print $form->textwithpicto('   '.$linkspec,$htmltooltip,1,0); + print $linkspec; print ''; print "\n";