1 %# if ( $link eq 'popup' ) {
2 <% include('/elements/header-popup.html', $title ) %>
4 %# <% include("/elements/header.html", $title, '') %>
7 <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
8 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
9 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
10 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
12 <% include('/elements/error.html') %>
14 <FORM NAME="sc_popup" ACTION="<% popurl(1) %>process/cancel_pkg.html" METHOD=POST>
15 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
16 <INPUT TYPE="hidden" NAME="method" VALUE="<% $method %>">
20 <% ucfirst($method) . " $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %>
21 <% ntable("#cccccc", 2) %>
23 % if ($method eq 'expire' || $method eq 'adjourn') {
25 <TD><% $submit =~ /^(\w*)\s/ %> package on </TD>
26 <TD><INPUT TYPE="text" NAME="date" ID="expire_date" VALUE="<% $date %>">
27 <IMG SRC="<% $p %>images/calendar.png" ID="expire_button" STYLE="cursor:pointer" TITLE="Select date">
31 <SCRIPT TYPE="text/javascript">
33 inputField: "expire_date",
35 button: "expire_button",
42 <% include('/elements/tr-select-reason.html',
43 'field' => 'reasonnum',
44 'reason_class' => $class,
45 #XXX these need to be sticky on errors too...
47 'control_button' => 'document.sc_popup.submit',
54 <INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>" disabled='true'>
61 my($method, $pkgnum, $reasonnum, $submit, $cust_pkg, $part_pkg,
62 $date, $curuser, $class);
63 $date = time2str("%m/%d/%Y", time);
64 if ( $cgi->param('error') ) {
65 $method = $cgi->param('method');
66 $pkgnum = $cgi->param('pkgnum');
67 $reasonnum = $cgi->param('reasonnum');
68 $date = $cgi->param('date');
69 } elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
72 die "illegal query ". $cgi->keywords;
75 $method = $cgi->param('method');
76 if ($method eq 'cancel') {
78 $submit = "Cancel Now";
79 }elsif ($method eq 'expire') {
81 $submit = "Cancel Later";
82 }elsif ($method eq 'suspend') {
84 $submit = "Suspend Now";
85 }elsif ($method eq 'adjourn') {
87 $submit = "Suspend Later";
89 die "illegal query ". $cgi->keywords;
92 my $title = ucfirst($method) . ' Package';
94 $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
95 die "No such package: $pkgnum" unless $cust_pkg;
97 $part_pkg = $cust_pkg->part_pkg;
99 $curuser = $FS::CurrentUser::CurrentUser;