|
From: Javier S. <ja...@us...> - 2001-08-17 14:39:51
|
Update of /cvsroot/phpbt/phpbt/admin
In directory usw-pr-cvs1:/tmp/cvs-serv7513
Modified Files:
version.php user.php status.php resolution.php project.php
os.php component.php
Log Message:
SQL lower case modification, and fields's name change
Index: version.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/version.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- version.php 2001/08/09 13:21:58 1.8
+++ version.php 2001/08/17 14:39:47 1.9
@@ -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.
@@ -24,60 +24,60 @@
include '../include.php';
function do_form($versionid = 0) {
- global $q, $me, $projectid, $version, $active, $STRING, $now, $u;
-
- // Validation
- if (!$version = trim($version))
- $error = $STRING['giveversion'];
- if ($error) { show_form($versionid, $error); return; }
-
- if (!$active) $active = 0;
- if (!$versionid) {
- $q->query("insert into Version (VersionID, ProjectID, Name, Active, CreatedBy, CreatedDate) values (".$q->nextid('Version').", $projectid, '$version', '$active', $u, $now)");
- } else {
- $q->query("update Version set ProjectID = $projectid, Name = '$version', Active = '$active' where VersionID = '$versionid'");
- }
- header("Location: project.php?op=edit&id=$projectid");
-}
+ global $q, $me, $projectid, $version, $active, $STRING, $now, $u;
+ // Validation
+ if (!$version = trim($version))
+ $error = $STRING['giveversion'];
+ if ($error) { show_form($versionid, $error); return; }
+
+ if (!$active) $active = 0;
+ if (!$versionid) {
+ $q->query("insert into version (version_id, project_id, version_name, active, created_by, created_date) values (".$q->nextid('version').", $projectid, '$version', '$active', $u, $now)");
+ } else {
+ $q->query("update version set project_id = $projectid, version_name = '$version', active = '$active' where version_id = '$versionid'");
+ }
+ header("Location: project.php?op=edit&id=$projectid");
+}
+
function show_form($versionid = 0, $error = '') {
- global $q, $me, $t, $projectid, $version, $active, $TITLE;
-
- $t->set_file('content','versionform.html');
- if ($versionid && !$error) {
- $row = $q->grab("select v.*, p.Name as ProjectName from Version v left join Project p using(ProjectID) where VersionID = '$versionid'");
- $t->set_var(array(
- 'versionid' => $row['VersionID'],
- 'projectid' => $row['ProjectID'],
- 'project' => $row['ProjectName'],
- 'version' => $row['Name'],
- 'active' => $row['Active'] ? 'checked' : '',
- 'TITLE' => $TITLE['editversion']));
- } else {
- $t->set_var(array(
- 'id' => $id,
- 'me' => $me,
- 'error' => $error,
- 'versionid' => $versionid,
- 'projectid' => $projectid,
- 'project' => $q->grab_field("select Name from Project where ProjectID = $projectid"),
- 'version' => $version,
- 'active' => $active ? ' checked' : '',
- 'TITLE' => $id ? $TITLE['editversion'] : $TITLE['addversion']));
- }
+ global $q, $me, $t, $projectid, $version, $active, $TITLE;
+
+ $t->set_file('content','versionform.html');
+ if ($versionid && !$error) {
+ $row = $q->grab("select v.*, p.project_name as project_name from version v left join project p using(project_id) where version_id = '$versionid'");
+ $t->set_var(array(
+ 'versionid' => $row['version_id'],
+ 'projectid' => $row['project_id'],
+ 'project' => $row['project_name'],
+ 'version' => $row['version_name'],
+ 'active' => $row['active'] ? 'checked' : '',
+ 'TITLE' => $TITLE['editversion']));
+ } else {
+ $t->set_var(array(
+ 'id' => $id,
+ 'me' => $me,
+ 'error' => $error,
+ 'versionid' => $versionid,
+ 'projectid' => $projectid,
+ 'project' => $q->grab_field("select project_name from project where project_id = $projectid"),
+ 'version' => $version,
+ 'active' => $active ? ' checked' : '',
+ 'TITLE' => $id ? $TITLE['editversion'] : $TITLE['addversion']));
+ }
}
$t->set_file('wrap','wrap.html');
if ($op) switch($op) {
- case 'add' : show_form(); break;
- case 'edit' : show_form($id); break;
-} elseif($submit) {
- do_form($id);
+ case 'add' : show_form(); break;
+ case 'edit' : show_form($id); break;
+} elseif($submit) {
+ do_form($id);
} else list_items();
$t->pparse('main',array('content','wrap','main'));
page_close();
-?>
+?>
\ No newline at end of file
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/user.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- user.php 2001/08/09 13:21:58 1.13
+++ user.php 2001/08/17 14:39:47 1.14
@@ -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.
@@ -24,113 +24,113 @@
include '../include.php';
function do_form($userid = 0) {
- global $q, $me, $ffirstname, $flastname, $femail, $fpassword, $usertype, $STRING, $now;
-
- // Validation
- if (!valid_email($femail))
- $error = $STRING['giveemail'];
- elseif (!$fpassword = trim($fpassword))
- $error = $STRING['givepassword'];
- if ($error) { list_items($userid, $error); return; }
-
- if (!$userid) {
- if (ENCRYPTPASS) $mpassword = md5($fpassword);
- else $mpassword = $fpassword;
- $q->query("insert into User (UserID, FirstName, LastName, Email, Password, UserLevel, CreatedDate) values (".$q->nextid('User').", '$ffirstname', '$flastname', '$femail', '$mpassword', $usertype, $now)");
- } else {
- if (ENCRYPTPASS) {
- $oldpass = $q->grab_field("select Password from User where UserID = $userid");
- if ($oldpass != $fpassword) {
- $pquery = "Password = '".md5($fpassword)."',";
- } else {
- $pquery = '';
- }
- } else {
- $pquery = "Password = '$fpassword',";
- }
- $q->query("update User set FirstName = '$ffirstname', LastName = '$flastname', Email = '$femail', $pquery UserLevel = $usertype where UserID = '$userid'");
- }
- header("Location: $me?");
-}
+ global $q, $me, $ffirstname, $flastname, $femail, $fpassword, $usertype, $STRING, $now;
+ // Validation
+ if (!valid_email($femail))
+ $error = $STRING['giveemail'];
+ elseif (!$fpassword = trim($fpassword))
+ $error = $STRING['givepassword'];
+ if ($error) { list_items($userid, $error); return; }
+
+ if (!$userid) {
+ if (ENCRYPTPASS) $mpassword = md5($fpassword);
+ else $mpassword = $fpassword;
+ $q->query("insert into user (user_id, first_name, last_name, email, password, user_level, created_date) values (".$q->nextid('user').", '$ffirstname', '$flastname', '$femail', '$mpassword', $usertype, $now)");
+ } else {
+ if (ENCRYPTPASS) {
+ $oldpass = $q->grab_field("select password from user where user_id = $userid");
+ if ($oldpass != $fpassword) {
+ $pquery = "password = '".md5($fpassword)."',";
+ } else {
+ $pquery = '';
+ }
+ } else {
+ $pquery = "password = '$fpassword',";
+ }
+ $q->query("update user set first_name = '$ffirstname', last_name = '$flastname', email = '$femail', $pquery user_level = $usertype where user_id = '$userid'");
+ }
+ header("Location: $me?");
+}
+
function show_form($userid = 0, $error = '') {
- global $q, $me, $t, $firstname, $lastname, $email, $password, $usertype, $STRING;
-
- if ($userid && !$error) {
- $row = $q->grab("select * from User where UserID = '$userid'");
- $t->set_var(array(
- 'action' => $STRING['edit'],
- 'fuserid' => $row['UserID'],
- 'ffirstname' => stripslashes($row['FirstName']),
- 'flastname' => stripslashes($row['LastName']),
- 'femail' => $row['Email'],
- 'fpassword' => $row['Password'],
- 'usertype' => build_select('authlevels',$row['UserLevel']),
- 'createddate' => $row['CreatedDate']));
- } else {
- $t->set_var(array(
- 'action' => $userid ? $STRING['edit'] : $STRING['addnew'],
- 'error' => $error,
- 'fuserid' => $userid,
- 'ffirstname' => stripslashes($firstname),
- 'flastname' => stripslashes($lastname),
- 'femail' => $email,
- 'fpassword' => $password ? $password : genpassword(10),
- 'usertype' => build_select('authlevels',$usertype),
- 'createddate' => $createddate));
- }
+ global $q, $me, $t, $firstname, $lastname, $email, $password, $usertype, $STRING;
+
+ if ($userid && !$error) {
+ $row = $q->grab("select * from user where user_id = '$userid'");
+ $t->set_var(array(
+ 'action' => $STRING['edit'],
+ 'fuserid' => $row['user_id'],
+ 'ffirstname' => stripslashes($row['first_name']),
+ 'flastname' => stripslashes($row['last_name']),
+ 'femail' => $row['email'],
+ 'fpassword' => $row['password'],
+ 'usertype' => build_select('authlevels',$row['user_level']),
+ 'createddate' => $row['created_date']));
+ } else {
+ $t->set_var(array(
+ 'action' => $userid ? $STRING['edit'] : $STRING['addnew'],
+ 'error' => $error,
+ 'fuserid' => $userid,
+ 'ffirstname' => stripslashes($firstname),
+ 'flastname' => stripslashes($lastname),
+ 'femail' => $email,
+ 'fpassword' => $password ? $password : genpassword(10),
+ 'usertype' => build_select('authlevels',$usertype),
+ 'createddate' => $createddate));
+ }
}
function list_items($userid = 0, $error = '') {
- global $me, $q, $t, $selrange, $order, $sort, $select, $STRING, $TITLE, $page;
-
- $t->set_file('content','userlist.html');
- $t->set_block('content','row','rows');
-
- if (!$order) { $order = '1'; $sort = 'asc'; }
- $nr = $q->grab_field("select count(*) from User");
-
- list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
- "order=$order&sort=$sort");
-
- $t->set_var(array(
- 'pages' => '[ '.$pages.' ]',
- 'first' => $llimit+1,
- 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
- 'records' => $nr));
-
- $q->query("select UserID, concat(FirstName,' ',LastName) as FullName, Email,
- CreatedDate, UserLevel from User order by $order $sort
- limit $llimit, $selrange");
-
- if (!$q->num_rows()) {
- $t->set_var('rows',"<tr><td>{$STRING['nousers']}</td></tr>");
- return;
- }
-
- $headers = array(
- 'userid' => 'UserID',
- 'name' => 'LastName',
- 'login' => 'Email',
- 'password' => 'Password',
- 'userlevel' => 'UserLevel',
- 'date' => 'CreatedDate');
-
- sorting_headers($me, $headers, $order, $sort);
-
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'userid' => $row['UserID'],
- 'name' => stripslashes($row['FullName']),
- 'email' => $row['Email'],
- 'userlevel' => $select['authlevels'][$row['UserLevel']],
- 'date' => date(DATEFORMAT,$row['CreatedDate'])));
- $t->parse('rows','row',true);
- }
-
- show_form($userid, $error);
- $t->set_var('TITLE',$TITLE['user']);
+ global $me, $q, $t, $selrange, $order, $sort, $select, $STRING, $TITLE, $page;
+
+ $t->set_file('content','userlist.html');
+ $t->set_block('content','row','rows');
+
+ if (!$order) { $order = '1'; $sort = 'asc'; }
+ $nr = $q->grab_field("select count(*) from user");
+
+ list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
+ "order=$order&sort=$sort");
+
+ $t->set_var(array(
+ 'pages' => '[ '.$pages.' ]',
+ 'first' => $llimit+1,
+ 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
+ 'records' => $nr));
+
+ $q->query("select user_id, concat(first_name,' ',last_name) as fullname, email,
+ created_date, user_level from user order by $order $sort
+ limit $llimit, $selrange");
+
+ if (!$q->num_rows()) {
+ $t->set_var('rows',"<tr><td>{$STRING['nousers']}</td></tr>");
+ return;
+ }
+
+ $headers = array(
+ 'userid' => 'user_id',
+ 'name' => 'last_name',
+ 'login' => 'email',
+ 'password' => 'password',
+ 'userlevel' => 'user_level',
+ 'date' => 'created_date');
+
+ sorting_headers($me, $headers, $order, $sort);
+
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'userid' => $row['user_id'],
+ 'name' => stripslashes($row['fullname']),
+ 'email' => $row['email'],
+ 'userlevel' => $select['authlevels'][$row['user_level']],
+ 'date' => date(DATEFORMAT,$row['created_date'])));
+ $t->parse('rows','row',true);
+ }
+
+ show_form($userid, $error);
+ $t->set_var('TITLE',$TITLE['user']);
}
$t->set_file('wrap','wrap.html');
@@ -138,14 +138,14 @@
$perm->check('Administrator');
if ($op) switch($op) {
- case 'add' : list_items(); break;
- case 'edit' : list_items($id); break;
-} elseif($submit) {
- do_form($id);
+ case 'add' : list_items(); break;
+ case 'edit' : list_items($id); break;
+} elseif($submit) {
+ do_form($id);
} else list_items();
$t->pparse('main',array('content','wrap','main'));
page_close();
-?>
+?>
\ No newline at end of file
Index: status.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/status.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- status.php 2001/08/09 12:54:47 1.8
+++ status.php 2001/08/17 14:39:47 1.9
@@ -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.
@@ -24,91 +24,91 @@
include '../include.php';
function do_form($statusid = 0) {
- global $q, $me, $fname, $fdescription, $fsortorder, $STRING;
-
- // Validation
- if (!$fname = trim($fname))
- $error = $STRING['givename'];
- elseif (!$fdescription = trim($fdescription))
- $error = $STRING['givedesc'];
- if ($error) { list_items($statusid, $error); return; }
-
- if (!$statusid) {
- $q->query("insert into Status (StatusID, Name, Description, SortOrder) values (".$q->nextid('Status').", '$fname', '$fdescription', '$fsortorder')");
- } else {
- $q->query("update Status set Name = '$fname', Description = '$fdescription', SortOrder = '$fsortorder' where StatusID = '$statusid'");
- }
- header("Location: $me?");
-}
+ global $q, $me, $fname, $fdescription, $fsortorder, $STRING;
+ // Validation
+ if (!$fname = trim($fname))
+ $error = $STRING['givename'];
+ elseif (!$fdescription = trim($fdescription))
+ $error = $STRING['givedesc'];
+ if ($error) { list_items($statusid, $error); return; }
+
+ if (!$statusid) {
+ $q->query("insert into status (status_id, status_name, status_desc, sort_order) values (".$q->nextid('status').", '$fname', '$fdescription', '$fsortorder')");
+ } else {
+ $q->query("update status set status_name = '$fname', status_desc = '$fdescription', sort_order = '$fsortorder' where status_id = '$statusid'");
+ }
+ header("Location: $me?");
+}
+
function show_form($statusid = 0, $error = '') {
- global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
-
- if ($statusid && !$error) {
- $row = $q->grab("select * from Status where StatusID = '$statusid'");
- $t->set_var(array(
- 'action' => $STRING['edit'],
- 'fstatusid' => $row['StatusID'],
- 'fname' => $row['Name'],
- 'fdescription' => $row['Description'],
- 'fsortorder' => $row['SortOrder']));
- } else {
- $t->set_var(array(
- 'action' => $statusid ? $STRING['edit'] : $STRING['addnew'],
- 'error' => $error,
- 'fstatusid' => $statusid,
- 'fname' => $fname,
- 'fdescription' => $fdescription,
- 'fsortorder' => $fsortorder));
- }
+ global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
+
+ if ($statusid && !$error) {
+ $row = $q->grab("select * from status where status_id = '$statusid'");
+ $t->set_var(array(
+ 'action' => $STRING['edit'],
+ 'fstatusid' => $row['status_id'],
+ 'fname' => $row['status_name'],
+ 'fdescription' => $row['status_desc'],
+ 'fsortorder' => $row['sort_order']));
+ } else {
+ $t->set_var(array(
+ 'action' => $statusid ? $STRING['edit'] : $STRING['addnew'],
+ 'error' => $error,
+ 'fstatusid' => $statusid,
+ 'fname' => $fname,
+ 'fdescription' => $fdescription,
+ 'fsortorder' => $fsortorder));
+ }
}
function list_items($statusid = 0, $error = '') {
- global $q, $t, $selrange, $order, $sort, $STRING, $TITLE;
-
- $t->set_file('content','statuslist.html');
- $t->set_block('content','row','rows');
-
- if (!$order) { $order = 'SortOrder'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from Status where StatusID = '$statusid' order by $order $sort");
-
- list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
- "order=$order&sort=$sort");
-
- $t->set_var(array(
- 'pages' => '[ '.$pages.' ]',
- 'first' => $llimit+1,
- 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
- 'records' => $nr));
-
- $q->query("select * from Status order by $order $sort limit $llimit, $selrange");
-
- if (!$q->num_rows()) {
- $t->set_var('rows',"<tr><td>{$STRING['nostatuses']}</td></tr>");
- return;
- }
-
- $headers = array(
- 'statusid' => 'StatusID',
- 'name' => 'Name',
- 'description' => 'Description',
- 'sortorder' => 'SortOrder');
-
- sorting_headers($me, $headers, $order, $sort);
-
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'statusid' => $row['StatusID'],
- 'name' => $row['Name'],
- 'description' => $row['Description'],
- 'sortorder' => $row['SortOrder']));
- $t->parse('rows','row',true);
- }
-
- show_form($statusid, $error);
- $t->set_var('TITLE',$TITLE['status']);
+ global $q, $t, $selrange, $order, $sort, $STRING, $TITLE;
+
+ $t->set_file('content','statuslist.html');
+ $t->set_block('content','row','rows');
+
+ if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
+ $nr = $q->query("select count(*) from status where status_id = '$statusid' order by $order $sort");
+
+ list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
+ "order=$order&sort=$sort");
+
+ $t->set_var(array(
+ 'pages' => '[ '.$pages.' ]',
+ 'first' => $llimit+1,
+ 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
+ 'records' => $nr));
+
+ $q->query("select * from status order by $order $sort limit $llimit, $selrange");
+
+ if (!$q->num_rows()) {
+ $t->set_var('rows',"<tr><td>{$STRING['nostatuses']}</td></tr>");
+ return;
+ }
+
+ $headers = array(
+ 'statusid' => 'status_id',
+ 'name' => 'status_name',
+ 'description' => 'status_desc',
+ 'sortorder' => 'sort_order');
+
+ sorting_headers($me, $headers, $order, $sort);
+
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'statusid' => $row['status_id'],
+ 'name' => $row['status_name'],
+ 'description' => $row['status_desc'],
+ 'sortorder' => $row['sort_order']));
+ $t->parse('rows','row',true);
+ }
+
+ show_form($statusid, $error);
+ $t->set_var('TITLE',$TITLE['status']);
}
$t->set_file('wrap','wrap.html');
@@ -116,14 +116,14 @@
$perm->check('Administrator');
if ($op) switch($op) {
- case 'add' : list_items(); break;
- case 'edit' : list_items($id); break;
-} elseif($submit) {
- do_form($id);
+ case 'add' : list_items(); break;
+ case 'edit' : list_items($id); break;
+} elseif($submit) {
+ do_form($id);
} else list_items();
$t->pparse('main',array('content','wrap','main'));
page_close();
-?>
+?>
\ No newline at end of file
Index: resolution.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/resolution.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- resolution.php 2001/08/09 12:54:47 1.8
+++ resolution.php 2001/08/17 14:39:47 1.9
@@ -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.
@@ -24,91 +24,91 @@
include '../include.php';
function do_form($resolutionid = 0) {
- global $q, $me, $fname, $fdescription, $fsortorder, $STRING;
-
- // Validation
- if (!$fname = trim($fname))
- $error = $STRING['givename'];
- elseif (!$fdescription = trim($fdescription))
- $error = $STRING['givedesc'];
- if ($error) { list_items($resolutionid, $error); return; }
-
- if (!$resolutionid) {
- $q->query("insert into Resolution (ResolutionID, Name, Description, SortOrder) values (".$q->nextid('Resolution').", '$fname', '$fdescription', '$fsortorder')");
- } else {
- $q->query("update Resolution set Name = '$fname', Description = '$fdescription', SortOrder = '$fsortorder' where ResolutionID = '$resolutionid'");
- }
- header("Location: $me?");
-}
+ global $q, $me, $fname, $fdescription, $fsortorder, $STRING;
+ // Validation
+ if (!$fname = trim($fname))
+ $error = $STRING['givename'];
+ elseif (!$fdescription = trim($fdescription))
+ $error = $STRING['givedesc'];
+ if ($error) { list_items($resolutionid, $error); return; }
+
+ if (!$resolutionid) {
+ $q->query("insert into resolution (resolution_id, resolution_name, resolution_desc, sort_order) values (".$q->nextid('resolution').", '$fname', '$fdescription', '$fsortorder')");
+ } else {
+ $q->query("update resolution set resolution_name = '$fname', resolution_desc = '$fdescription', sort_order = '$fsortorder' where resolution_id = '$resolutionid'");
+ }
+ header("Location: $me?");
+}
+
function show_form($resolutionid = 0, $error = '') {
- global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
-
- if ($resolutionid && !$error) {
- $row = $q->grab("select * from Resolution where ResolutionID = '$resolutionid'");
- $t->set_var(array(
- 'action' => $STRING['edit'],
- 'fresolutionid' => $row['ResolutionID'],
- 'fname' => $row['Name'],
- 'fdescription' => $row['Description'],
- 'fsortorder' => $row['SortOrder']));
- } else {
- $t->set_var(array(
- 'action' => $resolutionid ? $STRING['edit'] : $STRING['addnew'],
- 'error' => $error,
- 'fresolutionid' => $resolutionid,
- 'fname' => $fname,
- 'fdescription' => $fdescription,
- 'fsortorder' => $fsortorder));
- }
+ global $q, $me, $t, $fname, $fdescription, $fsortorder, $STRING;
+
+ if ($resolutionid && !$error) {
+ $row = $q->grab("select * from resolution where resolution_id = '$resolutionid'");
+ $t->set_var(array(
+ 'action' => $STRING['edit'],
+ 'fresolutionid' => $row['resolution_id'],
+ 'fname' => $row['resolution_name'],
+ 'fdescription' => $row['resolution_desc'],
+ 'fsortorder' => $row['sort_order']));
+ } else {
+ $t->set_var(array(
+ 'action' => $resolutionid ? $STRING['edit'] : $STRING['addnew'],
+ 'error' => $error,
+ 'fresolutionid' => $resolutionid,
+ 'fname' => $fname,
+ 'fdescription' => $fdescription,
+ 'fsortorder' => $fsortorder));
+ }
}
function list_items($resolutionid = 0, $error = '') {
- global $q, $t, $selrange, $order, $sort, $STRING, $TITLE;
-
- $t->set_file('content','resolutionlist.html');
- $t->set_block('content','row','rows');
-
- if (!$order) { $order = 'SortOrder'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from Resolution where ResolutionID = '$resolutionid' order by $order $sort");
-
- list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
- "order=$order&sort=$sort");
-
- $t->set_var(array(
- 'pages' => '[ '.$pages.' ]',
- 'first' => $llimit+1,
- 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
- 'records' => $nr));
-
- $q->query("select * from Resolution order by $order $sort limit $llimit, $selrange");
-
- if (!$q->num_rows()) {
- $t->set_var('rows',"<tr><td>{$STRING['noresolutions']}</td></tr>");
- return;
- }
-
- $headers = array(
- 'resolutionid' => 'ResolutionID',
- 'name' => 'Name',
- 'description' => 'Description',
- 'sortorder' => 'SortOrder');
-
- sorting_headers($me, $headers, $order, $sort);
-
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'resolutionid' => $row['ResolutionID'],
- 'name' => $row['Name'],
- 'description' => $row['Description'],
- 'sortorder' => $row['SortOrder']));
- $t->parse('rows','row',true);
- }
-
- show_form($resolutionid, $error);
- $t->set_var('TITLE',$TITLE['resolution']);
+ global $q, $t, $selrange, $order, $sort, $STRING, $TITLE;
+
+ $t->set_file('content','resolutionlist.html');
+ $t->set_block('content','row','rows');
+
+ if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
+ $nr = $q->query("select count(*) from resolution where resolution_id = '$resolutionid' order by $order $sort");
+
+ list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
+ "order=$order&sort=$sort");
+
+ $t->set_var(array(
+ 'pages' => '[ '.$pages.' ]',
+ 'first' => $llimit+1,
+ 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
+ 'records' => $nr));
+
+ $q->query("select * from resolution order by $order $sort limit $llimit, $selrange");
+
+ if (!$q->num_rows()) {
+ $t->set_var('rows',"<tr><td>{$STRING['noresolutions']}</td></tr>");
+ return;
+ }
+
+ $headers = array(
+ 'resolutionid' => 'resolution_id',
+ 'name' => 'resolution_name',
+ 'description' => 'resolution_desc',
+ 'sortorder' => 'sort_order');
+
+ sorting_headers($me, $headers, $order, $sort);
+
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'resolutionid' => $row['resolution_id'],
+ 'name' => $row['resolution_name'],
+ 'description' => $row['resolution_desc'],
+ 'sortorder' => $row['sort_order']));
+ $t->parse('rows','row',true);
+ }
+
+ show_form($resolutionid, $error);
+ $t->set_var('TITLE',$TITLE['resolution']);
}
$t->set_file('wrap','wrap.html');
@@ -116,14 +116,14 @@
$perm->check('Administrator');
if ($op) switch($op) {
- case 'add' : list_items(); break;
- case 'edit' : list_items($id); break;
-} elseif($submit) {
- do_form($id);
+ case 'add' : list_items(); break;
+ case 'edit' : list_items($id); break;
+} elseif($submit) {
+ do_form($id);
} else list_items();
$t->pparse('main',array('content','wrap','main'));
page_close();
-
-?>
+
+?>
\ No newline at end of file
Index: project.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/project.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- project.php 2001/08/09 13:21:58 1.9
+++ project.php 2001/08/17 14:39:47 1.10
@@ -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.
@@ -24,173 +24,173 @@
include '../include.php';
function do_form($projectid = 0) {
- global $q, $me, $name, $description, $active, $version, $u, $STRING, $now;
-
- // Validation
- if (!$name = htmlspecialchars(trim($name)))
- $error = $STRING['givename'];
- elseif (!$description = htmlspecialchars(trim($description)))
- $error = $STRING['givedesc'];
- elseif (!projectid and !$version = htmlspecialchars(trim($version)))
- $error = $STRING['giveversion'];
- if ($error) { show_form($projectid, $error); return; }
-
- if (!$active) $active = 0;
- if (!$projectid) {
- $projectid = $q->nextid('Project');
- $q->query("insert into Project (ProjectID, Name, Description, Active, CreatedBy, CreatedDate) values ($projectid , '$name', '$description', $active, $u, $now)");
- $q->query("insert into Version (VersionID, ProjectID, Name, Active, CreatedBy, CreatedDate) values (".$q->nextid('Version').", $projectid, '$version', $active, $u, $now)");
- $location = "component.php?op=add&projectid=$projectid";
- } else {
- $q->query("update Project set Name = '$name', Description = '$description', Active = $active where ProjectID = $projectid");
- $location = "$me?";
- }
- header("Location: $location");
-}
+ global $q, $me, $name, $description, $active, $version, $u, $STRING, $now;
+ // Validation
+ if (!$name = htmlspecialchars(trim($name)))
+ $error = $STRING['givename'];
+ elseif (!$description = htmlspecialchars(trim($description)))
+ $error = $STRING['givedesc'];
+ elseif (!projectid and !$version = htmlspecialchars(trim($version)))
+ $error = $STRING['giveversion'];
+ if ($error) { show_form($projectid, $error); return; }
+
+ if (!$active) $active = 0;
+ if (!$projectid) {
+ $projectid = $q->nextid('project');
+ $q->query("insert into project (project_id, project_name, project_desc, active, created_by, created_date) values ($projectid , '$name', '$description', $active, $u, $now)");
+ $q->query("insert into version (version_id, project_id, version_name, active, created_by, created_date) values (".$q->nextid('version').", $projectid, '$version', $active, $u, $now)");
+ $location = "component.php?op=add&projectid=$projectid";
+ } else {
+ $q->query("update project set project_name = '$name', project_desc = '$description', active = $active where project_id = $projectid");
+ $location = "$me?";
+ }
+ header("Location: $location");
+}
+
function show_form($projectid = 0, $error = '') {
- global $q, $me, $t, $name, $description, $active, $version, $TITLE;
-
- $t->set_file('content','projectform.html');
- $t->set_block('content','box','details');
- $t->set_block('content','vfield','verfield');
- if ($projectid && !$error) {
- $row = $q->grab("select * from Project where ProjectID = $projectid");
- $t->set_var(array(
- 'projectid' => $row['ProjectID'],
- 'name' => $row['Name'],
- 'description' => $row['Description'],
- 'active' => $row['Active'] ? 'checked' : '',
- 'createdby' => $row['CreatedBy'],
- 'createddate' => $row['CreatedDate'],
- 'TITLE' => $TITLE['editproject']
- ));
- } else {
- $t->set_var(array(
- 'error' => $error,
- 'projectid' => $projectid,
- 'name' => $name,
- 'description' => $description,
- 'active' => (isset($active) and !$active) ? '' : 'checked',
- 'createdby' => $createdby,
- 'createddate' => $createddate,
- 'TITLE' => $projectid ? $TITLE['editproject'] : $TITLE['addproject']
- ));
- }
- if ($projectid) {
- $t->set_var('verfield','');
- list_components($projectid);
- list_versions($projectid);
- $t->parse('details','box',true);
- } else {
- $t->set_var(array(
- 'details' => '',
- 'version' => $version
- ));
- $t->parse('verfield','vfield',true);
- }
+ global $q, $me, $t, $name, $description, $active, $version, $TITLE;
+
+ $t->set_file('content','projectform.html');
+ $t->set_block('content','box','details');
+ $t->set_block('content','vfield','verfield');
+ if ($projectid && !$error) {
+ $row = $q->grab("select * from project where project_id = $projectid");
+ $t->set_var(array(
+ 'projectid' => $row['project_id'],
+ 'name' => $row['project_name'],
+ 'description' => $row['project_desc'],
+ 'active' => $row['active'] ? 'checked' : '',
+ 'createdby' => $row['created_by'],
+ 'createddate' => $row['created_date'],
+ 'TITLE' => $TITLE['editproject']
+ ));
+ } else {
+ $t->set_var(array(
+ 'error' => $error,
+ 'projectid' => $projectid,
+ 'name' => $name,
+ 'description' => $description,
+ 'active' => (isset($active) and !$active) ? '' : 'checked',
+ 'createdby' => $createdby,
+ 'createddate' => $createddate,
+ 'TITLE' => $projectid ? $TITLE['editproject'] : $TITLE['addproject']
+ ));
+ }
+ if ($projectid) {
+ $t->set_var('verfield','');
+ list_components($projectid);
+ list_versions($projectid);
+ $t->parse('details','box',true);
+ } else {
+ $t->set_var(array(
+ 'details' => '',
+ 'version' => $version
+ ));
+ $t->parse('verfield','vfield',true);
+ }
}
function list_versions($projectid) {
- global $q, $t, $STRING;
-
- $t->set_block('box','verrow','verrows');
- $q->query("select * from Version where ProjectID = $projectid");
- if (!$q->num_rows()) {
- $t->set_var('verrows',"<tr><td colspan='2' align='center'>{$STRING['noversions']}</td></tr>");
- return;
- }
-
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'verid' => $row['VersionID'],
- 'vername' => $row['Name'],
- 'verdate' => date(DATEFORMAT,$row['CreatedDate']),
- 'veractive' => $row['Active'] ? 'Y' : 'N'
- ));
- $t->parse('verrows','verrow',true);
- }
+ global $q, $t, $STRING;
+
+ $t->set_block('box','verrow','verrows');
+ $q->query("select * from version where project_id = $projectid");
+ if (!$q->num_rows()) {
+ $t->set_var('verrows',"<tr><td colspan='2' align='center'>{$STRING['noversions']}</td></tr>");
+ return;
+ }
+
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'verid' => $row['version_id'],
+ 'vername' => $row['version_name'],
+ 'verdate' => date(DATEFORMAT,$row['created_date']),
+ 'veractive' => $row['active'] ? 'Y' : 'N'
+ ));
+ $t->parse('verrows','verrow',true);
+ }
}
-
+
function list_components($projectid) {
- global $q, $t, $STRING;
-
- $t->set_block('box','row','rows');
- $q->query("select * from Component where ProjectID = $projectid");
- if (!$q->num_rows()) {
- $t->set_var('rows',"<tr><td colspan='2' align='center'>{$STRING['nocomponents']}</td></tr>");
- return;
- }
-
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'compid' => $row['ComponentID'],
- 'compname' => $row['Name'],
- 'compdesc' => stripslashes($row['Description']),
- 'owner' => $row['Owner'],
- 'compactive' => $row['Active'] ? 'Y' : 'N',
- 'createdby' => $row['CreatedBy'],
- 'compdate' => date(DATEFORMAT,$row['CreatedDate']),
- 'lastmodifiedby' => $row['LastModifiedBy'],
- 'lastmodifieddate' => date(DATEFORMAT,$row['LastModifiedDate'])
- ));
- $t->parse('rows','row',true);
- }
+ global $q, $t, $STRING;
+
+ $t->set_block('box','row','rows');
+ $q->query("select * from component where project_id = $projectid");
+ if (!$q->num_rows()) {
+ $t->set_var('rows',"<tr><td colspan='2' align='center'>{$STRING['nocomponents']}</td></tr>");
+ return;
+ }
+
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'compid' => $row['component_id'],
+ 'compname' => $row['component_name'],
+ 'compdesc' => stripslashes($row['project_desc']),
+ 'owner' => $row['Owner'],
+ 'compactive' => $row['active'] ? 'Y' : 'N',
+ 'createdby' => $row['created_by'],
+ 'compdate' => date(DATEFORMAT,$row['created_date']),
+ 'lastmodifiedby' => $row['last_modified_by'],
+ 'lastmodifieddate' => date(DATEFORMAT,$row['last_modified_date'])
+ ));
+ $t->parse('rows','row',true);
+ }
}
function list_items() {
- global $me, $q, $t, $selrange, $order, $sort, $STRING, $TITLE, $page;
-
- $t->set_file('content','projectlist.html');
- $t->set_block('content','row','rows');
-
- if (!$order) { $order = '1'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from Project");
-
- list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
- "order=$order&sort=$sort");
-
- $t->set_var(array(
- 'pages' => '[ '.$pages.' ]',
- 'first' => $llimit+1,
- 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
- 'records' => $nr,
- 'TITLE' => $TITLE['project']
- ));
-
- $q->query("select * from Project order by $order $sort limit $llimit, $selrange");
-
- if (!$q->num_rows()) {
- $t->set_var('rows',"<tr><td>{$STRING['noprojects']}</td></tr>");
- return;
- }
-
- $headers = array(
- 'projectid' => 'ProjectID',
- 'name' => 'Name',
- 'description' => 'Description',
- 'active' => 'Active',
- 'createdby' => 'CreatedBy',
- 'createddate' => 'CreatedDate'
- );
-
- sorting_headers($me, $headers, $order, $sort);
- $i = 0;
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'projectid' => $row['ProjectID'],
- 'name' => $row['Name'],
- 'description' => stripslashes($row['Description']),
- 'active' => $row['Active'] ? 'Y' : 'N',
- 'createdby' => $row['CreatedBy'],
- 'createddate' => date(DATEFORMAT,$row['CreatedDate'])
- ));
- $t->parse('rows','row',true);
- }
+ global $me, $q, $t, $selrange, $order, $sort, $STRING, $TITLE, $page;
+
+ $t->set_file('content','projectlist.html');
+ $t->set_block('content','row','rows');
+
+ if (!$order) { $order = '1'; $sort = 'asc'; }
+ $nr = $q->query("select count(*) from project");
+
+ list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
+ "order=$order&sort=$sort");
+
+ $t->set_var(array(
+ 'pages' => '[ '.$pages.' ]',
+ 'first' => $llimit+1,
+ 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
+ 'records' => $nr,
+ 'TITLE' => $TITLE['project']
+ ));
+
+ $q->query("select * from project order by $order $sort limit $llimit, $selrange");
+
+ if (!$q->num_rows()) {
+ $t->set_var('rows',"<tr><td>{$STRING['noprojects']}</td></tr>");
+ return;
+ }
+
+ $headers = array(
+ 'projectid' => 'project_id',
+ 'name' => 'project_name',
+ 'description' => 'project_desc',
+ 'active' => 'active',
+ 'createdby' => 'created_by',
+ 'createddate' => 'created_date'
+ );
+
+ sorting_headers($me, $headers, $order, $sort);
+ $i = 0;
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'projectid' => $row['project_id'],
+ 'name' => $row['project_name'],
+ 'description' => stripslashes($row['project_desc']),
+ 'active' => $row['active'] ? 'Y' : 'N',
+ 'createdby' => $row['created_by'],
+ 'createddate' => date(DATEFORMAT,$row['created_date'])
+ ));
+ $t->parse('rows','row',true);
+ }
}
$t->set_file('wrap','wrap.html');
@@ -198,14 +198,14 @@
$perm->check('Administrator');
if (isset($_gv['op'])) switch($_gv['op']) {
- case 'add' : show_form(); break;
- case 'edit' : show_form($_gv['id']); break;
-} elseif(isset($_pv['submit'])) {
- do_form($_pv['id']);
+ case 'add' : show_form(); break;
+ case 'edit' : show_form($_gv['id']); break;
+} elseif(isset($_pv['submit'])) {
+ do_form($_pv['id']);
} else list_items();
$t->pparse('main',array('content','wrap','main'));
page_close();
-?>
+?>
\ No newline at end of file
Index: os.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/os.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- os.php 2001/08/09 12:54:47 1.7
+++ os.php 2001/08/17 14:39:47 1.8
@@ -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.
@@ -24,90 +24,90 @@
include '../include.php';
function do_form($osid = 0) {
- global $q, $me, $fname, $fregex, $fsortorder, $STRING;
-
- // Validation
- if (!$fname = trim($fname))
- $error = $STRING['givename'];
- if ($error) { list_items($osid, $error); return; }
-
- if (!$osid) {
- $q->query("insert into OS (OSID, Name, Regex, SortOrder) values (".$q->nextid('OS').", '$fname', '$fregex', '$fsortorder')");
- } else {
- $q->query("update OS set Name = '$fname', Regex = '$fregex', SortOrder = '$fsortorder' where OSID = '$osid'");
- }
- header("Location: $me?");
-}
+ global $q, $me, $fname, $fregex, $fsortorder, $STRING;
+ // Validation
+ if (!$fname = trim($fname))
+ $error = $STRING['givename'];
+ if ($error) { list_items($osid, $error); return; }
+
+ if (!$osid) {
+ $q->query("insert into os (os_id, os_name, regex, sort_order) values (".$q->nextid('os').", '$fname', '$fregex', '$fsortorder')");
+ } else {
+ $q->query("update os set os_name = '$fname', regex = '$fregex', sort_order = '$fsortorder' where os_id = '$osid'");
+ }
+ header("Location: $me?");
+}
+
function show_form($osid = 0, $error = '') {
- global $q, $me, $t, $fname, $fregex, $fsortorder, $STRING;
-
- #$t->set_file('content','osform.html');
- if ($osid && !$error) {
- $row = $q->grab("select * from OS where OSID = '$osid'");
- $t->set_var(array(
- 'action' => $STRING['edit'],
- 'fosid' => $row['OSID'],
- 'fname' => $row['Name'],
- 'fregex' => $row['Regex'],
- 'fsortorder' => $row['SortOrder']));
- } else {
- $t->set_var(array(
- 'action' => $osid ? $STRING['edit'] : $STRING['addnew'],
- 'error' => $error,
- 'fosid' => $osid,
- 'fname' => $fname,
- 'fregex' => $fregex,
- 'fsortorder' => $fsortorder));
- }
+ global $q, $me, $t, $fname, $fregex, $fsortorder, $STRING;
+
+ #$t->set_file('content','osform.html');
+ if ($osid && !$error) {
+ $row = $q->grab("select * from os where os_id = '$osid'");
+ $t->set_var(array(
+ 'action' => $STRING['edit'],
+ 'fosid' => $row['os_id'],
+ 'fname' => $row['os_name'],
+ 'fregex' => $row['regex'],
+ 'fsortorder' => $row['sort_order']));
+ } else {
+ $t->set_var(array(
+ 'action' => $osid ? $STRING['edit'] : $STRING['addnew'],
+ 'error' => $error,
+ 'fosid' => $osid,
+ 'fname' => $fname,
+ 'fregex' => $fregex,
+ 'fsortorder' => $fsortorder));
+ }
}
function list_items($osid = 0, $error = '') {
- global $q, $t, $selrange, $order, $sort, $STRING, $TITLE;
-
- $t->set_file('content','oslist.html');
- $t->set_block('content','row','rows');
-
- if (!$order) { $order = 'SortOrder'; $sort = 'asc'; }
- $nr = $q->query("select count(*) from OS where OSID = '$osid' order by $order $sort");
-
- list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
- "order=$order&sort=$sort");
-
- $t->set_var(array(
- 'pages' => '[ '.$pages.' ]',
- 'first' => $llimit+1,
- 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
- 'records' => $nr));
-
- $q->query("select * from OS order by $order $sort limit $llimit, $selrange");
-
- if (!$q->num_rows()) {
- $t->set_var('rows',"<tr><td>{$STRING['nooses']}</td></tr>");
- return;
- }
-
- $headers = array(
- 'osid' => 'OSID',
- 'name' => 'Name',
- 'regex' => 'Regex',
- 'sortorder' => 'SortOrder');
-
- sorting_headers($me, $headers, $order, $sort);
-
- while ($row = $q->grab()) {
- $t->set_var(array(
- 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
- 'osid' => $row['OSID'],
- 'name' => $row['Name'],
- 'regex' => $row['Regex'],
- 'sortorder' => $row['SortOrder']));
- $t->parse('rows','row',true);
- }
-
- show_form($osid, $error);
- $t->set_var('TITLE',$TITLE['os']);
+ global $q, $t, $selrange, $order, $sort, $STRING, $TITLE;
+
+ $t->set_file('content','oslist.html');
+ $t->set_block('content','row','rows');
+
+ if (!$order) { $order = 'sort_order'; $sort = 'asc'; }
+ $nr = $q->query("select count(*) from os where os_id = '$osid' order by $order $sort");
+
+ list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
+ "order=$order&sort=$sort");
+
+ $t->set_var(array(
+ 'pages' => '[ '.$pages.' ]',
+ 'first' => $llimit+1,
+ 'last' => $llimit+$selrange > $nr ? $nr : $llimit+$selrange,
+ 'records' => $nr));
+
+ $q->query("select * from os order by $order $sort limit $llimit, $selrange");
+
+ if (!$q->num_rows()) {
+ $t->set_var('rows',"<tr><td>{$STRING['nooses']}</td></tr>");
+ return;
+ }
+
+ $headers = array(
+ 'osid' => 'os_id',
+ 'name' => 'os_name',
+ 'regex' => 'regex',
+ 'sortorder' => 'sort_order');
+
+ sorting_headers($me, $headers, $order, $sort);
+
+ while ($row = $q->grab()) {
+ $t->set_var(array(
+ 'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'osid' => $row['os_id'],
+ 'name' => $row['os_name'],
+ 'regex' => $row['regex'],
+ 'sortorder' => $row['sort_order']));
+ $t->parse('rows','row',true);
+ }
+
+ show_form($osid, $error);
+ $t->set_var('TITLE',$TITLE['os']);
}
$t->set_file('wrap','wrap.html');
@@ -115,14 +115,14 @@
$perm->check('Administrator');
if ($op) switch($op) {
- case 'add' : list_items(); break;
- case 'edit' : list_items($id); break;
-} elseif($submit) {
- do_form($id);
+ case 'add' : list_items(); break;
+ case 'edit' : list_items($id); break;
+} elseif($submit) {
+ do_form($id);
} else list_items();
$t->pparse('main',array('content','wrap','main'));
page_close();
-?>
+?>
\ No newline at end of file
Index: component.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/component.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- component.php 2001/08/09 13:21:58 1.7
+++ component.php 2001/08/17 14:39:47 1.8
@@ -37,9 +37,9 @@
if (!$owner) $owner = 0;
if (!$active) $active = 0;
if (!$componentid) {
- $q->query("insert into Component (ComponentID, ProjectID, Name, Description, Owner, Active, CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate) values (".$q->nextid('Component').", $projectid, '$name', '$description', $owner, $active, $u, $time, $u, $time)");
+ $q->query("insert into component (component_id, project_id, component_name, component_desc, owner, active, created_by, created_date, last_modified_by, last_modified_date) values (".$q->nextid('component ').", $projectid, '$name', '$description', $owner, $active, $u, $time, $u, $time)");
} else {
- $q->query("update Component set Name = '$name', Description = '$description', Owner = $owner, Active = $active, LastModifiedBy = $u, LastModifiedDate = $time where ComponentID = '$componentid'");
+ $q->query("update component set component_name = '$name', component_desc = '$description', owner = $owner, active = $active, last_modified_by = $u, last_modified_date = $time where component_id = '$componentid'");
}
header("Location: project.php?op=edit&id=$projectid");
}
@@ -50,19 +50,19 @@
$t->set_file('content','componentform.html');
if ($componentid && !$error) {
- $row = $q->grab("select c.*, p.Name as ProjectName from Component c left join Project p using (ProjectID) where ComponentID = '$componentid'");
+ $row = $q->grab("select c.*, p.project_name as project_name from component c left join project p using (project_id) where component_id = '$componentid'");
$t->set_var(array(
- 'componentid' => $row['ComponentID'],
- 'projectid' => $row['ProjectID'],
- 'project' => $row['ProjectName'],
- 'name' => $row['Name'],
- 'description' => $row['Description'],
- 'owner' => build_select('owner',$row['Owner']),
- 'active' => $row['Active'] ? 'checked' : '',
- 'createdby' => $row['CreatedBy'],
- 'createddate' => $row['CreatedDate'],
- 'lastmodifiedby' => $row['LastModifiedBy'],
- 'lastmodifieddate' => $row['LastModifiedDate'],
+ 'componentid' => $row['component_id'],
+ 'projectid' => $row['project_id'],
+ 'project' => $row['project_name'],
+ 'name' => $row['component_name'],
+ 'description' => $row['component_desc'],
+ 'owner' => build_select('owner',$row['owner']),
+ 'active' => $row['active'] ? 'checked' : '',
+ 'createdby' => $row['created_by'],
+ 'createddate' => $row['created_date'],
+ 'lastmodifiedby' => $row['last_modified_by'],
+ 'lastmodifieddate' => $row['last_modified_date'],
'TITLE' => $TITLE['editcomponent']));
} else {
$t->set_var(array(
@@ -70,7 +70,7 @@
'error' => $error,
'componentid' => $componentid,
'projectid' => $projectid,
- 'project' => $q->grab_field("select Name from Project where ProjectID = $projectid"),
+ 'project' => $q->grab_field("select project_name from project where project_id = $projectid"),
'name' => $name,
'description' => $description,
'owner' => build_select('owner',$owner),
|