[rt-users] Upgrading RT 3.4.2 -> 3.8 users' home pages

Tim Cutts tjrc at sanger.ac.uk
Sat Jul 19 04:31:33 EDT 2008


On 19 Jul 2008, at 8:51 am, Tim Cutts wrote:

> I'm upgrading a copy of our production database, so that I can work  
> out what I'm going to need to do to upgrade the production version  
> eventually.
>
> So far, I have got RT up and working, imported a dump of the  
> production database, and upgraded the schema (using rt-setup- 
> database --action upgrade, and then applying the MySQL c 4.0->4.1  
> changes -- the latter step took a long time; more than 12 hours on  
> our database)
>
> Once it was complete, I discovered that because the home page is now  
> configured on a per-user basis, none of the users have anything  
> displayed in their home page, and would need to go to preferences to  
> set it up.
>
> Is "RT at a glance" not configured somewhere centrally with a  
> default?  If not, how do I add a default layout to all my users (of  
> whom I have a couple of thousand, so doing this manually is *not* an  
> option)
>
> Related to this:  there doesn't seem to be a MyRequests type panel  
> the users can choose in their home page.   In our old version of RT,  
> this was done with a local set of HTML elements in the home page,  
> but clearly that's not the right approach now.  Should I create a  
> global saved search that does it, and then add that to all the  
> default "RT at a glance" that he users will get?

No sooner have I asked the question, than I answer part of it myself;  
there is of course a new global config option for setting the default  
RT-at-a-glance.  The trouble is, for me it doesn't work.  I get:

Can't call method "Content" on an undefined value at /itch/rt-3.8.0/ 
share/html/Admin/Global/MyRT.html line 97.

So, it looks to me as though during the schema update, some important  
default data didn't get put into the database.  Looks like 3.5.1  
content patch did not go in properly.  Adding it by hand has resolved  
the problem.  Now I'm down to reapplying some of my old changes, and  
I'm a bit stuck.  In RT 3.4.2 I overrode the default "newest unowned  
tickets" box to list only tickets for which the user had the  
'SeeQueue' right (we have over fifty queues for different purposes,  
and we don't want everyone to see everything).  I did it with a local  
Element:

<&|/Elements/TitleBox,
         title => loc("[_1] newest unowned tickets", $rows),
         title_href => "Search/Results.html".$QueryString &>
<& /Elements/TicketList,
         Format => "'<a href=\"$RT::WebPath/Ticket/Display.html? 
id=__id__\">__id__</a>/TITLE:#', '<a href=\"$RT::WebPath/Tic
ket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject',  
QueueName, ExtendedStatus, CreatedRelative, '<A HREF=\"$RT::We
bPath/Ticket/Display.html?Action=Take&id=__id__\">".loc('Take')."</a>/ 
TITLE: ' ",
         Query => $Query,
         OrderBy => 'Created',
         Order => 'DESC',
         ShowNavigation => 0,
         Rows => $rows

         &>
</&>
<%init>
my $rows = $RT::MyRequestsLength;

my $q = new RT::Queues($session{'CurrentUser'});
$q->UnLimit;

my @queues;

while (my $queue = $q->Next) {
   if ($queue->CurrentUserHasRight('SeeQueue') &&
       $queue->CurrentUserHasRight('TakeTicket')) {
     push(@queues, "Queue = \'" . $queue->Name ."\'");
   }
}

my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')";

if (@queues) {
   $Query .= ' AND (' . join(' OR ', @queues ) . ')';
}

my $QueryString = '?' . $m->comp('/Elements/QueryString',
             Query => $Query,
             Order => 'DESC',
             OrderBy => 'Priority') if ($Query);

</%init>


How do I create a new portlet with the same functionality using the  
new database system?  Or am I approaching this the wrong way, and  
maybe there's something I can do in the access rights part of RT to  
achieve the same thing?

Many thanks...

Tim


-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the rt-users mailing list