From 1be5ff2f35f064c6bc133a15048df0648b8d2bdc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 4 Aug 2007 13:32:12 +0000 Subject: [PATCH] =?UTF-8?q?Ajax:=20d=E9but=20ajout=20message=20de=20confir?= =?UTF-8?q?mation=20de=20suppression=20ou=20autre=20afin=20d'=E9viter=20de?= =?UTF-8?q?=20recharger=20la=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php | 44 ++++++++++++++++++++++++++++++------------ htdocs/lib/lib_head.js | 2 +- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 0bc01f8ca10..bc2f23782a8 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -304,7 +304,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer) /* * Cloture de la propale */ -if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer) +if ($_REQUEST['action'] == 'setstatut' && $user->rights->propale->cloturer) { if (! $_POST['cancel']) { @@ -312,7 +312,7 @@ if ($_POST['action'] == 'setstatut' && $user->rights->propale->cloturer) $propal->fetch($_GET['propalid']); // prevent browser refresh from closing proposal several times if ($propal->statut==1) { - $propal->cloture($user, $_POST['statut'], $_POST['note']); + $propal->cloture($user, $_REQUEST['statut'], $_REQUEST['note']); } } } @@ -1414,10 +1414,12 @@ if ($_GET['propalid'] > 0) /* * Formulaire cloture (signé ou non) */ - $form_close = ''.$langs->trans('Note').''; - $form_close.= ''.$langs->trans("CloseAs").''; + $form_close.= ''.$langs->trans("CloseAs").''; $form_close.= ''; $form_close.= ''; $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + if ($conf->use_ajax) + { + $form_close.= '   '; + } + else + { + $form_close.= '   '; + } + $form_close.= ''; + $form_close.= ''; if ($_GET['action'] == 'statut') { - print '
'; - print ''; print $form_close; - print ''; - print '
'; - print ''; - print '   '; - print '
'; } @@ -1496,7 +1503,20 @@ if ($_GET['propalid'] > 0) // Close if ($propal->statut == 1 && $user->rights->propale->cloturer) { - print ''.$langs->trans('Close').''; + print ''."\n"; + + print 'use_ajax) + { + print 'href="#" onClick="info($(\'confirm_close\').innerHTML)"'."\n"; + } + else + { + print 'href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=statut"'; + } + print '>'.$langs->trans('Close').''; } // Delete diff --git a/htdocs/lib/lib_head.js b/htdocs/lib/lib_head.js index ef59dac6fb8..964ec87f8a5 100644 --- a/htdocs/lib/lib_head.js +++ b/htdocs/lib/lib_head.js @@ -669,7 +669,7 @@ function confirmDelete(linkurl,message,ok,cancel) { /*================================================================= Purpose: Affiche un message d'information - Input: linkurl,message,ok,cancel + Input: message Author: Regis Houssin Licence: GPL ==================================================================*/