[Rt-commit] rt branch, 4.4/disabled-articles, repushed
? sunnavy
sunnavy at bestpractical.com
Tue Nov 25 11:38:54 EST 2014
The branch 4.4/disabled-articles was deleted and repushed:
was 500329f55d70fd1bf89d8dda259f71da2aa88546
now 4644c1f49207ad4d3f71dbbbf7f1472139cc03df
1: 500329f ! 1: 4644c1f don't delete articles, just disable them.
@@ -91,6 +91,22 @@
diff --git a/lib/RT/Article.pm b/lib/RT/Article.pm
--- a/lib/RT/Article.pm
+++ b/lib/RT/Article.pm
+@@
+ CustomFields => {},
+ Links => {},
+ Topics => [],
++ Disabled => 0,
+ @_
+ );
+
+@@
+ Name => $args{'Name'},
+ Class => $class->Id,
+ Summary => $args{'Summary'},
++ Disabled => $args{'Disabled'},
+ );
+ unless ($id) {
+ $RT::Handle->Rollback();
@@
=head2 Delete
@@ -368,6 +384,26 @@
--- a/share/html/Articles/Article/Edit.html
+++ b/share/html/Articles/Article/Edit.html
@@
+ my %create_args;
+ my %CFContent;
+ my $EditClass = 1;
++
++if ( $ARGS{SetEnabled} ) {
++ $ARGS{Disabled} = $ARGS{Enabled} ? 0 : 1;
++}
++
+ if ( !$id ) {
+ $title = loc('Create a new article');
+ foreach my $arg ( sort keys %ARGS ) {
+@@
+ Name => $ARGS{'Name'},
+ Class => $ARGS{'Class'},
+ Topics => $ARGS{'Topics'},
++ Disabled => $ARGS{'Disabled'},
+ %create_args,
+ %cfs
+ );
+@@
Why => loc("Unable to load article") );
}
@@ -386,12 +422,11 @@
</tr>
+% if ($ARGS{'id'} eq 'new' || $ArticleObj->CurrentUserHasRight('DisableArticle')) {
+<tr>
-+<td class="label"><&|/l&>Disabled</&></td>
++<td class="label"></td>
+<td>
-+ <select name="Disabled">
-+ <option <% ( $ArticleObj->id && $ArticleObj->Disabled || $ARGS{'Disabled'} ) ? 'selected="selected"' : '' |n %> value="1"><&|/l&>Yes</&></option>
-+ <option <% ( $ArticleObj->id && $ArticleObj->Disabled || $ARGS{'Disabled'} ) ? '' : 'selected="selected"' |n %> value="0"><&|/l&>No</&></option>
-+ </select>
++ <input type="hidden" class="hidden" name="SetEnabled" value="1" />
++ <input type="checkbox" class="checkbox" id="Enabled" name="Enabled" value="1" <% ( $ArticleObj->id && $ArticleObj->Disabled || $ARGS{'Disabled'} ) ? '' : 'checked="checked"' |n %> />
++ <label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this custom field)</&></label>
+</td>
+</tr>
+% }
More information about the rt-commit
mailing list