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: Javier S. <js...@si...> - 2001-09-01 17:41:10
|
I'm ok with you, i like to split queries too ;-) Patrick Mairif wrote: >On Sat, Sep 01, 2001 at 08:55:16AM -0700, Ben Curtis wrote: > >>With Patrick's last commit I was reminded that I need to get the coding standards document written. :) One thing I like is to keep queries all on one line (for ease in grepping). The downside is that it's not as easy to deal with in terminal text editors like vi and emacs. Thoughts? >> > >you can tell grep to print some lines before and after match, so this >is no reason! And I think sql strings splitted over more lines >increases readability a lot! > > |
|
From: Patrick M. <mai...@st...> - 2001-09-01 17:05:44
|
On Sat, Sep 01, 2001 at 08:55:16AM -0700, Ben Curtis wrote: > With Patrick's last commit I was reminded that I need to get the coding standards document written. :) One thing I like is to keep queries all on one line (for ease in grepping). The downside is that it's not as easy to deal with in terminal text editors like vi and emacs. Thoughts? you can tell grep to print some lines before and after match, so this is no reason! And I think sql strings splitted over more lines increases readability a lot! -- http://home.nikocity.de/mairif http://caravan-network.de ICQ# 96716515 |
|
From: Benjamin C. <bc...@us...> - 2001-09-01 16:17:12
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6685
Modified Files:
config.php
Log Message:
Move the table definitions down below the other configurable options, as they are less likely to be edited
Index: config.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- config.php 2001/09/01 15:44:20 1.6
+++ config.php 2001/09/01 16:17:10 1.7
@@ -35,8 +35,27 @@
define ('DB_USER', 'root');
define ('DB_PASSWORD', '');
+define ('ADMINEMAIL', 'ph...@be...');
+define ('ENCRYPTPASS', 0); // Whether to store passwords encrypted
+define ('THEME', 'default/'); // Which set of templates to use
+define ('USE_JPGRAPH', 0); // Whether to show images or not
+define ('MASK_EMAIL', 1); // Should email addresses be plainly visible?
+define ('HIDE_EMAIL', 1); // Should email addresses be hidden for those not logged in?
+// Should the query list use the severity colors as the row background color (like SourceForge)
+define ('USE_SEVERITY_COLOR', 1);
+define ('EMAIL_IS_LOGIN', 1); // Whether to use email addresses as logins
+
+// Sub-dir of the INSTALLPATH - Needs to be writeable by the web process
+define ('ATTACHMENT_PATH', 'attachments');
+// Maximum size (in bytes) of an attachment
+// This will not override the settings in php.ini if php.ini has a lower limit
+define ('ATTACHMENT_MAX_SIZE', 2097152);
+define ('ONEDAY', 86400);
+define ('DATEFORMAT', 'm-d-Y');
+define ('TIMEFORMAT', 'g:i A');
+
//Database Table Config
-//you can change either the prefix of the table names or each table name individualy
+//you can change either the prefix of the table names or each table name individually
//define ('TBL_PREFIX', 'phpbt_'); //the prefix for all tables
define ('TBL_PREFIX', ''); //the prefix for all tables, leave empty to use the old style
define ('TBL_ATTACHMENT', TBL_PREFIX.'attachment');
@@ -59,25 +78,6 @@
define ('TBL_GROUP_PERM', TBL_PREFIX.'group_perm');
define ('TBL_BUG_GROUP', TBL_PREFIX.'bug_group');
define ('TBL_PROJECT_GROUP', TBL_PREFIX.'project_group');
-
-define ('ADMINEMAIL', 'ph...@be...');
-define ('ENCRYPTPASS', 0); // Whether to store passwords encrypted
-define ('THEME', 'default/'); // Which set of templates to use
-define ('USE_JPGRAPH', 0); // Whether to show images or not
-define ('MASK_EMAIL', 1); // Should email addresses be plainly visible?
-define ('HIDE_EMAIL', 1); // Should email addresses be hidden for those not logged in?
-// Should the query list use the severity colors as the row background color (like SourceForge)
-define ('USE_SEVERITY_COLOR', 1);
-define ('EMAIL_IS_LOGIN', 1); // Whether to use email addresses as logins
-
-// Sub-dir of the INSTALLPATH - Needs to be writeable by the web process
-define ('ATTACHMENT_PATH', 'attachments');
-// Maximum size (in bytes) of an attachment
-// This will not override the settings in php.ini if php.ini has a lower limit
-define ('ATTACHMENT_MAX_SIZE', 2097152);
-define ('ONEDAY', 86400);
-define ('DATEFORMAT', 'm-d-Y');
-define ('TIMEFORMAT', 'g:i A');
require PHPLIBPATH.'db_'.DB_TYPE.'.inc';
require PHPLIBPATH.'ct_sql.inc';
|
|
From: Benjamin C. <bc...@us...> - 2001-09-01 16:15:05
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6360
Modified Files:
include.php
Log Message:
Tweaked build_select a bit, plus fixed a problem with the project query in it
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- include.php 2001/09/01 15:44:20 1.45
+++ include.php 2001/09/01 16:15:01 1.46
@@ -269,22 +269,23 @@
//create hash to map tablenames
$cfgDatabase=array(
- 'project' => TBL_PROJECT,
- 'component' => TBL_COMPONENT,
- 'status' => TBL_STATUS,
- 'resolution' => TBL_RESOLUTION,
- 'severity' => TBL_SEVERITY,
- 'version' => TBL_VERSION
+ 'project' => TBL_PROJECT,
+ 'component' => TBL_COMPONENT,
+ 'status' => TBL_STATUS,
+ 'resolution' => TBL_RESOLUTION,
+ 'severity' => TBL_SEVERITY,
+ 'version' => TBL_VERSION
);
$text = '';
+ $querystart = "select {$box}_id, {$box}_name from $cfgDatabase[$box]";
$queries = array(
- 'severity' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
- 'status' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
- 'resolution' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
- 'project' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where active = 0 order by {$box}_name",
- 'component' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where project_id = $project order by {$box}_name",
- 'version' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where project_id = $project order by {$box}_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',
+ 'project' => $querystart." where active > 0 order by {$box}_name",
+ 'component' => $querystart." where project_id = $project order by {$box}_name",
+ 'version' => $querystart." where project_id = $project order by {$box}_name"
);
switch($box) {
@@ -299,7 +300,7 @@
if ($value == $row[$box.'_id'] and $value != '') $sel = ' selected';
else $sel = '';
$text .= '<option value="'.
- $row[$box.'_id']."\"$sel>".$row[$box.'_name']."</option>";
+ $row[$box.'_id']."\"$sel>".$row[$box.'_name'].'</option>';
}
break;
case 'os' :
|
|
From: Benjamin C. <bc...@us...> - 2001-09-01 16:14:32
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6255
Modified Files:
bug.php
Log Message:
Use the table alias
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- bug.php 2001/09/01 15:44:20 1.35
+++ bug.php 2001/09/01 16:14:29 1.36
@@ -476,7 +476,7 @@
}
}
- $q->query("select comment_text, comment.created_date, email"
+ $q->query("select comment_text, c.created_date, email"
." 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()) {
|
|
From: Patrick M. <mai...@st...> - 2001-09-01 16:03:57
|
On Sat, Sep 01, 2001 at 08:55:16AM -0700, Ben Curtis wrote: > With Patrick's last commit I was reminded that I need to get the coding standards document written. :) One thing I like is to keep queries all on one line (for ease in grepping). The downside is that it's not as easy to deal with in terminal text editors like vi and emacs. Thoughts? my vim has no problems with it. but for me it's very hard to read them, when they are all on one line! -- http://home.nikocity.de/mairif http://caravan-network.de ICQ# 96716515 |
|
From: Patrick M. <mai...@st...> - 2001-09-01 16:00:12
|
I made a simple table_rename.sql that renames tables to those with prefix 'phpbt_'. the actual config.php uses an empty prefix, so the actual tablenames should still work. |
|
From: Ben C. <php...@be...> - 2001-09-01 15:56:08
|
With Patrick's last commit I was reminded that I need to get the coding standards document written. :) One thing I like is to keep queries all on one line (for ease in grepping). The downside is that it's not as easy to deal with in terminal text editors like vi and emacs. Thoughts? |
|
From: Ben C. <php...@be...> - 2001-09-01 15:46:57
|
Since Monday is a holiday for me, I'd like to get 0.3.0 released by the end of Monday. Can anyone think of anything that would prevent that? |
|
From: Patrick M. <mo...@us...> - 2001-09-01 15:44:23
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv32304
Modified Files:
attachment.php bug.php config.php images.php include.php
index.php newaccount.php query.php report.php user.php
Added Files:
table_rename.sql
Log Message:
configurable tablenames
----------------------------------------------------------------------
Committing in .
Modified Files:
attachment.php bug.php config.php images.php include.php
index.php newaccount.php query.php report.php user.php
admin/component.php admin/os.php admin/project.php
admin/resolution.php admin/severity.php admin/status.php
admin/user.php admin/version.php
Added Files:
table_rename.sql
----------------------------------------------------------------------
--- NEW FILE: table_rename.sql ---
alter table attachment rename phpbt_attachment;
alter table bug rename phpbt_bug;
alter table bug_history rename phpbt_bug_history;
alter table comment rename phpbt_comment;
alter table component rename phpbt_component;
alter table os rename phpbt_os;
alter table project rename phpbt_project;
alter table resolution rename phpbt_resolution;
alter table saved_query rename phpbt_saved_query;
alter table severity rename phpbt_severity;
alter table status rename phpbt_status;
alter table auth_user rename phpbt_auth_user;
alter table version rename phpbt_version;
alter table auth_group rename phpbt_auth_group;
alter table auth_perm rename phpbt_auth_perm;
alter table user_group rename phpbt_user_group;
alter table user_perm rename phpbt_user_perm;
alter table group_perm rename phpbt_group_perm;
alter table bug_group rename phpbt_bug_group;
alter table project_group rename phpbt_project_group;
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- attachment.php 2001/08/23 02:03:16 1.6
+++ attachment.php 2001/09/01 15:44:20 1.7
@@ -28,7 +28,7 @@
global $q;
if (list($filename, $mimetype) = grab_attachment($attachid)) {
- $q->query("delete from attachment where attachment_id = $attachid");
+ $q->query("delete from ".TBL_ATTACHMENT." where attachment_id = $attachid");
unlink($filename);
header("Location: bug.php?op=show&bugid=$attachid");
}
@@ -41,7 +41,9 @@
show_text($STRING['bad_attachment'], true);
return false;
}
- $ainfo = $q->grab("select a.bug_id, file_name, mime_type, project_id from attachment a, bug b where attachment_id = $attachid and a.bug_id = b.bug_id");
+ $ainfo = $q->grab("select a.bug_id, file_name, mime_type, project_id"
+ ." from ".TBL_ATTACHMENT." a, ".TBL_BUG." b"
+ ." where attachment_id = $attachid and a.bug_id = b.bug_id");
if ($q->num_rows() != 1) {
show_text($STRING['bad_attachment'], true);
return false;
@@ -71,14 +73,15 @@
return;
}
- $projectid = $q->grab_field("select project_id from bug where bug_id = $bugid");
+ $projectid = $q->grab_field("select project_id from ".TBL_BUG." where bug_id = $bugid");
if (!$projectid) {
show_text($STRING['nobug'], true);
return;
}
// Check for a previously-uploaded attachment with the same name, bug, and project
- $q->query("select a.bug_id, project_id from attachment a, bug b where file_name = '{$HTTP_POST_FILES['attachment']['name']}' and a.bug_id = b.bug_id");
+ $q->query("select a.bug_id, project_id from ".TBL_ATTACHMENT." a, ".TBL_BUG." b"
+ ." where file_name = '{$HTTP_POST_FILES['attachment']['name']}' and a.bug_id = b.bug_id");
while ($ainfo = $q->grab()) {
if ($bugid == $ainfo['bug_id'] && $projectid == $ainfo['project_id']) {
show_attachment_form($bugid, $STRING['dupe_attachment']);
@@ -111,7 +114,7 @@
}
@chmod("$filepath/$projectid/$filename", 0766);
- $q->query("insert into attachment (attachment_id, bug_id, file_name, description, file_size, mime_type, created_by, created_date) values (".$q->nextid('attachment').", $bugid, '{$HTTP_POST_FILES['attachment']['name']}', '$description', {$HTTP_POST_FILES['attachment']['size']}, '{$HTTP_POST_FILES['attachment']['type']}', $u, $now)");
+ $q->query("insert into ".TBL_ATTACHMENT." (attachment_id, bug_id, file_name, description, file_size, mime_type, created_by, created_date) values (".$q->nextid('attachment').", $bugid, '{$HTTP_POST_FILES['attachment']['name']}', '$description', {$HTTP_POST_FILES['attachment']['size']}, '{$HTTP_POST_FILES['attachment']['type']}', $u, $now)");
$t->set_file('content', 'bugattachmentsuccess.html');
$t->set_var('bugid', $bugid);
}
@@ -125,7 +128,7 @@
return;
}
- $bugexists = $q->grab_field("select count(*) from bug where bug_id = $bugid");
+ $bugexists = $q->grab_field("select count(*) from ".TBL_BUG." where bug_id = $bugid");
if (!$bugexists) {
show_text($STRING['nobug'], true);
return;
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- bug.php 2001/08/31 04:25:07 1.34
+++ bug.php 2001/09/01 15:44:20 1.35
@@ -34,7 +34,8 @@
return;
}
- $q->query("select bh.*, email from bug_history bh left join auth_user on created_by = user_id where bug_id = $bugid");
+ $q->query("select bh.*, email from ".TBL_BUG_HISTORY." bh left join ".TBL_AUTH_USER." on created_by = user_id"
+ ." where bug_id = $bugid");
if (!$q->num_rows()) {
show_text($STRING['nobughistory']);
return;
@@ -65,7 +66,9 @@
$t->set_block('emailout','commentblock', 'cblock');
foreach(array('title','url') as $field) {
if (isset($cf[$field])) {
- $q->query("insert into bug_history (bug_id, changed_field, old_value, new_value, created_by, created_date) values ({$buginfo['bug_id']}, '$field', '$buginfo[$field]', '$cf[$field]', $u, $now)");
+ $q->query("insert into ".TBL_BUG_HISTORY
+ ." (bug_id, changed_field, old_value, new_value, created_by, created_date)"
+ ." values ({$buginfo['bug_id']}, '$field', '$buginfo[$field]', '$cf[$field]', $u, $now)");
$t->set_var(array(
$field => $cf[$field],
$field.'_stat' => '!'
@@ -77,13 +80,28 @@
));
}
}
+
+ //create array with tablenames for following loop
+ $cfgDatabase=array(
+ 'project' => TBL_PROJECT,
+ 'component' => TBL_COMPONENT,
+ 'status' => TBL_STATUS,
+ 'resolution' => TBL_RESOLUTION,
+ 'severity' => TBL_SEVERITY,
+ 'os' => TBL_OS,
+ 'version' => TBL_VERSION
+ );
foreach(array('project','component','status','resolution','severity','os',
'version') as $field) {
- $oldvalue = $q->grab_field("select ${field}_name from $field where ${field}_id = {$buginfo[$field.'_id']}");
+ $oldvalue = $q->grab_field("select ${field}_name from ".$cfgDatabase[$field]
+ ." where ${field}_id = {$buginfo[$field.'_id']}");
if ($cf[$field]) {
- $newvalue = $q->grab_field("select ${field}_name from $field where ${field}_id = $cf[$field]");
- $q->query("insert into bug_history (bug_id, changed_field, old_value, new_value, created_by, created_date) values ({$buginfo['bug_id']}, '$field', '$oldvalue', '$newvalue', $u, $now)");
+ $newvalue = $q->grab_field("select ${field}_name from ".$cfgDatabase[$field]
+ ." where ${field}_id = $cf[$field]");
+ $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)");
$t->set_var(array(
$field => stripslashes($newvalue),
$field.'Stat' => '!'
@@ -97,14 +115,18 @@
}
// Reporter never changes;
- $reporter = $q->grab_field("select email from auth_user where user_id = {$buginfo['created_by']}");
+ $reporter = $q->grab_field("select email from ".TBL_AUTH_USER." where user_id = {$buginfo['created_by']}");
$reporterstat = ' ';
- $assignedto = $q->grab_field("select email from auth_user where user_id = ". ($cf['assigned_to'] ? $cf['assigned_to'] : $buginfo['assigned_to']));
+ $assignedto = $q->grab_field("select email from ".TBL_AUTH_USER
+ ." where user_id = ". ($cf['assigned_to'] ? $cf['assigned_to'] : $buginfo['assigned_to']));
$assignedtostat = $cf['assigned_to'] ? '!' : ' ';
// If there are new comments grab the comments immediately before the latest
if ($comments) {
- $q->query("select u.email, c.comment_text, c.created_date from comment c, auth_user u where bug_id = {$buginfo['bug_id']} and c.created_by = u.user_id order by created_date desc limit 2");
+ $q->query("select u.email, c.comment_text, c.created_date"
+ ." from ".TBL_COMMENT." c, ".TBL_AUTH_USER." u"
+ ." where bug_id = {$buginfo['bug_id']} and c.created_by = u.user_id"
+ ." order by created_date desc limit 2");
$row = $q->grab();
$t->set_var(array(
'newpostedby' => $row['email'],
@@ -115,7 +137,9 @@
// If this comment is the first additional comment after the creation of the
// bug then we need to grab the bug's description as the previous comment
if ($q->num_rows() < 2) {
- list($by, $on, $comments) = $q->grab("select u.email, b.created_date, b.description from bug b, auth_user u where b.created_by = u.user_id and bug_id = {$buginfo['bug_id']}");
+ list($by, $on, $comments) = $q->grab("select u.email, b.created_date, b.description"
+ ." from ".TBL_BUG." b, ".TBL_AUTH_USER." u"
+ ." where b.created_by = u.user_id and bug_id = {$buginfo['bug_id']}");
$t->set_var(array(
'oldpostedby' => $by,
'oldpostedon' => date(TIMEFORMAT,$on).' on '.date(DATEFORMAT,$on),
@@ -166,7 +190,7 @@
global $q, $t, $u, $STRING, $perm, $now;
// Pull bug from database to determine changed fields and for user validation
- $buginfo = $q->grab("select * from bug where bug_id = $bugid");
+ $buginfo = $q->grab("select * from ".TBL_BUG." where bug_id = $bugid");
if (isset($GLOBALS['HTTP_POST_VARS'])) {
foreach ($GLOBALS['HTTP_POST_VARS'] as $k => $v) {
@@ -187,7 +211,7 @@
}
if ($outcome == 'reassign' and
- (!$assignedto = $q->grab_field("select user_id from auth_user where email = '$reassignto'"))) {
+ (!$assignedto = $q->grab_field("select user_id from ".TBL_AUTH_USER." where email = '$reassignto'"))) {
show_bug($bugid,array('status' => $STRING['nouser']));
return;
}
@@ -201,7 +225,7 @@
case 'unchanged' : break;
case 'assign' : $assignedto = $u; $statusfield = 'Assigned'; break;
case 'reassign' :
- if (!$assignedto = $q->grab_field("select user_id from auth_user where email = '$reassignto'")) {
+ if (!$assignedto = $q->grab_field("select user_id from ".TBL_AUTH_USER." where email = '$reassignto'")) {
show_bug($bugid,array('status' => $STRING['nouser']));
return;
} else {
@@ -210,21 +234,23 @@
break;
}
case 'reassigntocomponent' :
- $assignedto = $q->grab_field("select owner from component where component_id = $component");
+ $assignedto = $q->grab_field("select owner from ".TBL_COMPONENT." where component_id = $component");
$statusfield = 'Assigned'; break;
case 'dupe' :
$changeresolution = true;
if ($dupenum == $bugid) {
show_bug($bugid,array('status' => $STRING['dupeofself']));
return;
- } elseif (!$q->grab_field("select bug_id from bug where bug_id = $dupenum")) {
+ } elseif (!$q->grab_field("select bug_id from ".TBL_BUG." where bug_id = $dupenum")) {
show_bug($bugid,array('status' => $STRING['nobug']));
return;
}
- $q->query("insert into comment (comment_id, bug_id, comment_text, created_by, created_date) values (".$q->nextid('comment').", $dupenum, 'Bug #$bugid is a duplicate of this bug', $u, $now)");
- $q->query("insert into comment (comment_id, bug_id, comment_text, created_by, created_date) values (".$q->nextid('comment').", $bugid, 'This bug is a duplicate of bug #$dupenum', $u, $now)");
+ $q->query("insert into ".TBL_COMMENT." (comment_id, bug_id, comment_text, created_by, created_date)"
+ ." values (".$q->nextid('comment').", $dupenum, 'Bug #$bugid is 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('comment').", $bugid, 'This bug is a duplicate of bug #$dupenum', $u, $now)");
$statusfield = 'Duplicate';
- $bugresolution = $q->grab_field("select resolution_id from resolution where resolution_name = 'Duplicate'");
+ $bugresolution = $q->grab_field("select resolution_id from ".TBL_RESOLUTION." where resolution_name = 'Duplicate'");
$statusfield = 'Resolved';
break;
case 'resolve' :
@@ -244,16 +270,17 @@
break;
}
if ($statusfield) {
- $status = $q->grab_field("select status_id from status where status_name = '$statusfield'");
+ $status = $q->grab_field("select status_id from ".TBL_STATUS." where status_name = '$statusfield'");
$changedfields['status'] = $status;
}
if ($comments) {
$comments = htmlspecialchars($comments);
- $q->query("insert into comment (comment_id, bug_id, comment_text, created_by, created_date) values (".$q->nextid('comment').", $bugid, '$comments', $u, $now)");
+ $q->query("insert into ".TBL_COMMENT." (comment_id, bug_id, comment_text, created_by, created_date)"
+ ." values (".$q->nextid('comment').", $bugid, '$comments', $u, $now)");
}
- $q->query("update bug set title = '$title', url = '$url', severity_id = $severity_id, priority = $priority, ".($status ? "status_id = $status, " : ''). ($changeresolution ? "resolution_id = $bugresolution, " : ''). ($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");
+ $q->query("update ".TBL_BUG." set title = '$title', url = '$url', severity_id = $severity_id, priority = $priority, ".($status ? "status_id = $status, " : ''). ($changeresolution ? "resolution_id = $bugresolution, " : ''). ($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");
if ($changedfields or $comments) {
do_changedfields($u, $buginfo, $changedfields, $comments);
@@ -277,10 +304,10 @@
if ($url == 'http://') $url = '';
$time = time();
if (!$bugid) {
- $status = $q->grab_field("select status_id from status where status_name = 'Unconfirmed'");
- $q->query("insert into bug (bug_id, title, description, url, severity_id, priority, status_id, created_by, created_date, last_modified_by, last_modified_date, project_id, version_id, component_id, os_id, browser_string) values (".$q->nextid('bug').", '$title', '$description', '$url', $severity, $priority, $status, $u, $time, $u, $time, $project, $version, $component, '$os', '{$GLOBALS['HTTP_USER_AGENT']}')");
+ $status = $q->grab_field("select status_id from ".TBL_STATUS." where status_name = 'Unconfirmed'");
+ $q->query("insert into ".TBL_BUG." (bug_id, title, description, url, severity_id, priority, status_id, created_by, created_date, last_modified_by, last_modified_date, project_id, version_id, component_id, os_id, browser_string) values (".$q->nextid('bug').", '$title', '$description', '$url', $severity, $priority, $status, $u, $time, $u, $time, $project, $version, $component, '$os', '{$GLOBALS['HTTP_USER_AGENT']}')");
} else {
- $q->query("update bug set title = '$title', description = '$description', url = '$url', severity_id = '$severity', priority = '$priority', status_id = $status, assigned_to = '$assignedto', project_id = $project, version_id = $version, component_id = $component, os_id = '$os', browser_string = '{$GLOBALS['HTTP_USER_AGENT']}' last_modified_by = $u, last_modified_date = $time where bug_id = '$bugid'");
+ $q->query("update ".TBL_BUG." set title = '$title', description = '$description', url = '$url', severity_id = '$severity', priority = '$priority', status_id = $status, assigned_to = '$assignedto', project_id = $project, version_id = $version, component_id = $component, os_id = '$os', browser_string = '{$GLOBALS['HTTP_USER_AGENT']}' last_modified_by = $u, last_modified_date = $time where bug_id = '$bugid'");
}
if ($another) header("Location: $me?op=add&project=$project");
else header("Location: query.php");
@@ -293,9 +320,9 @@
while (list($k,$v) = each($GLOBALS['HTTP_POST_VARS'])) $$k = $v;
$t->set_file('content','bugform.html');
- $projectname = $q->grab_field("select project_name from project where project_id = $project");
+ $projectname = $q->grab_field("select project_name from ".TBL_PROJECT." where project_id = $project");
if ($bugid && !$error) {
- $row = $q->grab("select * from bug where bug_id = '$bugid'");
+ $row = $q->grab("select * from ".TBL_BUG." where bug_id = '$bugid'");
$t->set_var(array(
'bugid' => $bugid,
'TITLE' => $TITLE['editbug'],
@@ -343,9 +370,14 @@
}
function show_bug($bugid = 0, $error = '') {
- global $q, $me, $t, $project, $STRING, $u, $perm;
+ global $q, $me, $t, $project, $STRING, $u, $perm;
- if (!ereg('^[0-9]+$',$bugid) or !$row = $q->grab("select b.*, reporter.email as reporter, owner.email as owner, status_name, resolution_name from bug b left join resolution r using(resolution_id), severity sv, status st left join auth_user owner on b.assigned_to = owner.user_id left join 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")) {
+ if (!ereg('^[0-9]+$',$bugid) or !$row = $q->grab("select b.*, reporter.email as reporter, owner.email 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")) {
show_text($STRING['bugbadnum'],true);
return;
}
@@ -410,7 +442,7 @@
}
// Show the attachments
- $q->query("select * from attachment where bug_id = $bugid");
+ $q->query("select * from ".TBL_ATTACHMENT." where bug_id = $bugid");
if (!$q->num_rows()) {
$t->set_var('attrows', '<tr><td colspan="5" align="center">No attachments</td></tr>');
} else {
@@ -444,7 +476,9 @@
}
}
- $q->query("select comment_text, comment.created_date, email from comment, auth_user where bug_id = $bugid and comment.created_by = user_id order by comment.created_date");
+ $q->query("select comment_text, comment.created_date, email"
+ ." 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 {
@@ -465,7 +499,7 @@
function show_projects() {
global $me, $q, $t, $project, $STRING;
- $q->query("select * from project where active order by project_name");
+ $q->query("select * from ".TBL_PROJECT." where active order by project_name");
switch ($q->num_rows()) {
case 0 :
$t->set_var('rows',$STRING['noprojects']);
Index: config.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- config.php 2001/08/28 03:51:09 1.5
+++ config.php 2001/09/01 15:44:20 1.6
@@ -35,6 +35,31 @@
define ('DB_USER', 'root');
define ('DB_PASSWORD', '');
+//Database Table Config
+//you can change either the prefix of the table names or each table name individualy
+//define ('TBL_PREFIX', 'phpbt_'); //the prefix for all tables
+define ('TBL_PREFIX', ''); //the prefix for all tables, leave empty to use the old style
+define ('TBL_ATTACHMENT', TBL_PREFIX.'attachment');
+define ('TBL_BUG', TBL_PREFIX.'bug');
+define ('TBL_BUG_HISTORY', TBL_PREFIX.'bug_history');
+define ('TBL_COMMENT', TBL_PREFIX.'comment');
+define ('TBL_COMPONENT', TBL_PREFIX.'component');
+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_AUTH_USER', TBL_PREFIX.'auth_user');
+define ('TBL_VERSION', TBL_PREFIX.'version');
+define ('TBL_OS', TBL_PREFIX.'os');
+define ('TBL_AUTH_GROUP', TBL_PREFIX.'auth_group');
+define ('TBL_AUTH_PERM', TBL_PREFIX.'auth_perm');
+define ('TBL_USER_GROUP', TBL_PREFIX.'user_group');
+define ('TBL_USER_PERM', TBL_PREFIX.'user_perm');
+define ('TBL_GROUP_PERM', TBL_PREFIX.'group_perm');
+define ('TBL_BUG_GROUP', TBL_PREFIX.'bug_group');
+define ('TBL_PROJECT_GROUP', TBL_PREFIX.'project_group');
+
define ('ADMINEMAIL', 'ph...@be...');
define ('ENCRYPTPASS', 0); // Whether to store passwords encrypted
define ('THEME', 'default/'); // Which set of templates to use
Index: images.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/images.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- images.php 2001/08/17 01:34:55 1.5
+++ images.php 2001/09/01 15:44:20 1.6
@@ -31,13 +31,13 @@
include_once JPGRAPH_PATH.'jpgraph_pie.php';
// Grab the legend
- $q->query("select status_id, status_name from status order by sort_order");
+ $q->query("select status_id, status_name from ".TBL_STATUS." order by sort_order");
while ($row = $q->grab()) {
$stats[$row['status_id']]['name'] = $row['status_name'];
}
// Grab the data
- $q->query("select status_id, count(status_id) as count from bug group by status_id");
+ $q->query("select status_id, count(status_id) as count from ".TBL_BUG." group by status_id");
while ($row = $q->grab()) {
$stats[$row['status_id']]['count'] = $row['count'];
}
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- include.php 2001/08/29 08:05:39 1.44
+++ include.php 2001/09/01 15:44:20 1.45
@@ -118,14 +118,17 @@
if (ENCRYPTPASS) {
$password = md5($password);
}
- $u = $q->grab("select * from auth_user where login = '$username' and password = '$password' and active > 0");
+ $u = $q->grab("select * from ".TBL_AUTH_USER." where login = '$username' and password = '$password' and active > 0");
if (!$q->num_rows()) {
return 'nobody';
} else {
$this->auth['db_fields'] = unserialize($u['bug_list_fields']);
// Grab group assignments and permissions based on groups
- $q->query("select group_name, perm_name from auth_perm ap, group_perm gp, auth_group ag, user_group ug where ap.perm_id = gp.perm_id and gp.group_id = ag.group_id and ag.group_id = ug.group_id and ug.user_id = {$u['user_id']}");
+ $q->query("select group_name, perm_name"
+ ." from ".TBL_AUTH_PERM." ap, ".TBL_GROUP_PERM." gp, ".TBL_AUTH_GROUP." ag, ".TBL_USER_GROUP." ug"
+ ." where ap.perm_id = gp.perm_id and gp.group_id = ag.group_id"
+ ." and ag.group_id = ug.group_id and ug.user_id = {$u['user_id']}");
while (list($group, $perm) = $q->grab()) {
$this->auth['perm'][$perm] = true;
$this->auth['group'][$group] = true;
@@ -196,9 +199,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 bug b left join status s using(status_id) where assigned_to = $u");
+ $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");
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 bug b left join status s using(status_id) where created_by = $u");
+ $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");
$this->set_var(array(
'loggedinas' => $auth->auth['uname'],
'liblock' => '',
@@ -259,14 +267,24 @@
function build_select($box, $value = '', $project = 0) {
global $q, $select;
+ //create hash to map tablenames
+ $cfgDatabase=array(
+ 'project' => TBL_PROJECT,
+ 'component' => TBL_COMPONENT,
+ 'status' => TBL_STATUS,
+ 'resolution' => TBL_RESOLUTION,
+ 'severity' => TBL_SEVERITY,
+ 'version' => TBL_VERSION
+ );
+
$text = '';
$queries = array(
- 'severity' => "select {$box}_id, {$box}_name from $box where sort_order > 0 order by sort_order",
- 'status' => "select {$box}_id, {$box}_name from $box where sort_order > 0 order by sort_order",
- 'resolution' => "select {$box}_id, {$box}_name from $box where sort_order > 0 order by sort_order",
- 'project' => "select {$box}_id, {$box}_name from $box where active = 1 order by {$box}_name",
- 'component' => "select {$box}_id, {$box}_name from $box where project_id = $project order by {$box}_name",
- 'version' => "select {$box}_id, {$box}_name from $box where project_id = $project order by {$box}_name"
+ 'severity' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
+ 'status' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
+ 'resolution' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
+ 'project' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where active = 0 order by {$box}_name",
+ 'component' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where project_id = $project order by {$box}_name",
+ 'version' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where project_id = $project order by {$box}_name"
);
switch($box) {
@@ -285,7 +303,7 @@
}
break;
case 'os' :
- $q->query("select {$box}_id, {$box}_name, regex from $box order by sort_order");
+ $q->query("select {$box}_id, {$box}_name, regex from ".TBL_OS." order by sort_order");
while ($row = $q->grab()) {
if ($value == '' and $row['Regex'] and
preg_match($row['Regex'],$GLOBALS['HTTP_USER_AGENT'])) $sel = ' selected';
@@ -296,7 +314,7 @@
}
break;
case 'owner' :
- $q->query("select user_id, email from auth_user where user_level > 1 order by email");
+ $q->query("select user_id, email from ".TBL_AUTH_USER." where user_level > 1 order by email");
while ($row = $q->grab()) {
if ($value == $row['user_id']) $sel = ' selected';
else $sel = '';
@@ -442,7 +460,7 @@
// Check to see if the user is trying to login
if (isset($HTTP_POST_VARS['dologin'])) {
if (isset($HTTP_POST_VARS['sendpass'])) {
- list($email, $password) = $q->grab("select email, password from auth_user where login = '$username' and active > 0");
+ list($email, $password) = $q->grab("select email, password from ".TBL_AUTH_USER." where login = '$username' and active > 0");
if (!$q->num_rows()) {
$t->set_var(array(
'loginerrorcolor' => '#ff0000',
@@ -452,7 +470,7 @@
if (ENCRYPTPASS) {
$password = genpassword(10);
$mpassword = md5($password);
- $q->query("update auth_user set password = '$mpassword' where login = '$username'");
+ $q->query("update ".TBL_AUTH_USER." set password = '$mpassword' where login = '$username'");
}
mail($email, $STRING['newacctsubject'], sprintf($STRING['newacctmessage'],
$password), sprintf("From: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n",ADMINEMAIL, $STRING['lang_charset']));
Index: index.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/index.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- index.php 2001/08/17 01:25:48 1.10
+++ index.php 2001/09/01 15:44:20 1.11
@@ -34,11 +34,11 @@
if (USE_JPGRAPH) {
$t->set_var('sblock', '<img src="images.php" align="right">');
} else {
- $q->query("select * from status order by sort_order");
+ $q->query("select * from ".TBL_STATUS." order by sort_order");
while ($row = $q->grab()) {
$stats[$row['status_id']]['name'] = $row['status_name'];
}
- $q->query("select status_id, count(status_id) as count from bug group by status_id");
+ $q->query("select status_id, count(status_id) as count from ".TBL_BUG." group by status_id");
while ($row = $q->grab()) {
$stats[$row['status_id']]['count'] = $row['count'];
}
Index: newaccount.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- newaccount.php 2001/08/29 08:05:39 1.14
+++ newaccount.php 2001/09/01 15:44:20 1.15
@@ -31,7 +31,7 @@
$error = $STRING['loginused'];
elseif (!$email or !valid_email($email))
$error = $STRING['giveemail'];
- elseif ($q->grab_field("select user_id from auth_user where email = '$email' or login = '$login'"))
+ elseif ($q->grab_field("select user_id from ".TBL_AUTH_USER." where email = '$email' or login = '$login'"))
$error = $STRING['loginused'];
if ($error) {
show_form($error);
@@ -47,8 +47,10 @@
}
if (EMAIL_IS_LOGIN) $login = $email;
$user_id = $q->nextid('user');
- $q->query("insert into auth_user (user_id, login, first_name, last_name, email, password, active, created_date, last_modified_date) values ($user_id, '$login', '$firstname', '$lastname', '$email', '$mpassword', 1, $now, $now)");
- $q->query("insert into user_group (user_id, group_id) select $user_id, group_id from auth_group where group_name = 'user'");
+ $q->query("insert into ".TBL_AUTH_USER." (user_id, login, first_name, last_name, email, password, active, created_date, last_modified_date)"
+ ." values ($user_id, '$login', '$firstname', '$lastname', '$email', '$mpassword', 1, $now, $now)");
+ $q->query("insert into ".TBL_USER_GROUP." (user_id, group_id)"
+ ." select $user_id, group_id from ".TBL_AUTH_GROUP." where group_name = 'user'");
mail($email, $STRING['newacctsubject'], sprintf($STRING['newacctmessage'],
$password), sprintf("From: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n",ADMINEMAIL, $STRING['lang_charset']));
$t->set_file('content','newaccountsuccess.html');
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- query.php 2001/09/01 14:59:42 1.25
+++ query.php 2001/09/01 15:44:20 1.26
@@ -26,7 +26,7 @@
function delete_saved_query($queryid) {
global $q, $u, $me;
- $q->query("delete from 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");
}
@@ -40,11 +40,11 @@
$t->set_block('savequeryblock','row','rows');
// Build the javascript-powered select boxes
- $q->query("select project_id, project_name from project where active order by project_name");
+ $q->query("select project_id, project_name from ".TBL_PROJECT." where active 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 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'),";
}
@@ -53,7 +53,7 @@
// Component array
$js .= "components['$pname'] = new Array(new Array('','All'),";
- $nq->query("select component_name, component_id from 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'),";
}
@@ -63,7 +63,7 @@
if ($u != 'nobody') {
// Grab the saved queries if there are any
- $q->query("select * from saved_query where user_id = '$u'");
+ $q->query("select * from ".TBL_SAVED_QUERY." where user_id = '$u'");
if (!$q->num_rows()) {
$t->set_var('rows','');
} else {
@@ -101,7 +101,7 @@
// Open bugs assigned to the user -- a hit list
if ($assignedto || $reportedby) {
- $q->query("select status_id from 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) {
@@ -113,7 +113,7 @@
// 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 ($os) $flags[] = 'bug.op_sys_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 ($flags) $query[] = '('.delimit_list(' or ',$flags).')';
@@ -168,11 +168,15 @@
// Save the query if requested
if ($savedqueryname) {
$savedquerystring = ereg_replace('&savedqueryname=.*(&?)', '\\1', $GLOBALS['QUERY_STRING']);
- $q->query("insert into saved_query (user_id, saved_query_name, saved_query_string) values ($u, '$savedqueryname', '$savedquerystring')");
+ $q->query("insert into ".TBL_SAVED_QUERY." (user_id, saved_query_name, saved_query_string)"
+ ." values ($u, '$savedqueryname', '$savedquerystring')");
}
if (!$order) { $order = 'bug_id'; $sort = 'asc'; }
if (!$querystring or $op) build_query($assignedto, $reportedby, $open);
- $nr = $q->grab_field("select count(*) from bug left join auth_user owner on bug.assigned_to = owner.user_id left join auth_user reporter on bug.created_by = reporter.user_id ".($querystring != '' ? "where $querystring": ''));
+ $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": ''));
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -185,7 +189,20 @@
'project' => build_select('project'),
'TITLE' => $TITLE['buglist']));
- $q->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 bug left join resolution using (resolution_id), severity, status, os, version, component, project left join auth_user owner on bug.assigned_to = owner.user_id left join auth_user reporter on bug.created_by = reporter.user_id left join 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 limit $llimit, $selrange");
+ $q->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 limit $llimit, $selrange");
$headers = array(
'bug_id' => 'bug_id',
Index: report.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/report.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- report.php 2001/08/25 18:39:11 1.14
+++ report.php 2001/09/01 15:44:20 1.15
@@ -34,7 +34,7 @@
$querystring = 'select email as "Assigned To", sum(if(resolution_id = "0",1,0)) as "Open"';
$resfields = array('Assigned To','Open');
// Grab the resolutions from the database
- $q->query("select resolution_name, concat(', sum(if(resolution_id = \"',resolution_id,'\",1,0)) as \"',resolution_name,'\"') from resolution");
+ $q->query("select resolution_name, concat(', sum(if(resolution_id = \"',resolution_id,'\",1,0)) as \"',resolution_name,'\"') from ".TBL_RESOLUTION);
while (list($fieldname, $countquery) = $q->grab()) {
$resfields[] = $fieldname;
$querystring .= $countquery;
@@ -47,7 +47,7 @@
$projectquery = '';
}
- $q->query("$querystring, count(bug_id) as 'Total' from bug b left join auth_user u on assigned_to = user_id $projectquery group by assigned_to");
+ $q->query("$querystring, count(bug_id) as 'Total' from ".TBL_BUG." b left join ".TBL_AUTH_USER." u on assigned_to = user_id $projectquery group by assigned_to");
if (!$q->num_rows()) {
$t->set_var('rows', 'No data to display');
} else {
@@ -86,7 +86,7 @@
$t->set_file('wrap','wrap.html');
$t->set_file('content','report.html');
$t->set_var(array(
- 'projects' => build_select('Project', $projectid),
+ 'projects' => build_select('project', $projectid),
'TITLE' => $TITLE['reporting']
));
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/user.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- user.php 2001/08/25 18:39:11 1.13
+++ user.php 2001/09/01 15:44:20 1.14
@@ -28,7 +28,7 @@
$auth->auth['db_fields'] = $column_list;
$column_list = serialize($column_list);
- $q->query("update auth_user set bug_list_fields = '$column_list' where user_id = $u");
+ $q->query("update ".TBL_AUTH_USER." set bug_list_fields = '$column_list' where user_id = $u");
//$t->set_file('content', 'columnlistchanged.html');
show_text('Your bug list column preferences have been saved');
}
@@ -50,7 +50,7 @@
$mpassword = $pass1;
}
- $q->query("update auth_user set password = '$mpassword' where user_id = $u");
+ $q->query("update ".TBL_AUTH_USER." set password = '$mpassword' where user_id = $u");
$t->set_file('content', 'passwordchanged.html');
}
|
|
From: Patrick M. <mo...@us...> - 2001-09-01 15:44:23
|
Update of /cvsroot/phpbt/phpbt/admin
In directory usw-pr-cvs1:/tmp/cvs-serv32304/admin
Modified Files:
component.php os.php project.php resolution.php severity.php
status.php user.php version.php
Log Message:
configurable tablenames
----------------------------------------------------------------------
Committing in .
Modified Files:
attachment.php bug.php config.php images.php include.php
index.php newaccount.php query.php report.php user.php
admin/component.php admin/os.php admin/project.php
admin/resolution.php admin/severity.php admin/status.php
admin/user.php admin/version.php
Added Files:
table_rename.sql
----------------------------------------------------------------------
Index: component.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/component.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- component.php 2001/08/23 01:39:03 1.10
+++ component.php 2001/09/01 15:44:20 1.11
@@ -41,7 +41,7 @@
if (!$componentid) {
$q->query("insert into component (component_id, project_id, component_name, component_desc, owner, active, created_by, created_date, last_modified_by, last_modified_date) values (".$q->nextid('component ').", $projectid, '$name', '$description', $owner, $active, $u, $time, $u, $time)");
} else {
- $q->query("update component set component_name = '$name', component_desc = '$description', owner = $owner, active = $active, last_modified_by = $u, last_modified_date = $time where component_id = '$componentid'");
+ $q->query("update ".TBL_COMPONENT." set component_name = '$name', component_desc = '$description', owner = $owner, active = $active, last_modified_by = $u, last_modified_date = $time where component_id = '$componentid'");
}
header("Location: project.php?op=edit&id=$projectid");
}
@@ -52,7 +52,10 @@
$t->set_file('content','componentform.html');
if ($componentid && !$error) {
- $row = $q->grab("select c.*, p.project_name as project_name from component c left join project p using (project_id) where component_id = '$componentid'");
+ $row = $q->grab("select c.*, p.project_name as project_name"
+ ." from ".TBL_COMPONENT." c"
+ ." left join ".TBL_PROJECT." p using (project_id)"
+ ." where component_id = '$componentid'");
$t->set_var(array(
'componentid' => $row['component_id'],
'projectid' => $row['project_id'],
@@ -72,7 +75,7 @@
'error' => $error,
'componentid' => $componentid,
'projectid' => $projectid,
- 'project' => $q->grab_field("select project_name from project where project_id = $projectid"),
+ 'project' => $q->grab_field("select project_name from ".TBL_PROJECT." where project_id = $projectid"),
'name' => $name,
'description' => $description,
'owner' => build_select('owner',$owner),
Index: os.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/os.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- os.php 2001/08/23 01:39:03 1.10
+++ os.php 2001/09/01 15:44:20 1.11
@@ -34,9 +34,9 @@
if ($error) { list_items($osid, $error); return; }
if (!$osid) {
- $q->query("insert into os (os_id, os_name, regex, sort_order) values (".$q->nextid('os').", '$fname', '$fregex', '$fsortorder')");
+ $q->query("insert into ".TBL_OS." (os_id, os_name, regex, sort_order) values (".$q->nextid('os').", '$fname', '$fregex', '$fsortorder')");
} else {
- $q->query("update os set os_name = '$fname', regex = '$fregex', sort_order = '$fsortorder' where os_id = '$osid'");
+ $q->query("update ".TBL_OS." set os_name = '$fname', regex = '$fregex', sort_order = '$fsortorder' where os_id = '$osid'");
}
header("Location: $me?");
}
@@ -46,7 +46,7 @@
#$t->set_file('content','osform.html');
if ($osid && !$error) {
- $row = $q->grab("select * from os where os_id = '$osid'");
+ $row = $q->grab("select * from ".TBL_OS." where os_id = '$osid'");
$t->set_var(array(
'action' => $STRING['edit'],
'fosid' => $row['os_id'],
@@ -72,7 +72,7 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from os where os_id = '$osid' order by $order $sort");
+ $nr = $q->query("select count(*) from ".TBL_OS." where os_id = '$osid' order by $order $sort");
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -83,7 +83,7 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from os order by $order $sort limit $llimit, $selrange");
+ $q->query("select * from ".TBL_OS." order by $order $sort limit $llimit, $selrange");
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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- project.php 2001/08/23 01:40:36 1.13
+++ project.php 2001/09/01 15:44:20 1.14
@@ -40,11 +40,13 @@
if (!$active) $active = 0;
if (!$projectid) {
$projectid = $q->nextid('project');
- $q->query("insert into project (project_id, project_name, project_desc, active, created_by, created_date) values ($projectid , '$name', '$description', $active, $u, $now)");
- $q->query("insert into version (version_id, project_id, version_name, active, created_by, created_date) values (".$q->nextid('version').", $projectid, '$version', $active, $u, $now)");
+ $q->query("insert into ".TBL_PROJECT." (project_id, project_name, project_desc, active, created_by, created_date)"
+ ." values ($projectid , '$name', '$description', $active, $u, $now)");
+ $q->query("insert into ".TBL_VERSION." (version_id, project_id, version_name, active, created_by, created_date)"
+ ." values (".$q->nextid('version').", $projectid, '$version', $active, $u, $now)");
$location = "component.php?op=add&projectid=$projectid";
} else {
- $q->query("update project set project_name = '$name', project_desc = '$description', active = $active where project_id = $projectid");
+ $q->query("update ".TBL_PROJECT." set project_name = '$name', project_desc = '$description', active = $active where project_id = $projectid");
$location = "$me?";
}
header("Location: $location");
@@ -57,7 +59,7 @@
$t->set_block('content','box','details');
$t->set_block('content','vfield','verfield');
if ($projectid && !$error) {
- $row = $q->grab("select * from project where project_id = $projectid");
+ $row = $q->grab("select * from ".TBL_PROJECT." where project_id = $projectid");
$t->set_var(array(
'projectid' => $row['project_id'],
'name' => $row['project_name'],
@@ -97,7 +99,7 @@
global $q, $t, $STRING;
$t->set_block('box','verrow','verrows');
- $q->query("select * from version where project_id = $projectid");
+ $q->query("select * from ".TBL_VERSION." where project_id = $projectid");
if (!$q->num_rows()) {
$t->set_var('verrows',"<tr><td colspan='2' align='center'>{$STRING['noversions']}</td></tr>");
return;
@@ -120,7 +122,7 @@
global $q, $t, $STRING;
$t->set_block('box','row','rows');
- $q->query("select * from component where project_id = $projectid");
+ $q->query("select * from ".TBL_COMPONENT." where project_id = $projectid");
if (!$q->num_rows()) {
$t->set_var('rows',"<tr><td colspan='2' align='center'>{$STRING['nocomponents']}</td></tr>");
return;
@@ -150,7 +152,7 @@
$t->set_block('content','row','rows');
if (!$order) { $order = '1'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from project");
+ $nr = $q->query("select count(*) from ".TBL_PROJECT);
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -163,7 +165,7 @@
'TITLE' => $TITLE['project']
));
- $q->query("select * from project order by $order $sort limit $llimit, $selrange");
+ $q->query("select * from ".TBL_PROJECT." order by $order $sort limit $llimit, $selrange");
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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- resolution.php 2001/08/23 01:39:03 1.11
+++ resolution.php 2001/09/01 15:44:20 1.12
@@ -36,9 +36,10 @@
if ($error) { list_items($resolutionid, $error); return; }
if (!$resolutionid) {
- $q->query("insert into resolution (resolution_id, resolution_name, resolution_desc, sort_order) values (".$q->nextid('resolution').", '$fname', '$fdescription', '$fsortorder')");
+ $q->query("insert into ".TBL_RESOLUTION." (resolution_id, resolution_name, resolution_desc, sort_order)"
+ ." values (".$q->nextid('resolution').", '$fname', '$fdescription', '$fsortorder')");
} else {
- $q->query("update 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?");
}
@@ -47,7 +48,7 @@
global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
if ($resolutionid && !$error) {
- $row = $q->grab("select * from 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'],
@@ -73,7 +74,7 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from 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");
@@ -84,7 +85,7 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from resolution order by $order $sort limit $llimit, $selrange");
+ $q->query("select * from ".TBL_RESOLUTION." order by $order $sort limit $llimit, $selrange");
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- severity.php 2001/08/23 01:39:03 1.4
+++ severity.php 2001/09/01 15:44:20 1.5
@@ -36,9 +36,9 @@
if ($error) { list_items($severityid, $error); return; }
if (!$severityid) {
- $q->query("insert into severity (severity_id, severity_name, severity_desc, sort_order, severity_color) values (".$q->nextid('severity').", '$fname', '$fdescription', '$fsortorder', '$fcolor')");
+ $q->query("insert into ".TBL_SEVERITY." (severity_id, severity_name, severity_desc, sort_order, severity_color) values (".$q->nextid('severity').", '$fname', '$fdescription', '$fsortorder', '$fcolor')");
} else {
- $q->query("update 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 +47,7 @@
global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
if ($severityid && !$error) {
- $row = $q->grab("select * from 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'],
@@ -75,7 +75,7 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from 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");
@@ -86,7 +86,7 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from severity order by $order $sort limit $llimit, $selrange");
+ $q->query("select * from ".TBL_SEVERITY." order by $order $sort limit $llimit, $selrange");
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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- status.php 2001/08/23 01:39:03 1.11
+++ status.php 2001/09/01 15:44:20 1.12
@@ -36,9 +36,9 @@
if ($error) { list_items($statusid, $error); return; }
if (!$statusid) {
- $q->query("insert into status (status_id, status_name, status_desc, sort_order) values (".$q->nextid('status').", '$fname', '$fdescription', '$fsortorder')");
+ $q->query("insert into ".TBL_STATUS." (status_id, status_name, status_desc, sort_order) values (".$q->nextid('status').", '$fname', '$fdescription', '$fsortorder')");
} else {
- $q->query("update 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 +47,7 @@
global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
if ($statusid && !$error) {
- $row = $q->grab("select * from 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 +73,7 @@
$t->set_block('content','row','rows');
if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from 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 +84,7 @@
'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
'records' => $nr));
- $q->query("select * from status order by $order $sort limit $llimit, $selrange");
+ $q->query("select * from ".TBL_STATUS." order by $order $sort limit $llimit, $selrange");
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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- user.php 2001/08/25 18:39:11 1.17
+++ user.php 2001/09/01 15:44:20 1.18
@@ -38,10 +38,10 @@
if (!$userid) {
if (ENCRYPTPASS) $mpassword = md5($fpassword);
else $mpassword = $fpassword;
- $q->query("insert into auth_user (user_id, first_name, last_name, email, password, user_level, created_date) values (".$q->nextid('user').", '$ffirstname', '$flastname', '$femail', '$mpassword', $usertype, $now)");
+ $q->query("insert into ".TBL_AUTH_USER." (user_id, first_name, last_name, email, password, user_level, created_date) values (".$q->nextid('user').", '$ffirstname', '$flastname', '$femail', '$mpassword', $usertype, $now)");
} else {
if (ENCRYPTPASS) {
- $oldpass = $q->grab_field("select password from auth_user where user_id = $userid");
+ $oldpass = $q->grab_field("select password from ".TBL_AUTH_USER." where user_id = $userid");
if ($oldpass != $fpassword) {
$pquery = "password = '".md5($fpassword)."',";
} else {
@@ -50,7 +50,7 @@
} else {
$pquery = "password = '$fpassword',";
}
- $q->query("update auth_user set first_name = '$ffirstname', last_name = '$flastname', email = '$femail', $pquery user_level = $usertype where user_id = '$userid'");
+ $q->query("update ".TBL_AUTH_USER." set first_name = '$ffirstname', last_name = '$flastname', email = '$femail', $pquery user_level = $usertype where user_id = '$userid'");
}
header("Location: $me?");
}
@@ -59,7 +59,7 @@
global $q, $me, $t, $firstname, $lastname, $email, $password, $usertype, $STRING;
if ($userid && !$error) {
- $row = $q->grab("select * from auth_user where user_id = '$userid'");
+ $row = $q->grab("select * from ".TBL_AUTH_USER." where user_id = '$userid'");
$t->set_var(array(
'action' => $STRING['edit'],
'fuserid' => $row['user_id'],
@@ -90,7 +90,7 @@
$t->set_block('content','row','rows');
if (!$order) { $order = '1'; $sort = 'asc'; }
- $nr = $q->grab_field("select count(*) from user");
+ $nr = $q->grab_field("select count(*) from ".TBL_AUTH_USER);
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -102,7 +102,7 @@
'records' => $nr));
$q->query("select user_id, concat(first_name,' ',last_name) as fullname, email,
- created_date, user_level from auth_user order by $order $sort
+ created_date, user_level from ".TBL_AUTH_USER." order by $order $sort
limit $llimit, $selrange");
if (!$q->num_rows()) {
Index: version.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/version.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- version.php 2001/08/23 01:39:03 1.11
+++ version.php 2001/09/01 15:44:20 1.12
@@ -35,9 +35,9 @@
if (!$active) $active = 0;
if (!$versionid) {
- $q->query("insert into version (version_id, project_id, version_name, active, created_by, created_date) values (".$q->nextid('version').", $projectid, '$version', '$active', $u, $now)");
+ $q->query("insert into ".TBL_VERSION." (version_id, project_id, version_name, active, created_by, created_date) values (".$q->nextid('version').", $projectid, '$version', '$active', $u, $now)");
} else {
- $q->query("update version set project_id = $projectid, version_name = '$version', active = '$active' where version_id = '$versionid'");
+ $q->query("update ".TBL_VERSION." set project_id = $projectid, version_name = '$version', active = '$active' where version_id = '$versionid'");
}
header("Location: project.php?op=edit&id=$projectid");
}
@@ -47,7 +47,9 @@
$t->set_file('content','versionform.html');
if ($versionid && !$error) {
- $row = $q->grab("select v.*, p.project_name as project_name from version v left join project p using(project_id) where version_id = '$versionid'");
+ $row = $q->grab("select v.*, p.project_name as project_name"
+ ." from ".TBL_VERSION." v left join ".TBL_PROJECT." p using(project_id)"
+ ." where version_id = '$versionid'");
$t->set_var(array(
'versionid' => $row['version_id'],
'projectid' => $row['project_id'],
@@ -62,7 +64,7 @@
'error' => $error,
'versionid' => $versionid,
'projectid' => $projectid,
- 'project' => $q->grab_field("select project_name from project where project_id = $projectid"),
+ 'project' => $q->grab_field("select project_name from ".TBL_PROJECT." where project_id = $projectid"),
'version' => $version,
'active' => $active ? ' checked' : '',
'TITLE' => $id ? $TITLE['editversion'] : $TITLE['addversion']));
|
|
From: Benjamin C. <bc...@us...> - 2001-09-01 14:59:46
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv22943
Modified Files:
query.php
Log Message:
Display the login field instead of email field
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- query.php 2001/08/25 18:39:11 1.24
+++ query.php 2001/09/01 14:59:42 1.25
@@ -185,7 +185,7 @@
'project' => build_select('project'),
'TITLE' => $TITLE['buglist']));
- $q->query("select bug.*, reporter.email as reporter, owner.email as owner, lastmodifier.email as lastmodifier, project_name, severity_name, status_name, os_name, version_name, component_name, resolution_name, severity_color from bug left join resolution using (resolution_id), severity, status, os, version, component, project left join auth_user owner on bug.assigned_to = owner.user_id left join auth_user reporter on bug.created_by = reporter.user_id left join 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 limit $llimit, $selrange");
+ $q->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 bug left join resolution using (resolution_id), severity, status, os, version, component, project left join auth_user owner on bug.assigned_to = owner.user_id left join auth_user reporter on bug.created_by = reporter.user_id left join 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 limit $llimit, $selrange");
$headers = array(
'bug_id' => 'bug_id',
|
|
From: Ben C. <php...@be...> - 2001-09-01 14:24:29
|
Well, a lot of times sourceforge just takes a while to catch up every server, so that may have been it. Congrats! On Sat, Sep 01, 2001 at 04:14:52PM +0200, Patrick Mairif wrote: > Hi, > > now I had luck! Today it works! :-) Don't know what went wrong! > > On Fri, Aug 31, 2001 at 08:13:08PM -0700, Ben Curtis wrote: > > Someone on the phplib-dev list was having a problem with sourceforge, and he suggested sshing into cvs.sourceforge.net. He said even though you won't be able to login it creates the needed dirs for you. Let me know if you have any luck -- otherwise we can submit a support request to the sourceforge staff. > > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Ben C. <php...@be...> - 2001-09-01 14:22:33
|
Yup, we do need some admin for this, but probably not a lot yet, for the simple reason we currently only have two groups and two perms. The most immediate need is to change user.php to remove the user_level select box and add a group multiple selection select box. Of course, this select box will only have two entries at the moment. With the user_level going away we need a check box for the active state, which of course should be checked upon page load if the user is active and not if not. I don't know that we need group or perm admin yet, since the code wouldn't support more groups or more perms. Thoughts? On Fri, Aug 31, 2001 at 07:23:44PM +0200, Javier Sixto wrote: > I was wondering how to manage new tables perms, auth (etc ..) .in the > admin part > The table schema permits to : > associet : > perms <-> groups > groups <-> users > users <-> perms > > But as you said , Ben, "we have enough to perms to worry about perms to > users" > > So they must be some new functions integrated into the admin section : > > -> add/delete perms > -> add/delete groups > -> associet perms <-> groups ... > => a new admin page for this functions, will be required. > (perms_groups.php ? groups.php ? pgroups.php ? :-) ) > > -> associet users <-> groups , this can be done on actual user page. > > suggestions? > > > > > > _______________________________________________ > phpbt-dev mailing list > php...@li... > http://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Patrick M. <mai...@st...> - 2001-09-01 14:14:41
|
Hi, now I had luck! Today it works! :-) Don't know what went wrong! On Fri, Aug 31, 2001 at 08:13:08PM -0700, Ben Curtis wrote: > Someone on the phplib-dev list was having a problem with sourceforge, and he suggested sshing into cvs.sourceforge.net. He said even though you won't be able to login it creates the needed dirs for you. Let me know if you have any luck -- otherwise we can submit a support request to the sourceforge staff. |
|
From: Ben C. <php...@be...> - 2001-09-01 03:14:03
|
Someone on the phplib-dev list was having a problem with sourceforge, and he suggested sshing into cvs.sourceforge.net. He said even though you won't be able to login it creates the needed dirs for you. Let me know if you have any luck -- otherwise we can submit a support request to the sourceforge staff. On Thu, Aug 30, 2001 at 11:33:07PM +0200, Patrick Mairif wrote: > no effect!? |
|
From: Javier S. <js...@si...> - 2001-08-31 17:24:26
|
I was wondering how to manage new tables perms, auth (etc ..) .in the admin part The table schema permits to : associet : perms <-> groups groups <-> users users <-> perms But as you said , Ben, "we have enough to perms to worry about perms to users" So they must be some new functions integrated into the admin section : -> add/delete perms -> add/delete groups -> associet perms <-> groups ... => a new admin page for this functions, will be required. (perms_groups.php ? groups.php ? pgroups.php ? :-) ) -> associet users <-> groups , this can be done on actual user page. suggestions? |
|
From: Benjamin C. <bc...@us...> - 2001-08-31 14:11:26
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv18758
Modified Files:
bug.php
Log Message:
DB changes
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- bug.php 2001/08/30 13:49:08 1.33
+++ bug.php 2001/08/31 04:25:07 1.34
@@ -301,7 +301,7 @@
'TITLE' => $TITLE['editbug'],
'title' => stripslashes($row['title']),
'description' => stripslashes($row['description']),
- 'url' => $row['URL'],
+ 'url' => $row['url'],
'urllabel' => $row['url'] ? "<a href='{$row['url']}'>URL</a>" : 'URL',
'severity' => build_select('severity',$row['severity_id']),
'priority' => build_select('priority',$row['priority']),
@@ -472,7 +472,7 @@
return;
case 1 :
$row = $q->grab();
- $project = $row['ProjectID'];
+ $project = $row['project_id'];
show_form();
break;
default :
@@ -482,8 +482,8 @@
while ($row = $q->grab()) {
$t->set_var(array(
'id' => $row['project_id'],
- 'name' => $row['name'],
- 'description' => $row['description'],
+ 'name' => $row['project_name'],
+ 'description' => $row['project_desc'],
'date' => date(DATEFORMAT,$row['created_date'])
));
$t->parse('rows','row',true);
|
|
From: Ben C. <php...@be...> - 2001-08-30 21:38:01
|
Hmm, any other suggestions anyone? On Thu, Aug 30, 2001 at 11:33:07PM +0200, Patrick Mairif wrote: > no effect!? > > > _______________________________________________ > phpbt-dev mailing list > php...@li... > http://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Patrick M. <mai...@st...> - 2001-08-30 21:33:15
|
no effect!? |
|
From: Ben C. <php...@be...> - 2001-08-30 21:23:39
|
Er, drop that first :.... CVS...@cv...:/cvsroot/phpbt On Thu, Aug 30, 2001 at 02:16:26PM -0700, Ben Curtis wrote: > I have my CVSROOT exported as bc...@cv...:/cvsroot/phpbt, so you might try exporting (or setenv, with csh) yours CVSROOT=:mo...@cv...:/cvsroot/phpbt and then try cvs -z3 co phpbt. > > On Thu, Aug 30, 2001 at 11:11:28PM +0200, Patrick Mairif wrote: > > > Hmm, I dunno if this will work, but try sshing to phpbt.sourceforge.net, > > > logging out, and then doing the checkout. > > > > ok, I logged in via ssh, he told me sth. that my homedir was created, I > > logged out, but nothing changed. > > > > the exact command I use it: > > cvs -z3 -d:ext:mo...@cv...:/cvsroot/phpbt co phpbt > > > > > > _______________________________________________ > > phpbt-dev mailing list > > php...@li... > > http://lists.sourceforge.net/lists/listinfo/phpbt-dev > > _______________________________________________ > phpbt-dev mailing list > php...@li... > http://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Ben C. <php...@be...> - 2001-08-30 21:16:34
|
I have my CVSROOT exported as bc...@cv...:/cvsroot/phpbt, so you might try exporting (or setenv, with csh) yours CVSROOT=:mo...@cv...:/cvsroot/phpbt and then try cvs -z3 co phpbt. On Thu, Aug 30, 2001 at 11:11:28PM +0200, Patrick Mairif wrote: > > Hmm, I dunno if this will work, but try sshing to phpbt.sourceforge.net, > > logging out, and then doing the checkout. > > ok, I logged in via ssh, he told me sth. that my homedir was created, I > logged out, but nothing changed. > > the exact command I use it: > cvs -z3 -d:ext:mo...@cv...:/cvsroot/phpbt co phpbt > > > _______________________________________________ > phpbt-dev mailing list > php...@li... > http://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Patrick M. <mai...@st...> - 2001-08-30 21:11:36
|
> Hmm, I dunno if this will work, but try sshing to phpbt.sourceforge.net, > logging out, and then doing the checkout. ok, I logged in via ssh, he told me sth. that my homedir was created, I logged out, but nothing changed. the exact command I use it: cvs -z3 -d:ext:mo...@cv...:/cvsroot/phpbt co phpbt |
|
From: Ben C. <php...@be...> - 2001-08-30 20:49:56
|
Hmm, I dunno if this will work, but try sshing to phpbt.sourceforge.net, logging out, and then doing the checkout. On Thu, Aug 30, 2001 at 10:46:37PM +0200, Patrick Mairif wrote: > the largest part of the work is done, but I cannot get write access. > checkout as anonymous was ok, but checking out as mohni via ssh does not > work. after entering my password I get the following error: > > Could not chdir to home directory /home/users/m/mo/mohni: No such file or > directory > cvs [server aborted]: can't chdir(/home/users/m/mo/mohni): No such file or > directory > > whhat does this mean? what can Id do? > > > _______________________________________________ > phpbt-dev mailing list > php...@li... > http://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Patrick M. <mai...@st...> - 2001-08-30 20:46:42
|
the largest part of the work is done, but I cannot get write access. checkout as anonymous was ok, but checking out as mohni via ssh does not work. after entering my password I get the following error: Could not chdir to home directory /home/users/m/mo/mohni: No such file or directory cvs [server aborted]: can't chdir(/home/users/m/mo/mohni): No such file or directory whhat does this mean? what can Id do? |