|
From: Benjamin C. <bc...@us...> - 2001-11-03 19:24:09
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv25896
Modified Files:
CHANGELOG bug.php
Log Message:
Added a printable view for bugs
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- CHANGELOG 2001/11/03 14:25:30 1.23
+++ CHANGELOG 2001/11/03 19:24:07 1.24
@@ -2,7 +2,8 @@
: Fixed a bug with the bug history update.
: Added web-based installation.
: Added on option for choosing whether bugs can be changed only by the bug
- reporter, bug owner, managers, or admins.
+ reporter, bug owner, managers, or admins.
+: Added a printable view for bugs
-- 0.4.0 -- 18 Oct 2001
: Improved the CSS file to make choosing different color schemes easier.
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- bug.php 2001/11/03 14:58:04 1.54
+++ bug.php 2001/11/03 19:24:07 1.55
@@ -427,6 +427,74 @@
}
}
+function show_bug_printable($bugid) {
+ global $q, $t, $select;
+
+ if (!is_numeric($bugid) or
+ !$row = $q->grab('select b.*, reporter.login as reporter,
+ owner.login as owner, project_name, component_name, version_name,
+ severity_name, os_name, status_name, resolution_name
+ from '.TBL_BUG.' b
+ left join '.TBL_AUTH_USER.' owner on b.assigned_to = owner.user_id
+ left join '.TBL_AUTH_USER.' reporter on b.created_by = reporter.user_id
+ left join '.TBL_RESOLUTION.' r on b.resolution_id = r.resolution_id,'.
+ TBL_SEVERITY.' sv, '.TBL_STATUS.' st, '.TBL_OS.' os, '.
+ TBL_VERSION.' v, '.TBL_COMPONENT.' c, '.TBL_PROJECT." p
+ where bug_id = '$bugid' and b.severity_id = sv.severity_id
+ and b.os_id = os.os_id and b.version_id = v.version_id
+ and b.component_id = c.component_id and b.project_id = p.project_id
+ and b.status_id = st.status_id")) {
+ show_text($STRING['bugbadnum'],true);
+ exit;
+ }
+
+ $t->set_file('content', 'bugdisplay-printable.html');
+ $t->set_block('content','row','rows');
+ $t->set_var(array(
+ 'TITLE' => "{$TITLE['editbug']} #$bugid",
+ 'bugid' => $bugid,
+ 'title' => stripslashes($row['title']),
+ 'description' => nl2br(stripslashes($row['description'])),
+ 'url' => $row['url'] ? "<a href='{$row['url']}'>{$row['url']}</a>" : '',
+ 'severity' => $row['severity_name'],
+ 'priority' => $select['priority'][$row['priority']],
+ 'status' => $row['status_name'],
+ 'resolution' => $row['resolution_name'] ? $row['resolution_name'] : '',
+ 'owner' => maskemail($row['owner']),
+ 'reporter' => maskemail($row['reporter']),
+ 'createddate' => date(DATE_FORMAT,$row['created_date']),
+ 'createdtime' => date(TIME_FORMAT,$row['created_date']),
+ 'lastmodifieddate' => $row['last_modified_date'],
+ 'project' => $row['project_name'],
+ 'version' => $row['version_name'],
+ 'component' => $row['component_name'],
+ 'os' => $row['os_name'],
+ 'browserstring' => $row['browser_string'],
+ ));
+
+ // Show the comments
+ $q->query('select comment_text, c.created_date, login'
+ .' from '.TBL_COMMENT.' c, '.TBL_AUTH_USER
+ ." where bug_id = $bugid and c.created_by = user_id order by c.created_date");
+ if (!$q->num_rows()) {
+ $t->set_var('rows','');
+ } else {
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'trclass' => $i % 2 ? '' : 'alt',
+ 'rdescription' => nl2br(format_comments(
+ htmlspecialchars($row['comment_text']))),
+ 'rreporter' => maskemail($row['login']),
+ 'rcreateddate' => date(TIME_FORMAT,$row['created_date']).' on '.
+ date(DATE_FORMAT,$row['created_date'])
+ ));
+ $t->parse('rows','row',true);
+ }
+ }
+}
+
+
function show_bug($bugid = 0, $error = '') {
global $q, $me, $t, $project, $STRING, $u, $perm;
@@ -610,6 +678,7 @@
case 'show' : show_bug($bugid); break;
case 'update' : update_bug($bugid); break;
case 'do' : do_form($bugid); break;
+ case 'print' : show_bug_printable($bugid); break;
}
} else header("Location: query.php");
|