[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dolibarr-cvs] dolibarr/htdocs commpropal.php commande/fiche.p...
From: |
Regis Houssin |
Subject: |
[Dolibarr-cvs] dolibarr/htdocs commpropal.php commande/fiche.p... |
Date: |
Thu, 08 Jun 2006 10:35:22 +0000 |
CVSROOT: /cvsroot/dolibarr
Module name: dolibarr
Changes by: Regis Houssin <hregis> 06/06/08 10:35:21
Modified files:
htdocs/comm : propal.php
htdocs/commande: fiche.php
htdocs/langs/en_US: products.lang
htdocs/langs/fr_FR: products.lang
Log message:
début ajout option : confirmation de suppression d'une ligne produit
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/comm/propal.php?cvsroot=dolibarr&r1=1.221&r2=1.222
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/commande/fiche.php?cvsroot=dolibarr&r1=1.193&r2=1.194
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/langs/en_US/products.lang?cvsroot=dolibarr&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/langs/fr_FR/products.lang?cvsroot=dolibarr&r1=1.57&r2=1.58
Patches:
Index: comm/propal.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/comm/propal.php,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -b -r1.221 -r1.222
--- comm/propal.php 8 Jun 2006 10:00:17 -0000 1.221
+++ comm/propal.php 8 Jun 2006 10:35:21 -0000 1.222
@@ -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.221 2006/06/08 10:00:17 hregis Exp $
+ * $Id: propal.php,v 1.222 2006/06/08 10:35:21 hregis Exp $
* $Source: /cvsroot/dolibarr/dolibarr/htdocs/comm/propal.php,v $
*/
@@ -43,6 +43,7 @@
$langs->load('propal');
$langs->load('compta');
$langs->load('bills');
+$langs->load('products');
if ($conf->projet->enabled)
require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
if ($conf->commande->enabled)
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
@@ -87,7 +88,7 @@
exit;
}
-if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] ==
'yes')
+if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] ==
'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{
if ($user->rights->propale->creer)
{
@@ -1629,6 +1630,6 @@
}
$db->close();
-llxFooter('$Date: 2006/06/08 10:00:17 $ - $Revision: 1.221 $');
+llxFooter('$Date: 2006/06/08 10:35:21 $ - $Revision: 1.222 $');
?>
Index: commande/fiche.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/commande/fiche.php,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -b -r1.193 -r1.194
--- commande/fiche.php 5 Jun 2006 23:04:13 -0000 1.193
+++ commande/fiche.php 8 Jun 2006 10:35:21 -0000 1.194
@@ -19,7 +19,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: fiche.php,v 1.193 2006/06/05 23:04:13 eldy Exp $
+ * $Id: fiche.php,v 1.194 2006/06/08 10:35:21 hregis Exp $
* $Source: /cvsroot/dolibarr/dolibarr/htdocs/commande/fiche.php,v $
*/
@@ -27,7 +27,7 @@
\file htdocs/commande/fiche.php
\ingroup commande
\brief Fiche commande
- \version $Revision: 1.193 $
+ \version $Revision: 1.194 $
*/
require('./pre.inc.php');
@@ -45,6 +45,7 @@
$langs->load('bills');
$langs->load('propal');
$langs->load('deliveries');
+$langs->load('products');
$user->getrights('commande');
$user->getrights('expedition');
@@ -248,11 +249,12 @@
exit;
}
-if ($_GET['action'] == 'deleteline' && $user->rights->commande->creer)
+if ($_GET['action'] == 'deleteline' && $user->rights->commande->creer &&
!$conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{
$commande = new Commande($db);
$commande->fetch($_GET['id']);
$result = $commande->delete_line($_GET['lineid']);
+ commande_pdf_create($db, $_GET['id'], $commande->modelpdf);
Header('Location: fiche.php?id='.$_GET['id']);
exit;
}
@@ -292,6 +294,19 @@
}
}
+if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] ==
'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+{
+ if ($user->rights->commande->creer)
+ {
+ $commande = new Commande($db);
+ $commande->fetch($_GET['id']);
+ $commande->delete_line($_GET['lineid']);
+ commande_pdf_create($db, $_GET['id'], $commande->modelpdf);
+ }
+ Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET['id']);
+ exit;
+}
+
if ($_GET['action'] == 'modif' && $user->rights->commande->creer)
{
/*
@@ -798,7 +813,7 @@
*/
if ($_GET['action'] == 'delete')
{
- $html->form_confirm('fiche.php?id='.$id,
$langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'),
'confirm_delete');
+
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id,
$langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'),
'confirm_delete');
print '<br />';
}
@@ -808,7 +823,7 @@
if ($_GET['action'] == 'valid')
{
//$numfa = commande_get_num($soc);
- $html->form_confirm('fiche.php?id='.$id,
$langs->trans('ValidateOrder'), $langs->trans('ConfirmValidateOrder'),
'confirm_valid');
+
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id,
$langs->trans('ValidateOrder'), $langs->trans('ConfirmValidateOrder'),
'confirm_valid');
print '<br />';
}
@@ -818,7 +833,7 @@
if ($_GET['action'] == 'cloture')
{
//$numfa = commande_get_num($soc);
- $html->form_confirm('fiche.php?id='.$id,
$langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'),
'confirm_close');
+
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id,
$langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'),
'confirm_close');
print '<br />';
}
@@ -827,11 +842,20 @@
*/
if ($_GET['action'] == 'annuler')
{
- $html->form_confirm('fiche.php?id='.$id,
$langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
+
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'),
$langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
print '<br />';
}
/*
+ * 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"].'?id='.$id.'&lineid='.$_GET["lineid"],
$langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'),
'confirm_deleteproductline');
+ print '<br>';
+ }
+
+ /*
* Commande
*/
$nbrow=8;
@@ -1110,10 +1134,17 @@
// Icone d'edition et
suppression
if ($commande->statut == 0 &&
$user->rights->commande->creer)
{
- print '<td
align="right"><a
href="fiche.php?id='.$id.'&action=editline&rowid='.$objp->rowid.'">';
+ print '<td
align="right"><a
href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=editline&rowid='.$objp->rowid.'">';
print img_edit();
print '</a></td>';
- print '<td
align="right"><a
href="fiche.php?id='.$id.'&action=deleteline&lineid='.$objp->rowid.'">';
+ if
($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
+ {
+ print '<td
align="right"><a
href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=delete_product_line&lineid='.$objp->rowid.'">';
+ }
+ else
+ {
+ print '<td
align="right"><a
href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=deleteline&lineid='.$objp->rowid.'">';
+ }
print img_delete();
print '</a></td>';
print '<td
align="right">';
@@ -1669,5 +1700,5 @@
$db->close();
-llxFooter('$Date: 2006/06/05 23:04:13 $ - $Revision: 1.193 $');
+llxFooter('$Date: 2006/06/08 10:35:21 $ - $Revision: 1.194 $');
?>
Index: langs/en_US/products.lang
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/langs/en_US/products.lang,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- langs/en_US/products.lang 26 May 2006 13:58:59 -0000 1.36
+++ langs/en_US/products.lang 8 Jun 2006 10:35:21 -0000 1.37
@@ -90,6 +90,8 @@
Quantity=Quantity
NoMatchFound=No match found
DeleteProduct=Delete a product/service
-ConfirmDeleteProduct=Are you sure you want to delete this product/service ?
+ConfirmDeleteProduct=Are you sure you want to delete this product/service?
ProductDeleted=Product/Service "%s" deleted from database.
ExportDataset_produit_1=Products and services
\ No newline at end of file
+DeleteProductLine=Delete product line
+ConfirmDeleteProductLine=Are you sure you want to delete this product line?
\ No newline at end of file
Index: langs/fr_FR/products.lang
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/langs/fr_FR/products.lang,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- langs/fr_FR/products.lang 26 May 2006 13:58:59 -0000 1.57
+++ langs/fr_FR/products.lang 8 Jun 2006 10:35:21 -0000 1.58
@@ -103,3 +103,5 @@
ConfirmDeleteProduct=Etes-vous sûr de vouloir supprimer ce produit/service ?
ProductDeleted=Le produit/service "%s" à été supprimé de la base.
ExportDataset_produit_1=Produits et services
+DeleteProductLine=Supprimer ligne produit
+ConfirmDeleteProductLine=Êtes-vous sûr de vouloir effacer cette ligne produit ?
\ No newline at end of file
- [Dolibarr-cvs] dolibarr/htdocs commpropal.php commande/fiche.p...,
Regis Houssin <=