From cca0cc20700b15a95b2c61e527b3a128c6efb32e Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 3 Jun 2015 22:16:26 -0700 Subject: [PATCH] set appointment length, RT#33556 --- 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 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; +
+ + + +% my @sched_item = qsearch('sched_item', { 'disabled' => '', }); +% my @username = map $_->access_user->username, @sched_item; +% foreach my $username (@username) { + +% } + +Length: + +
+
+ + + +
+ +<& /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 + + + 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, + }) + + +<& /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'}; + + 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 @@ + + + + + +<%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; + + diff --git a/httemplate/view/cust_main/appointments.html b/httemplate/view/cust_main/appointments.html index 9bec7b9ae..335bd208b 100644 --- a/httemplate/view/cust_main/appointments.html +++ b/httemplate/view/cust_main/appointments.html @@ -2,16 +2,7 @@ Appointments % 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 -Make appointment + <& /elements/popup_link-make_appointment.html, custnum=>$cust_main->custnum &> % } %# | -- 2.11.0