From 90069b76bb91e2bf349b8e5fd58f063965f51209 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 3 Aug 2003 12:18:29 +0000 Subject: [PATCH] Gestion de la suppression --- htdocs/comm/action/fiche.php3 | 54 ++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/action/fiche.php3 b/htdocs/comm/action/fiche.php3 index e75568126a8..d58e2af2c7a 100644 --- a/htdocs/comm/action/fiche.php3 +++ b/htdocs/comm/action/fiche.php3 @@ -49,17 +49,21 @@ if ($action=='add_action') $societe = new Societe($db); $societe->fetch($socid); - $actioncomm = new ActionComm($db); - + + $actioncomm->date = $db->idate(mktime($HTTP_POST_VARS["achour"], + $HTTP_POST_VARS["acmin"], + 0, + $HTTP_POST_VARS["acmonth"], + $HTTP_POST_VARS["acday"], + $HTTP_POST_VARS["acyear"]) + ); if ($actionid == 5) { - $actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear)); $actioncomm->percent = 0; } else { - $actioncomm->date = $date; $actioncomm->percent = 100; } $actioncomm->priority = 2; @@ -116,6 +120,14 @@ if ($action=='add_action') Header("Location: ".DOL_URL_ROOT."/comm/fiche.php3?socid=$socid"); } +if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) +{ + $actioncomm = new ActionComm($db); + $actioncomm->delete($id); + Header("Location: index.php"); +} + + /******************************************************************************/ /* */ /* Fin des Actions */ @@ -183,12 +195,12 @@ if ($action=='create' && $actionid && $contactid) { */ else { + $html = new Form($db); print_titre ("Action effectuée"); print '
'; print ''; - print ''; print ''; print ''; print ''; @@ -199,7 +211,9 @@ if ($action=='create' && $actionid && $contactid) { print 'Société'; print ''.$societe->nom.''; print 'Contact'.$contact->fullname.''; - print 'Date'.strftime('%d %B %Y %H:%M',time()).''; + print 'Date'; + print $html->select_date('','ac',1,1); + print ''; print 'Commentaire'; print ''; print "

"; @@ -230,6 +244,27 @@ if ($action=='create' && $actionid && $contactid) { */ if ($id) { + + if ($action == 'delete') + { + + print ''; + print ''; + print ''; + + print ''; + + print '\n"; + print ''; + print '
Supprimer l\'action
Etes-vous sur de vouloir supprimer cette action ?'; + $htmls = new Form($db); + + $htmls->selectyesno("confirm","no"); + + print "
'; + print "

\n"; + } + $act = new ActionComm($db); $act->fetch($id); @@ -246,7 +281,7 @@ if ($id) print 'Contact'.$act->contact->fullname.''; print 'Auteur'.$act->author->fullname.''; - print 'Date'.strftime('%d %B %Y %H:%M',time()).''; + print 'Date'.strftime('%d %B %Y %H:%M',$act->date).''; if ($act->objet_url) { print 'Objet lié'; @@ -270,11 +305,8 @@ if ($id) print '-'; print '-'; print ''; - print 'Supprimer'; + print 'Supprimer'; print ''; - - - } $db->close();