X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fappointments.html;h=171cb5c8c344ff49d13e9828e8cefeb2113039b2;hb=6a953cf2693cada43052a16481c433dab8878579;hp=9bec7b9ae0e802bcbc8ca19afd92f89187644254;hpb=18092846de81204c8be139ce47fd41191e5606c2;p=freeside.git diff --git a/httemplate/view/cust_main/appointments.html b/httemplate/view/cust_main/appointments.html index 9bec7b9ae..171cb5c8c 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 &> % } %# | @@ -26,7 +17,9 @@ % my $bgcolor = ''; - <% mt('Type') |h %> +% if ( $custom_field ) { + <% mt('Type') |h %> +% } <% mt('Date') |h %> <% mt('Status') |h %> <% mt('Owner') |h %> @@ -41,16 +34,18 @@ % } % % use Date::Parse qw( str2time ); -% my $starts = str2time( $ticket->{starts} ); #default format here sucks +% my $starts = str2time( $ticket->{starts}, 'UTC' ); #default format here sucks % my $starts_pretty = ''; % $starts_pretty = time2str('%a %h %o %Y %l:%M%P', $starts) % if $starts > 86400; - - - ><% 'custom field magic type' %> - + +% if ( $custom_field ) { + + ><% $ticket->{"CF.{$custom_field}"} |h %> + +% } ><% $starts_pretty %> @@ -84,20 +79,22 @@ return '' unless $conf->config('ticket_system'); #my $object = $opt{'object'}; #$object = $object->cust_svc if $object->isa('FS::svc_Common'); -my( @tickets ) = $object->tickets; #XXX but actually appointments... filter by presense of the necessary CF? RT::Appointment instead of RT::Ticket ? +my @tickets = $object->appointments; -my ($openlabel, $open_link, $res_link, $thing); -$openlabel = join('/', FS::TicketSystem->statuses ); +my $custom_field = $conf->config('ticket_system-appointment-custom_field'); + +# my ($openlabel, $open_link, $res_link, $thing); +# $openlabel = join('/', FS::TicketSystem->statuses ); # not the nicest way to do this--FS::has_tickets_Common? #if ( $object->isa('FS::cust_main') ) { - $thing = 'customer'; - $open_link = FS::TicketSystem->href_customer_tickets($object->custnum); - - $res_link = FS::TicketSystem->href_customer_tickets( - $object->custnum, - { 'statuses' => [ 'resolved' ] } - ); +# $thing = 'customer'; +# $open_link = FS::TicketSystem->href_customer_tickets($object->custnum); +# +# $res_link = FS::TicketSystem->href_customer_tickets( +# $object->custnum, +# { 'statuses' => [ 'resolved' ] } +# ); #} elsif ( $object->isa('FS::cust_svc') ) { # # return '' unless $object->pkgnum;