On Fri, 2006-10-06 at 11:03 -0700, Dale Bewley wrote:
> RT 3.6.1.
> I've changed my default search results to include some custom fields by
> modifying $DefaultSearchResultFormat in RT_SiteConfig.pm.
> 
> Additionally, I want to change the default format on the at a glance
> page to include these fields. I found this page
> http://wiki.bestpractical.com/index.cgi?ChangeDefaultRTAtAGlance
> which is about what is displayed on the page rather than how.
> 
> So, I tried to assume and extrapolate like this:
> 
> The default search formats are apparently stored in the Attributes table
> and created by RT_System i.e. Creator = 1.
> 
> mysql> select id, name, description from Attributes where Creator = 1;
> +----+--------------------------+-------------------------------------+
> | id | name                     | description                         |
> +----+--------------------------+-------------------------------------+
> | 19 | Search - My Tickets      | [_1] highest priority tickets I own |
> | 20 | Search - Unowned Tickets | [_1] newest unowned tickets         |
> | 21 | HomepageSettings         | HomepageSettings                    |
> +----+--------------------------+-------------------------------------+
> 
> As user 104, I customized the search results to my satisfaction.
> 
> mysql> select id, name, description from Attributes where Creator = 104;
> +----+-----------------------+-------------+
> | id | name                  | description |
> +----+-----------------------+-------------+
> | 22 | Pref-RT::Attribute-19 | NULL        |
> | 23 | Pref-SummaryRows      | NULL        |
> | 25 | Pref-HomepageSettings | NULL        |
> | 26 | Pref-RT::Attribute-20 | NULL        |
> +----+-----------------------+-------------+
> 
> I then updated the default searches with the content of my customized
> search.
> 
> mysql> update Attributes set Content = 'BQcDAAAABBc...' where id = 19;
> Query OK, 1 row affected (0.04 sec)
> Rows matched: 1  Changed: 1  Warnings: 0
> 
> mysql> update Attributes set Content = 'BQcDAAAABBcPQ...' where id = 20;
> Query OK, 1 row affected (0.04 sec)
> Rows matched: 1  Changed: 1  Warnings: 0
> 
> But now, the at a glance results are all blank. Is there a better way to
> do this, or at least a tweak to this method?

Well, apparently there is not yet an ordained method for this. :)
I did find out why the results are blank.

If I modify Elements/ShowSearch to Data::Dumper the $search->Content
hash, I can see that the content from my record does not contain a query
value unlike the content in the default record  #20.

Mine:
$VAR1 = {
          'Order' => 'ASC|ASC|ASC|ASC',
          'OrderBy' => 'id',
          'Format' => '\'<a 
href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#\',
\'<a 
href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject\',
\'__CustomField.{Department}__/TITLE:Dept\',
\'__CustomField.{SubQueue}__/TITLE:Area\',
\'<Small>__QueueName__</Small>\',
\'<Small>__CreatedRelative__</Small>\',
\'<A 
HREF="__WebPath__/Ticket/Display.html?Action=Take&id=__id__">__loc(Take)__</a>/TITLE:&nbsp;
 \'',
          'RowsPerPage' => '0'
        };

Default:
$VAR1 = {
          'Order' => 'DESC',
          'Query' => ' Owner = \'Nobody\' AND ( Status = \'new\' OR Status = 
\'open\')',
          'OrderBy' => 'Created',
          'Format' => '\'<a 
href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#\', \'<a 
href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject\',
 QueueName, ExtendedStatus, CreatedRelative, \'<A 
HREF="__WebPath__/Ticket/Display.html?Action=Take&id=__id__">__loc(Take)__</a>/TITLE:&nbsp;\'
 '
        };

So, I guess if I can hack together some code  to build a suitable hash
then nfreeze and base64 encode it (as seen in Attribute.pm), I'll have a
string that will fit. 

I tried to decode the content field on the cmd line and got a Storable
module error:
Storable binary image v33.81 more recent than I am (v2.7)
at ../../lib/Storable.pm (autosplit
into ../../lib/auto/Storable/thaw.al) line 366

I assume this means there's some difference in Storable.pm as seen by
mod_perl versus perl and that I'll have to do this freezing inside
Mason.

Hints happily accepted.
-- 
Dale Bewley - Unix Administrator - Shields Library - UC Davis
GPG: 0xB098A0F3 0D5A 9AEB 43F4 F84C 7EFD  1753 064D 2583 B098 A0F3

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to