Commit 1da33ff2 authored by Jesse Vincent's avatar Jesse Vincent
Browse files

Merging internationalization fixes from ourinternet

parent 47c18126
......@@ -551,7 +551,7 @@ while (my $link = $links->Next) {
require RT::Action::Notify; bless($self, 'RT::Action::Notify');
$self->{Argument} = 'Requestor'; $self->Prepare;
return $passed;
return 0; # ignore $passed;
# ------------------------------------------------------------------- #
],
CustomCommitCode => '"never needed"',
......
......@@ -74,10 +74,18 @@ sub SetReturnAddress {
}
unless ($self->TemplateObj->MIMEObj->head->get('From')) {
my $friendly_name = $self->TicketObj->QueueObj->Description ||
$self->TicketObj->QueueObj->Name;
$friendly_name =~ s/"/\\"/g;
$self->SetHeader('From', "\"$friendly_name\" <$replyto>");
if ($RT::UseFriendlyFromLine) {
my $friendly_name = $self->TicketObj->QueueObj->Description ||
$self->TicketObj->QueueObj->Name;
$friendly_name =~ s/"/\\"/g;
$self->SetHeader( 'From',
sprintf($RT::FriendlyFromLineFormat,
$self->MIMEEncodeString( $friendly_name, $RT::EmailOutputEncoding ), $replyto),
);
}
else {
$self->SetHeader( 'From', $replyto );
}
}
unless ($self->TemplateObj->MIMEObj->head->get('Reply-To')) {
......
......@@ -294,5 +294,58 @@ sub WithRight {
);
}
# {{{ sub LimitToEnabled
=head2 LimitToEnabled
Only find items that haven\'t been disabled
=cut
sub LimitToEnabled {
my $self = shift;
my $alias = $self->Join(
TYPE => 'left',
ALIAS1 => 'main',
FIELD1 => 'id',
TABLE2 => 'Principals',
FIELD2 => 'ObjectId'
);
$self->Limit( ALIAS => $alias,
FIELD => 'Disabled',
VALUE => '0',
OPERATOR => '=' );
}
# }}}
# {{{ sub LimitToDisabled
=head2 LimitToDeleted
Only find items that have been deleted.
=cut
sub LimitToDeleted {
my $self = shift;
my $alias = $self->Join(
TYPE => 'left',
ALIAS1 => 'main',
FIELD1 => 'id',
TABLE2 => 'Principals',
FIELD2 => 'ObjectId'
);
$self->{'find_disabled_rows'} = 1;
$self->Limit( ALIAS => $alias,
FIELD => 'Disabled',
OPERATOR => '=',
VALUE => '1'
);
}
# }}}
1;
This diff is collapsed.
......@@ -2936,7 +2936,7 @@ msgstr "七月"
#: lib/RT/Date.pm:417
msgid "Jul."
msgstr "01"
msgstr "07"
#: NOT FOUND IN SOURCE
msgid "July"
......@@ -2952,7 +2952,7 @@ msgstr "六月"
#: lib/RT/Date.pm:416
msgid "Jun."
msgstr "06."
msgstr "06"
#: NOT FOUND IN SOURCE
msgid "June"
......@@ -6414,3 +6414,7 @@ msgstr "年"
msgid "approving"
msgstr "待簽核"
#: lib/RT/Date.pm:331
msgid "CompanySpecific"
msgstr "各公司獨立顯示"
......@@ -463,7 +463,14 @@ sub MakeMIMEEntity {
#foreach my $filehandle (@filenames) {
my ( $fh, $temp_file ) = tempfile();
my ( $fh, $temp_file );
for ( 1 .. 10 ) {
# on NFS and NTFS, it is possible that tempfile() conflicts
# with other processes, causing a race condition. we try to
# accommodate this by pausing and retrying.
last if ($fh, $temp_file) = eval { tempfile() };
sleep 1;
}
binmode $fh; #thank you, windows
my ($buffer);
......
......@@ -206,7 +206,7 @@ sub LoadQueueTemplate {
Name => undef
);
return ( $self->LoadByCols( Name => $args{'Name'}, Queue => {'Queue'} ) );
return ( $self->LoadByCols( Name => $args{'Name'}, Queue => $args{'Queue'} ) );
}
......
......@@ -433,6 +433,10 @@ sub _Attach {
return ( 0, $self->loc("[_1]: no attachment specified", $self) );
}
if (ref($MIMEObject->{ME_Bodyhandle}) and ref($MIMEObject->{ME_Bodyhandle}{MBC_Data})) {
Encode::_utf8_on($_) for @{$MIMEObject->{ME_Bodyhandle}{MBC_Data}};
}
my $Attachment = new RT::Attachment( $self->CurrentUser );
$Attachment->Create(
TransactionId => $self->Id,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment