You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(76) |
Oct
(65) |
Nov
(177) |
Dec
(147) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(257) |
Feb
(313) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tr...@us...> - 2002-09-09 08:17:25
|
Update of /cvsroot/basedb/basedb In directory usw-pr-cvs1:/tmp/cvs-serv17115 Modified Files: README Log Message: Corrected tpyo, clarified shebang part Index: README =================================================================== RCS file: /cvsroot/basedb/basedb/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README 21 Aug 2002 12:56:57 -0000 1.6 --- README 9 Sep 2002 08:17:21 -0000 1.7 *************** *** 7,18 **** Here's what you need to do to get BASE running: ! Download, install, and configure Apache, MySQL, and PHP. ! Version requirements: ! Apache 1.3.x has been tested. Apache 2 might be tricky to get to ! work with PHP, but it has been done. ! MySQL 3.23.x (x > 40 or so) is know to work with BASE. We don't know ! if anyone has tested MySQL 4, but it's likely that it works. PHP 4.2.1 works, and 4.2.0 probably works too. Note that there is a security ! issue with 4.2.1. PHP compilation: --- 7,18 ---- Here's what you need to do to get BASE running: ! Download, install, and configure Apache, MySQL, and PHP. Version ! requirements: Apache 1.3.x has been tested. Apache 2 might be tricky to get ! to work with PHP, but it has been done. ! MySQL 3.23.x (x > 40 or so) is know to work with BASE. We don't know if ! anyone has tested MySQL 4, but it's likely that it works. PHP 4.2.1 works, and 4.2.0 probably works too. Note that there is a security ! issue with 4.2.1, and you should use 4.2.2. At the moment of writing, PHP 4.3 ! hasn't been released yet, adn we haven't tested BASE with it. PHP compilation: *************** *** 23,28 **** PHP) to upload files to BASE, you'll need socket support in the standalone version of PHP. The scripts helpParser.php, jobController.php and ! updateGenes.php (in subdir exec/), exspect standalone interpreter to be found ! as #!/usr/local/bin/php. If it is elsewhere, adjust their first lines. PHP configuration: --- 23,29 ---- PHP) to upload files to BASE, you'll need socket support in the standalone version of PHP. The scripts helpParser.php, jobController.php and ! updateGenes.php (in subdir exec/) expect the standalone interpreter to be ! found as #!/usr/local/bin/php. If it is elsewhere, adjust their first ! line of those php files. PHP configuration: |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv8628 Modified Files: misc.inc.php mysql.inc.php pgsql.inc.php plate_edit.phtml user_edit.phtml user_list.phtml Log Message: Added db_date_never to deal with 0001-01-01 vs. 0000-00-00 Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** misc.inc.php 5 Aug 2002 11:29:34 -0000 1.34 --- misc.inc.php 9 Sep 2002 06:39:01 -0000 1.35 *************** *** 25,28 **** --- 25,30 ---- // + require_once("db.inc.php"); + function html($txt, $nbsp = true) { *************** *** 46,52 **** function strtodate($txt) { ! if($txt == "") return "0000-00-00"; $t = @strtotime($txt); ! if($t < 0) return "0000-00-00"; return date("Y-m-d", $t); } --- 48,54 ---- function strtodate($txt) { ! if($txt == "") return db_date_never(); $t = @strtotime($txt); ! if($t < 0) return db_date_never(); return date("Y-m-d", $t); } *************** *** 54,60 **** function strtodatetime($txt) { ! if($txt == "") return "0000-00-00 00:00:00"; $t = @strtotime($txt); ! if($t < 0) return "0000-00-00 00:00:00"; return date("Y-m-d H:i:s", $t); } --- 56,62 ---- function strtodatetime($txt) { ! if($txt == "") return db_date_never()." 00:00:00"; $t = @strtotime($txt); ! if($t < 0) return db_date_never()." 00:00:00"; return date("Y-m-d H:i:s", $t); } *************** *** 62,66 **** function htmldate($txt, $nbsp = true) { ! if(substr($txt, 0, 10) == "0000-00-00") return ($nbsp ? "-" : ""); return $txt; --- 64,68 ---- function htmldate($txt, $nbsp = true) { ! if(substr($txt, 0, 10) == db_date_never()) return ($nbsp ? "-" : ""); return $txt; *************** *** 69,73 **** function htmldatetime($txt) { ! if(substr($txt, 0, 10) == "0000-00-00") return "-"; return substr($txt, 0, 16); --- 71,75 ---- function htmldatetime($txt) { ! if(substr($txt, 0, 10) == db_date_never()) return "-"; return substr($txt, 0, 16); Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mysql.inc.php 9 Sep 2002 06:29:34 -0000 1.10 --- mysql.inc.php 9 Sep 2002 06:39:01 -0000 1.11 *************** *** 270,272 **** --- 270,277 ---- } + function db_date_never() + { + return "0000-00-00"; + } + ?> Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pgsql.inc.php 9 Sep 2002 06:29:34 -0000 1.6 --- pgsql.inc.php 9 Sep 2002 06:39:01 -0000 1.7 *************** *** 334,336 **** --- 334,341 ---- } + function db_date_never() + { + return "0001-01-01"; + } + ?> Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** plate_edit.phtml 29 Aug 2002 16:51:34 -0000 1.26 --- plate_edit.phtml 9 Sep 2002 06:39:01 -0000 1.27 *************** *** 335,339 **** $protos = Protocol::getBriefer($e["protocolType"]); if(isset($events[$eid]["eventDate"]) && ! $events[$eid]["eventDate"] != "0000-00-00") $ed = $events[$eid]["eventDate"]; else $ed = ""; --- 335,339 ---- $protos = Protocol::getBriefer($e["protocolType"]); if(isset($events[$eid]["eventDate"]) && ! $events[$eid]["eventDate"] != db_date_never()) $ed = $events[$eid]["eventDate"]; else $ed = ""; Index: user_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_edit.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** user_edit.phtml 5 Aug 2002 11:29:35 -0000 1.13 --- user_edit.phtml 9 Sep 2002 06:39:01 -0000 1.14 *************** *** 183,187 **** { $nev = ""; ! if($actu == "0000-00-00") $actu = ""; } --- 183,187 ---- { $nev = ""; ! if($actu == db_date_never()) $actu = ""; } *************** *** 228,232 **** if($actu == "9999-12-31") $actu = "never"; ! else if($actu == "0000-00-00") $actu = "inactive account"; ?> --- 228,232 ---- if($actu == "9999-12-31") $actu = "never"; ! else if($actu == db_date_never()) $actu = "inactive account"; ?> Index: user_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_list.phtml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** user_list.phtml 29 Aug 2002 16:51:34 -0000 1.12 --- user_list.phtml 9 Sep 2002 06:39:01 -0000 1.13 *************** *** 120,124 **** if($date == "9999-12-31") return "<span class=active_0>forever</span>"; ! if($date == "0000-00-00") return "<span class=active_5>-</span>"; if($daysLeft > 30) --- 120,124 ---- if($date == "9999-12-31") return "<span class=active_0>forever</span>"; ! if($date == db_date_never()) return "<span class=active_5>-</span>"; if($daysLeft > 30) |
From: <tr...@us...> - 2002-09-09 06:33:53
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv6959 Modified Files: experiment.inc.php Log Message: added a missing strtodate Index: experiment.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment.inc.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** experiment.inc.php 9 Sep 2002 06:30:50 -0000 1.47 --- experiment.inc.php 9 Sep 2002 06:33:50 -0000 1.48 *************** *** 51,55 **** $this->abstract = $abstract; $this->pubMedId = $pubMedId; ! $this->publicationDate = $publicationDate; } --- 51,55 ---- $this->abstract = $abstract; $this->pubMedId = $pubMedId; ! $this->publicationDate = strtodate($publicationDate); } |
From: <tr...@us...> - 2002-09-09 06:30:53
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv5866 Modified Files: experiment.inc.php Log Message: Moved misplaced comma Index: experiment.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment.inc.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** experiment.inc.php 9 Sep 2002 06:29:34 -0000 1.46 --- experiment.inc.php 9 Sep 2002 06:30:50 -0000 1.47 *************** *** 304,308 **** if(db_has_subselects()) { ! $ss1 = ", t.raws, t.sets, t.assays FROM Experiment e, ". "(SELECT e.id,"; $ss2 = ") AS t WHERE e.id = t.id"; --- 304,308 ---- if(db_has_subselects()) { ! $ss1 = "t.raws, t.sets, t.assays FROM Experiment e, ". "(SELECT e.id,"; $ss2 = ") AS t WHERE e.id = t.id"; *************** *** 311,315 **** $ss1 = $ss2 = ""; ! $query = "SELECT e.* $ss1 ". "COUNT(DISTINCT erb.`rawBioAssay`) AS raws, ". "COUNT(DISTINCT bas.id) AS sets, ". --- 311,315 ---- $ss1 = $ss2 = ""; ! $query = "SELECT e.*, $ss1 ". "COUNT(DISTINCT erb.`rawBioAssay`) AS raws, ". "COUNT(DISTINCT bas.id) AS sets, ". |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv5308 Modified Files: acquisition.inc.php array.inc.php bio.inc.php bioassay.inc.php experiment.inc.php genelist.inc.php image.inc.php job.inc.php molecule.inc.php mysql.inc.php news.inc.php pgsql.inc.php plate.inc.php program.inc.php raw.inc.php user.inc.php ware.inc.php Log Message: Replaced TRUE with db_true because of missing TRUE/FALSE in mysql Index: acquisition.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/acquisition.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** acquisition.inc.php 9 Sep 2002 06:21:19 -0000 1.13 --- acquisition.inc.php 9 Sep 2002 06:29:33 -0000 1.14 *************** *** 159,163 **** $query = "SELECT COUNT(*) FROM ImageAcquisition ia ". "LEFT JOIN Image im ON im.imageAcquisition = ia.id ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 159,163 ---- $query = "SELECT COUNT(*) FROM ImageAcquisition ia ". "LEFT JOIN Image im ON im.imageAcquisition = ia.id ". ! "WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** array.inc.php 9 Sep 2002 06:21:19 -0000 1.34 --- array.inc.php 9 Sep 2002 06:29:34 -0000 1.35 *************** *** 863,867 **** $query = "SELECT COUNT(*) FROM ArrayBatch ab ". ! "WHERE TRUE ".$search->getWhere()." ". $search->getExtraWhere(); --- 863,867 ---- $query = "SELECT COUNT(*) FROM ArrayBatch ab ". ! "WHERE ".db_true()." ".$search->getWhere()." ". $search->getExtraWhere(); Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** bio.inc.php 9 Sep 2002 06:21:19 -0000 1.21 --- bio.inc.php 9 Sep 2002 06:29:34 -0000 1.22 *************** *** 161,165 **** { $owner = (int)$owner; ! $query = "SELECT * FROM Sample WHERE TRUE"; if($owner >= 0) $query .= " AND owner = $owner"; --- 161,165 ---- { $owner = (int)$owner; ! $query = "SELECT * FROM Sample WHERE ".db_true(); if($owner >= 0) $query .= " AND owner = $owner"; Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassay.inc.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** bioassay.inc.php 9 Sep 2002 06:21:19 -0000 1.32 --- bioassay.inc.php 9 Sep 2002 06:29:34 -0000 1.33 *************** *** 384,388 **** "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) --- 384,389 ---- "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE ".db_true()." ". ! $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) *************** *** 434,438 **** "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); $arr = array(); --- 435,440 ---- "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE ".db_true()." ". ! $search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); $arr = array(); *************** *** 475,480 **** "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). ! " $ob"; return $genelist->populateFromQuery($query); } --- 477,482 ---- "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE ".db_true()." ".$search->getWhere()." ". ! $search->getExtraWhere()." $ob"; return $genelist->populateFromQuery($query); } *************** *** 499,503 **** "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); return (bool)query($query); } --- 501,506 ---- "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE ".db_true()." ".$search->getWhere()." ". ! $search->getExtraWhere(); return (bool)query($query); } Index: experiment.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment.inc.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** experiment.inc.php 9 Sep 2002 06:20:40 -0000 1.45 --- experiment.inc.php 9 Sep 2002 06:29:34 -0000 1.46 *************** *** 285,289 **** $query = "SELECT COUNT(*) FROM Experiment e ". ! "WHERE TRUE ".$search->getExtraWhere()." ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 285,290 ---- $query = "SELECT COUNT(*) FROM Experiment e ". ! "WHERE ".db_true()." ".$search->getExtraWhere()." ". ! $search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; *************** *** 318,322 **** "LEFT JOIN BioAssaySet bas ON bas.experiment = e.id ". "LEFT JOIN BioAssay ba ON ba.`bioAssaySet` = bas.id ". ! "WHERE TRUE ".$search->getExtraWhere()." ".$search->getWhere()." ". "GROUP BY e.id $ss2 $ob ".$search->makeLimit(); --- 319,324 ---- "LEFT JOIN BioAssaySet bas ON bas.experiment = e.id ". "LEFT JOIN BioAssay ba ON ba.`bioAssaySet` = bas.id ". ! "WHERE ".db_true()." ".$search->getExtraWhere()." ". ! $search->getWhere()." ". "GROUP BY e.id $ss2 $ob ".$search->makeLimit(); Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** genelist.inc.php 9 Sep 2002 06:21:19 -0000 1.20 --- genelist.inc.php 9 Sep 2002 06:29:34 -0000 1.21 *************** *** 115,119 **** $query = "SELECT COUNT(*) FROM GeneList gl ". ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); --- 115,119 ---- $query = "SELECT COUNT(*) FROM GeneList gl ". ! "WHERE ".db_true()." ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); *************** *** 135,139 **** $query = "SELECT gl.* ". "FROM GeneList gl ". ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere()." ". "GROUP BY id $ob ".$search->makeLimit(); --- 135,139 ---- $query = "SELECT gl.* ". "FROM GeneList gl ". ! "WHERE ".db_true()." ".$search->getExtraWhere()." ". $search->getWhere()." ". "GROUP BY id $ob ".$search->makeLimit(); Index: image.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/image.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** image.inc.php 9 Sep 2002 06:21:19 -0000 1.11 --- image.inc.php 9 Sep 2002 06:29:34 -0000 1.12 *************** *** 134,138 **** $query = "SELECT COUNT(*) FROM Image im ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 134,138 ---- $query = "SELECT COUNT(*) FROM Image im ". ! "WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); *************** *** 152,156 **** $query = "SELECT im.* ". ! "FROM Image im WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere()." ". "$ob ".$search->makeLimit(); --- 152,156 ---- $query = "SELECT im.* ". ! "FROM Image im WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere()." ". "$ob ".$search->makeLimit(); Index: job.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/job.inc.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** job.inc.php 9 Sep 2002 06:21:20 -0000 1.35 --- job.inc.php 9 Sep 2002 06:29:34 -0000 1.36 *************** *** 273,277 **** $query = "SELECT COUNT(*) FROM Job j ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 273,277 ---- $query = "SELECT COUNT(*) FROM Job j ". ! "WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** molecule.inc.php 9 Sep 2002 06:21:20 -0000 1.29 --- molecule.inc.php 9 Sep 2002 06:29:34 -0000 1.30 *************** *** 628,632 **** $query = "SELECT COUNT(*) FROM Molecule m ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 628,633 ---- $query = "SELECT COUNT(*) FROM Molecule m ". $search->getExtraTables()." ". ! "WHERE ".db_true()." ".$search->getWhere()." ". ! $search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; *************** *** 652,656 **** "l.name AS `libraryName` ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); --- 653,658 ---- "l.name AS `libraryName` ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE ".db_true()." ".$search->getWhere()." ". ! $search->getExtraWhere(). " $ob ".$search->makeLimit(); *************** *** 691,696 **** $query = "SELECT m.id ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). ! " $ob"; return $genelist->populateFromQuery($query); --- 693,698 ---- $query = "SELECT m.id ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE ".db_true()." ".$search->getWhere()." ". ! $search->getExtraWhere()." $ob"; return $genelist->populateFromQuery($query); Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mysql.inc.php 9 Sep 2002 06:21:00 -0000 1.9 --- mysql.inc.php 9 Sep 2002 06:29:34 -0000 1.10 *************** *** 265,267 **** --- 265,272 ---- } + function db_true() + { + return "1"; + } + ?> Index: news.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/news.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** news.inc.php 9 Sep 2002 06:21:20 -0000 1.7 --- news.inc.php 9 Sep 2002 06:29:34 -0000 1.8 *************** *** 66,70 **** $query = "SELECT COUNT(*) FROM News n ". ! "WHERE TRUE ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 66,70 ---- $query = "SELECT COUNT(*) FROM News n ". ! "WHERE ".db_true()." ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pgsql.inc.php 9 Sep 2002 06:21:00 -0000 1.5 --- pgsql.inc.php 9 Sep 2002 06:29:34 -0000 1.6 *************** *** 329,331 **** --- 329,336 ---- } + function db_true() + { + return "TRUE"; + } + ?> Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** plate.inc.php 9 Sep 2002 06:21:20 -0000 1.30 --- plate.inc.php 9 Sep 2002 06:29:34 -0000 1.31 *************** *** 253,257 **** $query = "SELECT COUNT(*) FROM PlateType pt ". ! "WHERE TRUE ".$search->getWhere(); $res = query($query); --- 253,257 ---- $query = "SELECT COUNT(*) FROM PlateType pt ". ! "WHERE ".db_true()." ".$search->getWhere(); $res = query($query); *************** *** 272,276 **** $query = "SELECT pt.* ". "FROM PlateType pt ". ! "WHERE TRUE ".$search->getWhere()." $ob ".$search->makeLimit(); $arr = array(); --- 272,277 ---- $query = "SELECT pt.* ". "FROM PlateType pt ". ! "WHERE ".db_true()." ". ! $search->getWhere()." $ob ".$search->makeLimit(); $arr = array(); *************** *** 652,656 **** $query = "SELECT COUNT(*) FROM Plate p ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); --- 653,657 ---- $query = "SELECT COUNT(*) FROM Plate p ". $search->getExtraTables()." ". ! "WHERE ".db_true()." ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); *************** *** 678,682 **** $query = "SELECT p.* $selectfields ". "FROM Plate p ".$search->getExtraTables(). ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere()." $ob ".$search->makeLimit(); --- 679,683 ---- $query = "SELECT p.* $selectfields ". "FROM Plate p ".$search->getExtraTables(). ! "WHERE ".db_true()." ".$search->getExtraWhere()." ". $search->getWhere()." $ob ".$search->makeLimit(); Index: program.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/program.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** program.inc.php 9 Sep 2002 06:21:20 -0000 1.21 --- program.inc.php 9 Sep 2002 06:29:34 -0000 1.22 *************** *** 260,264 **** $query = "SELECT COUNT(*) FROM Program p ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 260,265 ---- $query = "SELECT COUNT(*) FROM Program p ". ! "WHERE ".db_true()." ". ! $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; Index: raw.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw.inc.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** raw.inc.php 9 Sep 2002 06:21:20 -0000 1.33 --- raw.inc.php 9 Sep 2002 06:29:34 -0000 1.34 *************** *** 266,270 **** $query = "SELECT COUNT(*) ". "FROM RawBioAssay r ". ! "WHERE TRUE ". $search->getExtraWhere()." ".$search->getWhere(); --- 266,270 ---- $query = "SELECT COUNT(*) ". "FROM RawBioAssay r ". ! "WHERE ".db_true()." ". $search->getExtraWhere()." ".$search->getWhere(); Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** user.inc.php 9 Sep 2002 06:21:20 -0000 1.7 --- user.inc.php 9 Sep 2002 06:29:34 -0000 1.8 *************** *** 359,363 **** $query = "SELECT COUNT(*) FROM Submitter u ". ! "WHERE TRUE ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) --- 359,363 ---- $query = "SELECT COUNT(*) FROM Submitter u ". ! "WHERE ".db_true()." ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) *************** *** 381,385 **** "TO_DAYS(`activeUntil`) - TO_DAYS(NOW()) AS `daysLeft`, ". "(u.`accessMask` & (".BUA_SUPERUSER.")) AS `superUser` ". ! "FROM Submitter u WHERE TRUE ".$search->getWhere(). " $ob ".$search->makeLimit(); --- 381,385 ---- "TO_DAYS(`activeUntil`) - TO_DAYS(NOW()) AS `daysLeft`, ". "(u.`accessMask` & (".BUA_SUPERUSER.")) AS `superUser` ". ! "FROM Submitter u WHERE ".db_true()." ".$search->getWhere(). " $ob ".$search->makeLimit(); Index: ware.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ware.inc.php 9 Sep 2002 06:21:20 -0000 1.10 --- ware.inc.php 9 Sep 2002 06:29:34 -0000 1.11 *************** *** 91,95 **** $query = "SELECT COUNT(*) FROM $type w ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 91,95 ---- $query = "SELECT COUNT(*) FROM $type w ". ! "WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv2356 Modified Files: acquisition.inc.php array.inc.php bio.inc.php bioassay.inc.php genelist.inc.php image.inc.php item.inc.php job.inc.php molecule.inc.php news.inc.php plate.inc.php program.inc.php raw.inc.php search.inc.php user.inc.php ware.inc.php Log Message: Changed WHERE 1 to WHERE TRUE Index: acquisition.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/acquisition.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** acquisition.inc.php 7 Sep 2002 11:36:31 -0000 1.12 --- acquisition.inc.php 9 Sep 2002 06:21:19 -0000 1.13 *************** *** 159,163 **** $query = "SELECT COUNT(*) FROM ImageAcquisition ia ". "LEFT JOIN Image im ON im.imageAcquisition = ia.id ". ! "WHERE 1 ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 159,163 ---- $query = "SELECT COUNT(*) FROM ImageAcquisition ia ". "LEFT JOIN Image im ON im.imageAcquisition = ia.id ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** array.inc.php 8 Sep 2002 22:38:08 -0000 1.33 --- array.inc.php 9 Sep 2002 06:21:19 -0000 1.34 *************** *** 863,867 **** $query = "SELECT COUNT(*) FROM ArrayBatch ab ". ! "WHERE 1 ".$search->getWhere()." ". $search->getExtraWhere(); --- 863,867 ---- $query = "SELECT COUNT(*) FROM ArrayBatch ab ". ! "WHERE TRUE ".$search->getWhere()." ". $search->getExtraWhere(); Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** bio.inc.php 8 Sep 2002 23:13:56 -0000 1.20 --- bio.inc.php 9 Sep 2002 06:21:19 -0000 1.21 *************** *** 161,165 **** { $owner = (int)$owner; ! $query = "SELECT * FROM Sample WHERE 1"; if($owner >= 0) $query .= " AND owner = $owner"; --- 161,165 ---- { $owner = (int)$owner; ! $query = "SELECT * FROM Sample WHERE TRUE"; if($owner >= 0) $query .= " AND owner = $owner"; Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassay.inc.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** bioassay.inc.php 8 Sep 2002 22:38:08 -0000 1.31 --- bioassay.inc.php 9 Sep 2002 06:21:19 -0000 1.32 *************** *** 384,388 **** "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) --- 384,388 ---- "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) *************** *** 434,438 **** "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); $arr = array(); --- 434,438 ---- "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); $arr = array(); *************** *** 475,479 **** "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(). " $ob"; return $genelist->populateFromQuery($query); --- 475,479 ---- "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $search->getExtraTables()." $ljoin ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). " $ob"; return $genelist->populateFromQuery($query); *************** *** 499,503 **** "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(); return (bool)query($query); } --- 499,503 ---- "FROM $config[dbDynamic].BioAssayData$expid bad ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); return (bool)query($query); } Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** genelist.inc.php 8 Sep 2002 22:38:08 -0000 1.19 --- genelist.inc.php 9 Sep 2002 06:21:19 -0000 1.20 *************** *** 115,119 **** $query = "SELECT COUNT(*) FROM GeneList gl ". ! "WHERE 1 ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); --- 115,119 ---- $query = "SELECT COUNT(*) FROM GeneList gl ". ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); *************** *** 135,139 **** $query = "SELECT gl.* ". "FROM GeneList gl ". ! "WHERE 1 ".$search->getExtraWhere()." ". $search->getWhere()." ". "GROUP BY id $ob ".$search->makeLimit(); --- 135,139 ---- $query = "SELECT gl.* ". "FROM GeneList gl ". ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere()." ". "GROUP BY id $ob ".$search->makeLimit(); Index: image.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/image.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** image.inc.php 8 Sep 2002 22:38:08 -0000 1.10 --- image.inc.php 9 Sep 2002 06:21:19 -0000 1.11 *************** *** 134,138 **** $query = "SELECT COUNT(*) FROM Image im ". ! "WHERE 1 ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 134,138 ---- $query = "SELECT COUNT(*) FROM Image im ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); *************** *** 152,156 **** $query = "SELECT im.* ". ! "FROM Image im WHERE 1 ". $search->getWhere()." ".$search->getExtraWhere()." ". "$ob ".$search->makeLimit(); --- 152,156 ---- $query = "SELECT im.* ". ! "FROM Image im WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere()." ". "$ob ".$search->makeLimit(); Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** item.inc.php 8 Sep 2002 23:13:56 -0000 1.25 --- item.inc.php 9 Sep 2002 06:21:19 -0000 1.26 *************** *** 269,273 **** function getSharers() { ! $query = "SELECT si.owner, u.`userName` FROM Shared$this->type si ". "LEFT JOIN Submitter u ON u.id = si.owner ". "WHERE si.item = $this->id ORDER BY u.`userName`"; --- 269,274 ---- function getSharers() { ! $query = "SELECT si.owner, u.`userName` ". ! "FROM Shared$this->type si ". "LEFT JOIN Submitter u ON u.id = si.owner ". "WHERE si.item = $this->id ORDER BY u.`userName`"; Index: job.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/job.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** job.inc.php 8 Sep 2002 22:38:08 -0000 1.34 --- job.inc.php 9 Sep 2002 06:21:20 -0000 1.35 *************** *** 273,277 **** $query = "SELECT COUNT(*) FROM Job j ". ! "WHERE 1 ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 273,277 ---- $query = "SELECT COUNT(*) FROM Job j ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** molecule.inc.php 8 Sep 2002 22:38:08 -0000 1.28 --- molecule.inc.php 9 Sep 2002 06:21:20 -0000 1.29 *************** *** 628,632 **** $query = "SELECT COUNT(*) FROM Molecule m ". $search->getExtraTables()." ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 628,632 ---- $query = "SELECT COUNT(*) FROM Molecule m ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; *************** *** 652,656 **** "l.name AS `libraryName` ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); --- 652,656 ---- "l.name AS `libraryName` ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); *************** *** 691,695 **** $query = "SELECT m.id ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(). " $ob"; --- 691,695 ---- $query = "SELECT m.id ". "FROM Molecule m ".$search->getExtraTables()." ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(). " $ob"; Index: news.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/news.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** news.inc.php 8 Sep 2002 22:38:08 -0000 1.6 --- news.inc.php 9 Sep 2002 06:21:20 -0000 1.7 *************** *** 66,70 **** $query = "SELECT COUNT(*) FROM News n ". ! "WHERE 1 ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 66,70 ---- $query = "SELECT COUNT(*) FROM News n ". ! "WHERE TRUE ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** plate.inc.php 8 Sep 2002 22:38:08 -0000 1.29 --- plate.inc.php 9 Sep 2002 06:21:20 -0000 1.30 *************** *** 253,257 **** $query = "SELECT COUNT(*) FROM PlateType pt ". ! "WHERE 1 ".$search->getWhere(); $res = query($query); --- 253,257 ---- $query = "SELECT COUNT(*) FROM PlateType pt ". ! "WHERE TRUE ".$search->getWhere(); $res = query($query); *************** *** 272,276 **** $query = "SELECT pt.* ". "FROM PlateType pt ". ! "WHERE 1 ".$search->getWhere()." $ob ".$search->makeLimit(); $arr = array(); --- 272,276 ---- $query = "SELECT pt.* ". "FROM PlateType pt ". ! "WHERE TRUE ".$search->getWhere()." $ob ".$search->makeLimit(); $arr = array(); *************** *** 652,656 **** $query = "SELECT COUNT(*) FROM Plate p ". $search->getExtraTables()." ". ! "WHERE 1 ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); --- 652,656 ---- $query = "SELECT COUNT(*) FROM Plate p ". $search->getExtraTables()." ". ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere(); $res = query($query); *************** *** 678,682 **** $query = "SELECT p.* $selectfields ". "FROM Plate p ".$search->getExtraTables(). ! "WHERE 1 ".$search->getExtraWhere()." ". $search->getWhere()." $ob ".$search->makeLimit(); --- 678,682 ---- $query = "SELECT p.* $selectfields ". "FROM Plate p ".$search->getExtraTables(). ! "WHERE TRUE ".$search->getExtraWhere()." ". $search->getWhere()." $ob ".$search->makeLimit(); Index: program.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/program.inc.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** program.inc.php 8 Sep 2002 22:38:08 -0000 1.20 --- program.inc.php 9 Sep 2002 06:21:20 -0000 1.21 *************** *** 260,264 **** $query = "SELECT COUNT(*) FROM Program p ". ! "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 260,264 ---- $query = "SELECT COUNT(*) FROM Program p ". ! "WHERE TRUE ".$search->getWhere()." ".$search->getExtraWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; Index: raw.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw.inc.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** raw.inc.php 8 Sep 2002 22:38:08 -0000 1.32 --- raw.inc.php 9 Sep 2002 06:21:20 -0000 1.33 *************** *** 266,270 **** $query = "SELECT COUNT(*) ". "FROM RawBioAssay r ". ! "WHERE 1 ". $search->getExtraWhere()." ".$search->getWhere(); --- 266,270 ---- $query = "SELECT COUNT(*) ". "FROM RawBioAssay r ". ! "WHERE TRUE ". $search->getExtraWhere()." ".$search->getWhere(); Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** search.inc.php 8 Sep 2002 23:13:56 -0000 1.37 --- search.inc.php 9 Sep 2002 06:21:20 -0000 1.38 *************** *** 719,725 **** for(reset($textra); list($fid) = each($textra); ) { ! if(isset($tables[$fid][0])) $this->addExtraTable($tables[$fid][0]); ! if(isset($tables[$fid][1])) $this->addExtraWhere($tables[$fid][1]); ! if(isset($tables[$fid][2])) $this->addLeftJoin($tables[$fid][2]); } $this->where = $where; --- 719,728 ---- for(reset($textra); list($fid) = each($textra); ) { ! if(isset($tables[$fid][0])) ! $this->addExtraTable($tables[$fid][0]); ! if(isset($tables[$fid][1])) ! $this->addExtraWhere($tables[$fid][1]); ! if(isset($tables[$fid][2])) ! $this->addLeftJoin($tables[$fid][2]); } $this->where = $where; Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** user.inc.php 8 Sep 2002 22:38:08 -0000 1.6 --- user.inc.php 9 Sep 2002 06:21:20 -0000 1.7 *************** *** 359,363 **** $query = "SELECT COUNT(*) FROM Submitter u ". ! "WHERE 1 ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) --- 359,363 ---- $query = "SELECT COUNT(*) FROM Submitter u ". ! "WHERE TRUE ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) *************** *** 381,385 **** "TO_DAYS(`activeUntil`) - TO_DAYS(NOW()) AS `daysLeft`, ". "(u.`accessMask` & (".BUA_SUPERUSER.")) AS `superUser` ". ! "FROM Submitter u WHERE 1 ".$search->getWhere(). " $ob ".$search->makeLimit(); --- 381,385 ---- "TO_DAYS(`activeUntil`) - TO_DAYS(NOW()) AS `daysLeft`, ". "(u.`accessMask` & (".BUA_SUPERUSER.")) AS `superUser` ". ! "FROM Submitter u WHERE TRUE ".$search->getWhere(). " $ob ".$search->makeLimit(); Index: ware.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ware.inc.php 8 Sep 2002 22:38:08 -0000 1.9 --- ware.inc.php 9 Sep 2002 06:21:20 -0000 1.10 *************** *** 91,95 **** $query = "SELECT COUNT(*) FROM $type w ". ! "WHERE 1 ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); --- 91,95 ---- $query = "SELECT COUNT(*) FROM $type w ". ! "WHERE TRUE ". $search->getWhere()." ".$search->getExtraWhere(); $res = query($query); |
From: <tr...@us...> - 2002-09-09 06:21:02
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv2226 Modified Files: pgsql.inc.php mysql.inc.php Log Message: Aded db_has_subselect Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pgsql.inc.php 8 Sep 2002 22:37:25 -0000 1.4 --- pgsql.inc.php 9 Sep 2002 06:21:00 -0000 1.5 *************** *** 324,326 **** --- 324,331 ---- } + function db_has_subselects() + { + return true; + } + ?> Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mysql.inc.php 8 Sep 2002 22:37:25 -0000 1.8 --- mysql.inc.php 9 Sep 2002 06:21:00 -0000 1.9 *************** *** 260,262 **** --- 260,267 ---- } + function db_has_subselects() + { + return false; + } + ?> |
From: <tr...@us...> - 2002-09-09 06:20:45
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv2148 Modified Files: experiment.inc.php Log Message: Added subselect to deal with MySQL's GROUP BY/'first encountered value' feature Index: experiment.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment.inc.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** experiment.inc.php 8 Sep 2002 22:38:08 -0000 1.44 --- experiment.inc.php 9 Sep 2002 06:20:40 -0000 1.45 *************** *** 285,289 **** $query = "SELECT COUNT(*) FROM Experiment e ". ! "WHERE 1 ".$search->getExtraWhere()." ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; --- 285,289 ---- $query = "SELECT COUNT(*) FROM Experiment e ". ! "WHERE TRUE ".$search->getExtraWhere()." ".$search->getWhere(); $res = query($query); if($row =& db_fetch_row($res)) $cnt = $row[0]; *************** *** 301,305 **** $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT e.*, COUNT(DISTINCT erb.`rawBioAssay`) AS raws, ". "COUNT(DISTINCT bas.id) AS sets, ". "COUNT(DISTINCT ba.id) AS assays ". --- 301,315 ---- $ob = $search->makeOrderBy($sortfields); ! if(db_has_subselects()) ! { ! $ss1 = ", t.raws, t.sets, t.assays FROM Experiment e, ". ! "(SELECT e.id,"; ! $ss2 = ") AS t WHERE e.id = t.id"; ! } ! else ! $ss1 = $ss2 = ""; ! ! $query = "SELECT e.* $ss1 ". ! "COUNT(DISTINCT erb.`rawBioAssay`) AS raws, ". "COUNT(DISTINCT bas.id) AS sets, ". "COUNT(DISTINCT ba.id) AS assays ". *************** *** 308,313 **** "LEFT JOIN BioAssaySet bas ON bas.experiment = e.id ". "LEFT JOIN BioAssay ba ON ba.`bioAssaySet` = bas.id ". ! "WHERE 1 ".$search->getExtraWhere()." ".$search->getWhere()." ". ! "GROUP BY e.id $ob ".$search->makeLimit(); $arr = array(); --- 318,323 ---- "LEFT JOIN BioAssaySet bas ON bas.experiment = e.id ". "LEFT JOIN BioAssay ba ON ba.`bioAssaySet` = bas.id ". ! "WHERE TRUE ".$search->getExtraWhere()." ".$search->getWhere()." ". ! "GROUP BY e.id $ss2 $ob ".$search->makeLimit(); $arr = array(); |
From: <tr...@us...> - 2002-09-08 23:14:00
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv1867 Modified Files: bio.inc.php hyb.inc.php item.inc.php search.inc.php Log Message: Fixed mysql-ism: implicit cast of numbers to booleans Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** bio.inc.php 8 Sep 2002 22:38:08 -0000 1.19 --- bio.inc.php 8 Sep 2002 23:13:56 -0000 1.20 *************** *** 119,123 **** $search->makeWhere($fields); if($visible) ! $search->addExtraWhere("s.`isVisible`"); $query = "SELECT COUNT(*) FROM Sample s, Submitter u, SharedSample ss ". --- 119,123 ---- $search->makeWhere($fields); if($visible) ! $search->addExtraWhere("s.`isVisible` <> 0"); $query = "SELECT COUNT(*) FROM Sample s, Submitter u, SharedSample ss ". *************** *** 165,169 **** $query .= " AND owner = $owner"; if($visible) ! $query .= " AND `isVisible`"; $arr = array(); $res = query($query); --- 165,169 ---- $query .= " AND owner = $owner"; if($visible) ! $query .= " AND `isVisible` <> 0"; $arr = array(); $res = query($query); *************** *** 206,211 **** if($visible) { ! $query .= " AND s.`isVisibl`e AND e.`isVisible` AND le.`isVisible` ". ! "AND h`.isVisible`"; } $res = query($query); --- 206,211 ---- if($visible) { ! $query .= " AND s.`isVisible` <> 0 AND e.`isVisible` <> 0 ". ! "AND le.`isVisible` <> 0 AND h`.isVisible` <> 0"; } $res = query($query); *************** *** 227,231 **** "WHERE le.id = $labeled AND e.id = le.extract AND s.id = e.sample"; if($visible) ! $query .= " AND s.`isVisible` AND e.`isVisible` AND le.`isVisible`"; $res = query($query); if($row =& db_fetch_assoc($res)) --- 227,232 ---- "WHERE le.id = $labeled AND e.id = le.extract AND s.id = e.sample"; if($visible) ! $query .= " AND s.`isVisible` <> 0 AND e.`isVisible` <> 0 ". ! "AND le.`isVisible` <> 0"; $res = query($query); if($row =& db_fetch_assoc($res)) Index: hyb.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** hyb.inc.php 8 Sep 2002 22:38:08 -0000 1.18 --- hyb.inc.php 8 Sep 2002 23:13:56 -0000 1.19 *************** *** 145,153 **** $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT h.*, p.name AS `protocolName`, u.`userName,` ". "COUNT(DISTINCT ia.id) AS scans, COUNT(DISTINCT i.id) AS images, ". "COUNT(DISTINCT rba.id) AS raws, a.barcode ". ! "FROM Hybridization h, SharedHybridization sh, Submitter u, ". ! "Protocol p ". "LEFT JOIN ImageAcquisition ia ON ia.hybridization = h.id ". "LEFT JOIN Image i ON i.`imageAcquisition` = ia.id ". --- 145,153 ---- $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT h.*, p.name AS `protocolName`, u.`userName`, ". "COUNT(DISTINCT ia.id) AS scans, COUNT(DISTINCT i.id) AS images, ". "COUNT(DISTINCT rba.id) AS raws, a.barcode ". ! "FROM SharedHybridization sh, Submitter u, ". ! "Protocol p, Hybridization h ". "LEFT JOIN ImageAcquisition ia ON ia.hybridization = h.id ". "LEFT JOIN Image i ON i.`imageAcquisition` = ia.id ". Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** item.inc.php 8 Sep 2002 22:38:08 -0000 1.24 --- item.inc.php 8 Sep 2002 23:13:56 -0000 1.25 *************** *** 70,74 **** } if($visible) ! $query .= " AND i.`isVisible`"; return $this->readQuery($query); } --- 70,74 ---- } if($visible) ! $query .= " AND i.`isVisible` <> 0"; return $this->readQuery($query); } *************** *** 172,176 **** "WHERE si.item = i.id AND si.owner = $owner"; if($visible) ! $query .= " AND i.`isVisible`"; $res = query($query); while($row =& db_fetch_row($res)) --- 172,176 ---- "WHERE si.item = i.id AND si.owner = $owner"; if($visible) ! $query .= " AND i.`isVisible` <> 0"; $res = query($query); while($row =& db_fetch_row($res)) *************** *** 181,185 **** " WHERE si.item = i.id AND si.owner = 0"; if($visible) ! $query .= " AND i.`isVisible`"; $res = query($query); while($row =& db_fetch_row($res)) --- 181,185 ---- " WHERE si.item = i.id AND si.owner = 0"; if($visible) ! $query .= " AND i.`isVisible` <> 0"; $res = query($query); while($row =& db_fetch_row($res)) Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** search.inc.php 8 Sep 2002 22:38:08 -0000 1.36 --- search.inc.php 8 Sep 2002 23:13:56 -0000 1.37 *************** *** 831,835 **** { for($i = 0; $i < count($vars); $i++) ! $vars[$i] = "$vars[$i] = '".addslashes($this->{$vars[$i]})."'"; $query = "UPDATE SearchCriterion SET ".implode(", ", $vars)." ". "WHERE search = $this->search AND position = $this->position"; --- 831,835 ---- { for($i = 0; $i < count($vars); $i++) ! $vars[$i] = "`$vars[$i]` = '".addslashes($this->{$vars[$i]})."'"; $query = "UPDATE SearchCriterion SET ".implode(", ", $vars)." ". "WHERE search = $this->search AND position = $this->position"; |
From: <tr...@us...> - 2002-09-08 23:12:42
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv1630 Modified Files: protocol.inc.php Log Message: Fixed join order to work with postgresql (LEFT JOIN) Index: protocol.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** protocol.inc.php 8 Sep 2002 22:38:08 -0000 1.8 --- protocol.inc.php 8 Sep 2002 23:12:40 -0000 1.9 *************** *** 178,182 **** // Returns an array with lots of fields (id,etype,name,descr,submitter, ! // fileid,fname,fileSize,date,sname). function getBrief($type = 0) { --- 178,182 ---- // Returns an array with lots of fields (id,etype,name,descr,submitter, ! // fileId,fname,fileSize,date,sname). function getBrief($type = 0) { *************** *** 184,189 **** $query = "SELECT p.*, u.name AS fname, u.`fileSize`, ". "u.`addedDate` AS fdate, s.`userName` AS sname ". ! "FROM Protocol p, Submitter s ". ! "LEFT JOIN Upload u ON u.id = p.fileid ". "WHERE s.id = p.submitter "; if($type) $query .= "AND p.etype = $type ORDER BY p.id"; --- 184,189 ---- $query = "SELECT p.*, u.name AS fname, u.`fileSize`, ". "u.`addedDate` AS fdate, s.`userName` AS sname ". ! "FROM Submitter s, Protocol p ". ! "LEFT JOIN Upload u ON u.id = p.`fileId` ". "WHERE s.id = p.submitter "; if($type) $query .= "AND p.etype = $type ORDER BY p.id"; |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv25478 Modified Files: array.inc.php bio.inc.php bioassay.inc.php bioassayset.inc.php eventlog.inc.php experiment.inc.php genelist.inc.php hyb.inc.php image.inc.php item.inc.php job.inc.php left.phtml molecule.inc.php news.inc.php plate.inc.php plot.inc.php program.inc.php protocol.inc.php raw.inc.php sampleannotation.inc.php sampletissue.inc.php search.inc.php session.inc.php transformation.inc.php upload.inc.php user.inc.php ware.inc.php wizzzard.inc.php Log Message: Added backticks around all mixed/upper case column names Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** array.inc.php 7 Sep 2002 11:36:31 -0000 1.32 --- array.inc.php 8 Sep 2002 22:38:08 -0000 1.33 *************** *** 78,86 **** if(!query($query) || db_affected_rows() < 1) return false; ! $query = "DELETE FROM ArrayTypePlate WHERE arrayType = $this->id"; query($query); ! $query = "DELETE FROM Element WHERE arrayType = $this->id"; query($query); ! $query = "DELETE FROM ArrayBlock WHERE arrayType = $this->id"; query($query); @unlink($this->getRepositoryFilename()); --- 78,86 ---- [...560 lines suppressed...] $search->getWhere()." ".$search->getExtraWhere()." ". --- 936,953 ---- { // Add more fields here ! $sortfields = array("barcode", array("`batchName`", "`orderNumber`"), ! "`orderNumber`", "`userName`", array("`designName`", "`batchName`", ! "`orderNumber`"), "`printStartDate`", "destroyed", "comment", ! "`hybName`", "`hybUserName`"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT a.*, ab.name AS `batchName`, ab.`arrayType`, ". ! "ab.`printStartDate`, at.name AS `designName`, u.`userName`, ". ! "h.name AS `hybName`, hu.`userName` AS `hybUserName` ". "FROM Array a, ArrayBatch ab, ArrayType at, Submitter u ". $search->getExtraTables()." ". "LEFT JOIN Hybridization h ON h.id = a.hybridization ". "LEFT JOIN Submitter hu ON hu.id = h.owner ". ! "WHERE a.batch = ab.id AND ab.`arrayType` = at.id ". "AND u.id = ab.owner ". $search->getWhere()." ".$search->getExtraWhere()." ". Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** bio.inc.php 7 Sep 2002 11:59:40 -0000 1.18 --- bio.inc.php 8 Sep 2002 22:38:08 -0000 1.19 *************** *** 115,123 **** $ownerId = (int)$ownerId; // Add more fields and operators here ! $fields = array("s.name", "s.descr", "u.userName", "s.addedDate"); $search->makeWhere($fields); if($visible) ! $search->addExtraWhere("s.isVisible"); $query = "SELECT COUNT(*) FROM Sample s, Submitter u, SharedSample ss ". --- 115,123 ---- [...233 lines suppressed...] $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT le.*, se.owner AS extractPublic, ". ! "ss.owner AS samplePublic, p.name AS protocolName, ". ! "e.name AS extractName, e.sample, s.name AS sampleName ". "FROM LabeledExtract le, Extract e, SharedLabeledExtract sle, ". "Sample s, Protocol p ". --- 699,710 ---- // Add more fields here ! $sortfields = array("name", "label", "`extractName`", "`sampleName`", ! "`labelingDate`", "`protocolName`", "`quantityLeft`", 0); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT le.*, se.owner AS `extractPublic`, ". ! "ss.owner AS `samplePublic`, p.name AS `protocolName`, ". ! "e.name AS `extractName`, e.sample, s.name AS `sampleName` ". "FROM LabeledExtract le, Extract e, SharedLabeledExtract sle, ". "Sample s, Protocol p ". Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassay.inc.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** bioassay.inc.php 7 Sep 2002 11:36:31 -0000 1.30 --- bioassay.inc.php 8 Sep 2002 22:38:08 -0000 1.31 *************** *** 76,80 **** $query = "DELETE FROM $config[dbDynamic].BioAssayData$this->experiment ". ! "WHERE bioAssay = $this->id"; query($query); --- 76,80 ---- $query = "DELETE FROM $config[dbDynamic].BioAssayData$this->experiment ". ! "WHERE `bioAssay` = $this->id"; query($query); [...705 lines suppressed...] ! else $extra .= " 0 AS C"; ! $query = "SELECT $xc AS A, $yc AS B, $extra ". "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $sea->getExtraTables()." ". ! "WHERE bad.bioAssay = $this->id ".$sea->getExtraWhere()." ". "$groupby"; $res = query($query); --- 1046,1056 ---- } else if($third >= 0) ! $extra .= " $groups[$third] AS `C`"; ! else $extra .= " 0 AS `C`"; ! $query = "SELECT $xc AS `A`, $yc AS `B`, $extra ". "FROM $config[dbDynamic].BioAssayData$this->experiment bad ". $sea->getExtraTables()." ". ! "WHERE bad.`bioAssay` = $this->id ".$sea->getExtraWhere()." ". "$groupby"; $res = query($query); Index: bioassayset.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassayset.inc.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** bioassayset.inc.php 7 Sep 2002 11:36:31 -0000 1.24 --- bioassayset.inc.php 8 Sep 2002 22:38:08 -0000 1.25 *************** *** 65,70 **** function write() { ! if($this->id) return parent::write(array()); ! else return parent::write(array("experiment", "transformation")); } --- 65,72 ---- function write() { ! if($this->id) [...413 lines suppressed...] if($row =& db_fetch_assoc($res)) return $row; --- 652,656 ---- { $query = "SELECT * FROM BioAssaySetExplore ". ! "WHERE `bioAssaySet` = $this->id"; $res = query($query); if($row =& db_fetch_assoc($res)) return $row; *************** *** 696,700 **** { $query = "SELECT * FROM BioAssaySetCreation ". ! "WHERE bioAssaySet = $this->id"; $res = query($query); return db_fetch_assoc($res); --- 706,710 ---- { $query = "SELECT * FROM BioAssaySetCreation ". ! "WHERE `bioAssaySet` = $this->id"; $res = query($query); return db_fetch_assoc($res); Index: eventlog.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/eventlog.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** eventlog.inc.php 7 Sep 2002 11:36:32 -0000 1.4 --- eventlog.inc.php 8 Sep 2002 22:38:08 -0000 1.5 *************** *** 30,44 **** function log($type, $message) { ! $query = "INSERT INTO EventLog (eventDate, eventType, message) ". ! "VALUES (NOW(), '".addslashes($type)."', '".addslashes($message)."')"; return (bool)query($query); } ! // Returns array(array(date,type,message)) function getLast($cnt) { ! $query = "SELECT eventDate AS date, eventType AS type, message ". ! "FROM EventLog WHERE eventType='broadcast' ". ! "ORDER BY eventDate DESC ".db_limit(0, (int)$cnt); $res = query($query); $arr = array(); --- 30,45 ---- function log($type, $message) { ! $query = "INSERT INTO EventLog ". ! "(`eventDate`, `eventType`, message) VALUES ". ! "(NOW(), '".addslashes($type)."', '".addslashes($message)."')"; return (bool)query($query); } ! // Returns array(array(eventDate,eventType,message)) function getLast($cnt) { ! $query = "SELECT `eventDate`, `eventType`, message ". ! "FROM EventLog WHERE `eventType` = 'broadcast' ". ! "ORDER BY `eventDate` DESC ".db_limit(0, (int)$cnt); $res = query($query); $arr = array(); Index: experiment.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment.inc.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** experiment.inc.php 7 Sep 2002 11:36:32 -0000 1.43 --- experiment.inc.php 8 Sep 2002 22:38:08 -0000 1.44 *************** *** 111,115 **** $query = "DELETE FROM Experiment WHERE id = $id"; ! if(!query($query)) return false; db_table_drop("$config[dbDynamic].BioAssayData$id"); --- 111,116 ---- $query = "DELETE FROM Experiment WHERE id = $id"; ! if(!query($query)) ! return false; [...209 lines suppressed...] --- 399,403 ---- $rc = false; $query = "DELETE FROM ExperimentRawBioAssay ". ! "WHERE experiment = $expid AND `rawBioAssay` = $rawid"; if(query($query) && db_affected_rows() == 1) { *************** *** 405,409 **** "WHERE experiment = $this->id"; $res = query($query); ! if($row =& db_fetch_row($res)) return $row[0]; else return false; } --- 415,420 ---- "WHERE experiment = $this->id"; $res = query($query); ! if($row =& db_fetch_row($res)) ! return $row[0]; else return false; } Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** genelist.inc.php 8 Sep 2002 14:02:42 -0000 1.18 --- genelist.inc.php 8 Sep 2002 22:38:08 -0000 1.19 *************** *** 55,59 **** if(query($query)) { ! $query = "DELETE FROM GeneListGene WHERE geneList = $this->id"; query($query); } --- 55,59 ---- if(query($query)) { ! $query = "DELETE FROM GeneListGene WHERE `geneList` = $this->id"; query($query); [...152 lines suppressed...] $query = "SELECT glg.molecule, glg.score ". "FROM GeneListGene glg ". ! "WHERE glg.geneList = $this->id ". "ORDER BY score"; $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) $arr[$row[0]] = $row[1]; return $arr; } --- 323,332 ---- $query = "SELECT glg.molecule, glg.score ". "FROM GeneListGene glg ". ! "WHERE glg.`geneList` = $this->id ". "ORDER BY score"; $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) ! $arr[$row[0]] = $row[1]; return $arr; } Index: hyb.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** hyb.inc.php 7 Sep 2002 11:36:32 -0000 1.17 --- hyb.inc.php 8 Sep 2002 22:38:08 -0000 1.18 *************** *** 118,123 **** // Add more fields and operators here ! $fields = array("h.name", "h.descr", "u.userName", ! "h.addedDate", "h.hybridizationDate", "p.name"); $search->addExtraWhere("sh.owner IN (0, $ownerId)"); --- 118,123 ---- // Add more fields and operators here ! $fields = array("h.name", "h.descr", "u.`userName`", [...122 lines suppressed...] } *************** *** 261,267 **** { $query = "SELECT COUNT(*) FROM ImageAcquisition ia, RawBioAssay r ". ! "WHERE ia.hybridization = $this->id AND r.imageAcquisition = ia.id"; $res = query($query); ! if($row =& db_fetch_row($res)) return($row[0]); return 0; } --- 269,277 ---- { $query = "SELECT COUNT(*) FROM ImageAcquisition ia, RawBioAssay r ". ! "WHERE ia.hybridization = $this->id ". ! "AND r.`imageAcquisition` = ia.id"; $res = query($query); ! if($row =& db_fetch_row($res)) ! return($row[0]); return 0; } Index: image.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/image.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** image.inc.php 7 Sep 2002 11:36:32 -0000 1.9 --- image.inc.php 8 Sep 2002 22:38:08 -0000 1.10 *************** *** 51,60 **** $id = (int)$id; $owner = (int)$owner; ! if($owner < 0) $query = "SELECT * FROM $this->type WHERE id = $id"; else { $query = "SELECT i.* FROM Image i, ImageAcquisition ia, ". "SharedHybridization sh ". ! "WHERE ia.id = i.imageAcquisition AND sh.item = ia.hybridization ". "AND sh.owner IN (0, $owner) AND i.id = $id"; } --- 51,62 ---- $id = (int)$id; $owner = (int)$owner; ! if($owner < 0) ! $query = "SELECT * FROM $this->type WHERE id = $id"; else { $query = "SELECT i.* FROM Image i, ImageAcquisition ia, ". "SharedHybridization sh ". ! "WHERE ia.id = i.`imageAcquisition` ". ! "AND sh.item = ia.hybridization ". "AND sh.owner IN (0, $owner) AND i.id = $id"; } *************** *** 64,68 **** function write() { ! return parent::write(array("imageAcquisition", "channels", "fileSize")); } --- 66,71 ---- function write() { ! return parent::write(array("`imageAcquisition`", "channels", ! "`fileSize`")); } *************** *** 127,131 **** $fields = array(); ! $search->addExtraWhere("im.imageAcquisition = ".(int)$acq); $search->makeWhere($fields); --- 130,134 ---- $fields = array(); ! $search->addExtraWhere("im.`imageAcquisition` = ".(int)$acq); $search->makeWhere($fields); *************** *** 144,148 **** { // Add more fields here ! $sortfields = array("name", "channels", "fileSize", "descr"); $ob = $search->makeOrderBy($sortfields); --- 147,151 ---- { // Add more fields here ! $sortfields = array("name", "channels", "`fileSize`", "descr"); $ob = $search->makeOrderBy($sortfields); *************** *** 153,158 **** "$ob ".$search->makeLimit(); $arr = array(); ! if(!($res = query($query))) return $arr; ! while($row =& db_fetch_assoc($res)) $arr[] = $row; return $arr; } --- 156,163 ---- "$ob ".$search->makeLimit(); $arr = array(); ! if(!($res = query($query))) ! return $arr; ! while($row =& db_fetch_assoc($res)) ! $arr[] = $row; return $arr; } Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** item.inc.php 7 Sep 2002 11:36:32 -0000 1.23 --- item.inc.php 8 Sep 2002 22:38:08 -0000 1.24 *************** *** 70,74 **** } if($visible) ! $query .= " AND i.isVisible"; return $this->readQuery($query); } --- 70,74 ---- } if($visible) ! $query .= " AND i.`isVisible`"; return $this->readQuery($query); [...201 lines suppressed...] ! "WHERE id = $id AND `useCount` = -1"; return query($query) && db_affected_rows() == 1; } ! $query = "UPDATE $type SET `useCount` = `useCount` - 1 ". ! "WHERE id = $id AND `useCount` > 0"; return query($query) && db_affected_rows() == 1; } *************** *** 446,450 **** function getUseCount() { ! $query = "SELECT useCount FROM $this->type WHERE id = $this->id"; $res = query($query); if($row =& db_fetch_row($res)) --- 452,456 ---- function getUseCount() { ! $query = "SELECT `useCount` FROM $this->type WHERE id = $this->id"; $res = query($query); if($row =& db_fetch_row($res)) Index: job.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/job.inc.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** job.inc.php 7 Sep 2002 11:36:32 -0000 1.33 --- job.inc.php 8 Sep 2002 22:38:08 -0000 1.34 *************** *** 91,95 **** $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] = "'".addslashes($this->{$vars[$i]})."'"; $id = db_insert("Job", $vars, $vals); if(!$id) --- 91,95 ---- $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] =& $this->{$vars[$i]}; $id = db_insert("Job", $vars, $vals); [...144 lines suppressed...] // worst thing that can happen isn't all that horrible. $query = "INSERT INTO JobFileSection ". ! "(`jobFile`, `fileSection`, `sectionCount`) ". "VALUES ($this->id, $section, $count)"; return (bool)query($query); *************** *** 651,656 **** function sectionCount($section) { ! $query = "SELECT sectionCount FROM JobFileSection ". ! "WHERE jobFile = $this->id AND fileSection = ".(int)$section; $res = query($query); if($row =& db_fetch_row($res)) --- 652,657 ---- function sectionCount($section) { ! $query = "SELECT `sectionCount` FROM JobFileSection ". ! "WHERE `jobFile` = $this->id AND `fileSection` = ".(int)$section; $res = query($query); if($row =& db_fetch_row($res)) Index: left.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/left.phtml,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** left.phtml 7 Sep 2002 11:36:32 -0000 1.44 --- left.phtml 8 Sep 2002 22:38:08 -0000 1.45 *************** *** 376,383 **** for($i = count($events) - 1; $i >= 0; $i--) { ! $txt = sprintf($et[$events[$i]["type"]], html($events[$i]["message"])); ! $date = (int)substr($events[$i]["date"], 8, 2).". ". ! substr($events[$i]["date"], 11, 5); echo "$date $txt<br>\n"; } --- 376,383 ---- for($i = count($events) - 1; $i >= 0; $i--) { ! $txt = sprintf($et[$events[$i]["eventType"]], html($events[$i]["message"])); ! $date = (int)substr($events[$i]["eventDate"], 8, 2).". ". ! substr($events[$i]["eventDate"], 11, 5); echo "$date $txt<br>\n"; } Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** molecule.inc.php 8 Sep 2002 14:46:57 -0000 1.27 --- molecule.inc.php 8 Sep 2002 22:38:08 -0000 1.28 *************** *** 125,129 **** $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] = "'".addslashes($this->{$vars[$i]})."'"; $vals[] = chr(strlen($this->cloneId)).$this->cloneId; $id = db_insert("Molecule", $vars, $vals); --- 125,129 ---- $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] =& $this->{$vars[$i]}; $vals[] = chr(strlen($this->cloneId)).$this->cloneId; [...101 lines suppressed...] ! "tissueName", "vectorName", "libraryName", "lastUpdate"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT m.*, v.name AS vectorName, t.name AS tissueName, ". ! "l.name AS libraryName ". "FROM Molecule m ".$search->getExtraTables()." ". "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(). --- 643,654 ---- "l.id = m.library")); ! $sortfields = array("`cloneId`", array("species", "`clusterId`"), ! "`geneSymbol`", "`geneName`", "chromosome", "`cytoBand`", ! "markers", "`locusLink`", "omim", "accession", "nid", "antibiotics", ! "`tissueName`", "`vectorName`", "`libraryName`", "`lastUpdate`"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT m.*, v.name AS `vectorName`, t.name AS `tissueName`, ". ! "l.name AS `libraryName` ". "FROM Molecule m ".$search->getExtraTables()." ". "WHERE 1 ".$search->getWhere()." ".$search->getExtraWhere(). Index: news.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/news.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** news.inc.php 7 Sep 2002 11:36:32 -0000 1.5 --- news.inc.php 8 Sep 2002 22:38:08 -0000 1.6 *************** *** 44,48 **** function getLatest($count, $from = 0) { ! $query = "SELECT * FROM News ORDER BY addedDate DESC ". db_limit((int)$from, (int)$count); $res = query($query); --- 44,48 ---- function getLatest($count, $from = 0) { ! $query = "SELECT * FROM News ORDER BY `addedDate` DESC ". db_limit((int)$from, (int)$count); $res = query($query); *************** *** 82,86 **** $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT n.*, u.userName ". "FROM News n, Submitter u WHERE n.owner = u.id ". $search->getWhere()." $ob ".$search->makeLimit(); --- 82,86 ---- $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT n.*, u.`userName` ". "FROM News n, Submitter u WHERE n.owner = u.id ". $search->getWhere()." $ob ".$search->makeLimit(); Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** plate.inc.php 7 Sep 2002 11:36:32 -0000 1.28 --- plate.inc.php 8 Sep 2002 22:38:08 -0000 1.29 *************** *** 59,63 **** { $query = "SELECT pt.* FROM PlateType pt, Plate p ". ! "WHERE p.id = ".(int)$plate." AND pt.id = p.plateType"; return $this->readQuery($query); } --- 59,63 ---- { $query = "SELECT pt.* FROM PlateType pt, Plate p ". ! "WHERE p.id = ".(int)$plate." AND pt.id = p.`plateType`"; return $this->readQuery($query); [...638 lines suppressed...] $arr[1][$row[0]] = $row[1]; ! $query = "SELECT `bacterialGrowth`, COUNT(*) ". ! "FROM Well WHERE `bacterialGrowth` <> '' AND probe = $probe ". ! "GROUP BY `bacterialGrowth`"; $res = query($query); while($row =& db_fetch_row($res)) *************** *** 962,966 **** { $probe = (int)$probe; ! $query = "SELECT w.*, p.plateType, p.name ". "FROM Well w, Plate p WHERE p.id = w.plate AND w.probe = $probe"; $res = query($query); --- 964,968 ---- { $probe = (int)$probe; ! $query = "SELECT w.*, p.`plateType`, p.name ". "FROM Well w, Plate p WHERE p.id = w.plate AND w.probe = $probe"; $res = query($query); Index: plot.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plot.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** plot.inc.php 7 Sep 2002 11:36:32 -0000 1.19 --- plot.inc.php 8 Sep 2002 22:38:08 -0000 1.20 *************** *** 112,121 **** } else $mn = "Median"; ! if($this->item == 0) $s = "$table.FCh1$mn-$table.BCh1$mn"; ! else if($this->item == 1) $s = "$table.FCh2$mn-$table.BCh2$mn"; ! else if($this->item == 2) $s = "($table.FCh1$mn-$table.BCh1$mn)/". ! "($table.FCh2$mn-$table.BCh2$mn)"; ! else $s = "($table.FCh1$mn-$table.BCh1$mn)*". ! "($table.FCh2$mn-$table.BCh2$mn)"; if($log) $s = "LOG($s)/LOG($log)"; if($this->item == 3) --- 112,121 ---- } else $mn = "Median"; ! if($this->item == 0) $s = "$table.`FCh1$mn`-$table.`BCh1$mn`"; ! else if($this->item == 1) $s = "$table.`FCh2$mn`-$table.`BCh2$mn`"; ! else if($this->item == 2) $s = "($table.`FCh1$mn`-$table.`BCh1$mn`)/". ! "($table.`FCh2$mn`-$table.`BCh2$mn`)"; ! else $s = "($table.`FCh1$mn`-$table.`BCh1$mn`)*". ! "($table.`FCh2$mn`-$table.`BCh2$mn`)"; if($log) $s = "LOG($s)/LOG($log)"; if($this->item == 3) *************** *** 444,449 **** "), AVG(".$a2->getExpression("t1", $ylog). ") FROM $table1 ". ! "WHERE t1.".($a1->type == "v" ? "bioAssay" : "rawBioAssay"). ! " = $a1->id"; } else --- 444,449 ---- "), AVG(".$a2->getExpression("t1", $ylog). ") FROM $table1 ". ! "WHERE t1.`".($a1->type == "v" ? "bioAssay" : "rawBioAssay"). ! "` = $a1->id"; } else *************** *** 451,456 **** $query = "SELECT ".$a1->getExpression("t1", $xlog).", ". $a2->getExpression("t1", $ylog)." FROM $table1 ". ! "WHERE t1.".($a1->type == "v" ? "bioAssay" : "rawBioAssay"). ! " = $a1->id"; } if($excluded && $a1->type == "v") --- 451,456 ---- $query = "SELECT ".$a1->getExpression("t1", $xlog).", ". $a2->getExpression("t1", $ylog)." FROM $table1 ". ! "WHERE t1.`".($a1->type == "v" ? "bioAssay" : "rawBioAssay"). ! "` = $a1->id"; } if($excluded && $a1->type == "v") *************** *** 488,494 **** "WHERE t1.position = t2.position"; } ! $query .= " AND t1.".($a1->type == "v" ? "bioAssay" : "rawBioAssay"). ! " = $a1->id AND t2.". ! ($a2->type == "v" ? "bioAssay" : "rawBioAssay")." = $a2->id"; if($excluded) { --- 488,494 ---- "WHERE t1.position = t2.position"; } ! $query .= " AND t1.`".($a1->type == "v" ? "bioAssay" : "rawBioAssay"). ! "` = $a1->id AND t2.`". ! ($a2->type == "v" ? "bioAssay" : "rawBioAssay")."` = $a2->id"; if($excluded) { Index: program.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/program.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** program.inc.php 7 Sep 2002 11:36:32 -0000 1.19 --- program.inc.php 8 Sep 2002 22:38:08 -0000 1.20 *************** *** 167,174 **** { $query = "SELECT id, name FROM Program ". ! "WHERE onServer ORDER BY name"; $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) $arr[$row[0]] = $row[1]; return $arr; } --- 167,175 ---- { $query = "SELECT id, name FROM Program ". ! "WHERE `onServer` ORDER BY name"; $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) ! $arr[$row[0]] = $row[1]; return $arr; } *************** *** 207,212 **** { $query = "REPLACE INTO ProgramParameter ". ! "(program, position, name, commonName, valueType, options, ". ! "defaultValue, enumOptions) VALUES ". "($this->id, ".(int)$pos.", ". "'".addslashes($name)."', ". --- 208,213 ---- { $query = "REPLACE INTO ProgramParameter ". ! "(program, position, name, `commonName`, `valueType`, options, ". ! "`defaultValue`, `enumOptions`) VALUES ". "($this->id, ".(int)$pos.", ". "'".addslashes($name)."', ". *************** *** 271,280 **** { // Add more fields here ! $sortfields = array("name", "execName", array("addedDate", "p.id"), ! "userName", "onServer", "geneAverages", "serialFormat", "url"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT p.*, u.userName ". "FROM Program p, Submitter u ". "WHERE u.id = p.owner ".$search->getWhere()." ". --- 272,282 ---- { // Add more fields here ! $sortfields = array("name", "`execName`", array("`addedDate`", "p.id"), ! "`userName`", "`onServer`", "`geneAverages`", "`serialFormat`", ! "url"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT p.*, u.`userName` ". "FROM Program p, Submitter u ". "WHERE u.id = p.owner ".$search->getWhere()." ". Index: protocol.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** protocol.inc.php 7 Sep 2002 11:36:32 -0000 1.7 --- protocol.inc.php 8 Sep 2002 22:38:08 -0000 1.8 *************** *** 82,86 **** "descr = '".addslashes($this->descr)."', ". "submitter = ".$this->submitter.", ". ! "fileId = ".$this->fileId." ". "WHERE id = $this->id"; return query($query); --- 82,86 ---- "descr = '".addslashes($this->descr)."', ". "submitter = ".$this->submitter.", ". ! "`fileId` = ".$this->fileId." ". "WHERE id = $this->id"; return query($query); *************** *** 182,187 **** { $type = (int)$type; ! $query = "SELECT p.*, u.name AS fname, u.fileSize, ". ! "u.addedDate AS fdate, s.userName AS sname ". "FROM Protocol p, Submitter s ". "LEFT JOIN Upload u ON u.id = p.fileid ". --- 182,187 ---- { $type = (int)$type; ! $query = "SELECT p.*, u.name AS fname, u.`fileSize`, ". ! "u.`addedDate` AS fdate, s.`userName` AS sname ". "FROM Protocol p, Submitter s ". "LEFT JOIN Upload u ON u.id = p.fileid ". *************** *** 203,207 **** $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) $arr[$row[0]] = $row[1]; return $arr; } --- 203,208 ---- $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) ! $arr[$row[0]] = $row[1]; return $arr; } Index: raw.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw.inc.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** raw.inc.php 7 Sep 2002 11:36:32 -0000 1.31 --- raw.inc.php 8 Sep 2002 22:38:08 -0000 1.32 *************** *** 87,99 **** query($query); $query = "DELETE FROM RawBioAssayData ". ! "WHERE rawBioAssay = $this->id"; query($query); $query = "DELETE FROM RawBioAssayHeader ". ! "WHERE rawBioAssay = $this->id"; query($query); // This is silly and will be deleted. $query = "DELETE FROM ExperimentRawBioAssay ". [...629 lines suppressed...] $res2 = query($query); ! if($row2 =& db_fetch_row($res2)) $row[3] = $row2[0]; ! else $row[3] = false; } $arr[] = $row; --- 754,767 ---- else if($grouping == 2) { ! $query = "SELECT h.`hybridizationDate` FROM RawBioAssay r, ". "ImageAcquisition ia, Hybridization h ". ! "WHERE r.id = $row[3] AND ia.id = r.`imageAcquisition` ". "AND h.id = ia.hybridization"; } $res2 = query($query); ! if($row2 =& db_fetch_row($res2)) ! $row[3] = $row2[0]; ! else ! $row[3] = false; } $arr[] = $row; Index: sampleannotation.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannotation.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** sampleannotation.inc.php 7 Sep 2002 11:36:32 -0000 1.15 --- sampleannotation.inc.php 8 Sep 2002 22:38:08 -0000 1.16 *************** *** 65,69 **** $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] = "'".addslashes($this->{$vars[$i]})."'"; $id = db_insert("SampleAnnotationType", $vars, $vals); if(!$id) --- 65,69 ---- $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] =& $this->{$vars[$i]}; $id = db_insert("SampleAnnotationType", $vars, $vals); [...108 lines suppressed...] function getBrieferForSample($sample) { ! $query = "SELECT sa.`annotationType`, sa.annotation ". "FROM SampleAnnotation sa ". ! "WHERE sa.sample = ".(int)$sample." ORDER BY sa.`annotationType`"; $arr = array(); $res = query($query); *************** *** 289,293 **** $annotationType = (int)$annotationType; $query = "DELETE FROM SampleAnnotation ". ! "WHERE sample = $sample AND annotationType = $annotationType"; query($query); } --- 293,297 ---- $annotationType = (int)$annotationType; $query = "DELETE FROM SampleAnnotation ". ! "WHERE sample = $sample AND `annotationType` = $annotationType"; query($query); } Index: sampletissue.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampletissue.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sampletissue.inc.php 7 Sep 2002 11:36:32 -0000 1.7 --- sampletissue.inc.php 8 Sep 2002 22:38:08 -0000 1.8 *************** *** 80,84 **** query($query); if(db_affected_rows() <= 0) return false; ! $query = "UPDATE Sample SET tissue = $this->parent WHERE tissue = $this->id"; query($query); return true; --- 80,85 ---- query($query); if(db_affected_rows() <= 0) return false; ! $query = "UPDATE Sample SET tissue = $this->parent ". ! "WHERE tissue = $this->id"; query($query); return true; Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** search.inc.php 8 Sep 2002 13:18:04 -0000 1.35 --- search.inc.php 8 Sep 2002 22:38:08 -0000 1.36 *************** *** 140,144 **** $search = (int)$search; $query = "SELECT * FROM Preset ". ! "WHERE search = $search AND searchType = $searchType ". "AND owner = ".(int)$owner; return $this->readQuery($query); --- 140,144 ---- $search = (int)$search; $query = "SELECT * FROM Preset ". ! "WHERE search = $search AND `searchType` = $searchType ". "AND owner = ".(int)$owner; [...179 lines suppressed...] $this->search = (int)$search; $this->position = (int)$position; ! $query = "SELECT * FROM SearchCriterion ". ! "WHERE search = $this->search ". "AND position = $this->position"; $res = query($query); *************** *** 887,891 **** { $search = (int)$search; ! $query = "SELECT * FROM SearchCriterion WHERE search = $search ORDER BY position"; $res = query($query); $arr = array(); --- 898,903 ---- { $search = (int)$search; ! $query = "SELECT * FROM SearchCriterion ". ! "WHERE search = $search ORDER BY position"; $res = query($query); $arr = array(); Index: session.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/session.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** session.inc.php 8 Sep 2002 14:46:58 -0000 1.5 --- session.inc.php 8 Sep 2002 22:38:08 -0000 1.6 *************** *** 44,49 **** if($cookie != "") $this->cookie = $cookie; ! $query = "SELECT * FROM Cookie WHERE cookie = '".addslashes($this->cookie)."' "; ! if($ip != "") $query .= "AND IP = '".addslashes($ip)."'"; $res = query($query); if($row =& db_fetch_assoc($res)) --- 44,51 ---- if($cookie != "") $this->cookie = $cookie; ! $query = "SELECT * FROM Cookie ". [...91 lines suppressed...] function justLoggedIn() { ! $query = "SELECT u.userName FROM Cookie c, Submitter u ". ! "WHERE c.owner = u.id AND c.loginDate > NOW() - ".db_interval(200); $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) $arr[] = $row[0]; return $arr; } --- 215,224 ---- function justLoggedIn() { ! $query = "SELECT u.`userName` FROM Cookie c, Submitter u ". ! "WHERE c.owner = u.id AND c.`loginDate` > NOW() - ".db_interval(200); $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) ! $arr[] = $row[0]; return $arr; } Index: transformation.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/transformation.inc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** transformation.inc.php 7 Sep 2002 12:04:26 -0000 1.14 --- transformation.inc.php 8 Sep 2002 22:38:08 -0000 1.15 *************** *** 139,144 **** $query = "SELECT tr.* ". "FROM Transformation tr, BioAssaySet bas ". ! "WHERE bas.experiment = $expid AND tr.bioAssaySet = bas.id ". ! "ORDER BY addedDate, id"; $res = query($query); $arr = array(); --- 139,144 ---- $query = "SELECT tr.* ". "FROM Transformation tr, BioAssaySet bas ". ! "WHERE bas.experiment = $expid AND tr.`bioAssaySet` = bas.id ". [...118 lines suppressed...] "AND bas.experiment = $expid"; $res = query($query); ! if($row =& db_fetch_row($res)) ! return true; return false; } *************** *** 226,230 **** "WHERE p.id = j.program AND j.transformation = ".(int)$id; $res = query($query); ! if($row =& db_fetch_row($res)) return $row[0]; return ""; } --- 232,237 ---- "WHERE p.id = j.program AND j.transformation = ".(int)$id; $res = query($query); ! if($row =& db_fetch_row($res)) ! return $row[0]; return ""; } Index: upload.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/upload.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** upload.inc.php 7 Sep 2002 11:36:32 -0000 1.19 --- upload.inc.php 8 Sep 2002 22:38:08 -0000 1.20 *************** *** 138,142 **** $owner = (int)$owner; $query = "SELECT * FROM Upload WHERE owner = $owner ". ! "AND !hidden ORDER BY addedDate"; $res = query($query); $arr = array(); --- 138,142 ---- $owner = (int)$owner; $query = "SELECT * FROM Upload WHERE owner = $owner ". ! "AND hidden = 0 ORDER BY `addedDate`"; $res = query($query); [...116 lines suppressed...] { // Add more fields here ! $sortfields = array("name", "`fileSize`", "`addedDate`", ! "descr", "`userName`"); if($search->getSortField() == 4) { *************** *** 313,317 **** $query = "SELECT up.* ". "FROM Upload up". $search->getExtraTables()." ". ! "WHERE !up.hidden ".$search->getExtraWhere()." ".$search->getWhere(). " $ob ".$search->makeLimit(); --- 315,320 ---- $query = "SELECT up.* ". "FROM Upload up". $search->getExtraTables()." ". ! "WHERE up.hidden = 0 ".$search->getExtraWhere()." ". ! $search->getWhere(). " $ob ".$search->makeLimit(); Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** user.inc.php 7 Sep 2002 11:36:32 -0000 1.5 --- user.inc.php 8 Sep 2002 22:38:08 -0000 1.6 *************** *** 94,100 **** if($pass != "") $this->setPassword($pass); $query = "SELECT * FROM Submitter ". ! "WHERE userName = '".addslashes($this->userName)."' ". ! "AND md5Pass = '".addslashes($this->md5Pass)."' ". ! "AND activeUntil >= NOW()"; return $this->readQuery($query); } --- 94,100 ---- if($pass != "") $this->setPassword($pass); $query = "SELECT * FROM Submitter ". [...183 lines suppressed...] $ob = $search->makeOrderBy($sortfields); $query = "SELECT u.*, ". ! "TO_DAYS(activeUntil) - TO_DAYS(NOW()) AS daysLeft, ". ! "(u.accessMask & (".BUA_SUPERUSER.")) AS superUser ". "FROM Submitter u WHERE 1 ".$search->getWhere(). " $ob ".$search->makeLimit(); --- 373,384 ---- { // Add more fields here ! $sortfields = array("`userName`", "name", "phone", "email", ! "`activeUntil`", "`superUser`", "`accessMask`"); $ob = $search->makeOrderBy($sortfields); $query = "SELECT u.*, ". ! "TO_DAYS(`activeUntil`) - TO_DAYS(NOW()) AS `daysLeft`, ". ! "(u.`accessMask` & (".BUA_SUPERUSER.")) AS `superUser` ". "FROM Submitter u WHERE 1 ".$search->getWhere(). " $ob ".$search->makeLimit(); Index: ware.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ware.inc.php 7 Sep 2002 11:36:32 -0000 1.8 --- ware.inc.php 8 Sep 2002 22:38:08 -0000 1.9 *************** *** 105,113 **** // Add more fields here $sortfields = array("shown", array("name", "version"), ! array("version", "name"), "addedDate", "userName"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT w.*, u.userName ". "FROM $type w, Submitter u ". "WHERE u.id = w.owner ". --- 105,113 ---- // Add more fields here $sortfields = array("shown", array("name", "version"), ! array("version", "name"), "`addedDate`", "`userName`"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT w.*, u.`userName` ". "FROM $type w, Submitter u ". "WHERE u.id = w.owner ". *************** *** 115,120 **** "$ob ".$search->makeLimit(); $arr = array(); ! if(!($res = query($query))) return $arr; ! while($row =& db_fetch_assoc($res)) $arr[] = $row; return $arr; } --- 115,122 ---- "$ob ".$search->makeLimit(); $arr = array(); ! if(!($res = query($query))) ! return $arr; ! while($row =& db_fetch_assoc($res)) ! $arr[] = $row; return $arr; } *************** *** 169,173 **** $res = query($query); $arr = array(); ! while($row =& db_fetch_assoc($res)) $arr[$row["id"]] = $row; return $arr; } --- 171,176 ---- $res = query($query); $arr = array(); ! while($row =& db_fetch_assoc($res)) ! $arr[$row["id"]] = $row; return $arr; } *************** *** 236,240 **** $res = query($query); $arr = array(); ! while($row =& db_fetch_assoc($res)) $arr[$row["id"]] = $row; return $arr; } --- 239,244 ---- $res = query($query); $arr = array(); ! while($row =& db_fetch_assoc($res)) ! $arr[$row["id"]] = $row; return $arr; } Index: wizzzard.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/wizzzard.inc.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wizzzard.inc.php 7 Sep 2002 11:36:32 -0000 1.24 --- wizzzard.inc.php 8 Sep 2002 22:38:08 -0000 1.25 *************** *** 63,67 **** { $vars = array("id", "owner", "etype", "name", "numCols", ! "extraCols", "dataHeader", "typeHeader", "typeHeaderLine", "mapping"); for($i = 0; $i < count($vars); $i++) $this->$vars[$i] = $row[$vars[$i]]; --- 63,68 ---- { $vars = array("id", "owner", "etype", "name", "numCols", ! "extraCols", "dataHeader", "typeHeader", "typeHeaderLine", ! "mapping"); for($i = 0; $i < count($vars); $i++) $this->$vars[$i] = $row[$vars[$i]]; *************** *** 83,87 **** $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] = "'".addslashes($this->{$vars[$i]})."'"; $id = db_insert("Wizzzard", $vars, $vals); if(!$id) --- 84,88 ---- $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] =& $this->{$vars[$i]}; $id = db_insert("Wizzzard", $vars, $vals); if(!$id) *************** *** 93,97 **** { for($i = 0; $i < count($vars); $i++) ! $vars[$i] = "$vars[$i] = '".addslashes($this->{$vars[$i]})."'"; $query = "UPDATE Wizzzard SET ".implode(", ", $vars)." ". "WHERE id = $this->id"; --- 94,98 ---- { for($i = 0; $i < count($vars); $i++) ! $vars[$i] = "`$vars[$i]` = '".addslashes($this->{$vars[$i]})."'"; $query = "UPDATE Wizzzard SET ".implode(", ", $vars)." ". "WHERE id = $this->id"; *************** *** 671,679 **** $ownerId = (int)$ownerId; // Add more fields here ! $sortfields = array("name", "userName", "extraCols", "useWiz"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT w.*, u.userName, (wu.owner IS NOT NULL) AS useWiz ". "FROM Wizzzard w, Submitter u ". "LEFT JOIN WizzzardUser wu ON wu.wizzzard = w.id ". --- 672,681 ---- $ownerId = (int)$ownerId; // Add more fields here ! $sortfields = array("name", "`userName`", "`extraCols`", "`useWiz`"); $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT w.*, u.`userName`, ". ! "(wu.owner IS NOT NULL) AS `useWiz` ". "FROM Wizzzard w, Submitter u ". "LEFT JOIN WizzzardUser wu ON wu.wizzzard = w.id ". *************** *** 713,717 **** $query = "SELECT owner FROM Wizzzard WHERE id = ".(int)$id; $res = query($query); ! if($row =& db_fetch_row($res)) return $row[0] == (int)$owner; return false; } --- 715,720 ---- $query = "SELECT owner FROM Wizzzard WHERE id = ".(int)$id; $res = query($query); ! if($row =& db_fetch_row($res)) ! return $row[0] == (int)$owner; return false; } |
From: <tr...@us...> - 2002-09-08 22:37:29
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv25321 Modified Files: mysql.inc.php pgsql.inc.php Log Message: re-added multiinsert Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mysql.inc.php 8 Sep 2002 18:05:24 -0000 1.7 --- mysql.inc.php 8 Sep 2002 22:37:25 -0000 1.8 *************** *** 180,184 **** } ! /*function db_multiinsert_begin($table, $columns) { $res = array($table, $columns, array()); --- 180,184 ---- } ! function db_multiinsert_begin($table, $columns) { $res = array($table, $columns, array()); *************** *** 205,209 **** return -1; return mysql_affected_rows(); ! }*/ function db_tabfile_load($filename, $table, $columns) --- 205,209 ---- return -1; return mysql_affected_rows(); ! } function db_tabfile_load($filename, $table, $columns) Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgsql.inc.php 8 Sep 2002 14:50:02 -0000 1.3 --- pgsql.inc.php 8 Sep 2002 22:37:25 -0000 1.4 *************** *** 36,40 **** "dbname = '".addslashes($database)."'"; $this->serv = pg_pconnect($cstring) ! or die("pg_pconnect() failed: ".pg_last_error()."\n"); } --- 36,40 ---- "dbname = '".addslashes($database)."'"; $this->serv = pg_pconnect($cstring) ! or die("pg_pconnect() failed: ".pg_last_error()); } [...220 lines suppressed...] + } + else if($s == 1) + { + if($c == "'") $s = 0; + else if($c == "\\") $s = 2; + $q2 .= $c; + } + else + { + $s = 1; + $q2 .= $c; + } + } + if($s != 0) + { + error_log("db_pgsql_requote: error in query string (final state: ". + ($s == 1 ? "quoted" : "backslashed").")"); + } } |
From: <tr...@us...> - 2002-09-08 18:05:28
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv22821 Modified Files: mysql.inc.php Log Message: Added forgotten escaping in db_insert Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mysql.inc.php 8 Sep 2002 14:50:02 -0000 1.6 --- mysql.inc.php 8 Sep 2002 18:05:24 -0000 1.7 *************** *** 93,99 **** function db_insert($table, &$columns, &$values) { $query = "INSERT INTO $table (".implode(", ", $columns).") ". ! "VALUES (".implode(", ", $values).")"; ! if(!query($query)) return false; return mysql_insert_id(); } --- 93,104 ---- function db_insert($table, &$columns, &$values) { + $arr = array(); + for(reset($values); list(, $v) = each($values); ) + $arr[] = "'".addslashes($v)."'"; + $query = "INSERT INTO $table (".implode(", ", $columns).") ". ! "VALUES (".implode(", ", $arr).")"; ! if(!query($query)) ! return false; return mysql_insert_id(); } |
From: <tr...@us...> - 2002-09-08 14:50:05
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv11433 Modified Files: mysql.inc.php pgsql.inc.php Log Message: Added missing 'function' keyword Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mysql.inc.php 8 Sep 2002 14:46:58 -0000 1.5 --- mysql.inc.php 8 Sep 2002 14:50:02 -0000 1.6 *************** *** 250,254 **** // Return a representation of a time interval ! db_interval($secs) { return "INTERVAL ".(int)$secs." SECOND"; --- 250,254 ---- // Return a representation of a time interval ! function db_interval($secs) { return "INTERVAL ".(int)$secs." SECOND"; Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pgsql.inc.php 8 Sep 2002 14:46:58 -0000 1.2 --- pgsql.inc.php 8 Sep 2002 14:50:02 -0000 1.3 *************** *** 249,253 **** // Return a representation of a time interval ! db_interval($secs) { return "INTERVAL '".(int)$secs." s'"; --- 249,253 ---- // Return a representation of a time interval ! function db_interval($secs) { return "INTERVAL '".(int)$secs." s'"; |
From: <tr...@us...> - 2002-09-08 14:48:03
|
Update of /cvsroot/basedb/basedb In directory usw-pr-cvs1:/tmp/cvs-serv10876 Added Files: base_pg.sql Log Message: Structure and data for postgresql --- NEW FILE: base_pg.sql --- -- -- Selected TOC Entries: -- \connect base base -- -- TOC Entry ID 2 (OID 1099523) -- -- Name: array_id_seq Type: SEQUENCE Owner: postgres -- CREATE SEQUENCE array_id_seq start 1 increment 1 maxvalue 9223372036854775807 minvalue 1 cache 1; -- -- TOC Entry ID 98 (OID 1099525) -- -- Name: Array Type: TABLE Owner: postgres -- [...2221 lines suppressed...] -- -- TOC Entry ID 247 (OID 1100079) -- -- Name: name_sample_index Type: INDEX Owner: postgres -- CREATE UNIQUE INDEX name_sample_index ON Sample USING btree (name); SELECT setval ('program_id_seq', 5, true); SELECT setval ('protocol_id_seq', 13, true); SELECT setval ('protocoltype_id_seq', 15, true); SELECT setval ('submitter_id_seq', 2, true); SELECT setval ('sampletissue_id_seq', 2, true); |
From: <tr...@us...> - 2002-09-08 14:47:04
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv10601 Modified Files: molecule.inc.php mysql.inc.php pgsql.inc.php session.inc.php Log Message: Added db_interval function to deal with different time interval representations Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** molecule.inc.php 7 Sep 2002 11:36:32 -0000 1.26 --- molecule.inc.php 8 Sep 2002 14:46:57 -0000 1.27 *************** *** 603,607 **** $secs = (int)$secs; $query = "SELECT id FROM Molecule ". ! "WHERE lastUpdate < NOW() - INTERVAL $secs SECOND ". "ORDER BY lastUpdate"; $res = query($query); --- 603,607 ---- $secs = (int)$secs; $query = "SELECT id FROM Molecule ". ! "WHERE lastUpdate < NOW() - ".db_interval($secs)." ". "ORDER BY lastUpdate"; $res = query($query); Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mysql.inc.php 8 Sep 2002 13:17:08 -0000 1.4 --- mysql.inc.php 8 Sep 2002 14:46:58 -0000 1.5 *************** *** 249,251 **** --- 249,257 ---- } + // Return a representation of a time interval + db_interval($secs) + { + return "INTERVAL ".(int)$secs." SECOND"; + } + ?> Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pgsql.inc.php 8 Sep 2002 13:15:59 -0000 1.1 --- pgsql.inc.php 8 Sep 2002 14:46:58 -0000 1.2 *************** *** 60,64 **** function &db_fetch_assoc(&$r) { ! return pg_fetch_array($GLOBALS["curDb"]->serv, $r, PGSQL_ASSOC); } function db_num_rows(&$r) --- 60,66 ---- function &db_fetch_assoc(&$r) { ! // print_r(get_defined_vars()); ! // return pg_fetch_array($GLOBALS["curDb"]->serv, $r, PGSQL_ASSOC); ! return pg_fetch_array($r); } function db_num_rows(&$r) *************** *** 73,82 **** function query(&$query, $quiet = 0) { ! // error_log("Q: $query"); $res = pg_query($query); if(!$res && !$quiet) error_log("PostgresSQL query failed: \"".$query."\" : ".pg_last_error()); ! $GLOBALS["curDb"]->affected = pg_affected_rows($res); return $res; } --- 75,87 ---- function query(&$query, $quiet = 0) { ! error_log("Q: $query"); $res = pg_query($query); if(!$res && !$quiet) error_log("PostgresSQL query failed: \"".$query."\" : ".pg_last_error()); ! if($res) ! $GLOBALS["curDb"]->affected = pg_affected_rows($res); ! else ! $GLOBALS["curDb"]->affected = -1; return $res; } *************** *** 114,118 **** $arr = array(); for($i = 0; $i < count($keycolumns) - 1; $i++) ! $arr[] = "$keycolumns[$i] = '".addslashes($keyvalues[$i])."'" $query = "SELECT MAX($lastcol) FROM $table ". --- 119,123 ---- $arr = array(); for($i = 0; $i < count($keycolumns) - 1; $i++) ! $arr[] = "$keycolumns[$i] = '".addslashes($keyvalues[$i])."'"; $query = "SELECT MAX($lastcol) FROM $table ". *************** *** 241,244 **** --- 246,255 ---- } return true; + } + + // Return a representation of a time interval + db_interval($secs) + { + return "INTERVAL '".(int)$secs." s'"; } Index: session.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/session.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** session.inc.php 7 Sep 2002 11:36:32 -0000 1.4 --- session.inc.php 8 Sep 2002 14:46:58 -0000 1.5 *************** *** 195,199 **** $secsToLive = (int)$secsToLive; $query = "DELETE FROM Cookie ". ! "WHERE lastseen < NOW() - INTERVAL $secsToLive SECOND"; query($query); } --- 195,199 ---- $secsToLive = (int)$secsToLive; $query = "DELETE FROM Cookie ". ! "WHERE lastseen < NOW() - ".db_interval($secsToLive); query($query); } *************** *** 210,214 **** { $query = "SELECT u.userName FROM Cookie c, Submitter u ". ! "WHERE c.owner = u.id AND c.loginDate > NOW() - INTERVAL 200 SECOND"; $res = query($query); $arr = array(); --- 210,214 ---- { $query = "SELECT u.userName FROM Cookie c, Submitter u ". ! "WHERE c.owner = u.id AND c.loginDate > NOW() - ".db_interval(200); $res = query($query); $arr = array(); |
From: <tr...@us...> - 2002-09-08 14:02:45
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv636 Modified Files: genelist.inc.php Log Message: ugly fix for auto_increment in temp table Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** genelist.inc.php 7 Sep 2002 13:12:13 -0000 1.17 --- genelist.inc.php 8 Sep 2002 14:02:42 -0000 1.18 *************** *** 237,240 **** --- 237,242 ---- function populateFromQuery($moleculequery) { + global $config; + // Previously it was possible to select directly into GeneListGene // if no genelist was used in the select, but with the new 'score' *************** *** 249,259 **** return -1; } $res = -1; $moleculequery = "INSERT INTO GeneListTemp (molecule) ".$moleculequery; ! if(query($moleculequery)) { $query = "INSERT INTO GeneListGene (geneList, molecule, score) ". "SELECT $this->id, molecule, score FROM GeneListTemp"; ! if(query($query)) $res = db_affected_rows(); } db_table_drop("GeneListTemp"); --- 251,273 ---- return -1; } + if($config["RDBMS"] != "mysql") + { + $query = "CREATE TEMPORARY SEQUENCE genelisttemp_score_seq"; + query($query); + } $res = -1; $moleculequery = "INSERT INTO GeneListTemp (molecule) ".$moleculequery; ! $tmp = query($moleculequery); ! if($config["RDBMS"] != "mysql") ! { ! $query = "DROP SEQUENCE genelisttemp_score_seq"; ! query($query); ! } ! if($tmp) { $query = "INSERT INTO GeneListGene (geneList, molecule, score) ". "SELECT $this->id, molecule, score FROM GeneListTemp"; ! if(query($query)) ! $res = db_affected_rows(); } db_table_drop("GeneListTemp"); |
From: <tr...@us...> - 2002-09-08 13:19:03
|
Update of /cvsroot/basedb/basedb In directory usw-pr-cvs1:/tmp/cvs-serv20157 Modified Files: example_config.inc.php Log Message: Added config item 'RDBMS' Index: example_config.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/example_config.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** example_config.inc.php 30 Jul 2002 16:57:34 -0000 1.4 --- example_config.inc.php 8 Sep 2002 13:19:00 -0000 1.5 *************** *** 30,34 **** $config["sessionTimeout"] = 900; ! // MySQL details: Host, user, password, main database, database for // dynamic tables (can be the same as the main database, but it's not // recommended as it'll get awfully cluttered). --- 30,38 ---- $config["sessionTimeout"] = 900; ! // What relational database management system to use. ! // Possible values: mysql, pgsql ! $config["RDBMS"] = "mysql"; ! ! // Database settings: Host, user, password, main database, database for // dynamic tables (can be the same as the main database, but it's not // recommended as it'll get awfully cluttered). |
From: <tr...@us...> - 2002-09-08 13:18:36
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv20077 Modified Files: common.inc.php db.inc.php Log Message: Added config item 'RDBMS' Index: common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/common.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** common.inc.php 23 Aug 2002 13:13:58 -0000 1.17 --- common.inc.php 8 Sep 2002 13:18:33 -0000 1.18 *************** *** 33,40 **** die("Configuration error - see log for details"); } ! $cfgvars = array("sessionTimeout", "dbHost", "dbUser", "dbPassword", ! "dbDatabase", "dbDynamic", "cookieName", "adminName", "adminEmail", ! "uploadDir", "tempDir", "jobDir", "rawFileDir", "rawImageDir", ! "printMapDir", "execDir", "webDir", "gnuplot", "mime.types"); foreach($cfgvars as $v) { --- 33,41 ---- die("Configuration error - see log for details"); } ! $cfgvars = array("sessionTimeout", "RDBMS", "dbHost", "dbUser", ! "dbPassword", "dbDatabase", "dbDynamic", "cookieName", "adminName", ! "adminEmail", "uploadDir", "tempDir", "jobDir", "rawFileDir", ! "rawImageDir", "printMapDir", "execDir", "webDir", "gnuplot", ! "mime.types"); foreach($cfgvars as $v) { *************** *** 49,53 **** unset($v); ! // This appeared before we had chosen the name 'BASE'. $config["codename"] = "BASE 1.1dev"; --- 50,56 ---- unset($v); ! // This appeared before we had chosen the name 'BASE'. It used to be in ! // the config file but then it wasn't updated with each new version and ! // that was... well, not a Good Thing. $config["codename"] = "BASE 1.1dev"; Index: db.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/db.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** db.inc.php 7 Sep 2002 11:36:32 -0000 1.10 --- db.inc.php 8 Sep 2002 13:18:33 -0000 1.11 *************** *** 25,29 **** // ! require_once("mysql.inc.php"); ?> --- 25,29 ---- // ! require_once("$config[RDBMS].inc.php"); ?> |
From: <tr...@us...> - 2002-09-08 13:18:06
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv19979 Modified Files: search.inc.php Log Message: moved some escaping to db_insert_multicol Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** search.inc.php 7 Sep 2002 11:36:32 -0000 1.34 --- search.inc.php 8 Sep 2002 13:18:04 -0000 1.35 *************** *** 805,814 **** if($this->position < 1) { - $vars[] = "search"; $keycols = array("search", "position"); $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] = "'".addslashes($this->{$vars[$i]})."'"; ! $pos = db_insert_multicol("SearchCriterion", $keycols, $vars, $vals); if(!$pos) return false; --- 805,815 ---- if($this->position < 1) { $keycols = array("search", "position"); + $keyvals = array($this->search); $vals = array(); for($i = 0; $i < count($vars); $i++) ! $vals[] =& $this->{$vars[$i]}; ! $pos = db_insert_multicol("SearchCriterion", ! $keycols, $keyvals, $vars, $vals); if(!$pos) return false; |
From: <tr...@us...> - 2002-09-08 13:17:11
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv19778 Modified Files: mysql.inc.php Log Message: Fixed missing escaping Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mysql.inc.php 7 Sep 2002 13:12:13 -0000 1.3 --- mysql.inc.php 8 Sep 2002 13:17:08 -0000 1.4 *************** *** 91,97 **** // a column called 'id' as its primary key. The id of the newly inserted // row is returned. ! function db_insert($table, &$names, &$values) { ! $query = "INSERT INTO $table (".implode(", ", $names).") ". "VALUES (".implode(", ", $values).")"; if(!query($query)) return false; --- 91,97 ---- // a column called 'id' as its primary key. The id of the newly inserted // row is returned. ! function db_insert($table, &$columns, &$values) { ! $query = "INSERT INTO $table (".implode(", ", $columns).") ". "VALUES (".implode(", ", $values).")"; if(!query($query)) return false; *************** *** 106,114 **** // This is the behavior you get with auto_increment on the non-first // column of a primary key in MySQL. ! function db_insert_multicol($table, &$keycolumns, &$names, &$values) { ! $query = "INSERT INTO $table (".implode(", ", $names).") ". ! "VALUES (".implode(", ", $values).")"; ! if(!query($query)) return false; return mysql_insert_id(); } --- 106,123 ---- // This is the behavior you get with auto_increment on the non-first // column of a primary key in MySQL. ! function db_insert_multicol($table, &$keycolumns, &$keyvalues, ! &$columns, &$values) { ! $arr = array(); ! for(reset($keyvalues); list(, $v) = each($keyvalues); ) ! $arr[] = "'".addslashes($v)."'"; ! for(reset($values); list(, $v) = each($values); ) ! $arr[] = "'".addslashes($v)."'"; ! $allcols = array_merge($keycolumns, $columns); ! ! $query = "INSERT INTO $table (".implode(", ", $allcols).") ". ! "VALUES (".implode(", ", $arr).")"; ! if(!query($query)) ! return false; return mysql_insert_id(); } *************** *** 147,154 **** $arr[] = "'".addslashes($v)."'"; $query = "INSERT INTO $table ". ! "(".implode(",", $keys).",".implode(",", $columns).") ". "VALUES (".implode(",", $arr).")"; ! return query($query) && mysql_affected_rows() > 0; } --- 156,164 ---- $arr[] = "'".addslashes($v)."'"; + $allcols = array_merge($keys, $columns); $query = "INSERT INTO $table ". ! "(".implode(",", $allcols).") ". "VALUES (".implode(",", $arr).")"; ! return (bool)query($query); } |
From: <tr...@us...> - 2002-09-08 13:16:02
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv19569 Added Files: pgsql.inc.php Log Message: First untested attempt at postgresql compatibility --- NEW FILE: pgsql.inc.php --- <? // $Id: pgsql.inc.php,v 1.1 2002/09/08 13:15:59 troein Exp $ // // BioArray Software Environment (BASE) - homepage http://base.thep.lu.se/ // Copyright (C) 2002 Lao Saal, Carl Troein, Johan Vallon-Christersson (LSCTJVC) // // Write to LSCTJVC, Dept. of Oncology, Lund University Hospital, // Klinikgatan 7, SE-22185, Lund, Sweden. // // This file is part of BASE. // // BASE is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // BASE 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 [...206 lines suppressed...] $query = "CREATE $tmp TABLE $to () INHERITS ($from)"; return (bool)query($query); } // This function drops a table quietly. It exists because we want to use // persistent connections and we might come across temporary tables that // haven't been deleted because of script errors. function db_table_drop($table) { $query = "DROP TABLE $table"; if(!pg_query($query) && pg_last_error() != "ERROR: table \"$table\" does not exist") { error_log("PostgresSQL query failed: \"".$query."\" : ".pg_last_error()); return false; } return true; } ?> |
From: <tr...@us...> - 2002-09-07 13:12:16
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv10570 Modified Files: genelist.inc.php mysql.inc.php Log Message: made the multiinsert functions unnecessary Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** genelist.inc.php 7 Sep 2002 11:36:32 -0000 1.16 --- genelist.inc.php 7 Sep 2002 13:12:13 -0000 1.17 *************** *** 191,199 **** --- 191,203 ---- function populate(&$genes, $append = false) { + $iua = ignore_user_abort(1); if(!$append) { $query = "DELETE FROM GeneListGene WHERE geneList = $this->id"; if(!query($query)) + { + ignore_user_abort($iua); return false; + } } else *************** *** 203,220 **** "AND molecule IN (".implode(",", array_keys($genes)).")"; if(!query($query)) return false; } ! $mi = db_multiinsert_begin("GeneListGene", ! array("geneList", "molecule", "score")); ! for(reset($genes); list($i,$v) = each($genes);) { ! $arr = array($this->id, (int)$i, (float)$v); ! db_multiinsert_row($mi, $arr); } ! unset($arr); ! $added = db_multiinsert_finish($mi); $this->updateGeneCount(); return $added; } --- 207,232 ---- "AND molecule IN (".implode(",", array_keys($genes)).")"; if(!query($query)) + { + ignore_user_abort($iua); return false; + } } ! $fname = tempFileName(); ! $fd = fopen($fname, "wb"); ! if(!$fd) { ! ignore_user_abort($iua); ! return false; } ! for(reset($genes); list($i,$v) = each($genes);) ! fwrite($fd, $this->id."\t".(int)$i."\t".(float)$v."\n"); ! fclose($fd); + $added = db_tabfile_load($fname, "GeneListGene", + array("geneList", "molecule", "score")); + unlink($fname); $this->updateGeneCount(); + ignore_user_abort($iua); return $added; } Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mysql.inc.php 7 Sep 2002 12:04:05 -0000 1.2 --- mysql.inc.php 7 Sep 2002 13:12:13 -0000 1.3 *************** *** 165,169 **** } ! function db_multiinsert_begin($table, $columns) { $res = array($table, $columns, array()); --- 165,169 ---- } ! /*function db_multiinsert_begin($table, $columns) { $res = array($table, $columns, array()); *************** *** 190,194 **** return -1; return mysql_affected_rows(); ! } function db_tabfile_load($filename, $table, $columns) --- 190,194 ---- return -1; return mysql_affected_rows(); ! }*/ function db_tabfile_load($filename, $table, $columns) |
From: <tr...@us...> - 2002-09-07 13:11:48
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv10476 Modified Files: genelist_edit.phtml Log Message: improved how the form retains values on failure Index: genelist_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist_edit.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** genelist_edit.phtml 29 Aug 2002 16:51:33 -0000 1.13 --- genelist_edit.phtml 7 Sep 2002 13:11:44 -0000 1.14 *************** *** 185,192 **** <tr><th colspan=4>Alter the reporter list</th></tr> <tr><th>Mode of operation</th><td colspan=3><select name=i_append> - <option value=0>Replace the entire list - <option value=1>Append reporters to list - </select></td></tr> <? } --- 185,196 ---- <tr><th colspan=4>Alter the reporter list</th></tr> <tr><th>Mode of operation</th><td colspan=3><select name=i_append> <? + $modes = array("Replace the entire list", "Append/update reporters"); + for(reset($modes); list($i, $n) = each($modes); ) + { + $sel = (isset($i_append) && $i_append == $i) ? "selected" : ""; + echo "<option value=$i $sel>".html($n, 0)."\n"; + } + echo "</select></td></tr>\n"; } *************** *** 220,227 **** isset($i_col) ? (int)$i_col : "" ?>" size=5></td></tr> <tr><th>Value column</th> ! <td><input type=text name=i_vcol value="<?= ! isset($i_vcol) ? (int)$i_vcol : "" ?>" size=5></td> ! <td class=help colspan=2>Leave this blank to get values from 1 ! and up</td></tr> <tr><td colspan=4><input type=submit value="Accept"></td></tr> --- 224,231 ---- isset($i_col) ? (int)$i_col : "" ?>" size=5></td></tr> <tr><th>Value column</th> ! <td colspan=3><input type=text name=i_vcol value="<?= ! (isset($i_vcol) && $i_vcol > 0) ? (int)$i_vcol : "" ?>" size=5> ! <span class=help>Leave this blank to get values from 1 ! and up</span></td></tr> <tr><td colspan=4><input type=submit value="Accept"></td></tr> |
From: <tr...@us...> - 2002-09-07 12:04:30
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv28493 Modified Files: transformation.inc.php Log Message: removed debug info Index: transformation.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/transformation.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** transformation.inc.php 7 Sep 2002 11:36:32 -0000 1.13 --- transformation.inc.php 7 Sep 2002 12:04:26 -0000 1.14 *************** *** 50,56 **** { $n = $this->id; ! $r = parent::write(array("bioAssaySet", "isFilter")); ! error_log(($n ? "Updated" : "Created") . "Transformation $this->id"); ! return $r; } --- 50,54 ---- { $n = $this->id; ! return parent::write(array("bioAssaySet", "isFilter")); } *************** *** 61,65 **** { $id = $this->id; - error_log("Removing Transformation $id"); Search::removeAllForTransformation($id); --- 59,62 ---- *************** *** 235,260 **** function lockId($id, $exclusive) { ! $r = parent::lockItem("Transformation", $id, $exclusive); ! error_log("Transformation $id lockId (".(int)$exclusive."): ".(int)$r); ! return $r; } function unlockId($id, $exclusive) { ! $r = parent::unlockItem("Transformation", $id, $exclusive); ! error_log("Transformation $id unlockId (".(int)$exclusive."): ".(int)$r); ! return $r; ! } ! ! function lock($exclusive) ! { ! $r = parent::lock($exclusive); ! error_log("Transformation $this->id lock (".(int)$exclusive."): ".(int)$r); ! return $r; ! } ! function unlock($exclusive) ! { ! $r = parent::unlock($exclusive); ! error_log("Transformation $this->id unlock (".(int)$exclusive."): ".(int)$r); ! return $r; } --- 232,240 ---- function lockId($id, $exclusive) { ! return parent::lockItem("Transformation", $id, $exclusive); } function unlockId($id, $exclusive) { ! return parent::unlockItem("Transformation", $id, $exclusive); } |