[freeside-commits] branch master updated. 2e2fc8616751ce8fd69bc52344dd61fc03eb2ab0

Ivan ivan at 420.am
Wed Jun 3 22:16:21 PDT 2015


The branch, master has been updated
       via  2e2fc8616751ce8fd69bc52344dd61fc03eb2ab0 (commit)
      from  78e3c0ade972ce25fb9b3de97a2e6539854ffedd (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 2e2fc8616751ce8fd69bc52344dd61fc03eb2ab0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 3 22:16:20 2015 -0700

    set appointment length, RT#33556

diff --git a/httemplate/elements/make_appointment.html b/httemplate/elements/make_appointment.html
new file mode 100644
index 0000000..f9e8004
--- /dev/null
+++ b/httemplate/elements/make_appointment.html
@@ -0,0 +1,34 @@
+<& /elements/header-popup.html &>
+
+% #XXX actually, the action needs to repace the top-level window with this
+% #$params->{'action'} = $p. 'rt/Search/Schedule.html?'. $query;
+<FORM NAME="appointment_form" METHOD="POST" ACTION="<% $p %>elements/schedule-appointment.html">
+
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cgi->param('custnum') |h %>">
+
+% my @sched_item = qsearch('sched_item', { 'disabled' => '', });
+% my @username = map $_->access_user->username, @sched_item;
+% foreach my $username (@username) { 
+  <INPUT TYPE="hidden" NAME="username" VALUE="<% $username |h %>">
+% }
+
+Length: 
+<SELECT NAME="LengthMin">
+%  for ( my $hours = .5; $hours < 10.5; $hours += .5 ) {
+     <OPTION VALUE="<% $hours * 60 %>"><% $hours %> hour<% $hours > 1 ? 's' : '' %>
+%  }
+</SELECT>
+<BR>
+<BR>
+
+<INPUT TYPE="submit" VALUE="Schedule appointment">
+
+</FORM>
+
+<& /elements/footer-popup.html &>
+<%init>
+
+#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
+
+
+</%init>
diff --git a/httemplate/elements/popup_link-make_appointment.html b/httemplate/elements/popup_link-make_appointment.html
new file mode 100644
index 0000000..60a337c
--- /dev/null
+++ b/httemplate/elements/popup_link-make_appointment.html
@@ -0,0 +1,31 @@
+<%doc>
+
+Example:
+
+  include('/elements/init_overlib.html')
+
+  include( '/elements/popup_link-make-appointment.html', { #hashref or a list, either way
+             'custnum' => 54,
+  })
+
+</%doc>
+<& /elements/popup_link.html, $params &>\
+<%init>
+
+my $params = { 'closetext' => 'Close' };
+
+if (ref($_[0]) eq 'HASH') {
+  $params = { %$params, %{ $_[0] } };
+} else {
+  $params = { %$params, @_ };
+}
+
+#$params->{'label'} ||= 'schedule new appointment';
+$params->{'label'} ||= 'Schedule new appointment';
+$params->{'actionlabel'} ||= 'Schedule appointment';
+#$params->{'width'} ||= 350;
+#$params->{'height'} ||= 220;
+
+$params->{'action'} = $p. '/elements/make_appointment.html?custnum='. $params->{'custnum'};
+
+</%init>
diff --git a/httemplate/elements/schedule-appointment.html b/httemplate/elements/schedule-appointment.html
new file mode 100644
index 0000000..a469c84
--- /dev/null
+++ b/httemplate/elements/schedule-appointment.html
@@ -0,0 +1,21 @@
+<HTML>
+<HEAD>
+<SCRIPT TYPE="text/javascript">
+  window.top.location.href = '<% $url %>';
+</SCRIPT>
+</HEAD>
+</HTML>
+<%init>
+
+my @username = map encode_entities($_), $cgi->param('username');
+my $LengthMin = encode_entities( $cgi->param('LengthMin') );
+my $custnum = encode_entities( $cgi->param('custnum') );
+
+my $query = join('&', map "username=$_", @username).
+            "&LengthMin=$LengthMin".
+            "&custnum=$custnum";
+            #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?  we're getting complicated like form-creat_ticket.html
+
+my $url = $p. 'rt/Search/Schedule.html?'. $query;
+
+</%init>
diff --git a/httemplate/view/cust_main/appointments.html b/httemplate/view/cust_main/appointments.html
index f8c1bb6..c907b25 100644
--- a/httemplate/view/cust_main/appointments.html
+++ b/httemplate/view/cust_main/appointments.html
@@ -2,16 +2,7 @@
 <A NAME="appointments"><FONT CLASS="fsinnerbox-title">Appointments</FONT></A>
 
 % if ( $FS::CurrentUser::CurrentUser->access_right('Make appointment') ) { 
-%# just a link for now,  should probably be FS::TicketSystem->href_schedule
-%# maybe need to add a dropdown for type (install etc.) from a custom field
-%# or maybe change to a popup and get that info there
-% my @sched_item = qsearch('sched_item', { 'disabled' => '', });
-% my @username = map $_->access_user->username, @sched_item;
-% my $query = join('&', map "username=$_", @username).
-%             '&LengthMin=180'. #XXX appointment length
-%             '&custnum='. $cust_main->custnum; #.
-%             #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?  we're getting complicated like form-creat_ticket.html
-<A HREF="<%$p%>rt/Search/Schedule.html?<% $query %>">Make appointment</A>
+  <& /elements/popup_link-make_appointment.html, custnum=>$cust_main->custnum &>
 % }
 
 %#  |

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

Summary of changes:
 httemplate/elements/make_appointment.html          |   34 ++++++++++++++++++++
 .../elements/popup_link-make_appointment.html      |   31 ++++++++++++++++++
 httemplate/elements/schedule-appointment.html      |   21 ++++++++++++
 httemplate/view/cust_main/appointments.html        |   11 +------
 4 files changed, 87 insertions(+), 10 deletions(-)
 create mode 100644 httemplate/elements/make_appointment.html
 create mode 100644 httemplate/elements/popup_link-make_appointment.html
 create mode 100644 httemplate/elements/schedule-appointment.html




More information about the freeside-commits mailing list