Merge lp:~hartmut-php/eventum/no-mysql-functions into lp:eventum

Proposed by Elan Ruusamäe
Status: Merged
Merge reported by: Elan Ruusamäe
Merged at revision: not available
Proposed branch: lp:~hartmut-php/eventum/no-mysql-functions
Merge into: lp:eventum
Diff against target: 214 lines (+26/-20) (has conflicts)
11 files modified
lib/eventum/class.custom_field.php (+1/-1)
lib/eventum/class.draft.php (+1/-1)
lib/eventum/class.email_account.php (+1/-1)
lib/eventum/class.mail_queue.php (+6/-0)
lib/eventum/class.news.php (+1/-1)
lib/eventum/class.note.php (+1/-1)
lib/eventum/class.notification.php (+1/-1)
lib/eventum/class.report.php (+1/-1)
lib/eventum/class.search.php (+2/-2)
lib/eventum/class.stats.php (+9/-9)
lib/eventum/class.support.php (+2/-2)
Text conflict in lib/eventum/class.mail_queue.php
To merge this branch: bzr merge lp:~hartmut-php/eventum/no-mysql-functions
Reviewer Review Type Date Requested Status
Elan Ruusamäe Pending
Review via email: mp+236236@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Elan Ruusamäe (glen666) wrote :
Revision history for this message
Elan Ruusamäe (glen666) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/eventum/class.custom_field.php'
--- lib/eventum/class.custom_field.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.custom_field.php 2014-09-27 20:11:45 +0000
@@ -1747,7 +1747,7 @@
17471747
1748 public function getDBValueFieldSQL()1748 public function getDBValueFieldSQL()
1749 {1749 {
1750 return "(IF(fld_type = 'date', icf_value_date, IF(fld_type = 'integer', icf_value_integer, icf_value)))";1750 return "(CASE WHEN fld_type = 'date' THEN icf_value_date ELSE WHEN fld_type = 'integer' THEN icf_value_integer ELSE icf_value END)";
1751 }1751 }
17521752
1753 /**1753 /**
17541754
=== modified file 'lib/eventum/class.draft.php'
--- lib/eventum/class.draft.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.draft.php 2014-09-27 20:11:45 +0000
@@ -397,7 +397,7 @@
397 emd_status = 'pending'397 emd_status = 'pending'
398 ORDER BY398 ORDER BY
399 emd_id ASC399 emd_id ASC
400 LIMIT " . ($sequence - 1) . ", 1";400 LIMIT 1 OFFSET " . ($sequence - 1);
401 $res = DB_Helper::getInstance()->getOne($stmt);401 $res = DB_Helper::getInstance()->getOne($stmt);
402 if (PEAR::isError($res)) {402 if (PEAR::isError($res)) {
403 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);403 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
404404
=== modified file 'lib/eventum/class.email_account.php'
--- lib/eventum/class.email_account.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.email_account.php 2014-09-27 20:11:45 +0000
@@ -428,7 +428,7 @@
428 WHERE428 WHERE
429 ema_prj_id=" . Misc::escapeInteger($prj_id) . "429 ema_prj_id=" . Misc::escapeInteger($prj_id) . "
430 LIMIT430 LIMIT
431 0, 1";431 1 OFFSET 0";
432 $res = DB_Helper::getInstance()->getOne($stmt);432 $res = DB_Helper::getInstance()->getOne($stmt);
433 if (PEAR::isError($res)) {433 if (PEAR::isError($res)) {
434 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);434 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
435435
=== modified file 'lib/eventum/class.mail_queue.php'
--- lib/eventum/class.mail_queue.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.mail_queue.php 2014-09-27 20:11:45 +0000
@@ -307,12 +307,18 @@
307 WHERE307 WHERE
308 maq_status='$status'308 maq_status='$status'
309 ORDER BY309 ORDER BY
310<<<<<<< TREE
310 maq_id ASC";311 maq_id ASC";
311312
312 if ($limit !== false) {313 if ($limit !== false) {
313 $sql .= " LIMIT 0, $limit";314 $sql .= " LIMIT 0, $limit";
314 }315 }
315316
317=======
318 maq_id ASC
319 LIMIT
320 $limit OFFSET 0";
321>>>>>>> MERGE-SOURCE
316 $res = DB_Helper::getInstance()->getCol($sql);322 $res = DB_Helper::getInstance()->getCol($sql);
317 if (PEAR::isError($res)) {323 if (PEAR::isError($res)) {
318 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);324 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
319325
=== modified file 'lib/eventum/class.news.php'
--- lib/eventum/class.news.php 2014-09-04 20:32:55 +0000
+++ lib/eventum/class.news.php 2014-09-27 20:11:45 +0000
@@ -51,7 +51,7 @@
51 ORDER BY51 ORDER BY
52 nws_created_date DESC52 nws_created_date DESC
53 LIMIT53 LIMIT
54 0, 3";54 3 OFFSET 0";
55 $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);55 $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);
56 if (PEAR::isError($res)) {56 if (PEAR::isError($res)) {
57 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);57 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
5858
=== modified file 'lib/eventum/class.note.php'
--- lib/eventum/class.note.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.note.php 2014-09-27 20:11:45 +0000
@@ -244,7 +244,7 @@
244 not_removed = 0244 not_removed = 0
245 ORDER BY245 ORDER BY
246 not_created_date ASC246 not_created_date ASC
247 LIMIT " . ($sequence - 1) . ", 1";247 LIMIT 1 OFFSET " . ($sequence - 1);
248 $res = DB_Helper::getInstance()->getOne($stmt);248 $res = DB_Helper::getInstance()->getOne($stmt);
249 if (PEAR::isError($res)) {249 if (PEAR::isError($res)) {
250 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);250 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
251251
=== modified file 'lib/eventum/class.notification.php'
--- lib/eventum/class.notification.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.notification.php 2014-09-27 20:11:45 +0000
@@ -72,7 +72,7 @@
72 public static function getSubscribedEmails($issue_id, $type = false)72 public static function getSubscribedEmails($issue_id, $type = false)
73 {73 {
74 $stmt = "SELECT74 $stmt = "SELECT
75 IF(usr_id <> 0, usr_email, sub_email) AS email75 CASE usr_id <> 0 THEN usr_email ELSE sub_email END AS email
76 FROM76 FROM
77 (77 (
78 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription";78 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription";
7979
=== modified file 'lib/eventum/class.report.php'
--- lib/eventum/class.report.php 2014-09-04 20:59:49 +0000
+++ lib/eventum/class.report.php 2014-09-27 20:11:45 +0000
@@ -890,7 +890,7 @@
890 break;890 break;
891 case "dow":891 case "dow":
892 $format = '%W';892 $format = '%W';
893 $order_by = "IF(DATE_FORMAT(%1\$s, '%%w') = 0, 7, DATE_FORMAT(%1\$s, '%%w'))";893 $order_by = "CASE WHEN DATE_FORMAT(%1\$s, '%%w') = 0 THEN 7 ELSE DATE_FORMAT(%1\$s, '%%w') END";
894 break;894 break;
895 case "week":895 case "week":
896 if ($type == "aggregate") {896 if ($type == "aggregate") {
897897
=== modified file 'lib/eventum/class.search.php'
--- lib/eventum/class.search.php 2014-09-04 17:37:16 +0000
+++ lib/eventum/class.search.php 2014-09-27 20:11:45 +0000
@@ -265,7 +265,7 @@
265 iss_last_internal_action_date,265 iss_last_internal_action_date,
266 iss_last_internal_action_type,266 iss_last_internal_action_type,
267 " . Issue::getLastActionFields() . ",267 " . Issue::getLastActionFields() . ",
268 IF(iss_last_internal_action_date > iss_last_public_action_date, 'internal', 'public') AS action_type,268 CASE WHEN iss_last_internal_action_date > iss_last_public_action_date THEN 'internal' ELSE 'public' END AS action_type,
269 iss_private,269 iss_private,
270 usr_full_name,270 usr_full_name,
271 iss_percent_complete,271 iss_percent_complete,
@@ -397,7 +397,7 @@
397 $total_rows = Pager::getTotalRows($stmt);397 $total_rows = Pager::getTotalRows($stmt);
398 $stmt .= "398 $stmt .= "
399 LIMIT399 LIMIT
400 " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max);400 " . Misc::escapeInteger($max) . " OFFSET " . Misc::escapeInteger($start);
401 $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);401 $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);
402 if (PEAR::isError($res)) {402 if (PEAR::isError($res)) {
403 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);403 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
404404
=== modified file 'lib/eventum/class.stats.php'
--- lib/eventum/class.stats.php 2014-09-04 20:32:55 +0000
+++ lib/eventum/class.stats.php 2014-09-27 20:11:45 +0000
@@ -230,8 +230,8 @@
230 $stmt = "SELECT230 $stmt = "SELECT
231 DISTINCT iss_prc_id,231 DISTINCT iss_prc_id,
232 prc_title,232 prc_title,
233 SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items,233 SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items,
234 SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items234 SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items
235 FROM235 FROM
236 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,236 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,
237 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category,237 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category,
@@ -272,8 +272,8 @@
272 $stmt = "SELECT272 $stmt = "SELECT
273 DISTINCT iss_pre_id,273 DISTINCT iss_pre_id,
274 pre_title,274 pre_title,
275 SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items,275 SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items,
276 SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items276 SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items
277 FROM277 FROM
278 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,278 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,
279 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release,279 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release,
@@ -350,8 +350,8 @@
350 $stmt = "SELECT350 $stmt = "SELECT
351 DISTINCT iss_pri_id,351 DISTINCT iss_pri_id,
352 pri_title,352 pri_title,
353 SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items,353 SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items,
354 SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items354 SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items
355 FROM355 FROM
356 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,356 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,
357 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority,357 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority,
@@ -430,8 +430,8 @@
430 $stmt = "SELECT430 $stmt = "SELECT
431 DISTINCT isu_usr_id,431 DISTINCT isu_usr_id,
432 usr_full_name,432 usr_full_name,
433 SUM(IF(sta_is_closed=0, 1, 0)) AS total_open_items,433 SUM(CASE WHEN sta_is_closed=0 THEN 1 ELSE 0 END) AS total_open_items,
434 SUM(IF(sta_is_closed=1, 1, 0)) AS total_closed_items434 SUM(CASE WHEN sta_is_closed=1 THEN 1 ELSE 0 END) AS total_closed_items
435 FROM435 FROM
436 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,436 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,
437 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user,437 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user,
@@ -471,7 +471,7 @@
471 {471 {
472 $prj_id = Auth::getCurrentProject();472 $prj_id = Auth::getCurrentProject();
473 $stmt = "SELECT473 $stmt = "SELECT
474 IF(sup_iss_id > 0, 'associated', 'unassociated') type,474 CASE WHEN sup_iss_id > 0 THEN 'associated' ELSE 'unassociated' END AS type,
475 COUNT(*) AS total_items475 COUNT(*) AS total_items
476 FROM476 FROM
477 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email,477 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email,
478478
=== modified file 'lib/eventum/class.support.php'
--- lib/eventum/class.support.php 2014-09-04 21:31:57 +0000
+++ lib/eventum/class.support.php 2014-09-27 20:11:45 +0000
@@ -1308,7 +1308,7 @@
1308 $total_rows = Pager::getTotalRows($stmt);1308 $total_rows = Pager::getTotalRows($stmt);
1309 $stmt .= "1309 $stmt .= "
1310 LIMIT1310 LIMIT
1311 " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max);1311 " . Misc::escapeInteger($max) . " OFFSET " . Misc::escapeInteger($start);
1312 $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);1312 $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);
1313 if (PEAR::isError($res)) {1313 if (PEAR::isError($res)) {
1314 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);1314 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
@@ -1658,7 +1658,7 @@
1658 sup_iss_id = " . Misc::escapeInteger($issue_id) . "1658 sup_iss_id = " . Misc::escapeInteger($issue_id) . "
1659 ORDER BY1659 ORDER BY
1660 sup_id1660 sup_id
1661 LIMIT " . (Misc::escapeInteger($sequence) - 1) . ", 1";1661 LIMIT 1 OFFSET " . (Misc::escapeInteger($sequence) - 1);
1662 $res = DB_Helper::getInstance()->getRow($stmt);1662 $res = DB_Helper::getInstance()->getRow($stmt);
1663 if (PEAR::isError($res)) {1663 if (PEAR::isError($res)) {
1664 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);1664 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);

Subscribers

People subscribed via source and target branches