[Rt-commit] rtir branch, 2.5-trunk, updated. aa0df32d0bdb3a4a41ffad9aefb0f93435403857

Ruslan Zakirov ruz at bestpractical.com
Tue Sep 1 09:20:20 EDT 2009


The branch, 2.5-trunk has been updated
       via  aa0df32d0bdb3a4a41ffad9aefb0f93435403857 (commit)
       via  83f47249a4d917cd00e09f8ce4a2470cf35aad05 (commit)
       via  3fa9044985cf1ae4385ef527d663cd5ae16a6059 (commit)
       via  d3eae504ddf2d64acd77172b9bd27611a63105b9 (commit)
       via  5250b32783faaf3982ce0e5ba9c2286037df267a (commit)
      from  21a97fb3cbe50c3fd94659244ce6712c095f30ef (commit)

Summary of changes:
 html/RTIR/NoAuth/webrtir.css           |   10 +++
 html/RTIR/Search/Elements/BuildQuery   |   31 ++++++----
 html/RTIR/Search/Elements/PickCFs      |  106 --------------------------------
 html/RTIR/Search/Elements/PickCriteria |   69 ---------------------
 html/RTIR/Search/Reporting.html        |    2 +-
 lib/RT/IR.pm                           |   10 +++
 6 files changed, 40 insertions(+), 188 deletions(-)
 delete mode 100644 html/RTIR/Search/Elements/PickCFs
 delete mode 100644 html/RTIR/Search/Elements/PickCriteria

- Log -----------------------------------------------------------------
commit 5250b32783faaf3982ce0e5ba9c2286037df267a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Aug 31 15:17:51 2009 +0400

    * fix reporting

diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 7e4df70..9e55c4e 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -47,7 +47,7 @@ my $current_tab = "$BaseURL&$QueryString";
 </%INIT>
 
 <%ARGS>
-$PrimaryGroupBy => 'CF.{__RTIR_State}'
+$PrimaryGroupBy => 'CF.{State}'
 $ChartStyle     => 'bar'
 $ShowChart      => 0
 

commit d3eae504ddf2d64acd77172b9bd27611a63105b9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 1 12:38:39 2009 +0400

    delete some components we don't need
    
    We have no prefix on RTIR's CFs anymore, thus we don't
    need code that strips the prefix from name in the QB.

diff --git a/html/RTIR/Search/Elements/PickCFs b/html/RTIR/Search/Elements/PickCFs
deleted file mode 100644
index f586735..0000000
--- a/html/RTIR/Search/Elements/PickCFs
+++ /dev/null
@@ -1,106 +0,0 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
-%#                                          <jesse at 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-%# 
-%# 
-%# 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
-% foreach( @lines ) {
-<& /Search/Elements/ConditionRow, Condition => $_ &>
-% }
-<%INIT>
-my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
-$CustomFields->LimitToGlobal;
-$CustomFields->Limit( FIELD => 'Name', OPERATOR => 'STARTSWITH', VALUE => '_RTIR_' );
-
-if ( $Queues ) {
-    my @list;
-    if ( ref $Queues eq 'HASH' ) {
-        @list = grep $_ && $Queues->{$_}, keys %$Queues;
-    }
-    elsif ( ref $Queues eq 'ARRAY' ) {
-        @list = grep $_, @$Queues;
-    } else {
-        @list = ($Queues);
-    }
-    foreach my $queue( @list ) {
-        my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
-        $QueueObj->Load( $queue );
-        next unless $QueueObj->Id;
-
-        $CustomFields->LimitToQueue( $QueueObj->Id );
-    }
-}
-
-my @lines;
-while ( my $CustomField = $CustomFields->Next ) {
-    my $label = $CustomField->Name;
-    $label =~ s/^_RTIR_//; # XXX: add queue name to label
-    $label = $m->interp->apply_escapes($label, 'h');
-    if ( my $desc = $CustomField->Description ) {
-        $desc = $m->interp->apply_escapes($desc, 'h');
-        $label .= qq{<br><span class="label-comment">($desc)</span>};
-    }
-
-    my %line;
-    $line{'Name'} = "'CF.{" . $CustomField->Name . "}'";
-    $line{'Field'} = $label;
-    $line{'Op'} = {
-        Type => 'component',
-        Path => '/Elements/SelectCustomFieldOperator',
-        Arguments => {
-            Options => [ loc("is"), loc("isn't") ],
-            Values => [ '=', '!=' ],
-        },
-    };
-    $line{'Value'} = {
-        Type => 'component',
-        Path => '/Elements/SelectCustomFieldValue',
-        Arguments => { CustomField => $CustomField },
-    };
-    push @lines, \%line;
-}
-
-</%INIT>
-
-<%ARGS>
-$Queues => undef
-</%ARGS>
diff --git a/html/RTIR/Search/Elements/PickCriteria b/html/RTIR/Search/Elements/PickCriteria
deleted file mode 100644
index 3fd91ed..0000000
--- a/html/RTIR/Search/Elements/PickCriteria
+++ /dev/null
@@ -1,69 +0,0 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
-%#                                          <jesse at 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-%# 
-%# 
-%# 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
-<&| /Widgets/TitleBox, title => loc('Add Criteria')&>
-
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td class="label"><&|/l&>Aggregator</&>:</td>
-<td class="operator">&nbsp;</td>
-<td class="value"><& /Search/Elements/SelectAndOr, Name => "AndOr" &></td>
-</tr>
-
-
-<tr><th><&|/l&>Field</&></th><th><&|/l&>Operator</&></th><th><&|/l&>Value</&></th></tr>
-
-<tr class="separator"><td colspan="3"><hr /></td></tr>
-
-<& /Search/Elements/PickBasics &>
-<& PickCFs, Queues => $Queues &>
-<& /Search/Elements/PickCFs, cfqueues => $Queues &>
-
-</table>
-
-</&>
-<%ARGS>
-$Queues => {}
-</%ARGS>

commit 3fa9044985cf1ae4385ef527d663cd5ae16a6059
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 1 12:42:43 2009 +0400

    use RT's PickCriteria component

diff --git a/html/RTIR/Search/Elements/BuildQuery b/html/RTIR/Search/Elements/BuildQuery
index 9a68af8..2130c36 100644
--- a/html/RTIR/Search/Elements/BuildQuery
+++ b/html/RTIR/Search/Elements/BuildQuery
@@ -54,7 +54,8 @@
 <table width="100%">
 <tr>
 <td valign="top" class="boxcontainer">
-<& PickCriteria, Queues => $queues &>
+<& /Search/Elements/PickCriteria, cfqueues => $queues &>
+
 <& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&>
 
 </td>

commit 83f47249a4d917cd00e09f8ce4a2470cf35aad05
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 1 14:32:37 2009 +0400

    switch over RT's style for QB

diff --git a/html/RTIR/NoAuth/webrtir.css b/html/RTIR/NoAuth/webrtir.css
index dcc343b..de3c524 100644
--- a/html/RTIR/NoAuth/webrtir.css
+++ b/html/RTIR/NoAuth/webrtir.css
@@ -48,6 +48,16 @@ ul.userlist li:last-child::after{
 .tickets-list-investigation .titlebox-title .left { background-color: #316531; color: #fff; }
 .tickets-list-block         .titlebox-title .left { background-color: #316531; color: #fff; }
 
+
+#comp-RTIR-Search #body {
+    position: relative;
+}
+#comp-RTIR-Search .submit {
+    width: 58%;
+}
+
+
+
 % $m->abort;
 <%INIT>
 $r->content_type('text/css');
diff --git a/html/RTIR/Search/Elements/BuildQuery b/html/RTIR/Search/Elements/BuildQuery
index 2130c36..e1306fc 100644
--- a/html/RTIR/Search/Elements/BuildQuery
+++ b/html/RTIR/Search/Elements/BuildQuery
@@ -44,36 +44,42 @@
 %# 
 %# }}} END BPS TAGGED BLOCK
 
-<form method="post" action="<% RT->Config->Get('WebPath')%><% $m->request_comp->path %>" name="BuildQuery">
+<form method="post" action="<% RT->Config->Get('WebPath') %><% $m->request_comp->path %>" name="BuildQuery">
 <input type="hidden" class="hidden" name="SavedSearchId" value="<% $saved_search{'Id'} %>" />
 <input type="hidden" class="hidden" name="ResultPage" value="<% $ResultPage %>" />
 <input type="hidden" class="hidden" name="BaseQuery" value="<% $BaseQuery %>" />
 
 <input type="hidden" class="hidden" name="Query" value="<% $query{'Query'} %>" />
 <input type="hidden" class="hidden" name="Format" value="<% $query{'Format'} %>" />
-<table width="100%">
-<tr>
-<td valign="top" class="boxcontainer">
-<& /Search/Elements/PickCriteria, cfqueues => $queues &>
 
-<& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&>
+<div id="pick-criteria"><& /Search/Elements/PickCriteria, cfqueues => $queues &></div>
 
-</td>
-<td valign="top" class="boxcontainer">
+<& /Elements/Submit, Label => loc('Add these terms'), Name => 'AddClause' &>
+<& /Elements/Submit, Label => loc('Add these terms and Search'), Name => 'DoSearch' &>
+
+<div id="editquery">
 <& /Search/Elements/EditQuery,
     %ARGS,
     actions => \@actions,
     optionlist => $optionlist,
     Description => $saved_search{'Description'},
 &>
-<br />
+</div>
 
+<div id="editsearches">
 <& /Search/Elements/EditSearches, %saved_search, CurrentSearch => \%query &>
-</td>
-</tr>
-</table>
+</div>
 
+<span id="display-options">
 <& /Search/Elements/DisplayOptions, %ARGS, %query, cfqueues => $queues &>
+</span>
+
+<& /Elements/Submit,
+    Label => loc('Update format and Search'),
+    Name => 'DoSearch',
+    id => "formatbuttons",
+&>
+
 </form>
 <%ARGS>
 $BaseQuery    => ''

commit aa0df32d0bdb3a4a41ffad9aefb0f93435403857
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 1 17:16:14 2009 +0400

    Override LargeContent for IP field
    
    IP's content is two Content and LargeContent, but real end user
    value should be returned only by Content method. If IP CF is
    changed from many values to one value then we hit different
    code paths where LargeContent is checked by RT's code.

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index e858f26..edeb361 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -450,6 +450,16 @@ wrap 'RT::ObjectCustomFieldValue::Content',
     };
 }
 
+# don't return LargeContent to avoid making angry RT's AddCFV logic
+wrap 'RT::ObjectCustomFieldValue::LargeContent',
+    pre  => sub {
+        my $obj = $_[0];
+        my $cf = GetCustomField( 'IP' );
+        return unless $cf && $cf->id;
+        return unless $obj->CustomField == $cf->id;
+        $_[-1] = undef;
+    };
+
 
 { # ACL checks for multiple constituencies
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list