[otrs-cvs] otrs/Kernel/System LinkObject.pm,1.58.4.2,1.58.4.3
"CVS commits notifications of OTRS.org" <[email protected]>
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv2010/Kernel/System
Modified Files:
Tag: rel-3_1
LinkObject.pm
Log Message:
Moved to new SQL code style.
Author: ub
Index: LinkObject.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/LinkObject.pm,v
retrieving revision 1.58.4.2
retrieving revision 1.58.4.3
diff -2 -u -d -r1.58.4.2 -r1.58.4.3
--- LinkObject.pm 21 Jan 2013 15:06:02 -0000 1.58.4.2
+++ LinkObject.pm 21 Jan 2013 16:14:39 -0000 1.58.4.3
@@ -458,11 +458,15 @@
# check if link already exists in database
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT source_object_id, source_key, state_id '
- . 'FROM link_relation '
- . 'WHERE ( ( source_object_id = ? AND source_key = ? '
- . 'AND target_object_id = ? AND target_key = ? ) '
- . 'OR ( source_object_id = ? AND source_key = ? '
- . 'AND target_object_id = ? AND target_key = ? ) ) '
- . 'AND type_id = ? ',
+ SQL => '
+ SELECT source_object_id, source_key, state_id
+ FROM link_relation
+ WHERE (
+ ( source_object_id = ? AND source_key = ?
+ AND target_object_id = ? AND target_key = ? )
+ OR
+ ( source_object_id = ? AND source_key = ?
+ AND target_object_id = ? AND target_key = ? )
+ )
+ AND type_id = ?',
Bind => [
\$Param{SourceObjectID}, \$Param{SourceKey},
@@ -595,8 +599,9 @@
return if !$Self->{DBObject}->Do(
- SQL => 'INSERT INTO link_relation '
- . '(source_object_id, source_key, target_object_id, target_key, '
- . 'type_id, state_id, create_time, create_by) '
- . 'VALUES (?, ?, ?, ?, ?, ?, current_timestamp, ?)',
+ SQL => '
+ INSERT INTO link_relation
+ (source_object_id, source_key, target_object_id, target_key,
+ type_id, state_id, create_time, create_by)
+ VALUES (?, ?, ?, ?, ?, ?, current_timestamp, ?)',
Bind => [
\$Param{SourceObjectID}, \$Param{SourceKey},
@@ -675,6 +680,8 @@
# delete the link
return if !$Self->{DBObject}->Do(
- SQL => 'DELETE FROM link_relation '
- . 'WHERE state_id = ? AND create_time < ?',
+ SQL => '
+ DELETE FROM link_relation
+ WHERE state_id = ?
+ AND create_time < ?',
Bind => [
\$StateID, \$DeleteTime,
@@ -744,11 +751,15 @@
# get the existing link
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT source_object_id, source_key, target_object_id, target_key, state_id '
- . 'FROM link_relation '
- . 'WHERE ((source_object_id = ? AND source_key = ? '
- . 'AND target_object_id = ? AND target_key = ? ) '
- . 'OR ( source_object_id = ? AND source_key = ? '
- . 'AND target_object_id = ? AND target_key = ? )) '
- . 'AND type_id = ? ',
+ SQL => '
+ SELECT source_object_id, source_key, target_object_id, target_key, state_id
+ FROM link_relation
+ WHERE (
+ ( source_object_id = ? AND source_key = ?
+ AND target_object_id = ? AND target_key = ? )
+ OR
+ ( source_object_id = ? AND source_key = ?
+ AND target_object_id = ? AND target_key = ? )
+ )
+ AND type_id = ?',
Bind => [
\$Param{Object1ID}, \$Param{Key1},
@@ -838,10 +849,14 @@
# delete the link
return if !$Self->{DBObject}->Do(
- SQL => 'DELETE FROM link_relation '
- . 'WHERE (( source_object_id = ? AND source_key = ? '
- . 'AND target_object_id = ? AND target_key = ? ) '
- . 'OR ( source_object_id = ? AND source_key = ? '
- . 'AND target_object_id = ? AND target_key = ? )) '
- . 'AND type_id = ? ',
+ SQL => '
+ DELETE FROM link_relation
+ WHERE (
+ ( source_object_id = ? AND source_key = ?
+ AND target_object_id = ? AND target_key = ? )
+ OR
+ ( source_object_id = ? AND source_key = ?
+ AND target_object_id = ? AND target_key = ? )
+ )
+ AND type_id = ?',
Bind => [
\$Param{Object1ID}, \$Param{Key1},
@@ -1049,9 +1064,10 @@
# get links where the given object is the source
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT target_object_id, target_key, type_id '
- . 'FROM link_relation '
- . 'WHERE source_object_id = ? '
- . 'AND source_key = ? '
- . 'AND state_id = ? '
+ SQL => '
+ SELECT target_object_id, target_key, type_id
+ FROM link_relation
+ WHERE source_object_id = ?
+ AND source_key = ?
+ AND state_id = ? '
. $TypeSQL,
Bind => \@Bind,
@@ -1093,10 +1109,10 @@
# get links where the given object is the target
return if !$Self->{DBObject}->Prepare(
- SQL =>
- 'SELECT source_object_id, source_key, type_id '
- . 'FROM link_relation '
- . 'WHERE target_object_id = ? '
- . 'AND target_key = ? '
- . 'AND state_id = ? '
+ SQL => '
+ SELECT source_object_id, source_key, type_id
+ FROM link_relation
+ WHERE target_object_id = ?
+ AND target_key = ?
+ AND state_id = ? '
. $TypeSQL,
Bind => \@Bind,
@@ -1708,7 +1724,8 @@
# insert the new type
return if !$Self->{DBObject}->Do(
- SQL => 'INSERT INTO link_type '
- . '(name, valid_id, create_time, create_by, change_time, change_by) '
- . 'VALUES (?, 1, current_timestamp, ?, current_timestamp, ?)',
+ SQL => '
+ INSERT INTO link_type
+ (name, valid_id, create_time, create_by, change_time, change_by)
+ VALUES (?, 1, current_timestamp, ?, current_timestamp, ?)',
Bind => [ \$Param{Name}, \$Param{UserID}, \$Param{UserID} ],
);
@@ -1776,6 +1793,8 @@
# ask the database
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT id, name, create_time, create_by, change_time, change_by '
- . 'FROM link_type WHERE id = ?',
+ SQL => '
+ SELECT id, name, create_time, create_by, change_time, change_by
+ FROM link_type
+ WHERE id = ?',
Bind => [ \$Param{TypeID} ],
Limit => 1,
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log