summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/process/quick-cust_pkg.cgi4
-rw-r--r--httemplate/elements/tr-input-date-field.html15
-rw-r--r--httemplate/misc/order_pkg.html37
-rwxr-xr-xhttemplate/view/cust_main/packages.html1
4 files changed, 51 insertions, 6 deletions
diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi
index 57c696e7e..7a0f08280 100644
--- a/httemplate/edit/process/quick-cust_pkg.cgi
+++ b/httemplate/edit/process/quick-cust_pkg.cgi
@@ -49,6 +49,10 @@ my $locationnum = $1;
my $cust_pkg = new FS::cust_pkg {
'custnum' => $custnum,
'pkgpart' => $pkgpart,
+ 'start_date' => ( scalar($cgi->param('start_date'))
+ ? str2time($cgi->param('start_date'))
+ : ''
+ ),
'refnum' => $refnum,
'locationnum' => $locationnum,
};
diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html
index 11581d5bc..428221a5c 100644
--- a/httemplate/elements/tr-input-date-field.html
+++ b/httemplate/elements/tr-input-date-field.html
@@ -28,12 +28,15 @@ my($name, $value, $label, $format, $usedatetime) = @_;
$format = "%m/%d/%Y" unless $format;
$label = $name unless $label;
-if ($usedatetime) {
- my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating');
- $value = $dt->strftime($format)
- unless $value eq '';
-}else{
- $value = time2str($format, $value);
+if ( $value =~ /\S/ ) {
+ if ( $usedatetime ) {
+ my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating');
+ $value = $dt->strftime($format);
+ } else {
+ $value = time2str($format, $value);
+ }
+} else {
+ $value = '';
}
</%init>
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
index 9caa57a69..a7571ca58 100644
--- a/httemplate/misc/order_pkg.html
+++ b/httemplate/misc/order_pkg.html
@@ -1,5 +1,10 @@
<% include('/elements/header-popup.html', 'Order new package' ) %>
+<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>
+
<SCRIPT TYPE="text/javascript">
function enable_order_pkg () {
@@ -27,6 +32,34 @@
)
%>
+%# false laziness w/edit/quick-charge.html
+<TR>
+ <TH ALIGN="right">Start date </TD>
+ <TD COLSPAN=6>
+ <INPUT TYPE = "text"
+ NAME = "start_date"
+ SIZE = 32
+ ID = "start_date_text"
+ VALUE = "<% $start_date %>"
+ >
+ <IMG SRC = "../images/calendar.png"
+ ID = "start_date_button"
+ STYLE = "cursor: pointer"
+ TITLE = "Select date"
+ >
+ <FONT SIZE=-1>(leave blank to start immediately)</FONT>
+ </TD>
+</TR>
+
+<SCRIPT TYPE="text/javascript">
+ Calendar.setup({
+ inputField: "start_date_text",
+ ifFormat: "%m/%d/%Y",
+ button: "start_date_button",
+ align: "BR"
+ });
+</SCRIPT>
+
% if ( $conf->exists('pkg_referral') ) {
<% include('/elements/tr-select-part_referral.html',
'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,
@@ -68,4 +101,8 @@ my $cust_main = qsearchs({
my $pkgpart = scalar($cgi->param('pkgpart'));
+my $format = "%m/%d/%Y %T %z (%Z)"; #false laziness w/REAL_cust_pkg.cgi?
+my $start_date = $cust_main->next_bill_date;
+$start_date = $start_date ? time2str($format, $start_date) : '';
+
</%init>
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 8fbefae50..16adc8c5f 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -9,6 +9,7 @@
'cust_main' => $cust_main,
'closetext' => 'Close',
'width' => 763,
+ 'height' => 350,
)
%>
% }