Software Freedom Law Center

Changeset 11

Show
Ignore:
Timestamp:
01/14/06 02:44:09 (3 years ago)
Author:
orion
Message:


Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rt-test.pl

    r9 r11  
    11#!/usr/bin/perl -w 
    2 # Copyright 2005 Software Freedom Law Center, Inc. 
     2# Copyright (C) 2005, 2006   Software Freedom Law Center, Inc. 
     3# Author: Orion Montoya <orion@mdcclv.com> 
    34# 
    4 # This program is free software: you may copy, modify, or redistribute it 
    5 # and/or modify it under either: 
     5# This software gives you freedom; it is licensed to you under version 
     6# 3 of the GNU Affero General Public License, along with the 
     7# additional permission in the following paragraph. 
    68# 
    7 #  (a) the terms of the GNU Affero General Public License as published by 
    8 #      the Free Software Foundation, either version 3 of the License, or 
    9 #      (at your option) any later version. 
    10 #    or 
    11 #  (b) the terms of the GNU General Public license, version 2, as 
    12 #      published by the Free Software Foundation. 
    13 
    14 # This program is distributed in the hope that it will be useful, but 
    15 # WITHOUT ANY WARRANTY; without even the implied warranty of 
    16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero 
    17 # General Public License and/or GNU General Public License for more 
     9# This notice constitutes a grant of such permission as is necessary 
     10# to combine or link this software, or a modified version of it, with 
     11# Request Tracker (RT), published by Jesse Vincent and Best Practical 
     12# Solutions, LLC, or a derivative work of RT, and to copy, modify, and 
     13# distribute the resulting work.  RT is licensed under version 2 of 
     14# the GNU General Public License. 
     15#  
     16# This software is distributed WITHOUT ANY WARRANTY, without even the 
     17# implied warranties of MERCHANTABILITY and FITNESS FOR A PARTICULAR 
     18# PURPOSE.  See the GNU Affero General Public License for further 
    1819# details. 
    19 
    20 # You should have received a copy of the GNU Affero General Public License 
    21 # and the GNU General Public License along with this program. If not, see 
    22 # <http://www.gnu.org/licenses/>. 
    23  
    24 # Copyright (c) 2005 Software Freedom Law Center 
    25 # Author: Orion Montoya <orion@mdcclv.com> 
     20#   
     21# You should have received a copy of the GNU Affero General Public 
     22# License, version 3, and the GNU General Public License, version 2, 
     23# along with this software.  If not, see <http://www.gnu.org/licenses/>. 
    2624 
    2725use CGI qw(:standard); 
    2826use lib '/usr/share/request-tracker3.4/lib/'; 
    2927use lib '/etc/request-tracker3.4/'; 
     28 
     29use lib '/usr/share/request-tracker3.2/lib/'; 
     30use lib '/etc/request-tracker3.2/'; 
     31 
     32use MIME::Base64; 
     33use Frontier::Client; 
     34 
     35 
    3036use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent); 
    31  
     37use RT::Interface::Web; 
    3238 
    3339use RT; 
     
    3945use RT::CustomField; 
    4046use Data::Dumper; 
    41 my $CurrentUser = RT::Interface::CLI::GetCurrentUser(); 
    42 my $CustomFieldObj = RT::CustomField->new($CurrentUser); 
    43 #my $Query= " Requestor.EmailAddress LIKE 'moglen' "; 
    44 my $Query; 
    45  if(param()) { 
    46  
    47      $NoteUrl = param('NoteUrl'); 
    48 #     $Query = " CustomFields.NoteUrl LIKE '$NoteUrl' "; 
    49  } 
    50 # else { 
    51     $Query= " Requestor.EmailAddress LIKE 'moglen' "; 
    52 #} 
    53  
    54 my $TicketObj = new RT::Tickets( $RT::SystemUser ); 
     47 
     48sub debug { 
     49    print STDERR @_ . "\n"; 
     50 
     51
     52 
     53$printargs = "default (20 most recent comments)"; 
     54 
     55if (($name, $pass) = split(/:/, decode_base64(cookie('__ac')))) { 
     56 
     57    $name =~ s/\"//g; 
     58    $server = Frontier::Client->new(url => "http://gplv3.fsf.org:8800/launch/acl_users/Users/acl_users", 
     59                                    username => "stet_auth", 
     60                                    password =>  "fai1Iegh"); 
     61     
     62     
     63    $resp = $server->call('authRemoteUser',$name,$pass); 
     64
     65else { 
     66    ${$resp} = 0; 
     67
     68 
     69if (${$resp} == 0) { 
     70    print STDERR "auth boolean was 0\n"; 
     71
     72 
     73 
     74#my $CurrentUser = RT::Interface::CLI::GetCurrentUser(); 
     75#my $CustomFieldObj = RT::CustomField->new($CurrentUser); 
     76 
     77#my $Query; 
     78#if(param()) { 
     79#    $NoteUrl = param('NoteUrl'); 
     80# } 
     81my $CurrentUser = $RT::SystemUser; 
     82my $TicketObj = new RT::Tickets( $CurrentUser ); 
     83if (param('WatcherOp') == "LIKE") { 
     84    $arg = "%".param('ValueOfWatcher')."%"; 
     85
     86else { 
     87    $arg = param('ValueOfWatcher'); 
     88
     89$Query = param('WatcherField')." ".param('WatcherOp'). 'Requestor.Name LIKE "%'.param('ValueOfWatcher').'%"' 
    5590$TicketObj->FromSQL($Query); 
     91%session = ''; 
     92# as a result of next line, searches are *not* sticky. 
     93 
     94%ARGS = param(); 
    5695$TicketObj->Query(); 
    57 $TicketObj->LimitCustomField( 
    58      CUSTOMFIELD => 3, 
    59      VALUE => $NoteUrl, 
    60      OPERATOR => "=" 
    61 ); 
    62 #$count = $TicketObj->CountAll(); 
    63 #print $TicketObj->loc("Found [quant,_1,annotation].\n",$count); 
     96&LimitByArgs; 
     97 
     98 
     99 
     100 
     101# $TicketObj->FromSQL($Query); 
     102 
     103# $TicketObj->LimitCustomField( 
     104#                            CUSTOMFIELD => 3, 
     105#                            VALUE => $NoteUrl, 
     106#                            OPERATOR => "=" 
     107#                            ); 
     108 
     109 
     110$count = $TicketObj->CountAll(); 
     111print STDERR $TicketObj->loc("Found [quant,_1,annotation].\n",$count); 
    64112 
    65113print header('text/xml'); 
     
    70118my $annotation; 
    71119while (my $item = $TicketObj->Next) { 
    72 $annotation = ""; 
     120    $annotation = ""; 
    73121    my $Transactions = $item->Transactions; 
    74   while (my $Transaction = $Transactions->Next) { 
    75           next unless ($Transaction->Type =~ /^(Create|Correspond|Comment$)/); 
    76  
    77     my $attachments = $Transaction->Attachments; 
    78      my $CustomFields = $item->QueueObj->TicketCustomFields(); 
    79     $attachments->GotoFirstItem; 
    80     my $message = $attachments->Next; 
    81     $annotation .= $message->Content; 
    82 
     122    while (my $Transaction = $Transactions->Next) { 
     123        next unless ($Transaction->Type =~ /^(Create|Correspond|Comment$)/); 
     124                      
     125        my $attachments = $Transaction->Attachments; 
     126#    my $CustomFields = $item->QueueObj->TicketCustomFields(); 
     127        my $CustomFields = $item->QueueObj->CustomFields(); 
     128        $attachments->GotoFirstItem; 
     129        my $message = $attachments->Next; 
     130        $annotation .= $message->Content; 
     131    } 
     132 
     133        $showagree = '';         
     134        $agr_vals = $item->CustomFieldValues(7); 
     135        if ($$resp == 1) { 
     136 
     137            while ($value = $agr_vals->Next) { 
     138                if (($name) && ($value->Content eq $name)) { 
     139                    print STDERR "the user agrees with ".$item->id."\n"; 
     140#                   $showagree = "<a label=\"you have indicated that you agree with this\" name=\"you have indicated that you agree with this\">unagree</a>"; 
     141                    $showagree = "unagree"; 
     142                } 
     143            } 
     144            if (!$showagree) { 
     145                $showagree = "agree"; 
     146            } 
     147        } 
     148        else { 
     149            $showagree = "<a href=\"gplv3.fsf.org:8800/launch/login_form\">login</a> to agree"; 
     150             
     151        } 
     152         
     153#print "ticket has ".$values->count." customfieldvalues\n"; 
     154 
    83155# 
    84156#    my $Attachs = $item->TransactionObj->Attachments->First; 
     
    86158# while (my $CustomField = $CustomFields->Next()) { 
    87159# my $CustomFieldValues=$Ticket->CustomFieldValues($CustomField->Id); 
    88     $returnme .= "<annotation>\n"; 
     160        $returnme .= "<cs>Currently showing: $printargs.  <a href=\"javascript:newQuery()\">change</a></cs>\n"; 
     161          $returnme .= "<annotation>\n"; 
    89162#    $returnme .= " <url>" . $item->FirstCustomFieldValue('NoteUrl') . "</url>\n"; 
    90163#    $returnme .= " <dompath>" . $item->FirstCustomFieldValue('NoteDomPath') . "</dompath>\n"; 
    91     $returnme .= " <n>$annotation</n>\n"; 
    92     $returnme .= " <e>" . $item->FirstCustomFieldValue('NoteEndNodeId') . "</e>\n"; 
    93     $returnme .= " <s>" . $item->FirstCustomFieldValue('NoteSelection') . "</s>\n";  
    94     $returnme .= " <i>" . $item->FirstCustomFieldValue('NoteStartNodeId') . "</i>\n"; 
    95  
     164          $returnme .= " <n>$annotation</n>\n"; 
     165          $returnme .= " <e>" . $item->FirstCustomFieldValue('NoteEndNodeId') . "</e>\n"; 
     166          $noteSelection = $item->FirstCustomFieldValue('NoteSelection'); 
     167          $noteSelection =~ s/</&lt;/g; 
     168          $noteSelection =~ s/>/&gt;/g; 
     169          $returnme .= " <s>" . $noteSelection . "</s>\n";  
     170          $returnme .= " <i>" . $item->FirstCustomFieldValue('NoteStartNodeId') . "</i>\n"; 
     171          $returnme .= " <u>" . $item->Requestors->MemberEmailAddressesAsString . "</u>\n"; 
     172          $returnme .= " <ua>" . $showagree . "</ua>\n"; 
     173          $returnme .= " <at>" . $agr_vals->count . "</at>\n"; 
    96174          $returnme .= " <id>" . $item->id . "</id>\n"; 
    97     $returnme .= "</annotation>\n"; 
    98  
    99 #    print Dumper($content); 
    100  
     175         $returnme .= "</annotation>\n"; 
     176           
     177#    print STDERR Dumper($item); 
     178#         print STDERR $item->requestors; 
    101179    } 
    102180 
     
    106184print $returnme; 
    107185#print Dumper($TicketObj); 
     186 
     187# LimitByArgs adapted from $RT/lib/Interface/Web.pm's ProcessSearchQuery 
     188# (out of desperation) 
     189 
     190sub LimitByArgs { 
     191 
     192    # {{{ Limit priority 
     193    if ( param('ValueOfPriority') ne '' ) { 
     194        $TicketObj->LimitPriority( 
     195            VALUE    => param('ValueOfPriority'), 
     196            OPERATOR => param('PriorityOp') 
     197        ); 
     198        debug('limiting by '.param('ValueOfPriority')); 
     199    } 
     200 
     201    # }}} 
     202    # {{{ Limit owner 
     203    if ( param('ValueOfOwner') ne '' ) { 
     204        $TicketObj->LimitOwner( 
     205            VALUE    => param('ValueOfOwner'), 
     206            OPERATOR => param('OwnerOp') 
     207        ); 
     208        debug('limiting by '.param('ValueOfOwner')); 
     209    } 
     210 
     211    # }}} 
     212    # {{{ Limit requestor email 
     213     if ( param('ValueOfWatcher') ne '' ) { 
     214         my ($field, $property) = split(/\./,param('WatcherField')); 
     215         $TicketObj->LimitWatcher( 
     216#             TYPE     => $field, 
     217             VALUE    => param('ValueOfWatcher'), 
     218             OPERATOR => param('WatcherOp'), 
     219 
     220        ); 
     221        debug('limiting by '.param('ValueOfWatcher')); 
     222    } 
     223 
     224    # }}} 
     225    # {{{ Limit Queue 
     226    if ( param('ValueOfQueue') ne '' ) { 
     227        $TicketObj->LimitQueue( 
     228            VALUE    => param('ValueOfQueue'), 
     229            OPERATOR => param('QueueOp') 
     230        ); 
     231        debug('limiting by '.param('ValueOfQueue')); 
     232    } 
     233 
     234    # }}} 
     235    # {{{ Limit Status 
     236    if ( param('ValueOfStatus') ne '' ) { 
     237        if ( ref( param('ValueOfStatus') ) ) { 
     238            foreach my $value ( @{ param('ValueOfStatus') } ) { 
     239                $TicketObj->LimitStatus( 
     240                    VALUE    => $value, 
     241                    OPERATOR => param('StatusOp'), 
     242                ); 
     243            } 
     244            debug('limiting by '.@{param('ValueOfStatus')}[0]); 
     245        } 
     246        else { 
     247            $TicketObj->LimitStatus( 
     248                VALUE    => param('ValueOfStatus'), 
     249                OPERATOR => param('StatusOp'), 
     250            ); 
     251            debug('limiting by '.param('ValueOfStatus')); 
     252        } 
     253 
     254    } 
     255 
     256    # }}} 
     257    # {{{ Limit Subject 
     258    if ( param('ValueOfSubject') ne '' ) { 
     259            my $val = param('ValueOfSubject'); 
     260        if (param('SubjectOp') =~ /like/) { 
     261            $val = "%".$val."%"; 
     262        } 
     263        $TicketObj->LimitSubject( 
     264            VALUE    => $val, 
     265            OPERATOR => param('SubjectOp'), 
     266        ); 
     267        debug('limiting by '.$val); 
     268    } 
     269 
     270    # }}}     
     271    # {{{ Limit Dates 
     272    if ( param('ValueOfDate') ne '' ) { 
     273        my $date = ParseDateToISO( param('ValueOfDate') ); 
     274        ARGS{'DateType'} =~ s/_Date$//; 
     275 
     276        if ( ARGS{'DateType'} eq 'Updated' ) { 
     277            $TicketObj->LimitTransactionDate( 
     278                                            VALUE    => $date, 
     279                                            OPERATOR => param('DateOp'), 
     280            ); 
     281        } 
     282        else { 
     283            $TicketObj->LimitDate( FIELD => ARGS{'DateType'}, 
     284                                            VALUE => $date, 
     285                                            OPERATOR => param('DateOp'), 
     286            ); 
     287        } 
     288    } 
     289 
     290    # }}}     
     291    # {{{ Limit Content 
     292    if ( param('ValueOfAttachmentField') ne '' ) { 
     293        my $val = param('ValueOfAttachmentField'); 
     294        if (param('AttachmentFieldOp') =~ /like/) { 
     295            $val = "%".$val."%"; 
     296        } 
     297        $TicketObj->Limit( 
     298            FIELD   => param('AttachmentField'), 
     299            VALUE    => $val, 
     300            OPERATOR => param('AttachmentFieldOp'), 
     301        ); 
     302    } 
     303 
     304    # }}}    
     305 
     306 # {{{ Limit CustomFields 
     307 
     308    foreach my $arg ( keys %ARGS ) { 
     309        my $id; 
     310        if ( $arg =~ /^CustomField(\d+)$/ ) { 
     311            $id = $1; 
     312        } 
     313        else { 
     314            next; 
     315        } 
     316        next unless ( param($arg) ); 
     317 
     318        my $form = param($arg); 
     319        my $oper = param->{ "CustomFieldOp" . $id }; 
     320        foreach my $value ( ref($form) ? @{$form} : ($form) ) { 
     321            my $quote = 1; 
     322            if ($oper =~ /like/i) { 
     323                $value = "%".$value."%"; 
     324            } 
     325            if ( $value =~ /^null$/i ) { 
     326 
     327                #Don't quote the string 'null' 
     328                $quote = 0; 
     329 
     330                # Convert the operator to something apropriate for nulls 
     331                $oper = 'IS'     if ( $oper eq '=' ); 
     332                $oper = 'IS NOT' if ( $oper eq '!=' ); 
     333            } 
     334            $TicketObj->LimitCustomField( CUSTOMFIELD => $id, 
     335                                                   OPERATOR    => $oper, 
     336                                                   QUOTEVALUE  => $quote, 
     337                                                   VALUE       => $value ); 
     338        } 
     339    } 
     340 
     341 
     342} 
     343# {{{ sub ParseDateToISO 
     344 
     345=head2 ParseDateToISO 
     346 
     347Takes a date in an arbitrary format. 
     348Returns an ISO date and time in GMT 
     349 
     350=cut 
     351 
     352sub ParseDateToISO { 
     353    my $date = shift; 
     354 
     355    my $date_obj = RT::Date->new($session{'CurrentUser'}); 
     356    $date_obj->Set( 
     357        Format => 'unknown', 
     358        Value  => $date 
     359    ); 
     360    return ( $date_obj->ISO ); 
     361} 
     362 
     363# }}} 
     364 
     365 
     366 
     367=cut 
     368 
     369# http://gplv3.fsf.org/stet/rt-test.pl?SearchId=new 
     370Query= 
     371Format=%27+++%3Cb%3E%3Ca+href%3D%22%2Frt%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__id__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3A%23%27%2C+%0D%0A%27%3Cb%3E%3Ca+href%3D%22%2Frt%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__Subject__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3ASubject%27%2C+%0D%0A%27__Status__%27%2C+%0D%0A%27__QueueName__%27%2C+%0D%0A%27__OwnerName__%27%2C+%0D%0A%27__Priority__%27%2C+%0D%0A%27__NEWLINE__%27%2C+%0D%0A%27%27%2C+%0D%0A%27%3Csmall%3E__Requestors__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__CreatedRelative__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__ToldRelative__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__LastUpdatedRelative__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__TimeLeft__%3C%2Fsmall%3E%27 
     372AndOr=AND 
     373AttachmentField=Subject 
     374AttachmentOp=LIKE 
     375ValueOfAttachment= 
     376QueueOp=%3D 
     377ValueOfQueue= 
     378StatusOp=%3D 
     379ValueOfStatus= 
     380ActorField=Owner 
     381ActorOp=%3D 
     382ValueOfActor= 
     383WatcherField=Requestor.Name 
     384WatcherOp=LIKE 
     385ValueOfWatcher=orion 
     386DateField=Created 
     387DateOp=%3C 
     388ValueOfDate= 
     389TimeField=TimeWorked 
     390TimeOp=%3C 
     391ValueOfTime= 
     392PriorityField=Priority 
     393PriorityOp=%3C 
     394ValueOfPriority= 
     395LinksField=HasMember 
     396LinksOp=%3D 
     397ValueOfLinks= 
     398idOp=%3C 
     399ValueOfid= 
     400%27CF.NoteSelection%27Op=LIKE 
     401ValueOf%27CF.NoteSelection%27= 
     402%27CF.NoteDomPath%27Op=LIKE 
     403ValueOf%27CF.NoteDomPath%27= 
     404%27CF.NoteUrl%27Op=LIKE 
     405ValueOf%27CF.NoteUrl%27= 
     406%27CF.NoteStartNodeId%27Op=LIKE 
     407ValueOf%27CF.NoteStartNodeId%27= 
     408%27CF.NoteEndNodeId%27Op=LIKE 
     409ValueOf%27CF.NoteEndNodeId%27= 
     410%27CF.NoteText%27Op=LIKE 
     411ValueOf%27CF.NoteText%27= 
     412%27CF.Agreeers%27Op=LIKE 
     413ValueOf%27CF.Agreeers%27= 
     414AddClause=Add 
     415Owner=RT%3A%3AUser-12 
     416Description= 
     417LoadSavedSearch= 
     418Link=None 
     419Title= 
     420Size= 
     421Face= 
     422OrderBy=id 
     423Order=ASC 
     424RowsPerPage=50 
  • trunk/rtNoAuth/changeshown.html

    r10 r11  
    22%#  
    33%# COPYRIGHT: 
     4%# 
     5%# Copyright (C) 2006   Software Freedom Law Center, Inc. 
     6%# Modified-By: Orion Montoya <orion@mdcclv.com> 
     7%# 
     8%# This software gives you freedom; it is licensed to you under version 
     9%# 3 of the GNU Affero General Public License, along with the 
     10%# additional permission in the following paragraph. 
     11%# 
     12%# This notice constitutes a grant of such permission as is necessary 
     13%# to combine or link this software, or a modified version of it, with 
     14%# Request Tracker (RT), published by Jesse Vincent and Best Practical 
     15%# Solutions, LLC, or a derivative work of RT, and to copy, modify, and 
     16%# distribute the resulting work.  RT is licensed under version 2 of 
     17%# the GNU General Public License. 
     18%#  
     19%# This software is distributed WITHOUT ANY WARRANTY, without even the 
     20%# implied warranties of MERCHANTABILITY and FITNESS FOR A PARTICULAR 
     21%# PURPOSE.  See the GNU Affero General Public License for further 
     22%# details. 
     23%#   
     24%# You should have received a copy of the GNU Affero General Public 
     25%# License, version 3, and the GNU General Public License, version 2, 
     26%# along with this software.  If not, see <http://www.gnu.org/licenses/>. 
    427%#   
    528%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC  
     
    4770<html> 
    4871<head> 
    49 <title>gpl comment system - query builder</title> 
     72<title>stet query builder</title> 
    5073%# <link rel="stylesheet" href="/rt/NoAuth/webrt.css" type="text/css"> 
    5174<script type="text/javascript" src="/comments/stet.js"></script> 
     
    7598<& /Elements/Submit, Caption => "Do the Search", Label => loc('Search'), Name => 'DoSearch'&> 
    7699<& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&> 
    77 <input type=hidden name=" 
    78100 
    79101</td> 
  • trunk/rtNoAuth/Elements/PickCriteria

    r10 r11  
    11%# {{{ BEGIN BPS TAGGED BLOCK 
    22%#  
     3%# Copyright (C) 2006   Software Freedom Law Center, Inc. 
     4%# Modified-By: Orion Montoya <orion@mdcclv.com> 
     5%# 
     6%# This software gives you freedom; it is licensed to you under version 
     7%# 3 of the GNU Affero General Public License, along with the 
     8%# additional permission in the following paragraph. 
     9%# 
     10%# This notice constitutes a grant of such permission as is necessary 
     11%# to combine or link this software, or a modified version of it, with 
     12%# Request Tracker (RT), published by Jesse Vincent and Best Practical 
     13%# Solutions, LLC, or a derivative work of RT, and to copy, modify, and 
     14%# distribute the resulting work.  RT is licensed under version 2 of 
     15%# the GNU General Public License. 
     16%#  
     17%# This software is distributed WITHOUT ANY WARRANTY, without even the 
     18%# implied warranties of MERCHANTABILITY and FITNESS FOR A PARTICULAR 
     19%# PURPOSE.  See the GNU Affero General Public License for further 
     20%# details. 
     21%#   
     22%# You should have received a copy of the GNU Affero General Public 
     23%# License, version 3, and the GNU General Public License, version 2, 
     24%# along with this software.  If not, see <http://www.gnu.org/licenses/>. 
     25%# 
    326%# COPYRIGHT: 
    4 %#  
     27%#  
    528%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC  
    629%#                                          <jesse@bestpractical.com> 
     
    4972  <& PickBasics &> 
    5073  <& PickCFs, cfqueues => \%cfqueues &> 
     74  <tr><td>&nbsp;</td></tr> 
     75</table> 
    5176 
    52 %# <& /Elements/TitleBoxEnd &> 
     77<& /Elements/TitleBoxEnd &> 
    5378 
    5479<%ARGS> 
  • trunk/rtNoAuth/readsay.html

    r10 r11  
    1 %# Copyright 2005 Software Freedom Law Center, Inc. 
     1%# Copyright (C) 2006   Software Freedom Law Center, Inc. 
     2%# Author: Orion Montoya <orion@mdcclv.com> 
    23%# 
    3 %# This program is free software: you may copy, modify, or redistribute it 
    4 %# and/or modify it under either: 
     4%# This software gives you freedom; it is licensed to you under version 
     5%# 3 of the GNU Affero General Public License, along with the 
     6%# additional permission in the following paragraph. 
    57%# 
    6 %#  (a) the terms of the GNU Affero General Public License as published by 
    7 %#      the Free Software Foundation, either version 3 of the License, or 
    8 %#      (at your option) any later version. 
    9 %#    or 
    10 %#  (b) the terms of the GNU General Public license, version 2, as 
    11 %#      published by the Free Software Foundation. 
    12 %# 
    13 %# This program is distributed in the hope that it will be useful, but 
    14 %# WITHOUT ANY WARRANTY; without even the implied warranty of 
    15 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero 
    16 %# General Public License and/or GNU General Public License for more 
     8%# This notice constitutes a grant of such permission as is necessary 
     9%# to combine or link this software, or a modified version of it, with 
     10%# Request Tracker (RT), published by Jesse Vincent and Best Practical 
     11%# Solutions, LLC, or a derivative work of RT, and to copy, modify, and 
     12%# distribute the resulting work.  RT is licensed under version 2 of 
     13%# the GNU General Public License. 
     14%#  
     15%# This software is distributed WITHOUT ANY WARRANTY, without even the 
     16%# implied warranties of MERCHANTABILITY and FITNESS FOR A PARTICULAR 
     17%# PURPOSE.  See the GNU Affero General Public License for further 
    1718%# details. 
    18 %# 
    19 %# You should have received a copy of the GNU Affero General Public License 
    20 %# and the GNU General Public License along with this program. If not, see 
    21 %# <http://www.gnu.org/licenses/>. 
    22 
    23 %# Copyright (c) 2005 Software Freedom Law Center 
    24 %# Author: Orion Montoya <orion@mdcclv.com> 
     19%#   
     20%# You should have received a copy of the GNU Affero General Public 
     21%# License, version 3, and the GNU General Public License, version 2, 
     22%# along with this software.  If not, see <http://www.gnu.org/licenses/>. 
    2523% 
    2624<html> 
     
    3028</head> 
    3129<body> 
    32 <!-- <div id="maintext"> --
     30<div id="maintext"
    3331% if ($Tickets) { 
    34 <h3> Showing comments where <% humanQuery($ARGS{'Query'}) |n %> <a class="rsslink" href="<% $rsslink %>">[rss]</a> <a href="/comments/<% $Tickets->First->FirstCustomFieldValue('NoteUrl') %>?Query=<% $ARGS{'Query'} %>">[see on license]</a><h3> 
     32<h3> Showing comments where <% humanQuery($ARGS{'Query'}) |n %> <a class="rsslink" href="<% $rsslink %>">[rss]</a><h3> 
    3533<h4>Found <% $Tickets->CountAll()%></h4> 
    3634% } else { 
    37 <h3> Showing comment <a href="/rt/NoAuth/readsay.html?id=<% $ARGS{'id'} %>"><% $ARGS{'id'} %></a> <a class="rsslink" href="<% $rsslink %>">[rss]</a> <a href="/comments/<% $Ticket->FirstCustomFieldValue('NoteUrl') %>?id=<% $ARGS{'id'} %>#<% $Ticket->FirstCustomFieldValue('NoteStartNodeId') %>">[see on license]</a></h3> 
     35<h3> Showing comment <% $ARGS{'id'} %> <a class="rsslink" href="<% $rsslink %>">[rss]</a></h3> 
    3836% } 
    3937% 
     
    4240<& /Elements/ListActions, actions => \@msgresults &> 
    4341<& /Elements/ListActions, actions => \@linkresults &> 
    44 <h4><% $thing %> <a href="readsay.html?id=<% $item->id %>"><% $item->id %>: <% $item->Subject %></a></h4> 
     42<h4><a href="readsay.html?id=<% $item->id %>"><% $item->id %>: <% $item->Subject %></a></h4> 
    4543<span class="tktheader">Regarding the text:</span> <span class="ontextText"><% $scrubber->scrub($item->FirstCustomFieldValue('NoteSelection')) %></span><br/> 
    4644In section: <span class="nodeLink"><% $scrubber->scrub($item->FirstCustomFieldValue('NoteStartNodeId')) %></span><br/> 
     
    5149<span class="agreecount"><% $agr_count %> agree</span></span><br/> 
    5250comments: <% getThread(\$item) |n %><br/> 
     51% if (($makeissue) && ($item->Queue != $issuequeue)) { 
     52<input type="checkbox" value="1" name="MakeIssue"/>Upgrade this to an Issue<br/> 
     53% } 
     54Parents: 
     55% while (my $link = $item->MemberOf->Next) { 
     56      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> 
     57        <& ShowLink, URI => $link->TargetURI &><br> 
     58% } 
     59<br/> 
     60Children: 
     61% while (my $link = $Object->Members->Next) { 
     62      <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> 
     63        <& ShowLink, URI => $link->BaseURI &><br> 
     64% } 
    5365% if ($resp == 1) { 
    5466<form action="readsay.html" method="POST" name="TicketUpdate" enctype="multipart/form-data"> 
    5567<input type="hidden" name="id" value="<% $item->id %>"> 
    56 % } 
    57 % if (($makeissue) && ($item->Queue != $issuequeue)) { 
    58 <input type="checkbox" value="1" name="MakeIssue"/>Upgrade this to an Issue<br/> 
    59 % } 
    60 <span class="TktLabel">Parents</span> 
    61 % if (!$item->Members->GotoFirstItem) { 
    62 <em>this <% $thing %> does not have any parents </em><br/> 
    63 % } 
    64 % while (my $link = $item->MemberOf->Next) { 
    65         <& Elements/ShowLink, URI => $link->TargetURI &><span class="TktInput"> 
    66 % if ($resp == 1) { 
    67         <span class="TktInput indent">[delete: <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">]</span> 
    68 % } 
    69 <br/> 
    70 % } 
    71 % if ($makeissue) { 
    72 <span class="TktInput indent">add new: <INPUT NAME="<% $item->id %>-MemberOf"> <span class="inputcaption">[comment id numbers, space separated]</span></span> 
    73 % } 
    74 <br/> 
    75 <span class="TicketLabel">Children: 
    76 % if (!$item->Members->GotoFirstItem) { 
    77 <em>this <% $thing %> does not have any children </em><br/> 
    78 % } 
    79 % while (my $link = $item->Members->Next) { 
    80         <& Elements/ShowLink, URI => $link->BaseURI &></span> 
    81 % if ($makeissue) { 
    82  <span class="TktInput indent">[delete: <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">]</span> 
    83 % } 
    84 <br/> 
    85 % } 
    86 % if ($makeissue) { 
    87 <span class="TktInput indent">add new: <INPUT NAME="MemberOf-<% $item->id %>"> <span class="inputcaption">[comment id numbers, space separated]</span></span> 
    88 </span><br/> 
    89 <span class="TktInput">link to external item(s): <INPUT NAME="<% $item->id %>-RefersTo"> <span class="inputcaption">[URIs with protocol://, space separated]</span></span> 
    90 % } 
    91 </span><br/> 
    92 % if ($resp == 1) { 
    9368<textarea class="messagebox" COLS=72 ROWS=15 WRAP=HARD NAME="UpdateContent" onfocus="if(this.value=='Enter additional comments here') {this.value='';}" onblur="if(this.value==''){this.value='Enter additional comments here';}"> 
    9469% if($ARGS{'addcomments'}) { 
     
    10479<INPUT TYPE=SUBMIT NAME="SubmitTicket" VALUE='Add comment'></form> 
    10580% } 
    106 <!-- </div> --> 
    10781% } 
     82</div> 
    10883% $Ticket = ''; 
    10984% } 
    110 
     85 
    11186</body> 
    11287</html> 
     
    12196my $scrubber = HTML::Scrubber->new( allow => [ qw[ a b i u br ] ] ); 
    12297require "/var/www/stet/stetsubs.pl"; 
    123 my $issuequeue = 5; # I guess Issue will be queue 4... 
     98my $issuequeue = 4; # I guess Issue will be queue 4... 
    12499sub debug { 
    125100    print STDERR @_ . "\n"; 
    126101} 
    127102 
    128 my ($name, $resp, $pass, $agr_vals, $CurrentUser, $thing); 
     103my ($name, $resp, $pass, $agr_vals, $CurrentUser); 
    129104($CurrentUser, $resp) = getUser("foo"); 
    130105 
    131 my $rsslink = "/rt/NoAuth/rssresults.rdf?id=".$ARGS{'id'}."&Query=".$ARGS{'Query'}; 
     106my $rsslink = "/rt/NoAuth/rssresults.rdf?Query=".$ARGS{'Query'}; 
    132107 
    133108my ($Tickets, $Ticket, $makeissue, @msgresults, @linkresults); 
     
    142117    $Ticket = LoadTicket($ARGS{'id'}); 
    143118    if ($ARGS{'UpdateContent'}) { 
    144         ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@msgresults); 
     119        ProcessUpdateMessage(TicketObj => $item, ARGSRef=>\%ARGS, Actions=>\@msgresults); 
     120 
    145121    } 
    146122    if ($ARGS{'MakeIssue'}) { 
     
    160136        ) 
    161137      ) 
    162 ) 
    163138    { 
    164139        $makeissue = 1; 
    165140    } 
    166 else {$makeissue = '';} 
    167 if ($Ticket->Queue == 5) { 
    168     $thing = "issue"; 
    169 } 
    170 else { 
    171     $thing = "comment"; 
    172 } 
    173141 
    174142sub getThread($) { 
     
    199167#                        } 
    200168 
    201                          $allcomments .= "<blockquote><h4>$subj</h4>\n".$message->Content."<br/>\n"; 
     169                         $allcomments .= "<blockquote><h4>$subj</h4>\n$cont<br/>\n"; 
    202170                         $allcomments .= "<span class=\"posted\">noted by user <span class=\"userlink\">".$message->CreatorObj->Name."</span></span>\n"; 
    203171                     } 
  • trunk/rtNoAuth/xmlresults.html

    r10 r11  
    11<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    2 %# Copyright 2005 Software Freedom Law Center, Inc. 
     2%# Copyright (C) 2006   Software Freedom Law Center, Inc. 
     3%# Author: Orion Montoya <orion@mdcclv.com> 
    34%# 
    4 %# This program is free software: you may copy, modify, or redistribute it 
    5 %# and/or modify it under either: 
     5%# This software gives you freedom; it is licensed to you under version 
     6%# 3 of the GNU Affero General Public License, along with the 
     7%# additional permission in the following paragraph. 
    68%# 
    7 %#  (a) the terms of the GNU Affero General Public License as published by 
    8 %#      the Free Software Foundation, either version 3 of the License, or 
    9 %#      (at your option) any later version. 
    10 %#    or 
    11 %#  (b) the terms of the GNU General Public license, version 2, as 
    12 %#      published by the Free Software Foundation. 
    13 %# 
    14 %# This program is distributed in the hope that it will be useful, but 
    15 %# WITHOUT ANY WARRANTY; without even the implied warranty of 
    16 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero 
    17 %# General Public License and/or GNU General Public License for more 
     9%# This notice constitutes a grant of such permission as is necessary 
     10%# to combine or link this software, or a modified version of it, with 
     11%# Request Tracker (RT), published by Jesse Vincent and Best Practical 
     12%# Solutions, LLC, or a derivative work of RT, and to copy, modify, and 
     13%# distribute the resulting work.  RT is licensed under version 2 of 
     14%# the GNU General Public License. 
     15%#  
     16%# This software is distributed WITHOUT ANY WARRANTY, without even the 
     17%# implied warranties of MERCHANTABILITY and FITNESS FOR A PARTICULAR 
     18%# PURPOSE.  See the GNU Affero General Public License for further 
    1819%# details. 
    19 %# 
    20 %# You should have received a copy of the GNU Affero General Public License 
    21 %# and the GNU General Public License along with this program. If not, see 
    22 %# <http://www.gnu.org/licenses/>. 
     20%#   
     21%# You should have received a copy of the GNU Affero General Public 
     22%# License, version 3, and the GNU General Public License, version 2, 
     23%# along with this software.  If not, see <http://www.gnu.org/licenses/>. 
    2324% 
    2425% 
    2526<response> 
    26 % if ($Tickets) { 
    27 <cs>Showing comments where <% humanQuery($ARGS{'Query'}) |n %> <a class="rsslink" href="<% $rsslink %>">[rss]</a> (found <% $Tickets->CountAll()%>)</cs> 
    28 % } else { 
    29 <cs> Showing comment <a href="/rt/NoAuth/readsay.html?id=<% $ARGS{'id'} %>"><% $ARGS{'id'} %></a> <a class="rsslink" href="<% $rsslink %>">[rss]</a> <a href="/rt/NoAuth/changeshown.html">change</a> </cs> 
    30 % } 
    31 % while (my $item = $Tickets ? $Tickets->Next : $Ticket) { 
     27%# <cs>Showing comments where <% humanQuery($ARGS{'Query'} |n %> (<% $Tickets->CountAll() %> found) <a href="<% $rsslink %>">[rss]</a>  <a href="javascript:newQuery()">change</a> </cs> 
     28<cs>Currently showing <% $printargs %> <a href="<% $rsslink %>">[rss]</a>  <a href="changeshown.html">change</a> </cs> 
     29% while ( my $item = $Tickets->Next()) { 
    3230<annotation> 
    3331<n><% $item->Transactions->First->Content %></n> 
     
    4240<id><% $item->id %></id> 
    4341</annotation> 
    44 % $Ticket = ''; 
    4542% } 
    4643</response> 
     
    6764print STDERR "Currentuser $CurrentUser, $resp\n"; 
    6865#my $Tickets = RT::Tickets->new($session{'CurrentUser'}); 
    69  
    70 my ($Tickets, $Ticket); 
    71  
    72 if ($ARGS{'Query'}) { 
    73     $Tickets = RT::Tickets->new($CurrentUser); 
    74     $Tickets->FromSQL($ARGS{'Query'}); 
    75 
    76 elsif ($ARGS{'id'}) { 
    77     $Ticket = RT::Ticket->new($CurrentUser); 
    78     $Ticket = LoadTicket($ARGS{'id'}); 
    79 
    80  
    81 #my $Tickets = RT::Tickets->new($CurrentUser); 
    82 #$Tickets->FromSQL($ARGS{'Query'}); 
    83 #$Tickets->OrderBy( FIELD => 'id', ORDER => $ARGS{'Order'}); 
     66my $Tickets = RT::Tickets->new($CurrentUser); 
     67$Tickets->FromSQL($ARGS{'Query'}); 
     68$Tickets->OrderBy( FIELD => 'id', ORDER => $ARGS{'Order'}); 
    8469 
    8570$r->content_type('text/xml'); 
  • trunk/searchhi.js

    r10 r11  
    1 /* This is believed to be copyrighted by Stuart Langridge; the license is */ 
    2 /* unkowning but we are clarifying with the author.  */ 
    31/* The MIT Licence, for code from kryogenix.org 
    42** 
  • trunk/selectxpath.xsl

    r10 r11  
    1 <!-- Copyright 2005, Software Freedom Law Center, Inc. 
    2  
    3 -- This program is free software: you may copy, modify, or redistribute it 
    4 -- and/or modify it under the terms of the GNU Affero General Public 
    5 -- License as published by the Free Software Foundation, either version 3 
    6 -- of the License, or (at your option) any later version. 
    7 -- This program is distributed in the hope that it will be useful, but 
    8 -- WITHOUT ANY WARRANTY; without even the implied warranty of 
    9 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero 
    10 -- General Public License and/or GNU General Public License for more 
     1<!-- Copyright (C) 2005   Software Freedom Law Center, Inc. 
     2--   Author: Orion Montoya <orion@mdcclv.com> 
     3-- 
     4-- This software gives you freedom; it is licensed to you under version 
     5-- 3 of the GNU Affero General Public License, along with the 
     6-- additional permission in the following paragraph. 
     7-- 
     8-- This notice constitutes a grant of such permission as is necessary 
     9-- to combine or link this software, or a modified version of it, with 
     10-- Request Tracker (RT), published by Jesse Vincent and Best Practical 
     11-- Solutions, LLC, or a derivative work of RT, and to copy, modify, and 
     12-- distribute the resulting work.  RT is licensed under version 2 of 
     13-- the GNU General Public License. 
     14--  
     15-- This software is distributed WITHOUT ANY WARRANTY, without even the 
     16-- implied warranties of MERCHANTABILITY and FITNESS FOR A PARTICULAR 
     17-- PURPOSE.  See the GNU Affero General Public License for further 
    1118-- details. 
    12 -- 
    13 -- You should have received a copy of the GNU Affero General Public License 
    14 -- and the GNU General Public License along with this program. If not, see 
    15 -- <http://www.gnu.org/licenses/>. 
     19--   
     20-- You should have received a copy of the GNU Affero General Public 
     21-- License, version 3, and the GNU General Public License, version 2, 
     22-- along with this software.  If not, see <http://www.gnu.org/licenses/>. 
    1623--> 
    17  
    1824<?xml version="1.0" encoding="utf-8"?> 
    1925<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     
    97103    <xsl:for-each select="section"> 
    98104      <h3><xsl:value-of select="title"/></h3> 
    99       <section id="{@id}" name="{@id}"
     105      <section id="{@id}"
    100106        <xsl:for-each select="p"> 
    101           <p id="{@id}" name="{@id}"
     107          <p id="{@id}"
    102108            <xsl:for-each select="sent"> 
    103               <sent id="{@id}" name="{@id}"
     109              <sent id="{@id}"
    104110                <xsl:apply-templates select='node()|@*' /> 
    105111                <xsl:text>  </xsl:text> 
  • trunk/stet-spec.txt

    r9 r11  
    11Specification for stet, a system for public comment on gplv3 
    22Orion Montoya <orion@diderot.uchicago.edu> 
    3 $Id: stet-spec.txt 42 2005-12-15 23:18:11Z orion $ 
     3$Id: stet-spec.txt 46 2006-01-05 17:29:26Z orion $ 
    44 
    55 
     
    249249 - etc. [ *discuss* or request ] 
    250250 
    251 To proliferate excessive proliferation or disjunction of metadata 
    252 properties, new properties should be added only after reasonable 
     251To prevent excessive proliferation or disjunction of metadata 
     252properties, new properties should be added only after a reasonable 
    253<