Indefero

Indefero Commit Details


Date:2012-03-22 19:29:15 (12 years 8 months ago)
Author:Simon Holywell
Branch:develop
Commit:1d15d53eaa9922d1d0dc2ef370131b11350c8480
Parents: 1b363e4b6d53941b73e949993970f481a178ed82
Message:Add in the beginings of overdue issue display

Changes:

File differences

src/IDF/Project.php
201201
202202
203203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
204226
205227
206228
return $ownerStatistics;
}
/**
* Returns the number of overdue/in date issues.
*
* @param string Status ('open'), 'closed'
* @return int Count
*/
public function getIssueCountByOverdue()
{
$tags = implode(',', $this->getTagIdsByStatus('open'));
$sqlIssueTable = Pluf::factory('IDF_Issue')->getSqlTable();
$query = "SELECT (
SELECT COUNT(*) FROM $sqlIssueTable
WHERE due_dtime < NOW() AND status IN ($tags)
) AS overdue,
( SELECT COUNT(*) FROM $sqlIssueTable
WHERE due_dtime >= NOW() AND status IN ($tags)
) AS in_date";
$db = Pluf::db();
$dbData = $db->select($query);
return current($dbData);
}
/**
* Returns the number of open/closed issues.
src/IDF/Views/Issue.php
122122
123123
124124
125
126
127
128
129
130
125131
126132
127133
......
155161
156162
157163
164
158165
159166
160167
......
791798
792799
793800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
794851
795852
796853
}
arsort($ownerStatistics);
// Issue due date statistics
$overdue = $prj->getIssueCountByOverdue('open');
$combined_opened = $overdue['overdue'] + $overdue['in_date'];
$duedateStatistics['Overdue'] = array($overdue['overdue'], (int)(100 * $overdue['overdue'] / $combined_opened), 'Overdue');
$duedateStatistics['In date'] = array($overdue['in_date'], (int)(100 * $overdue['in_date'] / $combined_opened), 'In date');
// Issue class tag statistics
$grouped_tags = $prj->getTagCloud();
foreach ($grouped_tags as $class => $tags) {
'project' => $prj,
'tagStatistics' => $tagStatistics,
'ownerStatistics' => $ownerStatistics,
'duedateStatistics' => $duedateStatistics,
'status' => $status,
),
$request);
}
/**
* View list of issues for a given project with a given status.
*/
public $listOverdue_precond = array('IDF_Precondition::accessIssues');
public function listOverdue($request, $match)
{
$prj = $request->project;
$status = $match[2];
$title = sprintf(__('%s Closed Issues'), (string) $prj);
// Get stats about the issues
$open = $prj->getIssueCountByStatus('open');
$closed = $prj->getIssueCountByStatus('closed');
// Paginator to paginate the issues
$pag = new Pluf_Paginator(new IDF_Issue());
$pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname,
'current_user' => $request->user);
$pag->summary = __('This table shows the closed issues.');
$otags = $prj->getTagIdsByStatus('closed');
if (count($otags) == 0) $otags[] = 0;
$pag->forced_where = new Pluf_SQL('project=%s AND status IN ('.implode(', ', $otags).')', array($prj->id));
$pag->action = array('IDF_Views_Issue::listStatus', array($prj->shortname, $status));
$pag->sort_order = array('modif_dtime', 'ASC'); // will be reverted
$pag->sort_reverse_order = array('modif_dtime');
$pag->sort_link_title = true;
$pag->extra_classes = array('a-c', '', 'a-c', '');
$list_display = array(
'id' => __('Id'),
array('summary', 'IDF_Views_Issue_SummaryAndLabels', __('Summary')),
array('status', 'IDF_Views_Issue_ShowStatus', __('Status')),
array('due_dtime', 'IDF_Views_Issue_DueDate', __('Due Date')),
array('modif_dtime', 'Pluf_Paginator_DateAgo', __('Last Updated')),
);
$pag->configure($list_display, array(), array('id', 'status', 'due_dtime', 'modif_dtime'));
$pag->items_per_page = 10;
$pag->no_results_text = __('No issues were found.');
$pag->setFromRequest($request);
return Pluf_Shortcuts_RenderToResponse('idf/issues/index.html',
array('project' => $prj,
'page_title' => $title,
'open' => $open,
'closed' => $closed,
'issues' => $pag,
'cloud' => 'closed_issues',
),
$request);
}
/**
* View list of issues for a given project with a given label.
*/
public $listLabel_precond = array('IDF_Precondition::accessIssues');
src/IDF/templates/idf/issues/summary.html
103103
104104
105105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
106138
107139
108140
</table>
</div>
{/if}
{if $duedateStatistics}
<div>
<h2>{blocktrans}Unresolved: By Due Date{/blocktrans}</h2>
<table class='issue-summary'>
<tbody>
{foreach $duedateStatistics as $key => $value}
<tr>
<td class="name">
{if !empty($value[2])}
{aurl 'url', 'IDF_Views_Issue::listOverdue', array($project.shortname, $value[2], 'due')}
<a href="{$url}">{$key}</a>
{else}{$key}{/if}
</td>
<td class="count">{$value[0]}</td>
<td class="graph">
<table class='graph'>
<tbody><tr>
<td style="width:{$value[1] * 0.8 + 1}%" class="graph-color" valign="center">
<div class="colour-bar"></div>
</td>
<td class="graph-percent">{$value[1]}%</td>
</tr>
</tbody>
</table>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
</div>
{/if}
{/block}

Archive Download the corresponding diff file

Page rendered in 0.08983s using 13 queries.