[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.0-177-g5634d7c
Shawn Moore
shawn at bestpractical.com
Fri May 13 18:24:01 EDT 2016
The branch, 4.4-trunk has been updated
via 5634d7cf2718fa001272bcd21585b9edbe83e453 (commit)
via 6a4172281f23e5142c9a3e99dbda4ad0624a18b6 (commit)
via 61992d4198cd704f6d23da9f59ccc706f0501a8c (commit)
via 7baea5a404cbf9e6f451c01bf3210b22007cee2e (commit)
via 68b6a66f75aeaf0911bf98668825f5881277bae1 (commit)
via 1e2b566543d20aa4dd9cf9da95e0c33a678c4c35 (commit)
via 853983b9dae6c147f934ea4b44267a30f0049747 (commit)
via dc0992c7c5df2a570efaf898bea766969e7b5a40 (commit)
via 1f71eb4411c44d7fe7986f908c8fce947d0d6c93 (commit)
via 0ae37834d2e6b9ca8bcd3e16aa6c59822fb6ad29 (commit)
via 40b9adb822c00a7997e278e4ec4eb2157b66c2d9 (commit)
via 864797ca30b042955cfbc1775710dcc0044c37ab (commit)
via 8e5a04b1afc10f029f88fe2eaeb0166a7fe0d2bf (commit)
via 956fa9cf097579575fbefb3f25a3c8f7e9e62144 (commit)
via 38c07946928f04a7b5056a3fb64ecaabba5165ee (commit)
via d1e91a728dba3ded741aec317103e0c1653169fb (commit)
via f5886b40a95914b67501e1306fb768aab86ddddb (commit)
via 5e075862100c7ebf6604e790a045b4c0fa8765da (commit)
via c7245e49ccf1889f169c43b57328085931258255 (commit)
via 736f2da209c0aade1a33a4c6f2f4a03c7c72ec4d (commit)
via 56431b1d14d3ce648f148fbf879d1d68d4549870 (commit)
via 3b8bd6c41ff5fb46e05de1c56e43b4b41b884fe6 (commit)
via e283f469bc77d7dc7e08307d93dabbfbb35f0cf8 (commit)
via b38106f3a41c50f9db3310b174fc9bdf4397ae04 (commit)
via 084c7dba4d846c2935c2d24f4a9333593133bf01 (commit)
via 6be49169f95e21d83a61efea70f9ef0e9c81cf21 (commit)
via 72dc76913f9054e2ed271a6cb88f3c5d063d207f (commit)
via c93620ca042609a7f0036b435791cc5acf15f0a0 (commit)
via 6c46b1d0b09aa91bc56d55f5b6c690163463ecaf (commit)
via a88e47e12a1803c4f8308780f3683a1dc7310ddd (commit)
via 4028723fee8d7a6b0e21694492d260942e662f69 (commit)
via 27062ef0e8ad32466177f123a9cf6307455bf59c (commit)
via 4e74300a96710503f0ca68dd1aa92ee38a18dfa3 (commit)
via 4b5d6a7d822bff8d9d7fefac800a6ff4a1aad1e8 (commit)
via 150f210b9a49730775d633b9c647dcc88fb3629d (commit)
via e6c84c1098d5940ab45a683d1f4197f9e57e7e5f (commit)
via b2f4eecf1aa53fc2186a87f7059a8345dc5ff027 (commit)
via a92bf7c539238ab93d3d608fb173111e8aa1f35a (commit)
via 4db7df0ac6d12095c22c1b858b600857ce0079b5 (commit)
from 30de01288f6cd50c28eaf700c2c01578923a5dc2 (commit)
Summary of changes:
Makefile.in | 4 +-
README | 4 +-
configure.ac | 10 ++
docs/UPGRADING-4.2 | 4 +-
docs/full_text_indexing.pod | 7 +
etc/RT_Config.pm.in | 15 +++
etc/upgrade/4.0.1/content | 5 +
lib/RT/CustomField.pm | 2 +-
lib/RT/Interface/Web.pm | 3 +-
lib/RT/Shredder/Record.pm | 174 -------------------------
sbin/rt-fulltext-indexer.in | 18 +++
share/html/Admin/CustomFields/Modify.html | 3 +-
share/html/Dashboards/Subscription.html | 9 +-
share/html/Elements/BulkCustomFields | 8 +-
share/html/Elements/CollectionAsTable/Row | 15 ++-
share/html/Elements/ShowTransactionAttachments | 8 +-
share/html/SelfService/Helpers/Upload/Add | 2 +-
share/html/Ticket/Modify.html | 4 +-
t/customfields/group_rights.t | 68 ++++++++++
19 files changed, 170 insertions(+), 193 deletions(-)
delete mode 100644 lib/RT/Shredder/Record.pm
create mode 100644 t/customfields/group_rights.t
- Log -----------------------------------------------------------------
commit 5634d7cf2718fa001272bcd21585b9edbe83e453
Merge: 30de012 6a41722
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Fri May 13 18:23:48 2016 -0400
Merge branch '4.2-trunk' into 4.4-trunk
diff --cc sbin/rt-fulltext-indexer.in
index 2c34e80,ceffc97..fd8bb1d
--- a/sbin/rt-fulltext-indexer.in
+++ b/sbin/rt-fulltext-indexer.in
@@@ -213,11 -203,19 +215,19 @@@ sub process_bulk_insert
my ($attachments) = @_;
my @insert;
my $found = 0;
+
while ( my $a = $attachments->Next ) {
debug("Found attachment #". $a->id );
+ if ( $max_size and $a->ContentLength > $max_size ){
+ debug("Attachment #" . $a->id . " is " . $a->ContentLength .
+ " bytes which is larger than configured MaxFulltextAttachmentSize " .
+ " of " . $max_size . ", skipping");
+ next;
+ }
+
my $text = $a->Content // "";
HTML::Entities::decode_entities($text) if $a->ContentType eq "text/html";
- push @insert, $text, $a->id;
+ push @insert, join("\n", $a->Subject // "", $text), $a->id;
$found++;
}
return unless $found;
diff --cc share/html/Dashboards/Subscription.html
index 61d38cc,83680ef..cb5ba16
--- a/share/html/Dashboards/Subscription.html
+++ b/share/html/Dashboards/Subscription.html
@@@ -174,22 -170,16 +174,23 @@@
</select>
</td></tr>
-<tr><td class="label">
-<&|/l&>Recipient</&>:
-</td><td class="value">
-<input name="Recipient" id="Recipient" size="30" value="<%$fields{Recipient} ? $fields{Recipient} : ''%>" />
-<div class="hints"><% loc("Leave blank to send to your current email address ([_1])", $session{'CurrentUser'}->EmailAddress) %></div>
+<tr><td align="right"><input type="checkbox" id="SuppressIfEmpty" name="SuppressIfEmpty" value="1" <% $fields{'SuppressIfEmpty'} ? 'checked="checked"' : "" |n %> /></td>
+<td><label for="SuppressIfEmpty"><&|/l&>Suppress if empty (Check this to avoid sending mail if all searches have no results)</&></label><br />
+<input type="hidden"class="hidden" name="SuppressIfEmpty-Magic" value=1 />
</td></tr>
-
+ % $m->callback( %ARGS, CallbackName => 'SubscriptionFormEnd', FieldsRef => \%fields,
+ % SubscriptionObj => $SubscriptionObj, DashboardObj => $Dashboard );
</table>
</&>
+
+<&| /Widgets/TitleBox, title => loc('Recipients') &>
+<& Elements/SubscriptionRecipients,
+ UserField => $UserField, UserString => $UserString, UserOp => $UserOp,
+ GroupString => $GroupString, GroupOp => $GroupOp, GroupField => $GroupField,
+ Recipients => $fields{Recipients},
+ IsFirstSubscription => $SubscriptionObj ? 0 : 1 &>
+</&>
+
</td>
</tr>
</table>
@@@ -231,12 -213,14 +232,15 @@@ my %fields =
Dow => 'Monday',
Dom => 1,
Rows => 20,
- Recipient => '',
+ Recipients => { Users => [], Groups => [] },
Fow => 1,
Counter => 0,
+ SuppressIfEmpty => 0,
);
+ $m->callback( %ARGS, CallbackName => 'SubscriptionFields', FieldsRef => \%fields,
+ SubscriptionObj => $SubscriptionObj, DashboardObj => $Dashboard);
+
# update any fields with the values from the subscription object
if ($SubscriptionObj) {
for my $field (keys %fields) {
@@@ -248,66 -232,22 +252,69 @@@
for my $field (keys %fields) {
next if $field eq 'DashboardId'; # but this one is immutable
$fields{$field} = $ARGS{$field}
- if defined($ARGS{$field});
+ if defined($ARGS{$field}) || $ARGS{$field.'-Magic'};
}
+ $m->callback( %ARGS, CallbackName => 'MassageSubscriptionFields', FieldsRef => \%fields,
+ SubscriptionObj => $SubscriptionObj, DashboardObj => $Dashboard);
+
# this'll be defined on submit
if (defined $ARGS{Save}) {
- my $ok = 1;
-
- # validation
- if ($fields{Recipient}) {
- my @addresses = Email::Address->parse($fields{Recipient});
- if (@addresses == 0) {
- push @results, loc('Recipient must be an email address');
- $ok = 0;
+ # update recipients
+ for my $key (keys %ARGS) {
+ my $val = $ARGS{$key};
+ if ( $key =~ /^Dashboard-Subscription-Email-\d+$/ && $val ) {
+ my @recipients = @{ $fields{Recipients}->{Users} };
+
+ for ( RT::EmailParser->ParseEmailAddress( $val ) ) {
+ my ( $email, $name ) = ( $_->address, $_->name );
+
+ my $user = RT::User->new($session{CurrentUser});
+ $user->LoadOrCreateByEmail(
+ EmailAddress => $email,
+ RealName => $name,
+ Comments => 'Autocreated when added as a dashboard subscription recipient',
+ );
+
+ my $is_prev_recipient = grep { $_ == $user->id } @recipients;
+ if ( not $is_prev_recipient ) {
+ push @recipients, $user->id;
+ push @results, loc("[_1] added to dashboard subscription recipients", $email);
+ }
+ }
+ @{ $fields{Recipients}->{Users} } = uniq @recipients;
+
+ } elsif ($key =~ /^Dashboard-Subscription-(Users|Groups)-(\d+)$/) {
+ my ($mode, $type, $id) = ('', $1, $2);
+ my @recipients = @{ $fields{Recipients}->{$type} };
+
+ # find out proper value for user/group checkbox
+ my $add_keep_recipient = ref $ARGS{$key} eq 'ARRAY' ?
+ grep { $_ } @{ $ARGS{$key} } :
+ $ARGS{$key};
+
+ my $record; # hold user/group object
+ if ($type eq 'Users') {
+ my $user = RT::User->new($session{CurrentUser});
+ $user->Load( $id );
+ $record = $user;
+ } elsif ($type eq 'Groups') {
+ my $group = RT::Group->new($session{CurrentUser});
+ $group->Load( $id );
+ $record = $group;
+ }
+
+ my $is_prev_recipient = grep { $_ == $id } @recipients;
+
+ if ($add_keep_recipient and not $is_prev_recipient) { # Add User/Group
+ push @recipients, $id;
+ push @results, loc("[_1] added to dashboard subscription recipients", $record->Name);
+ } elsif (not $add_keep_recipient and $is_prev_recipient) { # Remove User/Group
+ @recipients = grep { $_ != $id } @recipients;
+ push @results, loc("[_1] removed from dashboard subscription recipients", $record->Name);
+ }
+
+ @{ $fields{Recipients}->{$type} } = uniq @recipients;
}
}
diff --cc share/html/Elements/BulkCustomFields
index 30b3624,2c3af38..88b9f58
--- a/share/html/Elements/BulkCustomFields
+++ b/share/html/Elements/BulkCustomFields
@@@ -81,13 -81,17 +81,17 @@@
<td><& /Elements/EditCustomFieldWikitext, @add &></td>
<td>
% } elsif ($cf->Type eq 'Date') {
-<td><& /Elements/EditCustomFieldDate, @add, Default => undef &></td>
-<td><& /Elements/EditCustomFieldDate, @del, Default => undef &><br />
+<td><& /Elements/EditCustomFieldDate, @add &></td>
+<td><& /Elements/EditCustomFieldDate, @del &><br />
% } elsif ($cf->Type eq 'DateTime') {
% # Pass datemanip format to prevent another tz date conversion
- <td><& /Elements/EditCustomFieldDateTime, @add, Format => 'datemanip' &></td>
- <td><& /Elements/EditCustomFieldDateTime, @del, Format => 'datemanip' &><br />
+ <td><& /Elements/EditCustomFieldDateTime, @add, Default => undef, Format => 'datemanip' &></td>
+ <td><& /Elements/EditCustomFieldDateTime, @del, Default => undef, Format => 'datemanip' &><br />
+ % } elsif ($cf->Type eq 'Autocomplete') {
+ <td><& /Elements/EditCustomFieldAutocomplete, @add &></td>
+ <td><& /Elements/EditCustomFieldAutocomplete, @del &><br />
% } else {
+ <td colspan="2"><em><&|/l&>(Unsupported custom field type)</&></em></td>
% $RT::Logger->crit("Unknown CustomField type: " . $cf->Type);
% next
% }
diff --cc share/html/Elements/ShowTransactionAttachments
index d9aa8ba,e0a4b50..34a6ad1
--- a/share/html/Elements/ShowTransactionAttachments
+++ b/share/html/Elements/ShowTransactionAttachments
@@@ -56,15 -56,14 +56,19 @@@ foreach my $message ( @{ $Attachments->
);
my $name = defined $message->Filename && length $message->Filename ? $message->Filename : '';
- if ( $message->ContentLength or $name ) {
+ my $should_render_download = $message->ContentLength || $name;
+
+ $m->callback(CallbackName => 'BeforeAttachment', ARGSRef => \%ARGS, Object => $Object, Transaction => $Transaction, Attachment => $message, Name => $name, ShouldRenderDownload => \$should_render_download);
+
+ if ($should_render_download) {
</%PERL>
<div class="downloadattachment">
-<a href="<% $AttachmentPath %>/<% $Transaction->Id %>/<% $message->Id %>/<% $name | un%>"><&|/l&>Download</&> <% length $name ? $name : loc('(untitled)') %></a>\
+% if (my $url = RT->System->ExternalStorageURLFor($message)) {
+<a href="<% $url %>">
+% } else {
- <a href="<% $AttachmentPath %>/<% $Transaction->Id %>/<% $message->Id %>/<% $name | u%>">
++<a href="<% $AttachmentPath %>/<% $Transaction->Id %>/<% $message->Id %>/<% $name | un %>">
+% }
+<&|/l&>Download</&> <% length $name ? $name : loc('(untitled)') %></a>\
% if ( $DownloadableHeaders && ! length $name && $message->ContentType =~ /text/ ) {
/ <a href="<% $AttachmentPath %>/WithHeaders/<% $message->Id %>"><% loc('with headers') %></a>
% }
diff --cc share/html/SelfService/Helpers/Upload/Add
index 53c3dab,0000000..2ab9854
mode 100644,000000..100644
--- a/share/html/SelfService/Helpers/Upload/Add
+++ b/share/html/SelfService/Helpers/Upload/Add
@@@ -1,58 -1,0 +1,58 @@@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
- %# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
++%# This software is Copyright (c) 1996-2016 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 }}}
+<%args>
+$Token => ''
+</%args>
+
+<%init>
+
+ProcessAttachments( Token => $Token, ARGSRef => \%ARGS );
+$r->content_type('application/json; charset=utf-8');
+$m->out( JSON({status => 'success'}) );
+$m->abort;
+</%init>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list