[Rt-commit] [svn] r1057 - in RT-Journal: . trunk trunk/etc
trunk/html/Journal trunk/html/Journal/Elements
trunk/html/Journal/User
jesse at pallas.eruditorum.org
jesse at pallas.eruditorum.org
Sat Jun 12 13:57:01 EDT 2004
Author: jesse
Date: Sat Jun 12 13:57:00 2004
New Revision: 1057
Added:
RT-Journal/trunk/etc/
RT-Journal/trunk/etc/initialdata
RT-Journal/trunk/html/Journal/Elements/AsRss
RT-Journal/trunk/html/Journal/Elements/_SetDefaults
RT-Journal/trunk/html/Journal/autohandler
Modified:
RT-Journal/ (props changed)
RT-Journal/trunk/META.yml
RT-Journal/trunk/html/Journal/Article.html
RT-Journal/trunk/html/Journal/Elements/BlogAsHTML
RT-Journal/trunk/html/Journal/Elements/BlogAsRSS
RT-Journal/trunk/html/Journal/Post.html
RT-Journal/trunk/html/Journal/Show.html
RT-Journal/trunk/html/Journal/User/dhandler
RT-Journal/trunk/html/Journal/index.html
Log:
----------------------------------------------------------------------
r1790 at debian: jesse | 2004-06-13T03:00:31.074689Z
A whole slew of cleanups. better initial configuration (including queue and acl setup)
----------------------------------------------------------------------
Modified: RT-Journal/trunk/META.yml
==============================================================================
--- RT-Journal/trunk/META.yml (original)
+++ RT-Journal/trunk/META.yml Sat Jun 12 13:57:00 2004
@@ -6,6 +6,7 @@
distribution_type: module
no_index:
directory:
+ - etc
- html
- inc
generated_by: Module::Install version 0.33
Added: RT-Journal/trunk/etc/initialdata
==============================================================================
--- (empty file)
+++ RT-Journal/trunk/etc/initialdata Sat Jun 12 13:57:00 2004
@@ -0,0 +1,63 @@
+my $queue = ( $RT::JournalQueue || 'RT::Journal');
+
+ at Queues = ( {Name => $queue,
+ Description => 'Queue for user journal entries',
+ Disabled => 2});
+
+ at CustomFields = ( { Queue => $queue,
+ Name => 'RT::Journal-Category',
+ Type => 'FreeformSingle' }
+
+ );
+
+ at Users = ( { Name => 'RT::Journal-Guest',
+ Privileged => 0 } );
+
+
+ at Scrips = (
+
+ { Queue => $queue,
+ ScripCondition => 'On Correspond',
+ ScripAction => 'Notify Owner',
+ Template => 'Correspondence',
+ }
+ );
+
+ at ACL = (
+ {
+ Queue => $queue,
+ GroupDomain => 'RT::Queue-Role',
+ GroupType => 'Owner',
+ Right => 'CreateTicket'
+
+ },
+
+ {
+ Queue => $queue,
+ GroupDomain => 'RT::Queue-Role',
+ GroupType => 'Owner',
+ Right => 'ModifyTicket'
+
+ },
+
+
+ {
+ Queue => $queue,
+ GroupDomain => 'SystemInternal',
+ GroupType => 'Everyone',
+ Right => 'ShowTicket'
+
+ },
+
+
+ {
+ Queue => $queue,
+ GroupDomain => 'SystemInternal',
+ GroupType => 'Everyone',
+ Right => 'ReplyToTicket'
+
+ },
+
+
+
+ );
Modified: RT-Journal/trunk/html/Journal/Article.html
==============================================================================
--- RT-Journal/trunk/html/Journal/Article.html (original)
+++ RT-Journal/trunk/html/Journal/Article.html Sat Jun 12 13:57:00 2004
@@ -7,13 +7,13 @@
my @Actions;
if ( $ARGS{'id'} eq 'new' ) { # new ticket?
my $q = RT::Queue->new( $session{'CurrentUser'} );
- $q->Load('Journal');
+ $q->Load($RT::JournalQueue);
$ARGS{'Queue'} = $q->id;
$ARGS{'Owner'} = $session{'CurrentUser'}->id;
$ARGS{'Status'} = 'new';
my $cat = RT::CustomField->new( $session{'CurrentUser'} );
- $cat->LoadByNameAndQueue( Queue => $q->Id, Name => 'Category');
+ $cat->LoadByNameAndQueue( Queue => $q->Id, Name => 'RT::Journal-Category');
$ARGS{ 'CustomField-' . $cat->Id } = $ARGS{'Category'};
@@ -35,7 +35,7 @@
<h1> <%$post->Subject%> </h1>
( <%$post->CreatedObj->AsString%>)<br>
-<%$post->FirstCustomFieldValue('Category')%>
+<%$post->FirstCustomFieldValue('RT-Journal::Category')%>
<br>
<%perl>
my $content = $post->Transactions->First->Content;
Added: RT-Journal/trunk/html/Journal/Elements/AsRss
==============================================================================
--- (empty file)
+++ RT-Journal/trunk/html/Journal/Elements/AsRss Sat Jun 12 13:57:00 2004
@@ -0,0 +1,52 @@
+<%ARGS>
+$User => undef
+$Before => undef
+$After => undef
+$Count => 25
+</%ARGS>
+<%INIT>
+
+my @Query;
+push ( @Query, "Queue = '__Journal')");
+push ( @Query, "Creator = '$User'" ) if ($User);
+push ( @Query, "Created >= '$After'" ) if ($After);
+push ( @Query, "Created <= '$Before'" ) if ($Before);
+
+my $Query = join ( " AND ", @Query );
+
+my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
+$Tickets->FromSQL($Query);
+$Tickets->RowsPerPage($Count);
+$r->content_type('xml/rss');
+
+# create an RSS 1.0 file (http://purl.org/rss/1.0/)
+use XML::RSS;
+my $rss = new XML::RSS( version => '1.0' );
+$rss->channel(
+ title => "$RT::rtname: Journal Entries",
+ link => $RT::WebURL,
+ description => "",
+ dc => {},
+ syn => {
+ updatePeriod => "hourly",
+ updateFrequency => "1",
+ updateBase => "1901-01-01T00:00+00:00",
+ },
+);
+
+while ( my $Ticket = $Tickets->Next() ) {
+ my $row;
+ $rss->add_item(
+ title => $Ticket->Subject,
+ link => $RT::WebURL . "/Journal/Entry.html?id=" . $Ticket->id,
+ description => $Ticket->Transactions->First->Content,
+ dc => {
+ subject => $Ticket->Subject,
+ creator => $Ticket->CreatorObj->RealName . "<"
+ . $Ticket->CreatorObj->EmailAddress . ">",
+ },
+ );
+}
+$m->out( $rss->as_string );
+$m->abort();
+</%INIT>
Modified: RT-Journal/trunk/html/Journal/Elements/BlogAsHTML
==============================================================================
--- RT-Journal/trunk/html/Journal/Elements/BlogAsHTML (original)
+++ RT-Journal/trunk/html/Journal/Elements/BlogAsHTML Sat Jun 12 13:57:00 2004
@@ -1,7 +1,7 @@
<& Header, User => $User &>
<div class="blog">
%while( my $post = $EntriesObj->Next) {
-% my $my_category = $post->FirstCustomFieldValue('Category');
+% my $my_category = $post->FirstCustomFieldValue('RT::Journal-Category');
<div class="blog-header">
<h2 class="date"><%$post->CreatedObj->AsString%></h2><br>
<h3 class="title"><%$post->Subject|| loc('Untitled')%></h3>
Modified: RT-Journal/trunk/html/Journal/Elements/BlogAsRSS
==============================================================================
--- RT-Journal/trunk/html/Journal/Elements/BlogAsRSS (original)
+++ RT-Journal/trunk/html/Journal/Elements/BlogAsRSS Sat Jun 12 13:57:00 2004
@@ -1,9 +1,6 @@
<%flags>
inherit => undef
</%flags>
-<%init>
-#return if ($m->cache_self([expires_in => '1 hour']));
-</%init>
<?xml version="1.0"?>
<rss version="0.92" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
<channel>
@@ -13,7 +10,7 @@
%while( my $post = $EntriesObj->Next) {
-% my $my_category = $post->FirstCustomFieldValue('Category');
+% my $my_category = $post->FirstCustomFieldValue('RT-Journal::Category');
<item>
<link><&Attr, Name=>'BaseURL', User=> $User&>/Entry/<%$post->id%></link>
<title><%$post->Subject|| loc('Untitled')%></title>
Added: RT-Journal/trunk/html/Journal/Elements/_SetDefaults
==============================================================================
--- (empty file)
+++ RT-Journal/trunk/html/Journal/Elements/_SetDefaults Sat Jun 12 13:57:00 2004
@@ -0,0 +1,4 @@
+<%init>
+$RT::JournalQueue ||= 'RT::Journal';
+return();
+</%init>
Modified: RT-Journal/trunk/html/Journal/Post.html
==============================================================================
--- RT-Journal/trunk/html/Journal/Post.html (original)
+++ RT-Journal/trunk/html/Journal/Post.html Sat Jun 12 13:57:00 2004
@@ -11,7 +11,7 @@
<&|/l&>Subject</&>:
<INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="<%$ARGS{Subject} || ''%>"><br>
<&|/l&>Category</&>:<& Elements/SelectCategory &><br>
-<&|/l&>Attach:</&>: <INPUT TYPE=FILE NAME="Attach"><br>
+%# <&|/l&>Attach</&>: <INPUT TYPE=FILE NAME="Attach"><br>
<&|/l&>Content</&>:<br>
<& /Elements/MessageBox, Default => $ARGS{Content} &>
@@ -35,6 +35,6 @@
$ARGS{'Status'} = 'new';
my $cat = RT::CustomField->new($session{'CurrentUser'});
-$cat->LoadByNameAndQueue(Queue => $q->Id, Name => 'Category');
+$cat->LoadByNameAndQueue(Queue => $q->Id, Name => 'RT::Journal-Category');
</%INIT>
Modified: RT-Journal/trunk/html/Journal/Show.html
==============================================================================
--- RT-Journal/trunk/html/Journal/Show.html (original)
+++ RT-Journal/trunk/html/Journal/Show.html Sat Jun 12 13:57:00 2004
@@ -44,13 +44,13 @@
<hr>
<%INIT>
my $q = RT::Queue->new($RT::SystemUser);
-$q->Load('Journal');
+$q->Load($RT::JournalQueue);
my $cat = RT::CustomField->new($RT::SystemUser);
$cat->LoadByNameAndQueue(Name => 'Category', Queue => $q->Id);
my $tix = RT::Tickets->new($session{'CurrentUser'});
-$tix->LimitQueue(VALUE => 'Journal');
+$tix->LimitQueue(VALUE => $RT::JournalQueue);
$tix->OrderBy(FIELD=>'Created', ORDER => 'DESC');
if ($user) {
$tix->LimitOwner(VALUE => $user);
Modified: RT-Journal/trunk/html/Journal/User/dhandler
==============================================================================
--- RT-Journal/trunk/html/Journal/User/dhandler (original)
+++ RT-Journal/trunk/html/Journal/User/dhandler Sat Jun 12 13:57:00 2004
@@ -6,6 +6,8 @@
inherit => 0
</%flags>
<%init>
+$m->comp('../Elements/_SetDefaults');
+
my $argument = $m->dhandler_arg;
my $username;
my $category;
@@ -54,10 +56,10 @@
my $guest_user = RT::CurrentUser->new('guest');
my $q = RT::Queue->new($RT::SystemUser);
-$q->Load('Journal');
+$q->Load($RT::JournalQueue);
my $cat = RT::CustomField->new($RT::SystemUser);
-$cat->LoadByNameAndQueue(Name => 'Category', Queue => $q->Id);
+$cat->LoadByNameAndQueue(Name => 'RT::Journal-Category', Queue => $q->Id);
my $tix = RT::Tickets->new($guest_user);
$tix->LimitQueue(VALUE => 'Journal');
Added: RT-Journal/trunk/html/Journal/autohandler
==============================================================================
--- (empty file)
+++ RT-Journal/trunk/html/Journal/autohandler Sat Jun 12 13:57:00 2004
@@ -0,0 +1,4 @@
+<%init>
+$m->comp('Elements/_SetDefaults');
+$m->call_next(%ARGS);
+</%init>
Modified: RT-Journal/trunk/html/Journal/index.html
==============================================================================
--- RT-Journal/trunk/html/Journal/index.html (original)
+++ RT-Journal/trunk/html/Journal/index.html Sat Jun 12 13:57:00 2004
@@ -1,22 +1,3 @@
<& Elements/Tabs &>
<%INIT>
-my $QueueName = 'Journals';
-my $QueueDescription = 'Personal Journal'; # loc
-
-my $queue = RT::Queue->new($session{'CurrentUser'});
-
-my ($ok, $msg) = $queue->Load($QueueName);
-
-unless ($ok) {
- my $new_entry = RT::Queue->new($RT::SystemUser);
- my ( $return, $msg ) = $new_entry->Create(
- Name => $QueueName,
- Description => $QueueDescription,
- Disabled => 1,
- );
-
- $queue->Load($QueueName);
-
- # XXX - set up ACL
-}
</%INIT>
More information about the Rt-commit
mailing list