New: Add cancel button on note edit

This commit is contained in:
Laurent Destailleur
2011-07-13 16:24:57 +00:00
parent cf184ec351
commit adbff7bc50

View File

@@ -23,7 +23,7 @@
* \file htdocs/societe/socnote.php
* \brief Tab for notes on third party
* \ingroup societe
* \version $Id$
* \version $Id: socnote.php,v 1.22 2011/07/13 16:24:57 eldy Exp $
*/
require("../main.inc.php");
@@ -44,7 +44,7 @@ $result = restrictedArea($user, 'societe', $socid);
* Actions
*/
if ($action == 'add')
if ($action == 'add' && ! GETPOST('cancel'))
{
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($_POST["note"])."' WHERE rowid=".$_POST["socid"];
$result = $db->query($sql);
@@ -133,7 +133,11 @@ if ($socid > 0)
if ($action == 'edit')
{
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
print '<tr><td colspan="2" align="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
}
print "</table>";
@@ -163,5 +167,5 @@ if ($action != 'edit')
$db->close();
llxFooter('$Date$ - $Revision$');
llxFooter('$Date: 2011/07/13 16:24:57 $ - $Revision: 1.22 $');
?>