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 % if ( $cgi->param('error') ) {
13 <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
17 <FORM NAME="sc_popup" ACTION="<% popurl(1) %>process/cancel_pkg.html" METHOD=POST>
18 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
19 <INPUT TYPE="hidden" NAME="method" VALUE="<% $method %>">
23 <% ucfirst($method) . " $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %>
24 <% ntable("#cccccc", 2) %>
26 % if ($method eq 'expire' || $method eq 'adjourn') {
28 <TD><% $submit =~ /^(\w*)\s/ %> package on </TD>
29 <TD><INPUT TYPE="text" NAME="date" ID="expire_date" VALUE="<% $date %>">
30 <IMG SRC="<% $p %>images/calendar.png" ID="expire_button" STYLE="cursor:pointer" TITLE="Select date">
34 <SCRIPT TYPE="text/javascript">
36 inputField: "expire_date",
38 button: "expire_button",
45 <% include('/elements/tr-select-reason.html',
46 'field' => 'reasonnum',
47 'reason_class' => $class,
48 #XXX these need to be sticky on errors too...
50 'control_button' => 'document.sc_popup.submit',
57 <INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>" disabled='true'>
64 my($method, $pkgnum, $reasonnum, $submit, $cust_pkg, $part_pkg,
65 $date, $curuser, $class);
66 $date = time2str("%m/%d/%Y", time);
67 if ( $cgi->param('error') ) {
68 $method = $cgi->param('method');
69 $pkgnum = $cgi->param('pkgnum');
70 $reasonnum = $cgi->param('reasonnum');
71 $date = $cgi->param('date');
72 } elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
75 die "illegal query ". $cgi->keywords;
78 $method = $cgi->param('method');
79 if ($method eq 'cancel') {
81 $submit = "Cancel Now";
82 }elsif ($method eq 'expire') {
84 $submit = "Cancel Later";
85 }elsif ($method eq 'suspend') {
87 $submit = "Suspend Now";
88 }elsif ($method eq 'adjourn') {
90 $submit = "Suspend Later";
92 die "illegal query ". $cgi->keywords;
95 my $title = ucfirst($method) . ' Package';
97 $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
98 die "No such package: $pkgnum" unless $cust_pkg;
100 $part_pkg = $cust_pkg->part_pkg;
102 $curuser = $FS::CurrentUser::CurrentUser;