summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-01-25 17:13:14 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-01-25 19:15:59 +0100
commita6737a8116e6145d1556a5359078103734f26a34 (patch)
treef053cce28155d630eca62c79b48156ebb67ed752
parent37f18efd3d3195395d029b25a20fda472691cbe9 (diff)
downloadDefaultRecipient-a6737a8116e6145d1556a5359078103734f26a34.tar.gz
DefaultRecipient-a6737a8116e6145d1556a5359078103734f26a34.tar.bz2
DefaultRecipient-a6737a8116e6145d1556a5359078103734f26a34.zip
Add AddCc and AddBcc.
AddBcc does not work because the default template does not support to prefill the bcc.
-rw-r--r--DefaultRecipient.sopm2
-rw-r--r--Kernel/Modules/AdminDefaultRecipient.pm4
-rw-r--r--Kernel/Output/HTML/DefaultRecipient.pm23
-rw-r--r--Kernel/Output/HTML/Standard/AdminDefaultRecipient.tt16
-rw-r--r--Kernel/System/DefaultRecipient.pm31
5 files changed, 59 insertions, 17 deletions
diff --git a/DefaultRecipient.sopm b/DefaultRecipient.sopm
index 5f3a160..4ee8dd0 100644
--- a/DefaultRecipient.sopm
+++ b/DefaultRecipient.sopm
@@ -25,6 +25,8 @@
<Column Name="title" Required="true" Size="250" Type="VARCHAR"/>
<Column Name="remove_to" Required="true" Type="SMALLINT"/>
<Column Name="add_to" Required="false" Size="255" Type="VARCHAR"/>
+ <Column Name="add_cc" Required="false" Size="255" Type="VARCHAR"/>
+ <Column Name="add_bcc" Required="false" Size="255" Type="VARCHAR"/>
<Column Name="comments" Required="false" Size="250" Type="VARCHAR"/>
<Column Name="create_time" Required="true" Type="DATE"/>
<Column Name="create_by" Required="true" Type="INTEGER"/>
diff --git a/Kernel/Modules/AdminDefaultRecipient.pm b/Kernel/Modules/AdminDefaultRecipient.pm
index df730ee..1704bd1 100644
--- a/Kernel/Modules/AdminDefaultRecipient.pm
+++ b/Kernel/Modules/AdminDefaultRecipient.pm
@@ -74,7 +74,7 @@ sub Run {
my $DefaultRecipientObject = $Kernel::OM->Get('Kernel::System::DefaultRecipient');
my @NewIDs = $Self->{ParamObject}->GetArray( Param => 'IDs' );
my ( %GetParam, %Errors );
- for my $Parameter (qw(ID Title RemoveTo AddTo Comment)) {
+ for my $Parameter (qw(ID Title RemoveTo AddTo AddCc AddBcc Comment)) {
$GetParam{$Parameter} = $Self->{ParamObject}->GetParam(
Param => $Parameter
);
@@ -164,7 +164,7 @@ sub Run {
my @NewIDs = $Self->{ParamObject}->GetArray( Param => 'IDs' );
my ( %GetParam, %Errors );
- for my $Parameter (qw(ID Title RemoveTo AddTo Comment)) {
+ for my $Parameter (qw(ID Title RemoveTo AddTo AddCc AddBcc Comment)) {
$GetParam{$Parameter} = $Self->{ParamObject}->GetParam( Param => $Parameter );
}
diff --git a/Kernel/Output/HTML/DefaultRecipient.pm b/Kernel/Output/HTML/DefaultRecipient.pm
index 775abb2..3965d9a 100644
--- a/Kernel/Output/HTML/DefaultRecipient.pm
+++ b/Kernel/Output/HTML/DefaultRecipient.pm
@@ -64,7 +64,9 @@ sub Run {
);
my $RemoveTo = 0;
- my @Addresses = ();
+ my @ToAddresses = ();
+ my @CcAddresses = ();
+ my @BccAddresses = ();
foreach my $ID ( values %MappedDefaultRecipient ) {
my %DefaultRecipient = $Self->{DefaultRecipientObject}->Get(
ID => $ID,
@@ -72,7 +74,13 @@ sub Run {
$RemoveTo = 1 if $DefaultRecipient{RemoveTo};
if ( $DefaultRecipient{AddTo} ne '' ) {
- push @Addresses, $DefaultRecipient{AddTo};
+ push @ToAddresses, $DefaultRecipient{AddTo};
+ }
+ if ( $DefaultRecipient{AddCc} ne '' ) {
+ push @CcAddresses, $DefaultRecipient{AddCc};
+ }
+ if ( $DefaultRecipient{AddBcc} ne '' ) {
+ push @BccAddresses, $DefaultRecipient{AddBcc};
}
}
@@ -88,7 +96,7 @@ sub Run {
}
# add new addresses
- foreach my $Address ( @Addresses ) {
+ foreach my $Address ( @ToAddresses ) {
$Self->{LayoutObject}->Block(
Name => 'PreFilledToRow',
Data => {
@@ -97,6 +105,15 @@ sub Run {
);
}
+ foreach my $Address ( @CcAddresses ) {
+ $Self->{LayoutObject}->Block(
+ Name => 'PreFilledCcRow',
+ Data => {
+ Email => $Address,
+ },
+ );
+ }
+
return $Param{Data};
}
diff --git a/Kernel/Output/HTML/Standard/AdminDefaultRecipient.tt b/Kernel/Output/HTML/Standard/AdminDefaultRecipient.tt
index 03ec6a3..84d4dbb 100644
--- a/Kernel/Output/HTML/Standard/AdminDefaultRecipient.tt
+++ b/Kernel/Output/HTML/Standard/AdminDefaultRecipient.tt
@@ -72,6 +72,8 @@
<th>[% Translate("Title") | html %]</th>
<th>[% Translate("Remove 'To'") | html %]</th>
<th>[% Translate("New 'To'") | html %]</th>
+ <th>[% Translate("New 'Cc'") | html %]</th>
+ <th>[% Translate("New 'Bcc'") | html %]</th>
<th>[% Translate("Comment") | html %]</th>
<th>[% Translate("Changed") | html %]</th>
<th>[% Translate("Created") | html %]</th>
@@ -96,6 +98,8 @@
</td>
<td>[% Translate(Data.RemoveToYesNo) | html %]</td>
<td>[% Data.AddTo | html %]</td>
+ <td>[% Data.AddCc | html %]</td>
+ <td>[% Data.AddBcc | html %]</td>
<td title="[% Data.Comment | html %]">[% Data.Comment | truncate(26) | html %]</td>
<td>[% Data.ChangeTime | Localize("TimeShort") %]</td>
<td>[% Data.CreateTime | Localize("TimeShort") %]</td>
@@ -163,6 +167,18 @@
</div>
<div class="Clear"></div>
+ <label for="AddCc">[% Translate("New 'Cc'") | html %]:</label>
+ <div class="Field">
+ <input type="text" name="AddCc" id="AddCc" value="[% Data.AddCc | html %]" class="W50pc" maxlength="200"/>
+ </div>
+ <div class="Clear"></div>
+
+ <label for="AddBcc">[% Translate("New 'Bcc'") | html %]:</label>
+ <div class="Field">
+ <input type="text" name="AddBcc" id="AddBcc" value="[% Data.AddBcc | html %]" class="W50pc" maxlength="200"/>
+ </div>
+ <div class="Clear"></div>
+
<label for="Comment">[% Translate("Comment") | html %]:</label>
<div class="Field">
<input type="text" name="Comment" id="Comment" value="[% Data.Comment | html %]" class="W50pc" maxlength="250"/>
diff --git a/Kernel/System/DefaultRecipient.pm b/Kernel/System/DefaultRecipient.pm
index d570dca..7bee4af 100644
--- a/Kernel/System/DefaultRecipient.pm
+++ b/Kernel/System/DefaultRecipient.pm
@@ -31,7 +31,7 @@ sub Add {
my ( $Self, %Param ) = @_;
# check needed stuff
- for my $Needed (qw(Title RemoveTo AddTo Comment UserID)) {
+ for my $Needed (qw(Title RemoveTo AddTo AddCc AddBcc Comment UserID)) {
if ( ! defined $Param{$Needed} ) {
my $LogObject = $Kernel::OM->Get('Kernel::System::Log');
$LogObject->Log(
@@ -47,13 +47,16 @@ sub Add {
# insert new DefaultRecipient
return if !$DBObject->Do(
SQL => 'INSERT INTO default_recipient '
- . '(title, remove_to, add_to, comments, '
+ . '(title, remove_to, add_to, add_cc, add_bcc, comments, '
. ' create_time, create_by, change_time, change_by) '
- . 'VALUES (?, ?, ?, ?, current_timestamp, ?, current_timestamp, ?)',
+ . 'VALUES (?, ?, ?, ?, ?, ?, '
+ . 'current_timestamp, ?, current_timestamp, ?)',
Bind => [
\$Param{Title},
\$Param{RemoveTo},
\$Param{AddTo},
+ \$Param{AddCc},
+ \$Param{AddBcc},
\$Param{Comment},
\$Param{UserID},
\$Param{UserID},
@@ -86,7 +89,7 @@ sub Update {
my ( $Self, %Param ) = @_;
# check needed stuff
- for my $Needed (qw(ID Title RemoveTo AddTo Comment UserID)) {
+ for my $Needed (qw(ID Title RemoveTo AddTo AddCc AddBcc Comment UserID)) {
if ( ! defined $Param{$Needed} ) {
my $LogObject = $Kernel::OM->Get('Kernel::System::Log');
$LogObject->Log(
@@ -102,13 +105,15 @@ sub Update {
# insert new DefaultRecipient
return if !$DBObject->Do(
SQL => 'UPDATE default_recipient SET title = ?, remove_to = ?, '
- . 'add_to = ?, comments = ?, change_by = ?, '
- . 'change_time = current_timestamp '
+ . 'add_to = ?, add_cc = ?, add_bcc = ?, comments = ?, '
+ . 'change_by = ?, change_time = current_timestamp '
. 'WHERE id = ?',
Bind => [
\$Param{Title},
\$Param{RemoveTo},
\$Param{AddTo},
+ \$Param{AddCc},
+ \$Param{AddBcc},
\$Param{Comment},
\$Param{UserID},
\$Param{ID},
@@ -135,7 +140,7 @@ sub Get {
# get RrsponseChangeDefaultTO obejct
return if !$DBObject->Prepare(
- SQL => 'SELECT id, title, remove_to, add_to, '
+ SQL => 'SELECT id, title, remove_to, add_to, add_cc, add_bcc, '
. 'comments, create_time, create_by, change_time, change_by '
. 'FROM default_recipient WHERE id = ?',
Bind => [ \$Param{ID} ],
@@ -149,11 +154,13 @@ sub Get {
Title => $Data[1],
RemoveTo => $Data[2],
AddTo => $Data[3],
- Comment => $Data[4],
- CreateTime => $Data[5],
- CreateBy => $Data[6],
- ChangeTime => $Data[7],
- ChangeBy => $Data[8],
+ AddCc => $Data[4],
+ AddBcc => $Data[5],
+ Comment => $Data[6],
+ CreateTime => $Data[7],
+ CreateBy => $Data[8],
+ ChangeTime => $Data[9],
+ ChangeBy => $Data[10],
);
}