diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-06-03 22:16:20 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-06-03 22:16:20 -0700 |
commit | 2e2fc8616751ce8fd69bc52344dd61fc03eb2ab0 (patch) | |
tree | b90957acba488cb8ae9a45ce137a3e03f4cdd745 | |
parent | 78e3c0ade972ce25fb9b3de97a2e6539854ffedd (diff) |
set appointment length, RT#33556
-rw-r--r-- | httemplate/elements/make_appointment.html | 34 | ||||
-rw-r--r-- | httemplate/elements/popup_link-make_appointment.html | 31 | ||||
-rw-r--r-- | httemplate/elements/schedule-appointment.html | 21 | ||||
-rw-r--r-- | httemplate/view/cust_main/appointments.html | 11 |
4 files changed, 87 insertions, 10 deletions
diff --git a/httemplate/elements/make_appointment.html b/httemplate/elements/make_appointment.html new file mode 100644 index 000000000..f9e80045c --- /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 000000000..60a337c04 --- /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 000000000..a469c8405 --- /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 f8c1bb686..c907b25bb 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 &> % } %# | |