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...> - 2002-09-16 19:06:49
|
Update of /cvsroot/phpbt/phpbt/inc In directory usw-pr-cvs1:/tmp/cvs-serv30438/inc Removed Files: template.php Log Message: No longer needed --- template.php DELETED --- |
|
From: Benjamin C. <bc...@us...> - 2002-09-16 19:04:40
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv29716/templates/default
Modified Files:
bugform.html newaccount.html
Log Message:
Changing htmlentities to htmlspecialchars
Index: bugform.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugform.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- bugform.html 17 Jun 2002 15:08:56 -0000 1.7
+++ bugform.html 16 Sep 2002 19:04:35 -0000 1.8
@@ -18,11 +18,11 @@
</tr><tr>
<td align="right" valign="top">{$STRING.BUGFORM.Summary}:</td>
<td><input type="text" size="50" maxlength="100" name="title"
- value="{$title|stripslashes|htmlentities}"></td>
+ value="{$title|stripslashes|htmlspecialchars}"></td>
</tr><tr>
<td align="right" valign="top">{$STRING.BUGFORM.Description}:</td>
<td><textarea name="description" cols="50" rows="8"
- wrap=virtual>{$description|stripslashes|htmlentities}</textarea></td>
+ wrap=virtual>{$description|stripslashes|htmlspecialchars}</textarea></td>
</tr><tr>
<td align="right" valign="top">URL:</td>
<td><input type="text" size="30" maxlength="255" name="url" value="{$url}"></td>
Index: newaccount.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/newaccount.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- newaccount.html 18 May 2002 03:00:50 -0000 1.6
+++ newaccount.html 16 Sep 2002 19:04:36 -0000 1.7
@@ -11,24 +11,24 @@
<tr>
<td align="right">Login: </td>
<td>
- <input type="text" name="login" value="{$smarty.post.login|stripslashes|htmlentities}">
+ <input type="text" name="login" value="{$smarty.post.login|stripslashes|htmlspecialchars}">
</td>
</tr>
{/if}
<tr>
<td align="right">Email: </td>
- <td><input type="text" name="email" value="{$smarty.post.email|stripslashes|htmlentities}"></td>
+ <td><input type="text" name="email" value="{$smarty.post.email|stripslashes|htmlspecialchars}"></td>
</tr>
<tr>
<td align="right">First Name (optional):</td>
<td>
- <input type="text" name="firstname" value="{$smarty.post.firstname|stripslashes|htmlentities}">
+ <input type="text" name="firstname" value="{$smarty.post.firstname|stripslashes|htmlspecialchars}">
</td>
</tr>
<tr>
<td align="right">Last Name (optional):</td>
<td>
- <input type="text" name="lastname" value="{$smarty.post.lastname|stripslashes|htmlentities}">
+ <input type="text" name="lastname" value="{$smarty.post.lastname|stripslashes|htmlspecialchars}">
</td>
</tr>
</table>
|
|
From: Benjamin C. <bc...@us...> - 2002-09-16 19:04:39
|
Update of /cvsroot/phpbt/phpbt/templates/default/admin
In directory usw-pr-cvs1:/tmp/cvs-serv29716/templates/default/admin
Modified Files:
component-edit.html group-edit.html project-add.html
project-edit.html resolution-edit.html severity-edit.html
status-edit.html user-edit.html version-edit.html
Log Message:
Changing htmlentities to htmlspecialchars
Index: component-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/component-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- component-edit.html 18 May 2002 03:00:50 -0000 1.4
+++ component-edit.html 16 Sep 2002 19:04:30 -0000 1.5
@@ -12,7 +12,7 @@
Name:
</td>
<td valign="top">
- <input type="text" name="component_name" value="{$component_name|stripslashes|htmlentities}">
+ <input type="text" name="component_name" value="{$component_name|stripslashes|htmlspecialchars}">
</td>
</tr>
<tr>
@@ -20,7 +20,7 @@
Description:
</td>
<td valign="top">
- <textarea name="component_desc" cols="40" rows="10">{$component_desc|stripslashes|htmlentities}</textarea>
+ <textarea name="component_desc" cols="40" rows="10">{$component_desc|stripslashes|htmlspecialchars}</textarea>
</td>
</tr>
<tr>
Index: group-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/group-edit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- group-edit.html 18 May 2002 03:00:50 -0000 1.3
+++ group-edit.html 16 Sep 2002 19:04:30 -0000 1.4
@@ -11,7 +11,7 @@
{/if}
<tr>
<td align="right" valign="top">Name:</td>
- <td><input type="text" size="20" maxlength="40" name="group_name" value="{$group_name|stripslashes|htmlentities}"></td>
+ <td><input type="text" size="20" maxlength="40" name="group_name" value="{$group_name|stripslashes|htmlspecialchars}"></td>
</tr>
</table>
<br>
Index: project-add.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/project-add.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- project-add.html 18 May 2002 03:00:50 -0000 1.4
+++ project-add.html 16 Sep 2002 19:04:31 -0000 1.5
@@ -16,14 +16,14 @@
<td valign="top">
Name:
<br>
- <input type="text" size="30" maxlength="30" name="project_name" value="{$project_name|stripslashes|htmlentities}">
+ <input type="text" size="30" maxlength="30" name="project_name" value="{$project_name|stripslashes|htmlspecialchars}">
</td>
</tr>
<tr>
<td valign="top">
Description:
<br>
- <textarea name="project_desc" cols=40 rows=5 wrap=virtual>{$project_desc|stripslashes|htmlentities}</textarea>
+ <textarea name="project_desc" cols=40 rows=5 wrap=virtual>{$project_desc|stripslashes|htmlspecialchars}</textarea>
</td>
</tr>
<tr>
@@ -48,7 +48,7 @@
<td valign="top">
Initial Version:
<br>
- <input type="text" size="30" maxlength="30" name="version_name" value="{$version_name|stripslashes|htmlentities}">
+ <input type="text" size="30" maxlength="30" name="version_name" value="{$version_name|stripslashes|htmlspecialchars}">
</td>
</tr>
</table>
@@ -68,14 +68,14 @@
<td valign="top">
Initial Component Name:
<br>
- <input type="text" size="30" maxlength="30" name="component_name" value="{$component_name|stripslashes|htmlentities}">
+ <input type="text" size="30" maxlength="30" name="component_name" value="{$component_name|stripslashes|htmlspecialchars}">
</td>
</tr>
<tr>
<td valign="top">
Description:
<br>
- <textarea name="component_desc" cols="30">{$component_desc|stripslashes|htmlentities}</textarea>
+ <textarea name="component_desc" cols="30">{$component_desc|stripslashes|htmlspecialchars}</textarea>
</td>
</tr>
<tr>
Index: project-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/project-edit.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- project-edit.html 18 May 2002 03:00:50 -0000 1.10
+++ project-edit.html 16 Sep 2002 19:04:31 -0000 1.11
@@ -3,7 +3,7 @@
var me = '{$smarty.server.PHP_SELF}';
var projectId = '{$project_id}';
{literal}
-
+
function popupComponent(id) {
window.open(me + '?op=edit_component&project_id='+projectId+'&use_js=1&id='+id, 'ewin', 'dependent=yes,width=450,height=300,scrollbars=1');
return false;
@@ -30,7 +30,7 @@
<td valign="top" width="360">
Name:
<br>
- <input type="text" size="30" maxlength="30" name="project_name" value="{$project_name|stripslashes|htmlentities}">
+ <input type="text" size="30" maxlength="30" name="project_name" value="{$project_name|stripslashes|htmlspecialchars}">
</td>
<td valign="top" rowspan="3">
Only users in the following groups can see this project:
@@ -44,7 +44,7 @@
<td valign="top">
Description:
<br>
- <textarea name="project_desc" cols=40 rows=5 wrap=virtual>{$project_desc|stripslashes|htmlentities}</textarea>
+ <textarea name="project_desc" cols=40 rows=5 wrap=virtual>{$project_desc|stripslashes|htmlspecialchars}</textarea>
</td>
</tr>
<tr>
Index: resolution-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/resolution-edit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- resolution-edit.html 18 May 2002 03:00:50 -0000 1.3
+++ resolution-edit.html 16 Sep 2002 19:04:32 -0000 1.4
@@ -11,11 +11,11 @@
{/if}
<tr>
<td align="right" valign="top">Name:</td>
- <td><input type="text" size="20" maxlength="40" name="resolution_name" value="{$resolution_name|stripslashes|htmlentities}"></td>
+ <td><input type="text" size="20" maxlength="40" name="resolution_name" value="{$resolution_name|stripslashes|htmlspecialchars}"></td>
</tr>
<tr>
<td align="right" valign="top">Description:</td>
- <td><textarea name="resolution_desc" cols=20 rows=5 wrap=virtual>{$resolution_desc|stripslashes|htmlentities}</textarea></td>
+ <td><textarea name="resolution_desc" cols=20 rows=5 wrap=virtual>{$resolution_desc|stripslashes|htmlspecialchars}</textarea></td>
</tr>
<tr>
<td align="right" valign="top">Sort Order:</td>
Index: severity-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/severity-edit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- severity-edit.html 18 May 2002 03:00:50 -0000 1.3
+++ severity-edit.html 16 Sep 2002 19:04:33 -0000 1.4
@@ -11,11 +11,11 @@
{/if}
<tr>
<td align="right" valign="top">Name:</td>
- <td><input type="text" size="20" maxlength="40" name="severity_name" value="{$severity_name|stripslashes|htmlentities}"></td>
+ <td><input type="text" size="20" maxlength="40" name="severity_name" value="{$severity_name|stripslashes|htmlspecialchars}"></td>
</tr>
<tr>
<td align="right" valign="top">Description:</td>
- <td><textarea name="severity_desc" cols=20 rows=5 wrap=virtual>{$severity_desc|stripslashes|htmlentities}</textarea></td>
+ <td><textarea name="severity_desc" cols=20 rows=5 wrap=virtual>{$severity_desc|stripslashes|htmlspecialchars}</textarea></td>
</tr>
<tr>
<td align="right" valign="top">Sort Order:</td>
Index: status-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/status-edit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- status-edit.html 18 May 2002 03:00:50 -0000 1.3
+++ status-edit.html 16 Sep 2002 19:04:34 -0000 1.4
@@ -11,11 +11,11 @@
{/if}
<tr>
<td align="right" valign="top">Name:</td>
- <td><input type="text" size="20" maxlength="40" name="status_name" value="{$status_name|stripslashes|htmlentities}"></td>
+ <td><input type="text" size="20" maxlength="40" name="status_name" value="{$status_name|stripslashes|htmlspecialchars}"></td>
</tr>
<tr>
<td align="right" valign="top">Description:</td>
- <td><textarea name="status_desc" cols=20 rows=5 wrap=virtual>{$status_desc|stripslashes|htmlentities}</textarea></td>
+ <td><textarea name="status_desc" cols=20 rows=5 wrap=virtual>{$status_desc|stripslashes|htmlspecialchars}</textarea></td>
</tr>
<tr>
<td align="right" valign="top">Sort Order:</td>
Index: user-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/user-edit.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- user-edit.html 18 May 2002 03:00:50 -0000 1.2
+++ user-edit.html 16 Sep 2002 19:04:34 -0000 1.3
@@ -2,11 +2,11 @@
<!--
var hadAdmin = {$hadadmin};
var numAdmins = {$numadmins};
-
+
{literal}
function checkAdmin(slct) {
var adminSelected = false;
-
+
if (hadAdmin && numAdmins == 1) {
for (current = 0; current < slct.options.length; current++ ) {
if (slct.options[current].selected && slct.options[current].value == 1) {
@@ -45,11 +45,11 @@
</tr>
<tr>
<td align="right" valign="top">FirstName:</td>
- <td><input type="text" size="20" maxlength="40" name="first_name" value="{$first_name|stripslashes|htmlentities}"></td>
+ <td><input type="text" size="20" maxlength="40" name="first_name" value="{$first_name|stripslashes|htmlspecialchars}"></td>
</tr>
<tr>
<td align="right" valign="top">LastName:</td>
- <td><input type="text" size="20" maxlength="40" name="last_name" value="{$last_name|stripslashes|htmlentities}"></td>
+ <td><input type="text" size="20" maxlength="40" name="last_name" value="{$last_name|stripslashes|htmlspecialchars}"></td>
</tr>
<tr>
<td align="right" valign="top">Password:</td>
Index: version-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/version-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- version-edit.html 18 May 2002 03:00:51 -0000 1.4
+++ version-edit.html 16 Sep 2002 19:04:34 -0000 1.5
@@ -12,7 +12,7 @@
Name:
</td>
<td valign="top">
- <input type="text" name="version_name" value="{$version_name|stripslashes|htmlentities}">
+ <input type="text" name="version_name" value="{$version_name|stripslashes|htmlspecialchars}">
</td>
</tr>
<tr>
@@ -30,4 +30,4 @@
</tr>
</table>
</form>
-
+
|
|
From: Ben C. <php...@be...> - 2002-09-14 19:35:48
|
I changed this table to match the other lookup tables so I could remove some redundant code. I also changed the schemas, but if you want to update your working database you can use the following (mysql) queries: update database_server set database_name = concat(database_name,' ', database_version); alter table database_server drop database_version; |
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:31:26
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv1879/templates/default
Modified Files:
bugdisplay.html
Log Message:
Fixes bug #559997 - Show the posted values instead of the database values when showing the form after a submission with errors.
Index: bugdisplay.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugdisplay.html,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- bugdisplay.html 13 Sep 2002 19:11:29 -0000 1.39
+++ bugdisplay.html 14 Sep 2002 19:31:23 -0000 1.40
@@ -138,7 +138,7 @@
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td valign="top">{$STRING.BUGDISPLAY.AdditionalComments}:<br><br>
- <textarea name="comments" rows="6" cols="55" wrap="virtual"></textarea>
+ <textarea name="comments" rows="6" cols="55" wrap="virtual">{$smarty.post.comments}</textarea>
<br><br>
<div align="right">
{if $smarty.session.uid}
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:31:26
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv1879
Modified Files:
bug.php
Log Message:
Fixes bug #559997 - Show the posted values instead of the database values when showing the form after a submission with errors.
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- bug.php 14 Sep 2002 19:06:30 -0000 1.116
+++ bug.php 14 Sep 2002 19:31:22 -0000 1.117
@@ -597,7 +597,7 @@
}
function show_bug($bugid = 0, $error = array()) {
- global $db, $me, $t, $STRING, $TITLE, $u, $_gv, $QUERY, $restricted_projects;
+ global $db, $me, $t, $STRING, $TITLE, $u, $_gv, $_pv, $QUERY, $restricted_projects;
if (!ereg('^[0-9]+$',$bugid) or
!$row = $db->getRow(sprintf($QUERY['bug-show-bug'], $bugid,
@@ -607,7 +607,11 @@
}
prev_next_links($bugid, isset($_gv['pos']) ? $_gv['pos'] : 0);
+
$t->assign($row);
+ // Override the database values with posted values if there were errors
+ if (count($error)) $t->assign($_pv);
+
$t->assign(array(
'error' => $error,
'already_voted' => $db->getOne("select count(*) from ".TBL_BUG_VOTE.
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:14:16
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv30244 Modified Files: CHANGELOG Log Message: Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- CHANGELOG 3 Aug 2002 18:56:54 -0000 1.58 +++ CHANGELOG 14 Sep 2002 19:14:12 -0000 1.59 @@ -1,13 +1,17 @@ -- 0.9.0 -- : Replaced the mail function with one that encodes (i18n support). -: Added four additional fields for tracking bug information: Database type +: Added four additional fields for tracking bug information: Database type and version, Environment, Closed Version, To-be-closed Version. : Removed English text from templates for better localization. : Added option for sending emails MIME-encapsulated. -: Cleaned up HTML -: Added list of saved queries to the home page and an option to disable that +: Cleaned up HTML. +: Added list of saved queries to the home page and an option to disable that list. : Updated translations. +: Cleaned up printing of bug detail page. +: Added required files from PEAR (DB.php, etc.) to the distribution. +: Improved compatibility with IIS. +: Fixed various small bugs. -- 0.8.2 -- 8 May 2002 : Fixed bugs with ordering by dates in the bug list, self-referencing URLs @@ -82,9 +86,9 @@ : Fixed a rendering problem with bug comments. : Added the ability to create user groups and restrict project visibility based on those groups. -: When a bug is filed against a component with an owner, that owner will be +: When a bug is filed against a component with an owner, that owner will be assigned the bug and receive an email about the bug. -: Fixed a bug preventing users from being assigned to the User group when +: Fixed a bug preventing users from being assigned to the User group when created. : Fixed a bug with the download option of the installation process. : Change the label on the login box from Email to Login if configuration @@ -97,7 +101,7 @@ -- 0.5.0 -- 9 Nov 2001 : Fixed a bug with the bug history update. : Added web-based installation. -: Added on option for choosing whether bugs can be changed by anyone or only by +: Added on option for choosing whether bugs can be changed by anyone or only by the bug reporter, bug owner, managers, or admins. : Added a printable view for bugs. : Added an upgrade script to upgrade from the last major version. @@ -115,7 +119,7 @@ -- 0.3.3 -- 2 Oct 2001 : Added the ability to enter cvs:filename.ext or cvs:path/filename.ext:v.vv into the bug comments and have that linked to a CVS web interface. -: Fixed bugs with project administration, account creation, and the initial +: Fixed bugs with project administration, account creation, and the initial database installation. -- 0.3.2 -- 28 Sep 2001 |
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:06:32
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv28419
Modified Files:
bug.php
Log Message:
Removed code made unnecessary by alteration of database_server table. Fixed a bug with submitting changes to a bug that is the only bug resulting from a query.
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- bug.php 14 Sep 2002 18:11:34 -0000 1.115
+++ bug.php 14 Sep 2002 19:06:30 -0000 1.116
@@ -159,48 +159,31 @@
);
foreach($cfgDatabase as $field => $table) {
- switch ($field) {
- case 'database':
- if ($buginfo[$field.'_id']) {
- $db_oldvalue = $db->getRow('select '.$field.'_name, '.$field.'_version from '.$table.
- ' where '.$field.'_id = '.$buginfo[$field.'_id']);
- $oldvalue = $db_oldvalue[$field.'_name'].' '.$db_oldvalue[$field.'_version'];
- } else {
- $oldvalue = 'None';
- }
-
- if (!empty($cf[$field.'_id'])) {
- $db_newvalue = $db->getRow('select '.$field.'_name, '.$field.'_version from '.$table.
- ' where '.$field.'_id = '.$cf[$field.'_id']);
- $newvalue = $db_newvalue[$field.'_name'].' '.$db_newvalue[$field.'_version'];
- } else {
- $newvalue = 'None';
- }
- break;
- default:
+ if (isset($buginfo[$field.'_id'])) {
$oldvalue = $db->getOne("select ${field}_name from $table".
" where ${field}_id = {$buginfo[$field.'_id']}");
- if (!empty($cf[$field.'_id'])) {
- $newvalue = $db->getOne("select ${field}_name from $table".
- " where ${field}_id = {$cf[$field.'_id']}");
- }
- break;
}
- if (!empty($cf[$field.'_id'])) {
+ if (empty($oldvalue)) $oldvalue = 'None';
+
+ if (isset($cf[$field.'_id'])) {
+ $newvalue = $db->getOne("select ${field}_name from $table".
+ " where ${field}_id = {$cf[$field.'_id']}");
+ if (empty($newvalue)) $newvalue = 'None';
+
$db->query('insert into '.TBL_BUG_HISTORY.
- ' (bug_id, changed_field, old_value, new_value, created_by, created_date)'.
+ ' (bug_id, changed_field, old_value, new_value, created_by, created_date)'.
" values (". join(', ', array($buginfo['bug_id'], $db->quote($field),
- $db->quote(stripslashes($oldvalue)),
- $db->quote(stripslashes($newvalue)), $u, $now)).")");
+ $db->quote(stripslashes($oldvalue)),
+ $db->quote(stripslashes($newvalue)), $u, $now)).")");
$t->assign(array(
- $field.'_id' => stripslashes($newvalue),
- $field.'_id_stat' => '!'
- ));
+ $field.'_id' => stripslashes($newvalue),
+ $field.'_id_stat' => '!'
+ ));
} else {
$t->assign(array(
- $field.'_id' => stripslashes($oldvalue),
- $field.'_id_stat' => ' '
- ));
+ $field.'_id' => stripslashes($oldvalue),
+ $field.'_id_stat' => ' '
+ ));
}
}
@@ -209,28 +192,31 @@
'closed_in_version' => 'closed in version');
foreach($versions as $field => $field_name) {
- if ($buginfo[$field.'_id']) {
+ if (isset($buginfo[$field.'_id'])) {
$oldvalue = $db->getOne('select version_name from '.$cfgDatabase['version'].
' where version_id = '.$buginfo[$field.'_id']);
}
+ if (empty($oldvalue)) $oldvalue = 'None';
- if (!empty($cf[$field.'_id'])) {
+ if (isset($cf[$field.'_id'])) {
$newvalue = $db->getOne('select version_name from '.$cfgDatabase['version'].
- ' where version_id = '.$cf[$field.'_id']);
+ ' where version_id = '.$cf[$field.'_id']);
+ if (empty($newvalue)) $newvalue = 'None';
+
$db->query('insert into '.TBL_BUG_HISTORY.
- ' (bug_id, changed_field, old_value, new_value, created_by, created_date)'.
+ ' (bug_id, changed_field, old_value, new_value, created_by, created_date)'.
" values (". join(', ', array($buginfo['bug_id'], $db->quote($field_name),
- $db->quote(stripslashes($oldvalue)),
- $db->quote(stripslashes($newvalue)), $u, $now)).")");
+ $db->quote(stripslashes($oldvalue)),
+ $db->quote(stripslashes($newvalue)), $u, $now)).")");
$t->assign(array(
- $field.'_id' => stripslashes($newvalue),
- $field.'_id_stat' => '!'
- ));
+ $field.'_id' => stripslashes($newvalue),
+ $field.'_id_stat' => '!'
+ ));
} else {
$t->assign(array(
- $field.'_id' => stripslashes($oldvalue),
- $field.'_id_stat' => ' '
- ));
+ $field.'_id' => stripslashes($oldvalue),
+ $field.'_id_stat' => ' '
+ ));
}
}
@@ -586,7 +572,7 @@
$offset = $pos - 1;
$limit = 2;
} else {
- $offset = $pos;
+ $offset = 0;
$limit = 1;
}
$rs = $db->limitQuery(sprintf($QUERY['bug-prev-next'],
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:03:58
|
Update of /cvsroot/phpbt/phpbt/inc
In directory usw-pr-cvs1:/tmp/cvs-serv27733/inc
Modified Files:
functions.php
Log Message:
Dropped the database_version field from the database_server table so it will match the other lookup tables
Index: functions.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- functions.php 18 Jul 2002 13:02:15 -0000 1.33
+++ functions.php 14 Sep 2002 19:03:48 -0000 1.34
@@ -51,7 +51,7 @@
if (!isset($selected)) {
$selected = '';
}
-
+
// create hash to map tablenames
$cfgDatabase = array(
'group' => TBL_AUTH_GROUP,
@@ -86,12 +86,12 @@
" order by {$box}_name",
'component' => $querystart." where project_id = $project and active = 1 order by {$box}_name",
'version' => $querystart." where project_id = $project and active = 1 order by {$box}_id desc",
- 'database' => "select {$box}_id, {$box}_name, {$box}_version from $cfgDatabase[$box]".$querymid
+ 'database' => $querystart.$querymid
);
}
-
+
switch($box) {
- case 'user_filter':
+ case 'user_filter':
foreach ($STRING['user_filter'] as $k => $v) {
$text .= sprintf("<option value=\"%d\"%s>%s</option>",
$k, ($k == $selected ? ' selected' : ''), $v);
@@ -117,6 +117,7 @@
$row[$box.'_id']."\"$sel>".$row[$box.'_name'].'</option>';
}
break;
+ case 'database': $text = '<option value="0">None</option>';
case 'severity':
case 'status':
case 'resolution':
@@ -135,19 +136,6 @@
$row[$box.'_id']."\"$sel>".$row[$box.'_name'].'</option>';
}
break;
- case 'database':
- $text = '<option value="0">None</option>';
- $rs = $db->query($queries[$box]);
- while ($rs->fetchInto($row)) {
- if ($selected == $row[$box.'_id'] and $selected != '') {
- $sel = ' selected';
- } else {
- $sel = '';
- }
- $text .= '<option value="'.
- $row[$box.'_id'].'"'.$sel.'>'.$row[$box.'_name'].' '.$row[$box.'_version'].'</option>';
- }
- break;
case 'os':
$rs = $db->query("select {$box}_id, {$box}_name, regex from ".TBL_OS." where sort_order > 0 order by sort_order");
while ($rs->fetchInto($row)) {
@@ -244,14 +232,14 @@
case 'BUG_ASSIGNED' :
case 'BUG_REOPENED' :
static $bug_status_list = array();
-
+
if (empty($bug_status_list)) {
$bug_status_list = $db->getAssoc("select status_id, status_name".
" from ".TBL_STATUS." order by status_name");
}
foreach ($bug_status_list as $id => $name) {
$sel = $id == $selected ? ' selected' : '';
- $text .= "<option value=\"$id\"$sel>$name</option>";
+ $text .= "<option value=\"$id\"$sel>$name</option>";
}
break;
default :
@@ -400,16 +388,16 @@
/// Build the javascript for the dynamic project -> component -> version select boxes
function build_project_js($params) {
global $db, $u, $perm, $_sv, $QUERY;
-
+
extract($params);
$js = ''; $js2 = '';
-
+
// Build the javascript-powered select boxes
if ($perm->have_perm('Admin')) {
$rs = $db->query("select project_id, project_name from ".TBL_PROJECT.
" where active = 1 order by project_name");
} else {
- $rs = $db->query(sprintf($QUERY['functions-project-js'],
+ $rs = $db->query(sprintf($QUERY['functions-project-js'],
delimit_list(',', $_sv['group_ids'])));
}
while (list($pid, $pname) = $rs->fetchRow(DB_FETCHMODE_ORDERED)) {
@@ -418,7 +406,7 @@
$js .= "versions['$pname'] = new Array(".
((!isset($no_all) or !$no_all) ? "new Array('','All')," : '');
$js2 = "closedversions['$pname'] = new Array(".
- ((!isset($no_all) or !$no_all) ? "new Array('','All'),"
+ ((!isset($no_all) or !$no_all) ? "new Array('','All'),"
: "new Array(0, 'Choose One'),");
$rs2 = $db->query("select version_name, version_id from ".TBL_VERSION.
" where project_id = $pid and active = 1");
@@ -432,7 +420,7 @@
if (substr($js2,-1) == ',') $js2 = substr($js2,0,-1);
$js2 .= ");\n";
$js .= $js2;
-
+
// Component array
$js .= "components['$pname'] = new Array(";
$js .= (!isset($no_all) || !$no_all) ? "new Array('','All')," : '';
@@ -452,7 +440,7 @@
/// Database concat
function db_concat() {
$pieces = func_get_args();
-
+
switch(DB_TYPE) {
case 'mysql' : $retstr = 'concat('. delimit_list(', ', $pieces).')'; break;
case 'pgsql' :
@@ -500,7 +488,7 @@
// Do "dos2unix" and split $input into $lines by end of line
$lines = split("\n", str_replace("\r\n", "\n", $input));
// Loop throught $lines
- while( list(, $line) = each($lines) ) {
+ while( list(, $line) = each($lines) ) {
// Trim each line from right side
$line = rtrim($line);
// Place line length to $linlen
@@ -549,7 +537,7 @@
// There have to be no newline at the end of $headers
}
$headers .= "Content-Type: text/plain; charset=\"".$STRING['lang_charset']."\"\nContent-Transfer-Encoding: ";
-
+
// If configured to send MIME encoded emails
if (SEND_MIME_EMAIL) {
$retval = mail ($to, $subject, qp_enc($body), $headers.
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:03:57
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv27733
Modified Files:
upgrade.php
Log Message:
Dropped the database_version field from the database_server table so it will match the other lookup tables
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- upgrade.php 4 Aug 2002 16:29:01 -0000 1.23
+++ upgrade.php 14 Sep 2002 19:03:48 -0000 1.24
@@ -29,7 +29,7 @@
function upgrade() {
global $db;
-
+
$upgraded = $db->getOne('select varname from '.TBL_CONFIGURATION.' where varname = \'BUG_UNCONFIRMED\'');
if (!$upgraded or DB::isError($upgraded)) {
if (!@is_writeable('c_templates')) {
@@ -46,21 +46,21 @@
$db->query("create table ".TBL_SITE." (site_id int unsigned NOT NULL default '0', site_name varchar(50) NOT NULL default '', sort_order tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (site_id))");
$db->query("create table ".TBL_SITE."_seq (id int unsigned auto_increment not null primary key)");
$db->query("insert into ".TBL_SITE."_seq values (4)");
- $db->query("create table ".TBL_DATABASE." (database_id int(10) unsigned NOT NULL default '0', database_name varchar(30) NOT NULL default '', database_version varchar(10) NOT NULL default '', sort_order tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (database_id))");
+ $db->query("create table ".TBL_DATABASE." (database_id int(10) unsigned NOT NULL default '0', database_name varchar(40) NOT NULL default '', sort_order tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (database_id))");
$db->query("create table ".TBL_DATABASE."_seq (id int unsigned auto_increment not null primary key)");
$db->query("insert into ".TBL_DATABASE."_seq values (3)");
break;
case 'oci8' :
break;
}
-
+
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('SEND_MIME_EMAIL', '1', 'Whether to use MIME quoted-printable encoded emails or not', 'bool')");
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('BUG_UNCONFIRMED', '1', 'The status to assign a bug when it is first submitted.', 'multi')");
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('BUG_PROMOTED', '2', 'The status to assign a bug when it is promoted (if enabled).', 'multi')");
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('BUG_ASSIGNED', '3', 'The status to assign a bug when it is assigned.', 'multi')");
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('BUG_REOPENED', '4', 'The status to assign a bug when it is reopened.', 'multi')");
$db->query("INSERT INTO ".TBL_SITE." VALUES (0,'All',1), (1,'Development',2), (2,'Testing',3), (3,'Staging',4), (4,'Production',5)");
- $db->query("INSERT INTO ".TBL_DATABASE." VALUES (1,'Oracle','8.1.7',1), (2,'MySQL','3.23.49',2), (3,'PostgreSQL','7.1.3',3");
+ $db->query("INSERT INTO ".TBL_DATABASE." VALUES (1,'Oracle 8.1.7',1), (2,'MySQL 3.23.49',2), (3,'PostgreSQL 7.1.3',3");
}
include 'templates/default/upgrade-finished.html';
}
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:03:57
|
Update of /cvsroot/phpbt/phpbt/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv27733/schemas
Modified Files:
mysql.in oci8.in pgsql.in
Log Message:
Dropped the database_version field from the database_server table so it will match the other lookup tables
Index: mysql.in
===================================================================
RCS file: /cvsroot/phpbt/phpbt/schemas/mysql.in,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mysql.in 18 Jul 2002 13:02:15 -0000 1.33
+++ mysql.in 14 Sep 2002 19:03:48 -0000 1.34
@@ -257,8 +257,7 @@
CREATE TABLE TBL_DATABASE (
database_id tinyint(3) unsigned NOT NULL default '0',
- database_name varchar(30) NOT NULL default '',
- database_version varchar(10) NOT NULL default '',
+ database_name varchar(40) NOT NULL default '',
sort_order tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (database_id)
) TYPE=MyISAM;
@@ -274,9 +273,9 @@
# -- Insert initial data --
#
-INSERT INTO TBL_AUTH_USER
+INSERT INTO TBL_AUTH_USER
(user_id, login, first_name, last_name, email, password)
- values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
+ values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
'OPTION_ADMIN_PASS');
create table TBL_AUTH_USER_seq (id int unsigned auto_increment not null primary key);
insert into TBL_AUTH_USER_seq values (1);
@@ -288,7 +287,7 @@
create table TBL_AUTH_GROUP_seq (id int unsigned auto_increment not null primary key);
insert into TBL_AUTH_GROUP_seq values (3);
-# ... and only two permissions
+# ... and only two permissions
INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin');
INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug');
@@ -396,9 +395,9 @@
create table TBL_STATUS_seq (id int unsigned auto_increment not null primary key);
insert into TBL_STATUS_seq values (7);
-INSERT INTO TBL_DATABASE VALUES (1,'Oracle','8.1.7',1);
-INSERT INTO TBL_DATABASE VALUES (2,'MySQL','3.23.49',2);
-INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL','7.1.3',3);
+INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1);
+INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2);
+INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3);
create table TBL_DATABASE_seq (id int unsigned auto_increment not null primary key);
insert into TBL_DATABASE_seq values (3);
Index: oci8.in
===================================================================
RCS file: /cvsroot/phpbt/phpbt/schemas/oci8.in,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- oci8.in 18 Jul 2002 13:02:15 -0000 1.17
+++ oci8.in 14 Sep 2002 19:03:48 -0000 1.18
@@ -50,7 +50,7 @@
created_date number(20) default '0' ,
last_modified_by number(10) default '0' ,
last_modified_date number(20) default '0' ,
- PRIMARY KEY (user_id)
+ PRIMARY KEY (user_id)
) ;
CREATE TABLE TBL_BUG (
@@ -91,16 +91,16 @@
CREATE TABLE TBL_BUG_DEPENDENCY (
bug_id number(10) default '0' NOT NULL,
depends_on number(10) default '0' NOT NULL,
- PRIMARY KEY (bug_id ,depends_on)
+ PRIMARY KEY (bug_id ,depends_on)
) ;
CREATE TABLE TBL_BUG_GROUP (
bug_id number(10) default '0' NOT NULL,
group_id number(10) default '0' NOT NULL,
- PRIMARY KEY (bug_id ,group_id)
+ PRIMARY KEY (bug_id ,group_id)
) ;
-CREATE INDEX GROUPIDX ON TBL_BUG_GROUP ( group_id );
+CREATE INDEX GROUPIDX ON TBL_BUG_GROUP ( group_id );
CREATE TABLE TBL_BUG_HISTORY (
bug_id number(10) default '0' NOT NULL,
@@ -115,7 +115,7 @@
user_id number(10) default '0' NOT NULL,
bug_id number(10) default '0' NOT NULL,
created_date number(20) default '0' NOT NULL,
- PRIMARY KEY (user_id , bug_id)
+ PRIMARY KEY (user_id , bug_id)
) ;
CREATE INDEX BUGIDX ON TBL_BUG_VOTE ( bug_id );
@@ -154,7 +154,7 @@
CREATE TABLE TBL_GROUP_PERM (
group_id number(10) default '0' NOT NULL,
perm_id number(10) default '0' NOT NULL,
- PRIMARY KEY (group_id ,perm_id)
+ PRIMARY KEY (group_id ,perm_id)
) ;
CREATE INDEX PERMIDX ON TBL_GROUP_PERM ( perm_id );
@@ -184,7 +184,7 @@
group_id number(10) default '0' NOT NULL,
created_by number(10) default '0' NOT NULL,
created_date number(20) default '0' NOT NULL,
- PRIMARY KEY (project_id ,group_id)
+ PRIMARY KEY (project_id ,group_id)
) ;
CREATE INDEX GROUPPROJIDX ON TBL_PROJECT_GROUP ( group_id );
@@ -227,7 +227,7 @@
group_id number(10) default '0' NOT NULL,
created_by number(10) default '0' NOT NULL,
created_date number(20) default '0' NOT NULL,
- PRIMARY KEY (user_id ,group_id)
+ PRIMARY KEY (user_id ,group_id)
) ;
CREATE INDEX GROUPUSERIDX ON TBL_USER_GROUP ( group_id );
@@ -237,7 +237,7 @@
perm_id number(10) default '0' NOT NULL,
created_by number(10) default '0' NOT NULL,
created_date number(20) default '0' NOT NULL,
- PRIMARY KEY (user_id ,perm_id)
+ PRIMARY KEY (user_id ,perm_id)
) ;
CREATE INDEX PERMUSERIDX ON TBL_USER_PERM ( perm_id );
@@ -262,8 +262,7 @@
CREATE TABLE TBL_DATABASE (
database_id number(3) default '0' NOT NULL,
- database_name varchar2(30) default '' NOT NULL,
- database_version varchar2(10) default '' NOT NULL,
+ database_name varchar2(40) default '' NOT NULL,
sort_order number(3) default '0' NOT NULL,
PRIMARY KEY (database_id)
);
@@ -275,9 +274,9 @@
PRIMARY KEY (site_id)
);
-INSERT INTO TBL_AUTH_USER
+INSERT INTO TBL_AUTH_USER
(user_id, login, first_name, last_name, email, password)
- values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
+ values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
'OPTION_ADMIN_PASS');
CREATE SEQUENCE TBL_AUTH_USER_seq START WITH 2 NOCACHE;
@@ -287,7 +286,7 @@
INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1);
CREATE SEQUENCE TBL_AUTH_GROUP_seq START WITH 4 NOCACHE;
--- ... and only two permissions
+-- ... and only two permissions
INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin');
INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug');
@@ -299,7 +298,7 @@
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1);
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2);
--- Add user's prefs as default values for all users defined so far (only admin)
+-- Add user's prefs as default values for all users defined so far (only admin)
INSERT INTO TBL_USER_PREF (user_id) values (1);
INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string');
@@ -391,9 +390,9 @@
INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7);
CREATE SEQUENCE TBL_STATUS_seq START WITH 8 NOCACHE;
-INSERT INTO TBL_DATABASE VALUES (1,'Oracle','8.1.7',1);
-INSERT INTO TBL_DATABASE VALUES (2,'MySQL','3.23.49',2);
-INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL','7.1.3',3);
+INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1);
+INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2);
+INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3);
CREATE SEQUENCE TBL_DATABASE_seq START WITH 4 NOCACHE;
INSERT INTO TBL_SITE VALUES (0,'All',1);
Index: pgsql.in
===================================================================
RCS file: /cvsroot/phpbt/phpbt/schemas/pgsql.in,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- pgsql.in 18 Jul 2002 13:02:15 -0000 1.34
+++ pgsql.in 14 Sep 2002 19:03:48 -0000 1.35
@@ -255,8 +255,7 @@
CREATE TABLE TBL_DATABASE (
database_id INT2 NOT NULL DEFAULT '0',
- database_name varchar(30) NOT NULL DEFAULT '',
- database_version varchar(10) NOT NULL DEFAULT '',
+ database_name varchar(40) NOT NULL DEFAULT '',
sort_order INT2 NOT NULL DEFAULT '0',
PRIMARY KEY (database_id)
);
@@ -272,9 +271,9 @@
-- -- Insert initial data --
--
-INSERT INTO TBL_AUTH_USER
+INSERT INTO TBL_AUTH_USER
(user_id, login, first_name, last_name, email, password)
- values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
+ values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL',
'OPTION_ADMIN_PASS');
CREATE SEQUENCE TBL_AUTH_USER_seq START 1;
@@ -284,7 +283,7 @@
INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1);
CREATE SEQUENCE TBL_AUTH_GROUP_seq START 3;
--- ... and only two permissions
+-- ... and only two permissions
INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin');
INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug');
@@ -296,7 +295,7 @@
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1);
INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2);
--- Add user's prefs as default values for all users defined so far (only admin)
+-- Add user's prefs as default values for all users defined so far (only admin)
INSERT INTO TBL_USER_PREF (user_id) values (1);
INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string');
@@ -388,9 +387,9 @@
INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7);
CREATE SEQUENCE TBL_STATUS_seq START 7;
-INSERT INTO TBL_DATABASE VALUES (1,'Oracle','8.1.7',1);
-INSERT INTO TBL_DATABASE VALUES (2,'MySQL','3.23.49',2);
-INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL','7.1.3',3);
+INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1);
+INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2);
+INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3);
CREATE SEQUENCE TBL_DATABASE_seq START 3;
INSERT INTO TBL_SITE VALUES (0,'All',1);
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 19:02:31
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv27491/templates/default
Modified Files:
bughistory.html
Log Message:
UI tweaks
Index: bughistory.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bughistory.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- bughistory.html 18 May 2002 03:00:50 -0000 1.4
+++ bughistory.html 14 Sep 2002 19:02:28 -0000 1.5
@@ -1,4 +1,4 @@
-<table border="0" cellspacing="2" cellpadding="2">
+<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr bgcolor="#eeeeee">
<th>Who</th>
<th>What</th>
@@ -12,7 +12,7 @@
<td>{$history[event].changed_field}</td>
<td> {$history[event].old_value}</td>
<td> {$history[event].new_value}</td>
- <td>{$history[event].created_date|date:DATE_FORMAT} {$history[event].created_date|date:TIME_FORMAT}</td>
+ <td align="center">{$history[event].created_date|date:DATE_FORMAT} {$history[event].created_date|date:TIME_FORMAT}</td>
</tr>
{sectionelse}
<tr>
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 18:11:37
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv14870
Modified Files:
bug.php
Log Message:
Just reformatting to correct indentation. Please indent with tabs and make sure your editor isn't converting tabs to spaces on save.
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- bug.php 29 Jul 2002 12:07:46 -0000 1.114
+++ bug.php 14 Sep 2002 18:11:34 -0000 1.115
@@ -28,7 +28,7 @@
/// View the votes for a bug
function vote_view($bug_id) {
global $u, $db, $t, $STRING;
-
+
$t->assign('votes', $db->getAll('select login, v.created_date '.
'from '.TBL_AUTH_USER.' u, '.TBL_BUG_VOTE." v ".
"where u.user_id = v.user_id and bug_id = $bug_id ".
@@ -40,7 +40,7 @@
/// Add a vote to a bug to (possibly) promote it
function vote_bug($bug_id) {
[...1035 lines suppressed...]
}
if ($op) {
- switch($op) {
+ switch($op) {
case 'history':
show_history($_gv['bugid']);
break;
@@ -717,9 +717,9 @@
case 'viewvotes':
vote_view($_gv['bugid']);
break;
- }
+ }
} else {
- header("Location: query.php");
+ header("Location: query.php");
}
?>
|
|
From: Benjamin C. <bc...@us...> - 2002-09-14 16:54:36
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv24877
Modified Files:
query.php
Log Message:
Fixes bug #605293 -- Saved queries were being ignored when clicked because op=dequery wasn't in the url.
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- query.php 13 Sep 2002 19:34:09 -0000 1.87
+++ query.php 14 Sep 2002 16:54:33 -0000 1.88
@@ -258,6 +258,7 @@
// Save the query if requested
if (!empty($savedqueryname)) {
$savedquerystring = ereg_replace('&savedqueryname=.*(&?)', '\1', $HTTP_SERVER_VARS['QUERY_STRING']);
+ $savedquerystring .= '&op=doquery';
$nextid = $db->getOne("select max(saved_query_id)+1 from ".TBL_SAVED_QUERY." where user_id = $u");
$nextid = $nextid ? $nextid : 1;
$db->query("insert into ".TBL_SAVED_QUERY.
|
|
From: Ben C. <php...@be...> - 2002-09-13 20:25:05
|
That's generally a server problem, but I haven't been having issues with the sourceforge server today. On Fri, Sep 13, 2002 at 10:16:08PM +0200, Florian Kolbe wrote: > Is this a problem from my end or from sourceforge? > (once timeout, once refused) > > Is the server too busy? > > Florian > > fke@in10:/opt/phpbt> cvs update > usw-pr-cvs.sourceforge.net: Connection timed out > cvs [update aborted]: end of file from server (consult above messages if > any) > fke@in10:/opt/phpbt> cvs update > usw-pr-cvs.sourceforge.net: Connection refused > cvs [update aborted]: end of file from server (consult above messages if > any) > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Florian K. <Flo...@in...> - 2002-09-13 20:15:31
|
Is this a problem from my end or from sourceforge? (once timeout, once refused) Is the server too busy? Florian fke@in10:/opt/phpbt> cvs update usw-pr-cvs.sourceforge.net: Connection timed out cvs [update aborted]: end of file from server (consult above messages if any) fke@in10:/opt/phpbt> cvs update usw-pr-cvs.sourceforge.net: Connection refused cvs [update aborted]: end of file from server (consult above messages if any) |
|
From: Ben C. <php...@be...> - 2002-09-13 19:38:33
|
My latest commits to the db files and query.php should remove the 'and 1' and hopefully won't break it further. :) On Fri, Sep 06, 2002 at 07:43:42PM +0200, Florian Kolbe wrote: > Thanks for working on this... > After fixing the comma-bug (see cvs), I get this upon submitting: > maybe it doesnt like the 'and 1' ? > > DB Error: unknown error > select count(*) from phpbt_bug b, phpbt_auth_user owner, phpbt_auth_user > reporter where b.assigned_to = owner.user_id(+) and b.created_by = > reporter.user_id(+) and 1 [nativecode=ORA-00920: invalid relational operator > ] > > Florian > > > -----Original Message----- > > From: Ben Curtis [mailto:php...@be...] > > Sent: Friday, September 06, 2002 4:55 PM > > To: php...@li... > > Subject: Re: [phpBT-dev] CVS: phpbt/inc/db mysql.php,1.12,1.13 > > oci8.php,1. 8,1.9 pgsql.php,1.17,1.18 > > > > > > Yes, I think Jirka's fix should solve the problem I introduced. :) > > Upgrade.php still needs work, but in the past I've put it off > > until just > > before release. > > > > On Fri, Sep 06, 2002 at 03:49:11PM +0200, Jirka Pech wrote: > > > > DB Error: invalid number > > > > SELECT sum(decode( s.status_name, 1, 1, 2, 1, 3, 1, 4, 1, > > 0 )), sum(decode( > > > > s.status_id, 1, 0, 2, 0, 3, 0, 4, 0, 1 )) from phpbt_bug > > b, phpbt_status s > > > > where b.status_id = s.status_id (+) and b.created_by = 1 > > > > [nativecode=ORA-01722: invalid number ] > > > > > > This comes from adding BUG_??? codes. s.status_name is not > > a number. Try new > > > inc/db/oci8.php from CVS and let me know. > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: OSDN - Tired of that same old > > cell phone? Get a new here for FREE! > > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > > _______________________________________________ > > phpbt-dev mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpbt-dev > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
|
From: Benjamin C. <bc...@us...> - 2002-09-13 19:34:12
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv10031
Modified Files:
query.php
Log Message:
Trying to fix the latest oracle problem with the bug query.
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- query.php 3 Sep 2002 19:43:48 -0000 1.86
+++ query.php 13 Sep 2002 19:34:09 -0000 1.87
@@ -10,12 +10,12 @@
// 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.
@@ -26,8 +26,8 @@
function delete_saved_query($queryid) {
global $db, $u, $me, $_gv;
-
- $db->query("delete from ".TBL_SAVED_QUERY." where user_id = $u
+
+ $db->query("delete from ".TBL_SAVED_QUERY." where user_id = $u
and saved_query_id = $queryid");
if (!empty($_gv['form']) and $_gv['form'] == 'advanced') {
header("Location: $me?op=query&form=advanced");
@@ -38,10 +38,10 @@
function show_query() {
global $db, $t, $TITLE, $u, $_gv;
-
+
if ($u != 'nobody') {
// Grab the saved queries if there are any
- $t->assign('queries',
+ $t->assign('queries',
$db->getAll("select * from ".TBL_SAVED_QUERY." where user_id = '$u'"));
}
@@ -69,7 +69,7 @@
$paramstr .= "&$k=$v";
}
}
-
+
// Open bugs assigned to the user -- a hit list
if ($assignedto || $reportedby) {
$query[] = 'b.status_id '.($open ? '' : 'not ').
@@ -82,7 +82,7 @@
} else {
// Select boxes
$flags = array();
- // Need to check $array[0] for Opera --
+ // Need to check $array[0] for Opera --
// it passes non-empty arrays for every multi-choice select box
if (!empty($status) and $status[0]) {
$flags[] = 'b.status_id in ('.delimit_list(',',$status).')';
@@ -114,8 +114,8 @@
if (!empty($email1)) {
switch($emailtype1) {
case 'like' : $econd = "like '%$email1%'"; break;
- case 'rlike' :
- case 'not rlike' :
+ case 'rlike' :
+ case 'not rlike' :
case '=' : $econd = "$emailtype1 '$email1'"; break;
}
foreach($emailfield1 as $field) $equery[] = "$field.$emailsearch1 $econd";
@@ -145,7 +145,7 @@
$query[] = "b.project_id not in ($restricted_projects)";
}
}
-
+
if (!empty($query)) {
return array(delimit_list(' and ',$query), $paramstr);
} else {
@@ -156,9 +156,9 @@
// Handle the formatting for various types of bug info in the bug list
function format_bug_col($colvalue, $coltype, $bugid, $pos) {
global $select;
-
+
$pos--;
-
+
switch ($coltype) {
case 'url' :
echo "<a href=\"$colvalue\" target=\"_new\">$colvalue</a>";
@@ -193,7 +193,7 @@
$t->register_modifier('modify_bug_col', 'format_bug_col');
function list_items($assignedto = 0, $reportedby = 0, $open = 0) {
- global $me, $db, $t, $select, $TITLE, $STRING, $_gv, $u,
+ global $me, $db, $t, $select, $TITLE, $STRING, $_gv, $u,
$default_db_fields, $all_db_fields, $HTTP_SESSION_VARS, $HTTP_SERVER_VARS,
$QUERY;
@@ -261,40 +261,42 @@
$nextid = $db->getOne("select max(saved_query_id)+1 from ".TBL_SAVED_QUERY." where user_id = $u");
$nextid = $nextid ? $nextid : 1;
$db->query("insert into ".TBL_SAVED_QUERY.
- " (saved_query_id, user_id, saved_query_name, saved_query_string)
- values (".join(', ', array($nextid, $u,
- $db->quote(stripslashes($savedqueryname)),
+ " (saved_query_id, user_id, saved_query_name, saved_query_string)
+ values (".join(', ', array($nextid, $u,
+ $db->quote(stripslashes($savedqueryname)),
$db->quote(stripslashes($savedquerystring)))).")");
}
- if (!isset($order)) {
+ if (!isset($order)) {
if (isset($HTTP_SESSION_VARS['queryinfo']['order'])) {
$order = $HTTP_SESSION_VARS['queryinfo']['order'];
$sort = $HTTP_SESSION_VARS['queryinfo']['sort'];
} else {
- $order = 'bug_id';
- $sort = 'asc';
+ $order = 'bug_id';
+ $sort = 'asc';
}
}
if (!session_is_registered('queryinfo')) {
session_register('queryinfo');
$HTTP_SESSION_VARS['queryinfo'] = array();
}
-
+
$HTTP_SESSION_VARS['queryinfo']['order'] = $order;
$HTTP_SESSION_VARS['queryinfo']['sort'] = $sort;
-
+
if (empty($HTTP_SESSION_VARS['queryinfo']['query']) or isset($op)) {
- list($HTTP_SESSION_VARS['queryinfo']['query'], $paramstr) =
+ list($HTTP_SESSION_VARS['queryinfo']['query'], $paramstr) =
build_query($assignedto, $reportedby, $open);
}
$nr = $db->getOne($QUERY['query-list-bugs-count'].
- (!empty($HTTP_SESSION_VARS['queryinfo']['query'])
- ? $HTTP_SESSION_VARS['queryinfo']['query']: '1'));
+ (!empty($HTTP_SESSION_VARS['queryinfo']['query'])
+ ? $QUERY['query-list-bugs-count-join'].
+ $HTTP_SESSION_VARS['queryinfo']['query']
+ : ''));
$HTTP_SESSION_VARS['queryinfo']['numrows'] = $nr;
list($selrange, $llimit) = multipages($nr, $page, "order=$order&sort=$sort");
-
- $desired_fields = !empty($HTTP_SESSION_VARS['db_fields']) ?
+
+ $desired_fields = !empty($HTTP_SESSION_VARS['db_fields']) ?
$HTTP_SESSION_VARS['db_fields'] : $default_db_fields;
$query_fields = array('bug_id as bug_link_id', 'severity.severity_color');
@@ -308,13 +310,13 @@
'db_fields' => $desired_fields,
'field_titles' => $field_titles
));
-
+
$t->assign('bugs', $db->getAll($db->modifyLimitQuery(
- sprintf($QUERY['query-list-bugs'], join(', ', $query_fields),
- (!empty($HTTP_SESSION_VARS['queryinfo']['query'])
+ sprintf($QUERY['query-list-bugs'], join(', ', $query_fields),
+ (!empty($HTTP_SESSION_VARS['queryinfo']['query'])
? "and {$HTTP_SESSION_VARS['queryinfo']['query']} " : ''),
$order, $sort), $llimit, $selrange)));
-
+
sorting_headers($me, $headers, $order, $sort, "page=$page".$paramstr);
$t->wrap('buglist.html', 'buglist');
}
|
|
From: Benjamin C. <bc...@us...> - 2002-09-13 19:33:21
|
Update of /cvsroot/phpbt/phpbt/inc/db In directory usw-pr-cvs1:/tmp/cvs-serv9701/inc/db Modified Files: mysql.php oci8.php pgsql.php Log Message: Trying to fix the latest oracle problem with the bug query. Index: mysql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mysql.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mysql.php 3 Sep 2002 19:44:56 -0000 1.13 +++ mysql.php 13 Sep 2002 19:33:17 -0000 1.14 @@ -129,7 +129,8 @@ 'query-list-bugs-count' => '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 where ', + 'left join '.TBL_AUTH_USER.' reporter on b.created_by = reporter.user_id ', + 'query-list-bugs-count-join' => 'where ', 'query-list-bugs' => 'select %s '. 'from '.TBL_BUG.' b '. 'left join '.TBL_AUTH_USER.' owner on b.assigned_to = owner.user_id '. Index: oci8.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/oci8.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- oci8.php 6 Sep 2002 17:42:04 -0000 1.11 +++ oci8.php 13 Sep 2002 19:33:17 -0000 1.12 @@ -132,7 +132,8 @@ 'query-list-bugs-count' => 'select count(*) '. 'from '.TBL_BUG.' b, '.TBL_AUTH_USER.' owner, '.TBL_AUTH_USER.' reporter '. 'where b.assigned_to = owner.user_id(+) '. - 'and b.created_by = reporter.user_id(+) and ', + 'and b.created_by = reporter.user_id(+) ', + 'query-list-bugs-count-join' => 'and ', 'query-list-bugs' => 'select %s '. 'from '.TBL_BUG.' b, '.TBL_AUTH_USER.' lastmodifier, '. TBL_AUTH_USER.' owner, '.TBL_AUTH_USER.' reporter, '. @@ -177,5 +178,5 @@ 'where v.project_id = %s and v.version_id = b.version_id(+) '. 'group by v.version_id, v.version_name, v.created_date, v.active', ); - + ?> Index: pgsql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/pgsql.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- pgsql.php 3 Sep 2002 19:45:01 -0000 1.18 +++ pgsql.php 13 Sep 2002 19:33:17 -0000 1.19 @@ -127,7 +127,8 @@ 'query-list-bugs-count' => '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 where ', + 'left join '.TBL_AUTH_USER.' reporter on b.created_by = reporter.user_id ', + 'query-list-bugs-count-join' => 'where ', 'query-list-bugs' => 'select %s '. 'from '.TBL_BUG.' b '. 'left join '.TBL_AUTH_USER.' owner on b.assigned_to = owner.user_id '. |
|
From: Benjamin C. <bc...@us...> - 2002-09-13 19:22:20
|
Update of /cvsroot/phpbt/phpbt/templates/default/images In directory usw-pr-cvs1:/tmp/cvs-serv5987/templates/default/images Modified Files: title.gif Log Message: Trying to fix a problem that showed up when checking out to windows. Index: title.gif =================================================================== RCS file: /cvsroot/phpbt/phpbt/templates/default/images/title.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /tmp/cvsKPrFkJ and /tmp/cvse6Ldxi differ |
|
From: Benjamin C. <bc...@us...> - 2002-09-13 19:11:34
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv2317/templates/default
Modified Files:
bugdisplay-printable.html bugdisplay.html wrap.html
Log Message:
Use the new print stylesheet and clean up for better printing.
Index: bugdisplay-printable.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugdisplay-printable.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- bugdisplay-printable.html 24 May 2002 15:19:16 -0000 1.8
+++ bugdisplay-printable.html 13 Sep 2002 19:11:29 -0000 1.9
@@ -1,133 +1,71 @@
-<table border='0' width="100%">
+<table border='0' width="100%" cellspacing="0" cellpadding="0">
<tr>
- <td width="210" colspan="2">
- Bug <b>#{$bug_id}</b>
- </td>
- <td width="210" colspan="2">
- Reporter: <b>{$reporter|maskemail}</b>
- </td>
- <td width="210" colspan="2">
- Created: <b>{$created_date|date:DATE_FORMAT}</b>
- </td>
- </tr>
- <tr>
- <td>
- Project:
- </td>
- <td>
- {$project_name}
- </td>
- <td>
- Component:
- </td>
- <td>
- {$component_name}
- </td>
<td>
- Version:
+ Bug <b>#{$bug_id}</b>
</td>
<td>
- {$version_name}
+ Created: <b>{$created_date|date:DATE_FORMAT}</b>
</td>
</tr>
<tr>
<td>
- Severity:
- </td>
- <td>
- {$severity_name}
- </td>
- <td>
- Priority:
- </td>
- <td>
- {$priority}
- </td>
- <td>
- OS:
- </td>
- <td>
- {$os_name}
- </td>
- </tr>
- <tr>
- <td colspan="6">
- <hr size="1">
- </td>
- </tr>
-</table>
-<table border="0" cellpadding="2" cellspacing="0" width="100%">
- <tr>
- <td>Assigned To:</td>
- <td><b>{$owner|maskemail}</td>
- <td colspan="2">
-
+ Reporter: <b>{$reporter|maskemail}</b>
</td>
+ <td>Assigned To: <b>{$owner|maskemail}</td>
</tr>
<tr>
- <td>Status:</td>
- <td><b>{$status_name}</b></td>
- <td>Summary:</td>
- <td>{$title|stripslashes}</td>
+ <td>Status: <b>{$status_name}</b></td>
+ <td>Resolution: <b>{$resolution_name}</b></td>
</tr>
<tr>
- <td>Resolution:</td>
- <td><b>{$resolution_name}</b></td>
- <td>URL:</td>
- <td>{$url}</td>
- </tr>
- <tr>
- <td colspan="4">
-
+ <td>
+ Project: {$project_name}
</td>
- </tr>
-</table>
-<br>
-<br>
-<table border="0" cellpadding="2" cellspacing="0" width="100%">
- <tr>
<td>
- Bug Dependencies: {$bug_dependencies}
- <br>
- <br>
+ Component: {$component_name}
</td>
</tr>
<tr>
<td>
- Comments:
- <hr size="1">
+ Version: {$version_name}
</td>
- </tr>
- <tr>
<td>
- <div align="center">
- <i>----- Posted by {$reporter|maskemail} at {$created_date|date:TIME_FORMAT} on {$created_date|date:DATE_FORMAT} -----</i>
- <br>
- <br>
- </div>
- {$description|stripslashes|format_comments|nl2br}
- <br>
- <br>
- <br>
+ Severity: {$severity_name}
</td>
</tr>
- {section name=comment loop=$comments}
<tr>
<td>
- <div align="center">
- <i>----- Posted by {$comments[comment].login|maskemail} at {$comments[comment].created_date|date:TIME_FORMAT} on {$comments[comment].created_date|date:DATE_FORMAT}-----</i>
- <br>
- <br>
- </div>
- {$comments[comment].comment_text|stripslashes|format_comments|nl2br}
- <br>
- <br>
- <br>
+ Priority: {$priority}
+ </td>
+ <td colspan="2">
+ OS: {$os_name}
</td>
</tr>
- {/section}
</table>
<br>
-<a href="{$smarty.server.PHP_SELF}?op=show&bugid={$bug_id}">Back to bug #{$bug_id}</a>
+Summary: {$title|stripslashes}
+<br>
+URL: {$url}
+<br>
+Bug Dependencies: {$bug_dependencies}
+<br>
+<br>
+Comments:
+<hr size="1">
+<i>----- Posted by {$reporter|maskemail} at {$created_date|date:TIME_FORMAT} on {$created_date|date:DATE_FORMAT} -----</i>
+<br>
+{$description|stripslashes|format_comments|nl2br}
+<br>
+<br>
+{section name=comment loop=$comments}
+<i>----- Posted by {$comments[comment].login|maskemail} at {$comments[comment].created_date|date:TIME_FORMAT} on {$comments[comment].created_date|date:DATE_FORMAT}-----</i>
+<br>
+{$comments[comment].comment_text|stripslashes|format_comments|nl2br}
+<br>
+<br>
+{/section}
+
+<br>
+<a class="bugdisplaylinks" href="{$smarty.server.PHP_SELF}?op=show&bugid={$bug_id}">Back to bug #{$bug_id}</a>
<br>
<br>
Index: bugdisplay.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugdisplay.html,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- bugdisplay.html 29 Jul 2002 12:07:23 -0000 1.38
+++ bugdisplay.html 13 Sep 2002 19:11:29 -0000 1.39
@@ -1,5 +1,5 @@
<script type="text/JavaScript">
-<!--
+<!--
versions = new Array();
closedversions = new Array();
components = new Array();
@@ -39,7 +39,7 @@
f.component_id.selectedIndex = 0;
}
}
-
+
function popupAtt(id) {
window.open('attachment.php?use_js=1&bugid='+id, 'ewin', 'dependent=yes,width=350,height=200,scrollbars=1');
return false;
@@ -148,14 +148,14 @@
{/if}
</div></td>
</tr><tr>
- <td><table border="0" cellpadding="0">
+ <td><table border="0" cellpadding="0" width="100%">
<tr>
<td colspan="2">{$STRING.BUGDISPLAY.Attachments}:</td>
<td colspan="3" align="right"><a href="attachment.php?bugid={$bug_id}" onClick="return popupAtt({$bug_id})">{$STRING.BUGDISPLAY.CreateAttachment}</a></td>
</tr><tr>
<td colspan="5" height="2" bgcolor="#ffffff"><spacer type="block" height="2" width="2"></td>
</tr><tr>
- <td width="250" bgcolor="#cccccc" align="center"><b>{$STRING.BUGDISPLAY.Name}</b></td>
+ <td bgcolor="#cccccc" align="center"><b>{$STRING.BUGDISPLAY.Name}</b></td>
<td width="60" bgcolor="#cccccc" align="center"><b>{$STRING.BUGDISPLAY.Size}</b></a></td>
<td width="150" bgcolor="#cccccc" align="center"><b>{$STRING.BUGDISPLAY.Type}</b></a></td>
<td width="80" bgcolor="#cccccc" align="center"><b>{$STRING.BUGDISPLAY.Created}</b></a></td>
@@ -204,11 +204,11 @@
</tr>
</table>
</form>
-<div align="center">
+<div align="center" class="bugdisplaylinks">
{if !empty($error.vote)}<div class="error">{$error.vote}</div>{/if}
- <b><a href="{$smarty.server.PHP_SELF}?op=vote&bugid={$bug_id}" onClick="if ({$already_voted}) {literal}{ alert ('{/literal}{$STRING.already_voted}{literal}'); return false; }{/literal}">{$STRING.BUGDISPLAY.VoteForThisBug}</a></b> |
- <b><a href="{$smarty.server.PHP_SELF}?op=viewvotes&bugid={$bug_id}">{$STRING.BUGDISPLAY.ViewVotes} ({$num_votes}) {$STRING.BUGDISPLAY.ForThisBug}</a></b> |
- <b><a href="{$smarty.server.PHP_SELF}?op=history&bugid={$bug_id}">{$STRING.BUGDISPLAY.ViewBugActivity}</a></b> |
+ <b><a href="{$smarty.server.PHP_SELF}?op=vote&bugid={$bug_id}" onClick="if ({$already_voted}) {literal}{ alert ('{/literal}{$STRING.already_voted}{literal}'); return false; }{/literal}">{$STRING.BUGDISPLAY.VoteForThisBug}</a></b> |
+ <b><a href="{$smarty.server.PHP_SELF}?op=viewvotes&bugid={$bug_id}">{$STRING.BUGDISPLAY.ViewVotes} ({$num_votes}) {$STRING.BUGDISPLAY.ForThisBug}</a></b> |
+ <b><a href="{$smarty.server.PHP_SELF}?op=history&bugid={$bug_id}">{$STRING.BUGDISPLAY.ViewBugActivity}</a></b> |
<b><a href="{$smarty.server.PHP_SELF}?op=print&bugid={$bug_id}">{$STRING.BUGDISPLAY.PrintableView}</a></b>
</div>
<br><br>
Index: wrap.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/wrap.html,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- wrap.html 13 Sep 2002 18:02:21 -0000 1.21
+++ wrap.html 13 Sep 2002 19:11:30 -0000 1.22
@@ -3,10 +3,11 @@
<META HTTP-EQUIV="Expires" CONTENT="-1">
<title>phpBugTracker - {$page_title}</title>
<link rel="StyleSheet" href="styles/{$STYLE}.css" type="text/css">
+ <link rel="stylesheet" type"text/css" href="styles/print.css" media="print">
<META http-equiv="Content-Type" content="text/html; charset={$STRING.lang_charset}">
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="nav">
<tr>
<td class="nav" valign="middle"><img name="title" src="{$template_path}/images/title.gif" width="500" height="50" border="0" alt="" hspace="0" vspace="0"></td>
<td align="right" valign="middle" class="nav">
|
|
From: Benjamin C. <bc...@us...> - 2002-09-13 19:11:33
|
Update of /cvsroot/phpbt/phpbt/templates/default/admin
In directory usw-pr-cvs1:/tmp/cvs-serv2317/templates/default/admin
Modified Files:
wrap.html
Log Message:
Use the new print stylesheet and clean up for better printing.
Index: wrap.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/wrap.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- wrap.html 13 Sep 2002 18:02:21 -0000 1.18
+++ wrap.html 13 Sep 2002 19:11:29 -0000 1.19
@@ -3,6 +3,7 @@
<META HTTP-EQUIV="Expires" CONTENT="-1">
<title>phpBugTracker Admin - {$page_title}</title>
<link rel="StyleSheet" href="../styles/{$STYLE}.css" type="text/css">
+ <link rel="stylesheet" type"text/css" href="styles/print.css" media="print">
<META http-equiv="Content-Type" content="text/html; charset={$STRING.lang_charset}">
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
|
|
From: Benjamin C. <bc...@us...> - 2002-09-13 19:10:35
|
Update of /cvsroot/phpbt/phpbt/styles
In directory usw-pr-cvs1:/tmp/cvs-serv2029/styles
Added Files:
print.css
Log Message:
Stylesheet for printing
--- NEW FILE: print.css ---
body {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
font-size: 12px;
color: #000000;
background: #ffffff;
}
a:link { text-decoration: none; color: #006699; }
a:visited { text-decoration: none; color: #006699; }
a:active { text-decoration: none }
a:hover { text-decoration: underline; }
td {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
font-size: 12px;
color: #000000;
}
tr.alt {
background: #dddddd;
}
th {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
font-size: 12px;
color: #000000;
background-color: #eeeeee;
}
th.selected {
font-weight: bold;
text-align: center;
background-color: #bbbbbb;
}
select {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
font-size: 12px;
}
input {
font-size: 12px;
}
input[type="file"] {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
font-size: 12px;
}
input[type="submit"] {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
}
input[type="reset"] {
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
}
textarea {
font-size: 12px;
}
.navfont {
font-family: "Verdana","Arial","Helvetica","MS Sans Serif","Sans-Serif";
font-size: 10px;
}
.login-box {
vertical-align: text-bottom;
font-size: 10px;
display: none;
}
input[type="text"].login-box {
padding-top: 0.1em;
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;
}
.result {
text-align: center;
font-weight: bold;
color: #0000ff;
padding-bottom: 0.1em;
}
a.sidenavlink {
color: #000000;
text-decoration: none;
}
.nav {
vertical-align: middle;
background: #9999ff;
color: #ffffff;
font-family: "Arial", sans-serif;
font-size: 16px;
font-weight: bold;
display: none;
}
.navinput {
vertical-align: middle;
background: #ffffff;
color: #00000;
font-family: "Arial", sans-serif;
font-size: 12px;
}
.sidenav {
vertical-align: top;
background: #9999ff;
color: #ffffff;
font-family: "Verdana", "Tahoma", "Helvetica", sans-serif;
font-size: 14px;
font-weight: bold;
}
.bottomnav {
vertical-align: middle;
background: #ffffcc;
color: #000000;
font-family: "Arial", sans-serif;
font-size: 10px;
font-weight: bold;
}
.bottomnavinput {
vertical-align: middle;
color: #00000;
font-family: "Arial", sans-serif;
font-size: 10px;
}
.topnavbox {
vertical-align: middle;
background: #9999ff;
color: #ffffff;
font-family: "Arial", sans-serif;
font-size: 14px;
font-weight: bold;
border-width: 1px 0px 1px 0px;
border-color: #ffffff;
border-style: solid;
padding: 5px;
cursor: pointer;
cursor: hand;
display: none;
}
.navbox {
vertical-align: middle;
background: #9999ff;
color: #ffffff;
font-family: "Arial", sans-serif;
font-size: 14px;
font-weight: bold;
border-width: 0px 0px 1px 0px;
border-color: #ffffff;
border-style: solid;
padding: 5px;
cursor: pointer;
cursor: hand;
display: none;
}
.navboxselected {
vertical-align: middle;
background: #ffffcc;
color: #ffffff;
font-family: "Arial", sans-serif;
font-size: 14px;
font-weight: bold;
border-width: 0px 0px 1px 0px;
border-color: #ffffff;
border-style: solid;
padding: 5px;
cursor: pointer;
cursor: hand;
}
.maincontent {
vertical-align: top;
background: #ffffff;
color: #000000;
font-family: "Arial", sans-serif;
font-size: 12px;
padding: 5px;
}
.info {
font-size: 10px;
color: #000000;
background: #eeeeee;
border-width: 1px 1px 1px 1px;
border-color: #000000;
border-style: solid;
padding: 5px;
text-align: center;
}
.header-col { font-weight: bold; }
.center-col { text-align: center; }
.navlink {
color: #FFFFFF;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.bugdisplaylinks {
display: none;
}
|
|
From: Benjamin C. <bc...@us...> - 2002-09-13 18:13:28
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv14495
Modified Files:
include.php install.php
Log Message:
Attempt to use included pear.
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- include.php 18 Jul 2002 13:02:14 -0000 1.121
+++ include.php 13 Sep 2002 18:13:25 -0000 1.122
@@ -22,7 +22,7 @@
// ------------------------------------------------------------------------
// $Id$
-ini_set("magic_quotes_runtime", 0);
+ini_set("magic_quotes_runtime", 0);
if (!@include('config.php')) {
header("Location: install.php");
@@ -37,6 +37,7 @@
include ('inc/functions.php');
// PEAR::DB
+chdir('inc/pear'); // Drop down to the pear directory to include pear stuff
require_once('DB.php');
$dsn = array(
'phptype' => DB_TYPE,
@@ -52,17 +53,18 @@
$db->setOption('optimize', 'portability');
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$db->setErrorHandling(PEAR_ERROR_CALLBACK, "handle_db_error");
+chdir('../..'); // Come back up from the pear directory
// Set up the configuration variables
$rs = $db->query('select varname, varvalue from '.TBL_CONFIGURATION);
while (list($k, $v) = $rs->fetchRow(DB_FETCHMODE_ORDERED)) {
define($k, $v);
}
-define('OPEN_BUG_STATUSES', join(', ', array(BUG_UNCONFIRMED, BUG_PROMOTED,
+define('OPEN_BUG_STATUSES', join(', ', array(BUG_UNCONFIRMED, BUG_PROMOTED,
BUG_ASSIGNED, BUG_REOPENED)));
require_once ('inc/db/'.DB_TYPE.'.php');
-
+
// Localization - include the file with the desired language
include 'languages/'.LANGUAGE.'.php';
@@ -98,7 +100,7 @@
'browser_string' => 'Browser',
'close_date' => 'Closed Date'
);
-
+
$default_db_fields = array('bug_id', 'title', 'reporter', 'owner',
'severity_name', 'priority', 'status_name', 'resolution_name');
@@ -115,15 +117,15 @@
error_reporting(E_ALL ^ E_NOTICE); // Clobber Smarty warnings
return Smarty::fetch($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $_smarty_display);
}
-
+
function wrap($template, $title = '') {
global $TITLE, $_gv, $_pv;
-
+
$this->assign(array(
'content_template' => $template,
'page_title' => isset($TITLE[$title]) ? $TITLE[$title] : $title
));
-
+
// Use a popup wrap?
if ((isset($_gv['use_js']) and $_gv['use_js']) or
(isset($_pv['use_js']) and $_pv['use_js'])) {
@@ -143,6 +145,7 @@
$t->template_dir = 'templates/'.THEME.'/';
$t->compile_dir = 'c_templates';
$t->config_dir = '.';
+$t->use_sub_dirs = false;
$t->register_function('build_select', 'build_select');
$t->register_function('project_js', 'build_project_js');
$t->register_modifier('date', 'bt_date');
@@ -203,14 +206,14 @@
setcookie('phpbt_user');
}
}
-
+
}
if (!empty($u)) {
- list($owner_open, $owner_closed) =
- $db->getRow(sprintf($QUERY['include-template-owner'], $u),
+ list($owner_open, $owner_closed) =
+ $db->getRow(sprintf($QUERY['include-template-owner'], $u),
DB_FETCHMODE_ORDERED);
- list($reporter_open, $reporter_closed) =
+ list($reporter_open, $reporter_closed) =
$db->getRow(sprintf($QUERY['include-template-reporter'], $u),
DB_FETCHMODE_ORDERED);
$t->assign(array(
@@ -233,11 +236,11 @@
// Check to see if we have projects that shouldn't be visible to the user
$restricted_projects = '0';
if (!$perm->have_perm('Admin')) {
- $viewable_projects = delimit_list(',',
+ $viewable_projects = delimit_list(',',
$db->getCol("select project_id from ".TBL_PROJECT_GROUP.
" where group_id in (".delimit_list(',', $_sv['group_ids']).")"));
$viewable_projects = $viewable_projects ? $viewable_projects : '0';
- $matching_projects = delimit_list(',',
+ $matching_projects = delimit_list(',',
$db->getCol("select project_id from ".TBL_PROJECT_GROUP.
" where project_id not in ($viewable_projects) group by project_id"));
if ($matching_projects) {
Index: install.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/install.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- install.php 29 Jul 2002 12:26:18 -0000 1.30
+++ install.php 13 Sep 2002 18:13:25 -0000 1.31
@@ -59,7 +59,7 @@
'mysql' => 'MySQL',
'oci8' => 'Oracle 8.1.x',
'pgsql' => 'PostgreSQL');
-
+
ini_set("magic_quotes_runtime", 0); // runtime quotes will kill the included sql
if (!empty($_pv)) {
@@ -97,7 +97,7 @@
'/TBL_DATABASE/' => $_pv['tbl_prefix'].'database_server',
'/TBL_SITE/' => $_pv['tbl_prefix'].'site',
'/OPTION_ADMIN_EMAIL/' => $_pv['admin_login'],
- '/OPTION_ADMIN_PASS/' => $_pv['encrypt_pass'] ? md5($_pv['admin_pass'])
+ '/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'],
@@ -113,13 +113,13 @@
function build_select($params) {
global $db_types;
-
+
extract($params);
$text = '';
foreach ($db_types as $val => $item) {
if ($selected == $val and $selected != '') $sel = ' selected';
- else $sel = '';
- $text .= "<option value=\"$val\"$sel>$item</option>";
+ else $sel = '';
+ $text .= "<option value=\"$val\"$sel>$item</option>";
}
echo $text;
}
@@ -141,16 +141,17 @@
// Smarty
$patterns[] = '{smarty_path}';
$replacements[] = SMARTY_PATH;
-
+
$contents = join('', file('config-dist.php'));
return str_replace($patterns, $replacements, $contents);
-
+
}
function create_tables() {
global $_pv, $tables;
-
+
// PEAR::DB
+ chdir('inc/pear'); // Drop down to the pear directory to include pear stuff
require_once('DB.php');
$dsn = array(
'phptype' => $_pv['db_type'],
@@ -160,22 +161,24 @@
'password' => $_pv['db_pass']
);
$db = DB::Connect($dsn);
- // Simple error checking on returned DB object to check connection to db
- if(get_class($db)=='db_error') {
- die('<br><br>
- <div align="center">The installation script could not connect to the database (' . $_pv['db_database'] .
- ') on the host (' . $_pv['db_host'] . ') using the specified username and password.
- <br>
- Please check these details are correct and that the database already exists then retry.
- </div>
- <br>'.$db->message.'<br>'.$db->userinfo);
- }
+ chdir('../..'); // Come back up from the pear directory
+
+ // Simple error checking on returned DB object to check connection to db
+ if(get_class($db)=='db_error') {
+ die('<br><br>
+ <div align="center">The installation script could not connect to the database (' . $_pv['db_database'] .
+ ') on the host (' . $_pv['db_host'] . ') using the specified username and password.
+ <br>
+ Please check these details are correct and that the database already exists then retry.
+ </div>
+ <br>'.$db->message.'<br>'.$db->userinfo);
+ }
$db->setOption('optimize', 'portability');
$q_temp_ary = file('schemas/'.$_pv['db_type'].'.in');
- $queries = preg_replace(array_keys($tables), array_values($tables),
+ $queries = preg_replace(array_keys($tables), array_values($tables),
$q_temp_ary);
$do_query = '';
foreach ($queries as $query) {
@@ -192,7 +195,7 @@
function check_vars() {
global $_pv;
-
+
$error = '';
if (!$_pv['db_host'] = trim($_pv['db_host'])) {
$error = 'Please enter the host name for your database server';
@@ -213,7 +216,7 @@
} elseif ($_pv['admin_pass'] != $_pv['admin_pass2']) {
$error = 'The admin passwords don\'t match';
}
-
+
if (!empty($error)) {
show_front($error);
return false;
@@ -246,14 +249,14 @@
function show_finished() {
global $t, $_pv;
-
+
$t->assign('login', $_pv['admin_login']);
$t->display('install-complete.html');
}
function show_front($error = '') {
global $t, $_pv, $select, $HTTP_SERVER_VARS;
-
+
$t->assign($_pv);
$t->assign('error', $error);
$t->assign('default_email', 'phpbt@'.$HTTP_SERVER_VARS['SERVER_NAME']);
|
|
From: Benjamin C. <bc...@us...> - 2002-09-13 18:07:55
|
Update of /cvsroot/phpbt/phpbt/inc/pear/DB In directory usw-pr-cvs1:/tmp/cvs-serv10534/inc/pear/DB Added Files: common.php dbase.php fbsql.php ibase.php ifx.php msql.php mssql.php mysql.php oci8.php odbc.php pgsql.php storage.php sybase.php Log Message: Adding pear from php 4.2.3 distribution. This will help solve one of the primary installation problems of not being able to load pear. --- NEW FILE: common.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Stig Bakken <ss...@fa...> | // +----------------------------------------------------------------------+ // // $Id: common.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ [...1243 lines suppressed...] } // }}} } // Used by many drivers if (!function_exists('array_change_key_case')) { define('CASE_UPPER', 1); define('CASE_LOWER', 0); function &array_change_key_case(&$array, $case) { $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; $ret = array(); foreach ($array as $key => $value) { $ret[$casefunc($key)] = $value; } return $ret; } } ?> --- NEW FILE: dbase.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Tomas V.V.Cox <co...@id...> | // +----------------------------------------------------------------------+ // // $Id: dbase.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ // // Database independent query interface definition for PHP's dbase // extension. // // XXX legend: // You have to compile your PHP with the --enable-dbase option // require_once "DB/common.php"; class DB_dbase extends DB_common { // {{{ properties var $connection; var $phptype, $dbsyntax; var $prepare_tokens = array(); var $prepare_types = array(); var $transaction_opcount = 0; var $res_row = array(); var $result = 0; // }}} // {{{ constructor /** * DB_mysql constructor. * * @access public */ function DB_dbase() { $this->DB_common(); $this->phptype = 'dbase'; $this->dbsyntax = 'dbase'; $this->features = array( 'prepare' => false, 'pconnect' => false, 'transactions' => false, 'limit' => false ); $this->errorcode_map = array(); } function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('dbase')) { return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); } $this->dsn = $dsninfo; ob_start(); $conn = dbase_open($dsninfo['database'], 0); $error = ob_get_contents(); ob_end_clean(); if (!$conn) { return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, null, null, strip_tags($error)); } $this->connection = $conn; return DB_OK; } function disconnect() { $ret = dbase_close($this->connection); $this->connection = null; return $ret; } function &query($query = null) { // emulate result resources $this->res_row[$this->result] = 0; return new DB_result($this, $this->result++); } function fetchInto($res, &$row, $fetchmode, $rownum = null) { if ($rownum === null) { $rownum = $this->res_row[$res]++; } if ($fetchmode & DB_FETCHMODE_ASSOC) { $row = @dbase_get_record_with_names($this->connection, $rownum); } else { $row = @dbase_get_record($this->connection, $rownum); } if (!$row) { return null; } return DB_OK; } function numCols($foo) { return dbase_numfields($this->connection); } function numRows($foo) { return dbase_numrecords($this->connection); } } ?> --- NEW FILE: fbsql.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Frank M. Kromann <fr...@fr...> | // +----------------------------------------------------------------------+ // // $Id: fbsql.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ // // Database independent query interface definition for PHP's FrontBase // extension. // // // XXX legend: // // XXX ERRORMSG: The error message from the fbsql function should // be registered here. // require_once "DB/common.php"; class DB_fbsql extends DB_common { // {{{ properties var $connection; var $phptype, $dbsyntax; var $prepare_tokens = array(); var $prepare_types = array(); var $num_rows = array(); var $fetchmode = DB_FETCHMODE_ORDERED; /* Default fetch mode */ // }}} // {{{ constructor /** * DB_fbsql constructor. * * @access public */ function DB_fbsql() { $this->DB_common(); $this->phptype = 'fbsql'; $this->dbsyntax = 'fbsql'; $this->features = array( 'prepare' => false, 'pconnect' => true, 'transactions' => true, 'limit' => 'emulate' ); $this->errorcode_map = array( 1004 => DB_ERROR_CANNOT_CREATE, 1005 => DB_ERROR_CANNOT_CREATE, 1006 => DB_ERROR_CANNOT_CREATE, 1007 => DB_ERROR_ALREADY_EXISTS, 1008 => DB_ERROR_CANNOT_DROP, 1046 => DB_ERROR_NODBSELECTED, 1050 => DB_ERROR_ALREADY_EXISTS, 1051 => DB_ERROR_NOSUCHTABLE, 1054 => DB_ERROR_NOSUCHFIELD, 1062 => DB_ERROR_ALREADY_EXISTS, 1064 => DB_ERROR_SYNTAX, 1100 => DB_ERROR_NOT_LOCKED, 1136 => DB_ERROR_VALUE_COUNT_ON_ROW, 1146 => DB_ERROR_NOSUCHTABLE, ); } // }}} // {{{ connect() /** * Connect to a database and log in as the specified user. * * @param $dsn the data source name (see DB::parseDSN for syntax) * @param $persistent (optional) whether the connection should * be persistent * @access public * @return int DB_OK on success, a DB error on failure */ function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('fbsql')) return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); $this->dsn = $dsninfo; $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost'; $user = $dsninfo['username']; $pw = $dsninfo['password']; $connect_function = $persistent ? 'fbsql_pconnect' : 'fbsql_connect'; ini_set('track_errors', true); if ($dbhost && $user && $pw) { $conn = @$connect_function($dbhost, $user, $pw); } elseif ($dbhost && $user) { $conn = @$connect_function($dbhost, $user); } elseif ($dbhost) { $conn = @$connect_function($dbhost); } else { $conn = false; } ini_restore("track_errors"); if (empty($conn)) { if (empty($php_errormsg)) { return $this->raiseError(DB_ERROR_CONNECT_FAILED); } else { return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, null, null, $php_errormsg); } } if ($dsninfo['database']) { if (!fbsql_select_db($dsninfo['database'], $conn)) { return $this->fbsqlRaiseError(); } } $this->connection = $conn; return DB_OK; } // }}} // {{{ disconnect() /** * Log out and disconnect from the database. * * @access public * * @return bool TRUE on success, FALSE if not connected. */ function disconnect() { $ret = fbsql_close($this->connection); $this->connection = null; return $ret; } // }}} // {{{ simpleQuery() /** * Send a query to fbsql and return the results as a fbsql resource * identifier. * * @param the SQL query * * @access public * * @return mixed returns a valid fbsql result for successful SELECT * queries, DB_OK for other successful queries. A DB error is * returned on failure. */ function simpleQuery($query) { $this->last_query = $query; $query = $this->modifyQuery($query); $result = @fbsql_query("$query;", $this->connection); if (!$result) { return $this->fbsqlRaiseError(); } // Determine which queries that should return data, and which // should return an error code only. if (DB::isManip($query)) { return DB_OK; } $numrows = $this->numrows($result); if (is_object($numrows)) { return $numrows; } $this->num_rows[$result] = $numrows; return $result; } // }}} // {{{ nextResult() /** * Move the internal fbsql result pointer to the next available result * * @param a valid fbsql result resource * * @access public * * @return true if a result is available otherwise return false */ function nextResult($result) { return @fbsql_next_result($result); } // }}} // {{{ fetchRow() /** * Fetch and return a row of data (it uses fetchInto for that) * @param $result fbsql result identifier * @param $fetchmode format of fetched row array * @param $rownum the absolute row number to fetch * * @return array a row of data, or false on error */ function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) { if ($fetchmode == DB_FETCHMODE_DEFAULT) { $fetchmode = $this->fetchmode; } $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); if ($res !== DB_OK) { return $res; } return $arr; } // }}} // {{{ fetchInto() /** * Fetch a row and insert the data into an existing array. * * @param $result fbsql result identifier * @param $arr (reference) array where data from the row is stored * @param $fetchmode how the array data should be indexed * @param $rownum the row number to fetch * @access public * * @return int DB_OK on success, a DB error on failure */ function fetchInto($result, &$arr, $fetchmode, $rownum=null) { if ($rownum !== null) { if (!@fbsql_data_seek($result, $rownum)) { return null; } } if ($fetchmode & DB_FETCHMODE_ASSOC) { $arr = @fbsql_fetch_array($result, FBSQL_ASSOC); } else { $arr = @fbsql_fetch_row($result); } if (!$arr) { $errno = @fbsql_errno($this->connection); if (!$errno) { return NULL; } return $this->fbsqlRaiseError($errno); } return DB_OK; } // }}} // {{{ freeResult() /** * Free the internal resources associated with $result. * * @param $result fbsql result identifier or DB statement identifier * * @access public * * @return bool TRUE on success, FALSE if $result is invalid */ function freeResult($result) { if (is_resource($result)) { return fbsql_free_result($result); } if (!isset($this->prepare_tokens[(int)$result])) { return false; } unset($this->prepare_tokens[(int)$result]); unset($this->prepare_types[(int)$result]); return true; } // }}} // {{{ autoCommit() function autoCommit($onoff=false) { if ($onoff) { $this->query("SET COMMIT TRUE"); } else { $this->query("SET COMMIT FALSE"); } } // }}} // {{{ commit() function commit() { fbsql_commit(); } // }}} // {{{ rollback() function rollback() { fbsql_rollback(); } // }}} // {{{ numCols() /** * Get the number of columns in a result set. * * @param $result fbsql result identifier * * @access public * * @return int the number of columns per row in $result */ function numCols($result) { $cols = @fbsql_num_fields($result); if (!$cols) { return $this->fbsqlRaiseError(); } return $cols; } // }}} // {{{ numRows() /** * Get the number of rows in a result set. * * @param $result fbsql result identifier * * @access public * * @return int the number of rows in $result */ function numRows($result) { $rows = @fbsql_num_rows($result); if ($rows === null) { return $this->fbsqlRaiseError(); } return $rows; } // }}} // {{{ affectedRows() /** * Gets the number of rows affected by the data manipulation * query. For other queries, this function returns 0. * * @return number of rows affected by the last query */ function affectedRows() { if (DB::isManip($this->last_query)) { $result = @fbsql_affected_rows($this->connection); } else { $result = 0; } return $result; } // }}} // {{{ errorNative() /** * Get the native error code of the last error (if any) that * occured on the current connection. * * @access public * * @return int native fbsql error code */ function errorNative() { return fbsql_errno($this->connection); } // }}} // {{{ nextId() /** * Get the next value in a sequence. We emulate sequences * for fbsql. Will create the sequence if it does not exist. * * @access public * * @param $seq_name the name of the sequence * * @param $ondemand whether to create the sequence table on demand * (default is true) * * @return a sequence integer, or a DB error */ function nextId($seq_name, $ondemand = true) { $sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name); $repeat = 0; do { $seqname = sprintf($this->getOption("seqname_format"), $sqn); $result = $this->query("INSERT INTO ${seqname} VALUES(NULL)"); if ($ondemand && DB::isError($result) && $result->getCode() == DB_ERROR_NOSUCHTABLE) { $repeat = 1; $result = $this->createSequence($seq_name); if (DB::isError($result)) { return $result; } } else { $repeat = 0; } } while ($repeat); if (DB::isError($result)) { return $result; } return fbsql_insert_id($this->connection); } // }}} // {{{ createSequence() function createSequence($seq_name) { $sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name); $seqname = sprintf($this->getOption("seqname_format"), $sqn); return $this->query("CREATE TABLE ${seqname} ". '(id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'. ' PRIMARY KEY(id))'); } // }}} // {{{ dropSequence() function dropSequence($seq_name) { $sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name); $seqname = sprintf($this->getOption("seqname_format"), $sqn); return $this->query("DROP TABLE ${seqname} RESTRICT"); } // }}} // {{{ modifyQuery() function modifyQuery($query) { if ($this->options['optimize'] == 'portability') { // "DELETE FROM table" gives 0 affected rows in fbsql. // This little hack lets you know how many rows were deleted. if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) { $query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/', 'DELETE FROM \1 WHERE 1=1', $query); } } return $query; } // }}} // {{{ fbsqlRaiseError() function fbsqlRaiseError($errno = null) { if ($errno === null) { $errno = $this->errorCode(fbsql_errno($this->connection)); } return $this->raiseError($errno, null, null, null, fbsql_error($this->connection)); } // }}} // {{{ tableInfo() function tableInfo($result, $mode = null) { $count = 0; $id = 0; $res = array(); /* * depending on $mode, metadata returns the following values: * * - mode is false (default): * $result[]: * [0]["table"] table name * [0]["name"] field name * [0]["type"] field type * [0]["len"] field length * [0]["flags"] field flags * * - mode is DB_TABLEINFO_ORDER * $result[]: * ["num_fields"] number of metadata records * [0]["table"] table name * [0]["name"] field name * [0]["type"] field type * [0]["len"] field length * [0]["flags"] field flags * ["order"][field name] index of field named "field name" * The last one is used, if you have a field name, but no index. * Test: if (isset($result['meta']['myfield'])) { ... * * - mode is DB_TABLEINFO_ORDERTABLE * the same as above. but additionally * ["ordertable"][table name][field name] index of field * named "field name" * * this is, because if you have fields from different * tables with the same field name * they override each * other with DB_TABLEINFO_ORDER * * you can combine DB_TABLEINFO_ORDER and * DB_TABLEINFO_ORDERTABLE with DB_TABLEINFO_ORDER | * DB_TABLEINFO_ORDERTABLE * or with DB_TABLEINFO_FULL */ // if $result is a string, then we want information about a // table without a resultset if (is_string($result)) { $id = @fbsql_list_fields($this->dsn['database'], $result, $this->connection); if (empty($id)) { return $this->fbsqlRaiseError(); } } else { // else we want information about a resultset $id = $result; if (empty($id)) { return $this->fbsqlRaiseError(); } } $count = @fbsql_num_fields($id); // made this IF due to performance (one if is faster than $count if's) if (empty($mode)) { for ($i=0; $i<$count; $i++) { $res[$i]['table'] = @fbsql_field_table ($id, $i); $res[$i]['name'] = @fbsql_field_name ($id, $i); $res[$i]['type'] = @fbsql_field_type ($id, $i); $res[$i]['len'] = @fbsql_field_len ($id, $i); $res[$i]['flags'] = @fbsql_field_flags ($id, $i); } } else { // full $res["num_fields"]= $count; for ($i=0; $i<$count; $i++) { $res[$i]['table'] = @fbsql_field_table ($id, $i); $res[$i]['name'] = @fbsql_field_name ($id, $i); $res[$i]['type'] = @fbsql_field_type ($id, $i); $res[$i]['len'] = @fbsql_field_len ($id, $i); $res[$i]['flags'] = @fbsql_field_flags ($id, $i); if ($mode & DB_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & DB_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } } } // free the result only if we were called on a table if (is_string($result)) { @fbsql_free_result($id); } return $res; } // }}} // {{{ getSpecialQuery() /** * Returns the query needed to get some backend info * @param string $type What kind of info you want to retrieve * @return string The SQL query string */ function getSpecialQuery($type) { switch ($type) { case 'tables': $sql = 'select "table_name" from information_schema.tables'; break; default: return null; } return $sql; } // }}} } // TODO/wishlist: // longReadlen // binmode ?> --- NEW FILE: ibase.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Sterling Hughes <ste...@ph...> | // +----------------------------------------------------------------------+ // // $Id: ibase.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ // // Database independent query interface definition for PHP's Interbase // extension. // require_once 'DB/common.php'; class DB_ibase extends DB_common { var $connection; var $phptype, $dbsyntax; var $autocommit = 1; var $manip_query = array(); function DB_ibase() { $this->DB_common(); $this->phptype = 'ibase'; $this->dbsyntax = 'ibase'; $this->features = array( 'prepare' => true, 'pconnect' => true, 'transactions' => true, 'limit' => false ); // just a few of the tons of Interbase error codes listed in the // Language Reference section of the Interbase manual $this->errorcode_map = array( -104 => DB_ERROR_SYNTAX, -150 => DB_ERROR_ACCESS_VIOLATION, -151 => DB_ERROR_ACCESS_VIOLATION, -155 => DB_ERROR_NOSUCHTABLE, -157 => DB_ERROR_NOSUCHFIELD, -158 => DB_ERROR_VALUE_COUNT_ON_ROW, -170 => DB_ERROR_MISMATCH, -171 => DB_ERROR_MISMATCH, -172 => DB_ERROR_INVALID, -204 => DB_ERROR_INVALID, -205 => DB_ERROR_NOSUCHFIELD, -206 => DB_ERROR_NOSUCHFIELD, -208 => DB_ERROR_INVALID, -219 => DB_ERROR_NOSUCHTABLE, -297 => DB_ERROR_CONSTRAINT, -530 => DB_ERROR_CONSTRAINT, -803 => DB_ERROR_CONSTRAINT, -551 => DB_ERROR_ACCESS_VIOLATION, -552 => DB_ERROR_ACCESS_VIOLATION, -922 => DB_ERROR_NOSUCHDB, -923 => DB_ERROR_CONNECT_FAILED, -924 => DB_ERROR_CONNECT_FAILED ); } function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('interbase')) { return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); } $this->dsn = $dsninfo; $user = $dsninfo['username']; $pw = $dsninfo['password']; $dbhost = $dsninfo['hostspec'] ? ($dsninfo['hostspec'] . ':/' . $dsninfo['database']) : $dsninfo['database']; $connect_function = $persistent ? 'ibase_pconnect' : 'ibase_connect'; $params = array(); $params[] = $dbhost; $params[] = !empty($user) ? $user : null; $params[] = !empty($pw) ? $pw : null; $params[] = isset($dsninfo['charset']) ? $dsninfo['charset'] : null; $params[] = isset($dsninfo['buffers']) ? $dsninfo['buffers'] : null; $params[] = isset($dsninfo['dialect']) ? $dsninfo['dialect'] : null; $params[] = isset($dsninfo['role']) ? $dsninfo['role'] : null; /* if ($dbhost && $user && $pw) { $conn = $connect_function($dbhost, $user, $pw); } elseif ($dbhost && $user) { $conn = $connect_function($dbhost, $user); } elseif ($dbhost) { $conn = $connect_function($dbhost); } else { return $this->raiseError("no host, user or password"); } */ $conn = @call_user_func_array($connect_function, $params); if (!$conn) { return $this->ibaseRaiseError(DB_ERROR_CONNECT_FAILED); } $this->connection = $conn; return DB_OK; } function disconnect() { $ret = @ibase_close($this->connection); $this->connection = null; return $ret; } function simpleQuery($query) { $ismanip = DB::isManip($query); $this->last_query = $query; $query = $this->modifyQuery($query); $result = @ibase_query($this->connection, $query); if (!$result) { return $this->ibaseRaiseError(); } if ($this->autocommit && $ismanip) { ibase_commit($this->connection); } // Determine which queries that should return data, and which // should return an error code only. return DB::isManip($query) ? DB_OK : $result; } // {{{ modifyLimitQuery() /** * This method is used by backends to alter limited queries * Uses the new FIRST n SKIP n Firebird 1.0 syntax, so it is * only compatible with Firebird 1.x * * @param string $query query to modify * @param integer $from the row to start to fetching * @param integer $count the numbers of rows to fetch * * @return the new (modified) query * @author Ludovico Magnocavallo <lu...@su...> * @access private */ function modifyLimitQuery($query, $from, $count) { if ($this->dsn['dbsyntax'] == 'firebird') { $from++; // SKIP starts from 1, ie SKIP 1 starts from the first record $query = preg_replace('/^\s*select\s(.*)$/is', "SELECT FIRST $count SKIP $from $1", $query); } return $query; } // }}} // {{{ nextResult() /** * Move the internal ibase result pointer to the next available result * * @param a valid fbsql result resource * * @access public * * @return true if a result is available otherwise return false */ function nextResult($result) { return false; } // }}} function fetchInto($result, &$ar, $fetchmode, $rownum = null) { if ($rownum !== NULL) { return $this->ibaseRaiseError(DB_ERROR_NOT_CAPABLE); } if ($fetchmode & DB_FETCHMODE_ASSOC) { $ar = get_object_vars(ibase_fetch_object($result)); if ($ar && $this->options['optimize'] == 'portability') { $ar = array_change_key_case($ar, CASE_LOWER); } } else { $ar = ibase_fetch_row($result); } if (!$ar) { if ($errmsg = ibase_errmsg()) { return $this->ibaseRaiseError(null, $errmsg); } else { return null; } } return DB_OK; } function freeResult() { if (is_resource($result)) { return ibase_free_result($result); } if (!isset($this->prepare_tokens[(int)$result])) { return false; } unset($this->prepare_tokens[(int)$result]); unset($this->prepare_types[(int)$result]); return true; } function freeQuery($query) { ibase_free_query($query); return true; } function numCols($result) { $cols = ibase_num_fields($result); if (!$cols) { return $this->ibaseRaiseError(); } return $cols; } function prepare($query) { $this->last_query = $query; $query = $this->modifyQuery($query); $stmt = ibase_prepare($query); $this->manip_query[(int)$stmt] = DB::isManip($query); return $stmt; } function execute($stmt, $data = false) { $result = ibase_execute($stmt, $data); if (!$result) { return $this->ibaseRaiseError(); } if ($this->autocommit) { ibase_commit($this->connection); } return DB::isManip($this->manip_query[(int)$stmt]) ? DB_OK : new DB_result($this, $result); } function autoCommit($onoff = false) { $this->autocommit = $onoff ? 1 : 0; return DB_OK; } function commit() { return ibase_commit($this->connection); } function rollback($trans_number) { return ibase_rollback($this->connection, $trans_number); } function transactionInit($trans_args = 0) { return $trans_args ? ibase_trans($trans_args, $this->connection) : ibase_trans(); } // {{{ nextId() /** * Get the next value in a sequence. * * If the sequence does not exist, it will be created, * unless $ondemand is false. * * @access public * @param string $seq_name the name of the sequence * @param bool $ondemand whether to create the sequence on demand * @return a sequence integer, or a DB error */ function nextId($seq_name, $ondemand = true) { $sqn = strtoupper(preg_replace('/[^a-z0-9_]/i', '_', $seq_name)); $repeat = 0; do { $this->pushErrorHandling(PEAR_ERROR_RETURN); $result = $this->query("SELECT GEN_ID(${sqn}_SEQ, 1) FROM RDB\$GENERATORS" ." WHERE RDB\$GENERATOR_NAME='${sqn}_SEQ'"); $this->popErrorHandling(); if ($ondemand && DB::isError($result)) { $repeat = 1; $result = $this->createSequence($seq_name); if (DB::isError($result)) { return $result; } } else { $repeat = 0; } } while ($repeat); if (DB::isError($result)) { return $result; } $arr = $result->fetchRow(DB_FETCHMODE_ORDERED); $result->free(); return $arr[0]; } // }}} // {{{ createSequence() /** * Create the sequence * * @param string $seq_name the name of the sequence * @return mixed DB_OK on success or DB error on error * @access public */ function createSequence($seq_name) { $sqn = strtoupper(preg_replace('/[^a-z0-9_]/i', '_', $seq_name)); $this->pushErrorHandling(PEAR_ERROR_RETURN); $result = $this->query("CREATE GENERATOR ${sqn}_SEQ"); $this->popErrorHandling(); return $result; } // }}} // {{{ dropSequence() /** * Drop a sequence * * @param string $seq_name the name of the sequence * @return mixed DB_OK on success or DB error on error * @access public */ function dropSequence($seq_name) { $sqn = strtoupper(preg_replace('/[^a-z0-9_]/i', '_', $seq_name)); return $this->query("DELETE FROM RDB\$GENERATORS WHERE RDB\$GENERATOR_NAME='${sqn}_SEQ'"); } // }}} // {{{ _ibaseFieldFlags() /** * get the Flags of a Field * * @param string $field_name the name of the field * @param string $table_name the name of the table * * @return string The flags of the field ("primary_key", "unique_key", "not_null" * "default", "computed" and "blob" are supported) * @access private */ function _ibaseFieldFlags($field_name, $table_name) { $sql = 'SELECT R.RDB$CONSTRAINT_TYPE CTYPE' .' FROM RDB$INDEX_SEGMENTS I' .' JOIN RDB$RELATION_CONSTRAINTS R ON I.RDB$INDEX_NAME=R.RDB$INDEX_NAME' .' WHERE I.RDB$FIELD_NAME=\''.$field_name.'\'' .' AND R.RDB$RELATION_NAME=\''.$table_name.'\''; $result = ibase_query($this->connection, $sql); if (empty($result)) { return $this->ibaseRaiseError(); } if ($obj = @ibase_fetch_object($result)) { ibase_free_result($result); if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'PRIMARY KEY') { $flags = 'primary_key '; } if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'UNIQUE') { $flags .= 'unique_key '; } } $sql = 'SELECT R.RDB$NULL_FLAG AS NFLAG,' .' R.RDB$DEFAULT_SOURCE AS DSOURCE,' .' F.RDB$FIELD_TYPE AS FTYPE,' .' F.RDB$COMPUTED_SOURCE AS CSOURCE' .' FROM RDB$RELATION_FIELDS R ' .' JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME' .' WHERE R.RDB$RELATION_NAME=\''.$table_name.'\'' .' AND R.RDB$FIELD_NAME=\''.$field_name.'\''; $result = ibase_query($this->connection, $sql); if (empty($result)) { return $this->ibaseRaiseError(); } if ($obj = @ibase_fetch_object($result)) { ibase_free_result($result); if (isset($obj->NFLAG)) { $flags .= 'not_null '; } if (isset($obj->DSOURCE)) { $flags .= 'default '; } if (isset($obj->CSOURCE)) { $flags .= 'computed '; } if (isset($obj->FTYPE) && $obj->FTYPE == 261) { $flags .= 'blob '; } } return trim($flags); } // }}} // {{{ tableInfo() /** * Returns information about a table or a result set * * NOTE: doesn't support 'flags'and 'table' if called from a db_result * * @param mixed $resource Interbase result identifier or table name * @param int $mode A valid tableInfo mode (DB_TABLEINFO_ORDERTABLE or * DB_TABLEINFO_ORDER) * * @return array An array with all the information */ function tableInfo($result, $mode = null) { $count = 0; $id = 0; $res = array(); /* * depending on $mode, metadata returns the following values: * * - mode is false (default): * $result[]: * [0]["table"] table name * [0]["name"] field name * [0]["type"] field type * [0]["len"] field length * [0]["flags"] field flags * * - mode is DB_TABLEINFO_ORDER * $result[]: * ["num_fields"] number of metadata records * [0]["table"] table name * [0]["name"] field name * [0]["type"] field type * [0]["len"] field length * [0]["flags"] field flags * ["order"][field name] index of field named "field name" * The last one is used, if you have a field name, but no index. * Test: if (isset($result['meta']['myfield'])) { ... * * - mode is DB_TABLEINFO_ORDERTABLE * the same as above. but additionally * ["ordertable"][table name][field name] index of field * named "field name" * * this is, because if you have fields from different * tables with the same field name * they override each * other with DB_TABLEINFO_ORDER * * you can combine DB_TABLEINFO_ORDER and * DB_TABLEINFO_ORDERTABLE with DB_TABLEINFO_ORDER | * DB_TABLEINFO_ORDERTABLE * or with DB_TABLEINFO_FULL */ // if $result is a string, then we want information about a // table without a resultset if (is_string($result)) { $id = ibase_query($this->connection,"SELECT * FROM $result"); if (empty($id)) { return $this->ibaseRaiseError(); } } else { // else we want information about a resultset $id = $result; if (empty($id)) { return $this->ibaseRaiseError(); } } $count = @ibase_num_fields($id); // made this IF due to performance (one if is faster than $count if's) if (empty($mode)) { for ($i=0; $i<$count; $i++) { $info = @ibase_field_info($id, $i); $res[$i]['table'] = (is_string($result)) ? $result : ''; $res[$i]['name'] = $info['name']; $res[$i]['type'] = $info['type']; $res[$i]['len'] = $info['length']; $res[$i]['flags'] = (is_string($result)) ? $this->_ibaseFieldFlags($info['name'], $result) : ''; } } else { // full $res["num_fields"]= $count; for ($i=0; $i<$count; $i++) { $info = @ibase_field_info($id, $i); $res[$i]['table'] = (is_string($result)) ? $result : ''; $res[$i]['name'] = $info['name']; $res[$i]['type'] = $info['type']; $res[$i]['len'] = $info['length']; $res[$i]['flags'] = (is_string($result)) ? $this->_ibaseFieldFlags($info['name'], $result) : ''; if ($mode & DB_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & DB_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } } } // free the result only if we were called on a table if (is_resource($id)) { ibase_free_result($id); } return $res; } // }}} // {{{ getSpecialQuery() /** * Returns the query needed to get some backend info * @param string $type What kind of info you want to retrieve * @return string The SQL query string */ function getSpecialQuery($type) { switch ($type) { case 'tables': default: return null; } return $sql; } // }}} // {{{ ibaseRaiseError() function ibaseRaiseError($errno = null, $errmsg = null) { if ($errmsg === null) $errmsg = ibase_errmsg(); // memo for the interbase php module hackers: we need something similar // to mysql_errno() to retrieve error codes instead of this ugly hack if (preg_match('/^([^0-9\-]+)([0-9\-]+)\s+(.*)$/', $errmsg, $m)) { if ($errno === null) { $ibase_errno = (int)$m[2]; // try to interpret Interbase error code (that's why we need ibase_errno() // in the interbase module to return the real error code) switch ($ibase_errno) { case -204: if (is_int(strpos($m[3], 'Table unknown'))) { $errno = DB_ERROR_NOSUCHTABLE; } break; default: $errno = $this->errorCode($ibase_errno); } } $errmsg = $m[2] . ' ' . $m[3]; } return $this->raiseError($errno, null, null, $errmsg, $this->last_query); } // }}} } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ ?> --- NEW FILE: ifx.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Tomas V.V.Cox <co...@id...> | // +----------------------------------------------------------------------+ // // $Id: ifx.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ // // Database independent query interface definition for PHP's Informix // extension. // // Legend: // For more info on Informix errors see: // http://www.informix.com/answers/english/ierrors.htm // // TODO: // - set needed env Informix vars on connect // - implement native prepare/execute require_once 'DB/common.php'; class DB_ifx extends DB_common { var $connection; var $affected = 0; var $dsn = array(); var $fetchmode = DB_FETCHMODE_ORDERED; /* Default fetch mode */ function DB_ifx() { $this->phptype = 'ifx'; $this->dbsyntax = 'ifx'; $this->features = array( 'prepare' => false, 'pconnect' => true, 'transactions' => false, 'limit' => 'emulate' ); $this->errorcode_map = array( '-201' => DB_ERROR_SYNTAX, '-206' => DB_ERROR_NOSUCHTABLE, '-217' => DB_ERROR_NOSUCHFIELD, '-329' => DB_ERROR_NODBSELECTED, '-1204' => DB_ERROR_INVALID_DATE, '-1205' => DB_ERROR_INVALID_DATE, '-1206' => DB_ERROR_INVALID_DATE, '-1209' => DB_ERROR_INVALID_DATE, '-1210' => DB_ERROR_INVALID_DATE, '-1212' => DB_ERROR_INVALID_DATE ); } /** * Connect to a database and log in as the specified user. * * @param $dsn the data source name (see DB::parseDSN for syntax) * @param $persistent (optional) whether the connection should * be persistent * * @return int DB_OK on success, a DB error code on failure */ function connect(&$dsninfo, $persistent = false) { if (!DB::assertExtension('informix')) return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); $this->dsn = $dsninfo; $dbhost = $dsninfo['hostspec'] ? '@' . $dsninfo['hostspec'] : ''; $dbname = $dsninfo['database'] ? $dsninfo['database'] . $dbhost : ''; $user = $dsninfo['username'] ? $dsninfo['username'] : ''; $pw = $dsninfo['password'] ? $dsninfo['password'] : ''; $connect_function = $persistent ? 'ifx_pconnect' : 'ifx_connect'; $this->connection = @$connect_function($dbname, $user, $pw); if (!is_resource($this->connection)) { return $this->ifxraiseError(DB_ERROR_CONNECT_FAILED); } return DB_OK; } /** * Log out and disconnect from the database. * * @return bool TRUE on success, FALSE if not connected. */ function disconnect() { $ret = @ifx_close($this->connection); $this->connection = null; return $ret; } /** * Send a query to Informix and return the results as a * Informix resource identifier. * * @param $query the SQL query * * @return int returns a valid Informix result for successful SELECT * queries, DB_OK for other successful queries. A DB error code * is returned on failure. */ function simpleQuery($query) { $this->last_query = $query; if (preg_match('/(SELECT)/i', $query)) { //TESTME: Use !DB::isManip()? // the scroll is needed for fetching absolute row numbers // in a select query result $result = @ifx_query($query, $this->connection, IFX_SCROLL); } else { $result = @ifx_query($query, $this->connection); } if (!$result) { return $this->ifxraiseError(); } $this->affected = ifx_affected_rows ($result); // Determine which queries that should return data, and which // should return an error code only. if (preg_match('/(SELECT)/i', $query)) { return $result; } return DB_OK; } // {{{ nextResult() /** * Move the internal ifx result pointer to the next available result * * @param a valid fbsql result resource * * @access public * * @return true if a result is available otherwise return false */ function nextResult($result) { return false; } // }}} /** * Gets the number of rows affected by the last query. * if the last query was a select, returns an _estimate_ value. * * @return number of rows affected by the last query */ function affectedRows() { return $this->affected; } /** * Fetch and return a row of data (it uses fetchInto for that) * @param $result Informix result identifier * @param $fetchmode format of fetched row array * @param $rownum the absolute row number to fetch * * @return array a row of data, or false on error */ function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) { if ($fetchmode == DB_FETCHMODE_DEFAULT) { $fetchmode = $this->fetchmode; } $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); if ($res !== DB_OK) { return $res; } return $arr; } /** * Fetch a row and return as array. * * @param $result Informix result identifier * @param $row (reference) array where data from the row is stored * @param $fetchmode how the resulting array should be indexed * @param $rownum the row number to fetch * * @return int an array on success, a DB error code on failure, NULL * if there is no more data */ function fetchInto($result, &$row, $fetchmode, $rownum=null) { if (($rownum !== null) && ($rownum < 0)) { return null; } // if $rownum is null, fetch row will return the next row if (!$row = @ifx_fetch_row($result, $rownum)) { return null; } if ($fetchmode !== DB_FETCHMODE_ASSOC) { $i=0; $order = array(); foreach ($row as $key => $val) { $order[$i++] = $val; } $row = $order; } return DB_OK; } function numRows($result) { return $this->raiseError(DB_ERROR_NOT_CAPABLE); } /** * Get the number of columns in a result set. * * @param $result Informix result identifier * * @return int the number of columns per row in $result */ function numCols($result) { if (!$cols = @ifx_num_fields($result)) { return $this->ifxraiseError(); } return $cols; } /** * Free the internal resources associated with $result. * * @param $result Informix result identifier * * @return bool TRUE on success, DB_error on error */ function freeResult($result) { if (is_resource($result)) { if (!@ifx_free_result($result)) { return $this->ifxraiseError(); } return true; } if (!isset($this->prepare_tokens[(int)$result])) { return false; } unset($this->prepare_tokens[(int)$result]); unset($this->prepare_types[(int)$result]); return true; } function ifxraiseError($errno = null) { if ($errno === null) { $errno = $this->errorCode(ifx_error()); } return $this->raiseError($errno, null, null, null, $this->errorNative()); } /** * Map native error codes to DB's portable ones. Requires that * the DB implementation's constructor fills in the $errorcode_map * property. * * @return int a portable DB error code, or DB_ERROR if this DB * implementation has no mapping for the given error code. */ function errorCode($nativecode) { if (ereg('SQLCODE=(.*)]', $nativecode, $match)) { $code = $match[1]; if (isset($this->errorcode_map[$code])) { return $this->errorcode_map[$code]; } } return DB_ERROR; } /** * Get the native error message of the last error (if any) that * occured on the current connection. * * @return int native Informix error code */ function errorNative() { return ifx_error() . ' ' . ifx_errormsg(); } // {{{ getSpecialQuery() /** * Returns the query needed to get some backend info * @param string $type What kind of info you want to retrieve * @return string The SQL query string */ function getSpecialQuery($type) { switch ($type) { case 'tables': default: return null; } return $sql; } // }}} } ?> --- NEW FILE: msql.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Sterling Hughes <ste...@ph...> | // +----------------------------------------------------------------------+ // // $Id: msql.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ // // Database independent query interface definition for PHP's Mini-SQL // extension. // require_once 'DB/common.php'; class DB_msql extends DB_common { var $connection; var $phptype, $dbsyntax; var $prepare_tokens = array(); var $prepare_types = array(); function DB_msql() { $this->DB_common(); $this->phptype = 'msql'; $this->dbsyntax = 'msql'; $this->features = array( 'prepare' => false, 'pconnect' => true, 'transactions' => false, 'limit' => 'emulate' ); } function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('msql')) return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); $this->dsn = $dsninfo; $user = $dsninfo['username']; $pw = $dsninfo['password']; $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost'; $connect_function = $persistent ? 'msql_pconnect' : 'msql_connect'; if ($dbhost && $user && $pw) { $conn = $connect_function($dbhost, $user, $pw); } elseif ($dbhost && $user) { $conn = $connect_function($dbhost,$user); } else { $conn = $connect_function($dbhost); } if (!$conn) { $this->raiseError(DB_ERROR_CONNECT_FAILED); } if (!@msql_select_db($dsninfo['database'], $conn)){ return $this->raiseError(DB_ERROR_NODBSELECTED); } $this->connection = $conn; return DB_OK; } function disconnect() { $ret = @msql_close($this->connection); $this->connection = null; return $ret; } function simpleQuery($query) { $this->last_query = $query; $query = $this->modifyQuery($query); $result = @msql_query($query, $this->connection); if (!$result) { return $this->raiseError(); } // Determine which queries that should return data, and which // should return an error code only. return DB::isManip($query) ? DB_OK : $result; } // {{{ nextResult() /** * Move the internal msql result pointer to the next available result * * @param a valid fbsql result resource * * @access public * * @return true if a result is available otherwise return false */ function nextResult($result) { return false; } // }}} function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) { if ($fetchmode == DB_FETCHMODE_DEFAULT) { $fetchmode = $this->fetchmode; } $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); if ($res !== DB_OK) { return $res; } return $arr; } function fetchInto($result, &$ar, $fetchmode, $rownum=null) { if ($rownum !== null) { if (!@msql_data_seek($result, $rownum)) { return null; } } if ($fetchmode & DB_FETCHMODE_ASSOC) { $ar = @msql_fetch_array($result, MSQL_ASSOC); } else { $ar = @msql_fetch_row($result); } if (!$ar) { if ($error = msql_error()) { return $this->raiseError($error); } else { return null; } } return DB_OK; } function freeResult($result) { if (is_resource($result)) { return @msql_free_result($result); } if (!isset($this->prepare_tokens[$result])) { return false; } unset($this->prepare_tokens[$result]); unset($this->prepare_types[$result]); return true; } function numCols($result) { $cols = @msql_num_fields($result); if (!$cols) { return $this->raiseError(); } return $cols; } function numRows($result) { $rows = @msql_num_rows($result); if (!$rows) { return $this->raiseError(); } return $rows; } /** * Gets the number of rows affected by a query. * * @return number of rows affected by the last query */ function affectedRows() { return @msql_affected_rows($this->connection); } // {{{ getSpecialQuery() /** * Returns the query needed to get some backend info * @param string $type What kind of info you want to retrieve * @return string The SQL query string */ function getSpecialQuery($type) { switch ($type) { case 'tables': default: return null; } return $sql; } // }}} } ?> --- NEW FILE: mssql.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Sterling Hughes <ste...@ph...> | // +----------------------------------------------------------------------+ // // $Id: mssql.php,v 1.1 2002/09/13 18:07:51 bcurtis Exp $ // // Database independent query interface definition for PHP's Microsoft SQL Server // extension. // require_once 'DB/common.php'; class DB_mssql extends DB_common { v... [truncated message content] |