[otrs-cvs] FAQ/Kernel/System/FAQ Vote.pm,1.1,1.2
"CVS commits notifications of OTRS.org" <[email protected]> Sun, 30 Jun 2013 01:15:51 +0000
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/FAQ/Kernel/System/FAQ
In directory lancelot:/tmp/cvs-serv20305/Kernel/System/FAQ
Modified Files:
Vote.pm
Log Message:
Updated SQL style.
Author: cr
Index: Vote.pm
===================================================================
RCS file: /home/cvs/FAQ/Kernel/System/FAQ/Vote.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -2 -u -d -r1.1 -r1.2
--- Vote.pm 30 Jun 2013 00:58:12 -0000 1.1
+++ Vote.pm 30 Jun 2013 01:15:46 -0000 1.2
@@ -63,6 +63,7 @@
return if !$Self->{DBObject}->Do(
- SQL => 'INSERT INTO faq_voting (created_by, item_id, ip, interface, rate, created )'
- . ' VALUES ( ?, ?, ?, ?, ?, current_timestamp )',
+ SQL => '
+ INSERT INTO faq_voting (created_by, item_id, ip, interface, rate, created )
+ VALUES ( ?, ?, ?, ?, ?, current_timestamp )',
Bind => [
\$Param{CreatedBy}, \$Param{ItemID}, \$Param{IP}, \$Param{Interface},
@@ -111,5 +112,7 @@
return if !$Self->{DBObject}->Do(
- SQL => 'DELETE FROM faq_voting WHERE id = ?',
+ SQL => '
+ DELETE FROM faq_voting
+ WHERE id = ?',
Bind => [ \$Param{VoteID} ],
);
@@ -164,19 +167,28 @@
my $Ext = "";
- my $SQL = " SELECT created_by, item_id, interface, ip, created, rate FROM faq_voting WHERE";
+ my $SQL = '
+ SELECT created_by, item_id, interface, ip, created, rate
+ FROM faq_voting
+ WHERE';
# public
if ( $Param{Interface} eq '3' ) {
- $Ext .= " ip = '$Param{IP}' AND item_id = $Param{ItemID}";
+ $Ext .= "
+ ip = '$Param{IP}'
+ AND item_id = $Param{ItemID}";
}
# customer
elsif ( $Param{Interface} eq '2' ) {
- $Ext .= " created_by = '$Param{CreateBy}' AND item_id = $Param{ItemID}";
+ $Ext .= "
+ created_by = '$Param{CreateBy}'
+ AND item_id = $Param{ItemID}";
}
# internal
elsif ( $Param{Interface} eq '1' ) {
- $Ext .= " created_by = '$Param{CreateBy}' AND item_id = $Param{ItemID}";
+ $Ext .= "
+ created_by = '$Param{CreateBy}'
+ AND item_id = $Param{ItemID}";
}
$SQL .= $Ext;
@@ -236,6 +248,9 @@
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT id FROM faq_voting WHERE item_id = ?',
- Bind => [ \$Param{ItemID} ],
+ SQL => '
+ SELECT id
+ FROM faq_voting
+ WHERE item_id = ?',
+ Bind => [ \$Param{ItemID} ],
Limit => $Param{Limit} || 500,
);
@@ -291,6 +306,9 @@
# get vote from db
return if !$Self->{DBObject}->Prepare(
- SQL => 'SELECT count(*), avg(rate) FROM faq_voting WHERE item_id = ?',
- Bind => [ \$Param{ItemID} ],
+ SQL => '
+ SELECT count(*), avg(rate)
+ FROM faq_voting
+ WHERE item_id = ?',
+ Bind => [ \$Param{ItemID} ],
Limit => $Param{Limit} || 500,
);
---------------------------------------------------------------------
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