default appointment length, RT#33556
authorIvan Kohler <ivan@freeside.biz>
Thu, 4 Jun 2015 05:32:53 +0000 (22:32 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 4 Jun 2015 05:32:53 +0000 (22:32 -0700)
FS/FS/Conf.pm
httemplate/elements/make_appointment.html
httemplate/elements/schedule-appointment.html

index 8cd8e27..78baa2f 100644 (file)
@@ -5947,6 +5947,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" },
index f9e8004..ddf377f 100644 (file)
 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
 
 
index a469c84..45a8a5b 100644 (file)
@@ -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');