diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php
index 2e21a480ce4..afe8d046e4b 100644
--- a/htdocs/admin/produit.php
+++ b/htdocs/admin/produit.php
@@ -104,16 +104,18 @@ else if ($_POST["action"] == 'viewProdDescInForm')
{
dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $_POST["activate_viewProdDescInForm"],'chaine',0,'',$conf->entity);
}
+/*
else if ($_POST["action"] == 'confirmDeleteProdLineInForm')
{
dolibarr_set_const($db, "PRODUIT_CONFIRM_DELETE_LINE", $_POST["activate_confirmDeleteProdLineInForm"],'chaine',0,'',$conf->entity);
}
+*/
else if ($_POST["action"] == 'ProductCanvasAbility')
{
// 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);
-
+
dolibarr_set_const($db, "MAIN_NEED_SMARTY", $_POST["ProductCanvasAbility"],'chaine',0,'',$conf->entity);
}
else if ($_POST["action"] == 'usesearchtoselectproduct')
@@ -125,7 +127,7 @@ 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"]);
if ($_GET["value"]) dolibarr_set_const($db, $const, $_GET["value"],'chaine',0,'',$conf->entity);
else dolibarr_del_const($db, $const,$conf->entity);
@@ -253,6 +255,7 @@ print '';
print '';
// Confirmation de suppression d'un ligne produit dans les formulaires activation/desactivation
+/*
$var=!$var;
print "
';
+*/
// Utilisation de l'ecotaxe
$var=!$var;
@@ -310,14 +314,14 @@ if ($conf->global->PRODUCT_CANVAS_ABILITY)
$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)
{
@@ -330,7 +334,7 @@ if ($conf->global->PRODUCT_CANVAS_ABILITY)
print ' | ';
print ''.$langs->trans("Activate").'';
}
-
+
print ' |
';
}
}
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index b31c8b638a0..e992c1ea1b5 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -128,8 +128,7 @@ if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes')
}
// Remove line
-if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
-|| ($_REQUEST['action'] == 'deleteline' && ! $conf->global->PRODUIT_CONFIRM_DELETE_LINE))
+if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
{
if ($user->rights->propale->creer)
{
@@ -934,7 +933,7 @@ if ($id > 0 || ! empty($ref))
/*
* Confirmation de la suppression d'une ligne produit/service
*/
- if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+ if ($_GET['action'] == 'ask_deleteline')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1);
if ($ret == 'html') print '
';
@@ -1462,14 +1461,7 @@ if ($id > 0 || ! empty($ref))
}
print '';
print '';
- if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
- {
- print 'id.'&action=ask_deleteline&lineid='.$objp->rowid.'">';
- }
- else
- {
- print 'id.'&action=deleteline&lineid='.$objp->rowid.'">';
- }
+ print 'id.'&action=ask_deleteline&lineid='.$objp->rowid.'">';
print img_delete();
print ' | ';
if ($num > 1)
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 2d6fd033e5d..b250014b8e5 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -108,10 +108,9 @@ if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes')
}
/*
- * Supprime une ligne produit AVEC ou SANS confirmation
+ * Remove a product line
*/
-if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
-|| ($_GET['action'] == 'deleteline' && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE))
+if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
{
if ($user->rights->commande->creer)
{
@@ -1249,7 +1248,7 @@ else
/*
* Confirmation de la suppression d'une ligne produit
*/
- if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+ if ($_GET['action'] == 'ask_deleteline')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
if ($ret == 'html') print '
';
@@ -1638,14 +1637,7 @@ else
}
print '';
print '';
- if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
- {
- print 'rowid.'">';
- }
- else
- {
- print 'rowid.'">';
- }
+ print 'rowid.'">';
print img_delete();
print ' | ';
if ($num > 1)
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 6b0b802c558..18f6ded2c5f 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -138,8 +138,7 @@ if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' &&
/*
* Supprime une ligne produit AVEC ou SANS confirmation
*/
-if (($_REQUEST['action'] == 'confirm_deleteproductline' && $_REQUEST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
-|| ($_REQUEST['action'] == 'deleteline' && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE))
+if ($_REQUEST['action'] == 'confirm_deleteproductline' && $_REQUEST['confirm'] == 'yes')
{
if ($user->rights->facture->creer)
{
@@ -2132,9 +2131,9 @@ else
}
// Confirmation de la suppression d'une ligne produit
- if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+ if ($_GET['action'] == 'delete_product_line')
{
- $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&rowid='.$_GET["rowid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 'no', 1);
+ $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&rowid='.$_GET["rowid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 'no', 1);
if ($ret == 'html') print '
';
}
@@ -2857,14 +2856,7 @@ else
}
print '';
print '';
- if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
- {
- print 'id.'&action=delete_product_line&rowid='.$objp->rowid.'">';
- }
- else
- {
- print 'id.'&action=deleteline&rowid='.$objp->rowid.'">';
- }
+ print 'id.'&action=delete_product_line&rowid='.$objp->rowid.'">';
print img_delete();
print ' | ';
if ($num_lignes > 1)
diff --git a/htdocs/core/conf.class.php b/htdocs/core/conf.class.php
index cfc29d6b9da..754703a5ff5 100644
--- a/htdocs/core/conf.class.php
+++ b/htdocs/core/conf.class.php
@@ -68,8 +68,6 @@ class Conf
{
dol_syslog("Conf::setValues");
- $this->global->PRODUIT_CONFIRM_DELETE_LINE=1; // Par defaut, a oui
-
/*
* Definition de toutes les constantes globales d'environnement
* - En constante php (TODO a virer)
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index 7df42250cbc..29f93b54cd7 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -288,38 +288,10 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P
}
-/*
- * Supprime une ligne d'intervention SANS confirmation
- */
-if ($_REQUEST['action'] == 'deleteline' && $user->rights->ficheinter->creer && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE)
-{
- $fichinterline = new FichinterLigne($db);
- if ($fichinterline->fetch($_GET['ligne']) <= 0)
- {
- dol_print_error($db);
- exit;
- }
- $result=$fichinterline->delete_line();
- $fichinter = new Fichinter($db);
- if ($fichinter->fetch($fichinterline->fk_fichinter) <= 0)
- {
- dol_print_error($db);
- exit;
- }
-
- $outputlangs = $langs;
- if (! empty($_REQUEST['lang_id']))
- {
- $outputlangs = new Translate("",$conf);
- $outputlangs->setDefaultLang($_REQUEST['lang_id']);
- }
- fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs);
-}
-
/*
* Supprime une ligne d'intervention AVEC confirmation
*/
-if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
{
if ($user->rights->ficheinter->creer)
{
@@ -541,9 +513,9 @@ elseif ($_GET["id"] > 0)
}
// Confirmation de la suppression d'une ligne d'intervention
- if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+ if ($_GET['action'] == 'ask_deleteline')
{
- $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
+ $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
if ($ret == 'html') print '
';
}
@@ -674,16 +646,8 @@ elseif ($_GET["id"] > 0)
print '';
print '';
print '';
- if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
- {
- print 'id.'&action=ask_deleteline&ligne='.$objp->rowid.'">';
- print img_delete();
- }
- else
- {
- print 'id.'&action=deleteline&ligne='.$objp->rowid.'">';
- print img_delete();
- }
+ print 'id.'&action=ask_deleteline&ligne='.$objp->rowid.'">';
+ print img_delete();
print ' | ';
if ($num > 1)
{
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index bbfc151a82b..ad0b57245eb 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -224,7 +224,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->c
}
}
-if ($_REQUEST['action'] == 'confirm_deleteproductline' && ($_REQUEST['confirm'] == 'yes' || empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE)))
+if ($_REQUEST['action'] == 'confirm_deleteproductline' && $_REQUEST['confirm'] == 'yes')
{
if ($user->rights->fournisseur->commande->creer)
{
@@ -409,7 +409,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
}
}
-// Efface les fichiers
+// Delete file
if ($action=='remove_file')
{
$commande = new CommandeFournisseur($db);
@@ -576,9 +576,9 @@ if ($id > 0 || ! empty($ref))
/*
* Confirmation de la suppression d'une ligne produit
*/
- if ($_GET['action'] == 'delete_product_line' && ! empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE))
+ if ($_GET['action'] == 'delete_product_line')
{
- $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2);
+ $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2);
if ($ret == 'html') print '
';
}
@@ -762,7 +762,6 @@ if ($id > 0 || ! empty($ref))
print '';
$actiondelete='delete_product_line';
- if (empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE)) $actiondelete='confirm_deleteproductline';
print 'id.'&action='.$actiondelete.'&lineid='.$commandline->id.'">';
print img_delete();
print ' | ';
diff --git a/mysql/migration/2.6.0-2.7.0.sql b/mysql/migration/2.6.0-2.7.0.sql
index 5921cf005dd..c0ba1373974 100644
--- a/mysql/migration/2.6.0-2.7.0.sql
+++ b/mysql/migration/2.6.0-2.7.0.sql
@@ -18,6 +18,7 @@ update llx_menu_constraint set action = '$conf->societe->enabled' where action =
delete from llx_const where name = 'MAIN_MODULE_COMMERCIAL';
delete from llx_const where name like 'MAIN_MODULE_%_DIR_OUTPUT';
delete from llx_const where name like 'MAIN_MODULE_%_DIR_TEMP';
+delete from llx_const where name like 'PRODUIT_CONFIRM_DELETE_LINE';
alter table llx_societe add column import_key varchar(14);
@@ -121,3 +122,5 @@ UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_SYSLOG';
UPDATE llx_const SET entity=0 WHERE name='SYSLOG_FILE';
UPDATE llx_const SET entity=0 WHERE name='SYSLOG_LEVEL';
+
+