[freeside-commits] branch FREESIDE_3_BRANCH updated. be50cb8c900bfc20c873996a9ab6c48009de0204

Ivan ivan at 420.am
Wed Jun 3 22:32:56 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  be50cb8c900bfc20c873996a9ab6c48009de0204 (commit)
      from  cca0cc20700b15a95b2c61e527b3a128c6efb32e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit be50cb8c900bfc20c873996a9ab6c48009de0204
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 3 22:32:55 2015 -0700

    default appointment length, RT#33556

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 38ccb6e..6a4d19b 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5964,6 +5964,13 @@ and customer address. Include units.',
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'default_appointment_length',
+    'section'     => 'UI',
+    'description' => 'Default appointment length, in minutes (30 minute granularity).',
+    'type'        => 'text',
+  },
+
   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
diff --git a/httemplate/elements/make_appointment.html b/httemplate/elements/make_appointment.html
index f9e8004..ddf377f 100644
--- a/httemplate/elements/make_appointment.html
+++ b/httemplate/elements/make_appointment.html
@@ -15,7 +15,10 @@
 Length: 
 <SELECT NAME="LengthMin">
 %  for ( my $hours = .5; $hours < 10.5; $hours += .5 ) {
-     <OPTION VALUE="<% $hours * 60 %>"><% $hours %> hour<% $hours > 1 ? 's' : '' %>
+%    my $min = $hours * 60;
+     <OPTION VALUE="<% $min %>"
+             <% $min == $default_length ? 'SELECTED' : '' %>
+     ><% $hours %> hour<% $hours > 1 ? 's' : '' %>
 %  }
 </SELECT>
 <BR>
@@ -28,6 +31,8 @@ Length:
 <& /elements/footer-popup.html &>
 <%init>
 
+my $default_length = FS::Conf->new->config('default_appointment_length') || 180;
+
 #XXX '&pkgnum=$pkgnum";need to be for specific package/location, not just for a customer... default to active(/ordered) package in a pkg_class w/ticketing_queueid, otherwise, a popup?  (well, we're already a popup now) we're getting complicated like form-creat_ticket.html
 
 
diff --git a/httemplate/elements/schedule-appointment.html b/httemplate/elements/schedule-appointment.html
index a469c84..45a8a5b 100644
--- a/httemplate/elements/schedule-appointment.html
+++ b/httemplate/elements/schedule-appointment.html
@@ -1,10 +1,9 @@
-<HTML>
-<HEAD>
+<& /elements/header-popup.html &>
+<h1>Scheduling appointment...</h1>
 <SCRIPT TYPE="text/javascript">
   window.top.location.href = '<% $url %>';
 </SCRIPT>
-</HEAD>
-</HTML>
+<& /elements/footer-popup.html &>
 <%init>
 
 my @username = map encode_entities($_), $cgi->param('username');

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Conf.pm                                 |    7 +++++++
 httemplate/elements/make_appointment.html     |    7 ++++++-
 httemplate/elements/schedule-appointment.html |    7 +++----
 3 files changed, 16 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list