1 --- eventum-2.2/htdocs/ajax/order.php 1970-01-01 02:00:00.000000000 +0200
2 +++ eventum-2.2-order/htdocs/ajax/order.php 2009-10-12 22:10:36.429185594 +0300
5 +require_once(dirname(__FILE__) . '/../init.php');
6 +require_once(APP_INC_PATH . "class.auth.php");
7 +require_once(APP_INC_PATH . "class.issue.php");
10 +if (!Auth::hasValidCookie(APP_COOKIE)) {
16 +if (!isset($_POST['before']) || !isset($_POST['after'])) {
20 +parse_str($_POST['before'], $before);
21 +parse_str($_POST['after'], $after);
23 +$before = $before['issue_list_table'];
24 +$after = $after['issue_list_table'];
27 +$before = array_slice($before, 2, count($before)-3);
28 +$after = array_slice($after, 2, count($after)-3);
30 +if (count($before) != count($after) or count($before) < 1) {
34 +$usr_id = Auth::getUserID();
36 +$order = Issue::getIssueOrderByUser($usr_id);
38 +if (!count($order)) {
39 + // no prev order list
43 +$after_filterd = array();
44 +$before_filterd = array();
46 +// remove issues that are not assigned to me
47 +foreach ($after as $id) {
48 + if (isset($order[$id])) {
49 + $after_filterd[] = $id;
52 +foreach ($before as $id) {
53 + if (isset($order[$id])) {
54 + $before_filterd[] = $id;
58 +foreach ($after_filterd as $key => $nID) {
59 + if ($nID != $before_filterd[$key]) {
62 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
64 + isu_order = " . $order[$before_filterd[$key]] . "
66 + isu_iss_id = $nID AND
67 + isu_usr_id = $usr_id";
68 + $res = DB_Helper::getInstance()->query($stmt);
69 + if (PEAR::isError($res)) {
70 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
71 + die('update failed');
76 --- eventum-2.2/htdocs/ajax/update.php 1970-01-01 02:00:00.000000000 +0200
77 +++ eventum-2.2-order/htdocs/ajax/update.php 2009-10-12 22:10:36.439185157 +0300
80 +require_once(dirname(__FILE__) . '/../init.php');
81 +require_once(APP_INC_PATH . "class.auth.php");
82 +require_once(APP_INC_PATH . "class.issue.php");
85 +if (!Auth::hasValidCookie(APP_COOKIE)) {
89 +if (!is_numeric($_POST['issueID'])) {
93 +switch ($_POST['fieldName']) {
94 + case 'expected_resolution_date':
95 + $day = (int)$_POST['day'];
96 + $month = (int)$_POST['month'];
97 + $year = (int)$_POST['year'];
98 + if ($day == 0 && $month == 1 && $year == 0) {
102 + $date = sprintf('%04d-%02d-%02d', $year, $month, $day);
104 + if (Issue::updateField($_POST['issueID'], $_POST['fieldName'], $date) !== -1) {
105 + if (!is_null($date)) {
106 + echo Date_Helper::getSimpleDate(sprintf('%04d-%02d-%02d', $year, $month, $day), false);
109 + echo 'update failed';
114 + die('object type not supported');
117 --- eventum-2.2/htdocs/css/style.css 2009-09-14 18:07:55.000000000 +0300
118 +++ eventum-2.2-order/htdocs/css/style.css 2009-10-12 22:10:36.439185157 +0300
121 font-family: Verdana, Arial, Helvetica, sans-serif;
124 \ No newline at end of file
126 +.tDnD_whileDrag td {
127 + background-color: #ffffdd;
129 +.tDnD_whileDrag td {
130 + border: 1px solid red;
140 + background-image: url(../images/updown2.gif);
141 + background-repeat: no-repeat;
142 + background-position: center center;
144 --- eventum-2.2/htdocs/js/global.js 2009-09-14 18:07:55.000000000 +0300
145 +++ eventum-2.2-order/htdocs/js/global.js 2009-10-12 22:10:36.439185157 +0300
147 firstDay: user_prefs.week_firstday
151 +$(document).ready(function() {
152 + // dialog type calender isn't working in Konqueror beacuse it's not a supported browser for either jQuery or jQuery UI
153 + // http://groups.google.com/group/jquery-ui/browse_thread/thread/ea61238c34cb5f33/046837b02fb90b5c
154 + if (navigator.appName != 'Konqueror') {
155 + $(".inline_date_pick").click(function() {
156 + var masterObj = this;
157 + var masterObjPos = $(masterObj).offset();
158 + // offset gives uses top and left but datepicker needs pageX and pageY
159 + var masterObjPos = {pageX: masterObjPos.left, pageY: masterObjPos.top};
160 + $(this).datepicker(
161 + // we use dialog type calender so we won't haveto have a hidden element on the page
164 + masterObj.innerHTML,
166 + function (date, dteObj) {
167 + fieldName = masterObj.id.substr(0,masterObj.id.indexOf('|'));
168 + issueID = masterObj.id.substr(masterObj.id.indexOf('|')+1);
171 + dteObj.selectedDay = 0;
172 + dteObj.selectedMonth = 0;
173 + dteObj.selectedYear = 0;
175 + //alertProperties(date);
176 + $.post("/ajax/update.php", {fieldName: fieldName, issueID: issueID, day: dteObj.selectedDay, month: (dteObj.selectedMonth+1), year: dteObj.selectedYear}, function(data) {
177 + masterObj.innerHTML = data;
181 + {dateFormat: 'dd M yy', duration: ""},
182 + // position of the datepicker calender - taken from div's offset
191 --- eventum-2.2/htdocs/js/jquery/jquery.tablednd.js 1970-01-01 02:00:00.000000000 +0200
192 +++ eventum-2.2-order/htdocs/js/jquery/jquery.tablednd.js 2009-10-12 22:10:36.435851675 +0300
195 + * TableDnD plug-in for JQuery, allows you to drag and drop table rows
196 + * You can set up various options to control how the system will work
197 + * Copyright (c) Denis Howlett <denish@isocra.com>
198 + * Licensed like jQuery, see http://docs.jquery.com/License.
200 + * Configuration options:
203 + * This is the style that is assigned to the row during drag. There are limitations to the styles that can be
204 + * associated with a row (such as you can't assign a border--well you can, but it won't be
205 + * displayed). (So instead consider using onDragClass.) The CSS style to apply is specified as
206 + * a map (as used in the jQuery css(...) function).
208 + * This is the style that is assigned to the row when it is dropped. As for onDragStyle, there are limitations
209 + * to what you can do. Also this replaces the original style, so again consider using onDragClass which
210 + * is simply added and then removed on drop.
212 + * This class is added for the duration of the drag and then removed when the row is dropped. It is more
213 + * flexible than using onDragStyle since it can be inherited by the row cells and other content. The default
214 + * is class is tDnD_whileDrag. So to use the default, simply customise this CSS class in your
217 + * Pass a function that will be called when the row is dropped. The function takes 2 parameters: the table
218 + * and the row that was dropped. You can work out the new order of the rows by using
221 + * Pass a function that will be called when the user starts dragging. The function takes 2 parameters: the
222 + * table and the row which the user has started to drag.
224 + * Pass a function that will be called as a row is over another row. If the function returns true, allow
225 + * dropping on that row, otherwise not. The function takes 2 parameters: the dragged row and the row under
226 + * the cursor. It returns a boolean: true allows the drop, false doesn't allow it.
228 + * This is the number of pixels to scroll if the user moves the mouse cursor to the top or bottom of the
229 + * window. The page should automatically scroll up or down as appropriate (tested in IE6, IE7, Safari, FF2,
232 + * This is the name of a class that you assign to one or more cells in each row that is draggable. If you
233 + * specify this class, then you are responsible for setting cursor: move in the CSS and only these cells
234 + * will have the drag behaviour. If you do not specify a dragHandle, then you get the old behaviour where
235 + * the whole row is draggable.
237 + * Other ways to control behaviour:
239 + * Add class="nodrop" to any rows for which you don't want to allow dropping, and class="nodrag" to any rows
240 + * that you don't want to be draggable.
242 + * Inside the onDrop method you can also call $.tableDnD.serialize() this returns a string of the form
243 + * <tableID>[]=<rowID1>&<tableID>[]=<rowID2> so that you can send this back to the server. The table must have
244 + * an ID as must all the rows.
248 + * $("...").tableDnDUpdate()
249 + * Will update all the matching tables, that is it will reapply the mousedown method to the rows (or handle cells).
250 + * This is useful if you have updated the table rows using Ajax and you want to make the table draggable again.
251 + * The table maintains the original configuration (so you don't have to specify it again).
253 + * $("...").tableDnDSerialize()
254 + * Will serialize and return the serialized string as above, but for each of the matching tables--so it can be
255 + * called from anywhere and isn't dependent on the currentTable being set up correctly before calling
258 + * - Auto-scoll has some problems with IE7 (it scrolls even when it shouldn't), work-around: set scrollAmount to 0
260 + * Version 0.2: 2008-02-20 First public version
261 + * Version 0.3: 2008-02-07 Added onDragStart option
262 + * Made the scroll amount configurable (default is 5 as before)
263 + * Version 0.4: 2008-03-15 Changed the noDrag/noDrop attributes to nodrag/nodrop classes
264 + * Added onAllowDrop to control dropping
265 + * Fixed a bug which meant that you couldn't set the scroll amount in both directions
266 + * Added serialize method
267 + * Version 0.5: 2008-05-16 Changed so that if you specify a dragHandle class it doesn't make the whole row
269 + * Improved the serialize method to use a default (and settable) regular expression.
270 + * Added tableDnDupate() and tableDnDSerialize() to be called when you are outside the table
273 + /** Keep hold of the current table being dragged */
274 + currentTable : null,
275 + /** Keep hold of the current drag object if any */
277 + /** The current mouse offset */
279 + /** Remember the old value of Y so that we don't do too much processing */
282 + /** Actually build the structure */
283 + build: function(options) {
284 + // Set up the defaults if any
286 + this.each(function() {
287 + // This is bound to each matching table, set up the defaults and override with user options
288 + this.tableDnDConfig = jQuery.extend({
291 + // Add in the default class for whileDragging
292 + onDragClass: "tDnD_whileDrag",
296 + serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs
297 + serializeParamName: null, // If you want to specify another parameter name instead of the table ID
298 + dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable
300 + // Now make the rows draggable
301 + jQuery.tableDnD.makeDraggable(this);
304 + // Now we need to capture the mouse up and mouse move event
305 + // We can use bind so that we don't interfere with other event handlers
307 + .bind('mousemove', jQuery.tableDnD.mousemove)
308 + .bind('mouseup', jQuery.tableDnD.mouseup);
310 + // Don't break the chain
314 + /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
315 + makeDraggable: function(table) {
316 + var config = table.tableDnDConfig;
317 + if (table.tableDnDConfig.dragHandle) {
318 + // We only need to add the event to the specified cells
319 + var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table);
320 + cells.each(function() {
321 + // The cell is bound to "this"
322 + jQuery(this).mousedown(function(ev) {
323 + jQuery.tableDnD.dragObject = this.parentNode;
324 + jQuery.tableDnD.currentTable = table;
325 + jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
326 + if (config.onDragStart) {
327 + // Call the onDrop method if there is one
328 + config.onDragStart(table, this);
334 + // For backwards compatibility, we add the event to the whole row
335 + var rows = jQuery("tr", table); // get all the rows as a wrapped set
336 + rows.each(function() {
337 + // Iterate through each row, the row is bound to "this"
338 + var row = jQuery(this);
339 + if (! row.hasClass("nodrag")) {
340 + row.mousedown(function(ev) {
341 + if (ev.target.tagName == "TD") {
342 + jQuery.tableDnD.dragObject = this;
343 + jQuery.tableDnD.currentTable = table;
344 + jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
345 + if (config.onDragStart) {
346 + // Call the onDrop method if there is one
347 + config.onDragStart(table, this);
351 + }).css("cursor", "move"); // Store the tableDnD object
357 + updateTables: function() {
358 + this.each(function() {
359 + // this is now bound to each matching table
360 + if (this.tableDnDConfig) {
361 + jQuery.tableDnD.makeDraggable(this);
366 + /** Get the mouse coordinates from the event (allowing for browser differences) */
367 + mouseCoords: function(ev){
368 + if(ev.pageX || ev.pageY){
369 + return {x:ev.pageX, y:ev.pageY};
372 + x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
373 + y:ev.clientY + document.body.scrollTop - document.body.clientTop
377 + /** Given a target element and a mouse event, get the mouse offset from that element.
378 + To do this we need the element's position and the mouse position */
379 + getMouseOffset: function(target, ev) {
380 + ev = ev || window.event;
382 + var docPos = this.getPosition(target);
383 + var mousePos = this.mouseCoords(ev);
384 + return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
387 + /** Get the position of an element by going up the DOM tree and adding up all the offsets */
388 + getPosition: function(e){
391 + /** Safari fix -- thanks to Luis Chato for this! */
392 + if (e.offsetHeight == 0) {
393 + /** Safari 2 doesn't correctly grab the offsetTop of a table row
394 + this is detailed here:
395 + http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
396 + the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
397 + note that firefox will return a text node as a first child, so designing a more thorough
398 + solution may need to take that into account, for now this seems to work in firefox, safari, ie */
399 + e = e.firstChild; // a table cell
402 + while (e.offsetParent){
403 + left += e.offsetLeft;
404 + top += e.offsetTop;
405 + e = e.offsetParent;
408 + left += e.offsetLeft;
409 + top += e.offsetTop;
411 + return {x:left, y:top};
414 + mousemove: function(ev) {
415 + if (jQuery.tableDnD.dragObject == null) {
419 + var dragObj = jQuery(jQuery.tableDnD.dragObject);
420 + var config = jQuery.tableDnD.currentTable.tableDnDConfig;
421 + var mousePos = jQuery.tableDnD.mouseCoords(ev);
422 + var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
423 + //auto scroll the window
424 + var yOffset = window.pageYOffset;
425 + if (document.all) {
427 + //yOffset=document.body.scrollTop;
428 + if (typeof document.compatMode != 'undefined' &&
429 + document.compatMode != 'BackCompat') {
430 + yOffset = document.documentElement.scrollTop;
432 + else if (typeof document.body != 'undefined') {
433 + yOffset=document.body.scrollTop;
438 + if (mousePos.y-yOffset < config.scrollAmount) {
439 + window.scrollBy(0, -config.scrollAmount);
441 + var windowHeight = window.innerHeight ? window.innerHeight
442 + : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
443 + if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) {
444 + window.scrollBy(0, config.scrollAmount);
449 + if (y != jQuery.tableDnD.oldY) {
450 + // work out if we're going up or down...
451 + var movingDown = y > jQuery.tableDnD.oldY;
452 + // update the old value
453 + jQuery.tableDnD.oldY = y;
454 + // update the style to show we're dragging
455 + if (config.onDragClass) {
456 + dragObj.addClass(config.onDragClass);
458 + dragObj.css(config.onDragStyle);
460 + // If we're over a row then move the dragged row to there so that the user sees the
461 + // effect dynamically
462 + var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
464 + // TODO worry about what happens when there are multiple TBODIES
465 + if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
466 + jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
467 + } else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) {
468 + jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
476 + /** We're only worried about the y position really, because we can only move rows up and down */
477 + findDropTargetRow: function(draggedRow, y) {
478 + var rows = jQuery.tableDnD.currentTable.rows;
479 + for (var i=0; i<rows.length; i++) {
481 + var rowY = this.getPosition(row).y;
482 + var rowHeight = parseInt(row.offsetHeight)/2;
483 + if (row.offsetHeight == 0) {
484 + rowY = this.getPosition(row.firstChild).y;
485 + rowHeight = parseInt(row.firstChild.offsetHeight)/2;
487 + // Because we always have to insert before, we need to offset the height a bit
488 + if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
489 + // that's the row we're over
490 + // If it's the same as the current row, ignore it
491 + if (row == draggedRow) {return null;}
492 + var config = jQuery.tableDnD.currentTable.tableDnDConfig;
493 + if (config.onAllowDrop) {
494 + if (config.onAllowDrop(draggedRow, row)) {
500 + // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
501 + var nodrop = jQuery(row).hasClass("nodrop");
514 + mouseup: function(e) {
515 + if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
516 + var droppedRow = jQuery.tableDnD.dragObject;
517 + var config = jQuery.tableDnD.currentTable.tableDnDConfig;
518 + // If we have a dragObject, then we need to release it,
519 + // The row will already have been moved to the right place so we just reset stuff
520 + if (config.onDragClass) {
521 + jQuery(droppedRow).removeClass(config.onDragClass);
523 + jQuery(droppedRow).css(config.onDropStyle);
525 + jQuery.tableDnD.dragObject = null;
526 + if (config.onDrop) {
527 + // Call the onDrop method if there is one
528 + config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
530 + jQuery.tableDnD.currentTable = null; // let go of the table too
534 + serialize: function() {
535 + if (jQuery.tableDnD.currentTable) {
536 + return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
538 + return "Error: No Table id set, you need to set an id on your table and every row";
542 + serializeTable: function(table) {
544 + var tableId = table.id;
545 + var rows = table.rows;
546 + for (var i=0; i<rows.length; i++) {
547 + if (result.length > 0) result += "&";
548 + var rowId = rows[i].id;
549 + if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
550 + rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
553 + result += tableId + '[]=' + rowId;
558 + serializeTables: function() {
560 + this.each(function() {
561 + // this is now bound to each matching table
562 + result += jQuery.tableDnD.serializeTable(this);
571 + tableDnD : jQuery.tableDnD.build,
572 + tableDnDUpdate : jQuery.tableDnD.updateTables,
573 + tableDnDSerialize: jQuery.tableDnD.serializeTables
576 \ No newline at end of file
577 --- eventum-2.2/htdocs/list.php 2009-09-14 18:07:55.000000000 +0300
578 +++ eventum-2.2-order/htdocs/list.php 2009-10-12 22:10:36.435851675 +0300
580 $profile['sort_by'] . "&sort_order=" . $profile['sort_order']);
583 +@$reorder_usr_id = $_REQUEST["reorder_user"];
584 +@$reorder_issue_id = $_REQUEST["reorder_source"];
585 +@$reorder_neworder = $_REQUEST["reorder_neworder"];
586 +Issue::reorderUserIssues($reorder_usr_id, $reorder_issue_id, $reorder_neworder);
588 $options = Issue::saveSearchParams();
589 $tpl->assign("options", $options);
590 $tpl->assign("sorting", Issue::getSortingInfo($options));
593 $assign_options += $users;
595 +// get the isu_order (assignated users) ordering user
596 +if (!empty($options["users"])) {
597 + if ($options["users"] == -2) {
598 + $isu_order_user = $usr_id;
600 + if ($options["users"] > 0) {
601 + $isu_order_user = $options["users"];
603 + unset($isu_order_user);
606 + unset($isu_order_user);
608 +$tpl->assign("isu_order_user", $isu_order_user);
610 $list = Issue::getListing($prj_id, $options, $pagerRow, $rows);
611 $tpl->assign("list", $list["list"]);
612 $tpl->assign("list_info", $list["info"]);
613 --- eventum-2.2/lib/eventum/class.display_column.php 2009-09-14 18:07:55.000000000 +0300
614 +++ eventum-2.2-order/lib/eventum/class.display_column.php 2009-10-12 22:10:36.429185594 +0300
617 "iss_expected_resolution_date" => array(
618 "title" => ev_gettext("Expected Resolution Date")
621 + "isu_order" => array(
622 + "title" => ev_gettext("Order")
626 return $columns[$page];
627 --- eventum-2.2/lib/eventum/class.issue.php 2009-09-14 18:07:55.000000000 +0300
628 +++ eventum-2.2-order/lib/eventum/class.issue.php 2009-10-12 22:10:36.445851670 +0300
629 @@ -1333,6 +1333,7 @@
630 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
633 + self::moveOrderForAllUsers($issue_id, 1000);
634 $prj_id = self::getProjectID($issue_id);
637 @@ -1636,6 +1637,180 @@
642 + * Method used to update the a single detail field of a specific issue.
644 + * @param integer $issue_id
645 + * @param string $field_name
646 + * @param string $field_value
647 + * @param string $field_type string or integer (for escape)
648 + * @return integer 1 on success, -1 otherwise
650 + function updateField($issue_id, $field_name, $filed_value) {
652 + $issue_id = Misc::escapeInteger($issue_id);
654 + $usr_id = Auth::getUserID();
655 + $prj_id = self::getProjectID($issue_id);
657 + // get all of the 'current' information of this issue
658 + $current = self::getDetails($issue_id);
661 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue
663 + iss_updated_date='" . Date_Helper::getCurrentDateGMT() . "',
664 + iss_last_public_action_date='" . Date_Helper::getCurrentDateGMT() . "',
665 + iss_last_public_action_type='updated'";
667 + switch ($field_name) {
669 + $stmt .= ", iss_prc_id = " . Misc::escapeInteger($filed_value);
672 + $stmt .= ", iss_pre_id = " . Misc::escapeInteger($filed_value);
674 + case 'expected_resolution_date':
675 + if (is_null($filed_value)) {
676 + $stmt .= ", iss_expected_resolution_date = null";
678 + $stmt .= ", iss_expected_resolution_date = '" . Misc::escapeString($filed_value) . "'";
682 + $stmt .= ", iss_pre_id = " . Misc::escapeInteger($filed_value);
685 + $stmt .= ", iss_pri_id = " . Misc::escapeInteger($filed_value);
688 + $stmt .= ", iss_sta_id = " . Misc::escapeInteger($filed_value);
691 + $stmt .= ", iss_res_id = " . Misc::escapeInteger($filed_value);
694 + $stmt .= ", iss_summary = '" . Misc::escapeString($filed_value) . "'";
696 + case 'description':
697 + $stmt .= ", iss_description = '" . Misc::escapeString($filed_value) . "'";
699 + case 'estimated_dev_time':
700 + $stmt .= ", iss_dev_time = '" . Misc::escapeString($filed_value) . "'";
702 + case 'percent_complete':
703 + $stmt .= ", iss_percent_complete = '" . Misc::escapeString($filed_value) . "'";
705 + case 'trigger_reminders':
706 + $stmt .= ", iss_trigger_reminders = " . Misc::escapeInteger($filed_value);
709 + $stmt .= ", iss_grp_id = " . Misc::escapeInteger($filed_value);
712 + $stmt .= ", iss_private = " . Misc::escapeInteger($filed_value);
715 + Error_Handler::logError("Unknown field name $field_name", __FILE__, __LINE__);
724 + $res = DB_Helper::getInstance()->query($stmt);
725 + if (PEAR::isError($res)) {
726 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
730 + 'category' => $current['iss_prc_id'],
731 + 'release' => $current['iss_pre_id'],
732 + 'expected_resolution_date' => $current['iss_expected_resolution_date'],
733 + 'release' => $current['iss_pre_id'],
734 + 'priority' => $current['iss_pri_id'],
735 + 'status' => $current['iss_sta_id'],
736 + 'resolution' => $current['iss_res_id'],
737 + 'summary' => $current['iss_summary'],
738 + 'description' => $current['iss_description'],
739 + 'estimated_dev_time' => $current['iss_dev_time'],
740 + 'percent_complete' => $current['iss_percent_complete'],
741 + 'trigger_reminders' => $current['iss_trigger_reminders'],
742 + 'group' => $current['iss_grp_id'],
743 + 'iss_private' => $current['private']
745 + $new[$field_name] = $filed_value;
747 + // add change to the history (only for changes on specific fields?)
748 + $updated_fields = array();
749 + if ($field_name == 'expected_resolution_date' && $current["iss_expected_resolution_date"] != $filed_value) {
750 + $updated_fields["Expected Resolution Date"] = History::formatChanges($current["iss_expected_resolution_date"], $filed_value);
752 + if ($field_name == 'category' && $current["iss_prc_id"] != $filed_value) {
753 + $updated_fields["Category"] = History::formatChanges(Category::getTitle($current["iss_prc_id"]), Category::getTitle($filed_value));
755 + if ($field_name == 'release' && $current["iss_pre_id"] != $filed_value) {
756 + $updated_fields["Release"] = History::formatChanges(Release::getTitle($current["iss_pre_id"]), Release::getTitle($filed_value));
758 + if ($field_name == 'priority' && $current["iss_pri_id"] != $filed_value) {
759 + $updated_fields["Priority"] = History::formatChanges(Priority::getTitle($current["iss_pri_id"]), Priority::getTitle($filed_value));
760 + Workflow::handlePriorityChange($prj_id, $issue_id, $usr_id, $current, $new);
762 + if ($field_name == 'status' && $current["iss_sta_id"] != $filed_value) {
763 + // clear out the last-triggered-reminder flag when changing the status of an issue
764 + Reminder_Action::clearLastTriggered($issue_id);
766 + // if old status was closed and new status is not, clear closed data from issue.
767 + $old_status_details = Status::getDetails($current['iss_sta_id']);
768 + if ($old_status_details['sta_is_closed'] == 1) {
769 + $new_status_details = Status::getDetails($filed_value);
770 + if ($new_status_details['sta_is_closed'] != 1) {
771 + self::clearClosed($issue_id);
774 + $updated_fields["Status"] = History::formatChanges(Status::getStatusTitle($current["iss_sta_id"]), Status::getStatusTitle($filed_value));
776 + if ($field_name == 'resolution' && $current["iss_res_id"] != $filed_value) {
777 + $updated_fields["Resolution"] = History::formatChanges(Resolution::getTitle($current["iss_res_id"]), Resolution::getTitle($filed_value));
779 + if ($field_name == 'estimated_dev_time' && $current["iss_dev_time"] != $filed_value) {
780 + $updated_fields["Estimated Dev. Time"] = History::formatChanges(Misc::getFormattedTime(($current["iss_dev_time"]*60)), Misc::getFormattedTime(($filed_value*60)));
782 + if ($field_name == 'summary' && $current["iss_summary"] != $filed_value) {
783 + $updated_fields["Summary"] = '';
785 + if ($field_name == 'description' && $current["iss_description"] != $filed_value) {
786 + $updated_fields["Description"] = '';
788 + if ($field_name == 'private' && ($filed_value != $current['iss_private'])) {
789 + $updated_fields["Private"] = History::formatChanges(Misc::getBooleanDisplayValue($current['iss_private']), Misc::getBooleanDisplayValue($filed_value));
791 + if (count($updated_fields) > 0) {
795 + foreach ($updated_fields as $key => $value) {
799 + if (($key != "Summary") && ($key != "Description")) {
800 + $changes .= "$key: $value";
802 + $changes .= "$key";
807 + History::add($issue_id, $usr_id, History::getTypeID('issue_updated'), "Issue updated ($changes) by " . User::getFullName($usr_id));
808 + // send notifications for the issue being updated
809 + Notification::notifyIssueUpdated($issue_id, $current, $new);
817 * Move the issue to a new project
818 @@ -1800,16 +1975,33 @@
820 $issue_id = Misc::escapeInteger($issue_id);
821 $assignee_usr_id = Misc::escapeInteger($assignee_usr_id);
823 + // move all orders down to free "order space" for this new association
825 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
827 + isu_order = isu_order + 1
829 + isu_usr_id = $assignee_usr_id AND
830 + isu_order >= $order";
831 + $res = DB_Helper::getInstance()->query($stmt);
832 + if (PEAR::isError($res)) {
833 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
836 + // insert the new association
838 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
848 - '" . Date_Helper::getCurrentDateGMT() . "'
849 + '" . Date_Helper::getCurrentDateGMT() . "',
852 $res = DB_Helper::getInstance()->query($stmt);
853 if (PEAR::isError($res)) {
854 @@ -1824,6 +2016,78 @@
859 + * Method used to get the order list to be rearranged
862 + * @param string $issue_id The issue ID or a comma seperated list of IDs already prepared for giving to mysql
863 + * @param string $usr_id The user to remove. When not specified, all users are taken as to be removed for that issue
864 + * @return mixed delete order list to be rearranged. Used as a parameter to the method of rearranging the order.
866 + function getDeleteUserAssociationOrderList($issue_id, $usr_id = "")
868 + // find all affected associantion orders
869 + $stmt = "SELECT isu_usr_id, isu_order FROM
870 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
872 + isu_iss_id IN ($issue_id)";
873 + if (!empty($usr_id)) {
874 + $stmt.= " AND isu_usr_id IN ($usr_id)";
876 + $stmt.= "ORDER BY isu_order";
877 + $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);
878 + if (PEAR::isError($res)) {
879 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
882 + $deleted_orders = array();
883 + foreach ($res as $row) {
884 + if (empty($deleted_orders[$row['isu_usr_id']])) {
885 + $deleted_orders[$row['isu_usr_id']] = array();
887 + $deleted_orders[$row['isu_usr_id']] [] = $row['isu_order'];
889 + return $deleted_orders;
895 + * Method used to rearrange order list in the db according to known deleted records
898 + * @param mixed deleteorder list
901 + function rearrangeDeleteUserAssociationOrderList($delete_order_list)
903 + if (empty($delete_order_list) || (!is_array($delete_order_list))) {
906 + foreach ($delete_order_list as $isu_usr_id => $orders) {
907 + for ($i = 0; $i < count($orders); $i++) { // traverse all deleted orders
908 + // move the orders after them up to take the "order space" of the deleted records
910 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
912 + isu_order = isu_order - " . ($i+1) . "
914 + isu_usr_id = $isu_usr_id AND
915 + isu_order > " . $orders[$i];
916 + if ($i < count($orders) - 1) {
918 + isu_order < " . $orders[$i+1];
920 + $res = DB_Helper::getInstance()->query($stmt);
921 + if (PEAR::isError($res)) {
922 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
932 * Method used to delete all user assignments for a specific issue.
933 @@ -1839,6 +2103,7 @@
934 if (is_array($issue_id)) {
935 $issue_id = implode(", ", $issue_id);
937 + $deleted_order_list = self::getDeleteUserAssociationOrderList($issue_id);
939 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
941 @@ -1869,6 +2134,7 @@
943 $issue_id = Misc::escapeInteger($issue_id);
944 $usr_id = Misc::escapeInteger($usr_id);
945 + $delete_order_list = self::getDeleteUserAssociationOrderList($issue_id, $usr_id);
947 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
949 @@ -1883,6 +2149,7 @@
950 History::add($issue_id, Auth::getUserID(), History::getTypeID('user_unassociated'),
951 User::getFullName($usr_id) . ' removed from issue by ' . User::getFullName(Auth::getUserID()));
953 + self::rearrangeDeleteUserAssociationOrderList($delete_order_list);
957 @@ -2342,6 +2609,11 @@
959 $sort_by = self::getParam('sort_by');
960 $sort_order = self::getParam('sort_order');
961 + $users = self::getParam('users');
962 + if (empty($users) && ($sort_by == 'isu_order')) { // Sorting by isu_order is impossible when no user specified
964 + unset($sort_order);
966 $rows = self::getParam('rows');
967 $hide_closed = self::getParam('hide_closed');
968 if ($hide_closed === '') {
969 @@ -2448,6 +2720,7 @@
970 "iss_expected_resolution_date" => "desc",
971 "pre_title" => "asc",
973 + "isu_order" => "desc",
976 foreach ($custom_fields as $fld_id => $fld_name) {
977 @@ -3253,6 +3526,8 @@
978 $ids = implode(", ", $ids);
985 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user,
986 @@ -3264,6 +3539,7 @@
987 if (PEAR::isError($res)) {
988 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
990 + // gather names of the users assigned to each issue
992 for ($i = 0; $i < count($res); $i++) {
993 if (!empty($t[$res[$i]['isu_iss_id']])) {
994 @@ -3272,9 +3548,18 @@
995 $t[$res[$i]['isu_iss_id']] = $res[$i]['usr_full_name'];
1000 + for ($i = 0; $i < count($res); $i++) {
1001 + if (empty($o[$res[$i]['isu_iss_id']])) {
1002 + $o[$res[$i]['isu_iss_id']] = array();
1004 + $o[$res[$i]['isu_iss_id']][$res[$i]['isu_usr_id']] = $res[$i]['isu_order'];
1006 // now populate the $result variable again
1007 for ($i = 0; $i < count($result); $i++) {
1008 @$result[$i]['assigned_users'] = $t[$result[$i]['iss_id']];
1009 + @$result[$i]['assigned_users_order'] = $o[$result[$i]['iss_id']];
1013 @@ -4247,6 +4532,7 @@
1014 Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
1017 + self::moveOrderForAllUsers($issue_id, 1);
1021 @@ -4346,4 +4632,120 @@
1022 History::add($issue_id, Auth::getUserID(), History::getTypeID('user_associated'),
1023 "Issue assignment to changed (" . History::formatChanges(join(', ', $old_assignee_names), join(', ', $assignee_names)) . ") by " . User::getFullName(Auth::getUserID()));
1027 + * Reorders user's issues as requested by user
1029 + * @param $usr_id User to be reordered
1030 + * @param $issue_id Issue or array of issues to be moved
1031 + * @param $neworder The new order of the issues
1034 + function reorderUserIssues($usr_id, $issue_id, $neworder)
1036 + if (!isset($usr_id) || !isset($issue_id) || !isset($neworder)) {
1039 + if (!is_numeric($usr_id) || !is_numeric($neworder)) {
1042 + $usr_id = Misc::escapeInteger($usr_id);
1043 + $issue_id = Misc::escapeInteger($issue_id);
1044 + $neworder = Misc::escapeInteger($neworder);
1045 + if (is_array($issue_id)) {
1046 + $issue_count = count($issue_id);
1047 + $issue_id_str = implode(", ", $issue_id);
1050 + $issue_id_str = $issue_id;
1051 + $issue_id = array($issue_id);
1053 + // do a nasty pretending to be deleting stuff so that reordering happens as if these elements were deleted
1054 + $orderlist = self::getDeleteUserAssociationOrderList($issue_id_str, $usr_id);
1055 + self::rearrangeDeleteUserAssociationOrderList($orderlist);
1056 + // move down the orders to free the "order space" needed
1058 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
1060 + isu_order = isu_order + $issue_count
1062 + isu_usr_id = $usr_id AND
1063 + isu_order >= $neworder";
1064 + $res = DB_Helper::getInstance()->query($stmt);
1065 + if (PEAR::isError($res)) {
1066 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
1069 + //update the order for the issues being moved
1071 + foreach ($issue_id as $iss_id) {
1073 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
1075 + isu_order = " . ($neworder + $i) . "
1077 + isu_usr_id = $usr_id AND
1078 + isu_iss_id = $iss_id";
1079 + $res = DB_Helper::getInstance()->query($stmt);
1080 + if (PEAR::isError($res)) {
1081 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
1090 + * Get users issue order list
1092 + * @param $user_id User
1093 + * @param $order_list Order of the issues
1096 + function getIssueOrderByUser($usr_id) {
1098 + if (!is_numeric($usr_id)) {
1103 + isu_iss_id, isu_order
1105 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
1107 + isu_usr_id = " . $usr_id ;
1109 + $order_list = array();
1111 + $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);
1113 + if (PEAR::isError($res)) {
1114 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
1117 + foreach ($res as $row) {
1118 + $order_list[$row["isu_iss_id"]] = $row["isu_order"];
1121 + return $order_list;
1124 + function moveOrderForAllUsers($issue_id, $neworder)
1126 + // Move the issue to the top priority for the ppl it's assigned to
1127 + $stmt = "SELECT isu_usr_id FROM
1128 + " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user
1130 + isu_iss_id = " . Misc::escapeInteger($issue_id);
1131 + $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);
1132 + if (PEAR::isError($res)) {
1133 + Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
1136 + foreach ($res as $row) {
1137 + self::reorderUserIssues($row["isu_usr_id"], $issue_id, $neworder);
1142 --- eventum-2.2/templates/header.tpl.html 2009-09-14 18:07:55.000000000 +0300
1143 +++ eventum-2.2-order/templates/header.tpl.html 2009-10-12 22:10:36.435851675 +0300
1145 <script type="text/javascript" src="{$rel_url}js/jquery/form.js?c=9984"></script>
1146 <script type="text/javascript" src="{$rel_url}js/jquery/blockui.js?c=eb13"></script>
1147 <script type="text/javascript" src="{$rel_url}js/jquery/ui.datepicker.js?c=a911"></script>
1148 +<script type="text/javascript" src="{$rel_url}js/jquery/jquery.tablednd.js"></script>
1149 <link rel="stylesheet" href="{$rel_url}js/jquery/ui.datepicker.css?c=5096">
1150 <script type="text/javascript">
1152 --- eventum-2.2/templates/list.tpl.html 2009-09-14 18:07:55.000000000 +0300
1153 +++ eventum-2.2-order/templates/list.tpl.html 2009-10-12 22:10:36.439185157 +0300
1155 f.target = '_popup';
1158 +function reorderBulk(order_user, neworder)
1160 + url = page_url + "?";
1161 + url += "reorder_user=" + order_user;
1163 + items = document.getElementsByName("item[]");
1165 + for (var i = 0; i < items.length; i++) {
1166 + if (items[i].checked) {
1167 + url += "&reorder_source[" + checkedcount + "]=" + items[i].value;
1171 + if (checkedcount == 0) {
1172 + alert('{/literal}{t escape=js}Please choose which issues to move to the new place.{/t}{literal}');
1176 + url += "&reorder_neworder=" + neworder;
1178 + window.location.href = url;
1180 function hideClosed(f)
1182 if (f.hide_closed.checked) {
1183 @@ -153,6 +175,13 @@
1184 f.go.disabled = true;
1187 +function updateCustomFields(issue_id)
1189 + var features = 'width=560,height=460,top=30,left=30,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
1190 + var customWin = window.open('custom_fields.php?issue_id=' + issue_id, '_custom_fields', features);
1191 + customWin.focus();
1197 @@ -169,11 +198,11 @@
1198 <input type="hidden" name="cat" value="bulk_update">
1201 - <table bgcolor="#FFFFFF" width="100%" cellspacing="1" cellpadding="2" border="0">
1203 + <table bgcolor="#FFFFFF" width="100%" cellspacing="1" cellpadding="2" border="0" id="issue_list_table">
1204 + <tr class="nodrag">
1205 <td colspan="{$col_count}" class="default">
1206 <table width="100%" cellspacing="0" cellpadding="0" border="0">
1208 + <tr class="nodrag">
1209 <td class="default">
1210 <b>{t}Search Results{/t} ({$list_info.total_rows} {t}issues found{/t}{if $list_info.end_offset > 0}, {math equation="x + 1" x=$list_info.start_offset} - {$list_info.end_offset} {t}shown{/t}{/if})</b>
1211 {include file="help_link.tpl.html" topic="list"}
1216 - <tr bgcolor="{$cell_color}">
1217 + <tr bgcolor="{$cell_color}" class="nodrag">
1218 {if $current_role > $roles.developer}
1220 <input type="button" value="{t}All{/t}" class="shortcut" onClick="javascript:toggleSelectAll(this.form, 'item[]');toggleBulkUpdate();">
1222 {if $sorting.images[$fld_name_id] != ""}<a title="{t}sort by{/t} {$fld_title|escape:"html"}" href="{$sorting.links[$fld_name_id]}" class="white_link"><img border="0" src="{$sorting.images[$fld_name_id]}"></a>{/if}
1226 + {elseif $field_name != 'isu_order' || $isu_order_user}
1227 <td align="{$column.align|default:'center'}" class="default_white" nowrap {if $column.width != ''}width="{$column.width}"{/if}>
1228 {if $field_name == 'iss_summary'}
1229 <table cellspacing="0" cellpadding="1" width="100%">
1230 @@ -232,20 +261,21 @@
1235 {section name="i" loop=$list}
1236 - <tr {if $current_role >= $roles.developer AND $list[i].iqu_status > 0}style="text-decoration: line-through;"{/if}>
1237 + <tr {if $current_role >= $roles.developer AND $list[i].iqu_status > 0}style="text-decoration: line-through;"{/if} id="{$list[i].iss_id}" {if !$list[i].assigned_users_order[$current_user_id]}class="nodrag"{/if}>
1238 {if $current_role > $roles.developer}
1239 <td bgcolor="{$list[i].status_color}" width="1%" class="default" align="center"><input type="checkbox" name="item[]" value="{$list[i].iss_id}" onchange="toggleBulkUpdate();"></td>
1241 {foreach from=$columns item=column key=field_name}
1242 {if $field_name == 'custom_fields'}
1243 {foreach from=$list[i].custom_field key=fld_id item=fld_value}
1244 - <td bgcolor="{$list[i].status_color}" align="{$column.align|default:'center'}" class="default">
1245 - {$fld_value|formatCustomValue:$fld_id:$list[i].iss_id}
1246 + <td bgcolor="{$list[i].status_color}" align="{$column.align|default:'center'}" class="default custom_field" onclick="return updateCustomFields({$list[i].iss_id});">
1247 + {$fld_value|formatCustomValue:$fld_id:$list[i].iss_id}
1251 - <td bgcolor="{$list[i].status_color}" align="{$column.align|default:'center'}" class="default">
1252 + {elseif $field_name != 'isu_order' || $isu_order_user}
1253 + <td bgcolor="{$list[i].status_color}" align="{$column.align|default:'center'}" class="default{if $field_name == 'isu_order'} dragHandle{/if}">
1254 {if $field_name == 'iss_id'}
1255 <a href="view.php?id={$list[i].iss_id}" class="link" title="{t}view issue details{/t}">{$list[i].iss_id}</a>
1256 {elseif $field_name == 'pri_rank'}
1258 {elseif $field_name == 'iss_percent_complete'}
1259 {$list[i].iss_percent_complete|escape:"html"}%
1260 {elseif $field_name == 'iss_expected_resolution_date'}
1261 - {$list[i].iss_expected_resolution_date|escape:"html"}
1262 + <div class="inline_date_pick" id="expected_resolution_date|{$list[i].iss_id}">{$list[i].iss_expected_resolution_date|escape:"html"} </div>
1263 {elseif $field_name == 'iss_summary'}
1264 <a href="view.php?id={$list[i].iss_id}" class="link" title="{t}view issue details{/t}">{$list[i].iss_summary|escape:"html"}</a>
1265 {if $list[i].redeemed}
1267 {if $list[i].iss_private == 1}
1270 + {elseif $field_name == 'isu_order'}
1271 + {if $options.sort_by == "isu_order" and $current_user_id == $isu_order_user} {/if}
1275 @@ -300,10 +332,11 @@
1279 - <tr bgcolor="{$cell_color}">
1281 + <tr bgcolor="{$cell_color}" class="nodrag">
1282 <td colspan="{$col_count}">
1283 <table width="100%" cellspacing="0" cellpadding="0">
1285 + <tr class="nodrag">
1286 <td width="30%" nowrap>
1287 {if $current_role > $roles.developer}
1288 <input type="button" value="{t}All{/t}" class="shortcut" onClick="javascript:toggleSelectAll(this.form, 'item[]');">
1289 @@ -355,6 +388,35 @@
1294 +<script type="text/javascript">
1296 + * Order issues by drag and drop:
1297 + * only if sorted by order and viewing your own issues
1299 +{if $options.sort_by == "isu_order" and $current_user_id == $isu_order_user}
1301 +var before = ''; // make it global variable
1302 +$('#issue_list_table').tableDnD({
1303 + onDragClass: "tDnD_whileDrag",
1304 + onDragStart: function(table, row) {
1305 + before = $.tableDnD.serialize('id');
1307 + onDrop: function(table, row) {
1308 + $.post("/ajax/order.php", {before: before, after: $.tableDnD.serialize('id')}, function(data) {
1309 + if (data.length > 0) {
1314 + dragHandle: "dragHandle"
1316 +$("#issue_list_table tr").hover(function() {
1317 + $('#' + this.id + ' .dragHandle').addClass('showDragHandle');
1319 + $('#' + this.id + ' .dragHandle').removeClass('showDragHandle');
1324 {include file="app_info.tpl.html"}
1325 {include file="footer.tpl.html"}
1326 --- eventum-2.2/upgrade/patches/04_isu_order.php 1970-01-01 02:00:00.000000000 +0200
1327 +++ eventum-2.2-order/upgrade/patches/04_isu_order.php 2009-10-12 22:10:36.439185157 +0300
1331 +function db_patch_4() {
1334 + $columns = db_getCol('DESC %TABLE_PREFIX%issue_user');
1335 + if (in_array('isu_order', $columns)) {
1339 + $stmts[] = "ALTER TABLE %TABLE_PREFIX%issue_user ADD isu_order int(11) NOT NULL DEFAULT '0' AFTER isu_assigned_date, ADD INDEX isu_order (isu_order)";
1340 + $stmts[] = "UPDATE %TABLE_PREFIX%issue_user set isu_order=isu_iss_id";
1344 --- eventum-2.2/upgrade/update-database.php 2009-09-14 18:07:55.000000000 +0300
1345 +++ eventum-2.2-order/upgrade/update-database.php 2009-10-12 22:10:36.439185157 +0300
1347 1 => '01_notes.php',
1348 2 => '02_usr_alias.php',
1349 3 => '03_prj_mail_aliases.php',
1350 + 4 => '04_isu_order.php',
1353 // sanity check. check that the version table exists.