You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(34) |
Aug
(215) |
Sep
(180) |
Oct
(135) |
Nov
(105) |
Dec
(81) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(76) |
Feb
(22) |
Mar
(154) |
Apr
(149) |
May
(128) |
Jun
(94) |
Jul
(14) |
Aug
(24) |
Sep
(77) |
Oct
(52) |
Nov
(22) |
Dec
(6) |
| 2003 |
Jan
(4) |
Feb
(10) |
Mar
(6) |
Apr
(29) |
May
(10) |
Jun
(37) |
Jul
(39) |
Aug
(13) |
Sep
(23) |
Oct
(3) |
Nov
(7) |
Dec
(2) |
| 2004 |
Jan
|
Feb
(10) |
Mar
(4) |
Apr
|
May
(35) |
Jun
(4) |
Jul
(17) |
Aug
(6) |
Sep
(14) |
Oct
(18) |
Nov
(2) |
Dec
(14) |
| 2005 |
Jan
(9) |
Feb
(30) |
Mar
(6) |
Apr
|
May
(38) |
Jun
(23) |
Jul
(21) |
Aug
(76) |
Sep
(50) |
Oct
(51) |
Nov
(13) |
Dec
|
|
From: Benjamin C. <bc...@us...> - 2001-11-02 04:21:44
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6469
Modified Files:
include.php
Log Message:
Abstract db concatting
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- include.php 2001/10/31 02:30:42 1.70
+++ include.php 2001/11/02 04:21:41 1.71
@@ -49,6 +49,16 @@
}
}
+ // Handle the different types of concats
+ function concat() {
+ $pieces = func_get_args();
+ if (DB_TYPE == 'pgsql') {
+ return delimit_list(' || ', $pieces);
+ } else {
+ return 'concat('. delimit_list(', ', $pieces).')';
+ }
+ }
+
function grab($q_string = '') {
if ($q_string) $this->query($q_string);
$this->next_record();
|
|
From: Benjamin C. <bc...@us...> - 2001-10-31 02:30:45
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv13182
Modified Files:
include.php
Log Message:
More pg stuff
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- include.php 2001/10/30 13:51:16 1.69
+++ include.php 2001/10/31 02:30:42 1.70
@@ -327,7 +327,7 @@
$text = '';
$querystart = "select {$box}_id, {$box}_name from $cfgDatabase[$box]";
$queries = array(
- 'group' => $querystart.' where group_name <> "User" order by group_name',
+ 'group' => $querystart.' where group_name <> \'User\' order by group_name',
'severity' => $querystart.' where sort_order > 0 order by sort_order',
'status' => $querystart.' where sort_order > 0 order by sort_order',
'resolution' => $querystart.' where sort_order > 0 order by sort_order',
|
|
From: Benjamin C. <bc...@us...> - 2001-10-31 02:30:45
|
Update of /cvsroot/phpbt/phpbt/admin
In directory usw-pr-cvs1:/tmp/cvs-serv13182/admin
Modified Files:
user.php
Log Message:
More pg stuff
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/user.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- user.php 2001/10/30 05:19:54 1.30
+++ user.php 2001/10/31 02:30:42 1.31
@@ -183,7 +183,7 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->limit_query("select user_id, concat(first_name,' ',last_name) as fullname,
+ $q->limit_query("select user_id, first_name, last_name,
email, login, created_date, active from ".TBL_AUTH_USER
." order by $order $sort", $selrange, $llimit);
@@ -209,7 +209,7 @@
'trclass' => $i % 2 ? '' : 'alt',
'userid' => $row['user_id'],
'login' => $row['login'],
- 'name' => stripslashes($row['fullname']),
+ 'name' => stripslashes("{$row['first_name']} {$row['last_name']}"),
'email' => $row['email'],
'active' => $row['active'] ? 'Yes' : 'No',
'date' => date(DATE_FORMAT, $row['created_date'])));
|
|
From: Ben C. <php...@be...> - 2001-10-30 23:35:08
|
Yup, this is high on my todo list as well, and it gives me an excuse to learn more about pg. You'll notice in the database class in include.php that I added a new function, limit_query(), which does a limit query in the syntax appropriate for the db being used. Of course it is currently limited to the two types, but that's all we are advertising. :) I think I got all the queries that used mysql's limit syntax and changed them to use $q->limit_query().
I was planning on handling the concat problem similarly. I'm taking my cues from the adodb code, as it has a concat handler for the various syntaxes. In fact, I've been thinking about moving away from phplib for db and templates and going to adodb and smarty, respectively. Any thoughts on that?
On Tue, Oct 30, 2001 at 07:43:49PM +0100, Javier Sixto wrote:
> I was working on support request for postgresql :-)
>
> I have solve the basic error from template extends, i have just change
> conditional synatx (IF is not compatible whith pgsql, but CASE works
> with both)
> There is many bugs like this ... when we use some specific Mysql
> function ..like CONCAT ... or LIMIT ... this cause a lot of errors on
> pgsql ...
> It is not a simple thing to make compatible SQL queries between
> differents DB types ...
>
> Mysql : CONCAT('str1','str2') > Pgsql 'str1' || 'str2'
>
> Mysql :
>
> This example will limit the result to 10 rows, starting with row 5.
> SELECT name FROM customers LIMIT 5 , 10
>
> Pgsql :
>
> This example will limit the result to 5 rows, starting with row 10.
> SELECT name FROM customers LIMIT 5 , 10
>
> This limit problem is a big problem .... There is two solutions :
>
> ->Each Query can be simplified
>
> OR
>
> ->Code must use different queries in funtion of DB type
>
> Any other ideas are welcome !
>
>
> Funny Game :-P
>
>
>
>
>
>
>
>
> _______________________________________________
> phpbt-dev mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/phpbt-dev
|
|
From: Javier S. <js...@si...> - 2001-10-30 18:48:33
|
I was working on support request for postgresql :-)
I have solve the basic error from template extends, i have just change
conditional synatx (IF is not compatible whith pgsql, but CASE works
with both)
There is many bugs like this ... when we use some specific Mysql
function ..like CONCAT ... or LIMIT ... this cause a lot of errors on
pgsql ...
It is not a simple thing to make compatible SQL queries between
differents DB types ...
Mysql : CONCAT('str1','str2') > Pgsql 'str1' || 'str2'
Mysql :
This example will limit the result to 10 rows, starting with row 5.
SELECT name FROM customers LIMIT 5 , 10
Pgsql :
This example will limit the result to 5 rows, starting with row 10.
SELECT name FROM customers LIMIT 5 , 10
This limit problem is a big problem .... There is two solutions :
->Each Query can be simplified
OR
->Code must use different queries in funtion of DB type
Any other ideas are welcome !
Funny Game :-P
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 14:23:15
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6635
Modified Files:
bug.php query.php
Log Message:
Getting more PG friendly
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- bug.php 2001/10/26 12:02:37 1.51
+++ bug.php 2001/10/30 14:23:12 1.52
@@ -52,9 +52,8 @@
return;
}
- $q->query('select bh.*, login from '.TBL_BUG_HISTORY.' bh left join '
- .TBL_AUTH_USER.' on bh.created_by = user_id'
- ." where bug_id = $bugid");
+ $q->query('select bh.*, login from '.TBL_BUG_HISTORY.' bh left join '.
+ TBL_AUTH_USER." on bh.created_by = user_id where bug_id = $bugid");
if (!$q->num_rows()) {
show_text($STRING['nobughistory']);
return;
@@ -303,9 +302,9 @@
return;
}
$q->query("insert into ".TBL_COMMENT." (comment_id, bug_id, comment_text, created_by, created_date)"
- ." values (".$q->nextid(TBL_COMMENT).", $dupenum, 'Bug #$bugid has been marked a duplicate of this bug', $u, $now)");
+ ." values (".$q->nextid(TBL_COMMENT).", $dupenum, 'Bug #$bugid has been marked a duplicate of this bug', $u, $now)");
$q->query("insert into ".TBL_COMMENT." (comment_id, bug_id, comment_text, created_by, created_date)"
- ." values (".$q->nextid(TBL_COMMENT).", $bugid, 'This bug is a duplicate of bug #$dupenum', $u, $now)");
+ ." values (".$q->nextid(TBL_COMMENT).", $bugid, 'This bug is a duplicate of bug #$dupenum', $u, $now)");
$statusfield = 'Duplicate';
$resolution_id = $q->grab_field("select resolution_id from ".TBL_RESOLUTION." where resolution_name = 'Duplicate'");
$statusfield = 'Resolved';
@@ -336,7 +335,7 @@
if ($comments) {
$comments = strip_tags($comments);
$q->query("insert into ".TBL_COMMENT." (comment_id, bug_id, comment_text, created_by, created_date)"
- ." values (".$q->nextid(TBL_COMMENT).", $bugid, '$comments', $u, $now)");
+ ." values (".$q->nextid(TBL_COMMENT).", $bugid, '$comments', $u, $now)");
}
$q->query("update ".TBL_BUG." set title = '$title', url = '$url', severity_id = $severity_id, priority = $priority, ".($status_id ? "status_id = $status_id, " : ''). ($changeresolution ? "resolution_id = $resolution_id, " : ''). ($assignedto ? "assigned_to = $assignedto, " : '')." project_id = $project_id, version_id = $version_id, component_id = $component_id, os_id = $os_id, last_modified_by = $u, last_modified_date = $now where bug_id = $bugid");
@@ -432,11 +431,14 @@
global $q, $me, $t, $project, $STRING, $u, $perm;
if (!ereg('^[0-9]+$',$bugid) or
- !$row = $q->grab('select b.*, reporter.login as reporter, owner.login as owner, status_name, resolution_name'
- .' from '.TBL_BUG.' b left join '.TBL_RESOLUTION.' r using(resolution_id),'
- .TBL_SEVERITY.' sv, '.TBL_STATUS.' st 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'
- ." where bug_id = '$bugid' and b.severity_id = sv.severity_id and b.status_id = st.status_id")) {
+ !$row = $q->grab('select b.*, reporter.login as reporter, owner.login as owner, 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
+ where bug_id = '$bugid' and b.severity_id = sv.severity_id
+ and b.status_id = st.status_id")) {
show_text($STRING['bugbadnum'],true);
return;
}
@@ -563,9 +565,11 @@
global $me, $q, $t, $project, $STRING;
// Show only active projects with at least one component
- $q->query('select p.* from '.TBL_PROJECT.' p, '.TBL_COMPONENT
- .' c where p.active and p.project_id = c.project_id group by p.project_id
- order by project_name');
+ $q->query('select p.project_id, p.project_name, p.project_desc, p.created_date
+ from '.TBL_PROJECT.' p, '.TBL_COMPONENT.
+ ' c where p.active = 1 and p.project_id = c.project_id group by
+ p.project_id, p.project_name, p.project_desc, p.created_date
+ order by project_name');
switch ($q->num_rows()) {
case 0 :
$t->set_var('rows',$STRING['noprojects']);
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- query.php 2001/10/30 05:19:54 1.35
+++ query.php 2001/10/30 14:23:12 1.36
@@ -48,7 +48,7 @@
// Version array
$js .= "versions['$pname'] = new Array(new Array('','All'),";
$nq->query("select version_name, version_id from ".TBL_VERSION.
- " where project_id = $pid and active");
+ " where project_id = $pid and active = 1");
while (list($version,$vid) = $nq->grab()) {
$js .= "new Array($vid,'$version'),";
}
@@ -58,7 +58,7 @@
// Component array
$js .= "components['$pname'] = new Array(new Array('','All'),";
$nq->query("select component_name, component_id from ".TBL_COMPONENT.
- " where project_id = $pid and active");
+ " where project_id = $pid and active = 1");
while (list($comp,$cid) = $nq->grab()) {
$js .= "new Array($cid,'$comp'),";
}
@@ -109,19 +109,19 @@
$q->query("select status_id from ".TBL_STATUS." where status_name ".
($open ? '' : 'not ')."in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
while ($statusid = $q->grab_field()) $status[] = $statusid;
- $query[] = 'bug.status_id in ('.delimit_list(',',$status).')';
+ $query[] = 'b.status_id in ('.delimit_list(',',$status).')';
if ($assignedto) {
$query[] = "assigned_to = {$auth->auth['uid']}";
} else {
- $query[] = "bug.created_by = {$auth->auth['uid']}";
+ $query[] = "b.created_by = {$auth->auth['uid']}";
}
} else {
// Select boxes
- if ($status) $flags[] = 'bug.status_id in ('.delimit_list(',',$status).')';
- if ($resolution) $flags[] = 'bug.resolution_id in ('.delimit_list(',',$resolution).')';
- if ($os) $flags[] = 'bug.os_id in ('.delimit_list(',',$os).')';
- if ($priority) $flags[] = 'bug.priority in ('.delimit_list(',',$priority).')';
- if ($severity) $flags[] = 'bug.severity_id in ('.delimit_list(',',$severity).')';
+ if ($status) $flags[] = 'b.status_id in ('.delimit_list(',',$status).')';
+ if ($resolution) $flags[] = 'b.resolution_id in ('.delimit_list(',',$resolution).')';
+ if ($os) $flags[] = 'b.os_id in ('.delimit_list(',',$os).')';
+ if ($priority) $flags[] = 'b.priority in ('.delimit_list(',',$priority).')';
+ if ($severity) $flags[] = 'b.severity_id in ('.delimit_list(',',$severity).')';
if ($flags) $query[] = '('.delimit_list(' or ',$flags).')';
// Email field(s)
@@ -175,8 +175,8 @@
if ($savedqueryname) {
$savedquerystring = ereg_replace('&savedqueryname=.*(&?)', '\\1', $GLOBALS['QUERY_STRING']);
$q->query("insert into ".TBL_SAVED_QUERY.
- " (saved_query_id, user_id, saved_query_name, saved_query_string)"
- ." values (".$q->nextid(TBL_SAVED_QUERY).", $u, '$savedqueryname', '$savedquerystring')");
+ " (saved_query_id, user_id, saved_query_name, saved_query_string)
+ values (".$q->nextid(TBL_SAVED_QUERY).", $u, '$savedqueryname', '$savedquerystring')");
}
if (!$order) {
$order = 'bug_id';
@@ -185,10 +185,10 @@
if (!$querystring or $op) {
build_query($assignedto, $reportedby, $open);
}
- $nr = $q->grab_field("select count(*) from ".TBL_BUG." bug"
- ." left join ".TBL_AUTH_USER." owner on bug.assigned_to = owner.user_id"
- ." left join ".TBL_AUTH_USER." reporter on bug.created_by = reporter.user_id "
- .($querystring != '' ? "where $querystring": ''));
+ $nr = $q->grab_field('select count(*) 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 '.
+ ($querystring != '' ? "where $querystring": ''));
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -201,20 +201,20 @@
'project' => build_select('project'),
'TITLE' => $TITLE['buglist']));
- $q->limit_query("select bug.*, reporter.login as reporter, owner.login as owner,
- lastmodifier.login as lastmodifier, project_name, severity_name,
- status_name, os_name, version_name, component_name, resolution_name, severity_color"
- ." from ".TBL_BUG." bug left join ".TBL_RESOLUTION." resolution using (resolution_id),"
- . TBL_SEVERITY." severity, ".TBL_STATUS." status, ".TBL_OS." os, ".TBL_VERSION." version, "
- . TBL_COMPONENT." component, ".TBL_PROJECT." project"
- ." left join ".TBL_AUTH_USER." owner on bug.assigned_to = owner.user_id"
- ." left join ".TBL_AUTH_USER." reporter on bug.created_by = reporter.user_id"
- ." left join ".TBL_AUTH_USER." lastmodifier on bug.last_modified_by = lastmodifier.user_id"
- ." where bug.severity_id = severity.severity_id and bug.status_id = status.status_id"
- ." and bug.os_id = os.os_id and bug.version_id = version.version_id"
- ." and bug.component_id = component.component_id and bug.project_id = project.project_id "
- . ($querystring != '' ? "and $querystring " : '')
- ." order by $order $sort", $selrange, $llimit);
+ $q->limit_query('select b.*, reporter.login as reporter, owner.login as owner,
+ lastmodifier.login as lastmodifier, project_name, severity_name, status_name,
+ os_name, version_name, component_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_AUTH_USER.' lastmodifier on b.last_modified_by = lastmodifier.user_id
+ left join '.TBL_RESOLUTION.' resolution on b.resolution_id = resolution.resolution_id, '.
+ TBL_SEVERITY.' severity, '.TBL_STATUS.' status, '.TBL_OS.' os, '.
+ TBL_VERSION.' version, '.TBL_COMPONENT.' component, '.TBL_PROJECT.' project
+ where b.severity_id = severity.severity_id and b.status_id = status.status_id
+ and b.os_id = os.os_id and b.version_id = version.version_id
+ and b.component_id = component.component_id and b.project_id = project.project_id '.
+ ($querystring != '' ? "and $querystring " : '').
+ "order by $order $sort", $selrange, $llimit);
$headers = array(
'bug_id' => 'bug_id',
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 13:51:21
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv30386
Modified Files:
include.php
Log Message:
Minor typos, but critical errors
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- include.php 2001/10/30 05:19:53 1.68
+++ include.php 2001/10/30 13:51:16 1.69
@@ -34,7 +34,7 @@
var $Database = DB_DATABASE;
var $User = DB_USER;
var $Password = DB_PASSWORD;
- var $Seg_Table = TBL_DB_SEQUENCE;
+ var $Seq_Table = TBL_DB_SEQUENCE;
// Attempt to handle different limit syntax
function limit_query($q_string, $limit, $offset = 0) {
@@ -66,7 +66,7 @@
if ($seq_name == TBL_SAVED_QUERY) {
return $q->grab_field("select max(saved_query_id)+1 where user_id = ".$auth->auth['uid']);
} else {
- return DB_Sql::nextid($seqname);
+ return DB_Sql::nextid($seq_name);
}
}
}
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 05:19:56
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv17647
Modified Files:
include.php query.php
Log Message:
Make the limit queries PG friendly and break them up over multiple lines
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- include.php 2001/10/30 04:04:08 1.67
+++ include.php 2001/10/30 05:19:53 1.68
@@ -35,6 +35,19 @@
var $User = DB_USER;
var $Password = DB_PASSWORD;
var $Seg_Table = TBL_DB_SEQUENCE;
+
+ // Attempt to handle different limit syntax
+ function limit_query($q_string, $limit, $offset = 0) {
+ if ($offset) {
+ if (DB_TYPE == 'pgsql') {
+ $this->query("$q_string limit $limit offset $offset");
+ } else {
+ $this->query("$q_string limit $offset, $limit");
+ }
+ } else {
+ $this->query("$q_string limit $limit");
+ }
+ }
function grab($q_string = '') {
if ($q_string) $this->query($q_string);
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- query.php 2001/10/30 03:57:43 1.34
+++ query.php 2001/10/30 05:19:54 1.35
@@ -27,7 +27,8 @@
function delete_saved_query($queryid) {
global $q, $u, $me;
- $q->query("delete from ".TBL_SAVED_QUERY." where user_id = $u and saved_query_id = $queryid");
+ $q->query("delete from ".TBL_SAVED_QUERY." where user_id = $u
+ and saved_query_id = $queryid");
header("Location: $me?op=query");
}
@@ -41,11 +42,13 @@
$t->set_block('savequeryblock','row','rows');
// Build the javascript-powered select boxes
- $q->query("select project_id, project_name from ".TBL_PROJECT." where active = 1 order by project_name");
+ $q->query("select project_id, project_name from ".TBL_PROJECT.
+ " where active = 1 order by project_name");
while (list($pid, $pname) = $q->grab()) {
// Version array
$js .= "versions['$pname'] = new Array(new Array('','All'),";
- $nq->query("select version_name, version_id from ".TBL_VERSION." where project_id = $pid and active");
+ $nq->query("select version_name, version_id from ".TBL_VERSION.
+ " where project_id = $pid and active");
while (list($version,$vid) = $nq->grab()) {
$js .= "new Array($vid,'$version'),";
}
@@ -54,7 +57,8 @@
// Component array
$js .= "components['$pname'] = new Array(new Array('','All'),";
- $nq->query("select component_name, component_id from ".TBL_COMPONENT." where project_id = $pid and active");
+ $nq->query("select component_name, component_id from ".TBL_COMPONENT.
+ " where project_id = $pid and active");
while (list($comp,$cid) = $nq->grab()) {
$js .= "new Array($cid,'$comp'),";
}
@@ -102,7 +106,8 @@
// Open bugs assigned to the user -- a hit list
if ($assignedto || $reportedby) {
- $q->query("select status_id from ".TBL_STATUS." where status_name ".($open ? '' : 'not ')."in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
+ $q->query("select status_id from ".TBL_STATUS." where status_name ".
+ ($open ? '' : 'not ')."in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
while ($statusid = $q->grab_field()) $status[] = $statusid;
$query[] = 'bug.status_id in ('.delimit_list(',',$status).')';
if ($assignedto) {
@@ -169,7 +174,8 @@
// Save the query if requested
if ($savedqueryname) {
$savedquerystring = ereg_replace('&savedqueryname=.*(&?)', '\\1', $GLOBALS['QUERY_STRING']);
- $q->query("insert into ".TBL_SAVED_QUERY." (saved_query_id, user_id, saved_query_name, saved_query_string)"
+ $q->query("insert into ".TBL_SAVED_QUERY.
+ " (saved_query_id, user_id, saved_query_name, saved_query_string)"
." values (".$q->nextid(TBL_SAVED_QUERY).", $u, '$savedqueryname', '$savedquerystring')");
}
if (!$order) {
@@ -195,7 +201,7 @@
'project' => build_select('project'),
'TITLE' => $TITLE['buglist']));
- $q->query("select bug.*, reporter.login as reporter, owner.login as owner,
+ $q->limit_query("select bug.*, reporter.login as reporter, owner.login as owner,
lastmodifier.login as lastmodifier, project_name, severity_name,
status_name, os_name, version_name, component_name, resolution_name, severity_color"
." from ".TBL_BUG." bug left join ".TBL_RESOLUTION." resolution using (resolution_id),"
@@ -208,7 +214,7 @@
." and bug.os_id = os.os_id and bug.version_id = version.version_id"
." and bug.component_id = component.component_id and bug.project_id = project.project_id "
. ($querystring != '' ? "and $querystring " : '')
- ." order by $order $sort limit $llimit, $selrange");
+ ." order by $order $sort", $selrange, $llimit);
$headers = array(
'bug_id' => 'bug_id',
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 05:19:56
|
Update of /cvsroot/phpbt/phpbt/admin
In directory usw-pr-cvs1:/tmp/cvs-serv17647/admin
Modified Files:
os.php project.php resolution.php severity.php status.php
user.php
Log Message:
Make the limit queries PG friendly and break them up over multiple lines
Index: os.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/os.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- os.php 2001/10/05 04:22:46 1.14
+++ os.php 2001/10/30 05:19:54 1.15
@@ -83,7 +83,8 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from ".TBL_OS." order by $order $sort limit $llimit, $selrange");
+ $q->limit_query("select * from ".TBL_OS." order by $order $sort",
+ $selrange, $llimit);
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td>{$STRING['nooses']}</td></tr>");
Index: project.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/project.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- project.php 2001/10/12 04:19:31 1.23
+++ project.php 2001/10/30 05:19:54 1.24
@@ -280,7 +280,8 @@
'TITLE' => $TITLE['project']
));
- $q->query("select * from ".TBL_PROJECT." order by $order $sort limit $llimit, $selrange");
+ $q->limit_query("select * from ".TBL_PROJECT." order by $order $sort",
+ $selrange, $llimit);
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td>{$STRING['noprojects']}</td></tr>");
Index: resolution.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/resolution.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- resolution.php 2001/10/05 04:22:46 1.15
+++ resolution.php 2001/10/30 05:19:54 1.16
@@ -36,10 +36,13 @@
if ($error) { list_items($resolutionid, $error); return; }
if (!$resolutionid) {
- $q->query("insert into ".TBL_RESOLUTION." (resolution_id, resolution_name, resolution_desc, sort_order)"
- ." values (".$q->nextid(TBL_RESOLUTION).", '$fname', '$fdescription', '$fsortorder')");
+ $q->query("insert into ".TBL_RESOLUTION.
+ " (resolution_id, resolution_name, resolution_desc, sort_order)"
+ ." values (".$q->nextid(TBL_RESOLUTION).", '$fname', '$fdescription', '$fsortorder')");
} else {
- $q->query("update ".TBL_RESOLUTION." set resolution_name = '$fname', resolution_desc = '$fdescription', sort_order = '$fsortorder' where resolution_id = '$resolutionid'");
+ $q->query("update ".TBL_RESOLUTION.
+ " set resolution_name = '$fname', resolution_desc = '$fdescription',
+ sort_order = '$fsortorder' where resolution_id = '$resolutionid'");
}
header("Location: $me?");
}
@@ -48,7 +51,8 @@
global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
if ($resolutionid && !$error) {
- $row = $q->grab("select * from ".TBL_RESOLUTION." where resolution_id = '$resolutionid'");
+ $row = $q->grab("select * from ".TBL_RESOLUTION.
+ " where resolution_id = '$resolutionid'");
$t->set_var(array(
'action' => $STRING['edit'],
'fresolutionid' => $row['resolution_id'],
@@ -74,7 +78,8 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from ".TBL_RESOLUTION." where resolution_id = '$resolutionid' order by $order $sort");
+ $nr = $q->query("select count(*) from ".TBL_RESOLUTION.
+ " where resolution_id = '$resolutionid' order by $order $sort");
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -85,7 +90,8 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from ".TBL_RESOLUTION." order by $order $sort limit $llimit, $selrange");
+ $q->limit_query("select * from ".TBL_RESOLUTION." order by $order $sort",
+ $selrange, $llimit);
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td>{$STRING['noresolutions']}</td></tr>");
Index: severity.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/severity.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- severity.php 2001/10/06 03:53:33 1.11
+++ severity.php 2001/10/30 05:19:54 1.12
@@ -36,9 +36,13 @@
if ($error) { list_items($severityid, $error); return; }
if (!$severityid) {
- $q->query("insert into ".TBL_SEVERITY." (severity_id, severity_name, severity_desc, sort_order, severity_color) values (".$q->nextid(TBL_SEVERITY).", '$fname', '$fdescription', '$fsortorder', '$fcolor')");
+ $q->query("insert into ".TBL_SEVERITY.
+ " (severity_id, severity_name, severity_desc, sort_order, severity_color)
+ values (".$q->nextid(TBL_SEVERITY).", '$fname', '$fdescription', '$fsortorder', '$fcolor')");
} else {
- $q->query("update ".TBL_SEVERITY." set severity_name = '$fname', severity_desc = '$fdescription', sort_order = '$fsortorder', severity_color = '$fcolor' where severity_id = '$severityid'");
+ $q->query("update ".TBL_SEVERITY." set severity_name = '$fname',
+ severity_desc = '$fdescription', sort_order = '$fsortorder',
+ severity_color = '$fcolor' where severity_id = '$severityid'");
}
header("Location: $me?");
}
@@ -47,7 +51,8 @@
global $q, $me, $t, $_pv, $STRING;
if ($severityid && !$error) {
- $row = $q->grab("select * from ".TBL_SEVERITY." where severity_id = '$severityid'");
+ $row = $q->grab("select * from ".TBL_SEVERITY.
+ " where severity_id = '$severityid'");
$t->set_var(array(
'action' => $STRING['edit'],
'fseverityid' => $row['severity_id'],
@@ -77,7 +82,8 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from ".TBL_SEVERITY." where severity_id = '$severityid' order by $order $sort");
+ $nr = $q->query("select count(*) from ".TBL_SEVERITY.
+ " where severity_id = '$severityid' order by $order $sort");
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -88,7 +94,9 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from ".TBL_SEVERITY." order by $order $sort limit $llimit, $selrange");
+ $q->limit_query("select * from ".TBL_SEVERITY." order by $order $sort",
+ $selrange, $llimit);
+
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td>{$STRING['noseverities']}</td></tr>");
Index: status.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/status.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- status.php 2001/10/05 04:22:46 1.15
+++ status.php 2001/10/30 05:19:54 1.16
@@ -36,9 +36,13 @@
if ($error) { list_items($statusid, $error); return; }
if (!$statusid) {
- $q->query("insert into ".TBL_STATUS." (status_id, status_name, status_desc, sort_order) values (".$q->nextid(TBL_STATUS).", '$fname', '$fdescription', '$fsortorder')");
+ $q->query("insert into ".TBL_STATUS.
+ " (status_id, status_name, status_desc, sort_order) values (".
+ $q->nextid(TBL_STATUS).", '$fname', '$fdescription', '$fsortorder')");
} else {
- $q->query("update ".TBL_STATUS." set status_name = '$fname', status_desc = '$fdescription', sort_order = '$fsortorder' where status_id = '$statusid'");
+ $q->query("update ".TBL_STATUS.
+ " set status_name = '$fname', status_desc = '$fdescription',
+ sort_order = '$fsortorder' where status_id = '$statusid'");
}
header("Location: $me?");
}
@@ -47,7 +51,8 @@
global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
if ($statusid && !$error) {
- $row = $q->grab("select * from ".TBL_STATUS." where status_id = '$statusid'");
+ $row = $q->grab("select * from ".TBL_STATUS.
+ " where status_id = '$statusid'");
$t->set_var(array(
'action' => $STRING['edit'],
'fstatusid' => $row['status_id'],
@@ -73,7 +78,8 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from ".TBL_STATUS." where status_id = '$statusid' order by $order $sort");
+ $nr = $q->query("select count(*) from ".TBL_STATUS.
+ " where status_id = '$statusid' order by $order $sort");
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -84,7 +90,8 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from ".TBL_STATUS." order by $order $sort limit $llimit, $selrange");
+ $q->limit_query("select * from ".TBL_STATUS." order by $order $sort",
+ $selrange, $llimit);
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td>{$STRING['nostatuses']}</td></tr>");
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/user.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- user.php 2001/10/12 04:19:31 1.29
+++ user.php 2001/10/30 05:19:54 1.30
@@ -183,9 +183,9 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select user_id, concat(first_name,' ',last_name) as fullname,
+ $q->limit_query("select user_id, concat(first_name,' ',last_name) as fullname,
email, login, created_date, active from ".TBL_AUTH_USER
- ." order by $order $sort limit $llimit, $selrange");
+ ." order by $order $sort", $selrange, $llimit);
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td>{$STRING['nousers']}</td></tr>");
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:08:38
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv14407
Modified Files:
install.php
Log Message:
Ooops - commented out for testing
Index: install.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/install.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- install.php 2001/10/30 04:05:58 1.1
+++ install.php 2001/10/30 04:08:35 1.2
@@ -65,9 +65,9 @@
);
@include_once('config.php');
-// if (defined('DB_HOST')) { // Already configured
-// header("Location: index.php");
-// }
+if (defined('DB_HOST')) { // Already configured
+ header("Location: index.php");
+}
function build_select($box, $value = '', $ary) {
foreach ($ary as $val => $item) {
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:06:01
|
Update of /cvsroot/phpbt/phpbt/templates/default In directory usw-pr-cvs1:/tmp/cvs-serv13123/templates/default Added Files: install-complete.html install.html Log Message: Web-based installation stuff --- NEW FILE: install-complete.html --- <html> <title>phpBugTracker Installation</title> <link rel="StyleSheet" href="css.php" type="text/css"> </head> <body bgcolor="#ffffff" link="#006699" vlink="#006699" alink="#006699"> <table border="0" cellpadding="0" cellspacing="0" width="640"> <tr> <td width="200" valign="top"><br><img src="logo.jpg"></td> <td valign="top"> <div class="banner">phpBugTracker Installation</div> <!-- BEGIN writeableblock --> The database tables have been created and the config file has been written. Especially if you are on a shared server, you should change the permissions so that config.php isn't writeable by others by executing chmod og-w config.php. You can login to the admin tools by using the login form below. <!-- END writeableblock --> <!-- BEGIN unwriteableblock --> The database tables have been created. Once you have config.php in place, you will be able to login to the admin tools via the form below using the admin login and password you provided. <!-- END unwriteableblock --> You will be taken to the home page, and from there you can go to the configuration page of the admin tools which will allow you to customize your installation of phpBugTracker further. Once you have completed the configuration, you will be ready to add a project and start reporting bugs! <br> <br> Please feel welcome to subscribe the phpbt-users mailing list by visiting the mailing list <a href="http://lists.sourceforge.net/lists/listinfo/phpbt-users" target="_new">web page.</a> <hr size="1" width="300"> <form action="index.php" method="post"> <table border="0" cellpadding="1" cellspacing="3" align="center"> <tr> <td>Login:</td> <td><input type="text" name="login" value="{login}"></td> </tr> <td>Password:</td> <td><input type="password" name="password"></td> </tr> <tr> <td colspan="2" align="center"> <input type="hidden" name="dologin" value="1"> <input type="submit" value="Login"> </td> </tr> </table> </form> </td> </tr> </table> </body> </html> --- NEW FILE: install.html --- <html> <title>phpBugTracker Installation</title> <link rel="StyleSheet" href="css.php" type="text/css"> </head> <body bgcolor="#ffffff" link="#006699" vlink="#006699" alink="#006699"> <form action="{me}" method="post"> <table border="0" cellpadding="0" cellspacing="0" width="640"> <tr> <td width="200" valign="top"><br><img src="logo.jpg"></td> <td valign="top" align="center"> <div class="banner">phpBugTracker Installation</div> {error} <table border="0" cellpadding="0" cellspacing="3"> <tr> <th colspan="2">Database Options</th> </tr> <tr> <td width="150">Type:</td> <td><select name="db_type">{db_type}</select></td> </tr> <tr> <td width="150">Host:</td> <td><input type="text" name="db_host" value="{db_host}"></td> </tr> <tr> <td width="150"> Database Name: <br> (This database must already exist) </td> <td valign="top"><input type="text" name="db_database" value="{db_database}"></td> </tr> <tr> <td width="150">User:</td> <td><input type="text" name="db_user" value="{db_user}"></td> </tr> <tr> <td width="150">Password:</td> <td><input type="text" name="db_pass" value="{db_pass}"></td> </tr> <tr> <td width="150">Table Prefix:</td> <td><input type="text" name="tbl_prefix" value="{tbl_prefix}"></td> </tr> <tr> </tr> <tr> <th colspan="2">Configuration</th> </tr> <tr> <td width="150"> phpBT Email: <br> (The email address used for sending bug updates, etc.) </td> <td valign="top"><input type="text" name="phpbt_email" value="{phpbt_email}"></td> </tr> <tr> <td width="150">Admin Login:</td> <td><input type="text" name="admin_login" value="{admin_login}"></td> </tr> <tr> <td width="150">Admin Password:</td> <td><input type="password" name="admin_pass" value=""></td> </tr> <tr> <td width="150">Confirm Password:</td> <td><input type="password" name="admin_pass2" value=""></td> </tr> <tr> <td width="150">Encrypt Passwords in DB:</td> <td> <input type="radio" name="encrypt_pass" value="1"> Yes <input type="radio" name="encrypt_pass" value="0" checked> No </td> </tr> <tr> <td colspan="2" align="center"> <hr size="1" width="220"> <!-- BEGIN writeableblock --> When you submit the form, the database tables will be created and config.php will be saved to disk. You will then be able to login and use the bug tracker. <input type="hidden" name="op" value="save_config_file"> <!-- END writeableblock --> <!-- BEGIN unwriteableblock --> Since config.php is not writeable by this script, when you submit this form you will be prompted to save config.php. Copy this file to the location of the bug tracker, and then you will be able to login to the bug tracker from the next page. <input type="hidden" name="op" value="dump_config_file"> <!-- END unwriteableblock --> <br> <br> <input type="submit" value="Save Options"> </td> </tr> </table> </td> </tr> </table> </form> </body> </html> |
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:06:01
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv13123
Added Files:
config-dist.php install.php
Log Message:
Web-based installation stuff
--- NEW FILE: config-dist.php ---
// config.php - Set up configuration options
// ------------------------------------------------------------------------
// Copyright (c) 2001 The phpBugTracker Group
// ------------------------------------------------------------------------
// This file is part of phpBugTracker
//
// phpBugTracker is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// phpBugTracker is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with phpBugTracker; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ------------------------------------------------------------------------
// $Id: config-dist.php,v 1.1 2001/10/30 04:05:58 bcurtis Exp $
define ('PHPLIB_PATH', ''); // If PHPlib is not in your include path
// Database Config
define ('DB_TYPE', '{db_type}'); // using PHPlib file naming
define ('DB_HOST', '{db_host}');
define ('DB_DATABASE', '{db_database}');
define ('DB_USER', '{db_user}');
define ('DB_PASSWORD', '{db_pass}');
// Database Table Config
// you can change either the prefix of the table names or each table name individually
define ('TBL_PREFIX', '{tbl_prefix}'); // the prefix for all tables, leave empty to use the old style
define ('TBL_ACTIVE_SESSIONS', TBL_PREFIX.'active_sessions');
define ('TBL_DB_SEQUENCE', TBL_PREFIX.'db_sequence');
define ('TBL_ATTACHMENT', TBL_PREFIX.'attachment');
define ('TBL_AUTH_GROUP', TBL_PREFIX.'auth_group');
define ('TBL_AUTH_PERM', TBL_PREFIX.'auth_perm');
define ('TBL_AUTH_USER', TBL_PREFIX.'auth_user');
define ('TBL_BUG', TBL_PREFIX.'bug');
define ('TBL_BUG_CC', TBL_PREFIX.'bug_cc');
define ('TBL_BUG_GROUP', TBL_PREFIX.'bug_group');
define ('TBL_BUG_HISTORY', TBL_PREFIX.'bug_history');
define ('TBL_COMMENT', TBL_PREFIX.'comment');
define ('TBL_COMPONENT', TBL_PREFIX.'component');
define ('TBL_CONFIGURATION', TBL_PREFIX.'configuration');
define ('TBL_GROUP_PERM', TBL_PREFIX.'group_perm');
define ('TBL_OS', TBL_PREFIX.'os');
define ('TBL_PROJECT', TBL_PREFIX.'project');
define ('TBL_RESOLUTION', TBL_PREFIX.'resolution');
define ('TBL_SAVED_QUERY', TBL_PREFIX.'saved_query');
define ('TBL_SEVERITY', TBL_PREFIX.'severity');
define ('TBL_STATUS', TBL_PREFIX.'status');
define ('TBL_USER_GROUP', TBL_PREFIX.'user_group');
define ('TBL_USER_PERM', TBL_PREFIX.'user_perm');
define ('TBL_VERSION', TBL_PREFIX.'version');
define ('TBL_PROJECT_GROUP', TBL_PREFIX.'project_group');
define ('ONEDAY', 86400);
require_once (PHPLIB_PATH.'db_'.DB_TYPE.'.inc');
require_once (PHPLIB_PATH.'ct_sql.inc');
require_once (PHPLIB_PATH.'session.inc');
require_once (PHPLIB_PATH.'auth.inc');
require_once (PHPLIB_PATH.'perm.inc');
require_once (PHPLIB_PATH.'page.inc');
require_once (PHPLIB_PATH.'template.inc');
?>
--- NEW FILE: install.php ---
<?php
// install.php -- Web-based installation script
// ------------------------------------------------------------------------
// Copyright (c) 2001 The phpBugTracker Group
// ------------------------------------------------------------------------
// This file is part of phpBugTracker
//
// phpBugTracker is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// phpBugTracker is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with phpBugTracker; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ------------------------------------------------------------------------
// $Id: install.php,v 1.1 2001/10/30 04:05:58 bcurtis Exp $
include_once('template.inc');
$t = new Template('templates/default', 'keep');
$t->set_var('me', $HTTP_SERVER_VARS['PHP_SELF']);
$_gv =& $HTTP_GET_VARS;
$_pv =& $HTTP_POST_VARS;
$tables = array(
'/^#.*/' => '',
'/^--.*/' => '',
'/TBL_ACTIVE_SESSIONS/' => $_pv['tbl_prefix'].'active_sessions',
'/TBL_DB_SEQUENCE/' => $_pv['tbl_prefix'].'db_sequence',
'/TBL_ATTACHMENT/' => $_pv['tbl_prefix'].'attachment',
'/TBL_AUTH_GROUP/' => $_pv['tbl_prefix'].'auth_group',
'/TBL_AUTH_PERM/' => $_pv['tbl_prefix'].'auth_perm',
'/TBL_AUTH_USER/' => $_pv['tbl_prefix'].'auth_user',
'/TBL_BUG_CC/' => $_pv['tbl_prefix'].'bug_cc',
'/TBL_BUG_GROUP/' => $_pv['tbl_prefix'].'bug_group',
'/TBL_BUG_HISTORY/' => $_pv['tbl_prefix'].'bug_history',
'/TBL_BUG/' => $_pv['tbl_prefix'].'bug',
'/TBL_COMMENT/' => $_pv['tbl_prefix'].'comment',
'/TBL_COMPONENT/' => $_pv['tbl_prefix'].'component',
'/TBL_CONFIGURATION/' => $_pv['tbl_prefix'].'configuration',
'/TBL_GROUP_PERM/' => $_pv['tbl_prefix'].'group_perm',
'/TBL_OS/' => $_pv['tbl_prefix'].'os',
'/TBL_PROJECT/' => $_pv['tbl_prefix'].'project',
'/TBL_RESOLUTION/' => $_pv['tbl_prefix'].'resolution',
'/TBL_SAVED_QUERY/' => $_pv['tbl_prefix'].'saved_query',
'/TBL_SEVERITY/' => $_pv['tbl_prefix'].'severity',
'/TBL_STATUS/' => $_pv['tbl_prefix'].'status',
'/TBL_USER_GROUP/' => $_pv['tbl_prefix'].'user_group',
'/TBL_USER_PERM/' => $_pv['tbl_prefix'].'user_perm',
'/TBL_VERSION/' => $_pv['tbl_prefix'].'version',
'/TBL_PROJECT_GROUP/' => $_pv['tbl_prefix'].'project_group',
'/OPTION_ADMIN_EMAIL/' => $_pv['admin_login'],
'/OPTION_ADMIN_PASS/' => $_pv['encrypt_pass'] ? md5($_pv['admin_pass'])
: $_pv['admin_pass'],
'/OPTION_PHPBT_EMAIL/' => $_pv['phpbt_email'],
'/OPTION_ENCRYPT_PASS/' => $_pv['encrypt_pass'],
'/OPTION_INSTALL_URL/' => 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].
dirname($HTTP_SERVER_VARS['SCRIPT_NAME']),
);
@include_once('config.php');
// if (defined('DB_HOST')) { // Already configured
// header("Location: index.php");
// }
function build_select($box, $value = '', $ary) {
foreach ($ary as $val => $item) {
if ($value == $val and $value != '') $sel = ' selected';
else $sel = '';
$text .= "<option value=\"$val\"$sel>$item</option>";
}
return $text;
}
function grab_config_file() {
global $t, $_pv;
$t->set_root('.');
$t->set_file('content', 'config-dist.php');
$t->set_var($_pv);
return "<?php\n".$t->finish($t->parse('main', 'content'));
}
function create_tables() {
global $_pv, $tables;
include_once('db_'.$_pv['db_type'].'.inc');
$db = new DB_Sql;
$db->Host = $_pv['db_host'];
$db->Database = $_pv['db_database'];
$db->User = $_pv['db_user'];
$db->Password = $_pv['db_pass'];
$q_temp_ary = file('schemas/'.$_pv['db_type'].'.in');
$queries = preg_replace(array_keys($tables), array_values($tables),
$q_temp_ary);
foreach ($queries as $query) {
// First, collect multi-line queries into one line, then run the query
$do_query .= chop($query);
if (substr($do_query, -1) != ';') continue;
$db->query($do_query);
$do_query = '';
}
}
function check_vars() {
global $_pv;
if (!$_pv['db_host'] = trim($_pv['db_host'])) {
$error = 'Please enter the host name for your database server';
} elseif (!$_pv['db_database'] = trim($_pv['db_database'])) {
$error = 'Please enter the name of the database you will be using';
} elseif (!$_pv['db_user'] = trim($_pv['db_user'])) {
$error = 'Please enter the user name for connecting to the database';
} elseif (!$_pv['phpbt_email'] = trim($_pv['phpbt_email'])) {
$error = 'Please enter the phpBT email address';
} elseif (!$_pv['admin_login'] = trim($_pv['admin_login'])) {
$error = 'Please enter the admin login';
} elseif (!$_pv['admin_pass'] = trim($_pv['admin_pass'])) {
$error = 'Please enter the admin password';
} elseif (!$_pv['admin_pass2'] = trim($_pv['admin_pass2'])) {
$error = 'Please confirm the admin password';
} elseif ($_pv['admin_pass'] != $_pv['admin_pass2']) {
$error = 'The admin passwords don\'t match';
}
if ($error) {
show_front($error);
return false;
} else {
return true;
}
}
function dump_config_file() {
if (!check_vars()) return;
create_tables();
header('Content-Type: text/x-delimtext; name="config.php"');
header('Content-disposition: attachment; filename=config.php');
echo grab_config_file();
show_finished();
}
function save_config_file() {
if (!check_vars()) return;
create_tables();
if (!$fp = fopen('config.php', 'w')) {
show_front('Error writing to config.php');
} else {
fwrite($fp, grab_config_file());
fclose($fp);
}
show_finished();
}
function show_finished() {
global $t, $_pv;
$t->set_root('templates/default');
$t->set_file('done', 'install-complete.html');
$t->set_block('done', 'writeableblock', 'writeable');
$t->set_block('done', 'unwriteableblock', 'unwriteable');
$t->set_var('login', $_pv['admin_login']);
if (is_writeable('config.php')) {
$t->parse('writeable', 'writeableblock', true);
$t->set_var('unwriteable', '');
} else {
$t->parse('unwriteable', 'unwriteableblock', true);
$t->set_var('writeable', '');
}
print $t->finish($t->parse('main', 'done'));
}
function show_front($error = '') {
global $t, $_pv, $select, $HTTP_SERVER_VARS;
$db_types = array(
'mysql' => 'MySQL',
'pgsql' => 'PostgreSQL');
$t->set_file('content', 'install.html');
$t->set_block('content', 'writeableblock', 'writeable');
$t->set_block('content', 'unwriteableblock', 'unwriteable');
$t->set_var(array(
'error' => $error ? "<div class=\"error\">$error</div>" : '',
'db_type' => build_select('db', $db_type, &$db_types),
'db_host' => $db_host ? $db_host : 'localhost',
'db_database' => $db_database ? $db_database : 'bug_tracker',
'db_user' => $db_user ? $db_user : 'root',
'db_pass' => '',
'tbl_prefix' => $tbl_prefix ? $tbl_prefix : 'phpbt_',
'admin_login' => $admin_login,
'phpbt_email' => $phpbt_email ? $phpbt_email :
'phpbt@'.$HTTP_SERVER_VARS['SERVER_NAME']
));
// If we can write to the config file, show that we will do that, otherwise
// offer the config file as a download
if (is_writeable('config.php')) {
$t->parse('writeable', 'writeableblock', true);
$t->set_var('unwriteable', '');
} else {
$t->parse('unwriteable', 'unwriteableblock', true);
$t->set_var('writeable', '');
}
print $t->finish($t->parse('main', 'content'));
}
if ($op = $_gv['op'] ? $_gv['op'] : $_pv['op']) {
switch ($op) {
case 'save_config_file' : save_config_file(); break;
case 'dump_config_file' : dump_config_file(); break;
}
} else {
show_front();
}
?>
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:04:49
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv12578 Modified Files: CHANGELOG Log Message: Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- CHANGELOG 2001/10/19 02:53:14 1.21 +++ CHANGELOG 2001/10/30 04:04:46 1.22 @@ -1,3 +1,7 @@ +-- 0.5.0 -- +: Fixed a bug with the bug history update. +: Added web-based installation. + -- 0.4.0 -- 18 Oct 2001 : Improved the CSS file to make choosing different color schemes easier. : Consolidated the two separate templates directories into one tree. |
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:04:41
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv12493
Modified Files:
css.php
Log Message:
Some changes for the web installation
Index: css.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/css.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- css.php 2001/10/10 04:40:47 1.2
+++ css.php 2001/10/30 04:04:38 1.3
@@ -137,3 +137,17 @@
padding-left: 0.2em;
padding-right: 0.2em;
}
+
+.banner {
+ text-align: center;
+ font-weight: bold;
+ padding: 1.5em;
+ font-size: 16px;
+}
+
+.error {
+ text-align: center;
+ font-weight: bold;
+ color: #ff0000;
+ padding-bottom: 0.1em;
+ }
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:04:10
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv12316
Modified Files:
include.php
Log Message:
Changes for the web installation. Formatting prettiness for quick bug stats. Change to the nextid() function to handle the saved_query table.
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- include.php 2001/10/29 22:59:55 1.66
+++ include.php 2001/10/30 04:04:08 1.67
@@ -28,13 +28,13 @@
}
require (INSTALL_PATH.'/'.INCLUDE_PATH.'config.php');
-// Edit this class with your database information
class dbclass extends DB_Sql {
var $classname = 'dbclass';
var $Host = DB_HOST;
var $Database = DB_DATABASE;
var $User = DB_USER;
var $Password = DB_PASSWORD;
+ var $Seg_Table = TBL_DB_SEQUENCE;
function grab($q_string = '') {
if ($q_string) $this->query($q_string);
@@ -46,6 +46,16 @@
list($retval) = $this->grab($q_string);
return $retval;
}
+
+ function nextid($seq_name) {
+ global $auth;
+
+ if ($seq_name == TBL_SAVED_QUERY) {
+ return $q->grab_field("select max(saved_query_id)+1 where user_id = ".$auth->auth['uid']);
+ } else {
+ return DB_Sql::nextid($seqname);
+ }
+ }
}
$q = new dbclass;
@@ -93,7 +103,7 @@
class sqlclass extends CT_Sql {
var $database_class = 'dbclass';
- var $database_table = 'active_sessions';
+ var $database_table = TBL_ACTIVE_SESSIONS;
}
class usess extends Session {
@@ -219,22 +229,19 @@
$this->set_block('wrap', 'loginblock', 'liblock');
$this->set_block('wrap', 'adminnavblock', 'anblock');
if ($u && $u != 'nobody') {
- list($owner_open, $owner_closed) =
- $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
+ list($owner_open, $owner_closed) = $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
."sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END )"
."from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where assigned_to = $u");
-
- list($reporter_open, $reporter_closed) =
- $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
+ list($reporter_open, $reporter_closed) = $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
."sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END )"
."from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where created_by = $u");
$this->set_var(array(
'loggedinas' => $auth->auth['uname'],
'liblock' => '',
- 'owner_open' => $owner_open,
- 'owner_closed' => $owner_closed,
- 'reporter_open' => $reporter_open,
- 'reporter_closed' => $reporter_closed
+ 'owner_open' => $owner_open ? $owner_open : 0,
+ 'owner_closed' => $owner_closed ? $owner_closed : 0,
+ 'reporter_open' => $reporter_open ? $reporter_open : 0,
+ 'reporter_closed' => $reporter_closed ? $reporter_closed : 0
));
$this->parse('loblock', 'logoutblock', true);
} else {
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 04:02:47
|
Update of /cvsroot/phpbt/phpbt/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv11380/schemas
Modified Files:
pgsql.in mysql.in
Log Message:
Drop the auto-incrementing primary key for the saved_query table. Use constants for the supporting tables active_sessions and db_sequence so they can have the prefix attached during installation. Add some substitutions in the data-populating queries for the web installation
Index: pgsql.in
===================================================================
RCS file: /cvsroot/phpbt/phpbt/schemas/pgsql.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- pgsql.in 2001/10/24 23:50:45 1.7
+++ pgsql.in 2001/10/30 04:02:45 1.8
@@ -3,17 +3,14 @@
-- If you change the database name, make sure you change the DB_DATABASE
-- constant in config.php. Make sure you edit the TBL_AUTH_USER insert below.
--
--- TEMPLATE: This is a template for configure_db -- not for creating the database!
+-- This is a template for install.php -- not for creating the database!
--
-- $Id$
-create database BugTracker;
-use BugTracker;
-
BEGIN;
-CREATE TABLE active_sessions (
+CREATE TABLE TBL_ACTIVE_SESSIONS (
sid varchar(32) NOT NULL DEFAULT '',
name varchar(32) NOT NULL DEFAULT '',
val text,
@@ -139,14 +136,14 @@
);
CREATE TABLE TBL_CONFIGURATION (
- varname char(40) NOT NULL DEFAULT '',
- varvalue char(255) NOT NULL DEFAULT '',
- description char(255) NOT NULL DEFAULT '',
+ varname varchar(40) NOT NULL DEFAULT '',
+ varvalue varchar(255) NOT NULL DEFAULT '',
+ description varchar(255) NOT NULL DEFAULT '',
vartype char(20) NOT NULL DEFAULT '',
PRIMARY KEY (varname)
);
-CREATE TABLE db_sequence (
+CREATE TABLE TBL_DB_SEQUENCE (
seq_name varchar(127) NOT NULL DEFAULT '',
nextid INT4 NOT NULL DEFAULT '0',
PRIMARY KEY (seq_name)
@@ -187,15 +184,8 @@
);
-
---
--- Sequences for table TBL_SAVED_QUERY
---
-
-CREATE SEQUENCE tbl_saved_query_saved_query_;
-
CREATE TABLE TBL_SAVED_QUERY (
- saved_query_id INT4 DEFAULT nextval('tbl_saved_query_saved_query_'),
+ saved_query_id INT4 DEFAULT '0',
user_id INT4 NOT NULL DEFAULT '0',
saved_query_name varchar(40) NOT NULL DEFAULT '',
saved_query_string TEXT DEFAULT '' NOT NULL,
@@ -253,9 +243,9 @@
INSERT INTO TBL_AUTH_USER
(user_id, login, first_name, last_name, email, password)
- values (1, 'ad...@ex...', 'System', 'Admin', 'ad...@ex...',
- 'somepassword');
-INSERT INTO db_sequence values ('TBL_AUTH_USER', 1);
+ values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
+ 'OPTION_ADMIN_PASS');
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_AUTH_USER', 1);
-- Start off with three user levels...
INSERT INTO TBL_AUTH_GROUP (group_id, group_name) VALUES (1, 'Admin');
@@ -274,11 +264,11 @@
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1);
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2);
-INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','http://localhost/~bcurtis/phpbt','The base URL of the phpBugTracker installation','string');
+INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string');
INSERT INTO TBL_CONFIGURATION VALUES ('JPGRAPH_PATH','','If not in the include path','string');
INSERT INTO TBL_CONFIGURATION VALUES ('CVS_WEB','http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/','Location of your cvs web interface (see format_comments() in bug.php)','string');
-INSERT INTO TBL_CONFIGURATION VALUES ('ADMIN_EMAIL','ph...@be...','The email address used in correspondence from the bug tracker','string');
-INSERT INTO TBL_CONFIGURATION VALUES ('ENCRYPT_PASS','','Whether to store passwords encrypted. <b>Warning:</b> Changing this after users have been created will result in their being unable to login.','bool');
+INSERT INTO TBL_CONFIGURATION VALUES ('ADMIN_EMAIL','OPTION_PHPBT_EMAIL','The email address used in correspondence from the bug tracker','string');
+INSERT INTO TBL_CONFIGURATION VALUES ('ENCRYPT_PASS','OPTION_ENCRYPT_PASS','Whether to store passwords encrypted. <b>Warning:</b> Changing this after users have been created will result in their being unable to login.','bool');
INSERT INTO TBL_CONFIGURATION VALUES ('USE_JPGRAPH','','Whether to show some reports as images','bool');
INSERT INTO TBL_CONFIGURATION VALUES ('MASK_EMAIL','1','Should email addresses have . changed to \'dot\' and @ change to \'at\'?','bool');
INSERT INTO TBL_CONFIGURATION VALUES ('HIDE_EMAIL','1','Should email addresses be hidden for those not logged in?','bool');
@@ -322,7 +312,7 @@
INSERT INTO TBL_OS VALUES (29,'Solaris',29,'/Mozilla.*\\(.*;.*; SunOS 5.*\\)/');
INSERT INTO TBL_OS VALUES (30,'SunOS',30,'/Mozilla.*\\(.*;.*; SunOS.*\\)/');
INSERT INTO TBL_OS VALUES (31,'other',31,'');
-INSERT INTO db_sequence values ('TBL_OS', 31);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_OS', 31);
INSERT INTO TBL_RESOLUTION VALUES (1,'Fixed','Bug was eliminated',1);
INSERT INTO TBL_RESOLUTION VALUES (2,'Not a bug','It\'s not a bug -- it\'s a feature!',2);
@@ -330,7 +320,7 @@
INSERT INTO TBL_RESOLUTION VALUES (4,'Deferred','We\'ll get around to it later',4);
INSERT INTO TBL_RESOLUTION VALUES (5,'Works for me','Can\'t replicate the bug',5);
INSERT INTO TBL_RESOLUTION VALUES (6,'Duplicate','',6);
-INSERT INTO db_sequence values ('TBL_RESOLUTION', 6);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_RESOLUTION', 6);
INSERT INTO TBL_SEVERITY VALUES (1,'Unassigned','Default bug creation',1,'#dadada');
INSERT INTO TBL_SEVERITY VALUES (2,'Idea','Ideas for further development',2,'#dad0d0');
@@ -339,7 +329,7 @@
INSERT INTO TBL_SEVERITY VALUES (5,'Content','Non-functional related bugs, such as text content',5,'#dababa');
INSERT INTO TBL_SEVERITY VALUES (6,'Significant','A bug affecting the intended performance of the product',6,'#dab0b0');
INSERT INTO TBL_SEVERITY VALUES (7,'Critical','A bug severe enough to prevent the release of the product',7,'#daaaaa');
-INSERT INTO db_sequence values ('TBL_SEVERITY', 7);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_SEVERITY', 7);
INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1);
INSERT INTO TBL_STATUS VALUES (2,'New','A new bug',2);
@@ -348,7 +338,7 @@
INSERT INTO TBL_STATUS VALUES (5,'Resolved','Set by engineer with a resolution',5);
INSERT INTO TBL_STATUS VALUES (6,'Verified','The resolution is confirmed by the reporter',6);
INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7);
-INSERT INTO db_sequence values ('TBL_STATUS', 7);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_STATUS', 7);
--
@@ -367,7 +357,7 @@
-- Indexes for table ACTIVE_SESSIONS
--
-CREATE INDEX changed_active_sessions_index ON active_sessions (changed);
+CREATE INDEX changed_TBL_ACTIVE_SESSIONS_index ON TBL_ACTIVE_SESSIONS (changed);
--
-- Indexes for table TBL_USER_PERM
@@ -381,10 +371,5 @@
CREATE INDEX group_id_TBL_BUG_GROUP_index ON TBL_BUG_GROUP (group_id);
---
--- Sequences for table TBL_SAVED_QUERY
---
-
-SELECT SETVAL('tbl_saved_query_saved_query_',(select case when max(saved_query_id)>0 then max(saved_query_id)+1 else 1 end from TBL_SAVED_QUERY));
COMMIT;
Index: mysql.in
===================================================================
RCS file: /cvsroot/phpbt/phpbt/schemas/mysql.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mysql.in 2001/10/13 23:15:22 1.6
+++ mysql.in 2001/10/30 04:02:45 1.7
@@ -1,22 +1,16 @@
-# MySQL database creation script
-# If you change the database name, make sure you change the DB_DATABASE
-# constant in config.php. Make sure you edit the TBL_AUTH_USER insert below.
+# MySQL database creation template
+# This is a template for install.php -- not for creating the database!
#
-# TEMPLATE: This is a template for configure_db -- not for creating the database!
-#
# $Id$
-
-create database BugTracker;
-use BugTracker;
-CREATE TABLE active_sessions (
+CREATE TABLE TBL_ACTIVE_SESSIONS (
sid varchar(32) NOT NULL default '',
name varchar(32) NOT NULL default '',
val text,
changed varchar(14) NOT NULL default '',
PRIMARY KEY (name,sid),
KEY changed (changed)
-) TYPE=ISAM PACK_KEYS=1;
+) TYPE=MyISAM;
CREATE TABLE TBL_ATTACHMENT (
attachment_id int(10) unsigned NOT NULL default '0',
@@ -145,11 +139,11 @@
PRIMARY KEY (varname)
) TYPE=MyISAM;
-CREATE TABLE db_sequence (
+CREATE TABLE TBL_DB_SEQUENCE (
seq_name varchar(127) NOT NULL default '',
nextid int(10) unsigned NOT NULL default '0',
PRIMARY KEY (seq_name)
-) TYPE=ISAM PACK_KEYS=1;
+) TYPE=MyISAM;
CREATE TABLE TBL_GROUP_PERM (
group_id int(10) unsigned NOT NULL default '0',
@@ -187,7 +181,7 @@
) TYPE=MyISAM;
CREATE TABLE TBL_SAVED_QUERY (
- saved_query_id int(10) unsigned NOT NULL auto_increment,
+ saved_query_id int(10) unsigned NOT NULL default '0',
user_id int(10) unsigned NOT NULL default '0',
saved_query_name varchar(40) NOT NULL default '',
saved_query_string text NOT NULL,
@@ -247,9 +241,9 @@
INSERT INTO TBL_AUTH_USER
(user_id, login, first_name, last_name, email, password)
- values (1, 'ad...@ex...', 'System', 'Admin', 'ad...@ex...',
- 'somepassword');
-INSERT INTO db_sequence values ('TBL_AUTH_USER', 1);
+ values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
+ 'OPTION_ADMIN_PASS');
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_AUTH_USER', 1);
# Start off with three user levels...
INSERT INTO TBL_AUTH_GROUP (group_id, group_name) VALUES (1, 'Admin');
@@ -268,11 +262,11 @@
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1);
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2);
-INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','http://localhost/~bcurtis/phpbt','The base URL of the phpBugTracker installation','string');
+INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string');
INSERT INTO TBL_CONFIGURATION VALUES ('JPGRAPH_PATH','','If not in the include path','string');
INSERT INTO TBL_CONFIGURATION VALUES ('CVS_WEB','http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/','Location of your cvs web interface (see format_comments() in bug.php)','string');
-INSERT INTO TBL_CONFIGURATION VALUES ('ADMIN_EMAIL','ph...@be...','The email address used in correspondence from the bug tracker','string');
-INSERT INTO TBL_CONFIGURATION VALUES ('ENCRYPT_PASS','','Whether to store passwords encrypted. <b>Warning:</b> Changing this after users have been created will result in their being unable to login.','bool');
+INSERT INTO TBL_CONFIGURATION VALUES ('ADMIN_EMAIL','OPTION_PHPBT_EMAIL','The email address used in correspondence from the bug tracker','string');
+INSERT INTO TBL_CONFIGURATION VALUES ('ENCRYPT_PASS','OPTION_ENCRYPT_PASS','Whether to store passwords encrypted. <b>Warning:</b> Changing this after users have been created will result in their being unable to login.','bool');
INSERT INTO TBL_CONFIGURATION VALUES ('USE_JPGRAPH','','Whether to show some reports as images','bool');
INSERT INTO TBL_CONFIGURATION VALUES ('MASK_EMAIL','1','Should email addresses have . changed to \'dot\' and @ change to \'at\'?','bool');
INSERT INTO TBL_CONFIGURATION VALUES ('HIDE_EMAIL','1','Should email addresses be hidden for those not logged in?','bool');
@@ -316,7 +310,7 @@
INSERT INTO TBL_OS VALUES (29,'Solaris',29,'/Mozilla.*\\(.*;.*; SunOS 5.*\\)/');
INSERT INTO TBL_OS VALUES (30,'SunOS',30,'/Mozilla.*\\(.*;.*; SunOS.*\\)/');
INSERT INTO TBL_OS VALUES (31,'other',31,'');
-INSERT INTO db_sequence values ('TBL_OS', 31);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_OS', 31);
INSERT INTO TBL_RESOLUTION VALUES (1,'Fixed','Bug was eliminated',1);
INSERT INTO TBL_RESOLUTION VALUES (2,'Not a bug','It\'s not a bug -- it\'s a feature!',2);
@@ -324,7 +318,7 @@
INSERT INTO TBL_RESOLUTION VALUES (4,'Deferred','We\'ll get around to it later',4);
INSERT INTO TBL_RESOLUTION VALUES (5,'Works for me','Can\'t replicate the bug',5);
INSERT INTO TBL_RESOLUTION VALUES (6,'Duplicate','',6);
-INSERT INTO db_sequence values ('TBL_RESOLUTION', 6);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_RESOLUTION', 6);
INSERT INTO TBL_SEVERITY VALUES (1,'Unassigned','Default bug creation',1,'#dadada');
INSERT INTO TBL_SEVERITY VALUES (2,'Idea','Ideas for further development',2,'#dad0d0');
@@ -333,7 +327,7 @@
INSERT INTO TBL_SEVERITY VALUES (5,'Content','Non-functional related bugs, such as text content',5,'#dababa');
INSERT INTO TBL_SEVERITY VALUES (6,'Significant','A bug affecting the intended performance of the product',6,'#dab0b0');
INSERT INTO TBL_SEVERITY VALUES (7,'Critical','A bug severe enough to prevent the release of the product',7,'#daaaaa');
-INSERT INTO db_sequence values ('TBL_SEVERITY', 7);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_SEVERITY', 7);
INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1);
INSERT INTO TBL_STATUS VALUES (2,'New','A new bug',2);
@@ -342,5 +336,5 @@
INSERT INTO TBL_STATUS VALUES (5,'Resolved','Set by engineer with a resolution',5);
INSERT INTO TBL_STATUS VALUES (6,'Verified','The resolution is confirmed by the reporter',6);
INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7);
-INSERT INTO db_sequence values ('TBL_STATUS', 7);
+INSERT INTO TBL_DB_SEQUENCE values ('TBL_STATUS', 7);
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 03:59:54
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv10107
Modified Files:
config.php
Log Message:
Use constants for the support tables to facilitate the web installation
Index: config.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- config.php 2001/10/12 13:43:29 1.14
+++ config.php 2001/10/30 03:59:51 1.15
@@ -34,6 +34,8 @@
// Database Table Config
// you can change either the prefix of the table names or each table name individually
define ('TBL_PREFIX', ''); // the prefix for all tables, leave empty to use the old style
+define ('TBL_ACTIVE_SESSIONS', TBL_PREFIX.'active_sessions');
+define ('TBL_DB_SEQUENCE', TBL_PREFIX.'db_sequence');
define ('TBL_ATTACHMENT', TBL_PREFIX.'attachment');
define ('TBL_AUTH_GROUP', TBL_PREFIX.'auth_group');
define ('TBL_AUTH_PERM', TBL_PREFIX.'auth_perm');
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 03:57:46
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv9278
Modified Files:
query.php
Log Message:
Stop depending on the auto_increment primary key for the saved queries table. Make the queries more PG compatible.
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- query.php 2001/10/16 04:19:47 1.33
+++ query.php 2001/10/30 03:57:43 1.34
@@ -41,7 +41,7 @@
$t->set_block('savequeryblock','row','rows');
// Build the javascript-powered select boxes
- $q->query("select project_id, project_name from ".TBL_PROJECT." where active order by project_name");
+ $q->query("select project_id, project_name from ".TBL_PROJECT." where active = 1 order by project_name");
while (list($pid, $pname) = $q->grab()) {
// Version array
$js .= "versions['$pname'] = new Array(new Array('','All'),";
@@ -169,8 +169,8 @@
// Save the query if requested
if ($savedqueryname) {
$savedquerystring = ereg_replace('&savedqueryname=.*(&?)', '\\1', $GLOBALS['QUERY_STRING']);
- $q->query("insert into ".TBL_SAVED_QUERY." (user_id, saved_query_name, saved_query_string)"
- ." values ($u, '$savedqueryname', '$savedquerystring')");
+ $q->query("insert into ".TBL_SAVED_QUERY." (saved_query_id, user_id, saved_query_name, saved_query_string)"
+ ." values (".$q->nextid(TBL_SAVED_QUERY).", $u, '$savedqueryname', '$savedquerystring')");
}
if (!$order) {
$order = 'bug_id';
|
|
From: Benjamin C. <bc...@us...> - 2001-10-30 03:56:02
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv8611/templates/default
Modified Files:
bugform.html
Log Message:
A little bit of cleanup
Index: bugform.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugform.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- bugform.html 2001/08/01 13:55:56 1.1
+++ bugform.html 2001/10/30 03:55:57 1.2
@@ -2,7 +2,7 @@
<input type="hidden" name="bugid" value="{bugid}">
<input type="hidden" name="project" value="{project}">
<input type="hidden" name="op" value="do">
-<table border='0'>
+<table border="0">
<tr>
<td colspan="2"><font color="#ff0000">{error}</font></td>
</tr>
@@ -77,5 +77,5 @@
</tr>
</table>
-<input type='submit' name='submit' value='Submit'>
+<input type="submit" name="submit" value="Submit">
</form>
|
|
From: Javier S. <ja...@us...> - 2001-10-29 22:59:59
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6587
Modified Files:
include.php
Log Message:
Changing SQL syntax for postgres compatibilty on template extends
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- include.php 2001/10/29 22:56:54 1.65
+++ include.php 2001/10/29 22:59:55 1.66
@@ -213,7 +213,6 @@
class templateclass extends Template {
function pparse($target, $handle, $append = false) {
global $auth, $perm, $q;
-$q->Debug=true;
$u = $auth->auth['uid'];
$this->set_block('wrap', 'logoutblock', 'loblock');
|
|
From: Javier S. <ja...@us...> - 2001-10-29 22:56:57
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv5652
Modified Files:
include.php
Log Message:
Changing SQL syntax for postgres compatibilty on template extends
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- include.php 2001/10/29 22:41:59 1.64
+++ include.php 2001/10/29 22:56:54 1.65
@@ -213,6 +213,7 @@
class templateclass extends Template {
function pparse($target, $handle, $append = false) {
global $auth, $perm, $q;
+$q->Debug=true;
$u = $auth->auth['uid'];
$this->set_block('wrap', 'logoutblock', 'loblock');
@@ -220,14 +221,14 @@
$this->set_block('wrap', 'adminnavblock', 'anblock');
if ($u && $u != 'nobody') {
list($owner_open, $owner_closed) =
- $q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
- ." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
- ." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id)"
- ." where assigned_to = $u where status_name in ");
+ $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
+ ."sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END )"
+ ."from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where assigned_to = $u");
+
list($reporter_open, $reporter_closed) =
- $q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
- ." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
- ." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where created_by = $u");
+ $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
+ ."sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END )"
+ ."from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where created_by = $u");
$this->set_var(array(
'loggedinas' => $auth->auth['uname'],
'liblock' => '',
|
|
From: Javier S. <ja...@us...> - 2001-10-29 22:42:02
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv737
Modified Files:
include.php
Log Message:
Changing SQL syntax for postgres compatibilty on template extends
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- include.php 2001/10/13 23:15:52 1.63
+++ include.php 2001/10/29 22:41:59 1.64
@@ -223,7 +223,7 @@
$q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id)"
- ." where assigned_to = $u");
+ ." where assigned_to = $u where status_name in ");
list($reporter_open, $reporter_closed) =
$q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
|
|
From: Benjamin C. <bc...@us...> - 2001-10-26 12:02:40
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv15924
Modified Files:
bug.php
Log Message:
Fixes bug #472928 - quotes not being escaped in the bug_history insert
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- bug.php 2001/10/17 13:19:19 1.50
+++ bug.php 2001/10/26 12:02:37 1.51
@@ -122,7 +122,8 @@
." where ${field}_id = {$cf[$field.'_id']}");
$q->query('insert into '.TBL_BUG_HISTORY
.' (bug_id, changed_field, old_value, new_value, created_by, created_date)'
- ." values ({$buginfo['bug_id']}, '$field', '$oldvalue', '$newvalue', $u, $now)");
+ ." values ({$buginfo['bug_id']}, '$field', '".addslashes($oldvalue).
+ "', '".addslashes($newvalue)."', $u, $now)");
$t->set_var(array(
$field.'_id' => stripslashes($newvalue),
$field.'_id_stat' => '!'
|
|
From: Ben C. <php...@be...> - 2001-10-25 13:54:06
|
https://sourceforge.net/tracker/index.php?func=detail&aid=474308&group_id=14939&atid=114939 Someone is having a problem with IIS and choosing "Add another" when adding a bug. I don't have ready access to IIS, so can someone take on this bug? |
|
From: Benjamin C. <bc...@us...> - 2001-10-25 13:00:24
|
Update of /cvsroot/phpbt/phpbt/docs/html
In directory usw-pr-cvs1:/tmp/cvs-serv25207/html
Modified Files:
devguide.html devstandards.html docs.css index.html
Added Files:
schema.html
Log Message:
Added database schema
--- NEW FILE: schema.html ---
<HTML
><HEAD
><TITLE
>Database Schema</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.73
"><LINK
REL="HOME"
TITLE="phpBugTracker"
HREF="index.html"><LINK
REL="UP"
TITLE="Developer's Guide"
HREF="devguide.html"><LINK
REL="PREVIOUS"
TITLE="Development Standards"
HREF="devstandards.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
[...3357 lines suppressed...]
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="devguide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
> </TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
Index: devguide.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/docs/html/devguide.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- devguide.html 2001/10/17 13:44:10 1.14
+++ devguide.html 2001/10/25 13:00:21 1.15
@@ -120,6 +120,11 @@
></DT
></DL
></DD
+><DT
+>3.3. <A
+HREF="schema.html"
+>Database Schema</A
+></DT
></DL
></DIV
><BLOCKQUOTE
Index: devstandards.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/docs/html/devstandards.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- devstandards.html 2001/10/17 13:44:10 1.15
+++ devstandards.html 2001/10/25 13:00:21 1.16
@@ -15,6 +15,9 @@
REL="PREVIOUS"
TITLE="Developer's Guide"
HREF="devguide.html"><LINK
+REL="NEXT"
+TITLE="Database Schema"
+HREF="schema.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="docs.css"></HEAD
@@ -58,7 +61,11 @@
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
-> </TD
+><A
+HREF="schema.html"
+ACCESSKEY="N"
+>Next</A
+></TD
></TR
></TABLE
><HR
@@ -421,7 +428,11 @@
WIDTH="33%"
ALIGN="right"
VALIGN="top"
-> </TD
+><A
+HREF="schema.html"
+ACCESSKEY="N"
+>Next</A
+></TD
></TR
><TR
><TD
@@ -442,7 +453,7 @@
WIDTH="33%"
ALIGN="right"
VALIGN="top"
-> </TD
+>Database Schema</TD
></TR
></TABLE
></DIV
Index: docs.css
===================================================================
RCS file: /cvsroot/phpbt/phpbt/docs/html/docs.css,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- docs.css 2001/10/17 13:43:41 1.6
+++ docs.css 2001/10/25 13:00:21 1.7
@@ -23,6 +23,6 @@
text-align: center;
}
-TT {
- font-family: "Tahoma", "Lucida", "Helvetica", "Arial", "Sans-Serif";
- }
+thead { background-color: #dddddd; }
+
+.TABLE { padding: .5em; }
Index: index.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/docs/html/index.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- index.html 2001/10/17 13:44:10 1.12
+++ index.html 2001/10/25 13:00:21 1.13
@@ -110,6 +110,11 @@
HREF="devstandards.html"
>Development Standards</A
></DT
+><DT
+>3.3. <A
+HREF="schema.html"
+>Database Schema</A
+></DT
></DL
></DD
></DL
|