X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=eventum-order.patch;h=5764514ba18bbecb6b4ef71b611d190aebb24fb3;hb=2a8699709f6a489d0d37f1729182b85314eceaa0;hp=14c6fd3d26a8432c6b31c98a5df22b14f1baba22;hpb=6b57f4ee01d268f5454d857161d0d325805c707e;p=packages%2Feventum.git diff --git a/eventum-order.patch b/eventum-order.patch index 14c6fd3..5764514 100644 --- a/eventum-order.patch +++ b/eventum-order.patch @@ -1,10 +1,8 @@ --- eventum-2.2/htdocs/ajax/order.php 1970-01-01 02:00:00.000000000 +0200 +++ eventum-2.2-order/htdocs/ajax/order.php 2009-10-12 22:10:36.429185594 +0300 -@@ -0,0 +1,72 @@ +@@ -0,0 +1,69 @@ + + + ul.excerpts { + list-style: none; +@@ -187,4 +205,4 @@ + ul.excerpts ul { + list-style-type: none; + padding-left: 1em; +-} +\ No newline at end of file ++} --- eventum-2.2/htdocs/js/jquery/jquery.tablednd.js 1970-01-01 02:00:00.000000000 +0200 +++ eventum-2.2-order/htdocs/js/jquery/jquery.tablednd.js 2009-10-12 22:10:36.435851675 +0300 @@ -0,0 +1,382 @@ @@ -574,10 +490,10 @@ + } +); \ No newline at end of file ---- eventum-2.2/htdocs/list.php 2009-09-14 18:07:55.000000000 +0300 -+++ eventum-2.2-order/htdocs/list.php 2009-10-12 22:10:36.435851675 +0300 -@@ -53,6 +53,11 @@ - $profile['sort_by'] . "&sort_order=" . $profile['sort_order']); +--- eventum-2.3.2/htdocs/list.php~ 2012-03-09 18:19:56.000000000 +0200 ++++ eventum-2.3.2/htdocs/list.php 2012-03-09 18:32:43.998284397 +0200 +@@ -67,6 +67,11 @@ + } } +@$reorder_usr_id = $_REQUEST["reorder_user"]; @@ -585,14 +501,14 @@ +@$reorder_neworder = $_REQUEST["reorder_neworder"]; +Issue::reorderUserIssues($reorder_usr_id, $reorder_issue_id, $reorder_neworder); + - $options = Issue::saveSearchParams(); - $tpl->assign("options", $options); - $tpl->assign("sorting", Issue::getSortingInfo($options)); -@@ -78,6 +83,21 @@ + if (!empty($_REQUEST['nosave'])) { + $options = Search::saveSearchParams(false); + } else { +@@ -92,6 +97,24 @@ } $assign_options += $users; -+// get the isu_order (assignated users) ordering user ++// get the isu_order (assigned users) ordering user +if (!empty($options["users"])) { + if ($options["users"] == -2) { + $isu_order_user = $usr_id; @@ -605,9 +521,12 @@ +} else { + unset($isu_order_user); +} -+$tpl->assign("isu_order_user", $isu_order_user); + - $list = Issue::getListing($prj_id, $options, $pagerRow, $rows); ++if (isset($isu_order_user)) { ++ $tpl->assign("isu_order_user", $isu_order_user); ++} ++ + $list = Search::getListing($prj_id, $options, $pagerRow, $rows); $tpl->assign("list", $list["list"]); $tpl->assign("list_info", $list["info"]); --- eventum-2.2/lib/eventum/class.display_column.php 2009-09-14 18:07:55.000000000 +0300 @@ -624,204 +543,23 @@ ) ); return $columns[$page]; ---- eventum-2.2/lib/eventum/class.issue.php 2009-09-14 18:07:55.000000000 +0300 -+++ eventum-2.2-order/lib/eventum/class.issue.php 2009-10-12 22:10:36.445851670 +0300 -@@ -1333,6 +1333,7 @@ - Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); +--- eventum-2.3.1/lib/eventum/class.issue.php~ 2011-09-15 09:36:55.000000000 +0300 ++++ eventum-2.3.1/lib/eventum/class.issue.php 2011-09-15 09:42:02.844032474 +0300 +@@ -1374,6 +1374,7 @@ return -1; - } else { -+ self::moveOrderForAllUsers($issue_id, 1000); - $prj_id = self::getProjectID($issue_id); - - // record the change -@@ -1636,6 +1637,180 @@ } - } -+ /** -+ * Method used to update the a single detail field of a specific issue. -+ * -+ * @param integer $issue_id -+ * @param string $field_name -+ * @param string $field_value -+ * @param string $field_type string or integer (for escape) -+ * @return integer 1 on success, -1 otherwise -+ */ -+ function updateField($issue_id, $field_name, $filed_value) { -+ -+ $issue_id = Misc::escapeInteger($issue_id); -+ -+ $usr_id = Auth::getUserID(); -+ $prj_id = self::getProjectID($issue_id); -+ -+ // get all of the 'current' information of this issue -+ $current = self::getDetails($issue_id); -+ -+ $stmt = "UPDATE -+ " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue -+ SET -+ iss_updated_date='" . Date_Helper::getCurrentDateGMT() . "', -+ iss_last_public_action_date='" . Date_Helper::getCurrentDateGMT() . "', -+ iss_last_public_action_type='updated'"; -+ -+ switch ($field_name) { -+ case 'category': -+ $stmt .= ", iss_prc_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'release': -+ $stmt .= ", iss_pre_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'expected_resolution_date': -+ if (is_null($filed_value)) { -+ $stmt .= ", iss_expected_resolution_date = null"; -+ } else { -+ $stmt .= ", iss_expected_resolution_date = '" . Misc::escapeString($filed_value) . "'"; -+ } -+ break; -+ case 'release': -+ $stmt .= ", iss_pre_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'priority': -+ $stmt .= ", iss_pri_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'status': -+ $stmt .= ", iss_sta_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'resolution': -+ $stmt .= ", iss_res_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'summary': -+ $stmt .= ", iss_summary = '" . Misc::escapeString($filed_value) . "'"; -+ break; -+ case 'description': -+ $stmt .= ", iss_description = '" . Misc::escapeString($filed_value) . "'"; -+ break; -+ case 'estimated_dev_time': -+ $stmt .= ", iss_dev_time = '" . Misc::escapeString($filed_value) . "'"; -+ break; -+ case 'percent_complete': -+ $stmt .= ", iss_percent_complete = '" . Misc::escapeString($filed_value) . "'"; -+ break; -+ case 'trigger_reminders': -+ $stmt .= ", iss_trigger_reminders = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'group': -+ $stmt .= ", iss_grp_id = " . Misc::escapeInteger($filed_value); -+ break; -+ case 'private': -+ $stmt .= ", iss_private = " . Misc::escapeInteger($filed_value); -+ break; -+ default: -+ Error_Handler::logError("Unknown field name $field_name", __FILE__, __LINE__); -+ return -1; -+ break; -+ } -+ -+ $stmt .= " -+ WHERE -+ iss_id=$issue_id"; -+ -+ $res = DB_Helper::getInstance()->query($stmt); -+ if (PEAR::isError($res)) { -+ Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); -+ return -1; -+ } else { -+ $new = array( -+ 'category' => $current['iss_prc_id'], -+ 'release' => $current['iss_pre_id'], -+ 'expected_resolution_date' => $current['iss_expected_resolution_date'], -+ 'release' => $current['iss_pre_id'], -+ 'priority' => $current['iss_pri_id'], -+ 'status' => $current['iss_sta_id'], -+ 'resolution' => $current['iss_res_id'], -+ 'summary' => $current['iss_summary'], -+ 'description' => $current['iss_description'], -+ 'estimated_dev_time' => $current['iss_dev_time'], -+ 'percent_complete' => $current['iss_percent_complete'], -+ 'trigger_reminders' => $current['iss_trigger_reminders'], -+ 'group' => $current['iss_grp_id'], -+ 'iss_private' => $current['private'] -+ ); -+ $new[$field_name] = $filed_value; -+ -+ // add change to the history (only for changes on specific fields?) -+ $updated_fields = array(); -+ if ($field_name == 'expected_resolution_date' && $current["iss_expected_resolution_date"] != $filed_value) { -+ $updated_fields["Expected Resolution Date"] = History::formatChanges($current["iss_expected_resolution_date"], $filed_value); -+ } -+ if ($field_name == 'category' && $current["iss_prc_id"] != $filed_value) { -+ $updated_fields["Category"] = History::formatChanges(Category::getTitle($current["iss_prc_id"]), Category::getTitle($filed_value)); -+ } -+ if ($field_name == 'release' && $current["iss_pre_id"] != $filed_value) { -+ $updated_fields["Release"] = History::formatChanges(Release::getTitle($current["iss_pre_id"]), Release::getTitle($filed_value)); -+ } -+ if ($field_name == 'priority' && $current["iss_pri_id"] != $filed_value) { -+ $updated_fields["Priority"] = History::formatChanges(Priority::getTitle($current["iss_pri_id"]), Priority::getTitle($filed_value)); -+ Workflow::handlePriorityChange($prj_id, $issue_id, $usr_id, $current, $new); -+ } -+ if ($field_name == 'status' && $current["iss_sta_id"] != $filed_value) { -+ // clear out the last-triggered-reminder flag when changing the status of an issue -+ Reminder_Action::clearLastTriggered($issue_id); -+ -+ // if old status was closed and new status is not, clear closed data from issue. -+ $old_status_details = Status::getDetails($current['iss_sta_id']); -+ if ($old_status_details['sta_is_closed'] == 1) { -+ $new_status_details = Status::getDetails($filed_value); -+ if ($new_status_details['sta_is_closed'] != 1) { -+ self::clearClosed($issue_id); -+ } -+ } -+ $updated_fields["Status"] = History::formatChanges(Status::getStatusTitle($current["iss_sta_id"]), Status::getStatusTitle($filed_value)); -+ } -+ if ($field_name == 'resolution' && $current["iss_res_id"] != $filed_value) { -+ $updated_fields["Resolution"] = History::formatChanges(Resolution::getTitle($current["iss_res_id"]), Resolution::getTitle($filed_value)); -+ } -+ if ($field_name == 'estimated_dev_time' && $current["iss_dev_time"] != $filed_value) { -+ $updated_fields["Estimated Dev. Time"] = History::formatChanges(Misc::getFormattedTime(($current["iss_dev_time"]*60)), Misc::getFormattedTime(($filed_value*60))); -+ } -+ if ($field_name == 'summary' && $current["iss_summary"] != $filed_value) { -+ $updated_fields["Summary"] = ''; -+ } -+ if ($field_name == 'description' && $current["iss_description"] != $filed_value) { -+ $updated_fields["Description"] = ''; -+ } -+ if ($field_name == 'private' && ($filed_value != $current['iss_private'])) { -+ $updated_fields["Private"] = History::formatChanges(Misc::getBooleanDisplayValue($current['iss_private']), Misc::getBooleanDisplayValue($filed_value)); -+ } -+ if (count($updated_fields) > 0) { -+ // log the changes -+ $changes = ''; -+ $i = 0; -+ foreach ($updated_fields as $key => $value) { -+ if ($i > 0) { -+ $changes .= "; "; -+ } -+ if (($key != "Summary") && ($key != "Description")) { -+ $changes .= "$key: $value"; -+ } else { -+ $changes .= "$key"; -+ } -+ $i++; -+ } -+ -+ History::add($issue_id, $usr_id, History::getTypeID('issue_updated'), "Issue updated ($changes) by " . User::getFullName($usr_id)); -+ // send notifications for the issue being updated -+ Notification::notifyIssueUpdated($issue_id, $current, $new); -+ } -+ } -+ return 1; -+ } -+ ++ self::moveOrderForAllUsers($issue_id, 1000); + $prj_id = self::getProjectID($issue_id); - /** - * Move the issue to a new project -@@ -1800,16 +1975,33 @@ + // record the change +@@ -1800,16 +1801,33 @@ { $issue_id = Misc::escapeInteger($issue_id); $assignee_usr_id = Misc::escapeInteger($assignee_usr_id); + $order = 1; + // move all orders down to free "order space" for this new association -+ $stmt = "UPDATE ++ $stmt = "UPDATE + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user + SET + isu_order = isu_order + 1 @@ -851,7 +589,7 @@ )"; $res = DB_Helper::getInstance()->query($stmt); if (PEAR::isError($res)) { -@@ -1824,6 +2016,78 @@ +@@ -1824,6 +1842,78 @@ } } @@ -930,7 +668,7 @@ /** * Method used to delete all user assignments for a specific issue. -@@ -1839,6 +2103,7 @@ +@@ -1839,6 +1929,7 @@ if (is_array($issue_id)) { $issue_id = implode(", ", $issue_id); } @@ -938,7 +676,7 @@ $stmt = "DELETE FROM " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user WHERE -@@ -1869,6 +2134,7 @@ +@@ -1869,6 +1960,7 @@ { $issue_id = Misc::escapeInteger($issue_id); $usr_id = Misc::escapeInteger($usr_id); @@ -946,35 +684,15 @@ $stmt = "DELETE FROM " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user WHERE -@@ -1883,6 +2149,7 @@ - History::add($issue_id, Auth::getUserID(), History::getTypeID('user_unassociated'), - User::getFullName($usr_id) . ' removed from issue by ' . User::getFullName(Auth::getUserID())); - } -+ self::rearrangeDeleteUserAssociationOrderList($delete_order_list); - return 1; +@@ -2020,6 +2021,7 @@ + History::add($issue_id, Auth::getUserID(), History::getTypeID('user_unassociated'), + User::getFullName($usr_id) . ' removed from issue by ' . User::getFullName(Auth::getUserID())); } ++ self::rearrangeDeleteUserAssociationOrderList($delete_order_list); + return 1; } -@@ -2342,6 +2609,11 @@ - { - $sort_by = self::getParam('sort_by'); - $sort_order = self::getParam('sort_order'); -+ $users = self::getParam('users'); -+ if (empty($users) && ($sort_by == 'isu_order')) { // Sorting by isu_order is impossible when no user specified -+ unset($sort_by); -+ unset($sort_order); -+ } - $rows = self::getParam('rows'); - $hide_closed = self::getParam('hide_closed'); - if ($hide_closed === '') { -@@ -2448,6 +2720,7 @@ - "iss_expected_resolution_date" => "desc", - "pre_title" => "asc", - "assigned" => "asc", -+ "isu_order" => "desc", - ); - foreach ($custom_fields as $fld_id => $fld_name) { -@@ -3253,6 +3526,8 @@ +@@ -3253,6 +3352,8 @@ $ids = implode(", ", $ids); $stmt = "SELECT isu_iss_id, @@ -983,7 +701,7 @@ usr_full_name FROM " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user, -@@ -3264,6 +3539,7 @@ +@@ -3264,6 +3365,7 @@ if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); } else { @@ -991,7 +709,7 @@ $t = array(); for ($i = 0; $i < count($res); $i++) { if (!empty($t[$res[$i]['isu_iss_id']])) { -@@ -3272,9 +3548,18 @@ +@@ -3272,9 +3374,18 @@ $t[$res[$i]['isu_iss_id']] = $res[$i]['usr_full_name']; } } @@ -1010,7 +728,7 @@ } } } -@@ -4247,6 +4532,7 @@ +@@ -4247,6 +4358,7 @@ Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return -1; } @@ -1018,7 +736,7 @@ } -@@ -4346,4 +4632,120 @@ +@@ -4346,4 +4458,120 @@ History::add($issue_id, Auth::getUserID(), History::getTypeID('user_associated'), "Issue assignment to changed (" . History::formatChanges(join(', ', $old_assignee_names), join(', ', $assignee_names)) . ") by " . User::getFullName(Auth::getUserID())); } @@ -1139,16 +857,39 @@ + } + } ---- eventum-2.2/templates/header.tpl.html 2009-09-14 18:07:55.000000000 +0300 -+++ eventum-2.2-order/templates/header.tpl.html 2009-10-12 22:10:36.435851675 +0300 -@@ -8,6 +8,7 @@ +--- eventum-2.3.1/lib/eventum/class.search.php~ 2011-04-20 17:22:15.000000000 +0300 ++++ eventum-2.3.1/lib/eventum/class.search.php 2011-04-20 17:44:34.498519260 +0300 +@@ -63,6 +63,12 @@ + { + $sort_by = self::getParam('sort_by'); + $sort_order = self::getParam('sort_order'); ++ $users = self::getParam('users'); ++ if (empty($users) && $sort_by === 'isu_order') { ++ // Sorting by isu_order is impossible when no user specified ++ unset($sort_by); ++ unset($sort_order); ++ } + $rows = self::getParam('rows'); + $hide_closed = self::getParam('hide_closed'); + if ($hide_closed === '') { +@@ -174,6 +174,7 @@ + "iss_expected_resolution_date" => "desc", + "pre_title" => "asc", + "assigned" => "asc", ++ "isu_order" => "desc", + ); + + foreach ($custom_fields as $fld_id => $fld_name) { +--- eventum-2.3.1/templates/header.tpl.html~ 2011-09-15 09:36:55.000000000 +0300 ++++ eventum-2.3.1/templates/header.tpl.html 2011-09-15 09:43:49.318473817 +0300 +@@ -18,6 +18,7 @@ + - - {include file="app_info.tpl.html"} {include file="footer.tpl.html"} ---- eventum-2.2/upgrade/patches/04_isu_order.php 1970-01-01 02:00:00.000000000 +0200 -+++ eventum-2.2-order/upgrade/patches/04_isu_order.php 2009-10-12 22:10:36.439185157 +0300 -@@ -0,0 +1,15 @@ -+ '01_notes.php', - 2 => '02_usr_alias.php', - 3 => '03_prj_mail_aliases.php', -+ 4 => '04_isu_order.php', - ); - - // sanity check. check that the version table exists.