[Rt-commit] rt branch, 4.4/disabled-articles, repushed
? sunnavy
sunnavy at bestpractical.com
Thu Jul 2 10:21:44 EDT 2015
The branch 4.4/disabled-articles was deleted and repushed:
was b89f38bdea056114555e253007045dfec484ae76
now 72e0909f39fad93e46015f6ac3e403f32694952f
1: d8b3882 = 1: d8b3882 fix description since "ModifyArticle" right can't _delete_ articles
-: ------- > 2: 17567bf abstract EditLink to reduce code duplication
2: 527aaf0 ! 3: a38893c don't delete articles, just disable them.
@@ -422,213 +422,17 @@
</%INIT>
<%ARGS>
-diff --git a/share/html/Elements/BulkLinks b/share/html/Elements/BulkLinks
---- a/share/html/Elements/BulkLinks
-+++ b/share/html/Elements/BulkLinks
-@@
- <td class="value">
- % if ( $hash{DependsOn} ) {
- % for my $link ( values %{$hash{DependsOn}} ) {
-- <input type="checkbox" class="checkbox" id="DeleteLink--<%$link->Type%>-<%$link->Target%>" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
-- <label for="DeleteLink--<%$link->Type%>-<%$link->Target%>"><& /Elements/ShowLink, URI => $link->TargetURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Target' &>
- % } }
- </td>
- </tr>
-@@
- <td class="value">
- % if ( $hash{DependedOnBy} ) {
- % for my $link ( values %{$hash{DependedOnBy}} ) {
-- <input type="checkbox" class="checkbox" id="DeleteLink-<%$link->Base%>-<%$link->Type%>-" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
-- <label for="DeleteLink-<%$link->Base%>-<%$link->Type%>-"><& /Elements/ShowLink, URI => $link->BaseURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Base' &>
- % } }
- </td>
- </tr>
-@@
- <td class="value">
- % if ( $hash{MemberOf} ) {
- % for my $link ( values %{$hash{MemberOf}} ) {
-- <input type="checkbox" class="checkbox" id="DeleteLink--<%$link->Type%>-<%$link->Target%>" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
-- <label for="DeleteLink--<%$link->Type%>-<%$link->Target%>"><& /Elements/ShowLink, URI => $link->TargetURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Target' &>
- % } }
- </td>
- </tr>
-@@
- <td class="value">
- % if ( $hash{Members} ) {
- % for my $link ( values %{$hash{Members}} ) {
-- <input type="checkbox" class="checkbox" id="DeleteLink-<%$link->Base%>-<%$link->Type%>-" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
-- <label for="DeleteLink-<%$link->Base%>-<%$link->Type%>-"><& /Elements/ShowLink, URI => $link->BaseURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Base' &>
- % } }
- </td>
- </tr>
-@@
- <td class="value">
- % if ( $hash{RefersTo} ) {
- % for my $link ( values %{$hash{RefersTo}} ) {
-- <input type="checkbox" class="checkbox" id="DeleteLink--<%$link->Type%>-<%$link->Target%>" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
-- <label for="DeleteLink--<%$link->Type%>-<%$link->Target%>"><& /Elements/ShowLink, URI => $link->TargetURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Target' &>
- % } }
- </td>
- </tr>
-@@
- <td class="value">
- % if ( $hash{ReferredToBy} ) {
- % for my $link ( values %{$hash{ReferredToBy}} ) {
--% # Skip reminders
--% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder');
-- <input type="checkbox" class="checkbox" id="DeleteLink-<%$link->Base%>-<%$link->Type%>-" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
-- <label for="DeleteLink-<%$link->Base%>-<%$link->Type%>-"><& /Elements/ShowLink, URI => $link->BaseURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Base' &>
- % } }
- </td>
- </tr>
-
diff --git a/share/html/Elements/EditLink b/share/html/Elements/EditLink
-new file mode 100644
---- /dev/null
+--- a/share/html/Elements/EditLink
+++ b/share/html/Elements/EditLink
@@
-+%# BEGIN BPS TAGGED BLOCK {{{
-+%#
-+%# COPYRIGHT:
-+%#
-+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
-+%# <sales 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., 51 Franklin Street, Fifth Floor, Boston, MA
-+%# 02110-1301 or visit their web page on the internet at
-+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-+%#
-+%#
-+%# 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 }}}
-+
-+% if ( $Mode eq 'Target' ) {
-+ <input type="checkbox" class="checkbox" id="DeleteLink--<%$Link->Type%>-<%$Link->Target%>" name="DeleteLink--<%$Link->Type%>-<%$Link->Target%>" value="1" />
-+ <label for="DeleteLink--<%$Link->Type%>-<%$Link->Target%>"><& ShowLink, URI => $Link->TargetURI &></label>
-+% } else {
-+ <input type="checkbox" class="checkbox" id="DeleteLink-<%$Link->Base%>-<%$Link->Type%>-" name="DeleteLink-<%$Link->Base%>-<%$Link->Type%>-" value="1" />
-+ <label for="DeleteLink-<%$Link->Base%>-<%$Link->Type%>-"><& ShowLink, URI => $Link->BaseURI &></label>
-+% }
-+
-+<br />
-+
-+<%INIT>
-+my $ModeObj = $Mode . 'Obj';
+
+ <%INIT>
+ my $ModeObj = $Mode . 'Obj';
+return if UNIVERSAL::isa($Link->$ModeObj, 'RT::Article') && $Link->$ModeObj->Disabled;
-+
-+# Skip reminders
-+return if $Mode eq 'Base' && $Link->Type eq 'RefersTo' && UNIVERSAL::isa($Link->BaseObj, 'RT::Ticket') && $Link->BaseObj->Type eq 'reminder';
-+</%INIT>
-+
-+<%ARGS>
-+$Link
-+$Mode
-+</%ARGS>
-
-diff --git a/share/html/Elements/EditLinks b/share/html/Elements/EditLinks
---- a/share/html/Elements/EditLinks
-+++ b/share/html/Elements/EditLinks
-@@
- <td class="labeltop"><& ShowRelationLabel, Object => $Object, Label => loc('Depends on').':', Relation => 'DependsOn' &></td>
- <td class="value">
- % while (my $link = $Object->DependsOn->Next) {
-- <input type="checkbox" class="checkbox" id="DeleteLink--<%$link->Type%>-<%$link->Target%>" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
-- <label for="DeleteLink--<%$link->Type%>-<%$link->Target%>"><& ShowLink, URI => $link->TargetURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Target' &>
- % }
- </td>
- </tr>
-@@
- <td class="labeltop"><& ShowRelationLabel, Object => $Object, Label => loc('Depended on by').':', Relation => 'DependedOnBy' &></td>
- <td class="value">
- % while (my $link = $Object->DependedOnBy->Next) {
-- <input type="checkbox" class="checkbox" id="DeleteLink-<%$link->Base%>-<%$link->Type%>-" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
-- <label for="DeleteLink-<%$link->Base%>-<%$link->Type%>-"><& ShowLink, URI => $link->BaseURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Base' &>
- % }
- </td>
- </tr>
-@@
- <td class="labeltop"><& ShowRelationLabel, Object => $Object, Label => loc('Parents').':', Relation => 'Parents' &></td>
- <td class="value">
- % while (my $link = $Object->MemberOf->Next) {
-- <input type="checkbox" class="checkbox" id="DeleteLink--<%$link->Type%>-<%$link->Target%>" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
-- <label for="DeleteLink--<%$link->Type%>-<%$link->Target%>"><& ShowLink, URI => $link->TargetURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Target' &>
- % }
- </td>
- </tr>
-@@
- <td class="labeltop"><& ShowRelationLabel, Object => $Object, Label => loc('Children').':', Relation => 'Children' &></td>
- <td class="value">
- % while (my $link = $Object->Members->Next) {
-- <input type="checkbox" class="checkbox" id="DeleteLink-<%$link->Base%>-<%$link->Type%>-" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
-- <label for="DeleteLink-<%$link->Base%>-<%$link->Type%>-"><& ShowLink, URI => $link->BaseURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Base' &>
- % }
- </td>
- </tr>
-@@
- <td class="labeltop"><& ShowRelationLabel, Object => $Object, Label => loc('Refers to').':', Relation => 'RefersTo' &></td>
- <td class="value">
- % while (my $link = $Object->RefersTo->Next) {
-- <input type="checkbox" class="checkbox" id="DeleteLink--<%$link->Type%>-<%$link->Target%>" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
-- <label for="DeleteLink--<%$link->Type%>-<%$link->Target%>"><& ShowLink, URI => $link->TargetURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Target' &>
- %}
- </td>
- </tr>
-@@
- <td class="labeltop"><& ShowRelationLabel, Object => $Object, Label => loc('Referred to by').':', Relation => 'ReferredToBy' &></td>
- <td class="value">
- % while (my $link = $Object->ReferredToBy->Next) {
--% # Skip reminders
--% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder');
-- <input type="checkbox" class="checkbox" id="DeleteLink-<%$link->Base%>-<%$link->Type%>-" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
-- <label for="DeleteLink-<%$link->Base%>-<%$link->Type%>-"><& ShowLink, URI => $link->BaseURI &></label><br />
-+ <& EditLink, Link => $link, Mode => 'Base' &>
- % }
- </td>
- </tr>
+
+ # Skip reminders
+ return if $Mode eq 'Base' && $Link->Type eq 'RefersTo' && UNIVERSAL::isa($Link->BaseObj, 'RT::Ticket') && $Link->BaseObj->Type eq 'reminder';
diff --git a/share/html/Elements/ShowLinksOfType b/share/html/Elements/ShowLinksOfType
--- a/share/html/Elements/ShowLinksOfType
3: 53b293b = 4: f47f71e hide reminders and disabled articles for REST
4: 137ec67 = 5: 296cbb0 hide reminders and disabled articles for ticket's relationship graph
5: b89f38b = 6: 72e0909 distinguish links by prefixing scheme for non-ticket ids
More information about the rt-commit
mailing list