dolibarr-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-cvs] dolibarr/htdocs adminproduit.php comm/propal.ph...


From: Regis Houssin
Subject: [Dolibarr-cvs] dolibarr/htdocs adminproduit.php comm/propal.ph...
Date: Thu, 08 Jun 2006 09:46:25 +0000

CVSROOT:        /cvsroot/dolibarr
Module name:    dolibarr
Changes by:     Regis Houssin <hregis>  06/06/08 09:46:25

Modified files:
        htdocs/admin   : produit.php 
        htdocs/comm    : propal.php 
        htdocs/langs/en_US: admin.lang 
        htdocs/langs/fr_FR: admin.lang 

Log message:
        début ajout option : confirmation de suppression d'une ligne produit

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/admin/produit.php?cvsroot=dolibarr&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/comm/propal.php?cvsroot=dolibarr&r1=1.217&r2=1.218
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/langs/en_US/admin.lang?cvsroot=dolibarr&r1=1.140&r2=1.141
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/langs/fr_FR/admin.lang?cvsroot=dolibarr&r1=1.155&r2=1.156

Patches:
Index: admin/produit.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/admin/produit.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- admin/produit.php   22 Mar 2006 09:03:55 -0000      1.7
+++ admin/produit.php   8 Jun 2006 09:46:25 -0000       1.8
@@ -16,7 +16,7 @@
  * 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.php,v 1.7 2006/03/22 09:03:55 hregis Exp $
+ * $Id: produit.php,v 1.8 2006/06/08 09:46:25 hregis Exp $
  * $Source: /cvsroot/dolibarr/dolibarr/htdocs/admin/produit.php,v $
  */
 
@@ -24,7 +24,7 @@
            \file       htdocs/admin/produit.php
                \ingroup    produit
                \brief      Page d'administration/configuration du module 
Produit
-               \version    $Revision: 1.7 $
+               \version    $Revision: 1.8 $
 */
 
 require("./pre.inc.php");
@@ -133,6 +133,18 @@
     Header("Location: produit.php");
     exit;
 }
+else if ($_GET["action"] == 'activate_confirmdelete')
+{
+    dolibarr_set_const($db, "PRODUIT_CONFIRM_DELETE_LINE", "1");
+    Header("Location: produit.php");
+    exit;
+}
+else if ($_GET["action"] == 'disable_confirmdelete')
+{
+       dolibarr_del_const($db, "PRODUIT_CONFIRM_DELETE_LINE");
+    Header("Location: produit.php");
+    exit;
+}
 
 
 /*
@@ -238,6 +250,32 @@
 print '</table>';
 print '</form>';
 
+// confirmation de suppression ligne produit activation/desactivation
+print '<br>';
+print '<table class="noborder" width="100%">';
+print '<tr class="liste_titre">';
+print '<td width="140">'.$langs->trans("Name").'</td>';
+print '<td align="center">&nbsp;</td>';
+print '<td align="center">'.$langs->trans("Active").'</td>';
+print "</tr>\n";
+print "<form method=\"post\" action=\"produit.php\">";
+print "<input type=\"hidden\" name=\"action\" value=\"confirmdeleteline\">";
+print "<tr ".$bc[false].">";
+print '<td 
width="80%">'.$langs->trans("ConfirmDeleteProductLineAbility").'</td>';
+print '<td align="center">';
+if($conf->global->PRODUIT_CONFIRM_DELETE_LINE == 1)
+       print img_tick();
+print '</td>';
+print "<td align=\"center\">";
+if($conf->global->PRODUIT_CONFIRM_DELETE_LINE == 0)
+print '<a 
href="produit.php?action=activate_confirmdeleteline">'.$langs->trans("Activate").'</a>';
+else if($conf->global->PRODUIT_CONFIRM_DELETE_LINE == 1)
+       print '<a 
href="produit.php?action=disable_confirmdeleteline">'.$langs->trans("Disable").'</a>';
+print "</td>";
+print '</tr>';
+print '</table>';
+print '</form>';
+
 $db->close();
 
 llxFooter();

Index: comm/propal.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/comm/propal.php,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -b -r1.217 -r1.218
--- comm/propal.php     5 Jun 2006 16:26:33 -0000       1.217
+++ comm/propal.php     8 Jun 2006 09:46:25 -0000       1.218
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: propal.php,v 1.217 2006/06/05 16:26:33 hregis Exp $
+ * $Id: propal.php,v 1.218 2006/06/08 09:46:25 hregis Exp $
  * $Source: /cvsroot/dolibarr/dolibarr/htdocs/comm/propal.php,v $
  */
 
@@ -87,6 +87,19 @@
     exit;
 }
 
+if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 
'yes')
+{
+    if ($user->rights->propale->creer)
+    {
+       $propal = new Propal($db);
+       $propal->fetch($_GET['propalid']);
+       $propal->delete_product($_GET['ligne']);
+       propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf);
+    }
+    Header('Location: '.$_SERVER["PHP_SELF"]);
+    exit;
+}
+
 if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes')
 {
     if ($user->rights->propale->valider)
@@ -421,7 +434,7 @@
 }
 
 
-if ($_GET['action'] == 'del_ligne' && $user->rights->propale->creer) 
+if ($_GET['action'] == 'del_ligne' && $user->rights->propale->creer && 
!$conf->global->PRODUIT_CONFIRM_DELETE_LINE) 
 {
   /*
    *  Supprime une ligne produit dans la propale
@@ -536,6 +549,15 @@
        }
 
        /*
+       * Confirmation de la suppression d'une ligne produit
+       */
+       if ($_GET['action'] == 'delete_product_line' && 
$conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+       {
+               
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;ligne='.$objp->rowid,
 $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 
'confirm_deleteproductline');
+               print '<br>';
+       }
+
+       /*
        * Confirmation de la validation de la propale
        */
        if ($_GET['action'] == 'validate')
@@ -912,7 +934,14 @@
                                                        print '<td 
align="right"><a 
href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=editline&amp;ligne='.$objp->rowid.'">';
                                                        print img_edit();
                                                        print '</a></td>';
+                                                       if 
($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+                                                       {
+                                                               print '<td 
align="right"><a 
href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=delete_product_ligne&amp;ligne='.$objp->rowid.'">';
+                                                       }
+                                                       else
+                                                       {
                                                        print '<td 
align="right"><a 
href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=del_ligne&amp;ligne='.$objp->rowid.'">';
+                                                       }
                                                        print img_delete();
                                                        print '</a></td>';
                                                        print '<td 
align="right">';
@@ -1600,6 +1629,6 @@
 }
 $db->close();
 
-llxFooter('$Date: 2006/06/05 16:26:33 $ - $Revision: 1.217 $');
+llxFooter('$Date: 2006/06/08 09:46:25 $ - $Revision: 1.218 $');
 
 ?>

Index: langs/en_US/admin.lang
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/langs/en_US/admin.lang,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -b -r1.140 -r1.141
--- langs/en_US/admin.lang      3 Jun 2006 11:32:52 -0000       1.140
+++ langs/en_US/admin.lang      8 Jun 2006 09:46:25 -0000       1.141
@@ -461,6 +461,7 @@
 ##### Products #####
 ProductSetup=Products module setup
 NumberOfProductShowInSelect=Max number of products in combos select lists 
(0=no limit)
+ConfirmDeleteProductLineAbility=Confirmation of removal of a line produces in 
the forms 
 ##### Sendings #####
 SendingsSetup=Sending module setup
 SendingsReceiptModel=Sending receipt model

Index: langs/fr_FR/admin.lang
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/langs/fr_FR/admin.lang,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -b -r1.155 -r1.156
--- langs/fr_FR/admin.lang      3 Jun 2006 11:32:52 -0000       1.155
+++ langs/fr_FR/admin.lang      8 Jun 2006 09:46:25 -0000       1.156
@@ -461,6 +461,7 @@
 ##### Products #####
 ProductSetup=Configuration du module Produits
 NumberOfProductShowInSelect=Nombre de produits max dans les listes déroulantes 
(0=aucune limite)
+ConfirmDeleteProductLineAbility=Confirmation de suppression d'une ligne 
produit dans les formulaires
 ##### Sendings #####
 SendingsSetup=Configuration du module Expéditions/Livraisons
 SendingsReceiptModel=Modèle du bordereau d'expédition




reply via email to

[Prev in Thread] Current Thread [Next in Thread]