List:Eventum Development« Previous MessageNext Message »
From:Phillip Smith Date:February 20 2004 2:02am
Subject:patch for issue resolution
View as plain text  
Greetings,

Attached are the files necessary for adding complete issue resolution
support.  It will add a column to the "List Issues" view, allow searching
on the resolution field from the simple and advanced search boxes, and
provide a resolution drop-down box when an issue is being closed.

The patch is a unified diff.  To apply it, grab the latest eventum bk
source, change into the top-level, and run:

patch -p1 < /path/to/resolution.diff

The query in resolution.sql will need to be run on eventum's database.

-phillip
ALTER TABLE `eventum_issue` ADD `iss_res_id` INT( 10 ) UNSIGNED NOT NULL AFTER `iss_sta_id`;
--- eventum/adv_search.php	2004-02-19 20:30:39.000000000 -0500
+++ resolution/adv_search.php	2004-02-19 20:11:46.000000000 -0500
@@ -34,6 +34,7 @@
 include_once(APP_INC_PATH . "class.category.php");
 include_once(APP_INC_PATH . "class.misc.php");
 include_once(APP_INC_PATH . "class.release.php");
+include_once(APP_INC_PATH . "class.resolution.php");
 include_once(APP_INC_PATH . "class.project.php");
 include_once(APP_INC_PATH . "class.filter.php");
 include_once(APP_INC_PATH . "class.status.php");
@@ -51,6 +52,7 @@
     "status"     => Status::getAssocStatusList($prj_id),
     "users"      => Project::getUserAssocList($prj_id, 'active'),
     "releases"   => Release::getAssocList($prj_id),
+    "resolutions" => Resolution::getAssocList($prj_id),
     "custom"     => Filter::getListing($prj_id)
 ));
 
--- eventum/list.php	2004-02-19 20:33:07.000000000 -0500
+++ resolution/list.php	2004-02-19 20:12:07.000000000 -0500
@@ -33,6 +33,7 @@
 include_once(APP_INC_PATH . "class.auth.php");
 include_once(APP_INC_PATH . "class.category.php");
 include_once(APP_INC_PATH . "class.misc.php");
+include_once(APP_INC_PATH . "class.resolution.php");
 include_once(APP_INC_PATH . "class.release.php");
 include_once(APP_INC_PATH . "class.issue.php");
 include_once(APP_INC_PATH . "class.project.php");
@@ -71,6 +72,7 @@
 $tpl->assign("custom", Filter::getAssocList($prj_id));
 $tpl->assign("csts", Filter::getListing($prj_id));
 $tpl->assign("categories", Category::getAssocList($prj_id));
+$tpl->assign("resolutions", Resolution::getAssocList($prj_id));
 
 $prefs = Prefs::get(Auth::getUserID());
 $tpl->assign("refresh_rate", $prefs['list_refresh_rate'] * 60);

--- eventum/templates/en/close.tpl.html	2004-02-19 20:35:28.000000000 -0500
+++ resolution/templates/en/close.tpl.html	2004-02-19 20:12:55.000000000 -0500
@@ -68,6 +68,16 @@
         </tr>
         <tr>
           <td width="160" bgcolor="{$cell_color}" class="default_white">
+            <b>Resolution:</b><br />
+          </td>
+          <td bgcolor="{$light_color}">
+            <select class="default" name="resolution">
+              {html_options options=$resolutions}
+            </select>
+          </td>
+        </tr>
+        <tr>
+          <td width="160" bgcolor="{$cell_color}" class="default_white">
             <b>Internal Note (reason for closing issue): *</b><br />
           </td>
           <td bgcolor="{$light_color}" class="default">

--- eventum/templates/en/custom_filter_form.tpl.html	2004-02-19 20:37:18.000000000 -0500
+++ resolution/templates/en/custom_filter_form.tpl.html	2004-02-19 20:13:08.000000000 -0500
@@ -160,6 +160,17 @@
           </td>
         </tr>
         <tr>
+          <td>
+            <span class="default">Resolution:</span><br />
+            <select name="resolution" class="default">
+              <option value="">any</option>
+              {foreach key=res_id item=res_title from=$resolutions}
+              <option value="{$res_id}" {if $res_id == $options.cst_iss_res_id}selected{/if}>{$res_title}</option>
+              {/foreach}
+            </select>
+          </td>
+        </tr>
+        <tr>
           <td align="center" class="default">
             <input type="checkbox" name="hide_closed" value="1" {if $options.cst_hide_closed == 1}checked{/if}> <a id="link" class="link" href="javascript:void(null);" onClick="javascript:toggleCheckbox('custom_filter_form', 'hide_closed');">Hide Closed Issues</a>
           </td>

--- eventum/templates/en/list_form.tpl.html	2004-02-19 20:36:48.000000000 -0500
+++ resolution/templates/en/list_form.tpl.html	2004-02-19 20:13:19.000000000 -0500
@@ -91,7 +91,7 @@
             <b>Search Results ({$list_info.total_rows} issues found{if $list_info.end_offset > 0}, {math equation="x + 1" x=$list_info.start_offset} - {$list_info.end_offset} shown{/if})</b>
             {include file="help_link.tpl.html" topic="list"}
           </td>
-          <td colspan="2" align="right" class="default">
+          <td colspan="3" align="right" class="default">
             {if $browser.ie5up or $browser.ns6up or $browser.gecko}
             hide/show:
             [ <a class="link" title="hide / show the quick search form" href="javascript:void(null);" onClick="javascript:toggleVisibility('filter_form');">quick search</a> ]
@@ -124,6 +124,10 @@
             {if $sorting.images.iss_sta_id != ""}<a title="sort by status" href="{$sorting.links.iss_sta_id}" class="white_link"><img border="0" src="{$sorting.images.iss_sta_id}"></a>{/if}
           </td>
           <td align="center" class="default_white" nowrap>
+            <a title="sort by resolution" href="{$sorting.links.iss_res_id}" class="white_link">Resolution</a>
+            {if $sorting.images.iss_res_id != ""}<a title="sort by resolution" href="{$sorting.links.iss_res_id}" class="white_link"><img border="0" src="{$sorting.images.iss_res_id}"></a>{/if}
+          </td>
+          <td align="center" class="default_white" nowrap>
             <a title="sort by created date" href="{$sorting.links.iss_created_date}" class="white_link">Created Date</a>
             {if $sorting.images.iss_created_date != ""}<a title="sort by created date" href="{$sorting.links.iss_created_date}" class="white_link"><img border="0" src="{$sorting.images.iss_created_date}"></a>{/if}
           </td>
@@ -148,12 +152,13 @@
           {/if}
           <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].pri_title|escape:"html"}</td>
           <td bgcolor="{$list[i].status_color}" align="center" class="default"><a href="view.php?id={$list[i].iss_id}" class="link" title="view issue details">{$list[i].iss_id}</a></td>
-          <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].assigned_users}</td>
+          <td bgcolor="{$list[i].status_color}" width="15%" class="default">{$list[i].assigned_users}</td>
           <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].time_spent}</td>
           <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].prc_title|escape:"html"}</td>
           <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].sta_title|escape:"html"}</td>
+          <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].iss_resolution|escape:"html"}</td>
           <td bgcolor="{$list[i].status_color}" align="center" class="default">{$list[i].iss_created_date|escape:"html"}</td>
-          <td bgcolor="{$list[i].status_color}" width="50%" class="default">
+          <td bgcolor="{$list[i].status_color}" width="30%" class="default">
             <a href="view.php?id={$list[i].iss_id}" class="link" title="view issue details">{$list[i].iss_summary|escape:"html"}</a>
             {if $list[i].iss_lock_usr_id != ""}
             <a href="view.php?id={$list[i].iss_id}" class="link" title="issue currently locked"><img src="images/icons/lock.gif" border="0"></a>
@@ -162,13 +167,13 @@
         </tr>
         {sectionelse}
         <tr bgcolor="gray">
-          <td colspan="{if $current_role > $roles.standard_user}9{else}8{/if}" class="default_white" align="center">
+          <td colspan="{if $current_role > $roles.standard_user}10{else}9{/if}" class="default_white" align="center">
             <b>No issues could be found.</b>
           </td>
         </tr>
         {/section}
         <tr bgcolor="{$cell_color}">
-          <td colspan="{if $current_role > $roles.standard_user}9{else}8{/if}">
+          <td colspan="{if $current_role > $roles.standard_user}10{else}9{/if}">
             <table width="100%" cellspacing="0" cellpadding="0">
               <tr>
                 <td width="30%" nowrap>
@@ -219,3 +224,4 @@
   <input type="hidden" name="csv_data" value="{$csv_data}">
   </form>
 </table>
+

--- eventum/templates/en/quick_filter_form.tpl.html	2004-02-19 20:37:39.000000000 -0500
+++ resolution/templates/en/quick_filter_form.tpl.html	2004-02-19 20:13:35.000000000 -0500
@@ -9,6 +9,7 @@
     f.category.selectedIndex = 0;
     f.status.selectedIndex = 0;
     f.priority.selectedIndex = 0;
+    f.resolution.selectedIndex = 0;
     // now for the fields that are only available through the advanced search page
     setHiddenFieldValue(f, 'created_date[Year]', '');
     setHiddenFieldValue(f, 'created_date[Month]', '');
@@ -35,7 +36,7 @@
 {/literal}
 var get_urls = new Array();
 {section name="i" loop=$csts}
-get_urls[{$csts[i].cst_id}] = 'keywords={$csts[i].cst_keywords|escape:"html"}&users={$csts[i].cst_users}&category={$csts[i].cst_iss_prc_id}&status={$csts[i].cst_iss_sta_id}&priority={$csts[i].cst_iss_pri_id}&release={$csts[i].cst_iss_pre_id}&rows={$csts[i].cst_rows}&sort_by={$csts[i].cst_sort_by}&sort_order={$csts[i].cst_sort_order}&hide_closed={$csts[i].cst_hide_closed}';
+get_urls[{$csts[i].cst_id}] = 'keywords={$csts[i].cst_keywords|escape:"html"}&users={$csts[i].cst_users}&category={$csts[i].cst_iss_prc_id}&status={$csts[i].cst_iss_sta_id}&priority={$csts[i].cst_iss_pri_id}&resolution={$csts[i].cst_iss_res_id}&release={$csts[i].cst_iss_pre_id}&rows={$csts[i].cst_rows}&sort_by={$csts[i].cst_sort_by}&sort_order={$csts[i].cst_sort_order}&hide_closed={$csts[i].cst_hide_closed}';
 {/section}
 {literal}
 function runCustomFilter(f)
@@ -121,6 +122,16 @@
               {/section}
             </select>
           </td>
+	  <td>
+            <span class="default">Resolution:</span><br />
+            <select name="resolution" class="default">
+              <option value="">any</option>
+              {foreach key=res_id item=res_title from=$resolutions}
+              <option value="{$res_id}" {if $res_id == $options.resolution}selected{/if}>{$res_title}</option>
+              {/foreach}
+            </select>
+          </td>
+
           <td>
             <input class="button" type="submit" value="Search">
             <input class="button" type="button" value="Clear" onClick="javascript:clearFilters(this.form);">

Thread
patch for issue resolutionPhillip Smith20 Feb