X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fappointments.html;h=171cb5c8c344ff49d13e9828e8cefeb2113039b2;hb=6a953cf2693cada43052a16481c433dab8878579;hp=335bd208be2bfc74b7fddacd8a0f2cf704f395d5;hpb=cca0cc20700b15a95b2c61e527b3a128c6efb32e;p=freeside.git diff --git a/httemplate/view/cust_main/appointments.html b/httemplate/view/cust_main/appointments.html index 335bd208b..171cb5c8c 100644 --- a/httemplate/view/cust_main/appointments.html +++ b/httemplate/view/cust_main/appointments.html @@ -17,7 +17,9 @@ % my $bgcolor = ''; - <% mt('Type') |h %> +% if ( $custom_field ) { + <% mt('Type') |h %> +% } <% mt('Date') |h %> <% mt('Status') |h %> <% mt('Owner') |h %> @@ -32,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 %> @@ -75,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;