[Rt-commit] rt branch, 4.0/disabled-articles, repushed
? sunnavy
sunnavy at bestpractical.com
Mon Oct 20 14:16:25 EDT 2014
The branch 4.0/disabled-articles was deleted and repushed:
was 231e30d8d5fbbecf7f01f17eb0f67cc38b0e158f
now 64df1a6c9e90168302c08b8c1b733db73b03f483
1: d875239 ! 1: 64df1a6 don't delete articles, just disable them.
@@ -51,6 +51,34 @@
Creator int(11) NOT NULL default '0',
Created datetime default NULL,
LastUpdatedBy int(11) NOT NULL default '0',
+
+diff --git a/etc/upgrade/4.0.23/schema.Oracle b/etc/upgrade/4.0.23/schema.Oracle
+new file mode 100644
+--- /dev/null
++++ b/etc/upgrade/4.0.23/schema.Oracle
+@@
++ALTER TABLE Articles ADD COLUMN Disabled NUMBER(11,0) DEFAULT 0 NOT NULL;
+
+diff --git a/etc/upgrade/4.0.23/schema.Pg b/etc/upgrade/4.0.23/schema.Pg
+new file mode 100644
+--- /dev/null
++++ b/etc/upgrade/4.0.23/schema.Pg
+@@
++ALTER TABLE Articles ADD COLUMN Disabled smallint NOT NULL DEFAULT 0;
+
+diff --git a/etc/upgrade/4.0.23/schema.SQLite b/etc/upgrade/4.0.23/schema.SQLite
+new file mode 100644
+--- /dev/null
++++ b/etc/upgrade/4.0.23/schema.SQLite
+@@
++ALTER TABLE Articles ADD COLUMN Disabled smallint NOT NULL DEFAULT 0;
+
+diff --git a/etc/upgrade/4.0.23/schema.mysql b/etc/upgrade/4.0.23/schema.mysql
+new file mode 100644
+--- /dev/null
++++ b/etc/upgrade/4.0.23/schema.mysql
+@@
++ALTER TABLE Articles ADD COLUMN Disabled int(2) NOT NULL DEFAULT 0;
diff --git a/lib/RT/Article.pm b/lib/RT/Article.pm
--- a/lib/RT/Article.pm
@@ -238,7 +266,7 @@
<td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Depends on'), Relation => 'DependsOn' &>:</td>
<td class="value">
% while (my $link = $Object->DependsOn->Next) {
-+% next if (UNIVERSAL::isa($link->TargetObj, 'RT::Article')) && $link->TargetObj->Disabled;
++% next if UNIVERSAL::isa($link->TargetObj, 'RT::Article') && $link->TargetObj->Disabled;
<input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
<& ShowLink, URI => $link->TargetURI &><br />
% }
@@ -246,7 +274,7 @@
<td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Depended on by'), Relation => 'DependedOnBy' &>:</td>
<td class="value">
% while (my $link = $Object->DependedOnBy->Next) {
-+% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Article')) && $link->BaseObj->Disabled;
++% next if UNIVERSAL::isa($link->BaseObj, 'RT::Article') && $link->BaseObj->Disabled;
<input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
<& ShowLink, URI => $link->BaseURI &><br />
% }
@@ -254,7 +282,7 @@
<td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Parents'), Relation => 'Parents' &>:</td>
<td class="value">
% while (my $link = $Object->MemberOf->Next) {
-+% next if (UNIVERSAL::isa($link->TargetObj, 'RT::Article')) && $link->TargetObj->Disabled;
++% next if UNIVERSAL::isa($link->TargetObj, 'RT::Article') && $link->TargetObj->Disabled;
<input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
<& ShowLink, URI => $link->TargetURI &><br />
% }
@@ -262,7 +290,7 @@
<td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Children'), Relation => 'Children' &>:</td>
<td class="value">
% while (my $link = $Object->Members->Next) {
-+% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Article')) && $link->BaseObj->Disabled;
++% next if UNIVERSAL::isa($link->BaseObj, 'RT::Article') && $link->BaseObj->Disabled;
<input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
<& ShowLink, URI => $link->BaseURI &><br />
% }
@@ -270,7 +298,7 @@
<td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Refers to'), Relation => 'RefersTo' &>:</td>
<td class="value">
% while (my $link = $Object->RefersTo->Next) {
-+% next if (UNIVERSAL::isa($link->TargetObj, 'RT::Article')) && $link->TargetObj->Disabled;
++% next if UNIVERSAL::isa($link->TargetObj, 'RT::Article') && $link->TargetObj->Disabled;
<input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
<& ShowLink, URI => $link->TargetURI &><br />
%}
@@ -278,7 +306,7 @@
<td class="value">
% while (my $link = $Object->ReferredToBy->Next) {
% # Skip reminders
-+% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Article')) && $link->BaseObj->Disabled;
++% next if UNIVERSAL::isa($link->BaseObj, 'RT::Article') && $link->BaseObj->Disabled;
% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder');
<input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
<& ShowLink, URI => $link->BaseURI &><br />
@@ -290,7 +318,7 @@
while ( my $link = $depends_on->Next ) {
my $target = $link->TargetObj;
-+ next if $target->isa('RT::Article') && $target->Disabled;
++ next if UNIVERSAL::isa($target,'RT::Article') && $target->Disabled;
if ( $target && $target->isa('RT::Ticket') ) {
if ( $target->QueueObj->IsInactiveStatus( $target->Status ) ) {
push( @inactive, $link->TargetURI );
@@ -298,7 +326,7 @@
<td class="value">
<ul>
% while (my $Link = $Ticket->DependedOnBy->Next) {
-+% next if (UNIVERSAL::isa($Link->BaseObj, 'RT::Article')) && $Link->BaseObj->Disabled;
++% next if UNIVERSAL::isa($Link->BaseObj, 'RT::Article') && $Link->BaseObj->Disabled;
<li><& ShowLink, URI => $Link->BaseURI &></li>
% }
</ul>
@@ -306,7 +334,7 @@
<td class="value">
<ul>
% while (my $Link = $Ticket->RefersTo->Next) {
-+% next if (UNIVERSAL::isa($Link->TargetObj, 'RT::Article')) && $Link->TargetObj->Disabled;
++% next if UNIVERSAL::isa($Link->TargetObj, 'RT::Article') && $Link->TargetObj->Disabled;
<li><& ShowLink, URI => $Link->TargetURI &></li>
% }
</ul>
@@ -314,7 +342,7 @@
<td class="value">
<ul>
% while (my $Link = $Ticket->ReferredToBy->Next) {
-+% next if (UNIVERSAL::isa($Link->BaseObj, 'RT::Article')) && $Link->BaseObj->Disabled;
++% next if UNIVERSAL::isa($Link->BaseObj, 'RT::Article') && $Link->BaseObj->Disabled;
% next if (UNIVERSAL::isa($Link->BaseObj, 'RT::Ticket') && $Link->BaseObj->Type eq 'reminder');
<li><& ShowLink, URI => $Link->BaseURI &></li>
% }
@@ -377,4 +405,3 @@
# NOT OK
#$RT::Handle->SimpleQuery("DELETE FROM Links");
-
2: 231e30d < -: ------- upgrade steps for Disabled column in Articles
More information about the rt-commit
mailing list