[freeside-commits] freeside/httemplate/edit REAL_cust_pkg.cgi, 1.9,
1.10
Ivan,,,
ivan at wavetail.420.am
Wed Sep 21 05:47:51 PDT 2005
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv13129/httemplate/edit
Modified Files:
REAL_cust_pkg.cgi
Log Message:
add prepaid support which sets RADIUS Expiration attribute, update customer view package UI
Index: REAL_cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/REAL_cust_pkg.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- REAL_cust_pkg.cgi 27 Feb 2005 11:05:35 -0000 1.9
+++ REAL_cust_pkg.cgi 21 Sep 2005 12:47:49 -0000 1.10
@@ -1,6 +1,4 @@
-<!-- mason kludge -->
<%
-# <!-- $Id$ -->
my $error ='';
my $pkgnum = '';
@@ -33,17 +31,20 @@
}
#my $custnum = $cust_pkg->getfield('custnum');
-print header('Package Edit'); #, menubar(
+%>
+
+<%= header('Customer package - Edit dates') %>
+<%
+#, menubar(
# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
# 'Main Menu' => popurl(2)
#));
-
%>
- <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
- <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
+<LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
+<SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
<%
@@ -57,67 +58,106 @@
my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
my $otaker = $cust_pkg->getfield('otaker');
-print '<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">', qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
+%>
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!
- if $error;
+<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%= $pkgnum %>">
+
+<% if ( $error ) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $error %></FONT>
+<% } %>
+
+<%
#my $format = "%c %z (%Z)";
my $format = "%m/%d/%Y %T %z (%Z)";
-print ntable("#cccccc",2),
- '<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
- $pkgnum, '</TD></TR>',
- '<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
- $pkg, '</TD></TR>',
- '<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
- $comment, '</TD></TR>',
- '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
- $otaker, '</TD></TR>',
- '<TR><TD ALIGN="right">Setup date</TD><TD>'.
- '<INPUT TYPE="text" NAME="setup" SIZE=32 ID="setup_text" VALUE="',
- ( $setup ? time2str($format, $setup) : "" ), '">'.
- ' <IMG SRC="../images/calendar.png" ID="setup_button" STYLE="cursor: pointer" TITLE="Select date">'.
- '</TD></TR>';
+#false laziness w/view/cust_main/packages.html
+#my( $billed_or_prepaid,
+my( $last_bill_or_renewed, $next_bill_or_prepaid_until );
+unless ( $part_pkg->is_prepaid ) {
+ #$billed_or_prepaid = 'billed';
+ $last_bill_or_renewed = 'Last bill';
+ $next_bill_or_prepaid_until = 'Next bill';
+} else {
+ #$billed_or_prepaid = 'prepaid';
+ $last_bill_or_renewed = 'Renewed';
+ $next_bill_or_prepaid_until = 'Prepaid until';
+}
-print '<TR><TD ALIGN="right">Last bill date</TD><TD>',
- '<INPUT TYPE="text" NAME="last_bill" SIZE=32 ID="last_bill_text" VALUE="',
- ( $cust_pkg->last_bill
- ? time2str($format, $cust_pkg->last_bill)
- : "" ),
- '">'.
- ' <IMG SRC="../images/calendar.png" ID="last_bill_button" STYLE="cursor: pointer" TITLE="Select date">'.
- '</TD></TR>'
- if $cust_pkg->dbdef_table->column('last_bill');
+%>
-print '<TR><TD ALIGN="right">Next bill date</TD><TD>',
- '<INPUT TYPE="text" NAME="bill" SIZE=32 ID="bill_text" VALUE="',
- ( $bill ? time2str($format, $bill) : "" ), '">'.
- ' <IMG SRC="../images/calendar.png" ID="bill_button" STYLE="cursor: pointer" TITLE="Select date">'.
- '</TD></TR>';
+<%= ntable("#cccccc",2) %>
-print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
- time2str($format, $susp), '</TD></TR>'
- if $susp;
+ <TR>
+ <TD ALIGN="right">Package number</TD>
+ <TD BGCOLOR="#ffffff"><%= $pkgnum %></TD>
+ </TR>
-#print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
-# time2str("%D",$expire), '</TD></TR>'
-# if $expire;
-print '<TR><TD ALIGN="right">Expiration date'.
- '</TD><TD>',
- '<INPUT TYPE="text" NAME="expire" SIZE=32 ID="expire_text" VALUE="',
- ( $expire ? time2str($format, $expire) : "" ), '">'.
- ' <IMG SRC="../images/calendar.png" ID="expire_button" STYLE="cursor: pointer" TITLE="Select date">'.
- '<BR><FONT SIZE=-1>(will <b>cancel</b> this package'.
- ' when the date is reached)</FONT>'.
- '</TD></TR>';
+ <TR>
+ <TD ALIGN="right">Package</TD>
+ <TD BGCOLOR="#ffffff"><%= $pkg %></TD>
+ </TR>
-print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
- time2str($format, $cancel), '</TD></TR>'
- if $cancel;
+ <TR>
+ <TD ALIGN="right">Comment</TD>
+ <TD BGCOLOR="#ffffff"><%= $comment %></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right">Order taker</TD>
+ <TD BGCOLOR="#ffffff"><%= $otaker %></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right">Setup date</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="setup" SIZE=32 ID="setup_text" VALUE="<%= ( $setup ? time2str($format, $setup) : "" ) %>">
+ <IMG SRC="../images/calendar.png" ID="setup_button" STYLE="cursor: pointer" TITLE="Select date">
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right"><%= $last_bill_or_renewed %> date</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="last_bill" SIZE=32 ID="last_bill_text" VALUE="<%= ( $cust_pkg->last_bill ? time2str($format, $cust_pkg->last_bill) : "" ) %>">
+ <IMG SRC="../images/calendar.png" ID="last_bill_button" STYLE="cursor: pointer" TITLE="Select date">
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right"><%= $next_bill_or_prepaid_until %> date</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="bill" SIZE=32 ID="bill_text" VALUE="<%= ( $bill ? time2str($format, $bill) : "" ) %>">
+ <IMG SRC="../images/calendar.png" ID="bill_button" STYLE="cursor: pointer" TITLE="Select date">
+ </TD>
+ </TR>
+
+ <% if ( $susp ) { %>
+ <TR>
+ <TD ALIGN="right">Suspension date</TD>
+ <TD BGCOLOR="#ffffff"><%= time2str($format, $susp) %></TD>
+ </TR>
+ <% } %>
+
+ <TR>
+ <TD ALIGN="right">Expiration date</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="expire" SIZE=32 ID="expire_text" VALUE="<%= ( $expire ? time2str($format, $expire) : "" ) %>">
+ <IMG SRC="../images/calendar.png" ID="expire_button" STYLE="cursor: pointer" TITLE="Select date">
+ <BR><FONT SIZE=-1>(will <b>cancel</b> this package when the date is reached)</FONT>
+ </TD>
+ </TR>
+
+ <% if ( $cancel ) { %>
+ <TR>
+ <TD ALIGN="right">Cancellation date</TD>
+ <TD BGCOLOR="#ffffff"><%= time2str($format, $cancel) %></TD>
+ </TR>
+ <% } %>
-%>
</TABLE>
+
<SCRIPT TYPE="text/javascript">
<%
my @cal = qw( setup bill expire );
More information about the freeside-commits
mailing list