summaryrefslogtreecommitdiffstats
path: root/Kernel/System/DefaultTo.pm
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-01-21 05:08:23 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-01-22 02:20:40 +0100
commit2b1e9e6e95fc1e5a5a7052deca7217d192a8af06 (patch)
tree8e96f6fdcca8090940597ff23a6485613eacc848 /Kernel/System/DefaultTo.pm
parente904525e9dc0429f83ad0bfb93371076b01e7324 (diff)
downloadDefaultRecipient-2b1e9e6e95fc1e5a5a7052deca7217d192a8af06.tar.gz
DefaultRecipient-2b1e9e6e95fc1e5a5a7052deca7217d192a8af06.tar.bz2
DefaultRecipient-2b1e9e6e95fc1e5a5a7052deca7217d192a8af06.zip
DefaultTo: Add comments, create_* and change_* fields
Add some more database fields to be more like the default otrs interface and track the creation time and user and the last change time and user. Also now we have a comments field to add an additional description.
Diffstat (limited to 'Kernel/System/DefaultTo.pm')
-rw-r--r--Kernel/System/DefaultTo.pm29
1 files changed, 22 insertions, 7 deletions
diff --git a/Kernel/System/DefaultTo.pm b/Kernel/System/DefaultTo.pm
index c033189..ef631cb 100644
--- a/Kernel/System/DefaultTo.pm
+++ b/Kernel/System/DefaultTo.pm
@@ -36,7 +36,8 @@ sub Add {
my ( $Self, %Param ) = @_;
# check needed stuff
- for my $Needed (qw(Title RemoveDefault AddNew NewAddress)) {
+ for my $Needed (qw(Title RemoveDefault AddNew NewAddress Comment
+ UserID)) {
if ( !$Param{$Needed} ) {
$Self->{LogObject}->Log(
Priority => 'error',
@@ -49,13 +50,17 @@ sub Add {
# insert new DefaultTo
return if !$Self->{DBObject}->Do(
SQL => 'INSERT INTO default_to '
- . '(title, remove_default, add_new, new_address) '
- . 'VALUES (?, ?, ?, ?)',
+ . '(title, remove_default, add_new, new_address, comments, '
+ . ' create_time, create_by, change_time, change_by) '
+ . 'VALUES (?, ?, ?, ?, ?, current_timestamp, ?, current_timestamp, ?)',
Bind => [
\$Param{Title},
\$Param{RemoveDefault},
\$Param{AddNew},
\$Param{NewAddress},
+ \$Param{Comment},
+ \$Param{UserID},
+ \$Param{UserID},
],
);
@@ -84,7 +89,8 @@ sub Update {
my ( $Self, %Param ) = @_;
# check needed stuff
- for my $Needed (qw(ID Title RemoveDefault AddNew NewAddress)) {
+ for my $Needed (qw(ID Title RemoveDefault AddNew NewAddress Comment
+ UserID)) {
if ( !$Param{$Needed} ) {
$Self->{LogObject}->Log(
Priority => 'error',
@@ -96,14 +102,17 @@ sub Update {
# insert new DefaultTo
return if !$Self->{DBObject}->Do(
- SQL => 'UPDATE default_to SET title = ?, '
- . 'remove_default = ?, add_new = ?, new_address = ? '
+ SQL => 'UPDATE default_to SET title = ?, remove_default = ?, '
+ . 'add_new = ?, new_address = ?, comments = ?, change_by = ? '
+ . 'change_time = current_timestamp '
. 'WHERE id = ?',
Bind => [
\$Param{Title},
\$Param{RemoveDefault},
\$Param{AddNew},
\$Param{NewAddress},
+ \$Param{Comment},
+ \$Param{UserID},
\$Param{ID},
],
);
@@ -125,7 +134,8 @@ sub Get {
# get RrsponseChangeDefaultTO obejct
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT id, title, remove_default, add_new, new_address '
+ SQL => 'SELECT id, title, remove_default, add_new, new_address, '
+ . 'comments, create_time, create_by, change_time, change_by '
. 'FROM default_to WHERE id = ?',
Bind => [ \$Param{ID} ],
Limit => 1,
@@ -139,6 +149,11 @@ sub Get {
RemoveDefault => $Data[2],
AddNew => $Data[3],
NewAddress => $Data[4],
+ Comment => $Data[5],
+ CreateTime => $Data[6],
+ CreateBy => $Data[7],
+ ChangeTime => $Data[8],
+ ChangeBy => $Data[9],
);
}