summaryrefslogtreecommitdiff
path: root/httemplate/misc/delete-saved_search.html
blob: 34567ec1ce5ad03ce85fb739eb1e49ad2bd4041e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% if ( $error ) {
<& /elements/errorpage-popup.html, $error &>
% } else {
<& /elements/header-popup.html, 'Saved search deleted' &>
  <script type="text/javascript">
  topreload();
  </script>
</body>
</html>
% }
<%init>

my $curuser = $FS::CurrentUser::CurrentUser;

my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal searchnum";
my $searchnum = $1;

my $search = qsearchs('saved_search', {
  'searchnum' => $searchnum,
  'usernum'   => $curuser->usernum,
});
my $error = $search->delete;

</%init>