diff --git a/web/includes/actions.php b/web/includes/actions.php index 24184d7db..d081d5c11 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -151,7 +151,7 @@ Warning("Addterm"); if ( ! empty($_REQUEST['Id']) ) { dbQuery( 'DELETE FROM Filters WHERE Id=?', array( $_REQUEST['Id'] ) ); } - } else if ( ( $action == 'save' ) or ( $action == 'execute' ) or ( $action == 'submit' ) ) { + } else if ( ( $action == 'Save' ) or ( $action == 'SaveAs' ) or ( $action == 'execute' ) or ( $action == 'submit' ) ) { $sql = ''; $_REQUEST['filter']['Query']['sort_field'] = validStr($_REQUEST['filter']['Query']['sort_field']); @@ -175,7 +175,7 @@ Warning("Addterm"); $sql .= ', Background = '. ( !empty($_REQUEST['filter']['Background']) ? 1 : 0); $sql .= ', Concurrent = '. ( !empty($_REQUEST['filter']['Concurrent']) ? 1 : 0); - if ( $_REQUEST['Id'] ) { + if ( $_REQUEST['Id'] and ( $action == 'Save' ) ) { dbQuery( 'UPDATE Filters SET ' . $sql. ' WHERE Id=?', array($_REQUEST['Id']) ); } else { dbQuery( 'INSERT INTO Filters SET' . $sql ); diff --git a/web/skins/classic/views/filter.php b/web/skins/classic/views/filter.php index 3beae54ad..002a08823 100644 --- a/web/skins/classic/views/filter.php +++ b/web/skins/classic/views/filter.php @@ -403,7 +403,8 @@ if ( ZM_OPT_MESSAGE ) { - + + Id() ) { ?> @@ -415,6 +416,6 @@ if ( canEdit( 'Events' ) ) { - - + + diff --git a/web/skins/classic/views/js/filter.js b/web/skins/classic/views/js/filter.js index ff93716c5..eed12a7f0 100644 --- a/web/skins/classic/views/js/filter.js +++ b/web/skins/classic/views/js/filter.js @@ -63,7 +63,7 @@ function saveFilter( element ) { //form.target = 'zmFilter'; form.target = window.name; - form.elements['action'].value = 'save'; + form.elements['action'].value = element.value; form.action = thisUrl + '?view=filter'; form.submit(); }