diff options
Diffstat (limited to 'rt/share/html/Elements')
| -rw-r--r-- | rt/share/html/Elements/AddCustomers | 59 | ||||
| -rw-r--r-- | rt/share/html/Elements/CalendarEvent | 129 | ||||
| -rw-r--r-- | rt/share/html/Elements/CollectionList | 4 | ||||
| -rw-r--r-- | rt/share/html/Elements/ColumnMap | 7 | ||||
| -rw-r--r-- | rt/share/html/Elements/EditCustomFieldDate | 62 | ||||
| -rw-r--r-- | rt/share/html/Elements/EditCustomers | 63 | ||||
| -rwxr-xr-x | rt/share/html/Elements/Footer | 19 | ||||
| -rwxr-xr-x | rt/share/html/Elements/Header | 92 | ||||
| -rw-r--r-- | rt/share/html/Elements/MyCalendar | 78 | ||||
| -rwxr-xr-x | rt/share/html/Elements/PageLayout | 12 | ||||
| -rw-r--r-- | rt/share/html/Elements/RT__CustomField/ColumnMap | 4 | ||||
| -rw-r--r-- | rt/share/html/Elements/RT__Ticket/ColumnMap | 19 | ||||
| -rw-r--r-- | rt/share/html/Elements/RefreshHomepage | 6 | ||||
| -rwxr-xr-x | rt/share/html/Elements/SelectDate | 17 | ||||
| -rw-r--r-- | rt/share/html/Elements/ShowCustomFieldDate | 57 | ||||
| -rw-r--r-- | rt/share/html/Elements/ShowLink_Checklist | 36 | ||||
| -rw-r--r-- | rt/share/html/Elements/ShowUserVerbose | 6 |
17 files changed, 596 insertions, 74 deletions
diff --git a/rt/share/html/Elements/AddCustomers b/rt/share/html/Elements/AddCustomers new file mode 100644 index 000000000..aaf8ca8ba --- /dev/null +++ b/rt/share/html/Elements/AddCustomers @@ -0,0 +1,59 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# Copyright (c) 2008 Freeside Internet Services, Inc. +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +<BR> +<%$msg%><br> + +% if (@Customers) { + +<br><i>(Check box to link)<i> +<table> +% foreach my $customer (@Customers) { +<tr> + <td> + <input type="checkbox" name="Object-AddCustomer-<% $customer->{'custnum'} %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>> + <A HREF="<%$freeside_url%>/view/cust_main.cgi?<% $customer->{'custnum'} %>"><% &RT::URI::freeside::small_custview($customer->{'custnum'}, &RT::URI::freeside::FreesideGetConfig('countrydefault'), 1) |n %> + </td> +</tr> +% } +</table> + +% } + +<%INIT> +my ($msg); + +my $freeside_url = &RT::URI::freeside::FreesideURL(); + +warn "/Elements/AddCustomers called with CustomerString $CustomerString\n" + if $Debug; + +my @Customers = (); +if ( $CustomerString ) { + @Customers = &RT::URI::freeside::smart_search( 'search' => $CustomerString ); +} + +my @Services = (); +if ($ServiceString) { + @Services = (); #service_search(); +} + +warn "/Elements/AddCustomers displaying ". scalar(@Customers). " customers\n" + if $Debug; + +</%INIT> + +<%ARGS> +$CustomerString => undef +$ServiceString => undef +$Debug => 0 +</%ARGS> diff --git a/rt/share/html/Elements/CalendarEvent b/rt/share/html/Elements/CalendarEvent new file mode 100644 index 000000000..3a6b00bb8 --- /dev/null +++ b/rt/share/html/Elements/CalendarEvent @@ -0,0 +1,129 @@ +<%args> +$Date => undef +$Object => undef +$DateTypes => undef +</%args> +<div class="tooltip"> +<small> + +% if ($IsReminder and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/reminder.png" /> + +% } elsif ($DateTypes->{Resolved} +% and RTx::Calendar::LocalDate($Object->ResolvedObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/resolved.png" /> + +% } elsif ($DateTypes->{Starts} and $DateTypes->{Due} +% and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today ) { + <img src="<%$RT::WebImagesURL%>/starts_due.png" /> + +% } elsif ($DateTypes->{Due} and $DateTypes->{Created} +% and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today ) { + <img src="<%$RT::WebImagesURL%>/created_due.png" /> + +% } elsif ($DateTypes->{Starts} +% and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/starts.png" /> + +% } elsif ($DateTypes->{Due} +% and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/due.png" /> + +% } elsif ($DateTypes->{Created} +% and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/created.png" /> + +% } elsif ($DateTypes->{Started} +% and RTx::Calendar::LocalDate($Object->StartedObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/started.png" /> + +% } elsif ($DateTypes->{LastUpdated} +% and RTx::Calendar::LocalDate($Object->LastUpdatedObj->Unix) eq $today) { + <img src="<%$RT::WebImagesURL%>/updated.png" /> + +% } + + <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$TicketId%>"> + <% $Object->QueueObj->Name %> #<% $TicketId %> + <% $display_owner ? 'by ' . $Object->OwnerObj->Name : '' %> + <% length($Object->Subject) > 80 ? substr($Object->Subject, 0, 77) . "..." : $Object->Subject %></a></small><br /> + <span class="tip"> + <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$TicketId%>"> + <% $Object->QueueObj->Name %> #<% $TicketId %> + </a> + :</strong> <% $subject%><br /> + <br /> + +%# logic taken from Ticket/Search/Results.tsv +% foreach my $attr (@display_fields) { +% my $value; +% +% if ($attr =~ /(.*)->ISO$/ and $Object->$1->Unix <= 0) { +% $value = '-'; +% } else { +% my $method = '$Object->'.$attr.'()'; +% $method =~ s/->ISO\(\)$/->ISO( Timezone => 'user' )/; +% $value = eval $method; +% if ($@) {die "<b>Check your CalendarPopupFields config in etc/RT_SiteConfig.pm</b>.<br /><br />Failed to find \"$attr\" - ". $@}; +% } + <strong><&|/l&><% $label_of{$attr} %></&>:</strong> <% $value %><br /> +% } + +<br /> + </span> +</div> + +<%init> +use RTx::Calendar; + +my $today = $Date->strftime("%F"); + +my $TicketId; + +my $ticket; +my $subject; +my $IsReminder; + +if ($Object->Type eq 'reminder') { + $IsReminder = 1; + if ($Object->RefersTo->First) { + $ticket = $Object->RefersTo->First->TargetObj; + $TicketId = $ticket->Id; + $subject = $Object->Subject . " (" . $ticket->Subject . ")"; + } +} else { + $TicketId = $Object->Id; + $subject = $Object->Subject; +} + +my $display_owner = $RT::CalendarDisplayOwner; +$display_owner ||= RT->Config->Get('CalendarDisplayOwner') + if RT->can('Config'); + + +# 3.6 config +my @display_fields = @RT::CalendarPopupFields; + +# 3.8 config +# the if condition is weird but it doesn't work with 3.8.0 without the last part +@display_fields = RT->Config->Get('CalendarPopupFields') + if 0 == @display_fields and RT->can('Config') and RT->Config->Get('CalendarPopupFields'); + +# default +if (0 == @display_fields) { + @display_fields = qw(OwnerObj->Name CreatedObj->ISO StartsObj->ISO + StartedObj->ISO LastUpdatedObj->ISO DueObj->ISO + ResolvedObj->ISO Status Priority + Requestors->MemberEmailAddressesAsString); +} + + +my %label_of; +for my $field (@display_fields) { + my $label = $field; + $label =~ s'Obj-.(?:AsString|Name|ISO)''g; + $label =~ s'-\>MemberEmailAddressesAsString''g; + $label_of{$field} = $label; +} + +</%init> diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList index c7bdfd903..4e06e3f0a 100644 --- a/rt/share/html/Elements/CollectionList +++ b/rt/share/html/Elements/CollectionList @@ -123,7 +123,9 @@ if ( $ShowHeader ) { my ($i, $column_map) = (0, {}); while ( my $record = $Collection->Next ) { # Every ten rows, flush the buffer and put something on the page. - $m->flush_buffer unless ++$i % 10; + #broken w/FS, causes rows to be output prematurely + #$m->flush_buffer unless ++$i % 10; + ++$i; my $warning = 0; my $Classes = ''; diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap index a1475a99d..6a1c23779 100644 --- a/rt/share/html/Elements/ColumnMap +++ b/rt/share/html/Elements/ColumnMap @@ -157,7 +157,12 @@ my $COLUMN_MAP = { } qw(WebPath WebBaseURL WebURL)), WebRequestPath => { value => sub { substr( $m->request_path, 1 ) } }, - WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } }, + #WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } }, + WebRequestPathDir => { value => sub { + my $wrpd = substr( $m->request_comp->dir_path, 1 ); + $wrpd =~ s(^rt/)(); #hacky, dunno why this happens + $wrpd; + } }, }; $COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'}; diff --git a/rt/share/html/Elements/EditCustomFieldDate b/rt/share/html/Elements/EditCustomFieldDate new file mode 100644 index 000000000..b6359d7e0 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldDate @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $name = $NamePrefix.$CustomField->Id.'-Values'; +<& /Elements/SelectDate, Name => "$name", ShowTime => 0, current => 0 &> (<%$DateObj->AsString%>) + +<%INIT> +my $DateObj = new RT::Date ( $session{'CurrentUser'} ); +$DateObj->Set( Format => 'ISO', Value => $Default ); +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => 1 +</%ARGS> diff --git a/rt/share/html/Elements/EditCustomers b/rt/share/html/Elements/EditCustomers new file mode 100644 index 000000000..68efb5f40 --- /dev/null +++ b/rt/share/html/Elements/EditCustomers @@ -0,0 +1,63 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# Copyright (c) 2008 Freeside Internet Services, Inc. +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +<TABLE width=100%> + <TR> + <TD VALIGN=TOP WIDTH=50%> + <h3><&|/l&>Current Customers</&></h3> + +<table> + <tr> + <td><i><&|/l&>(Check box to disassociate)</&></i></td> + </tr> + <tr> + <td class="value"> +% foreach my $link ( @{ $Object->Customers->ItemsArrayRef } ) { + + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> +%# <& ShowLink, URI => $link->TargetURI &><br> + <A HREF="<% $link->TargetURI->Resolver->HREF %>"><% $link->TargetURI->Resolver->AsStringLong |n %></A> + <BR> +% } + </td> + </tr> +</table> + +</TD> + +<TD VALIGN=TOP> +<h3><&|/l&>New Customer Links</&></h3> +<&|/l&>Find customer</&><BR> +<input name="CustomerString"> +<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>"> +<br><i>cust #, name, company or phone</i> +<BR> +%#<BR> +%#<&|/l&>Find service</&><BR> +%#<input name="ServiceString"> +%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>"> +%#<br><i>username, username@domain, domain, or IP address</i> +%#<BR> + +<& AddCustomers, Object => $Object, + CustomerString => $CustomerString, + ServiceString => $ServiceString, &> + +</TD> +</TR> +</TABLE> + +<%ARGS> +$CustomerString => undef +$ServiceString => undef +$Object => undef +</%ARGS> diff --git a/rt/share/html/Elements/Footer b/rt/share/html/Elements/Footer index 2fcdee949..59547e238 100755 --- a/rt/share/html/Elements/Footer +++ b/rt/share/html/Elements/Footer @@ -48,25 +48,6 @@ %# End of div#body from /Elements/PageLayout </div> % $m->callback( %ARGS ); -<div id="footer"> -% if ($m->{'rt_base_time'}) { - <p id="time"> - <span><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></span> - </p> -%} - <p id="bpscredits"> - <span> -<&|/l, '»|«', $RT::VERSION, '2009', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&> -</span> -</p> -% if (!$Menu) { - <p id="legal"> -<&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br /> -<&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br /> - </p> -% } - -</div> % if ($Debug >= 2 ) { % require Data::Dumper; % my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header index 953efcb22..d970ac52f 100755 --- a/rt/share/html/Elements/Header +++ b/rt/share/html/Elements/Header @@ -45,61 +45,67 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<% include( '/elements/header.html', { + 'title' => $Title, + 'head' => $head, + 'etc' => $etc, + 'nobr' => 1, + 'nocss' => 1, + }) |n +%> +<%INIT> +$r->headers_out->{'Pragma'} = 'no-cache'; +$r->headers_out->{'Cache-control'} = 'no-cache'; -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> -<title><%$Title%></title> +my $id = $m->request_comp->path; +$id =~ s|^/||g; +$id =~ s|/|-|g; +$id =~ s|\.html$||g; +$id =~ s|index$||g + if $id ne 'index'; +$id =~ s|-$||g; +my $head = ''; -% if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) { - <meta http-equiv="refresh" content="<% $Refresh %>" /> -% } +if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) { + $head .= '<meta http-equiv="refresh" content="$Refresh" />'; +} -<link rel="shortcut icon" href="<%RT->Config->Get('WebImagesURL')%>/favicon.png" type="image/png" /> -<link rel="stylesheet" href="<%RT->Config->Get('WebPath')%>/NoAuth/css/<% RT->Config->Get( 'WebDefaultStylesheet', $session{'CurrentUser'} ) %>/main<% RT->Config->Get('DevelMode')? '' : '-squished' %>.css" type="text/css" media="all" /> -<link rel="stylesheet" href="<%RT->Config->Get('WebPath')%>/NoAuth/css/print.css" type="text/css" media="print" /> +my $WebPath = RT->Config->Get('WebPath'); +my $WebImagesURL = RT->Config->Get('WebImagesURL'); +my $WebDefaultStylesheet = + RT->Config->Get('WebDefaultStylesheet', $session{'CurrentUser'}); +my $squished = RT->Config->Get('DevelMode') ? '' : '-squished'; -% for (keys %{$LinkRel || {}}) { - <link rel="<% $_ %>" href="<% RT->Config->Get('WebPath') . $LinkRel->{$_} %>" /> -% } +$head .= <<END; +<link rel="shortcut icon" href="$WebImagesURL/favicon.png" type="image/png" /> +<link rel="stylesheet" href="$WebPath/NoAuth/css/$WebDefaultStylesheet/main$squished.css" type="text/css" media="all" /> +<link rel="stylesheet" href="$WebPath/NoAuth/css/print.css" type="text/css" media="print" /> +END -% if ( $RSSAutoDiscovery ) { - <link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" /> -% } +for (keys %{$LinkRel || {}}) { + $head .= qq(<link rel="$_" href="$WebPath) . $LinkRel->{$_} . '" />'; +} -% if ($JavaScript) { -<& HeaderJavascript, focus => $Focus, onload => $onload &> -% } +if ( $RSSAutoDiscovery ) { + $head .= qq(<link rel="alternate" href="$RSSAutoDiscovery" type="application/rss+xml" title="RSS RT Search" />); +} -% my $stylesheet_plugin = "/NoAuth/css/". RT->Config->Get( 'WebDefaultStylesheet', $session{'CurrentUser'} )."/InHeader"; -% if ($m->comp_exists($stylesheet_plugin) ) { -<& $stylesheet_plugin &> -% } -% $m->callback( %ARGS, CallbackName => 'Head' ); +if ($JavaScript) { + $head .= $m->scomp('HeaderJavascript', focus => $Focus, onload => $onload); +} -</head> - <body<% $id && qq[ id="comp-$id"] |n %>> +my $stylesheet_plugin = "/NoAuth/css/$WebDefaultStylesheet/InHeader"; +if ($m->comp_exists($stylesheet_plugin) ) { + $head .= $m->scomp($stylesheet_plugin); +} -% if ($ShowBar) { -<& /Elements/Logo, %ARGS &> +# $m->callback( %ARGS, CallbackName => 'Head' ); +$head .= $m->scomp( '/Elements/Callback', _CallbackName => 'Head', %ARGS ); -<div id="quickbar"> - <& /Elements/PersonalQuickbar, %ARGS &> -% } +my $etc = ''; +$etc .= qq[ id="comp-$id"] if $id; -<%INIT> -$r->headers_out->{'Pragma'} = 'no-cache'; -$r->headers_out->{'Cache-control'} = 'no-cache'; - -my $id = $m->request_comp->path; -$id =~ s|^/||g; -$id =~ s|/|-|g; -$id =~ s|\.html$||g; -$id =~ s|index$||g - if $id ne 'index'; -$id =~ s|-$||g; </%INIT> <%ARGS> diff --git a/rt/share/html/Elements/MyCalendar b/rt/share/html/Elements/MyCalendar new file mode 100644 index 000000000..a54ab39d6 --- /dev/null +++ b/rt/share/html/Elements/MyCalendar @@ -0,0 +1,78 @@ +<&|/Widgets/TitleBox, + title => loc("Calendar"), + title_href => "Search/Calendar.html" &> + +<table class="rtxcalendar"> +<thead> +<tr> +% my $date = $begin->clone; +% while ( $date <= $end ) { +<th width="14%"><%$rtdate->GetWeekday($date->day_of_week % 7)%></th> +% $date = $set->next($date); +% } +</tr> +</thead> +<tbody> +<tr> +% $date = $begin->clone; +% while ($date <= $end) { +<td> +<p class="date"><%$date->day%></p> +% for my $t (@{ $Tickets{$date->strftime("%F")} }) { +<& /Elements/CalendarEvent, Object => $t, Date => $date, DateTypes => \%DateTypes &> +% } +</td> +% $date = $set->next($date); +% } +</tr> +</tbody> +</table> + + </&> + +<%INIT> + +use RTx::Calendar; + +my $title = loc("Calendar"); + +my $rtdate = RT::Date->new($session{'CurrentUser'}); + +my @DateTypes = qw/Created Starts Started Due LastUpdated Resolved/; + +my $today = DateTime->today; + +# this line is used to debug MyCalendar +# $today = DateTime->new(year => 2007, month => 4, day => 11); + +my $begin = $today->clone->subtract( days => 3); +my $end = $today->clone->add( days => 3); + +# use this to loop over days until $end +my $set = DateTime::Set->from_recurrence( + next => sub { $_[0]->truncate( to => 'day' )->add( days => 1 ) } +); + +my $Query = "( Status = 'new' OR Status = 'open' OR Status = 'stalled') + AND ( Owner = '" . $session{CurrentUser}->Id ."' OR Owner = 'Nobody' ) + AND ( Type = 'reminder' OR 'Type' = 'ticket' )"; +my $Format = "__Starts__ __Due__"; + +if ( my $Search = RTx::Calendar::SearchDefaultCalendar($session{CurrentUser}) ) { + $Format = $Search->SubValue('Format'); + $Query = $Search->SubValue('Query'); +} + +# we search all date types in Format string +my @Dates = grep { $Format =~ m/__${_}(Relative)?__/ } @DateTypes; + +# used to display or not a date in Element/CalendarEvent +my %DateTypes = map { $_ => 1 } @Dates; + +$Query .= RTx::Calendar::DatesClauses(\@Dates, $begin->strftime("%F"), $end->strftime("%F")); + +# print STDERR $Query, "\n"; + +my %Tickets = RTx::Calendar::FindTickets($session{'CurrentUser'}, $Query, \@Dates); + +</%INIT> diff --git a/rt/share/html/Elements/PageLayout b/rt/share/html/Elements/PageLayout index 981e58a3c..f30d815a5 100755 --- a/rt/share/html/Elements/PageLayout +++ b/rt/share/html/Elements/PageLayout @@ -45,23 +45,27 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} + +<% include('/elements/init_calendar.html') |n %> + +% if (0) { ## new ticket via customer, and we already have a ticket search box <div id="topactions"> % foreach my $action (reverse sort keys %{$topactions}) { <span class="topaction" id="topaction-<%$action%>"><% $topactions->{"$action"}->{'html'} |n %></span> % } </div> +% } -%# End of div#quickbar from /Elements/Header -</div> - +% if (0) { ##FREESIDE MENUS INSTEAD## if ( $show_menu ) { % if ( $show_menu ) { <div id="nav"> <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> </div> % } +% } <div id="header"> -<h1><% $title %></h1> +%#already shown <h1><% $title %></h1> <div id="page-navigation"> % my $sep = 0; % my $postsep = 0; diff --git a/rt/share/html/Elements/RT__CustomField/ColumnMap b/rt/share/html/Elements/RT__CustomField/ColumnMap index 6d8d76a4c..0a867eb26 100644 --- a/rt/share/html/Elements/RT__CustomField/ColumnMap +++ b/rt/share/html/Elements/RT__CustomField/ColumnMap @@ -155,7 +155,9 @@ my $COLUMN_MAP = { : ($args->{'PassArguments'}); my %pass = map { $_ => $args->{$_} } grep exists $args->{$_}, @pass; - my $uri = RT->Config->Get('WebPath') . $m->request_path; + my $path = $m->request_path; + $path =~ s(^/rt)(); #hacky, dunno why this happens + my $uri = RT->Config->Get('WebPath') . $path; my @res = ( \'<a href="', diff --git a/rt/share/html/Elements/RT__Ticket/ColumnMap b/rt/share/html/Elements/RT__Ticket/ColumnMap index c1f9e319a..e848939e1 100644 --- a/rt/share/html/Elements/RT__Ticket/ColumnMap +++ b/rt/share/html/Elements/RT__Ticket/ColumnMap @@ -313,6 +313,25 @@ $COLUMN_MAP = { return \$bookmark; }, }, + + Customer => { + title => 'Customer', #loc + attribute => 'Customer', #title/attribute/name... what does it all mean? + value => sub { + my $Ticket = shift; + my @Customers = @{ $Ticket->Customers->ItemsArrayRef }; + my @CustResolvers = map $_->TargetURI->Resolver, @Customers; + my @return = (); + for ( 0 .. $#CustResolvers ) { + my $c = @CustResolvers[$_]; + push @return, \'<A HREF="', $c->HREF, \'">', $c->AsString, \'</A>'; + push @return, \'<BR>' if scalar(@CustResolvers) > 1 + && $_ != $#CustResolvers; + } + @return; + }, + }, + }; # if no GPG support, then KeyOwnerName and KeyRequestors fall back to the regular diff --git a/rt/share/html/Elements/RefreshHomepage b/rt/share/html/Elements/RefreshHomepage index bf91a9522..7840f59cc 100644 --- a/rt/share/html/Elements/RefreshHomepage +++ b/rt/share/html/Elements/RefreshHomepage @@ -46,9 +46,13 @@ %# %# END BPS TAGGED BLOCK }}} <&|/Widgets/TitleBox, title => loc('Refresh')&> -<form method="get" action="<% RT->Config->Get('WebPath') . $m->request_path %>"> +<form method="get" action="<% RT->Config->Get('WebPath') . $path %>"> <& /Elements/Refresh, Name => 'HomeRefreshInterval', Default => $session{'home_refresh_interval'}||RT->Config->Get('HomePageRefreshInterval', $session{'CurrentUser'}) &> <& /Elements/Submit, Label => loc('Go!') &> </&> </form> +<%init> +my $path = $m->request_path; +$path =~ s(^/rt)(); #hacky, dunno why this happens +</%init> diff --git a/rt/share/html/Elements/SelectDate b/rt/share/html/Elements/SelectDate index 32a173db4..46092ce23 100755 --- a/rt/share/html/Elements/SelectDate +++ b/rt/share/html/Elements/SelectDate @@ -45,10 +45,21 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<script type="text/javascript"><!-- - onLoadHook('createCalendarLink("<% $Name %>");'); ---></script> +%# in PageLayout instead, once <% include('/elements/init_calendar.html') |n %> <input type="text" id="<% $Name %>" name="<% $Name %>" value="<% $Value %>" size="<% $Size %>" /> +<IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $Name %>_date_button" STYLE="cursor: pointer" TITLE="Select date"> +<script type="text/javascript"> +Calendar.setup({ + inputField: <% $Name |n,js_string %>, +% if ( defined($ShowTime) && $ShowTime ) { + ifFormat: "%Y-%m-%d %H:%M", + showsTime: true, +% } else { + ifFormat: "%Y-%m-%d", +% } + button: <% $Name.'_date_button' |n,js_string %>, +}); +</script> <%init> unless ((defined $Default) or ($current <= 0)) { diff --git a/rt/share/html/Elements/ShowCustomFieldDate b/rt/share/html/Elements/ShowCustomFieldDate new file mode 100644 index 000000000..4e8ad676c --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFieldDate @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> + my $content = $Object->Content; + my $DateObj = new RT::Date ( $session{'CurrentUser'} ); + $DateObj->Set( Format => 'ISO', Value => $content ); + $content = $DateObj->AsString; +</%INIT> +<%$content|n%> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/share/html/Elements/ShowLink_Checklist b/rt/share/html/Elements/ShowLink_Checklist new file mode 100644 index 000000000..945305fb6 --- /dev/null +++ b/rt/share/html/Elements/ShowLink_Checklist @@ -0,0 +1,36 @@ +<a href="<%$URI->Resolver->HREF%>"> +% if ($URI->IsLocal) { +% my $member = $URI->Object; +% if (UNIVERSAL::isa($member, "RT::Ticket")) { +% my $inactive = 0; #$member->QueueObj->IsInactiveStatus($member->Status); + +<span class="<% $inactive ? 'ticket-inactive' : '' %>"> +<IMG SRC="<%$fsurl%>images/<% $status2image{$member->Status} %>.png" BORDER=0> +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +%# [<% loc($member->Status) %>] +</span> + +% } elsif ( UNIVERSAL::can($member, 'Name')) { +<%$URI->Resolver->AsString%>: <%$member->Name%> +% } else { +<%$URI->Resolver->AsString%> +% } +% } else { +<%$URI->Resolver->AsString%> +% } +</a> +<%ARGS> +$URI => undef +</%ARGS> +<%once> + +my %status2image = ( + 'new' => 'square_add', #'bullet_add', + 'open' => 'square', #'bullet_black', + 'stalled' => 'error', + 'resolved' => 'tick', + 'rejected' => 'cross', + #'deleted' => 'delete', +); + +</%once> diff --git a/rt/share/html/Elements/ShowUserVerbose b/rt/share/html/Elements/ShowUserVerbose index 82d65b0b3..9b61ea74a 100644 --- a/rt/share/html/Elements/ShowUserVerbose +++ b/rt/share/html/Elements/ShowUserVerbose @@ -46,7 +46,11 @@ %# %# END BPS TAGGED BLOCK }}} %# Released under the terms of version 2 of the GNU Public License -<%$Address->format%>\ +% if ( $Address->phrase || $Address->comment ) { +<% sprintf q{%s <%s> %s}, map $Address->$_, qw( phrase address comment ) %> +% } else { +<% $Address->address %> +% } <%INIT> my ($phrase, $address, $comment); |
