--- plugins/tracker/wwwlib/TrackerItemBrowse.php.bak 2009-05-10 18:33:28.000000000 +0800 +++ plugins/tracker/wwwlib/TrackerItemBrowse.php 2009-08-11 16:31:43.000000000 +0800 @@ -42,8 +42,10 @@ throw new PermissionDeniedException(); } $tq = new TrackerItemSavedQuery($Tracker,$tsq); + error_log("Excute Saved Query"); } else { $tq = new TrackerItemQuickQuery($Tracker); + error_log("Excute Quick Query"); } $params = array( @@ -72,11 +74,22 @@ // Show the quick-browse pop-ups // echo '
- '; +
'; echo ''; echo ''; $tefr = new TrackerExtraFieldRenderer($Tracker); echo $tefr->renderFields('QUICKBROWSE',null,$tq); + +// add constraint of submitted_by jack.shang 20090811 +$users = array(); +$users[100] = "Unassigned"; +$users[0] = "Any"; +foreach ($Project->getMembers() as $member) { + $users[$member->getUserId()] = $member->getFullName(); +} +echo ''; +// End of Add submitted_by + echo ''; echo ''; echo '
'.$Lang->getText('TrackerItem.TrackerItemIdName').'
'.$Lang->getText('TrackerItem.SummaryName').'
'.$Lang->getText('TrackerItem.SubmittedByName').'
'.HTMLWidget::selectBoxFromAssoc($users,'submitted_by',$submitted_by,false,false).'
'.$Lang->getText('Tracker.SortCol').'
'.HTMLWidget::selectBoxFromAssoc($tq->getAvailableSortColumns(),'sortcol',$tq->getSortCol(),false,false).'
'.$Lang->getText('Tracker.SortOrd').'
'.HTMLWidget::selectBoxFromAssoc($tq->getAvailableSortOrd(),'sortord',$tq->getSortOrd(),false,false).'
'.HTMLWidget::button("submit",$Lang->getText('Common.Browse'),"browse","","").'
'; --- plugins/tracker/lib/TrackerItemQuery.php.bak 2009-05-10 18:33:30.000000000 +0800 +++ plugins/tracker/lib/TrackerItemQuery.php 2009-08-13 11:22:51.000000000 +0800 @@ -22,6 +22,9 @@ const FIELD_CLOSEDATE='8'; const FIELD_LIST='9'; const FIELD_PRIORITY='10'; + const FIELD_SUBMITTED_BY='11'; + + protected $tracker_item_id; protected $summary; @@ -37,6 +40,7 @@ protected $field_list; protected $Tracker; protected $showcols; + protected $submitted_by; function __construct(Tracker $Tracker) { $this->Tracker = $Tracker; @@ -93,7 +97,9 @@ //echo "priority".$this->priority; return $this->priority; } - + function getSubmitted_by() { + return $this->submitted_by; + } function getWhereClause() { //this may have been called already if (isset($this->TrackerItems) && is_array($this->TrackerItems)) { @@ -138,7 +144,19 @@ } else { $priority_str=''; } - + + // add constraint of submitted_by jack.shang 20090811 + error_log("$this->submitted_by".$this->submitted_by); + if (isset($this->submitted_by) && $this->submitted_by > 0) { + $submitted_by_str=" AND ti.submitted_by = '".$this->submitted_by."' "; + //error_log("TrackerItemQuery->getWhereClause() constraint submitted_by added"); + } else { + $submitted_by_str=''; + } + //error_log("TrackerItemQuery->getWhereClause() constraint 1"); + + + $ef_table_str=''; $ef_where_str=''; if (isset($this->extra_fields) && is_array($this->extra_fields)) { @@ -208,6 +226,9 @@ } else { $closedatesql= ''; } + + + //add constraint for restricted browing if ($this->Tracker->getRestrictBrowse() && !$this->Tracker->isPublic()) { if (!$this->Tracker->getProject()->getPermission()->check('tracker',$this->Tracker->getTrackerId(),Tracker::PERMLEVEL_TECH)) { @@ -226,7 +247,7 @@ $qstr="$ef_table_str $assigned_table_str WHERE ti.tracker_id='". $this->Tracker->getTrackerID() ."' - $opendatesql $moddatesql $closedatesql $priority_str $summary_str + $opendatesql $moddatesql $closedatesql $priority_str $summary_str $submitted_by_str $assigned_str $ef_where_str $restrict_str "; if ($this->getTrackerItemId() > 0) { $qstr=" WHERE --- plugins/tracker/lib/TrackerItemQuickQuery.php.bak 2009-05-10 18:33:30.000000000 +0800 +++ plugins/tracker/lib/TrackerItemQuickQuery.php 2009-08-11 16:58:24.000000000 +0800 @@ -20,6 +20,7 @@ function __construct(Tracker $Tracker) { parent::__construct($Tracker); $this->setupItems(); + } private function setupItems() { @@ -33,6 +34,7 @@ //if the ID was given, ignore the other fields } else { $fields['priority']=intval($_REQUEST['priority']); + $fields['submitted_by']=intval($_REQUEST['submitted_by']); $fields['assigned_to']=intval($_REQUEST['assigned_to']); $fields['summary']=Validator::sanitizeString(addslashes($_REQUEST['summary'])); // $fields['moddaterange']=$_REQUEST['moddaterange']; @@ -100,7 +102,15 @@ } if (isset($fields['priority'])) { $this->priority=$fields['priority']; + } + //add constraint of submitted_by jack.shang 20090811 + if (isset($fields['submitted_by'])) { + $this->submitted_by=$fields['submitted_by']; + //error_log("TrackerItemQuickQuery.php->setupitem() submitted_by seted"); + } + + // return $this->getTrackerItems(); }