[evolvis-commits] r8264: moving tracker/browse. php logic into separate class↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 16:37:56 CET 2011
Author: mirabilos
Date: 2011-02-24 16:37:56 +0100 (Thu, 24 Feb 2011)
New Revision: 8264
Added:
trunk/gforge_base/evolvisforge-5.1/gforge/common/tracker/ArtifactFactory.class
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/db/20021214.sql
trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/browse.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/include/ArtifactTypeHtml.class
Log:
moving tracker/browse.php logic into separate class
Added: trunk/gforge_base/evolvisforge-5.1/gforge/common/tracker/ArtifactFactory.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/tracker/ArtifactFactory.class (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/tracker/ArtifactFactory.class 2011-02-24 15:37:56 UTC (rev 8264)
@@ -0,0 +1,219 @@
+<?php
+/**
+ * GForge Tracker Facility
+ *
+ * Copyright 2002 GForge, LLC
+ * http://gforge.org/
+ *
+ * @version $Id$
+ */
+
+require_once('common/include/Error.class');
+require_once('common/tracker/Artifact.class');
+
+class ArtifactFactory extends Error {
+
+ /**
+ * The ArtifactType object.
+ *
+ * @var object $ArtifactType.
+ */
+ var $ArtifactType;
+
+ /**
+ * The artifacts array.
+ *
+ * @var array artifacts.
+ */
+ var $artifacts;
+ var $order_col;
+ var $sort;
+ var $status;
+ var $category;
+ var $group;
+ var $assigned_to;
+ var $offset;
+ var $max_rows;
+ var $fetched_rows;
+
+ /**
+ * Constructor.
+ *
+ * @param object The ArtifactType object to which this ArtifactFactory is associated.
+ * @return boolean success.
+ */
+ function ArtifactFactory(&$ArtifactType) {
+ $this->Error();
+ if (!$ArtifactType || !is_object($ArtifactType)) {
+ $this->setError('ArtifactFactory:: No Valid ArtifactType Object');
+ return false;
+ }
+ if ($ArtifactType->isError()) {
+ $this->setError('ArtifactFactory:: '.$ArtifactType->getErrorMessage());
+ return false;
+ }
+ $this->ArtifactType =& $ArtifactType;
+
+ return true;
+ }
+
+ /**
+ * setup - sets up limits and sorts before you call getTasks().
+ *
+ * @param int The offset - number of rows to skip.
+ * @param string The column to sort on.
+ * @param string The way to order - ASC or DESC.
+ * @param int The max number of rows to return.
+ * @param string Whether to set these prefs into the user_prefs table - use "custom".
+ * @param int Include this param if you want to limit to a certain assignee.
+ * @param int Include this param if you want to limit to a certain category.
+ * @param int Include this param if you want to limit to a certain group.
+ */
+ function setup($offset,$order_col,$sort,$max_rows,$set,$_assigned_to,$_status,$_category,$_group) {
+//echo "<BR>offset: $offset| order: $order|max_rows: $max_rows|_assigned_to: $_assigned_to|_status: $_status|_category_id: $_category_id +";
+ if ((!$offset) || ($offset < 0)) {
+ $this->offset=0;
+ } else {
+ $this->offset=$offset;
+ }
+
+ if (session_loggedin()) {
+ $u =& session_get_user();
+ }
+
+ if (!$set) {
+ /*
+ if no set is passed in, see if a preference was set
+ if no preference or not logged in, use open set
+ */
+ if (session_loggedin()) {
+ $custom_pref=$u->getPreference('art_cust'.$this->ArtifactType->getID());
+ if ($custom_pref) {
+ $pref_arr=explode('|',$custom_pref);
+ $_assigned_to=$pref_arr[0];
+ $_status=$pref_arr[1];
+ $_category=$pref_arr[2];
+ $_group=$pref_arr[3];
+ $order_col=$pref_arr[4];
+ $sort=$pref_arr[5];
+ $set='custom';
+ } else {
+ //default to open
+ $_assigned_to=0;
+ $_status=1;
+ }
+ } else {
+ //default to open
+ $_assigned_to=0;
+ $_status=1;
+ }
+ }
+
+ //
+ // validate the column names and sort order passed in from user
+ // before saving it to prefs
+ //
+ if ($order_col=='artifact_id' || $order_col=='summary' || $order_col=='open_date' ||
+ $order_col=='close_date' || $order_col=='assigned_to' || $order_col=='submitted_by' || $order_col=='priority') {
+ $_order_col=$order_col;
+ if (($sort == 'ASC') || ($sort == 'DESC')) {
+ $_sort_ord=$sort;
+ } else {
+ $_sort_ord='ASC';
+ }
+ } else {
+ $_order_col='artifact_id';
+ $_sort_ord='ASC';
+ }
+
+ if ($set=='custom') {
+ if (session_loggedin()) {
+ /*
+ if this custom set is different than the stored one, reset preference
+ */
+ $pref_=$_assigned_to.'|'.$_status.'|'.$_category.'|'.$_group.'|'.$_order_col.'|'.$_sort_ord;
+ if ($pref_ != $u->getPreference('art_cust'.$this->ArtifactType->getID())) {
+ $u->setPreference('art_cust'.$this->ArtifactType->getID(),$pref_);
+ }
+ }
+ }
+
+ $this->sort=$_sort_ord;
+ $this->order_col=$_order_col;
+ $this->status=$_status;
+ $this->assigned_to=$_assigned_to;
+ $this->category=$_category;
+ $this->group=$_group;
+
+ if (!$max_rows || $max_rows < 5) {
+ $max_rows=50;
+ }
+ $this->max_rows=$max_rows;
+ }
+
+ /**
+ * getArtifacts - get an array of Artifact objects.
+ *
+ * @return array The array of Artifact objects.
+ */
+ function &getArtifacts() {
+ if ($this->artifacts) {
+ return $this->artifacts;
+ }
+
+ //if status selected, and more to where clause
+ if ($this->status && ($this->status != 100)) {
+ //for open tasks, add status=100 to make sure we show all
+ $status_str="AND status_id='".$this->status."'";
+ } else {
+ //no status was chosen, so don't add it to where clause
+ $status_str='';
+ }
+
+ //if assigned to selected, and more to where clause
+ if ($this->assigned_to) {
+ $assigned_str="AND assigned_to='".$this->assigned_to."'";
+ } else {
+ //no assigned to was chosen, so don't add it to where clause
+ $assigned_str='';
+ }
+
+ if ($this->category && ($this->category != 100)) {
+ $category_str="AND category_id='". $this->category ."'";
+ }
+
+ //if artgroup selected, add to where clause
+ if ($this->group && ($this->group != 100)) {
+ $group_str="AND artifact_group_id='". $this->group ."'";
+ } else {
+ //no artgroup to was chosen, so don't add it to where clause
+ $group_str='';
+ }
+
+ //
+ // now run the query using the criteria chosen above
+ //
+ $sql="SELECT * FROM artifact_vw
+ WHERE
+ group_artifact_id='". $this->ArtifactType->getID() ."'
+ $status_str $assigned_str $category_str $group_str
+ ORDER BY group_artifact_id ".$this->sort.", ". $this->order_col ." ".$this->sort;
+
+
+ $result=db_query($sql,($this->max_rows),$this->offset);
+ $rows = db_numrows($result);
+ $this->fetched_rows=$rows;
+ if (db_error()) {
+ $this->setError('Database Error: '.db_error());
+ return false;
+ } else {
+ while ($arr =& db_fetch_array($result)) {
+ $this->artifacts[] = new Artifact($this->ArtifactType, $arr);
+ }
+ }
+ return $this->artifacts;
+ }
+
+}
+
+?>
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/db/20021214.sql
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/db/20021214.sql 2011-02-24 15:37:55 UTC (rev 8263)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/db/20021214.sql 2011-02-24 15:37:56 UTC (rev 8264)
@@ -8,25 +8,3 @@
WHERE
frs_filetype.type_id=frs_file.type_id
AND frs_processor.processor_id=frs_file.processor_id;
-
-CREATE SEQUENCE plugins_pk_seq;
-CREATE TABLE plugins (plugin_id integer DEFAULT nextval('plugins_pk_seq'::text) NOT NULL,
- plugin_name varchar(32) UNIQUE NOT NULL,
- plugin_desc text,
- CONSTRAINT plugins_pkey PRIMARY KEY (plugin_id));
-
-CREATE SEQUENCE group_plugin_pk_seq;
-CREATE TABLE group_plugin (group_plugin_id integer DEFAULT nextval('group_plugin_pk_seq'::text) NOT NULL,
- group_id integer,
- plugin_id integer,
- CONSTRAINT group_plugin_pkey PRIMARY KEY (group_plugin_id),
- CONSTRAINT group_plugin_group_id_fk FOREIGN KEY (group_id) REFERENCES groups(group_id) MATCH FULL,
- CONSTRAINT group_plugin_plugin_id_fk FOREIGN KEY (plugin_id) REFERENCES plugins(plugin_id) MATCH FULL);
-
-CREATE SEQUENCE user_plugin_pk_seq;
-CREATE TABLE user_plugin (user_plugin_id integer DEFAULT nextval('user_plugin_pk_seq'::text) NOT NULL,
- user_id integer,
- plugin_id integer,
- CONSTRAINT user_plugin_pkey PRIMARY KEY (user_plugin_id),
- CONSTRAINT user_plugin_user_id_fk FOREIGN KEY (user_id) REFERENCES users(user_id) MATCH FULL,
- CONSTRAINT user_plugin_plugin_id_fk FOREIGN KEY (plugin_id) REFERENCES plugins(plugin_id) MATCH FULL);
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/browse.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/browse.php 2011-02-24 15:37:55 UTC (rev 8263)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/browse.php 2011-02-24 15:37:56 UTC (rev 8264)
@@ -10,7 +10,7 @@
* @version $Id$
*
*/
-
+require_once('common/tracker/ArtifactFactory.class');
//
// make sure this person has permission to view artifacts
//
@@ -18,107 +18,26 @@
exit_permission_denied();
}
-if (session_loggedin()) {
- $u =& session_get_user();
+$af = new ArtifactFactory($ath);
+if (!$af || !is_object($af)) {
+ exit_error('Error','Could Not Get Factory');
+} elseif ($af->isError()) {
+ exit_error('Error',$af->getErrorMessage());
}
-if (!$offset || $offset < 0) {
- $offset=0;
-}
+$af->setup($offset,$_sort_col,$_sort_ord,$max_rows,$set,$_assigned_to,$_status,$_category,$_group);
+$_sort_col=$af->order_col;
+$_sort_ord=$af->sort;
+$_status=$af->status;
+$_assigned_to=$af->assigned_to;
+$_category=$af->category;
+$_group=$af->group;
-if (!$set) {
- /*
- if no set is passed in, see if a preference was set
- if no preference or not logged in, use open set
- */
- if (session_loggedin()) {
- $custom_pref=$u->getPreference('art_cust'.$ath->getID());
- if ($custom_pref) {
- $pref_arr=explode('|',$custom_pref);
- $_assigned_to=$pref_arr[0];
- $_status=$pref_arr[1];
- $_category=$pref_arr[2];
- $_group=$pref_arr[3];
- $order=$pref_arr[4];
- $sort=$pref_arr[5];
- $set='custom';
- } else {
- //default to open
- $_assigned_to=0;
- $_status=1;
- }
- } else {
- //default to open
- $_assigned_to=0;
- $_status=1;
- }
+$art_arr =& $af->getArtifacts();
+if (!$art_arr && $af->isError()) {
+ exit_error('Error',$af->getErrorMessage());
}
-//
-// validate the column names and sort order passed in from user
-// before saving it to prefs
-//
-if ($order=='artifact_id' || $order=='summary' || $order=='open_date' || $order=='close_date' || $order=='assigned_to' || $order=='submitted_by' || $order=='priority') {
- $_sort_col=$order;
- if (($sort == 'ASC') || ($sort == 'DESC')) {
- $_sort_ord=$sort;
- } else {
- $_sort_ord='ASC';
- }
-} else {
- $_sort_col='artifact_id';
- $_sort_ord='ASC';
-}
-
-if ($set=='custom') {
- if (session_loggedin()) {
- /*
- if this custom set is different than the stored one, reset preference
- */
- $pref_=$_assigned_to.'|'.$_status.'|'.$_category.'|'.$_group.'|'.$_sort_col.'|'.$_sort_ord;
- if ($pref_ != $u->getPreference('art_cust'.$ath->getID())) {
- $u->setPreference('art_cust'.$ath->getID(),$pref_);
- }
- }
-}
-
-/*
- Display items based on the form post - by user or status or both
-*/
-
-//if status selected, add more to where clause
-if ($_status && ($_status != 100)) {
- //for open tasks, add status=100 to make sure we show all
- $status_str="AND artifact.status_id='$_status'";
-} else {
- //no status was chosen, so don't add it to where clause
- $status_str='';
-}
-
-//if assigned to selected, add to where clause
-if ($_assigned_to) {
- $assigned_str="AND artifact.assigned_to='$_assigned_to'";
-} else {
- //no assigned to was chosen, so don't add it to where clause
- $assigned_str='';
-}
-
-//if category selected, add to where clause
-if ($_category && ($_category != 100)) {
- $category_str="AND artifact.category_id='$_category'";
-} else {
- //no assigned to was chosen, so don't add it to where clause
- $category_str='';
-}
-
-//if artgroup selected, add to where clause
-if ($_group && ($_group != 100)) {
- $group_str="AND artifact.artifact_group_id='$_group'";
-} else {
- //no artgroup to was chosen, so don't add it to where clause
- $group_str='';
-}
-
//build page title to make bookmarking easier
//if a user was selected, add the user_name to the title
//same for status
@@ -195,8 +114,8 @@
<tr>
<td align="right"><span style="font-size:smaller">Sort By: <a href="javascript:help_window(\'/help/tracker.php?helpname=sort_by\')"><strong>(?)</strong></a></span></td>'.
'<td><span style="font-size:smaller">'.
- html_build_select_box_from_arrays($order_arr,$order_name_arr,'order',$_sort_col,false) .'</td>'.
- '<td><span style="font-size:smaller">'.html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'sort',$_sort_ord,false) .'</td>'.
+ html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .'</td>'.
+ '<td><span style="font-size:smaller">'.html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .'</td>'.
'<td><span style="font-size:smaller"><input type="submit" name="submit" value="Browse" /></td>
</tr>
</form></table>';
@@ -206,28 +125,147 @@
*/
echo $ath->getBrowseInstructions();
-//
-// now run the query using the criteria chosen above
-//
-$sql="SELECT artifact.priority,artifact.group_artifact_id,artifact.artifact_id,artifact.summary,
- artifact.open_date AS date,users.user_name AS submitted_by,user2.user_name AS assigned_to
- FROM artifact,users,users user2
- WHERE users.user_id=artifact.submitted_by
- $status_str $assigned_str $category_str $group_str
- AND user2.user_id=artifact.assigned_to
- AND group_artifact_id='". $ath->getID() ."'
- ORDER BY group_artifact_id $_sort_ord, $_sort_col $_sort_ord";
+if ($art_arr && count($art_arr) > 0) {
-$result=db_query($sql,51,$offset);
+ if ($set=='custom') {
+ $set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status.'&_category='.$_category.'&_group='.$_group.'&_sort_col='.$_sort_col.'&_sort_ord='.$_sort_ord;
+ }
-if ($result && db_numrows($result) > 0) {
+ $title_arr=array();
+ $title_arr[]='Request ID';
+ $title_arr[]='Summary';
+ $title_arr[]='Date';
+ $title_arr[]='Assigned To';
+ $title_arr[]='Submitted By';
- if ($set=='custom') {
- $set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status.'&_category='.$_category.'&_group='.$_group.'&order='.$_sort_col.'&sort='.$_sort_ord;
+ $IS_ADMIN=$ath->userIsAdmin();
+
+ if ($IS_ADMIN) {
+ echo '
+ <form name="artifactList" action="'. $PHP_SELF .'?group_id='.$group_id.'&atid='.$ath->getID().'" METHOD="POST">
+ <input type="hidden" name="func" value="massupdate">';
}
- $ath->showBrowseList($result,$offset,$set);
+ echo $GLOBALS['HTML']->listTableTop ($title_arr);
+ $then=(time()-$ath->getDuePeriod());
+ $rows=count($art_arr);
+ for ($i=0; $i < $rows; $i++) {
+ echo '
+ <tr bgcolor="'. html_get_priority_color( $art_arr[$i]->getPriority() ) .'">'.
+ '<td NOWRAP>'.
+ ($IS_ADMIN?'<input type="CHECKBOX" name="artifact_id_list[]" value="'.
+ $art_arr[$i]->getID() .'"> ':'').
+ $art_arr[$i]->getID() .
+ '</td>'.
+ '<td><a href="'.$PHP_SELF.'?func=detail&aid='.
+ $art_arr[$i]->getID() .
+ '&group_id='. $group_id .'&atid='.
+ $ath->getID().'">'.
+ $art_arr[$i]->getSummary() .
+ '</a></td>'.
+ '<td>'. (($set != 'closed' && $art_arr[$i]->getOpenDate() < $then)?'* ':' ') .
+ date($sys_datefmt,$art_arr[$i]->getOpenDate()) .'</td>'.
+ '<td>'. $art_arr[$i]->getAssignedRealName() .'</td>'.
+ '<td>'. $art_arr[$i]->getSubmittedRealName() .'</td></tr>';
+ }
+
+ /*
+ Show extra rows for <-- Prev / Next -->
+ */
+ if (($offset > 0) || ($rows >= 50)) {
+ echo '
+ <tr><td colspan="2">';
+ if ($offset > 0) {
+ echo '<a href="'.$PHP_SELF.'?func=browse&group_id='.$group_id.'&atid='.$ath->getID().'&set='.
+ $set.'&offset='.($offset-50).'"><strong><-- Previous 50</strong></a>';
+ } else {
+ echo ' ';
+ }
+ echo '</td><td> </td><td colspan="2">';
+ if ($rows >= 50) {
+ echo '<a href="'.$PHP_SELF.'?func=browse&group_id='.$group_id.'&atid='.$ath->getID().'&set='.
+ $set.'&offset='.($offset+50).'"><strong>Next 50 --></strong></a>';
+ } else {
+ echo ' ';
+ }
+ echo '</td></tr>';
+ }
+
+ echo $GLOBALS['HTML']->listTableBottom();
+ /*
+ Mass Update Code
+ */
+ if ($IS_ADMIN) {
+ echo '<script language="JavaScript">
+ <!--
+ function checkAll(val) {
+ al=document.artifactList;
+ len = al.elements.length;
+ var i=0;
+ for( i=0 ; i<len ; i++) {
+ if (al.elements[i].name==\'artifact_id_list[]\') {
+ al.elements[i].checked=val;
+ }
+ }
+ }
+ //-->
+ </script>
+
+ <table width="100%" border="0">
+ <tr><td colspan="2">
+<font size=1>
+<a href="javascript:checkAll(1)">Check All</a>
+-
+ <a href="javascript:checkAll(0)">Clear All</a>
+</font>
+<p>
+<FONT COLOR="#FF0000"><strong>Admin:</strong></FONT> If you wish to apply changes to all items selected above,
+ use these controls to change their properties and click once on "Mass Update".
+ </td></tr>
+
+ <tr>
+ <td><strong>Category: <a href="javascript:help_window(\'/help/tracker.php?helpname=category\')"><strong>(?)</strong></a>
+ </strong><br />'. $ath->categoryBox ('category_id','xzxz','No Change') .'</td>
+ <td><strong>Group: <a href="javascript:help_window(\'/help/tracker.php?helpname=group\')"><strong>(?)</strong></a></strong>
+ <br />'. $ath->artifactGroupBox ('artifact_group_id','xzxz','No Change') .'</td>
+ </tr>
+
+ <tr>
+ <td><strong>Priority: <a href="javascript:help_window(\'/help/tracker.php?helpname=priority\')"><strong>(?)</strong></a>
+ </strong><br />';
+ echo build_priority_select_box ('priority', '100', true);
+ echo '</td><td>';
+ if ($ath->useResolution()) {
+ echo '
+ <strong>Resolution: <a href="javascript:help_window(\'/help/tracker.php?helpname=resolution\')"><strong>(?)</strong></a>
+ </strong><br />';
+ echo $ath->resolutionBox('resolution_id','xzxz',true,'No Change');
+ } else {
+ echo '
+ <input type="hidden" name="resolution_id" value="100">';
+ }
+
+ echo '</td>
+ </tr>
+
+ <tr>
+ <td><strong>Assigned To: <a href="javascript:help_window(\'/help/tracker.php?helpname=assignee\')"><strong>(?)</strong></a>
+ </strong><br />'. $ath->technicianBox ('assigned_to','xzxz',true,'No Change') .'</td>
+ <td><strong>Status: <a href="javascript:help_window(\'/help/tracker.php?helpname=status\')"><strong>(?)</strong></a></strong>
+ <br />'. $ath->statusBox ('status_id','xzxz',true,'No Change') .'</td>
+ </tr>
+
+ <tr><td colspan="2"><strong>Canned Response:
+ <a href="javascript:help_window(\'/help/tracker.php?helpname=canned_response\')"><strong>(?)</strong></a>
+ </strong><br />'. $ath->cannedResponseBox ('canned_response') .'</td></tr>
+
+ <tr><td colspan="3" align="MIDDLE"><input type="SUBMIT" name="submit" value="Mass Update"></td></tr>
+
+ </TABLE>
+ </form>';
+ }
+
echo '* Denotes Requests > '. ($ath->getDuePeriod()/86400) .' Days Old';
show_priority_colors_key();
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/include/ArtifactTypeHtml.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/include/ArtifactTypeHtml.class 2011-02-24 15:37:55 UTC (rev 8263)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/include/ArtifactTypeHtml.class 2011-02-24 15:37:56 UTC (rev 8264)
@@ -85,138 +85,6 @@
return html_build_select_box($this->getResolutions(),$name,$checked,$show_100,$text_100);
}
- function showBrowseList ($result,$offset,$set='open') {
- global $sys_datefmt,$PHP_SELF;
- $group_id=$this->Group->getID();
-
- $title_arr=array();
- $title_arr[]='Request ID';
- $title_arr[]='Summary';
- $title_arr[]='Date';
- $title_arr[]='Assigned To';
- $title_arr[]='Submitted By';
-
- $IS_ADMIN=$this->userIsAdmin();
-
-
- if ($IS_ADMIN) {
- echo '
- <form name="artifactList" action="'. $PHP_SELF .'?group_id='.$group_id.'&atid='.$this->getID().'" METHOD="POST">
- <input type="hidden" name="func" value="massupdate">';
- }
-
- echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
- $then=(time()-$this->getDuePeriod());
- $rows=db_numrows($result);
- for ($i=0; $i < $rows; $i++) {
- echo '
- <tr bgcolor="'. html_get_priority_color(db_result($result, $i, 'priority')) .'">'.
- '<td NOWRAP>'.
- ($IS_ADMIN?'<input type="CHECKBOX" name="artifact_id_list[]" value="'.
- db_result($result, $i, 'artifact_id') .'"> ':'').
- db_result($result, $i, 'artifact_id') .
- '</td>'.
- '<td><a href="'.$PHP_SELF.'?func=detail&aid='.
- db_result($result, $i, 'artifact_id').
- '&group_id='. $group_id .'&atid='.
- $this->getID().'">'.
- db_result($result, $i, 'summary').
- '</a></td>'.
- '<td>'. (($set != 'closed' && db_result($result, $i, 'date') < $then)?'<strong>* ':' ') . date($sys_datefmt,db_result($result, $i, 'date')) .'</td>'.
- '<td>'. make_user_link ( db_result($result, $i, 'assigned_to') ) .'</td>'.
- '<td>'. make_user_link ( db_result($result, $i, 'submitted_by') ) .'</td></tr>';
- }
-
- /*
- Show extra rows for <-- Prev / Next -->
- */
- if (($offset > 0) || ($rows >= 50)) {
- echo '
- <tr><td colspan="2">';
- if ($offset > 0) {
- echo '<a href="'.$PHP_SELF.'?func=browse&group_id='.$group_id.'&atid='.$this->getID().'&set='.$set.'&offset='.($offset-50).'"><strong><-- Previous 50</strong></a>';
- } else {
- echo ' ';
- }
- echo '</td><td> </td><td colspan="2">';
-
- if ($rows >= 50) {
- echo '<a href="'.$PHP_SELF.'?func=browse&group_id='.$group_id.'&atid='.$this->getID().'&set='.$set.'&offset='.($offset+50).'"><strong>Next 50 --></strong></a>';
- } else {
- echo ' ';
- }
- echo '</td></tr>';
- }
-
- echo $GLOBALS['HTML']->listTableBottom();
- /*
- Mass Update Code
- */
- if ($IS_ADMIN) {
- echo '<script language="JavaScript">
- <!--
- function checkAll(val) {
- al=document.artifactList;
- len = al.elements.length;
- var i=0;
- for( i=0 ; i<len ; i++) {
- if (al.elements[i].name==\'artifact_id_list[]\') {
- al.elements[i].checked=val;
- }
- }
- }
- //-->
- </script>
-
- <table width="100%" border="0">
- <tr><td colspan="2">
-<font size=1>
-<a href="javascript:checkAll(1)">Check All</a>
--
- <a href="javascript:checkAll(0)">Clear All</a>
-</font>
-<p>
-<FONT COLOR="#FF0000"><strong>Admin:</strong></FONT> If you wish to apply changes to all items selected above, use these controls to change their properties and click once on "Mass Update".
- </td></tr>
-
- <tr>
- <td><strong>Category: <a href="javascript:help_window(\'/help/tracker.php?helpname=category\')"><strong>(?)</strong></a></strong><br />'. $this->categoryBox ('category_id','xzxz','No Change') .'</td>
- <td><strong>Group: <a href="javascript:help_window(\'/help/tracker.php?helpname=group\')"><strong>(?)</strong></a></strong><br />'. $this->artifactGroupBox ('artifact_group_id','xzxz','No Change') .'</td>
- </tr>
-
- <tr>
- <td><strong>Priority: <a href="javascript:help_window(\'/help/tracker.php?helpname=priority\')"><strong>(?)</strong></a></strong><br />';
- echo build_priority_select_box ('priority', '100', true);
- echo '</td><td>';
- if ($this->useResolution()) {
- echo '
- <strong>Resolution: <a href="javascript:help_window(\'/help/tracker.php?helpname=resolution\')"><strong>(?)</strong></a></strong><br />';
- echo $this->resolutionBox('resolution_id','xzxz',true,'No Change');
- } else {
- echo '
- <input type="hidden" name="resolution_id" value="100">';
- }
-
- echo '</td>
- </tr>
-
- <tr>
- <td><strong>Assigned To: <a href="javascript:help_window(\'/help/tracker.php?helpname=assignee\')"><strong>(?)</strong></a></strong><br />'. $this->technicianBox ('assigned_to','xzxz',true,'No Change') .'</td>
- <td><strong>Status: <a href="javascript:help_window(\'/help/tracker.php?helpname=status\')"><strong>(?)</strong></a></strong><br />'. $this->statusBox ('status_id','xzxz',true,'No Change') .'</td>
- </tr>
-
- <tr><td colspan="2"><strong>Canned Response: <a href="javascript:help_window(\'/help/tracker.php?helpname=canned_response\')"><strong>(?)</strong></a></strong><br />'. $this->cannedResponseBox ('canned_response') .'</td></tr>
-
- <tr><td colspan="3" align="MIDDLE"><input type="SUBMIT" name="submit" value="Mass Update"></td></tr>
-
- </TABLE>
- </form>';
- }
-
-
- }
-
}
?>
More information about the evolvis-commits
mailing list