]> git.pld-linux.org Git - packages/eventum.git/blobdiff - eventum-order.patch
run upgrade script as http user; keep config dir writable
[packages/eventum.git] / eventum-order.patch
index ab398d328437a9f12cb16e84ad5fa2979b3873ae..5764514ba18bbecb6b4ef71b611d190aebb24fb3 100644 (file)
@@ -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 @@
 +<?
-+require_once(dirname(__FILE__) . '/../init.php');
-+require_once(APP_INC_PATH . "class.auth.php");
-+require_once(APP_INC_PATH . "class.issue.php");
++require_once dirname(__FILE__) . '/../../init.php';
 +
 +// check login
 +if (!Auth::hasValidCookie(APP_COOKIE)) {
@@ -12,7 +10,6 @@
 +}
 +
 +
-+
 +if (!isset($_POST['before']) || !isset($_POST['after'])) {
 +      exit;
 +}
 +        }
 +    }
 +}
---- eventum-2.2/htdocs/css/style.css~  2009-10-12 22:27:13.000000000 +0300
-+++ eventum-2.2/htdocs/css/style.css   2009-10-12 22:28:31.402712101 +0300
-@@ -176,3 +176,22 @@
- .custom_field {
+--- eventum-2.3.1/htdocs/css/style.css~        2011-09-15 09:36:55.000000000 +0300
++++ eventum-2.3.1/htdocs/css/style.css 2011-09-15 09:38:23.668223576 +0300
+@@ -177,6 +177,24 @@
      cursor: pointer;
  }
-+
 +.tDnD_whileDrag td {
 +    background-color: #ffffdd;
 +}
 +      background-image: url(../images/updown2.gif);
 +    background-repeat: no-repeat;
 +    background-position: center center;
++}
+ 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
 +      }
 +);
 \ 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"];
 +@$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;
 +} 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
              )
          );
          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
                   )";
          $res = DB_Helper::getInstance()->query($stmt);
          if (PEAR::isError($res)) {
-@@ -1824,6 +2016,78 @@
+@@ -1824,6 +1842,78 @@
          }
      }
  
  
      /**
       * 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);
          }
          $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);
          $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,
                      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 {
              $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'];
                  }
              }
              }
          }
      }
-@@ -4247,6 +4532,7 @@
+@@ -4247,6 +4358,7 @@
              Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
              return -1;
          }
      }
  
  
-@@ -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()));
      }
 +    }
 +    
  }
---- 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 @@
  <script type="text/javascript" src="{$rel_url}js/jquery/form.js?c=9984"></script>
  <script type="text/javascript" src="{$rel_url}js/jquery/blockui.js?c=eb13"></script>
  <script type="text/javascript" src="{$rel_url}js/jquery/ui.datepicker.js?c=a911"></script>
 +<script type="text/javascript" src="{$rel_url}js/jquery/jquery.tablednd.js"></script>
- <link rel="stylesheet" href="{$rel_url}js/jquery/ui.datepicker.css?c=5096">
- <script type="text/javascript">
- <!--
+ <script type="text/javascript" src="{$rel_url}js/validation.js?c=ad33"></script>
+ <script type="text/javascript" src="{$rel_url}js/browserSniffer.js?c=c046"></script>
+ <script type="text/javascript" src="{$rel_url}js/global.js?c=50d6"></script>
 --- eventum-2.2/templates/list.tpl.html        2009-09-14 18:07:55.000000000 +0300
 +++ eventum-2.2-order/templates/list.tpl.html  2009-10-12 22:10:36.439185157 +0300
 @@ -92,6 +92,28 @@
This page took 0.070528 seconds and 4 git commands to generate.