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
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv413 Modified Files: array.inc.php array_popup.phtml hyb.inc.php hyb_common.inc.php hyb_edit.phtml hyb_list.phtml hyb_result.phtml links_common.inc.php Log Message: Re-made it possible to pick array for hyb Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** array.inc.php 2 Oct 2002 17:50:56 -0000 1.41 --- array.inc.php 3 Oct 2002 18:00:07 -0000 1.42 *************** *** 191,195 **** } ! // Returns an array of arrays with id,name,batches,arrays function getWithSharedBatch($ownerId) { --- 191,195 ---- } ! /* // Returns an array of arrays with id,name,batches,arrays function getWithSharedBatch($ownerId) [...112 lines suppressed...] ! $query = "SELECT a.id, a.name, a.removed, a.batch, ". ! Item::whereshared("a", $user)." AS arrayRead, ". ! "ab.name AS `batchName`, ab.removed AS `batchRemoved`, ". ! Item::whereshared("ab", $user)." AS batchRead, ". ! "ab.name AS `batchName`, ab.removed AS `batchRemoved`, ". ! "ab.`arrayType`, ". ! Item::whereshared("ab", $user)." AS batchRead, ". ! "at.name AS `designName`, at.removed AS `designRemoved`, ". ! Item::whereshared("at", $user)." AS designRead ". ! "FROM ArraySlide a, ArrayBatch ab, ArrayType at ". ! "WHERE a.hybridization = $hyb AND ab.id = a.batch ". ! "AND at.id = ab.`arrayType`"; $res = query($query); if($row =& db_fetch_assoc($res)) return $row; return false; ! } function getNameFromId($id) Index: array_popup.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_popup.phtml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** array_popup.phtml 5 Aug 2002 11:29:31 -0000 1.11 --- array_popup.phtml 3 Oct 2002 18:00:07 -0000 1.12 *************** *** 59,63 **** <tr><th>Name</th><th>Date</th><th>Arrays</th><th>Design</th></tr> <? ! $arrs = ArrayBatch::getWithUnusedArray(0, $curUser->getId()); for($i = 0; $i < count($arrs); $i++) --- 59,63 ---- <tr><th>Name</th><th>Date</th><th>Arrays</th><th>Design</th></tr> <? ! $arrs = ArrayBatch::getWithUnusedArray(0, $curUser); for($i = 0; $i < count($arrs); $i++) *************** *** 66,70 **** <tr><td><a href="array_popup.phtml?i_batch=<?= $arrs[$i]["id"] ?>" ><?= html($arrs[$i]["name"]) ?></td> ! <td><?= htmldate($arrs[$i]["date"]) ?></td> <td><?= $arrs[$i]["arrays"] ?></td> <td><?= html($arrs[$i]["designName"]) ?></td></tr> --- 66,70 ---- <tr><td><a href="array_popup.phtml?i_batch=<?= $arrs[$i]["id"] ?>" ><?= html($arrs[$i]["name"]) ?></td> ! <td><?= htmldate($arrs[$i]["addedDate"]) ?></td> <td><?= $arrs[$i]["arrays"] ?></td> <td><?= html($arrs[$i]["designName"]) ?></td></tr> *************** *** 84,88 **** <tr><th>#</th><th>Barcode</th></tr> <? ! $arrs = ArrayBatch::getUnusedArrays($i_batch); for(reset($arrs); list($pos, $bc) = each($arrs); ) { --- 84,88 ---- <tr><th>#</th><th>Barcode</th></tr> <? ! $arrs = ArraySlide::getUnusedForBatch($i_batch, $curUser); for(reset($arrs); list($pos, $bc) = each($arrs); ) { Index: hyb.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb.inc.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** hyb.inc.php 30 Sep 2002 16:57:05 -0000 1.24 --- hyb.inc.php 3 Oct 2002 18:00:08 -0000 1.25 *************** *** 79,83 **** "WHERE hybridization IN (".implode(",", $del).")"; $ok = $ok && query($query); ! $query = "UPDATE Array SET hybridization = NULL ". "WHERE hybridization IN (".implode(",", $del).")"; $ok = $ok && query($query); --- 79,83 ---- "WHERE hybridization IN (".implode(",", $del).")"; $ok = $ok && query($query); ! $query = "UPDATE ArraySlide SET hybridization = NULL ". "WHERE hybridization IN (".implode(",", $del).")"; $ok = $ok && query($query); *************** *** 154,160 **** { // Add more fields here ! $sortfields = array("name", 0, "barcode", "`hybridizationDate`", "`userName`", 0, 0, 0, ! "`protocolName`", "scans", "images", "raws"); $ob = $search->makeOrderBy($sortfields); --- 154,161 ---- { // Add more fields here ! $sortfields = array("name", 0, "`userName`", 0, 0, 0, ! "`hybridizationDate`", "barcode", "`protocolName`", ! "scans", "images", "raws"); $ob = $search->makeOrderBy($sortfields); *************** *** 172,185 **** $query = "SELECT h.*, $ss1 p.name AS `protocolName`, ". ! "ug.name AS `userName`, ". Item::whereShared("p", $user)." AS `protocolRead`, ". "COUNT(DISTINCT ia.id) AS scans, ". "COUNT(DISTINCT i.id) AS images, ". ! "COUNT(DISTINCT rba.id) AS raws, a.barcode ". "FROM UserGroup ug, Protocol p, Hybridization h ". "LEFT JOIN ImageAcquisition ia ON ia.hybridization = h.id ". "LEFT JOIN Image i ON i.`imageAcquisition` = ia.id ". "LEFT JOIN RawBioAssay rba ON rba.`imageAcquisition` = ia.id ". ! "LEFT JOIN Array a ON a.hybridization = h.id ". "WHERE p.id = h.protocol AND ug.id = h.owner ". $search->getExtraWhere()." ".$search->getWhere()." ". --- 173,186 ---- $query = "SELECT h.*, $ss1 p.name AS `protocolName`, ". ! "ug.name AS `userName`, a.name AS barcode, ". Item::whereShared("p", $user)." AS `protocolRead`, ". "COUNT(DISTINCT ia.id) AS scans, ". "COUNT(DISTINCT i.id) AS images, ". ! "COUNT(DISTINCT rba.id) AS raws ". "FROM UserGroup ug, Protocol p, Hybridization h ". "LEFT JOIN ImageAcquisition ia ON ia.hybridization = h.id ". "LEFT JOIN Image i ON i.`imageAcquisition` = ia.id ". "LEFT JOIN RawBioAssay rba ON rba.`imageAcquisition` = ia.id ". ! "LEFT JOIN ArraySlide a ON a.hybridization = h.id ". "WHERE p.id = h.protocol AND ug.id = h.owner ". $search->getExtraWhere()." ".$search->getWhere()." ". Index: hyb_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_common.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** hyb_common.inc.php 30 Sep 2002 16:57:05 -0000 1.10 --- hyb_common.inc.php 3 Oct 2002 18:00:09 -0000 1.11 *************** *** 39,66 **** <td><?= html($hyb->getName()).remMark($hyb) ?></td></tr> <? ! $ai = ArrayBatch::getArrayInfo($hyb->getId(), $curUser->getId()); if($ai) { - $blink = html($ai["batchName"]); - if(!$ai["private"] && acc(BUA_ARRAY_READ)) - { - $blink = "<a ". - href("array_batch.phtml?i_ab=$ai[batchId]", 2).">$blink</a>"; - } - - $tlink = html($ai["typeName"]); - if(acc(BUA_ARRAY_READ)) - { - $tlink = "<a ". - href("array_edit.phtml?i_at=$ai[typeId]", 2).">$tlink</a>"; - } ?> ! <tr><th>Array slide</th> ! <td><?= html($ai["barcode"]) ?></td></tr> ! <tr><th>Array print</th><td><?= $blink ?></td></tr> ! <tr><th>Array design</th><td><?= $tlink ?></td></tr> <? } ! else echo "<tr><th>Array slide</th><td>-</td></tr>\n"; $used = LabeledExtract::getBriefForHyb($hybid, $curUser); --- 39,53 ---- <td><?= html($hyb->getName()).remMark($hyb) ?></td></tr> <? ! $ai = ArraySlide::getBriefForHyb($hyb->getId(), $curUser); if($ai) { ?> ! <tr><th>Array slide</th><td><?= ArraySlideArrLink($ai) ?></td></tr> ! <tr><th>Array print</th><td><?= ArrayBatchArrLink($ai) ?></td></tr> ! <tr><th>Array design</th><td><?= ArrayTypeArrLink($ai) ?></td></tr> <? } ! else ! echo "<tr><th>Array slide</th><td>".html(NULL)."</td></tr>\n"; $used = LabeledExtract::getBriefForHyb($hybid, $curUser); Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** hyb_edit.phtml 2 Oct 2002 17:50:56 -0000 1.37 --- hyb_edit.phtml 3 Oct 2002 18:00:10 -0000 1.38 *************** *** 87,103 **** $ai = 0; ! if(isset($i_array) && $i_array != "" && $err == "") { $as = new ArraySlide(); ! if(!$as->readShared($i_array, $curUser)) $err = "No such array slide or access denied"; else if($as->getHybridization()) - $err = "That array slide has already been used"; - $ai = ArrayBatch::getArrayId($i_array); [...144 lines suppressed...] ! "(ARRAY_READ)</td></tr>\n"; } ?> --- 380,395 ---- <? } ! else if($ainfo) { ! echo "<tr><th>Array slide</th><td>".arraySlideArrLink($ainfo)." "; if(acc(BUA_ARRAY_READ)) echo "<input type=submit name=i_charray value='Change'>"; echo "</td></tr>\n"; } ! else ! { ! echo "<tr><th>Array slide</th><td class=help>". ! "Access denied (ARRAY_READ)</td></tr>\n"; ! } } ?> Index: hyb_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_list.phtml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** hyb_list.phtml 30 Sep 2002 16:57:05 -0000 1.16 --- hyb_list.phtml 3 Oct 2002 18:00:12 -0000 1.17 *************** *** 43,52 **** "Hybridization date", "Protocol"); $fieldtype = array(0, 0, 0, 1, 1, 0); ! $headerfields = array("Name", "Labeled extracts", "Array", ! "Hyb date", "Owner", "[<a href=javascript:selAll(1)>A</a> ". "<a href=javascript:selAll(0)>N</a>]", "Group", "World", ! "Protocol", "Img sets", "Images", "Result files"); ! $sortorder = array(1, 0, 1, -1, 1, 0, 0, 0, 1, -1, -1, -1); $defsort = 0; --- 43,52 ---- "Hybridization date", "Protocol"); $fieldtype = array(0, 0, 0, 1, 1, 0); ! $headerfields = array("Name", "Labeled extracts", "Owner", "[<a href=javascript:selAll(1)>A</a> ". "<a href=javascript:selAll(0)>N</a>]", "Group", "World", ! "Hyb date", "Array", "Protocol", "Img sets", "Images", ! "Result files"); ! $sortorder = array(1, 0, 1, 0, 0, 0, -1, 1, 1, -1, -1, -1); $defsort = 0; *************** *** 101,130 **** $llink[] = html(""); - /* $samps = Sample::getBriefForHyb($id, $curUser); - $slink = array(); - for($j = 0; $j < count($samps); $j++) - { - $slink[] = html($samps[$j]["name"]); - if($samps[$j]["public"]) - { - $slink[$j] = "<a href='sample_edit.phtml?i_samp=". - $samps[$j]["id"]."'>$slink[$j]</a>". - remMark($samps[$j]["removed"]); - } - } - if(!count($slink)) - $slink[] = " "; - */ - echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='hyb_edit.phtml?i_hyb=$s[id]'>".html($s["name"]). "</a>".remMark($s["removed"])."</td>". "<td>".implode(",\n", $llink)."</td>". - "<td>".html($s["barcode"])."</td>". - "<td>".htmldate($s["hybridizationDate"])."</td>". "<td>".html($s["userName"])."</td>". "<td>".groupAccessCheckbox($s["id"])."</td>". "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". "<td>".protocolArrLink($s)."</td>". "<td>".html($s["scans"])."</td>". --- 101,114 ---- $llink[] = html(""); echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='hyb_edit.phtml?i_hyb=$s[id]'>".html($s["name"]). "</a>".remMark($s["removed"])."</td>". "<td>".implode(",\n", $llink)."</td>". "<td>".html($s["userName"])."</td>". "<td>".groupAccessCheckbox($s["id"])."</td>". "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". + "<td>".htmldate($s["hybridizationDate"])."</td>". + "<td>".html($s["barcode"])."</td>". "<td>".protocolArrLink($s)."</td>". "<td>".html($s["scans"])."</td>". Index: hyb_result.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_result.phtml,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** hyb_result.phtml 22 Sep 2002 23:37:34 -0000 1.55 --- hyb_result.phtml 3 Oct 2002 18:00:14 -0000 1.56 *************** *** 36,39 **** --- 36,40 ---- require_once("wizzzard.inc.php"); require_once("item_common.inc.php"); + require_once("upload_common.inc.php"); verifyAccess(BUA_BIO_EDIT); *************** *** 41,46 **** $upl = new Upload(); ! $err = $upl->handleUpload("i_file", "i_fileid", ! isset($i_descr) ? $i_descr : ""); $fileid = $upl->getId(); --- 42,46 ---- $upl = new Upload(); ! $err = handleUpload($upl, $curUser); $fileid = $upl->getId(); *************** *** 404,426 **** <input type=hidden name=location value="<?= html($location, 0) ?>"> <? ! $ups = Upload::getAll($curUser->getId()); ! if(count($ups)) ! { ! echo "<tr><th>Select an uploaded file</th>". ! "<td><select name=i_fileid><option value=0>- none -\n"; ! for($i = 0; $i < count($ups); $i++) ! { ! $sel = $fileid == $ups[$i]->getId() ? "selected" : ""; ! echo "<option $sel value=".$ups[$i]->getId().">". ! html($ups[$i]->getName())." (".$ups[$i]->getFileSize()." B)\n"; ! } ! echo "</select></td></tr>\n"; ! echo "<tr><th>Or pick a file to upload</th>"; ! } ! else echo "<tr><th>Pick a file to upload</th>"; ?> - <td><input type=file name=i_file></td></tr> - <tr><th>File description</th> - <td><input type=text name=i_descr size=30></td></tr> <tr><td colspan=2><input type=submit value='Continue'></td></tr> </table> --- 404,409 ---- <input type=hidden name=location value="<?= html($location, 0) ?>"> <? ! uploadInput($curUser); ?> <tr><td colspan=2><input type=submit value='Continue'></td></tr> </table> Index: links_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/links_common.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** links_common.inc.php 2 Oct 2002 17:50:56 -0000 1.3 --- links_common.inc.php 3 Oct 2002 18:00:15 -0000 1.4 *************** *** 134,137 **** --- 134,146 ---- } + function arraySlideArrLink(&$arr) + { + if(!$arr["arrayRead"]) + return html($arr["name"]).remMark($arr["removed"]); + return "<a ".href("arrayslide_edit.phtml?i_as=". + (int)$arr["id"], 2).">". + html($arr["name"])."</a>".remMark($arr["removed"]); + } + ?> |
From: <tr...@us...> - 2002-10-03 16:45:10
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv14883 Modified Files: misc.inc.php mysql.inc.php pgsql.inc.php user_edit.phtml user_list.phtml Log Message: Added db_date_future and looked over never/future handling Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** misc.inc.php 30 Sep 2002 21:13:10 -0000 1.40 --- misc.inc.php 3 Oct 2002 16:45:06 -0000 1.41 *************** *** 34,40 **** return $txt; } ! if($txt === NULL) return "<i>none</i>"; $txt = htmlspecialchars(trim($txt)); ! if($txt == "") return " "; return nl2br($txt); } --- 34,42 ---- return $txt; } ! if($txt === NULL) ! return "<i>none</i>"; $txt = htmlspecialchars(trim($txt)); ! if($txt == "") ! return " "; return nl2br($txt); } *************** *** 50,56 **** 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); } --- 52,60 ---- 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); } *************** *** 58,64 **** 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,70 ---- 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); } *************** *** 125,139 **** if(isset($_SERVER["HTTP_REFERER"])) { - // Quick fix for old Konqueror - delete later - if(ereg("Konqueror/2.1.2", $_SERVER["HTTP_USER_AGENT"]) && - ereg("bottom.phtml", $_SERVER["HTTP_REFERER"])) - { - $_SERVER["HTTP_REFERER"] = $defaultLocation; - } // Drop the proto://host[:port] part of the referring URL //$location = ereg_replace("^[a-z]+://[^/]*(:[0-9]+)?", "", // $_SERVER["HTTP_REFERER"]); ! // This removes all nasty links, including cross-site scripting ! // attempts. $location = ereg_replace(".*[/:]", "", $_SERVER["HTTP_REFERER"]); } --- 131,138 ---- if(isset($_SERVER["HTTP_REFERER"])) { // Drop the proto://host[:port] part of the referring URL //$location = ereg_replace("^[a-z]+://[^/]*(:[0-9]+)?", "", // $_SERVER["HTTP_REFERER"]); ! // This removes all nastyness $location = ereg_replace(".*[/:]", "", $_SERVER["HTTP_REFERER"]); } Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mysql.inc.php 11 Sep 2002 09:03:06 -0000 1.17 --- mysql.inc.php 3 Oct 2002 16:45:06 -0000 1.18 *************** *** 281,284 **** --- 281,289 ---- } + function db_date_future() + { + return "9999-12-31"; + } + function db_dynamic_db_prepare(&$dyn) { Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pgsql.inc.php 11 Sep 2002 09:03:36 -0000 1.14 --- pgsql.inc.php 3 Oct 2002 16:45:06 -0000 1.15 *************** *** 377,380 **** --- 377,385 ---- } + function db_date_future() + { + return "9999-12-31"; + } + function db_dynamic_db_prepare(&$dyn) { Index: user_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_edit.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** user_edit.phtml 10 Sep 2002 23:06:36 -0000 1.15 --- user_edit.phtml 3 Oct 2002 16:45:06 -0000 1.16 *************** *** 1,2 **** --- 1,3 ---- + <? // $Id$ *************** *** 50,55 **** $user->setPhone($i_phone); $user->setFax($i_fax); ! $user->setActiveUntil(isset($i_activeforever) ? ! "9999-12-31" : strtodate($i_activeu)); if($i_pass != "<<encrypted>>") $user->setPassword($i_pass); --- 51,56 ---- $user->setPhone($i_phone); $user->setFax($i_fax); ! $user->setActiveUntil(isset($i_activeforever) ? db_date_future() : ! ($i_activeu == "" ? db_date_never() : strtodate($i_activeu))); if($i_pass != "<<encrypted>>") $user->setPassword($i_pass); *************** *** 177,181 **** echo "</td></tr>\n"; $actu = $user->getActiveUntil(); ! if($actu == "9999-12-31") { $actu = ""; --- 178,182 ---- echo "</td></tr>\n"; $actu = $user->getActiveUntil(); ! if($actu == db_date_future()) { $actu = ""; *************** *** 231,235 **** { $actu = $user->getActiveUntil(); ! if($actu == "9999-12-31") $actu = "never"; else if($actu == db_date_never()) --- 232,236 ---- { $actu = $user->getActiveUntil(); ! if($actu == db_date_forever()) $actu = "never"; else if($actu == db_date_never()) Index: user_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_list.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** user_list.phtml 9 Sep 2002 06:39:01 -0000 1.13 --- user_list.phtml 3 Oct 2002 16:45:06 -0000 1.14 *************** *** 118,122 **** function htmluserdate($date, $daysLeft) { ! if($date == "9999-12-31") return "<span class=active_0>forever</span>"; if($date == db_date_never()) --- 118,122 ---- function htmluserdate($date, $daysLeft) { ! if($date == db_date_forever()) return "<span class=active_0>forever</span>"; if($date == db_date_never()) |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv8453 Modified Files: array.inc.php array_batch.phtml array_common.inc.php arrayslide_list.phtml extract_edit.phtml hyb_edit.phtml item.inc.php links_common.inc.php Log Message: Array made subclass of Item and renamed to ArraySlide Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** array.inc.php 1 Oct 2002 21:53:19 -0000 1.40 --- array.inc.php 2 Oct 2002 17:50:56 -0000 1.41 *************** *** 31,35 **** define("CLEN_ARRAYBATCH_NAME", 40); define("CLEN_ARRAYBATCH_SURFACETYPE", 40); ! define("CLEN_ARRAY_BARCODE", 20); class ArrayType extends Item --- 31,35 ---- define("CLEN_ARRAYBATCH_NAME", 40); define("CLEN_ARRAYBATCH_SURFACETYPE", 40); ! define("CLEN_ARRAYSLIDE_NAME", 20); [...733 lines suppressed...] ! "LEFT JOIN UserGroup hug ON hug.id = h.owner ". "WHERE a.batch = ab.id AND ab.`arrayType` = at.id ". ! "AND ug.id = a.owner ". $search->getWhere()." ".$search->getExtraWhere()." ". $ob." ".$search->makeLimit(); *************** *** 886,891 **** return $arr; } - } ?> --- 907,912 ---- return $arr; } } + ?> Index: array_batch.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_batch.phtml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** array_batch.phtml 10 Sep 2002 23:04:37 -0000 1.19 --- array_batch.phtml 2 Oct 2002 17:50:56 -0000 1.20 *************** *** 29,133 **** require_once("array_common.inc.php"); require_once("hyb.inc.php"); verifyAccess(BUA_ARRAY_READ); setLocation("array_list.phtml"); - if(!isset($i_bc)) $i_bc = array(); - $err = ""; - $edit = true; [...357 lines suppressed...] <tr><th>Printing protocol</th><td><?= ! protocolIdLink($ab->getProtocol(), $curUser) ?></td></tr> ! <? ! dateAndOwnerTable($ab, $curUser); ! ?> </table> <p> *************** *** 239,243 **** <input type=hidden name=location value="<?= html($location, 0) ?>"> <? ! arrayList($abid); echo "</form>\n"; } --- 232,236 ---- <input type=hidden name=location value="<?= html($location, 0) ?>"> <? ! arrayList($abid, $curUser); echo "</form>\n"; } Index: array_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_common.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** array_common.inc.php 1 Oct 2002 21:53:19 -0000 1.13 --- array_common.inc.php 2 Oct 2002 17:50:56 -0000 1.14 *************** *** 97,110 **** } ! function arrayList($arrayBatch) { ! global $curUser, $tdbg; ! $userid = $curUser->getId(); ! if(!$arrayBatch) { ! $searchfields = array("Barcode", "Hybridization", "Hyb owner", [...445 lines suppressed...] ! <option <?= $a["destroyed"] ? "selected" : "" ?> value=1>Yes </select></td> ! <td><input type=text size=30 name='i_adescr[<?= $on ?>]' ! value="<?= html($a["descr"], 0) ?>"><?= $e ?></td> </tr> <? ! } ! else ! { ! ?> ! <tr bgcolor=<? $tdbg[$odd] ?>><td><?= $laston ?></td> ! <td class=help>Read access denied</td> ! <td>-</td><td>-</td></tr> ! <? ! } } ?> ! <tr><td colspan=4><input type=submit value='Accept' name=i_ok></td></tr> </table> <? Index: arrayslide_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/arrayslide_list.phtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** arrayslide_list.phtml 5 Aug 2002 11:29:31 -0000 1.4 --- arrayslide_list.phtml 2 Oct 2002 17:50:56 -0000 1.5 *************** *** 39,43 **** </table> <? ! arrayList(0); ?> </form> --- 39,43 ---- </table> <? ! arrayList(0, $curUser); ?> </form> Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** extract_edit.phtml 1 Oct 2002 21:53:20 -0000 1.21 --- extract_edit.phtml 2 Oct 2002 17:50:56 -0000 1.22 *************** *** 108,112 **** if($curDb->dupKey()) $err = "There is already an extract with that name"; ! else $err = "Unable to save extract"; } else --- 108,113 ---- if($curDb->dupKey()) $err = "There is already an extract with that name"; ! else ! $err = "Unable to save extract"; } else Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** hyb_edit.phtml 1 Oct 2002 21:53:20 -0000 1.36 --- hyb_edit.phtml 2 Oct 2002 17:50:56 -0000 1.37 *************** *** 89,92 **** --- 89,97 ---- if(isset($i_array) && $i_array != "" && $err == "") { + $as = new ArraySlide(); + if(!$as->readShared($i_array, $curUser)) + $err = "No such array slide or access denied"; + else if($as->getHybridization()) + $err = "That array slide has already been used"; $ai = ArrayBatch::getArrayId($i_array); if(!$ai) Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** item.inc.php 30 Sep 2002 08:26:43 -0000 1.34 --- item.inc.php 2 Oct 2002 17:50:56 -0000 1.35 *************** *** 351,355 **** { error_log("Invalid user in Item::whereShared($table, $user, $write). ". ! "$_SERVER[REQUEST_URI] $_SERVER[QUERY_STRING]"); } if($user->access(BUA_SUPERUSER)) --- 351,355 ---- { error_log("Invalid user in Item::whereShared($table, $user, $write). ". ! "$_SERVER[REQUEST_URI]"); } if($user->access(BUA_SUPERUSER)) Index: links_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/links_common.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** links_common.inc.php 30 Sep 2002 16:57:05 -0000 1.2 --- links_common.inc.php 2 Oct 2002 17:50:56 -0000 1.3 *************** *** 75,78 **** --- 75,89 ---- } + function hybridizationArrLink(&$arr) + { + if(!isset($arr["hybridization"])) + return html(""); + if(!$arr["hybRead"]) + return html($arr["hybName"]).remMark($arr["hybRemoved"]); + return "<a ".href("hyb_edit.phtml?i_hyb=". + (int)$arr["hybridization"], 2).">". + html($arr["hybName"])."</a>".remMark($arr["hybRemoved"]); + } + function hybridizationIdLink($id, &$user) { *************** *** 82,85 **** --- 93,134 ---- return html($arr["name"]).remMark($arr["removed"]); return "<a ".href("hyb_edit.phtml?i_hyb=$id", 2).">". + html($arr["name"])."</a>".remMark($arr["removed"]); + } + + function arrayTypeArrLink(&$arr) + { + if(!$arr["designRead"]) + return html($arr["designName"]).remMark($arr["designRemoved"]); + return "<a ".href("array_edit.phtml?i_at=". + (int)$arr["arrayType"], 2).">". + html($arr["designName"])."</a>".remMark($arr["designRemoved"]); + } + + function arrayTypeIdLink($id, &$user) + { + $id = (int)$id; + $arr = ArrayType::getBasicFromId($id); + if(!ArrayType::isSharedId($id, $user)) + return html($arr["name"]).remMark($arr["removed"]); + return "<a ".href("array_edit.phtml?i_at=$id", 2).">". + html($arr["name"])."</a>".remMark($arr["removed"]); + } + + function arrayBatchArrLink(&$arr) + { + if(!$arr["batchRead"]) + return html($arr["batchName"]).remMark($arr["batchRemoved"]); + return "<a ".href("array_batch.phtml?i_ab=". + (int)$arr["batch"], 2).">". + html($arr["batchName"])."</a>".remMark($arr["batchRemoved"]); + } + + function arrayBatchIdLink($id, &$user) + { + $id = (int)$id; + $arr = ArrayBatch::getBasicFromId($id); + if(!ArrayBatch::isSharedId($id, $user)) + return html($arr["name"]).remMark($arr["removed"]); + return "<a ".href("array_batch.phtml?i_ab=$id", 2).">". html($arr["name"])."</a>".remMark($arr["removed"]); } |
Update of /cvsroot/basedb/basedb/documentation/faq In directory usw-pr-cvs1:/tmp/cvs-serv14533 Added Files: Makefile developer.tex faq.tex firstpage.tex general.tex installation.tex introduction.tex usage.tex Log Message: Adding first version of FAQ. --- NEW FILE: Makefile --- # $Id: Makefile,v 1.1 2002/10/02 15:16:20 kurri Exp $ MAIN = faq DVI = $(MAIN).dvi PS = $(MAIN).ps PDF = $(MAIN).pdf SRC = $(MAIN).tex developer.tex firstpage.tex general.tex \ installation.tex introduction.tex usage.tex default: dvi all: dvi pdf ps html clean: @rm -rf *.aux *.dvi *.log *.out *.toc *.flc *~ \ $(MAIN) $(MAIN).pdf $(MAIN).ps dvi: $(DVI) $(DVI): $(SRC) @(latex $(MAIN) ; latex $(MAIN) ; latex $(MAIN)) html: pdf ps @(rm -rf $(MAIN) ; latex2html $(MAIN) ; \ mv $(MAIN).pdf $(MAIN)/base_$(MAIN).pdf ; \ mv $(MAIN).ps $(MAIN)/base_$(MAIN).ps) pdf: $(PDF) $(PDF): $(DVI) dvipdfm -p a4 $(MAIN) ps: $(PS) $(PS): $(DVI) dvips $(MAIN) publish: html @(scp -rp $(MAIN) ja...@ba...:documents) --- NEW FILE: developer.tex --- % $Id: developer.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \section{Developer} \subsection{How do I write plug-ins?} See {\tt exec/source/README.basefile} and/or read the information below. What a plug-in needs to know is this: It's run in a directory where it's allowed to create files. Things written to {\tt stdout} will end up in a file called {\tt stdout.txt} (in the current directory). Errors and other information can be written to {\tt stderr}. On {\tt stdin} the plug-in will get the data to be processed, in the rather badly documented {\it BASEfile format}. When the plug-in has terminated, {\tt jobController.php} will scan the output directory (recursively) and add information about all files it finds to the database. If if finds what it believes to be valid BASEfiles, additional information about these will be stored, and if they contain a few predefined things (bioassays, reporter lists) {\it [...78 lines suppressed...] BASEfile with one {\tt assays} section per assay in the input, have only one assay per such section (that is, make it the ``serial'' version of this format), and put the same id for the assay as you got in the input. You need to pass the position and molecule columns through unchanged, and output the normalised values in columns called {\tt intensity1} and {\tt intensity2}. Have a look at a {\tt stdout.txt} from {\it lowess} to see what I mean. To have a {\it genelist} ({\it reporter} list) created by {\tt jobController.php}, output a section {\tt genelist} with columns {\tt cloneId} and {\tt value}, where the cloneId is passed through from the input {\it BASEfile} and {\tt value} is a value to be associated with the gene. If there is no such value or you just want the rank of the gene (the position in the genelist), leave out the {\tt value} column altogether. \noindent The BaseFileReader class: \\ In exec/source there is a C++ class called {\it BaseFileReader}. This class is used by the plug-ins provided with BASE, and in the source for those you can see how it can be used to parse BASEfiles. --- NEW FILE: faq.tex --- % $Id: faq.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \documentclass[10pt]{article} \usepackage{html} \evensidemargin 0pt \flushbottom \footskip 10mm %\headheight 0pt %\headsep 0pt \oddsidemargin 0pt %\pagestyle{empty} \parindent 10pt \parskip 1ex \textheight 235mm \textwidth 165mm \topmargin -5mm \begin{document} \input{firstpage} \input{introduction} \input{general} \input{installation} \input{usage} \input{developer} \end{document} --- NEW FILE: firstpage.tex --- % $Id: firstpage.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \begin{htmlonly} \begin{verbatim} $Date: 2002/10/02 15:16:21 $ \end{verbatim} \end{htmlonly} Created \today. \begin{htmlonly} This document is also available in \htmladdnormallink{postscript format}{base_faq.ps} or \htmladdnormallink{portable document format (pdf)}{base_faq.pdf}. \end{htmlonly} --- NEW FILE: general.tex --- % $Id: general.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \section{General} \begin{htmlonly} \begin{verbatim} $Date: 2002/10/02 15:16:21 $ \end{verbatim} \end{htmlonly} \subsection{What is BASE?} BASE is short for BioArray Software Environment. BASE is a comprehensive database server to manage the massive amounts of data generated by microarray analysis. In short, it manages biomaterial information, raw data and images, and provides integrated and ``plug-in''-able normalisation, data viewing and analysis tools. Additionally, for labs that make their own in-house arrays or for labs that wish to track probe information, the system also has array production LIMS features which can be integrated with the data [...90 lines suppressed...] \end{itemize} \subsection{Working browsers list} Christopher Faulk, Fa...@pb..., and others have compiled a list of working browsers. Remember, cookies {\em must} be turned on. \begin{itemize} \item IE v 6.0 on Windows 98, 2k, NT \item IE v 5.0 on Windows 98, 2k, NT, Mac OS 9 \item Opera v 6.01 on windows2k \item Netscape v 4.7 on Mac OS 9 \item Netscape v 6.1 on Windows 2k \item Mozilla v 0.9.8 on Linux Mandrake 8.2 i586 \end{itemize} \noindent These browser do not work, and you should not expect support for them. \begin{itemize} \item links and lynx. \item Konqueror 2.1.1 \end{itemize} --- NEW FILE: installation.tex --- % $Id: installation.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \section{Installation} \begin{htmlonly} \begin{verbatim} $Date: 2002/10/02 15:16:21 $ \end{verbatim} \end{htmlonly} \subsection{General} \subsubsection{Where can I find the installation documentation?} README in the distribution. Proper documentation are under construction. Make sure you are using the recommended operating system, PHP, and web server versions. Please use the mailing list if you need additional help. \subsection{Apache} \subsubsection{Apache does not recognise my php.ini changes.} You must restart Apache after changing {\tt php.ini}. \subsubsection{Apache version 2 cannot locate files.} The problem is that the PHP module defaults to {\it AcceptPathInfo} off, so you'll need an explicit {\tt AcceptPathInfo on} in your {\tt httpd.conf}. Cf. documentation at \htmladdnormallink{http://httpd.apache.org}{http://httpd.apache.org/docs-2.0/mod/core.html\#acceptpathinfo}. \subsubsection{File and Directory Permissions Problems} You must set the proper permissions for the BASE upload directory. The httpd process user id must have the right to write stuff to the directory. \subsection{MySQL} \subsubsection{MySQL doesn't allow LOCAL at LOAD DATA INFILE} You need to compile MySQL with {\tt --enable-local-infile} or start {\tt safe\_mysqld} with {\tt --local-infile}. \subsubsection{Can't connect to [local] MySQL server Error} Please read the \htmladdnormallink{MySQL documentation}{http://www.mysql.com/doc/en/Can_not_connect_to_server.html}. \subsection{PHP} \subsubsection{What version of PHP must I run?} You should run the latest 4.2 version (at least version 4.2.2). \subsubsection{PHP path problem; Plug-ins do not run} Make sure your PHP scripts contain the correct path to the PHP binary. The default is {\tt /usr/local/bin}, but your installation might have another location for {\tt php}. Use the command {\tt which php} to find out where the PHP binary is located. \subsubsection{Can't login as root to BASE; Undefined variable \_SERVER} This is a very clear indication that you are not running PHP 4.2.2, as \_SERVER is one of the predefined ever-global variables since 4.1. Point your browser to test.phtml (which does a phpinfo() to show PHP setup info), and see what version it reports. It could be that your standalone PHP and the apache module have different versions. \subsubsection{PHP does not cooperate with MySQL} PHP must be configured with MySQL support, e.g. \\ \indent {\tt ./configure --with-mysql [other options]} \\ or \\ \indent {\tt ./configure --with-mysql=/path/to/mysql/installation [...]} \subsubsection{Magic quotes must be off} I'm getting the message {\em PHP misconfigured - BASE can't run. (magic quotes)}. {\tt magic\_quotes\_gpc} and {\tt magic\_quotes\_runtime} must be set to {\tt "= Off"} --- NEW FILE: introduction.tex --- % $Id: introduction.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \section*{BASE Frequently Asked Questions, FAQ} \begin{htmlonly} \begin{verbatim} $Date: 2002/10/02 15:16:21 $ \end{verbatim} \end{htmlonly} --- NEW FILE: usage.tex --- % $Id: usage.tex,v 1.1 2002/10/02 15:16:21 kurri Exp $ \section{Using BASE} \begin{htmlonly} \begin{verbatim} $Date: 2002/10/02 15:16:21 $ \end{verbatim} \end{htmlonly} \subsubsection{Where can I find user documentation?} We recommend the novice user read the Quick Start Guide, aka ``BASE v1.0 instruction manual''. It can be found on the \htmladdnormallinkfoot{Download page}{http://base.thep.lu.se} at the BASE web site (you have to enter your personal registration code to get in). This guide contains a step-by-step walk through of most of the functionality in BASE v1.0 (there have been improvements in newer versions of BASE but most of the guide is still very relevant). \subsection{Must I use the Array LIMS part of BASE?} [...107 lines suppressed...] 384-well, and its position was stored in the 'position' column. As people desired to be able to reuse 96-wells on multiple 384-wells and also to be able to pick probes from several plates to create new plates, we wanted a more general many-to-many relationship. This has been implemented, but there is as of yet no way to create 96-wells from multiple 96-wells. Another thing that I've considered is the possibility to define new plate geometries and mappings from one to another. Right now the four 96-wells used on a 384 are assumed to be arranged in a pre- defined manner: \begin{verbatim} 121212 434343 121212 434343 etc. \end{verbatim} For labs with an other way of doing this step, flexibility is needed. |
From: <ku...@us...> - 2002-10-02 15:14:09
|
Update of /cvsroot/basedb/basedb/documentation/todo In directory usw-pr-cvs1:/tmp/cvs-serv13775/todo Log Message: Directory /cvsroot/basedb/basedb/documentation/todo added to the repository |
From: <ku...@us...> - 2002-10-02 15:13:41
|
Update of /cvsroot/basedb/basedb/documentation/faq In directory usw-pr-cvs1:/tmp/cvs-serv13561/faq Log Message: Directory /cvsroot/basedb/basedb/documentation/faq added to the repository |
From: <ku...@us...> - 2002-10-02 14:58:48
|
Update of /cvsroot/basedb/basedb/documentation In directory usw-pr-cvs1:/tmp/cvs-serv7996/documentation Log Message: Directory /cvsroot/basedb/basedb/documentation added to the repository |
From: <tr...@us...> - 2002-10-01 21:53:23
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv28083 Modified Files: array.inc.php array_batchlist.phtml array_common.inc.php array_edit.phtml extract_edit.phtml hyb_edit.phtml labeled_edit.phtml plate_edit.phtml platetype_edit.phtml protocol_common.inc.php protocol_edit.phtml protocol_list.phtml Log Message: Protocol fixes, mostly Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** array.inc.php 1 Oct 2002 17:35:10 -0000 1.39 --- array.inc.php 1 Oct 2002 21:53:19 -0000 1.40 *************** *** 764,784 **** // Counts the number of hits and sets up the search object ! function prepareSearch(&$search, $hpp, $arrayType = 0) { - // Add more fields and operators here $fields = array(); $search->makeWhere($fields); $arrayType = (int)$arrayType; if($arrayType) $search->addExtraWhere("ab.`arrayType` = $arrayType"); [...74 lines suppressed...] --- 799,817 ---- { $ss1 = "t.* FROM ArrayBatch ab, (SELECT ab.id,"; ! $ss2 = ",`designName`, `userName`, `arrayTypeRead`, ". ! "`arrayTypeRemoved`) AS t"; } else $ss1 = $ss2 = ""; ! $query = "SELECT ab.*, $ss1 at.name AS `designName`, ". ! "ug.name AS `userName`, ". "COUNT(a.id) AS arrays, COUNT(a.hybridization) AS hybs, ". ! "SUM(a.destroyed) AS destroyed, ". ! Item::whereShared("at", $user)." AS `arrayTypeRead`, ". ! "at.removed AS `arrayTypeRemoved` ". ! "FROM ArrayType at, UserGroup ug, ArrayBatch ab ". "LEFT JOIN Array a ON a.batch = ab.id ". ! "WHERE at.id = ab.`arrayType` AND ug.id = ab.owner ". $search->getWhere()." ".$search->getExtraWhere()." ". "GROUP BY ab.id $ss2 $ob ".$search->makeLimit(); Index: array_batchlist.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_batchlist.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** array_batchlist.phtml 5 Aug 2002 11:29:31 -0000 1.13 --- array_batchlist.phtml 1 Oct 2002 21:53:19 -0000 1.14 *************** *** 31,50 **** verifyAccess(BUA_ARRAY_READ); - $users = Submitter::getBrief(); - $userid = $curUser->getId(); - - batchSharing($users); - $pageTitle="$config[codename] - Array prints"; require_once("htmlinit.phtml"); ?> <table <?= $cellpad ?>> <tr><th class=pagehead>Array prints <?= webHelp(29, 1) ?></th></tr> <tr><td class=help>To create new prints, start from the array design ! pages.</td></tr> ! <form method=post name=ff action='array_batchlist.phtml'> </table> <? ! batchList($users, 0); ?> </form> --- 31,45 ---- verifyAccess(BUA_ARRAY_READ); $pageTitle="$config[codename] - Array prints"; require_once("htmlinit.phtml"); ?> <table <?= $cellpad ?>> + <form method=post name=ff action='array_batchlist.phtml'> <tr><th class=pagehead>Array prints <?= webHelp(29, 1) ?></th></tr> <tr><td class=help>To create new prints, start from the array design ! page.</td></tr> </table> <? ! batchList($curUser, 0); ?> </form> Index: array_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_common.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** array_common.inc.php 1 Oct 2002 17:35:10 -0000 1.12 --- array_common.inc.php 1 Oct 2002 21:53:19 -0000 1.13 *************** *** 24,114 **** // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ! require_once("array.inc.php"); ! require_once("hyb.inc.php"); ! require_once("search.inc.php"); ! require_once("searchhtml.inc.php"); ! ! function batchSharing(&$users) ! { ! global $i_sh, $i_unsh, $i_shuser, $i_user, $curUser; [...171 lines suppressed...] ! ! echo "<tr bgcolor=$tdbg[$odd]>". ! "<td><a ".href("array_batch.phtml?i_ab=$id", 2).">". ! html($b["name"])."</a>".remMark($b["removed"])."</td>". ! "<td>".$atlink."</td>\n". ! "<td>".htmldatetime($b["printStartDate"])."</td>". "<td>".html($b["userName"])."</td>\n". + "<td>".groupAccessCheckbox($b["id"])."</td>". + "<td>".groupInfo($b, $users)."</td>". + "<td>".worldInfo($b)."</td>". "<td>$b[arrays] ($b[hybs] used, $b[destroyed] destr, ". ! ($b["arrays"]-$b["hybs"]-$b["destroyed"])." free)</td>". ! "</tr>\n"; } unset($b); + $cols = count($headerfields); + groupAccessFooter($cols, $user); + showDelLinks($cols); echo "</table>\n"; } Index: array_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_edit.phtml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** array_edit.phtml 1 Oct 2002 17:35:10 -0000 1.23 --- array_edit.phtml 1 Oct 2002 21:53:19 -0000 1.24 *************** *** 74,80 **** if(isset($i_plat)) $at->setPlatform($i_plat); ! if(isset($i_proto) && $i_proto) ! $at->setProtocol($i_proto); ! dateAndOwnerInputHandle($samp, $curUser); } $atid = $at->getId(); --- 74,83 ---- if(isset($i_plat)) $at->setPlatform($i_plat); ! $p = $at->getProtocol(); ! $e = protocolValidate($p, "Configuration", $curUser); ! if($err == "") ! $err = $e; ! $at->setProtocol($p); ! dateAndOwnerInputHandle($at, $curUser); } $atid = $at->getId(); *************** *** 92,100 **** else if($at->getName() == "") $err = "The array design must have a name"; ! else if(!Protocol::isSharedAndType($at->getProtocol(), ! $curUser, "Configuration")) ! { ! $err = "Invalid protocol"; ! } else if(!$at->write()) { --- 95,100 ---- else if($at->getName() == "") $err = "The array design must have a name"; ! else if(!$at->getProtocol()) ! $err = "No protocol selected"; else if(!$at->write()) { *************** *** 531,543 **** arrayPlateList($at, $curUser); ! /* // Only show batches for printed array designs if($printed) { ?> <form method=post name=ff action="array_edit.phtml?i_at=<?= $atid ?>"> <? ! batchList($users, $atid); echo "</form>\n"; ! }*/ } ?> --- 531,544 ---- arrayPlateList($at, $curUser); ! // Only show batches for printed array designs if($printed) { ?> <form method=post name=ff action="array_edit.phtml?i_at=<?= $atid ?>"> + <input type=hidden name=location value="<?= html($location, 0) ?>"> <? ! batchList($curUser, $atid); echo "</form>\n"; ! } } ?> Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** extract_edit.phtml 30 Sep 2002 16:57:05 -0000 1.20 --- extract_edit.phtml 1 Oct 2002 21:53:20 -0000 1.21 *************** *** 65,70 **** if(isset($i_name)) $ext->setName($i_name); - if(isset($i_proto) && $i_proto) - $ext->setProtocol($i_proto); if(isset($i_descr)) $ext->setDescr($i_descr); --- 65,68 ---- *************** *** 74,77 **** --- 72,81 ---- $ext->setExtractionDate("$i_ey-$i_em-$i_ed"); dateAndOwnerInputHandle($ext, $curUser); + + $p = $ext->getProtocol(); + $e = protocolValidate($p, "Extraction", $curUser); + if($err == "") + $err = $e; + $ext->setProtocol($p); } *************** *** 98,107 **** else if($ext->getName() == "") $err = "The extract must have a name"; ! else if(!Protocol::isSharedAndType($ext->getProtocol(), ! $curUser, "Extraction")) ! { ! // Removed protocols will pass the test above. ! $err = "Invalid protocol"; ! } else if(!$ext->write()) { --- 102,107 ---- else if($ext->getName() == "") $err = "The extract must have a name"; ! else if(!$ext->getProtocol()) ! $err = "No protocol selected"; else if(!$ext->write()) { Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** hyb_edit.phtml 30 Sep 2002 16:57:05 -0000 1.35 --- hyb_edit.phtml 1 Oct 2002 21:53:20 -0000 1.36 *************** *** 77,83 **** if(isset($i_ey) && isset($i_em) && isset($i_ed)) $hyb->setHybridizationDate("$i_ey-$i_em-$i_ed"); - if(isset($i_proto) && $i_proto) - $hyb->setProtocol($i_proto); dateAndOwnerInputHandle($hyb, $curUser); } --- 77,87 ---- if(isset($i_ey) && isset($i_em) && isset($i_ed)) $hyb->setHybridizationDate("$i_ey-$i_em-$i_ed"); dateAndOwnerInputHandle($hyb, $curUser); + + $p = $hyb->getProtocol(); + $e = protocolValidate($p, "Hybridization", $curUser); + if($err == "") + $err = $e; + $hyb->setProtocol($p); } *************** *** 107,115 **** else if($hyb->getName() == "") $err = "The hybridization must have a name"; ! else if(!Protocol::isSharedAndType($hyb->getProtocol(), ! $curUser, "Hybridization")) ! { ! $err = "Invalid protocol"; ! } else if(!$hyb->write()) { --- 111,116 ---- else if($hyb->getName() == "") $err = "The hybridization must have a name"; ! else if(!$hyb->getProtocol()) ! $err = "No protocol selected"; else if(!$hyb->write()) { Index: labeled_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_edit.phtml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** labeled_edit.phtml 30 Sep 2002 16:57:05 -0000 1.19 --- labeled_edit.phtml 1 Oct 2002 21:53:20 -0000 1.20 *************** *** 69,74 **** if(isset($i_ey) && isset($i_em) && isset($i_ed)) $lext->setLabelingDate("$i_ey-$i_em-$i_ed"); - if(isset($i_proto) && $i_proto) - $lext->setProtocol($i_proto); if(isset($i_label)) $lext->setLabel($i_label); --- 69,72 ---- *************** *** 76,79 **** --- 74,83 ---- $lext->setQuantity($i_origqty); dateAndOwnerInputHandle($lext, $curUser); + + $p = $lext->getProtocol(); + $e = protocolValidate($p, "Labeling", $curUser); + if($err == "") + $err = $e; + $lext->setProtocol($p); } *************** *** 99,108 **** else if($lext->getName() == "") $err = "The labeled extract must have a name"; ! else if(!Protocol::isSharedAndType($lext->getProtocol(), ! $curUser, "Labeling")) ! { ! // Removed protocols will pass the test above. ! $err = "Invalid protocol"; ! } else if(!$lext->write()) { --- 103,108 ---- else if($lext->getName() == "") $err = "The labeled extract must have a name"; ! else if(!$lext->getProtocol()) ! $err = "No protocol selected"; else if(!$lext->write()) { Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** plate_edit.phtml 1 Oct 2002 17:35:10 -0000 1.32 --- plate_edit.phtml 1 Oct 2002 21:53:20 -0000 1.33 *************** *** 38,41 **** --- 38,43 ---- setLocation("plate_list.phtml"); + $protocolTypes = ProtocolType::getBrief(); + $edit = false; // Default to false $clone = 0; *************** *** 121,127 **** $ev =& $events[$eid]; [...68 lines suppressed...] "value='$ed'></td>". "<td>".html($prototypename)."</td>\n". ! "<td>".protocolSelect($events[$eid]["protocol"], ! $prototypename, $curUser, "i_proto$eid")."</td>". ! "</tr>\n"; } unset($e); *************** *** 484,488 **** { echo "<tr><td colspan=2><a ". ! href("plate_edit.phtml?i_p=$plateid&i_edit=1", 1). ">Edit plate</a></td></tr>\n"; } --- 486,490 ---- { echo "<tr><td colspan=2><a ". ! href("plate_edit.phtml?i_p=$plateid&i_edit=1", 2). ">Edit plate</a></td></tr>\n"; } Index: platetype_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/platetype_edit.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** platetype_edit.phtml 22 Sep 2002 23:37:35 -0000 1.15 --- platetype_edit.phtml 1 Oct 2002 21:53:20 -0000 1.16 *************** *** 34,38 **** setLocation("platetype_list.phtml"); ! $protoTypes = Protocol::getTypes(); $edit = true; --- 34,38 ---- setLocation("platetype_list.phtml"); ! $protoTypes = ProtocolType::getBrief(); $edit = true; Index: protocol_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_common.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** protocol_common.inc.php 1 Oct 2002 17:35:10 -0000 1.2 --- protocol_common.inc.php 1 Oct 2002 21:53:20 -0000 1.3 *************** *** 29,48 **** function protocolSelect($oldid, $typename, &$user, $varname = "i_proto") { - echo "<select name=$varname>"; $protos = Protocol::getBriefByType( ProtocolType::getIdFromName($typename), $user, 0); for(reset($protos); list($id, $arr) = each($protos); ) { $sel = $id == $oldid ? "selected" : ""; ! echo "<option $sel value=$id>".html($arr["name"], 0). remMark($arr["removed"], 0)."\n"; } ! if(!isset($protos[$oldid])) { $arr = Protocol::getBasicFromId($oldid); ! echo "<option selected value=0>".html($arr["name"], 0). remMark($arr["removed"], 0)."\n"; } ! echo "</select>"; } --- 29,64 ---- function protocolSelect($oldid, $typename, &$user, $varname = "i_proto") { $protos = Protocol::getBriefByType( ProtocolType::getIdFromName($typename), $user, 0); + if(!$protos && !$oldid) + { + return "<span class=red>None defined</span>"; + } + $str = "<select name=$varname>"; for(reset($protos); list($id, $arr) = each($protos); ) { $sel = $id == $oldid ? "selected" : ""; ! $str .= "<option $sel value=$id>".html($arr["name"], 0). remMark($arr["removed"], 0)."\n"; } ! if($oldid && !isset($protos[$oldid])) { $arr = Protocol::getBasicFromId($oldid); ! $str .= "<option selected value=0>".html($arr["name"], 0). remMark($arr["removed"], 0)."\n"; } ! return $str."</select>"; ! } ! ! // Returns "" if the protocol id is valid, and an error message otherwise. ! function protocolValidate(&$id, $typename, &$user, $varname = "i_proto") ! { ! if(!isset($GLOBALS[$varname]) || !$GLOBALS[$varname]) ! return ""; ! $newid = (int)$GLOBALS[$varname]; ! if(!Protocol::isSharedAndType($newid, $user, $typename)) ! return "Invalid $typename protocol (id = $newid)"; ! $id = $newid; ! return ""; } Index: protocol_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_edit.phtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** protocol_edit.phtml 26 Sep 2002 19:35:05 -0000 1.10 --- protocol_edit.phtml 1 Oct 2002 21:53:20 -0000 1.11 *************** *** 129,133 **** <form method=post enctype="multipart/form-data" action="protocol_edit.phtml?i_p=<?= $protoid ?>"> - <input type=hidden name=i_type value=<?= $proto->getProtocolType() ?>> <input type=hidden name=i_edit value=1> <input type=hidden name=location value="<?= html($location, 0) ?>"> --- 129,132 ---- *************** *** 137,145 **** value="<?= html($proto->getName(), 0) ?>"></td></tr> ! <tr><th>Protocol type</th><td><select name=i_type> <? for(reset($types); list($tid, $tn) = each($types); ) { ! $sel = $tid == $proto->getType() ? "selected" : ""; echo "<option $sel value=$tid>".html($tn, 0)."\n"; } --- 136,144 ---- value="<?= html($proto->getName(), 0) ?>"></td></tr> ! <tr><th>Protocol type</th><td><select name=i_ptype> <? for(reset($types); list($tid, $tn) = each($types); ) { ! $sel = $tid == $proto->getProtocolType() ? "selected" : ""; echo "<option $sel value=$tid>".html($tn, 0)."\n"; } Index: protocol_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_list.phtml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** protocol_list.phtml 30 Sep 2002 16:57:05 -0000 1.12 --- protocol_list.phtml 1 Oct 2002 21:53:20 -0000 1.13 *************** *** 54,59 **** $typeid = $rev[$i_typename]; } ! else if(isset($i_type)) ! $typeid = isset($types[$i_type]) ? $i_type : 0; else $typeid = 0; --- 54,59 ---- $typeid = $rev[$i_typename]; } ! else if(isset($i_ptype)) ! $typeid = isset($types[$i_ptype]) ? $i_ptype : 0; else $typeid = 0; *************** *** 67,78 **** if(s.selectedIndex < 0) return; f=s.form; ! f.action="protocol_list.phtml?i_type="+s.options[s.selectedIndex].value; f.submit(); } </script> <table <?= $cellpad ?>> ! <form name=ff method=post action="protocol_list.phtml?i_type=<?= $typeid ?>"> <tr><th class=pagehead>Protocols for ! <select name=i_type onChange="changePType(this)"> <option value=0>Everything <? --- 67,78 ---- if(s.selectedIndex < 0) return; f=s.form; ! f.action="protocol_list.phtml?i_ptype="+s.options[s.selectedIndex].value; f.submit(); } </script> <table <?= $cellpad ?>> ! <form name=ff method=post action="protocol_list.phtml?i_ptype=<?= $typeid ?>"> <tr><th class=pagehead>Protocols for ! <select name=i_ptype onChange="changePType(this)"> <option value=0>Everything <? *************** *** 100,104 **** { $addlink = "<a class=large href='protocol_edit.phtml". ! "?i_type=$typeid'>Add protocol</a>"; } makeSearchHeader($search, $headerfields, $sortorder, $defsort, "", --- 100,104 ---- { $addlink = "<a class=large href='protocol_edit.phtml". ! "?i_ptype=$typeid'>Add protocol</a>"; } makeSearchHeader($search, $headerfields, $sortorder, $defsort, "", |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv18528 Modified Files: array.inc.php array_common.inc.php array_edit.phtml array_list.phtml extract_list.phtml item_common.inc.php plate.inc.php plate_common.inc.php plate_edit.phtml plate_list.phtml platetype.inc.php probe_search.phtml protocol_common.inc.php sample_edit.phtml test.phtml Log Message: Mostly getting LIMS stuff back in working condition Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** array.inc.php 30 Sep 2002 21:13:09 -0000 1.38 --- array.inc.php 1 Oct 2002 17:35:10 -0000 1.39 *************** *** 27,33 **** require_once("item.inc.php"); ! define("CLEN_ARRAYTYPE_NAME", CLEN_ITEM_NAME); define("CLEN_ARRAYTYPE_PLATFORM", 255); ! define("CLEN_ARRAYBATCH_NAME", CLEN_ITEM_NAME); define("CLEN_ARRAYBATCH_SURFACETYPE", 40); define("CLEN_ARRAY_BARCODE", 20); --- 27,33 ---- require_once("item.inc.php"); [...347 lines suppressed...] $this->notes = $val; + } + + // Returns array (id,name,removed) + function getBriefForArrayType($atid, &$user, $removed = 0) + { + $atid = (int)$atid; + $query = "SELECT ab.id, ab.name, ab.removed ". + "FROM ArrayBatch ab ". + "WHERE ab.`arrayType` = $atid ". + "AND ".Item::whereShared("ab", $user)." ". + Item::whereRemovedAnd("ab", $removed)." ". + "ORDER BY ab.name"; + $res = query($query); + $arr = array(); + while($row =& db_fetch_assoc($res)) + $arr[] = $row; + return $arr; } Index: array_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_common.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** array_common.inc.php 10 Sep 2002 23:04:40 -0000 1.11 --- array_common.inc.php 1 Oct 2002 17:35:10 -0000 1.12 *************** *** 62,68 **** ! function batchList(&$users, $arrayType) { ! global $i_sh, $curUser, $tdbg; $userid = $curUser->getId(); --- 62,68 ---- ! function batchList(&$user, $arrayType) { ! global $$tdbg; $userid = $curUser->getId(); *************** *** 365,368 **** --- 365,396 ---- </table> <? + } + + function arrayPlateList(&$at, &$user) + { + global $cellpad, $tdbg; + ?> + <table <?= $cellpad ?>> + <tr><th colspan=2 class=subhead>Plates</th></tr> + <tr><th>Position</th><th>Plate</th></tr> + <? + $used = $at->findPlates($user); + if(!$used) + echo "<tr><td colspan=2>None</td></tr>\n"; + for(reset($used), $odd = 0; list(, $s) = each($used); $odd ^= 1) + { + if($s["plateRead"]) + { + $plink = "<a href='plate_edit.phtml?i_p=$s[id]'>". + html($s["name"])."</a>".remMark($s["removed"]); + } + else + $plink = html($s["name"]).remMark($s["removed"]); + echo "<tr bgcolor=$tdbg[$odd]>". + "<td>".$s["position"]."</td>". + "<td>".$plink."</td>". + "</tr>\n"; + } + echo "</table>\n"; } Index: array_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_edit.phtml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** array_edit.phtml 10 Sep 2002 23:04:45 -0000 1.22 --- array_edit.phtml 1 Oct 2002 17:35:10 -0000 1.23 *************** *** 31,34 **** --- 31,37 ---- require_once("search.inc.php"); require_once("searchhtml.inc.php"); + require_once("item_common.inc.php"); + require_once("links_common.inc.php"); + require_once("protocol_common.inc.php"); verifyAccess(BUA_ARRAY_READ); *************** *** 40,51 **** [...576 lines suppressed...] </table><br> <? ! arrayPlateList($at, $curUser); ! /* // Only show batches for printed array designs if($printed) { *************** *** 509,513 **** batchList($users, $atid); echo "</form>\n"; ! } } ?> --- 539,543 ---- batchList($users, $atid); echo "</form>\n"; ! }*/ } ?> Index: array_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_list.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** array_list.phtml 29 Aug 2002 16:51:33 -0000 1.15 --- array_list.phtml 1 Oct 2002 17:35:10 -0000 1.16 *************** *** 29,58 **** require_once("search.inc.php"); require_once("searchhtml.inc.php"); verifyAccess(BUA_ARRAY_READ); ! $searchfields = array("Design name", "User", "Date added"); ! $searchtypes = array(0, 0, 1); ! $headerfields = array("Design name", "Blocks", "Protocol", "Description", ! "Date added", "Prints", "Owner"); ! $sortorder = array(1, 1, 1, 1, -1, 0, 1); [...152 lines suppressed...] "<td>".$blk."</td>". "<td>".html($s["addedDate"])."</td>". + "<td>".html($s["userName"])."</td>". + "<td>".groupAccessCheckbox($s["id"])."</td>". + "<td>".groupInfo($s, $users)."</td>". + "<td>".worldInfo($s)."</td>". + "<td>".protocolArrLink($s)."</td>". "<td>".implode(", ", $blink)."</td>". ! "</tr>\n"; } + $cols = count($headerfields); + if($addlink != "") + echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; + + groupAccessFooter($cols, $curUser); + showDelLinks($cols); ?> ! </form> </table> Index: extract_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_list.phtml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** extract_list.phtml 30 Sep 2002 16:57:05 -0000 1.16 --- extract_list.phtml 1 Oct 2002 17:35:10 -0000 1.17 *************** *** 44,49 **** $fieldtype = array(0, 0, 0, 0, 1, 1, 0, 2); $headerfields = array("Name", "Sample", "Extracted", ! "Owner", ! "[<a href=javascript:selAll(1)>A</a> ". "<a href=javascript:selAll(0)>N</a>]", "Group", "World", "Protocol", "µg left", "Labelings", "Hybridizations"); --- 44,48 ---- $fieldtype = array(0, 0, 0, 0, 1, 1, 0, 2); $headerfields = array("Name", "Sample", "Extracted", ! "Owner", "[<a href=javascript:selAll(1)>A</a> ". "<a href=javascript:selAll(0)>N</a>]", "Group", "World", "Protocol", "µg left", "Labelings", "Hybridizations"); Index: item_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item_common.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** item_common.inc.php 30 Sep 2002 16:57:05 -0000 1.5 --- item_common.inc.php 1 Oct 2002 17:35:10 -0000 1.6 *************** *** 231,235 **** { // Only the owner may do these things. ! if(!Item::isOwner($subclass, $sh, $user->getId())) continue; --- 231,235 ---- { // Only the owner may do these things. ! if(!Item::isSharedId($subclass, $sh, $user, 2)) continue; *************** *** 424,429 **** for(reset($i_sh); list($sh) = each($i_sh); ) { ! // Only the owner may do these things. ! if(!Item::isOwner($subclass, $sh, $user->getId())) continue; Item::updateRemovedId($subclass, $sh, $del); --- 424,429 ---- for(reset($i_sh); list($sh) = each($i_sh); ) { ! // Only the owner/SU may do these things. ! if(!Item::isSharedId($subclass, $sh, $user, 2)) continue; Item::updateRemovedId($subclass, $sh, $del); Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** plate.inc.php 30 Sep 2002 21:13:10 -0000 1.36 --- plate.inc.php 1 Oct 2002 17:35:10 -0000 1.37 *************** *** 94,114 **** ! // Returns array eventType=>(protocol,eventDate) ! function getEvents() ! { ! $query = "SELECT pe.etype, pe.protocol, pe.`eventDate` ". ! "FROM PlateEvent pe, Protocol p ". ! "WHERE pe.plate = $this->id AND p.id = pe.protocol"; ! $res = query($query); ! $arr = array(); ! while($row =& db_fetch_assoc($res)) ! $arr[$row[0]] = $row; ! return $arr; ! } ! ! // Returns array eventType=>array(eventDate,name) function getEventsBrief() { ! $query = "SELECT pe.etype, pe.`eventDate`, p.name ". "FROM PlateEvent pe, Protocol p ". "WHERE pe.plate = $this->id AND p.id = pe.protocol"; --- 94,101 ---- ! // Returns array eventType=>array(eventDate,name,protocol) function getEventsBrief() { ! $query = "SELECT pe.etype, pe.`eventDate`, p.name, pe.protocol ". "FROM PlateEvent pe, Protocol p ". "WHERE pe.plate = $this->id AND p.id = pe.protocol"; *************** *** 116,120 **** $arr = array(); while($row =& db_fetch_assoc($res)) ! $arr[$row[0]] = $row; return $arr; } --- 103,107 ---- $arr = array(); while($row =& db_fetch_assoc($res)) ! $arr[$row["etype"]] = $row; return $arr; } *************** *** 471,477 **** function getNameAndDate($id) { ! $query = "SELECT name, `addedDate` FROM Plate WHERE id = ".(int)$id; $res = query($query); ! if($row =& db_fetch_row($res)) return $row; return false; } --- 458,466 ---- function getNameAndDate($id) { ! $query = "SELECT id, name, `addedDate` ". ! "FROM Plate WHERE id = ".(int)$id; $res = query($query); ! if($row =& db_fetch_assoc($res)) ! return $row; return false; } *************** *** 487,490 **** --- 476,484 ---- { return parent::exists("Plate", $id); + } + + function isSharedId($id, &$user, $write = 0) + { + return parent::isSharedId("Plate", $id, $user, $write); } } Index: plate_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_common.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** plate_common.inc.php 5 Aug 2002 11:29:34 -0000 1.3 --- plate_common.inc.php 1 Oct 2002 17:35:10 -0000 1.4 *************** *** 25,59 **** // ! function plateFamilyList($plateid) { ! $parents = Plate::getParentsBrief($plateid); ! for(reset($parents); list(, $a) = each($parents); ) { ! echo "<tr><th>Parent plate</th>". ! "<td><a ".href("plate_edit.phtml?i_p=$a[id]", 2).">". ! html($a["name"])."</a>"; ! if($a["position"]) echo " : $a[position] <img width=11 height=11 ". "src='img/p384_$a[position].gif'>"; - echo " (".html($a["typeName"], 0).")</td></tr>\n"; } ! $children = Plate::getChildrenBrief($plateid, 1); for(reset($children); list(, $a) = each($children); ) { ! echo "<tr><th>Plate used on</th>". ! "<td><a ".href("plate_edit.phtml?i_p=$a[id]", 2).">". ! html($a["name"])."</a>"; ! if($a["position"]) echo " : $a[position] <img width=11 height=11 ". ! "src='img/p384_$a[position].gif'>"; ! echo " (".html($a["typeName"], 0).")</td></tr>\n"; } ! $children = Plate::getChildrenBrief($plateid, 0); for(reset($children); list(, $a) = each($children); ) { ! echo "<tr><th>Child plate</th>". ! "<td><a ".href("plate_edit.phtml?i_p=$a[id]", 2).">". ! html($a["name"])."</a>"; ! if($a["position"]) echo " : $a[position] <img width=11 height=11 ". ! "src='img/p384_$a[position].gif'>"; ! echo " (".html($a["typeName"], 0).")</td></tr>\n"; } } --- 25,64 ---- // ! function plateArrLink($a) { ! if(!$a["readAccess"]) ! $lnk = html($a["name"]).remMark($a["removed"]); ! else { ! $lnk = "<a ".href("plate_edit.phtml?i_p=$a[id]", 2).">". ! html($a["name"])."</a>".remMark($a["removed"]); ! } ! if($a["position"]) ! { ! $lnk .= " : $a[position] <img width=11 height=11 ". "src='img/p384_$a[position].gif'>"; } ! return $lnk ." (".html($a["typeName"], 0).")"; ! } ! ! function plateFamilyList($plateid, &$user) ! { ! $parents = Plate::getParentsBrief($plateid, $user); ! for(reset($parents); list(, $a) = each($parents); ) ! { ! echo "<tr><th>Parent plate</th><td>". ! plateArrLink($a)."</td></tr>\n"; ! } ! $children = Plate::getChildrenBrief($plateid, 1, $user); for(reset($children); list(, $a) = each($children); ) { ! echo "<tr><th>Plate used on</th><td>". ! plateArrLink($a)."</td></tr>\n"; } ! $children = Plate::getChildrenBrief($plateid, 0, $user); for(reset($children); list(, $a) = each($children); ) { ! echo "<tr><th>Child plate</th><td>". ! plateArrLink($a)."</td></tr>\n"; } } Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** plate_edit.phtml 30 Sep 2002 08:26:44 -0000 1.31 --- plate_edit.phtml 1 Oct 2002 17:35:10 -0000 1.32 *************** *** 32,35 **** --- 32,37 ---- require_once("searchhtml.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); + require_once("protocol_common.inc.php"); verifyAccess(BUA_ARRAY_READ); *************** *** 46,50 **** if(isset($i_clone) && $i_clone) [...755 lines suppressed...] ! $plate->prepareWellSearch($search, 96); ?> <form name=ff method=post action="plate_edit.phtml?i_p=<?= ! $plate->getId() ?>"> <input type=hidden name=location value="<?= html($location, 0) ?>"> <? makeSearchHeader($search, $headerfields, $sortorder, $defsort, "", "document.ff.submit();", "Wells"); ! $wells = $plate->wellSearch($search); for($i = 0, $odd = 0; $i < count($wells); $i++, $odd ^= 1) { $a =& $wells[$i]; echo "<tr bgcolor=$tdbg[$odd]>". ! "<td>".chr($a["y"]+64)."</td>". ! "<td>$a[x]</td>". "<td>".Molecule::cloneLink($a["cloneId"])."</td>". "<td>".Molecule::clusterLink($a["species"], $a["clusterId"], Index: plate_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_list.phtml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** plate_list.phtml 22 Sep 2002 23:37:35 -0000 1.28 --- plate_list.phtml 1 Oct 2002 17:35:10 -0000 1.29 *************** *** 42,46 **** $err = ""; ! $types = PlateType::getBrief(); if($types) { --- 42,46 ---- $err = ""; ! $types = PlateType::getBrief($curUser); if($types) { *************** *** 58,62 **** if($ptypeid) { ! $eventTypes = PlateEventType::getBriefForPlateType($ptypeid, $curUser); } else --- 58,63 ---- if($ptypeid) { ! $eventTypes = PlateEventType::getBriefForPlateType($ptypeid, ! showDelSublist()); } else Index: platetype.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/platetype.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** platetype.inc.php 22 Sep 2002 23:37:35 -0000 1.1 --- platetype.inc.php 1 Oct 2002 17:35:10 -0000 1.2 *************** *** 260,269 **** // Returns array id=>name ! function getBrief($wells = -1, $removed = 0) { if($wells < 0) { $query = "SELECT pt.id, pt.name FROM PlateType pt ". ! "WHERE ".db_true()." ". Item::whereRemovedAnd("pt", $removed)." ". "ORDER BY name"; --- 260,269 ---- // Returns array id=>name ! function getBrief(&$user, $wells = -1, $removed = 0) { if($wells < 0) { $query = "SELECT pt.id, pt.name FROM PlateType pt ". ! "WHERE ".Item::whereShared("pt", $user)." ". Item::whereRemovedAnd("pt", $removed)." ". "ORDER BY name"; *************** *** 273,276 **** --- 273,277 ---- $query = "SELECT id, name FROM PlateType ". "WHERE wells = ".(int)$wells." ". + "AND ".Item::whereShared("pt", $user)." ". Item::whereRemovedAnd("pt", $removed)." ". "ORDER BY name"; Index: probe_search.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/probe_search.phtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** probe_search.phtml 30 Sep 2002 21:13:10 -0000 1.5 --- probe_search.phtml 1 Oct 2002 17:35:10 -0000 1.6 *************** *** 115,119 **** if($oneHit) { ! $ptypes = PlateType::getBrief(); ?> --- 115,119 ---- if($oneHit) { ! $ptypes = PlateType::getBrief($curUser); ?> Index: protocol_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_common.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** protocol_common.inc.php 30 Sep 2002 16:57:05 -0000 1.1 --- protocol_common.inc.php 1 Oct 2002 17:35:10 -0000 1.2 *************** *** 27,33 **** ! function protocolSelect($oldid, $typename, &$user) { ! echo "<select name=i_proto>"; $protos = Protocol::getBriefByType( ProtocolType::getIdFromName($typename), $user, 0); --- 27,33 ---- ! function protocolSelect($oldid, $typename, &$user, $varname = "i_proto") { ! echo "<select name=$varname>"; $protos = Protocol::getBriefByType( ProtocolType::getIdFromName($typename), $user, 0); Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** sample_edit.phtml 30 Sep 2002 16:57:05 -0000 1.24 --- sample_edit.phtml 1 Oct 2002 17:35:10 -0000 1.25 *************** *** 96,100 **** if($curDb->dupKey()) $err = "There is already a sample with that name"; ! else $err = "Unable to save sample"; } --- 96,101 ---- if($curDb->dupKey()) $err = "There is already a sample with that name"; ! else ! $err = "Unable to save sample"; } Index: test.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/test.phtml,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** test.phtml 30 Sep 2002 08:26:44 -0000 1.50 --- test.phtml 1 Oct 2002 17:35:10 -0000 1.51 *************** *** 26,29 **** --- 26,42 ---- header("content-type: text/plain"); + + echo "aaa\n"; + + eval("echo(\"bbb\\n\");"); + + echo "ccc\n"; + + eval("function foo(){echo \"ddd\\n\";}"); + + foo(); + + exit; + /* print_r($GLOBALS); *************** *** 47,51 **** echo "$s / max : ".foo($s, "ffffffff")."\n"; } ! //require_once("init.inc.php"); --- 60,64 ---- echo "$s / max : ".foo($s, "ffffffff")."\n"; } ! */ //require_once("init.inc.php"); |
From: <tr...@us...> - 2002-09-30 21:24:47
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv29279 Modified Files: Tag: stable_1_0_6 plate.inc.php Log Message: Fixed copy-and-paste error in function name Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** plate.inc.php 5 Aug 2002 11:19:01 -0000 1.25 --- plate.inc.php 30 Sep 2002 21:24:44 -0000 1.25.2.1 *************** *** 793,797 **** // Returns 0 if there's no such barcode ! function getIdFromName($barcode, $wells = 0) { $query = "SELECT id FROM Plate ". --- 793,797 ---- // Returns 0 if there's no such barcode ! function getIdFromBarcode($barcode, $wells = 0) { $query = "SELECT id FROM Plate ". |
From: <tr...@us...> - 2002-09-30 21:20:38
|
Update of /cvsroot/basedb/basedb/www/misc In directory usw-pr-cvs1:/tmp/cvs-serv27294 Modified Files: Tag: stable_1_0_6 specs.html welcome.html Log Message: changes by Lao Index: specs.html =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc/specs.html,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** specs.html 18 Jun 2002 18:03:10 -0000 1.1 --- specs.html 30 Sep 2002 21:20:34 -0000 1.1.2.1 *************** *** 1,3 **** --- 1,43 ---- + <p><span class=subhead>What is BASE?</span> + + <p>BASE is a comprehensive database server to manage the massive amounts + of + data generated by microarray analysis. In short, it manages biomaterial + information, raw data and images, and provides integrated and + "plug-in"-able normalization, data viewing and analysis + tools. Additionally, for labs that make their own in-house arrays or for + labs that wish to track probe information, the system also has array + production LIMS features which can be integrated with the data + analysis. The organization and interface of BASE was designed to closely + follow the natural work-flow of the microarray biologist, and is + compatible + with most types of array platforms and datatypes (e.g. cDNA/oligos spotted + on any substrate, Affymetrix, CGH on arrays, etc). + + <p>BASE is meant to be installed on a local server in a microarray + laboratory. The server is accessed via any web browser using personal + login accounts with administrated access levels. With his or her own + account, a user can enter data into the database, group experiments + together into projects, and in a uniform and streamlined fashion, apply + filters, normalizations, and run analyses. Users can choose to share + almost any database item (e.g. samples, data, experiments, files, etc) + with + other users to facilitate online collaboration. + <p>BASE was designed to cost next-to-nothing to install your own local + server. BASE runs on the free Linux operating system, using the free MySQL + database backend, and uses PHP/Java/Javascript/C++ programming + languages. In addition, the hardware requirements are quite modest, + making BASE ideal for users with a limited budget. BASE is publicly + available for free as open source under the <a + href="http://www.gnu.org/licenses/licenses.html#GPL" target=_new1 + >GNU General Public License</a>, and academic and commercial + contribution + to the project + is encouraged. In particular, we're interested in new data analysis + and normalization tools, as well as getting existing ones to work with + BASE. BASE software, source code, manuals, and updates can be downloaded + for free. + <p><p> <tr><th class=pagehead>SPECIFICATION SHEET DETAILS:</th></tr> Index: welcome.html =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc/welcome.html,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** welcome.html 21 Aug 2002 15:36:02 -0000 1.9.2.1 --- welcome.html 30 Sep 2002 21:20:35 -0000 1.9.2.2 *************** *** 5,42 **** <p><span class=subhead>What is BASE?</span> ! <p>BASE is a comprehensive database server to manage the massive amounts of ! data generated by microarray analysis. In short, it manages biomaterial ! information, raw data and images, and provides integrated and ! "plug-in"-able normalization, data viewing and analysis ! tools. Additionally, for labs that make their own in-house arrays or for ! labs that wish to track probe information, the system also has array ! production LIMS features which can be integrated with the data ! analysis. The organization and interface of BASE was designed to closely [...76 lines suppressed...] ! blank email to <a ! href="mailto:bas...@th...">bas...@th...</a>. ! <p><a target=_top href="http://sourceforge.net/projects/basedb/"><img ! width="88" height="31" src="http://sourceforge.net/sflogo.php?group_id=54527&type=1" border="0" alt="SourceForge.net Logo" align=left></a> *************** *** 68,72 **** <a target=_top href="http://sourceforge.net/projects/basedb/" >BASE project page</a> you can e.g. access the CVS repository. If you're ! interested in helping out with the development of BASE, get a SourceForge account and tell a project admin.<br clear=all> --- 37,41 ---- <a target=_top href="http://sourceforge.net/projects/basedb/" >BASE project page</a> you can e.g. access the CVS repository. If you're ! interested in helping out with its development, get a SourceForge account and tell a project admin.<br clear=all> |
From: <tr...@us...> - 2002-09-30 21:13:14
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv24108 Modified Files: array.inc.php bioassay.inc.php bioassayset.inc.php genelist.inc.php misc.inc.php molecule.inc.php plate.inc.php probe_search.phtml search.inc.php searchhtml.inc.php Log Message: Removed 1-byte length prefix from Molecule.cloneId Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** array.inc.php 10 Sep 2002 23:04:36 -0000 1.37 --- array.inc.php 30 Sep 2002 21:13:09 -0000 1.38 *************** *** 487,492 **** $y = (int)$y; ! $query = "SELECT e.id, p.molecule, ". ! "SUBSTRING(m.`cloneId`, 2) AS `cloneId` ". "FROM Element e, Well w, Probe p, Molecule m ". "WHERE e.`arrayType` = $arrayType AND e.block = $block ". --- 487,491 ---- $y = (int)$y; ! $query = "SELECT e.id, p.molecule, m.`cloneId` ". "FROM Element e, Well w, Probe p, Molecule m ". "WHERE e.`arrayType` = $arrayType AND e.block = $block ". *************** *** 504,509 **** $arrayType = (int)$arrayType; ! $query = "SELECT e.block, e.x, e.y, ". ! "SUBSTRING(m.`cloneId`, 2) AS `cloneId`, m.`geneName` ". "FROM Element e, Well w, Probe p, Molecule m ". "WHERE e.`arrayType` = $arrayType AND w.id = e.well AND ". --- 503,507 ---- $arrayType = (int)$arrayType; ! $query = "SELECT e.block, e.x, e.y, m.`cloneId`, m.`geneName` ". "FROM Element e, Well w, Probe p, Molecule m ". "WHERE e.`arrayType` = $arrayType AND w.id = e.well AND ". Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassay.inc.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** bioassay.inc.php 12 Sep 2002 11:45:25 -0000 1.39 --- bioassay.inc.php 30 Sep 2002 21:13:10 -0000 1.40 *************** *** 445,449 **** $ecol = $search->getExtraColumnExpressions(); ! $query = "SELECT SUBSTRING(m.`cloneId`, 2) AS `cloneId`, m.`geneName`, ". "bad.intensity1 AS i1, bad.intensity2 AS i2, bad.ratio, ". "m.species, m.`clusterId`, bad.molecule, bad.position AS position, ". --- 445,449 ---- $ecol = $search->getExtraColumnExpressions(); ! $query = "SELECT m.`cloneId`, m.`geneName`, ". "bad.intensity1 AS i1, bad.intensity2 AS i2, bad.ratio, ". "m.species, m.`clusterId`, bad.molecule, bad.position AS position, ". *************** *** 684,688 **** "intensity1" => "AVG(bad.intensity1) AS intensity1", "intensity2" => "AVG(bad.intensity2) AS intensity2", ! "cloneId" => "SUBSTRING(m.`cloneId`, 2) AS `cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", --- 684,688 ---- "intensity1" => "AVG(bad.intensity1) AS intensity1", "intensity2" => "AVG(bad.intensity2) AS intensity2", ! "cloneId" => "m.`cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", *************** *** 710,714 **** "intensity1" => "bad.intensity1", "intensity2" => "bad.intensity2", ! "cloneId" => "SUBSTRING(m.`cloneId`, 2) AS `cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", --- 710,714 ---- "intensity1" => "bad.intensity1", "intensity2" => "bad.intensity2", ! "cloneId" => "m.`cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", Index: bioassayset.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassayset.inc.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** bioassayset.inc.php 10 Sep 2002 23:04:54 -0000 1.28 --- bioassayset.inc.php 30 Sep 2002 21:13:10 -0000 1.29 *************** *** 395,399 **** $fieldsql = array( "position" => "0 AS position", ! "cloneId" => "SUBSTRING(m.`cloneId`, 2) AS `cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", --- 395,399 ---- $fieldsql = array( "position" => "0 AS position", ! "cloneId" => "m.`cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", *************** *** 408,412 **** $fieldsql = array( "position" => "sg.position", ! "cloneId" => "SUBSTRING(m.`cloneId`, 2) AS `cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", --- 408,412 ---- $fieldsql = array( "position" => "sg.position", ! "cloneId" => "m.`cloneId`", "clusterId" => "m.`clusterId`", "species" => "m.species", *************** *** 548,554 **** $ob = BioAssaySet::geneSearchSortOrder($search, true); $ecol = $search->getExtraColumnExpressions(); ! $sel = "m.id, SUBSTRING(m.`cloneId`, 2) AS `cloneId`, ". ! "m.`geneName`, m.`clusterId`, m.species, sg.cnt"; ! if(!$average) $sel .= ", sg.position"; $table = $average ? "$config[dbDynamic]BioAssaySetGene" : --- 548,555 ---- $ob = BioAssaySet::geneSearchSortOrder($search, true); $ecol = $search->getExtraColumnExpressions(); ! $sel = "m.id, m.`cloneId`, m.`geneName`, m.`clusterId`, ". ! "m.species, sg.cnt"; ! if(!$average) ! $sel .= ", sg.position"; $table = $average ? "$config[dbDynamic]BioAssaySetGene" : Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** genelist.inc.php 11 Sep 2002 09:02:04 -0000 1.23 --- genelist.inc.php 30 Sep 2002 21:13:10 -0000 1.24 *************** *** 342,347 **** function getGenesBrief() { ! $query = "SELECT SUBSTRING(m.`cloneId`, 2) AS `cloneId`, ". ! "glg.score, m.`geneName` ". "FROM GeneListGene glg, Molecule m ". "WHERE glg.`geneList` = $this->id AND m.id = glg.molecule ". --- 342,346 ---- function getGenesBrief() { ! $query = "SELECT m.`cloneId`, glg.score, m.`geneName` ". "FROM GeneListGene glg, Molecule m ". "WHERE glg.`geneList` = $this->id AND m.id = glg.molecule ". Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** misc.inc.php 30 Sep 2002 08:26:44 -0000 1.39 --- misc.inc.php 30 Sep 2002 21:13:10 -0000 1.40 *************** *** 43,47 **** { if(strlen($txt) > $len) ! return substr($txt, 0, $len).$etc; else return $txt; --- 43,47 ---- { if(strlen($txt) > $len) ! return substr($txt, 0, $len - strlen($etc)).$etc; else return $txt; Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** molecule.inc.php 30 Sep 2002 08:26:44 -0000 1.34 --- molecule.inc.php 30 Sep 2002 21:13:10 -0000 1.35 *************** *** 27,43 **** require_once("genelist.inc.php"); ! // The maximum cloneId length requires a bit of explanation: ! // To get a reasonable sort order for both numbers and strings, ! // the cloneId has its length prepended when it's stored in the ! // database. This length is stored in the simplest possible way - ! // as the ascii value of a single character. Because we want ! // case insensitivity in the cloneId, there will be problems with ! // the sort order if the character gets into the range of lowercase ! // letters, and since 'a' has ascii value 97, we limit the cloneId [...258 lines suppressed...] return $arr; } --- 626,631 ---- $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) ! $arr[] = (int)$row[0]; return $arr; } *************** *** 689,696 **** if(!($res = query($query))) return $arr; while($row =& db_fetch_assoc($res)) - { - $row["cloneId"] = substr($row["cloneId"], 1); $arr[] = $row; - } return $arr; } --- 679,683 ---- Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** plate.inc.php 22 Sep 2002 23:37:35 -0000 1.35 --- plate.inc.php 30 Sep 2002 21:13:10 -0000 1.36 *************** *** 373,377 **** } ! $query = "SELECT w.*, SUBSTRING(s.`cloneId`, 2) AS `cloneId`, ". "s.species, s.`clusterId`, s.`geneName`, s.`geneSymbol` ". "FROM Well w, Probe p, Molecule s ". --- 373,377 ---- } ! $query = "SELECT w.*, s.`cloneId`, ". "s.species, s.`clusterId`, s.`geneName`, s.`geneSymbol` ". "FROM Well w, Probe p, Molecule s ". Index: probe_search.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/probe_search.phtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** probe_search.phtml 12 Sep 2002 13:53:29 -0000 1.4 --- probe_search.phtml 30 Sep 2002 21:13:10 -0000 1.5 *************** *** 80,84 **** </script> <? ! Molecule::prepareSearch($search, 30); makeSearchHeader($search, $headerfields, $sortorder, $defsort, "", --- 80,84 ---- </script> <? ! Molecule::prepareSearch($search, 25); makeSearchHeader($search, $headerfields, $sortorder, $defsort, "", *************** *** 105,109 **** $s["cloneId"])."</td>". "<td>".html($s["geneSymbol"])."</td>". ! "<td>".html(maxlen($s["geneName"], 40, "..."))."</td>". "</tr>\n"; } --- 105,110 ---- $s["cloneId"])."</td>". "<td>".html($s["geneSymbol"])."</td>". ! "<td>".html($oneHit ? $s["geneName"] : ! maxlen($s["geneName"], 60, "..."))."</td>". "</tr>\n"; } Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** search.inc.php 12 Sep 2002 22:37:56 -0000 1.42 --- search.inc.php 30 Sep 2002 21:13:10 -0000 1.43 *************** *** 92,97 **** // Defined fieldtypes: 0 = string, 1 = date, 2 = int, 3 = float, ! // 4 = boolean, 5 = string%, 6 = %string%, 7 = genelist, 8 = 2^float, ! // 9 = cloneId, array(0=>0, n => option) = SELECT define("SEARCH_STRING", 0); --- 92,98 ---- // Defined fieldtypes: 0 = string, 1 = date, 2 = int, 3 = float, ! // 4 = boolean, 5 = string% (deprected), 6 = %string% (depr), ! // 7 = genelist, 8 = 2^float, 9 = cloneId(obsolete), ! // array(0=>0, n => option) = SELECT define("SEARCH_STRING", 0); *************** *** 967,970 **** --- 968,978 ---- } + if($type == SEARCH_CLONEID) + { + // The SEARCH_CLONEID type was a design error which I'm now removing. + // Recall that $type is a reference to $fieldtypes[$this->field]. + $type = SEARCH_STRING; + } + if($type == SEARCH_GENELIST) // Genelists are a bit special { *************** *** 1024,1030 **** else if($type == SEARCH_CLONEID) { ! $s = (string)$arr[$j]; ! $arr[$j] = chr(strlen($s)).$s; ! $view[] = $s; } else --- 1032,1039 ---- else if($type == SEARCH_CLONEID) { ! $arr[$j] = (string)$arr[$j]; ! // $s = (string)$arr[$j]; ! // $arr[$j] = chr(strlen($s)).$s; ! // $view[] = $s; } else Index: searchhtml.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/searchhtml.inc.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** searchhtml.inc.php 12 Sep 2002 11:45:26 -0000 1.41 --- searchhtml.inc.php 30 Sep 2002 21:13:10 -0000 1.42 *************** *** 32,36 **** // Defined fieldtypes: 0 = string, 1 = date, 2 = int, 3 = float, // 4 = boolean, 5 = string%, 6 = %string%, 7 = genelist, 8 = 2^float, ! // 9 = cloneId, array(0, ... ) = enum // // $userid - ID of the user for which the table is shown --- 32,36 ---- // Defined fieldtypes: 0 = string, 1 = date, 2 = int, 3 = float, // 4 = boolean, 5 = string%, 6 = %string%, 7 = genelist, 8 = 2^float, ! // 9 = cloneId(obsolete), array(0, ... ) = enum // // $userid - ID of the user for which the table is shown |
From: <tr...@us...> - 2002-09-30 17:20:33
|
Update of /cvsroot/basedb/basedb/exec In directory usw-pr-cvs1:/tmp/cvs-serv28500 Modified Files: example_getconfig2.inc.php Log Message: Made things a bit more clear Index: example_getconfig2.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/exec/example_getconfig2.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** example_getconfig2.inc.php 12 Jul 2002 16:52:52 -0000 1.1 --- example_getconfig2.inc.php 30 Sep 2002 17:20:30 -0000 1.2 *************** *** 3,7 **** // includes another file B, it doesn't search the directory A was in // but only the current directory (or whatever include_path says). ! ini_set("include_path", "/usr/local/base/www:".ini_get("include_path")); require_once("getconfig.inc.php"); ?> --- 3,10 ---- // includes another file B, it doesn't search the directory A was in // but only the current directory (or whatever include_path says). ! $wwwpath = "/usr/local/base/www"; ! ! ini_set("include_path", $wwwpath.":".ini_get("include_path")); ! unset($wwwpath); require_once("getconfig.inc.php"); ?> |
From: <tr...@us...> - 2002-09-30 17:19:39
|
Update of /cvsroot/basedb/basedb In directory usw-pr-cvs1:/tmp/cvs-serv28185 Modified Files: base.sql Log Message: New user access system, 'removed' flag. Index: base.sql =================================================================== RCS file: /cvsroot/basedb/basedb/base.sql,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** base.sql 7 Sep 2002 11:34:17 -0000 1.7 --- base.sql 30 Sep 2002 17:19:36 -0000 1.8 *************** *** 39,43 **** protocol int(11) NOT NULL default '0', notes tinytext NOT NULL, ! isVisible tinyint(1) NOT NULL default '1', PRIMARY KEY (id), UNIQUE KEY name (name), --- 39,46 ---- protocol int(11) NOT NULL default '0', notes tinytext NOT NULL, ! removed tinyint(1) NOT NULL default '0', ! gid int(11) NOT NULL default '0', [...531 lines suppressed...] + parent int(11) NOT NULL default '0', + PRIMARY KEY (child,parent) + ) TYPE=MyISAM; + + # # Table structure for table 'UserSearch' # *************** *** 1134,1138 **** CREATE TABLE UserSearch ( item int(11) NOT NULL default '0', ! searchType enum('plate','sample','extract','labeled','hybridization','value','arraytype','well','wizzzard','raw','exp','user','gene','genelist','program','news','acq','acq_img','ware','acq_rba','platetype','print','array','molecule','upload') NOT NULL default 'plate', search int(11) NOT NULL default '0', PRIMARY KEY (search), --- 1238,1242 ---- CREATE TABLE UserSearch ( item int(11) NOT NULL default '0', ! searchType enum('plate','sample','extract','labeled','hybridization','value','arraytype','well','wizzzard','raw','exp','user','gene','genelist','program','news','acq','acq_img','ware','acq_rba','platetype','print','array','molecule','upload','annottype','protocol') NOT NULL default 'plate', search int(11) NOT NULL default '0', PRIMARY KEY (search), |
From: <tr...@us...> - 2002-09-30 17:16:02
|
Update of /cvsroot/basedb/basedb/exec/migration_tools In directory usw-pr-cvs1:/tmp/cvs-serv26825a Added Files: devchanges.sql Log Message: Database changes necessary to use the CVS version --- NEW FILE: devchanges.sql --- -- This file mostly contains the structural changes (from 1.0.6) that -- have been done so far. ALTER TABLE Sample DROP useCount, ADD sampleDate DATE not null, ADD removed TINYINT(1) not null, ADD gid INT not null , ADD groupAccess TINYINT(1) not null, ADD worldAccess TINYINT(1) not null; ALTER TABLE Extract DROP useCount, ADD removed TINYINT(1) not null, ADD gid INT not null , ADD groupAccess TINYINT(1) not null, ADD worldAccess TINYINT(1) not null; ALTER TABLE LabeledExtract [...185 lines suppressed...] CREATE TABLE `UserGroupParent` ( `child` int(11) NOT NULL default '0', `parent` int(11) NOT NULL default '0', PRIMARY KEY (`child`,`parent`) ) TYPE=MyISAM; INSERT INTO UserGroup (id, name, accessMask) SELECT (id, userName, accessMask) FROM Submitter; INSERT INTO UserAccount (userGroup, email, address, phone, fax, realName, md5Pass, activeUntil) SELECT (id, email, address, phone, fax, name, md5Pass, activeUntil) FROM Submitter; ALTER TABLE UserSearch CHANGE searchType searchType ENUM ('plate','sample','extract','labeled','hybridization','value','arraytype','well','wizzzard','raw','exp','user','gene','genelist','program','news','acq','acq_img','ware','acq_rba','platetype','print','array','molecule','upload','annottype','protocol') DEFAULT 'plate' not null; UPDATE Protocol SET worldAccess = 1; UPDATE SampleAnnotationType SET worldAccess = 1; UPDATE Program SET worldAccess = 1; |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv20274 Modified Files: download.phtml extract_edit.phtml extract_list.phtml htmlinit.phtml hyb.inc.php hyb_common.inc.php hyb_edit.phtml hyb_image.phtml hyb_list.phtml item_common.inc.php labeled_edit.phtml labeled_list.phtml left.phtml links_common.inc.php protocol_list.phtml sample_edit.phtml sample_list.phtml sampletissue_tree.phtml upload_common.inc.php Added Files: protocol_common.inc.php Log Message: More cleanup for the new user access system and hiding rather than deleting... --- NEW FILE: protocol_common.inc.php --- <? // $Id: protocol_common.inc.php,v 1.1 2002/09/30 16:57:05 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 // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // require_once("item_common.inc.php"); function protocolSelect($oldid, $typename, &$user) { echo "<select name=i_proto>"; $protos = Protocol::getBriefByType( ProtocolType::getIdFromName($typename), $user, 0); for(reset($protos); list($id, $arr) = each($protos); ) { $sel = $id == $oldid ? "selected" : ""; echo "<option $sel value=$id>".html($arr["name"], 0). remMark($arr["removed"], 0)."\n"; } if(!isset($protos[$oldid])) { $arr = Protocol::getBasicFromId($oldid); echo "<option selected value=0>".html($arr["name"], 0). remMark($arr["removed"], 0)."\n"; } echo "</select>"; } ?> Index: download.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/download.phtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** download.phtml 29 Aug 2002 16:51:33 -0000 1.10 --- download.phtml 30 Sep 2002 16:57:05 -0000 1.11 *************** *** 54,63 **** $upl = new Upload(); ! if(!$upl->read($i_file, $curUser->getId())) { $ref = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "unknown"; error_log("File access denied: file ".(int)$i_file. ! ", user ".$curUser->getUserName()." from $ref"); header("HTTP/1.1 404 Not found"); echo "File not found"; --- 54,63 ---- $upl = new Upload(); ! if(!$upl->readShared($i_file, $curUser)) { $ref = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "unknown"; error_log("File access denied: file ".(int)$i_file. ! ", user ".$curUser->getName()." from $ref"); header("HTTP/1.1 404 Not found"); echo "File not found"; Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** extract_edit.phtml 30 Sep 2002 08:26:43 -0000 1.19 --- extract_edit.phtml 30 Sep 2002 16:57:05 -0000 1.20 *************** *** 29,32 **** --- 29,33 ---- require_once("item_common.inc.php"); require_once("links_common.inc.php"); + require_once("protocol_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 193,222 **** echo "<input type=hidden name=i_samp value=".$ext->getSample().">\n"; - $sid = $ext->getSample(); - $sinfo = Sample::getBasicFromId($sid); - $sname = "<a ".href("sample_edit.phtml?i_samp=$sid", 2).">". - html($sinfo["name"]).remMark($sinfo["removed"])."</a>"; ?> ! <tr><th>Sample</th><td><?= $sname ?></td></tr> <tr><th>Name</th><td><input type=text size=30 name=i_name maxlength=<?= CLEN_EXTRACT_NAME ?> value="<?= html($ext->getName(), 0) ?>"></td></tr> ! <tr><th>Extraction protocol</th><td><select name=i_proto> ! <? ! $protos = Protocol::getBriefByType( ! ProtocolType::getIdFromName("Extraction"), $curUser, 0); ! for(reset($protos); list($id, $arr) = each($protos); ) ! { ! $sel = $id == $ext->getProtocol() ? "selected" : ""; ! $del = $arr["removed"] ? " (D)" : ""; ! echo "<option $sel value=$id>".html($arr["name"], 0)."$del\n"; ! } ! if(!isset($protos[$ext->getProtocol()])) ! { ! $n = Protocol::getNameFromId($ext->getProtocol()); ! echo "<option $sel value=0>".html($n, 0)." (D)\n"; ! } ! ?> ! </select></td></tr> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr ><?= html($ext->getDescr(), 0) ?></textarea></td></tr> --- 194,205 ---- echo "<input type=hidden name=i_samp value=".$ext->getSample().">\n"; ?> ! <tr><th>Sample</th><td><?= ! sampleIdLink($ext->getSample(), $curUser) ?></td></tr> <tr><th>Name</th><td><input type=text size=30 name=i_name maxlength=<?= CLEN_EXTRACT_NAME ?> value="<?= html($ext->getName(), 0) ?>"></td></tr> ! <tr><th>Extraction protocol</th><td><?= ! protocolSelect($ext->getProtocol(), "Extraction", $curUser) ?></td></tr> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr ><?= html($ext->getDescr(), 0) ?></textarea></td></tr> *************** *** 296,311 **** } - $sid = $ext->getSample(); - $sinfo = Sample::getBasicFromId($sid); - $sname = html($sinfo["name"]); - if(Sample::isSharedId($sid, $curUser)) - { - $sname = "<a ".href("sample_edit.phtml?i_samp=$sid", 2).">". - $sname.remMark($sinfo["removed"])."</a>"; - } - ?> <tr><th>Name</th><td><?= html($ext->getName()).remMark($ext) ?></td></tr> ! <tr><th>Sample</th><td><?= $sname ?></td></tr> <tr><th>Protocol</th><td><?= protocolIdLink($ext->getProtocol(), $curUser) ?></td></tr> --- 279,286 ---- } ?> <tr><th>Name</th><td><?= html($ext->getName()).remMark($ext) ?></td></tr> ! <tr><th>Sample</th><td><?= ! sampleIdLink($ext->getSample(), $curUser) ?></td></tr> <tr><th>Protocol</th><td><?= protocolIdLink($ext->getProtocol(), $curUser) ?></td></tr> Index: extract_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_list.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** extract_list.phtml 30 Sep 2002 08:26:43 -0000 1.15 --- extract_list.phtml 30 Sep 2002 16:57:05 -0000 1.16 *************** *** 84,88 **** { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". ! html($s["sampleName"]).remMark($s["sampleRemoved"])."</a>"; } else $slink = html($s["sampleName"]); --- 84,88 ---- { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". ! html($s["sampleName"])."</a>".remMark($s["sampleRemoved"]); } else $slink = html($s["sampleName"]); *************** *** 93,97 **** { $hybs[$id] = "<a href='hyb_edit.phtml?i_hyb=$id'>". ! html($arr["name"]).remMark($arr["removed"])."</a>"; } $hybs = implode(", ", $hybs); --- 93,97 ---- { $hybs[$id] = "<a href='hyb_edit.phtml?i_hyb=$id'>". ! html($arr["name"])."</a>".remMark($arr["removed"]); } $hybs = implode(", ", $hybs); *************** *** 104,108 **** { $labs[$id] = "<a href='labeled_edit.phtml?i_lab=$id'>". ! html($arr["name"]).remMark($arr["removed"])."</a>"; } if(!$s["removed"] && acc(BUA_BIO_EDIT)) --- 104,108 ---- { $labs[$id] = "<a href='labeled_edit.phtml?i_lab=$id'>". ! html($arr["name"])."</a>".remMark($arr["removed"]); } if(!$s["removed"] && acc(BUA_BIO_EDIT)) *************** *** 116,120 **** echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='extract_edit.phtml?i_ext=$s[id]'>". ! html($s["name"]).remMark($s["removed"])."</a></td>". "<td>$slink</td>". "<td>".htmldate($s["extractionDate"])."</td>". --- 116,120 ---- echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='extract_edit.phtml?i_ext=$s[id]'>". ! html($s["name"])."</a>".remMark($s["removed"])."</td>". "<td>$slink</td>". "<td>".htmldate($s["extractionDate"])."</td>". *************** *** 123,127 **** "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolLink($s)."</td>". "<td>".$qty."</td>". "<td>".$labs."</td>". --- 123,127 ---- "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolArrLink($s)."</td>". "<td>".$qty."</td>". "<td>".$labs."</td>". Index: htmlinit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/htmlinit.phtml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** htmlinit.phtml 30 Sep 2002 08:26:43 -0000 1.26 --- htmlinit.phtml 30 Sep 2002 16:57:05 -0000 1.27 *************** *** 50,55 **** a:visited { text-decoration: none; color: #1000d0; } ! a.ext:active { text-decoration: none; color: #ff5050; } ! a.ext:link { text-decoration: none; color: #f00000; } a.ext:visited { text-decoration: none; color: #800000; } --- 50,55 ---- a:visited { text-decoration: none; color: #1000d0; } ! a.ext:active { text-decoration: none; color: #ff8050; } ! a.ext:link { text-decoration: none; color: #f05000; } a.ext:visited { text-decoration: none; color: #800000; } Index: hyb.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb.inc.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** hyb.inc.php 20 Sep 2002 18:25:00 -0000 1.23 --- hyb.inc.php 30 Sep 2002 16:57:05 -0000 1.24 *************** *** 151,155 **** // Returns an array of arrays with various fields. ! function search(&$search) { // Add more fields here --- 151,155 ---- // Returns an array of arrays with various fields. ! function search(&$search, &$user) { // Add more fields here *************** *** 164,168 **** $ss1 = "t.* FROM Hybridization h, ". "(SELECT h.id,"; ! $ss2 = ", `protocolName`, `userName`, barcode) AS t ". "WHERE h.id = t.id"; } --- 164,169 ---- $ss1 = "t.* FROM Hybridization h, ". "(SELECT h.id,"; ! $ss2 = ", `protocolName`, `protocolRead`, `userName`, ". ! "barcode) AS t ". "WHERE h.id = t.id"; } *************** *** 172,176 **** $query = "SELECT h.*, $ss1 p.name AS `protocolName`, ". "ug.name AS `userName`, ". ! "COUNT(DISTINCT ia.id) AS scans, COUNT(DISTINCT i.id) AS images, ". "COUNT(DISTINCT rba.id) AS raws, a.barcode ". "FROM UserGroup ug, Protocol p, Hybridization h ". --- 173,179 ---- $query = "SELECT h.*, $ss1 p.name AS `protocolName`, ". "ug.name AS `userName`, ". ! Item::whereShared("p", $user)." AS `protocolRead`, ". ! "COUNT(DISTINCT ia.id) AS scans, ". ! "COUNT(DISTINCT i.id) AS images, ". "COUNT(DISTINCT rba.id) AS raws, a.barcode ". "FROM UserGroup ug, Protocol p, Hybridization h ". Index: hyb_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_common.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** hyb_common.inc.php 30 Sep 2002 08:26:43 -0000 1.9 --- hyb_common.inc.php 30 Sep 2002 16:57:05 -0000 1.10 *************** *** 28,31 **** --- 28,32 ---- require_once("array.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); function hybInfo(&$hyb) *************** *** 81,85 **** ?> <tr><th>Hybridization protocol</th><td><?= ! html(Protocol::getNameFromId($hyb->getProtocol())) ?></td></tr> <tr><th>Description</th><td><?= html($hyb->getDescr()) ?></td></tr> <tr><th>Hybridized</th><td><?= htmldate($hyb->getHybridizationDate()) ?></td></tr> --- 82,86 ---- ?> <tr><th>Hybridization protocol</th><td><?= ! protocolIdLink($hyb->getProtocol(), $curUser) ?></td></tr> <tr><th>Description</th><td><?= html($hyb->getDescr()) ?></td></tr> <tr><th>Hybridized</th><td><?= htmldate($hyb->getHybridizationDate()) ?></td></tr> Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** hyb_edit.phtml 22 Sep 2002 23:37:34 -0000 1.34 --- hyb_edit.phtml 30 Sep 2002 16:57:05 -0000 1.35 *************** *** 35,40 **** require_once("search.inc.php"); require_once("searchhtml.inc.php"); - require_once("item_common.inc.php"); require_once("ware.inc.php"); verifyAccess(BUA_BIO_READ); --- 35,41 ---- require_once("search.inc.php"); require_once("searchhtml.inc.php"); require_once("ware.inc.php"); + require_once("item_common.inc.php"); + require_once("protocol_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 76,80 **** if(isset($i_ey) && isset($i_em) && isset($i_ed)) $hyb->setHybridizationDate("$i_ey-$i_em-$i_ed"); ! if(isset($i_proto)) $hyb->setProtocol($i_proto); dateAndOwnerInputHandle($hyb, $curUser); --- 77,81 ---- if(isset($i_ey) && isset($i_em) && isset($i_ed)) $hyb->setHybridizationDate("$i_ey-$i_em-$i_ed"); ! if(isset($i_proto) && $i_proto) $hyb->setProtocol($i_proto); dateAndOwnerInputHandle($hyb, $curUser); *************** *** 101,107 **** $newhyb = $hybid == 0; - if(!Protocol::existsNamedType($hyb->getProtocol(), "Hybridization")) - $err = "Invalid protocol"; - if($err != "") {} else if(!acc(BUA_BIO_EDIT)) --- 102,105 ---- *************** *** 109,112 **** --- 107,115 ---- else if($hyb->getName() == "") $err = "The hybridization must have a name"; + else if(!Protocol::isSharedAndType($hyb->getProtocol(), + $curUser, "Hybridization")) + { + $err = "Invalid protocol"; + } else if(!$hyb->write()) { *************** *** 296,309 **** } ?> ! <tr><th>Hybridization protocol</th><td><select name=i_proto> ! <? ! $protos = Protocol::getBriefByName("Hybridization"); ! for(reset($protos); list($id, $n) = each($protos); ) ! { ! $sel = $id == $hyb->getProtocol() ? "selected" : ""; ! echo "<option $sel value=$id>".html($n)."\n"; ! } ! ?> ! </select></td></tr> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr ><?= html($hyb->getDescr(), 0) ?></textarea></td></tr> --- 299,305 ---- } ?> ! <tr><th>Hybridization protocol</th><td><?= ! protocolSelect($hyb->getProtocol(), "Hybridization", $curUser) ?></td></tr> ! <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr ><?= html($hyb->getDescr(), 0) ?></textarea></td></tr> *************** *** 426,429 **** --- 422,426 ---- if($hybid) { + // Show image acquisistions $search = new Search(); $search->readForUser($curUser->getId(), "acq"); Index: hyb_image.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_image.phtml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** hyb_image.phtml 22 Sep 2002 23:37:34 -0000 1.25 --- hyb_image.phtml 30 Sep 2002 16:57:05 -0000 1.26 *************** *** 35,38 **** --- 35,39 ---- require_once("searchhtml.inc.php"); require_once("item_common.inc.php"); + require_once("upload_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 43,56 **** // Handle any file uploads (images) [...169 lines suppressed...] + + uploadInput($curUser, $img); + } + if($imageCount) + { ?> ! <tr><td colspan=2><input type=submit name=i_ok value='Accept'> ! <input type=submit name=i_imgadd value='Add more images'></td></tr> <? } + else + { ?> ! <tr><td colspan=2><input type=submit name=i_imgadd ! value='Add images'></td></tr> <? + } + echo "</table>\n"; } ?> Index: hyb_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_list.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** hyb_list.phtml 30 Sep 2002 08:26:43 -0000 1.15 --- hyb_list.phtml 30 Sep 2002 16:57:05 -0000 1.16 *************** *** 31,34 **** --- 31,35 ---- require_once("searchhtml.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 47,51 **** "<a href=javascript:selAll(0)>N</a>]", "Group", "World", "Protocol", "Img sets", "Images", "Result files"); ! $sortorder = array(1, 0, 1, -1, 1, 0, 0, 0, 1, 1, 1, 1); $defsort = 0; --- 48,52 ---- "<a href=javascript:selAll(0)>N</a>]", "Group", "World", "Protocol", "Img sets", "Images", "Result files"); ! $sortorder = array(1, 0, 1, -1, 1, 0, 0, 0, 1, -1, -1, -1); $defsort = 0; *************** *** 79,83 **** "document.ff.submit();", "", "", array($addlink)); ! $hybs = Hybridization::search($search); for($i = 0, $odd= 1; $i < count($hybs); $i++, $odd ^= 1) --- 80,84 ---- "document.ff.submit();", "", "", array($addlink)); ! $hybs = Hybridization::search($search, $curUser); for($i = 0, $odd= 1; $i < count($hybs); $i++, $odd ^= 1) *************** *** 126,130 **** "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".html($s["protocolName"])."</td>". "<td>".html($s["scans"])."</td>". "<td>".html($s["images"])."</td>". --- 127,131 ---- "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolArrLink($s)."</td>". "<td>".html($s["scans"])."</td>". "<td>".html($s["images"])."</td>". Index: item_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item_common.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** item_common.inc.php 30 Sep 2002 08:26:43 -0000 1.4 --- item_common.inc.php 30 Sep 2002 16:57:05 -0000 1.5 *************** *** 341,345 **** // Input: Item object or scalar. Output: string denoting deleted item. ! function remMark(&$obj) { if(is_object($obj)) --- 341,345 ---- // Input: Item object or scalar. Output: string denoting deleted item. ! function remMark(&$obj, $html = true) { if(is_object($obj)) *************** *** 350,353 **** --- 350,355 ---- else if(!$obj) return ""; + else if(!$html) + return " (D)"; return " <span class=del>(D)</span>"; } Index: labeled_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_edit.phtml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** labeled_edit.phtml 30 Sep 2002 08:26:43 -0000 1.18 --- labeled_edit.phtml 30 Sep 2002 16:57:05 -0000 1.19 *************** *** 28,31 **** --- 28,33 ---- require_once("bio.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); + require_once("protocol_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 67,71 **** if(isset($i_ey) && isset($i_em) && isset($i_ed)) [...101 lines suppressed...] - } - - $void = array(); ?> <tr><th>Name</th><td><?= html($lext->getName()).remMark($lext) ?></td></tr> ! <tr><th>Extract</th><td><?= $ename ?></td></tr> ! <tr><th>Protocol</th><td><?= html($pname) ?></td></tr> <tr><th>Description</th><td><?= html($lext->getDescr()) ?></td></tr> <tr><th>Label</th><td><?= html($lext->getLabel()) ?></td></tr> --- 306,315 ---- } ?> <tr><th>Name</th><td><?= html($lext->getName()).remMark($lext) ?></td></tr> ! <tr><th>Extract</th><td><?= ! extractIdLink($lext->getExtract(), $curUser) ?></td></tr> ! <tr><th>Protocol</th><td><?= ! protocolIdLink($lext->getProtocol(), $curUser) ?></td></tr> <tr><th>Description</th><td><?= html($lext->getDescr()) ?></td></tr> <tr><th>Label</th><td><?= html($lext->getLabel()) ?></td></tr> Index: labeled_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_list.phtml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** labeled_list.phtml 30 Sep 2002 08:26:44 -0000 1.16 --- labeled_list.phtml 30 Sep 2002 16:57:05 -0000 1.17 *************** *** 88,92 **** { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". ! html($s["sampleName"]).remMark($s["extractRemoved"])."</a>"; } else --- 88,92 ---- { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". ! html($s["sampleName"])."</a>".remMark($s["extractRemoved"]); } else *************** *** 95,99 **** { $elink = "<a href='extract_edit.phtml?i_ext=$s[extract]'>". ! html($s["extractName"]).remMark($s["extractRemoved"])."</a>"; } else --- 95,99 ---- { $elink = "<a href='extract_edit.phtml?i_ext=$s[extract]'>". ! html($s["extractName"])."</a>".remMark($s["extractRemoved"]); } else *************** *** 105,109 **** { $hybs[$id] = "<a href='hyb_edit.phtml?i_hyb=$id'>". ! html($arr["name"]).remMark($arr["removed"])."</a>"; } $hybs = implode(" ", $hybs); --- 105,109 ---- { $hybs[$id] = "<a href='hyb_edit.phtml?i_hyb=$id'>". ! html($arr["name"])."</a>".remMark($arr["removed"]); } $hybs = implode(" ", $hybs); *************** *** 114,118 **** echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='labeled_edit.phtml?i_lext=$s[id]'>". ! html($s["name"]).remMark($s["removed"])."</a></td>". "<td>".html($s["label"])."</td>". "<td>$elink</td>". --- 114,118 ---- echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='labeled_edit.phtml?i_lext=$s[id]'>". ! html($s["name"])."</a>".remMark($s["removed"])."</td>". "<td>".html($s["label"])."</td>". "<td>$elink</td>". *************** *** 123,127 **** "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolLink($s)."</td>". "<td>".$qty."</td>". "<td>".$hybs."</td></tr>\n"; --- 123,127 ---- "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolArrLink($s)."</td>". "<td>".$qty."</td>". "<td>".$hybs."</td></tr>\n"; Index: left.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/left.phtml,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** left.phtml 30 Sep 2002 08:26:44 -0000 1.48 --- left.phtml 30 Sep 2002 16:57:05 -0000 1.49 *************** *** 224,228 **** ?> <tr><th class=subheadact><a target=_top ! href="index.phtml?l=hyb&m=hyb_list.phtml">Hybridizations</a></td></tr> <tr><td><a target=main href="hyb_list.phtml">Hybridizations</a></td></tr> <tr><td><img src='img/1.gif' alt='' width=1 height=1></td></tr> --- 224,228 ---- ?> <tr><th class=subheadact><a target=_top ! href="index.phtml?l=hyb&m=bio_main.phtml">Hybridizations</a></td></tr> <tr><td><a target=main href="hyb_list.phtml">Hybridizations</a></td></tr> <tr><td><img src='img/1.gif' alt='' width=1 height=1></td></tr> *************** *** 243,247 **** } else echo "<tr><th class=subhead><a target=_top href='index.phtml". ! "?l=hyb&m=hyb_list.phtml'>Hybridizations</a></td></tr>\n"; if(!$loggedIn) {} --- 243,247 ---- } else echo "<tr><th class=subhead><a target=_top href='index.phtml". ! "?l=hyb&m=bio_main.phtml'>Hybridizations</a></td></tr>\n"; if(!$loggedIn) {} Index: links_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/links_common.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** links_common.inc.php 30 Sep 2002 08:26:44 -0000 1.1 --- links_common.inc.php 30 Sep 2002 16:57:05 -0000 1.2 *************** *** 27,31 **** ! function protocolLink(&$arr) { if(!$arr["protocolRead"]) --- 27,31 ---- ! function protocolArrLink(&$arr) { if(!$arr["protocolRead"]) *************** *** 42,46 **** return html($arr["name"]).remMark($arr["removed"]); return "<a ".href("protocol_edit.phtml?i_p=$id", 2).">". ! html($arr["name"]).remMark($arr["removed"])."</a>"; } --- 42,86 ---- return html($arr["name"]).remMark($arr["removed"]); return "<a ".href("protocol_edit.phtml?i_p=$id", 2).">". ! html($arr["name"])."</a>".remMark($arr["removed"]); ! } ! ! function sampleIdLink($id, &$user) ! { ! $id = (int)$id; ! $arr = Sample::getBasicFromId($id); ! if(!Sample::isSharedId($id, $user)) ! return html($arr["name"]).remMark($arr["removed"]); ! return "<a ".href("sample_edit.phtml?i_samp=$id", 2).">". ! html($arr["name"])."</a>".remMark($arr["removed"]); ! } ! ! function extractIdLink($id, &$user) ! { ! $id = (int)$id; ! $arr = Extract::getBasicFromId($id); ! if(!Extract::isSharedId($id, $user)) ! return html($arr["name"]).remMark($arr["removed"]); ! return "<a ".href("extract_edit.phtml?i_ext=$id", 2).">". ! html($arr["name"])."</a>".remMark($arr["removed"]); ! } ! ! function labeledExtractIdLink($id, &$user) ! { ! $id = (int)$id; ! $arr = LabeledExtract::getBasicFromId($id); ! if(!LabeledExtract::isSharedId($id, $user)) ! return html($arr["name"]).remMark($arr["removed"]); ! return "<a ".href("labeled_edit.phtml?i_lext=$id", 2).">". ! html($arr["name"])."</a>".remMark($arr["removed"]); ! } ! ! function hybridizationIdLink($id, &$user) ! { ! $id = (int)$id; ! $arr = Hybridization::getBasicFromId($id); ! if(!Hybridization::isSharedId($id, $user)) ! return html($arr["name"]).remMark($arr["removed"]); ! return "<a ".href("hyb_edit.phtml?i_hyb=$id", 2).">". ! html($arr["name"])."</a>".remMark($arr["removed"]); } Index: protocol_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_list.phtml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** protocol_list.phtml 26 Sep 2002 19:35:05 -0000 1.11 --- protocol_list.phtml 30 Sep 2002 16:57:05 -0000 1.12 *************** *** 125,129 **** "<td>".html($s["typeName"])."</td>". "<td><a href='protocol_edit.phtml?i_p=$s[id]'>". ! html($s["name"]).remMark($s["removed"])."</a></td>". "<td>".htmldate($s["addedDate"])."</td>". "<td>".html($s["userName"])."</td>". --- 125,129 ---- "<td>".html($s["typeName"])."</td>". "<td><a href='protocol_edit.phtml?i_p=$s[id]'>". ! html($s["name"])."</a>".remMark($s["removed"])."</td>". "<td>".htmldate($s["addedDate"])."</td>". "<td>".html($s["userName"])."</td>". Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** sample_edit.phtml 30 Sep 2002 08:26:44 -0000 1.23 --- sample_edit.phtml 30 Sep 2002 16:57:05 -0000 1.24 *************** *** 46,50 **** else { ! if(!isset($i_tissue)) $i_tissue = SampleTissue::getAncestorsOf($samp->getTissue()); $edit = isset($i_edit) && $i_edit && --- 46,50 ---- else { ! if(!isset($i_tissue) || !is_array($i_tissue)) $i_tissue = SampleTissue::getAncestorsOf($samp->getTissue()); [...105 lines suppressed...] { ! $id = $arr["id"]; ! if($arr["removed"] && $tid != $id) ! continue; ! $sel = $tid == $id ? "selected" : ""; ! if($tid == $id) ! $shown = true; ! $opt[] = "<option $sel value=$id>". ! html($arr["name"], 0).remMark($arr["removed"], 0); } ! if($lvl > 0 && !$opt) ! return; ! echo "<select name='i_tissue[$lvl]' onChange='this.form.submit()'>". ! "<option value=0>None\n".implode("\n", $opt)."</select>\n"; ! if(!$shown) ! unset($i_tissue[$lvl]); ! if(isset($i_tissue[$lvl]) && $i_tissue[$lvl]) ! showSelect($i_tissue, $lvl + 1); } Index: sample_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_list.phtml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** sample_list.phtml 30 Sep 2002 08:26:44 -0000 1.19 --- sample_list.phtml 30 Sep 2002 16:57:05 -0000 1.20 *************** *** 125,129 **** { $exts[$eid] = "<a href='extract_edit.phtml?i_ext=$eid'>". ! html($arr["name"]).remMark($arr["removed"])."</a>"; } if(!$s["removed"]) --- 125,129 ---- { $exts[$eid] = "<a href='extract_edit.phtml?i_ext=$eid'>". ! html($arr["name"])."</a>".remMark($arr["removed"]); } if(!$s["removed"]) *************** *** 137,141 **** { $hybs[$hid] = "<a href='hyb_edit.phtml?i_hyb=$hid'>". ! html($arr["name"]).remMark($arr["removed"])."</a>"; } $hybs = implode(", ", $hybs); --- 137,141 ---- { $hybs[$hid] = "<a href='hyb_edit.phtml?i_hyb=$hid'>". ! html($arr["name"])."</a>".remMark($arr["removed"]); } $hybs = implode(", ", $hybs); Index: sampletissue_tree.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampletissue_tree.phtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sampletissue_tree.phtml 30 Sep 2002 08:26:44 -0000 1.10 --- sampletissue_tree.phtml 30 Sep 2002 16:57:05 -0000 1.11 *************** *** 52,55 **** --- 52,56 ---- if(!$tissue->updateRemoved($i_delete == 1)) $err = "Unable to (un)delete sample origin"; + else $showdel = -1; } } *************** *** 59,63 **** $t2 = new SampleTissue(); $t2->setName($i_newchild); ! $t2->setParent($tissue->getId()); $t2->setOwner($curUser->getId()); if(!$t2->write()) --- 60,65 ---- $t2 = new SampleTissue(); $t2->setName($i_newchild); ! if(!isset($i_neworg) || !$i_neworg) ! $t2->setParent($tissue->getId()); $t2->setOwner($curUser->getId()); if(!$t2->write()) *************** *** 92,95 **** --- 94,98 ---- action="sampletissue_tree.phtml?i_t=<?= $tissueid ?>"> <input type=hidden name=i_newchild value=""> + <input type=hidden name=i_neworg value="0"> <script> function addCh(f) *************** *** 104,109 **** { v = prompt("Name the new organism", ""); ! if(v == null) return; f.i_newchild.value=v; f.submit(); } --- 107,114 ---- { v = prompt("Name the new organism", ""); ! if(v == null) ! return; f.i_newchild.value=v; + f.i_neworg.value=1; f.submit(); } Index: upload_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/upload_common.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** upload_common.inc.php 26 Sep 2002 19:35:52 -0000 1.1 --- upload_common.inc.php 30 Sep 2002 16:57:05 -0000 1.2 *************** *** 27,31 **** ! // This function displays a file input/selection thingy. // Use $inputid if you need more than one instance in a form. // Input will be passed in i_file, $i_fileid, $i_filedel, $i_filedescr --- 27,32 ---- ! // This function displays a file input/selection thingy, in the ! // context of a 2-column table. // Use $inputid if you need more than one instance in a form. // Input will be passed in i_file, $i_fileid, $i_filedel, $i_filedescr *************** *** 66,70 **** ?>>Delete after use</td></tr> <tr><th>File description</th> ! <td><input type=text name=i_filedescr<?= $inputid ?> size=30></td></tr> <? } --- 67,71 ---- ?>>Delete after use</td></tr> <tr><th>File description</th> ! <td><input type=text name=i_filedescr<?= $inputid ?> size=50></td></tr> <? } |
From: <tr...@us...> - 2002-09-30 11:25:30
|
Update of /cvsroot/basedb/basedb In directory usw-pr-cvs1:/tmp/cvs-serv21208 Modified Files: README Log Message: Restructured, hopefully for the better Index: README =================================================================== RCS file: /cvsroot/basedb/basedb/README,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** README 9 Sep 2002 10:29:56 -0000 1.9 --- README 30 Sep 2002 11:25:26 -0000 1.10 *************** *** 7,22 **** 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 or later. At the moment of writing, [...251 lines suppressed...] ! necessary changes to the database. --- 148,164 ---- ! Upgrading from an older version of BASE: ! Make a backup of your entire database before you do anything else. The best ! way to do this is probably to shut down MySQL and copy the database ! directories, and then start MySQL again. The easiest way to update the www and exec directories is to just move away the old directory tree and use the new files and configure BASE again (copy ! and edit the example_* files as described above). The only things you need ! to keep are the data directory and the database. As the database schema ! changes once in a while between versions, you'll need to run the script ! dbupdate.php (or dbupdate.pl, provided by Alan Shields for those of you who ! prefer perl), which will do the necessary changes to the database. It can be ! found in exec/migration_tools. |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv2429 Modified Files: bio.inc.php common.inc.php extract_edit.phtml extract_list.phtml htmlinit.phtml hyb_common.inc.php hyb_list.phtml image.inc.php image_get.phtml item.inc.php item_common.inc.php labeled_edit.phtml labeled_list.phtml left.phtml misc.inc.php molecule.inc.php plate_edit.phtml protocol.inc.php sample_edit.phtml sample_list.phtml sampletissue.inc.php sampletissue_tree.phtml test.phtml Added Files: links_common.inc.php Log Message: Many changes large and small --- NEW FILE: links_common.inc.php --- <? // $Id: links_common.inc.php,v 1.1 2002/09/30 08:26:44 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 // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // require_once("item_common.inc.php"); function protocolLink(&$arr) { if(!$arr["protocolRead"]) return html($arr["protocolName"]).remMark($arr["protocolRemoved"]); return "<a ".href("protocol_edit.phtml?i_p=".(int)$arr["protocol"], 2).">". html($arr["protocolName"])."</a>".remMark($arr["protocolRemoved"]); } function protocolIdLink($id, &$user) { $id = (int)$id; $arr = Protocol::getBasicFromId($id); if(!Protocol::isSharedId($id, $user)) return html($arr["name"]).remMark($arr["removed"]); return "<a ".href("protocol_edit.phtml?i_p=$id", 2).">". html($arr["name"]).remMark($arr["removed"])."</a>"; } ?> Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** bio.inc.php 20 Sep 2002 18:25:00 -0000 1.27 --- bio.inc.php 30 Sep 2002 08:26:43 -0000 1.28 *************** *** 407,412 **** $query = "SELECT e.*, ug.name AS `userName`, ". ! Item::whereShared("s", $user)." AS `samplePublic`, ". ! "p.name AS `protocolName`, ". "s.name AS `sampleName`, s.removed AS `sampleRemoved` ". "FROM Extract e, Sample s, UserGroup ug, Protocol p ". --- 407,413 ---- $query = "SELECT e.*, ug.name AS `userName`, ". ! Item::whereShared("s", $user)." AS `sampleRead`, ". ! "p.name AS `protocolName`, p.removed AS `protocolRemoved`, ". ! Item::whereShared("p", $user)." AS `protocolRead`, ". "s.name AS `sampleName`, s.removed AS `sampleRemoved` ". "FROM Extract e, Sample s, UserGroup ug, Protocol p ". *************** *** 630,633 **** --- 631,650 ---- } + // Returns array id->array(name,removed) with all labeled extracts that + // were made from a specific extract and that the owner has access to. + function getBriefForExtract($extract, &$user, $removed = 0) + { + $extract = (int)$extract; + $query = "SELECT i.id, i.name, i.removed ". + "FROM LabeledExtract i WHERE i.extract = $extract ". + "AND ".Item::whereShared("i", $user)." ". + Item::whereRemovedAnd("i", $removed); + $res = query($query); + $arr = array(); + while($row =& db_fetch_assoc($res)) + $arr[$row["id"]] = $row; + return $arr; + } + // Returns array from position to array(id,...,private,label, // quantity,qtyLeft,removed) *************** *** 715,721 **** $query = "SELECT le.*, ug.name AS `userName`, ". ! Item::whereShared("s", $user)." AS `samplePublic`, ". ! Item::whereShared("e", $user)." AS `extractPublic`, ". ! "p.name AS `protocolName`, ". "e.name AS `extractName`, e.removed AS `extractRemoved`, ". "e.sample, s.name AS `sampleName`, s.removed AS `sampleRemoved` ". --- 732,739 ---- $query = "SELECT le.*, ug.name AS `userName`, ". ! Item::whereShared("s", $user)." AS `sampleRead`, ". ! Item::whereShared("e", $user)." AS `extractRead`, ". ! Item::whereShared("p", $user)." AS `protocolRead`, ". ! "p.name AS `protocolName`, p.removed AS `protocolRemoved`, ". "e.name AS `extractName`, e.removed AS `extractRemoved`, ". "e.sample, s.name AS `sampleName`, s.removed AS `sampleRemoved` ". Index: common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/common.inc.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** common.inc.php 16 Sep 2002 14:20:57 -0000 1.20 --- common.inc.php 30 Sep 2002 08:26:43 -0000 1.21 *************** *** 38,42 **** "adminEmail", "uploadDir", "tempDir", "jobDir", "rawFileDir", "rawImageDir", "printMapDir", "execDir", "webDir", "gnuplot", ! "mime.types", "displayCookie", "accessColumns"); foreach($cfgvars as $v) { --- 38,42 ---- "adminEmail", "uploadDir", "tempDir", "jobDir", "rawFileDir", "rawImageDir", "printMapDir", "execDir", "webDir", "gnuplot", ! "mime.types", "displayCookie", "accessColumns", "protocolDir"); foreach($cfgvars as $v) { Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** extract_edit.phtml 22 Sep 2002 23:37:34 -0000 1.18 --- extract_edit.phtml 30 Sep 2002 08:26:43 -0000 1.19 *************** *** 28,31 **** --- 28,32 ---- require_once("bio.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 63,67 **** if(isset($i_name)) $ext->setName($i_name); [...71 lines suppressed...] --- 302,306 ---- { $sname = "<a ".href("sample_edit.phtml?i_samp=$sid", 2).">". ! $sname.remMark($sinfo["removed"])."</a>"; } *************** *** 297,301 **** <tr><th>Name</th><td><?= html($ext->getName()).remMark($ext) ?></td></tr> <tr><th>Sample</th><td><?= $sname ?></td></tr> ! <tr><th>Protocol</th><td><?= html($pname) ?></td></tr> <tr><th>Description</th><td><?= html($ext->getDescr()) ?></td></tr> <tr><th>Extracted quantity (µg)</th><td><?= $ext->getQuantity() ?></td></tr> --- 308,313 ---- <tr><th>Name</th><td><?= html($ext->getName()).remMark($ext) ?></td></tr> <tr><th>Sample</th><td><?= $sname ?></td></tr> ! <tr><th>Protocol</th><td><?= ! protocolIdLink($ext->getProtocol(), $curUser) ?></td></tr> <tr><th>Description</th><td><?= html($ext->getDescr()) ?></td></tr> <tr><th>Extracted quantity (µg)</th><td><?= $ext->getQuantity() ?></td></tr> Index: extract_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_list.phtml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** extract_list.phtml 22 Sep 2002 23:37:34 -0000 1.14 --- extract_list.phtml 30 Sep 2002 08:26:43 -0000 1.15 *************** *** 31,34 **** --- 31,35 ---- require_once("searchhtml.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 80,84 **** $s =& $extracts[$i]; ! if($s["samplePublic"]) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". --- 81,85 ---- $s =& $extracts[$i]; ! if($s["sampleRead"]) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". *************** *** 94,104 **** html($arr["name"]).remMark($arr["removed"])."</a>"; } ! $hybs = implode(" ", $hybs); if($hybs == "") $hybs = html(""); ! $labs = LabeledExtract::countForExtract($s["id"]); ! if(!$s["removed"]) ! $labs .= " <a href='labeled_edit.phtml?i_ext=$s[id]'>[new]</a>"; $qty = isset($s["quantityLeft"]) ? $s["quantityLeft"] : "n/a"; --- 95,114 ---- html($arr["name"]).remMark($arr["removed"])."</a>"; } ! $hybs = implode(", ", $hybs); if($hybs == "") $hybs = html(""); ! $labs = LabeledExtract::getBriefForExtract($s["id"], ! $curUser, showDelSublist()); ! for(reset($labs); list($id, $arr) = each($labs); ) ! { ! $labs[$id] = "<a href='labeled_edit.phtml?i_lab=$id'>". ! html($arr["name"]).remMark($arr["removed"])."</a>"; ! } ! if(!$s["removed"] && acc(BUA_BIO_EDIT)) ! $labs[] = "<a href='labeled_edit.phtml?i_ext=$s[id]'>[new]</a>"; ! $labs = implode(", ", $labs); ! if($labs == "") ! $labs = html(""); $qty = isset($s["quantityLeft"]) ? $s["quantityLeft"] : "n/a"; *************** *** 108,117 **** html($s["name"]).remMark($s["removed"])."</a></td>". "<td>$slink</td>". ! "<td>".html($s["extractionDate"])."</td>". "<td>".html($s["userName"])."</td>". "<td>".groupAccessCheckbox($s["id"])."</td>". "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".html($s["protocolName"])."</td>". "<td>".$qty."</td>". "<td>".$labs."</td>". --- 118,127 ---- html($s["name"]).remMark($s["removed"])."</a></td>". "<td>$slink</td>". ! "<td>".htmldate($s["extractionDate"])."</td>". "<td>".html($s["userName"])."</td>". "<td>".groupAccessCheckbox($s["id"])."</td>". "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolLink($s)."</td>". "<td>".$qty."</td>". "<td>".$labs."</td>". Index: htmlinit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/htmlinit.phtml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** htmlinit.phtml 12 Sep 2002 22:37:56 -0000 1.25 --- htmlinit.phtml 30 Sep 2002 08:26:43 -0000 1.26 *************** *** 45,49 **** $bgColor = "#f0f4f4"; ?> - <meta name=creator content="Typoed by Círdan"> <style type="text/css"> a:active { text-decoration: none; color: #ff5050; } --- 45,48 ---- Index: hyb_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_common.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hyb_common.inc.php 22 Sep 2002 23:37:34 -0000 1.8 --- hyb_common.inc.php 30 Sep 2002 08:26:43 -0000 1.9 *************** *** 83,87 **** html(Protocol::getNameFromId($hyb->getProtocol())) ?></td></tr> <tr><th>Description</th><td><?= html($hyb->getDescr()) ?></td></tr> ! <tr><th>Hybridized</th><td><?= html($hyb->getHybridizationDate()) ?></td></tr> <? dateAndOwnerTable($hyb, $curUser); --- 83,87 ---- html(Protocol::getNameFromId($hyb->getProtocol())) ?></td></tr> <tr><th>Description</th><td><?= html($hyb->getDescr()) ?></td></tr> ! <tr><th>Hybridized</th><td><?= htmldate($hyb->getHybridizationDate()) ?></td></tr> <? dateAndOwnerTable($hyb, $curUser); Index: hyb_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_list.phtml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** hyb_list.phtml 22 Sep 2002 23:37:34 -0000 1.14 --- hyb_list.phtml 30 Sep 2002 08:26:43 -0000 1.15 *************** *** 121,125 **** "<td>".implode(",\n", $llink)."</td>". "<td>".html($s["barcode"])."</td>". ! "<td>".html($s["hybridizationDate"])."</td>". "<td>".html($s["userName"])."</td>". "<td>".groupAccessCheckbox($s["id"])."</td>". --- 121,125 ---- "<td>".implode(",\n", $llink)."</td>". "<td>".html($s["barcode"])."</td>". ! "<td>".htmldate($s["hybridizationDate"])."</td>". "<td>".html($s["userName"])."</td>". "<td>".groupAccessCheckbox($s["id"])."</td>". Index: image.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/image.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** image.inc.php 20 Sep 2002 18:25:01 -0000 1.15 --- image.inc.php 30 Sep 2002 08:26:43 -0000 1.16 *************** *** 27,31 **** require_once("acquisition.inc.php"); ! define("CLEN_IMAGE_NAME", 150); class Image extends Item --- 27,31 ---- require_once("acquisition.inc.php"); ! define("CLEN_IMAGE_NAME", 255); class Image extends Item Index: image_get.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/image_get.phtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** image_get.phtml 5 Aug 2002 11:29:34 -0000 1.3 --- image_get.phtml 30 Sep 2002 08:26:43 -0000 1.4 *************** *** 41,46 **** $err = ""; $img = new Image(); ! if(!isset($i_img)) $err = "No image specified"; ! else if(!$img->read($i_img, $curUser->getId())) $err = "No such image"; --- 41,47 ---- $err = ""; $img = new Image(); ! if(!isset($i_img)) ! $err = "No image specified"; ! else if(!$img->readShared($i_img, $curUser)) $err = "No such image"; Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** item.inc.php 22 Sep 2002 23:37:34 -0000 1.33 --- item.inc.php 30 Sep 2002 08:26:43 -0000 1.34 *************** *** 108,129 **** } - function whereShared($table, &$user, $write = 0) - { - if(!is_object($user)) - { - error_log("Invalid user in Item::whereShared($table, $user, $write)"); - } - $write = $write ? 1 : 0; - $where = "$table.worldAccess > $write ". [...94 lines suppressed...] return ($access !== false || $user->access($access)) ! && $this->owner == $user->getId(); } function mayEdit(&$user, $access = false) { return ($access !== false || $user->access($access)) ! && $this->isShared($user, true) && !$this->removed; } --- 425,434 ---- { return ($access !== false || $user->access($access)) ! && $this->isShared($user, 2); } function mayEdit(&$user, $access = false) { return ($access !== false || $user->access($access)) ! && $this->isShared($user, 1) && !$this->removed; } Index: item_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item_common.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** item_common.inc.php 22 Sep 2002 23:37:35 -0000 1.3 --- item_common.inc.php 30 Sep 2002 08:26:43 -0000 1.4 *************** *** 49,66 **** <tr><th>Date added</th><td><?= htmldate($item->getAddedDate()) ?></td></tr> <? ! if(!$edit || $item->getOwner() != $user->getId()) ! { ! ?> ! <tr><th>Owner</th><td><?= userInfo($item, $void) ?></td></tr> ! <tr><th>Group</th><td><?= groupInfo($item, $void) ?></td></tr> ! <tr><th>World access</th><td><?= worldInfo($item) ?></td></tr> ! <? ! } [...68 lines suppressed...] ! if(isset($i_delete) && $i_delete) { $err = ""; $undel = $i_delete == 2; $act = $undel ? "undelete" : "delete"; ! if(!$user->access($access)) ! $err = "Can't $act ".$item->getType().": access denied ($access)"; ! else if($sharing && !$item->mayDelete($user)) $err = "Can't $act someone else's ".$item->getType(); else if($item->getRemoved() && !$undel) *************** *** 320,324 **** --- 335,341 ---- if($err == "") redirect($GLOBALS["location"]); + return $err; } + return ""; } Index: labeled_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_edit.phtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** labeled_edit.phtml 22 Sep 2002 23:37:35 -0000 1.17 --- labeled_edit.phtml 30 Sep 2002 08:26:43 -0000 1.18 *************** *** 327,331 **** html($lext->getQuantity()) ?></td></tr> <tr><th>Quantity left</th><td><?= $lext->getQuantityLeft() ?></td></tr> ! <tr><th>Labeled</th><td><?= html($lext->getLabelingDate()) ?></td></tr> <? dateAndOwnerTable($lext, $curUser); --- 327,331 ---- html($lext->getQuantity()) ?></td></tr> <tr><th>Quantity left</th><td><?= $lext->getQuantityLeft() ?></td></tr> ! <tr><th>Labeled</th><td><?= htmldate($lext->getLabelingDate()) ?></td></tr> <? dateAndOwnerTable($lext, $curUser); Index: labeled_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_list.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** labeled_list.phtml 22 Sep 2002 23:37:35 -0000 1.15 --- labeled_list.phtml 30 Sep 2002 08:26:44 -0000 1.16 *************** *** 31,34 **** --- 31,35 ---- require_once("searchhtml.inc.php"); require_once("item_common.inc.php"); + require_once("links_common.inc.php"); verifyAccess(BUA_BIO_READ); *************** *** 84,88 **** $s =& $lexts[$i]; ! if($s["samplePublic"]) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". --- 85,89 ---- $s =& $lexts[$i]; ! if($s["sampleRead"]) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". *************** *** 91,95 **** else $slink = html($s["sampleName"]); ! if($s["extractPublic"]) { $elink = "<a href='extract_edit.phtml?i_ext=$s[extract]'>". --- 92,96 ---- else $slink = html($s["sampleName"]); ! if($s["extractRead"]) { $elink = "<a href='extract_edit.phtml?i_ext=$s[extract]'>". *************** *** 122,126 **** "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".html($s["protocolName"])."</td>". "<td>".$qty."</td>". "<td>".$hybs."</td></tr>\n"; --- 123,127 ---- "<td>".groupInfo($s, $users)."</td>". "<td>".worldInfo($s)."</td>". ! "<td>".protocolLink($s)."</td>". "<td>".$qty."</td>". "<td>".$hybs."</td></tr>\n"; Index: left.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/left.phtml,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** left.phtml 16 Sep 2002 14:20:57 -0000 1.47 --- left.phtml 30 Sep 2002 08:26:44 -0000 1.48 *************** *** 117,120 **** --- 117,121 ---- <span class=special><?= html($curUser->getName()) ?></span> [<a target=_top href="index.phtml?i_logout=1">Log out</a>]<br> + <?= acc(BUA_SUPERUSER) ? "<span class=special>Superuser</span><br>" : "" ?> Users online: <?= $loggedin ?></td></tr> <tr><td class=tiny><img src="img/1.gif" alt="" width=1 height=1></td></tr> Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** misc.inc.php 12 Sep 2002 22:37:56 -0000 1.38 --- misc.inc.php 30 Sep 2002 08:26:44 -0000 1.39 *************** *** 185,189 **** // Generates a file name which is bloody well near unique ! function tempFileName() { global $config; --- 185,189 ---- // Generates a file name which is bloody well near unique ! function tempFilename() { global $config; Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** molecule.inc.php 12 Sep 2002 13:53:29 -0000 1.33 --- molecule.inc.php 30 Sep 2002 08:26:44 -0000 1.34 *************** *** 261,268 **** --- 261,274 ---- function setSpecies($val) { + $p = strpos($val, "."); + if($p !== false) + $val = substr($val, 0, $p); $this->species = maxlen($val, CLEN_MOLECULE_SPECIES); } function setClusterId($val) { + $p = strpos($val, "."); + if($p !== false) + $val = substr($val, $p + 1); $this->clusterId = (int)$val; } Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** plate_edit.phtml 22 Sep 2002 23:37:35 -0000 1.30 --- plate_edit.phtml 30 Sep 2002 08:26:44 -0000 1.31 *************** *** 36,85 **** setLocation("plate_list.phtml"); ! $edit = true; $clone = 0; $err = ""; - if(isset($i_act)) - { - // Deal with input from delete of validation input row - if(is_array($i_act)) - { [...154 lines suppressed...] *************** *** 201,207 **** $i_edit = 1; } ! else if(!isset($i_p)) $err = "You must specify a plate id"; ! else if(!$plate->read($i_p)) $err = "No such plate"; ! else $ptype->read($plate->getPlateType()); $edit = isset($i_edit); $eventTypes = $ptype->getEventTypes(); --- 232,241 ---- $i_edit = 1; } ! else if(!isset($i_p)) ! $err = "You must specify a plate id"; ! else if(!$plate->read($i_p)) ! $err = "No such plate"; ! else ! $ptype->read($plate->getPlateType()); $edit = isset($i_edit); $eventTypes = $ptype->getEventTypes(); Index: protocol.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** protocol.inc.php 26 Sep 2002 19:35:05 -0000 1.11 --- protocol.inc.php 30 Sep 2002 08:26:44 -0000 1.12 *************** *** 143,147 **** $search->addExtraWhere(Item::whereShared("p", $user)); if($typeid) ! $search->addExtraWhere("p.protocolType = $typeid"); $query = "SELECT COUNT(*) FROM Protocol p, UserGroup ug ". --- 143,147 ---- $search->addExtraWhere(Item::whereShared("p", $user)); if($typeid) ! $search->addExtraWhere("p.`protocolType` = $typeid"); $query = "SELECT COUNT(*) FROM Protocol p, UserGroup ug ". *************** *** 168,172 **** $query = "SELECT p.*, ug.name AS `userName`, pt.name AS `typeName` ". "FROM Protocol p, UserGroup ug, ProtocolType pt ". ! "WHERE ug.id = p.owner AND pt.id = p.protocolType ". $search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); --- 168,172 ---- $query = "SELECT p.*, ug.name AS `userName`, pt.name AS `typeName` ". "FROM Protocol p, UserGroup ug, ProtocolType pt ". ! "WHERE ug.id = p.owner AND pt.id = p.`protocolType` ". $search->getWhere()." ".$search->getExtraWhere(). " $ob ".$search->makeLimit(); *************** *** 184,194 **** $query = "SELECT p.id, p.name, p.removed ". "FROM Protocol p ". ! "WHERE p.etype = ".(int)$typeid." ". "AND ".Item::whereShared("p", $user)." ". ! Item::whereRemovedAnd("p", $removed); $res = query($query); $arr = array(); while($row =& db_fetch_assoc($res)) ! $arr[$row[0]] = $row; return $arr; } --- 184,195 ---- $query = "SELECT p.id, p.name, p.removed ". "FROM Protocol p ". ! "WHERE p.`protocolType` = ".(int)$typeid." ". "AND ".Item::whereShared("p", $user)." ". ! Item::whereRemovedAnd("p", $removed)." ". ! "ORDER BY name"; $res = query($query); $arr = array(); while($row =& db_fetch_assoc($res)) ! $arr[$row["id"]] = $row; return $arr; } *************** *** 259,263 **** $id = (int)$id; $query = "SELECT 1 FROM Protocol p, ProtocolType pt ". ! "WHERE p.id = $id AND pt.id = p.protocolType ". "AND pt.name = '".addslashes($typename)."' ". "AND ".Item::whereShared("p", $user, $write); --- 260,264 ---- $id = (int)$id; $query = "SELECT 1 FROM Protocol p, ProtocolType pt ". ! "WHERE p.id = $id AND pt.id = p.`protocolType` ". "AND pt.name = '".addslashes($typename)."' ". "AND ".Item::whereShared("p", $user, $write); Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** sample_edit.phtml 22 Sep 2002 23:37:35 -0000 1.22 --- sample_edit.phtml 30 Sep 2002 08:26:44 -0000 1.23 *************** *** 25,29 **** // require_once("init.inc.php"); - require_once("protocol.inc.php"); require_once("bio.inc.php"); require_once("sampletissue.inc.php"); --- 25,28 ---- *************** *** 48,52 **** { if(!isset($i_tissue)) ! $i_tissue = SampleTissue::getAncestors($samp->getTissue()); $edit = isset($i_edit) && $i_edit && $samp->isShared($curUser, true); --- 47,51 ---- { if(!isset($i_tissue)) ! $i_tissue = SampleTissue::getAncestorsOf($samp->getTissue()); $edit = isset($i_edit) && $i_edit && $samp->isShared($curUser, true); *************** *** 153,157 **** value="<?= html($samp->getName(), 0) ?>"></td></tr> <? ! $tarr = SampleTissue::getChildren(0); echo "<tr><th><a target=_blank ". "href='http://www.ncbi.nlm.nih.gov/Taxonomy'>Organism</a></th>". --- 152,156 ---- value="<?= html($samp->getName(), 0) ?>"></td></tr> <? ! $tarr = SampleTissue::getChildrenOf(0); echo "<tr><th><a target=_blank ". "href='http://www.ncbi.nlm.nih.gov/Taxonomy'>Organism</a></th>". *************** *** 169,174 **** if(isset($i_tissue[0]) && $i_tissue[0]) { ! $tarr = SampleTissue::getChildren($i_tissue[0]); ! $tarr[] = new SampleTissue(0, "Other"); $anc = isset($i_tissue[1]) ? $i_tissue[1] : 0; for($i = 0; $i < count($tarr); $i++) --- 168,175 ---- if(isset($i_tissue[0]) && $i_tissue[0]) { ! $tarr = SampleTissue::getChildrenOf($i_tissue[0]); ! $t = new SampleTissue(); ! $t->setName("Other"); ! $tarr[] = $t; $anc = isset($i_tissue[1]) ? $i_tissue[1] : 0; for($i = 0; $i < count($tarr); $i++) *************** *** 242,246 **** } ! $tnames = SampleTissue::getAncestorNames($samp->getTissue()); if(!count($tnames)) $tnames = "None"; --- 243,247 ---- } ! $tnames = SampleTissue::getAncestorNamesOf($samp->getTissue()); if(!count($tnames)) $tnames = "None"; *************** *** 286,290 **** { if(!isset($i_tissue[$lvl - 1]) || !$i_tissue[$lvl - 1]) return; ! $tarr = SampleTissue::getChildren($i_tissue[$lvl - 1]); if(!count($tarr)) return; echo "<select name='i_tissue[$lvl]' onChange='this.form.submit()'>". --- 287,291 ---- { if(!isset($i_tissue[$lvl - 1]) || !$i_tissue[$lvl - 1]) return; ! $tarr = SampleTissue::getChildrenOf($i_tissue[$lvl - 1]); if(!count($tarr)) return; echo "<select name='i_tissue[$lvl]' onChange='this.form.submit()'>". Index: sample_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_list.phtml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** sample_list.phtml 22 Sep 2002 23:37:35 -0000 1.18 --- sample_list.phtml 30 Sep 2002 08:26:44 -0000 1.19 *************** *** 25,29 **** // require_once("init.inc.php"); - require_once("protocol.inc.php"); require_once("bio.inc.php"); require_once("hyb.inc.php"); --- 25,28 ---- *************** *** 81,85 **** "sample", $searchfields, $searchtypes, 2, "", true); ! Sample::prepareSearch($search, $curUser, 30, showDelValue()); groupAccessScripts(); --- 80,84 ---- "sample", $searchfields, $searchtypes, 2, "", true); ! Sample::prepareSearch($search, $curUser, 20, showDelValue()); groupAccessScripts(); *************** *** 117,121 **** $id = $s["id"]; ! $tnames = SampleTissue::getAncestorNames($s["tissue"]); if(!count($tnames)) $tnames = "None"; else $tnames = implode(", ", $tnames); --- 116,120 ---- $id = $s["id"]; ! $tnames = SampleTissue::getAncestorNamesOf($s["tissue"]); if(!count($tnames)) $tnames = "None"; else $tnames = implode(", ", $tnames); Index: sampletissue.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampletissue.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sampletissue.inc.php 10 Sep 2002 23:06:30 -0000 1.9 --- sampletissue.inc.php 30 Sep 2002 08:26:44 -0000 1.10 *************** *** 24,89 **** // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ! require_once("db.inc.php"); define("CLEN_SAMPLETISSUE_NAME", 40); ! class SampleTissue { ! var $id, $parent, $name; [...240 lines suppressed...] ! function hasChildren() { ! $query = "SELECT COUNT(*) FROM SampleTissue WHERE parent = $this->id"; $res = query($query); ! if($row =& db_fetch_row($res)) return (bool)$row[0]; return false; } --- 152,163 ---- } ! function hasChildren($removed = 0) { ! $query = "SELECT COUNT(*) FROM SampleTissue st ". ! "WHERE st.parent = $this->id ". ! Item::whereRemovedAnd("st", $removed); $res = query($query); ! if($row =& db_fetch_row($res)) ! return $row[0] > 0; return false; } Index: sampletissue_tree.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampletissue_tree.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sampletissue_tree.phtml 10 Sep 2002 23:06:30 -0000 1.9 --- sampletissue_tree.phtml 30 Sep 2002 08:26:44 -0000 1.10 *************** *** 26,32 **** require_once("init.inc.php"); require_once("sampletissue.inc.php"); verifyAccess(BUA_BIO_TISSUE); ! setLocation("sampletissue_tree.phtml"); $err = ""; --- 26,35 ---- require_once("init.inc.php"); require_once("sampletissue.inc.php"); [...275 lines suppressed...] ! <tr><td><input type=button value="Add new organism" onClick="addOrg(this.form)" ! ></td></tr> ! </form> ! </table> ! </body> ! </html> --- 198,209 ---- $w = $cl * 20 + 150; echo "<td colspan=$cl width=$w>". ! "<a href='javascript:setTissue($id)' $class>". ! html($tiss[$i]["name"])."</a>".remMark($tiss[$i]["removed"]). ! "</td></tr>\n"; ! if($recHere) ! tissTree($ancs, $lv+1, $newtiss, $extralv, $islast); } } ! ?> \ No newline at end of file Index: test.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/test.phtml,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** test.phtml 16 Sep 2002 14:20:57 -0000 1.49 --- test.phtml 30 Sep 2002 08:26:44 -0000 1.50 *************** *** 26,29 **** --- 26,31 ---- header("content-type: text/plain"); + print_r($GLOBALS); + function foo($s1, $s2) { |
From: <tr...@us...> - 2002-09-26 19:36:51
|
Update of /cvsroot/basedb/basedb In directory usw-pr-cvs1:/tmp/cvs-serv24016 Modified Files: example_config.inc.php Log Message: Added protocolDir Index: example_config.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/example_config.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** example_config.inc.php 8 Sep 2002 13:19:00 -0000 1.5 --- example_config.inc.php 26 Sep 2002 19:36:47 -0000 1.6 *************** *** 46,49 **** --- 46,51 ---- // multiple installations of BASE on a single machine). $config["cookieName"] = "session"; + // The persistent cookie for display settings + $config["displayCookie"] = "display"; // You don't need a trailing slash on any of the paths here. *************** *** 73,76 **** --- 75,80 ---- // Where the print map files are copied to $config["printMapDir"] = $config["dataDir"]."/printmaps"; + // Where the protocol files are copied to + $config["protocolDir"] = $config["dataDir"]."/protocols"; // Where we can find external executables belonging to BASE. *************** *** 85,88 **** --- 89,101 ---- $config["gnuplot"] = "gnuplot"; $config["mime.types"] = "/usr/local/apache/conf/mime.types"; + + // The access system uses a set of columns called readAccessN where + // N is in (1, ..., $config[accessColumns]). These columns exist + // in tables representing all sharable subclasses of Item. + // The maximum number of users+groups is this number times 64. + // Note that to alter this value you need to create the required + // columns in the database first. In the future there will be a + // script for doing this. + $config["accessColumns"] = 2; require_once("$config[webDir]/common.inc.php"); |
From: <tr...@us...> - 2002-09-26 19:35:55
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv23731 Modified Files: upload.inc.php upload_list.phtml Added Files: upload_common.inc.php Log Message: Moved handleUpload and related things to upload_common.inc.php --- NEW FILE: upload_common.inc.php --- <? // $Id: upload_common.inc.php,v 1.1 2002/09/26 19:35:52 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 [...108 lines suppressed...] "$f[tmp_name] to $fname"; } else @unlink($f["tmp_name"]); if($err != "") { error_log("Upload failed: $err"); @unlink($f["tmp_name"]); $upload->updateRemoved(true); } ignore_user_abort($iua); $GLOBALS["i_fileid"] = $upload->getId(); return $err; } ?> Index: upload.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/upload.inc.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** upload.inc.php 22 Sep 2002 23:37:35 -0000 1.22 --- upload.inc.php 26 Sep 2002 19:35:52 -0000 1.23 *************** *** 26,30 **** require_once("item.inc.php"); ! define("CLEN_UPLOAD_NAME", 60); define("CLEN_UPLOAD_MIMETYPE", 255); --- 26,30 ---- require_once("item.inc.php"); ! define("CLEN_UPLOAD_NAME", 255); define("CLEN_UPLOAD_MIMETYPE", 255); [...85 lines suppressed...] ! if(!file_exists($dir)) ! if(!$createDir || !mkdir($dir, 0700)) return false; ! return $dir."/".$this->id; } *************** *** 184,189 **** { // Add more fields and operators here ! $fields = array("up.name", "up.`fileSize`", "up.`addedDate`", "up.descr", ! "ug.name"); $search->makeWhere($fields); --- 127,132 ---- { // Add more fields and operators here ! $fields = array("up.name", "up.`fileSize`", "up.`addedDate`", ! "up.descr", "ug.name"); $search->makeWhere($fields); Index: upload_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/upload_list.phtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** upload_list.phtml 22 Sep 2002 23:37:35 -0000 1.4 --- upload_list.phtml 26 Sep 2002 19:35:52 -0000 1.5 *************** *** 29,32 **** --- 29,33 ---- require_once("searchhtml.inc.php"); require_once("item_common.inc.php"); + require_once("upload_common.inc.php"); verifyAccess(BUA_NONE); *************** *** 40,45 **** $up = new Upload(); ! $err = $up->handleUpload($curUser, "i_file", false, ! isset($i_descr) ? $i_descr : ""); $others = isset($i_others) && $i_others ? 1 : 0; --- 41,45 ---- $up = new Upload(); ! $err = handleUpload($up, $curUser); $others = isset($i_others) && $i_others ? 1 : 0; *************** *** 52,70 **** ?> <table <?= $cellpad ?>> ! <tr><th colspan=3 class=pagehead><?= $pageName ?> <?= webHelp(80, 1) ?></th></tr> <? ! if($err) ! echo "<tr><td colspan=3 class=red>Error: $err</td></tr>\n"; ?> ! <tr><td class=tiny colspan=3> </td></tr> <form method=post enctype="multipart/form-data" action="upload_list.phtml?i_others=<?= $others ?>"> ! <tr><th colspan=3>Upload new file</th></tr> ! <tr><th>Select a file</th><td><input type=file name=i_file></td> ! <td><input type=submit value="Upload it"></td></tr> ! <tr><th>Description</th><td colspan=2><input type=text ! name=i_descr size=30></td></tr> </form> --- 52,70 ---- ?> <table <?= $cellpad ?>> ! <tr><th colspan=2 class=pagehead><?= $pageName ?> <?= webHelp(80, 1) ?></th></tr> <? ! if($err != "") ! echo "<tr><td colspan=2 class=red>Error: $err</td></tr>\n"; ?> ! <tr><td class=tiny colspan=2> </td></tr> <form method=post enctype="multipart/form-data" action="upload_list.phtml?i_others=<?= $others ?>"> ! <tr><th colspan=2>Upload new file</th></tr> ! <tr><th>Select a file</th><td><input type=file name=i_file> ! <input type=submit value="Upload it"></td></tr> ! <tr><th>Description</th><td><input type=text ! name=i_filedescr size=30></td></tr> </form> |
From: <tr...@us...> - 2002-09-26 19:35:09
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv23344 Modified Files: protocol.inc.php protocol_edit.phtml protocol_list.phtml Added Files: protocol_getfile.phtml Log Message: Made protocol a subclass of Item --- NEW FILE: protocol_getfile.phtml --- <? // $Id: protocol_getfile.phtml,v 1.1 2002/09/26 19:35:05 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 // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // require_once("init.inc.php"); require_once("protocol.inc.php"); require_once("misc.inc.php"); require_once("mime.inc.php"); verifyAccess(BUA_NONE); setLocation("protocol_list.phtml"); if(isset($_SERVER["PATH_INFO"]) && $_SERVER["PATH_INFO"] != "") { $arr = explode("/", $_SERVER["PATH_INFO"]); if(isset($arr[1])) $i_p = $arr[1]; if(isset($arr[2])) $i_dl = (bool)$arr[2]; } $err = ""; $proto = new Protocol(); if(!isset($i_p)) $err = "No protocol specified"; else if(!$proto->readShared($i_p, $curUser)) $err = "No such protocol"; if($err == "") { if(isset($i_dl) && $i_dl) header("Content-type: ".downloadMime()); else header("Content-type: ".mimeFromName($proto->getFilename())); if(readfile($proto->getRepositoryFilename()) === false) { $err = "Error reading file"; header("Content-type: text/html"); } } if($err != "") { $pageTitle="$config[codename] - Protocol file error"; include("htmlinit.phtml"); ?> <table <?= $cellpad ?>> <tr><th class=pagehead>Protocol file error</th></tr> <tr><td class=large><a href="<?= html($location, 0) ?>">Return</a></td></tr> <tr><td class=red>Error: <?= $err ?></td></tr> </table> </body> </html> <? } ?> Index: protocol.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** protocol.inc.php 10 Sep 2002 23:06:27 -0000 1.10 --- protocol.inc.php 26 Sep 2002 19:35:05 -0000 1.11 *************** *** 24,123 **** // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ! require_once("db.inc.php"); ! require_once("upload.inc.php"); ! ! define("CLEN_PROTOCOL_NAME", 30); ! class Protocol { [...459 lines suppressed...] + } + + function isSharedId($id, &$user, $write = 0) + { + return parent::isSharedId("Protocol", $id, $user, $write); + } + + function isSharedAndType($id, &$user, $typename, $write = 0) + { + $id = (int)$id; $query = "SELECT 1 FROM Protocol p, ProtocolType pt ". ! "WHERE p.id = $id AND pt.id = p.protocolType ". ! "AND pt.name = '".addslashes($typename)."' ". ! "AND ".Item::whereShared("p", $user, $write); $res = query($query); ! return db_num_rows($res) > 0; } + } Index: protocol_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_edit.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** protocol_edit.phtml 10 Sep 2002 23:06:27 -0000 1.9 --- protocol_edit.phtml 26 Sep 2002 19:35:05 -0000 1.10 *************** *** 27,99 **** require_once("protocol.inc.php"); require_once("upload.inc.php"); ! verifyAccess(BUA_PROTOCOL_EDIT); setLocation("protocol_list.phtml"); $up = new Upload(); ! $err = $up->handleUpload("i_file", "i_fileid", ! isset($i_fdescr) ? $i_fdescr : ""); ! $fileid = $up->getId(); [...306 lines suppressed...] + ?> + <tr><th>Attached file</th><td><?= html(NULL) ?></td></tr> + <? + } + else + { + ?> + <tr><th>Attached file</th><td><?= html($fn) ?> (<?= + readableBytes($proto->getFileSize()) ?>) + [<a href="protocol_getfile.phtml/<?= $protoid ?>/1/<?= + urlencode($fn) ?>">Download</a> + / <a href="protocol_getfile.phtml/<?= $protoid ?>/0/<?= + urlencode($fn) ?>">View</a>]</td></tr> + <? + } + dateAndOwnerTable($proto, $curUser); } ?> </table> Index: protocol_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_list.phtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** protocol_list.phtml 29 Aug 2002 16:51:34 -0000 1.10 --- protocol_list.phtml 26 Sep 2002 19:35:05 -0000 1.11 *************** *** 27,123 **** require_once("protocol.inc.php"); require_once("upload.inc.php"); ! $pageTitle="$config[codename] - Protocols"; ! require_once("htmlinit.phtml"); verifyAccess(BUA_NONE); ! setLocation("protocol_list.phtml"); ! if(!isset($i_type)) $i_type = ""; ! $types = Protocol::getTypes(); [...192 lines suppressed...] + "<td>".groupInfo($s, $users)."</td>". + "<td>".worldInfo($s)."</td>". + "<td>".$flink."</td>". + "<td>".(isset($s["filename"]) ? + readableBytes($s["fileSize"]) : html(""))."</td>". + "</tr>\n"; } ! $cols = count($headerfields); ! if($addlink != "") ! echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! ! groupAccessFooter($cols, $curUser); ! showDelLinks($cols); ?> + </form> </table> </body> </html> + |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv26839 Modified Files: extract_edit.phtml extract_list.phtml hyb_common.inc.php hyb_edit.phtml hyb_image.phtml hyb_list.phtml hyb_result.phtml item.inc.php item_common.inc.php labeled_edit.phtml labeled_list.phtml plate.inc.php plate_edit.phtml plate_list.phtml platetype_edit.phtml platetype_list.phtml sample_edit.phtml sample_list.phtml sampleannot_edit.phtml sampleannot_list.phtml sampleannotation.inc.php upload.inc.php upload_list.phtml user.inc.php ware_edit.phtml ware_list.phtml Added Files: platetype.inc.php Log Message: Changed/rewrote to match new Item/item_common functionality --- NEW FILE: platetype.inc.php --- <? // $Id: platetype.inc.php,v 1.1 2002/09/22 23:37:35 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 [...319 lines suppressed...] $arr = array(); $res = query($query); while($row =& db_fetch_assoc($res)) $arr[] = $row; return $arr; } function getPlateCount() { $query = "SELECT COUNT(*) FROM Plate ". "WHERE `plateType` = $this->id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; return -1; } } ?> Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** extract_edit.phtml 20 Sep 2002 18:25:00 -0000 1.17 --- extract_edit.phtml 22 Sep 2002 23:37:34 -0000 1.18 *************** *** 44,48 **** } else $edit = isset($i_edit) && $i_edit && ! $ext->isShared($curUser, true); } else if(isset($i_samp)) --- 44,48 ---- } else $edit = isset($i_edit) && $i_edit && ! $ext->mayEdit($curUser); } else if(isset($i_samp)) *************** *** 260,264 **** else { ! if($ext->getOwner() == $curUser->getId() && acc(BUA_BIO_EDIT)) { if($ext->getRemoved()) --- 260,264 ---- else { ! if($ext->mayDelete($curUser, BUA_BIO_EDIT)) { if($ext->getRemoved()) *************** *** 277,281 **** } } ! if($ext->isShared($curUser, true) && acc(BUA_BIO_EDIT)) { echo "<tr><td colspan=2><a ". --- 277,281 ---- } } ! if($ext->mayEdit($curUser, BUA_BIO_EDIT)) { echo "<tr><td colspan=2><a ". Index: extract_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_list.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** extract_list.phtml 20 Sep 2002 18:25:00 -0000 1.13 --- extract_list.phtml 22 Sep 2002 23:37:34 -0000 1.14 *************** *** 37,41 **** // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("Extract", $users, $curUser); $searchfields = array("Name", "Description", "Sample", "Owner", --- 37,41 ---- // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("Extract", $curUser); $searchfields = array("Name", "Description", "Sample", "Owner", *************** *** 80,84 **** $s =& $extracts[$i]; ! if(isset($s["samplePublic"])) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". --- 80,84 ---- $s =& $extracts[$i]; ! if($s["samplePublic"]) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". *************** *** 118,126 **** "<td>".$hybs."</td></tr>\n"; } ! $cols = 11; if($addlink != "") echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); ?> --- 118,126 ---- "<td>".$hybs."</td></tr>\n"; } ! $cols = count($headerfields); if($addlink != "") echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $curUser); showDelLinks($cols); ?> Index: hyb_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_common.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** hyb_common.inc.php 20 Sep 2002 18:25:00 -0000 1.7 --- hyb_common.inc.php 22 Sep 2002 23:37:34 -0000 1.8 *************** *** 74,78 **** $link = html($l["name"]); echo "<tr><th>Labeled extract</th>". ! "<td>$link (".html($l["label"]).", $l[quantity] µg)</td></tr>"; } --- 74,79 ---- $link = html($l["name"]); echo "<tr><th>Labeled extract</th>". ! "<td>$link (".html($l["label"]).", $l[quantity] µg)". ! remMark($l["removed"])."</td></tr>"; } Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** hyb_edit.phtml 20 Sep 2002 18:25:00 -0000 1.33 --- hyb_edit.phtml 22 Sep 2002 23:37:34 -0000 1.34 *************** *** 44,48 **** // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("ImageAcquisition", $users, $curUser); $err = ""; --- 44,48 ---- // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("ImageAcquisition", $curUser); $err = ""; *************** *** 396,413 **** else { ! if($hyb->getOwner() == $curUser->getId() && acc(BUA_BIO_EDIT)) { ! ?> ! <tr><td colspan=2><a <?= href("hyb_edit.phtml?i_hyb=$hybid&i_delete=1", 1) ! ?> onClick="return confirm('Really delete this hybridization?')" ! >Delete hybridization</a></td></tr> ! <? } ! if($hyb->isShared($curUser, true) && acc(BUA_BIO_EDIT)) { ! ?> ! <tr><td colspan=2><a <?= href("hyb_edit.phtml?i_hyb=$hybid&i_edit=1", 1) ! ?>>Edit hybridization</a></td></tr> ! <? } hybInfo($hyb); --- 396,421 ---- else { ! if($hyb->mayDelete($curUser, BUA_BIO_EDIT)) { ! if($hyb->getRemoved()) ! { ! echo "<tr><td colspan=2><a onClick=\"return ". ! "confirm('Really undelete this hybridization?')\" ". ! href("hyb_edit.phtml?i_hyb=$hybid&i_delete=2", 1). ! ">Undelete hybridization</a></td></tr>\n"; ! } ! else ! { ! echo "<tr><td colspan=2><a onClick=\"return ". ! "confirm('Really delete this hybridization?')\" ". ! href("hyb_edit.phtml?i_hyb=$hybid&i_delete=1", 1). ! ">Delete hybridization</a></td></tr>\n"; ! } } ! if($hyb->mayEdit($curUser, BUA_BIO_EDIT)) { ! echo "<tr><td colspan=2><a ". ! href("hyb_edit.phtml?i_hyb=$hybid&i_edit=1", 1). ! ">Edit hybridization</a></td></tr>\n"; } hybInfo($hyb); *************** *** 489,493 **** echo "<tr><td colspan=$cols>$addscan</td></tr>\n"; ! groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); echo "</table>\n"; --- 497,501 ---- echo "<tr><td colspan=$cols>$addscan</td></tr>\n"; ! groupAccessFooter($cols, $curUser); showDelLinks($cols); echo "</table>\n"; Index: hyb_image.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_image.phtml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** hyb_image.phtml 20 Sep 2002 18:25:01 -0000 1.24 --- hyb_image.phtml 22 Sep 2002 23:37:34 -0000 1.25 *************** *** 330,339 **** else { ! if($acq->getOwner() == $userid && acc(BUA_BIO_EDIT)) { ! echo "<tr><td colspan=2><a ". ! href("hyb_image.phtml?i_acq=$acqid&i_delete=1", 1). ! " onClick=\"return confirm('Really delete this image set?')\"". ! ">Delete image set</a></td></tr>\n"; } if($acq->isShared($curUser, true) && acc(BUA_BIO_EDIT)) --- 330,349 ---- else { ! if($acq->mayDelete($curUser, BUA_BIO_EDIT)) { ! if($acq->getRemoved()) ! { ! echo "<tr><td colspan=2><a onClick=\"return ". ! "confirm('Really undelete this image set?')\" ". ! href("hyb_image.phtml?i_acq=$acqid&i_delete=2", 1). ! ">Undelete image set</a></td></tr>\n"; ! } ! else ! { ! echo "<tr><td colspan=2><a onClick=\"return ". ! "confirm('Really delete this image set?')\" ". ! href("hyb_image.phtml?i_acq=$acqid&i_delete=1", 1). ! ">Delete image set</a></td></tr>\n"; ! } } if($acq->isShared($curUser, true) && acc(BUA_BIO_EDIT)) *************** *** 449,453 **** unset($a); $cols = 7; ! if(!$edit && $acq->isShared($curUser, true) && acc(BUA_BIO_EDIT)) { echo "<tr><td colspan=$cols class=large><a ". --- 459,463 ---- unset($a); $cols = 7; ! if(!$edit && $acq->mayEdit($curUser, BUA_BIO_EDIT)) { echo "<tr><td colspan=$cols class=large><a ". Index: hyb_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_list.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hyb_list.phtml 20 Sep 2002 18:25:01 -0000 1.13 --- hyb_list.phtml 22 Sep 2002 23:37:34 -0000 1.14 *************** *** 37,46 **** // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("Hybridization", $users, $curUser); $searchfields = array("Name", "Description", "Owner", "Date added", "Hybridization date", "Protocol"); $fieldtype = array(0, 0, 0, 1, 1, 0); ! $headerfields = array("Hybridization", "Labeled extracts", "Array", "Hyb date", "Owner", "[<a href=javascript:selAll(1)>A</a> ". --- 37,46 ---- // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("Hybridization", $curUser); $searchfields = array("Name", "Description", "Owner", "Date added", "Hybridization date", "Protocol"); $fieldtype = array(0, 0, 0, 1, 1, 0); ! $headerfields = array("Name", "Labeled extracts", "Array", "Hyb date", "Owner", "[<a href=javascript:selAll(1)>A</a> ". *************** *** 117,121 **** echo "<tr bgcolor=$tdbg[$odd]>". ! "<td><a href='hyb_edit.phtml?i_hyb=$s[id]'>".html($s["name"])."</a></td>". "<td>".implode(",\n", $llink)."</td>". "<td>".html($s["barcode"])."</td>". --- 117,122 ---- echo "<tr bgcolor=$tdbg[$odd]>". ! "<td><a href='hyb_edit.phtml?i_hyb=$s[id]'>".html($s["name"]). ! "</a>".remMark($s["removed"])."</td>". "<td>".implode(",\n", $llink)."</td>". "<td>".html($s["barcode"])."</td>". *************** *** 135,139 **** echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); ?> --- 136,140 ---- echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $curUser); showDelLinks($cols); ?> Index: hyb_result.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_result.phtml,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** hyb_result.phtml 10 Sep 2002 23:05:26 -0000 1.54 --- hyb_result.phtml 22 Sep 2002 23:37:34 -0000 1.55 *************** *** 35,38 **** --- 35,39 ---- require_once("upload.inc.php"); require_once("wizzzard.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_BIO_EDIT); *************** *** 49,54 **** if(!isset($i_acq)) $err = "No image acquisition id specified (i_acq)"; [...297 lines suppressed...] ! <tr><td colspan=2 class=large><?= returnLink($ispopup) ?></th></tr> <? ! if($err != "") ! echo "<tr><td class=red colspan=2>$err</td></tr>\n"; ?> <form method=post action="hyb_result.phtml?i_acq=<?= $acq->getId() ?>" *************** *** 583,587 **** $ch2 = 0; } ! else return "Bad number of labeled extracts - 1 or 2 needed"; $wiz = new Wizzzard(); --- 604,609 ---- $ch2 = 0; } ! else ! return "Bad number of labeled extracts - 1 or 2 needed"; $wiz = new Wizzzard(); Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** item.inc.php 20 Sep 2002 18:25:01 -0000 1.32 --- item.inc.php 22 Sep 2002 23:37:34 -0000 1.33 *************** *** 65,68 **** --- 65,85 ---- } + function readItem(&$row) + { + $this->id = (int)$row["id"]; + $this->owner = (int)$row["owner"]; + $this->name = $row["name"]; + $this->addedDate = $row["addedDate"]; + $this->descr = $row["descr"]; [...87 lines suppressed...] function updateGid($gid) --- 377,380 ---- *************** *** 419,422 **** --- 410,424 ---- return Item::updateColumn($type, $id, "worldAccess", max(0, min(1, (int)$acc))); + } + + function mayDelete(&$user, $access = false) + { + return ($access !== false || $user->access($access)) + && $this->owner == $user->getId(); + } + function mayEdit(&$user, $access = false) + { + return ($access !== false || $user->access($access)) + && $this->isShared($user, true) && !$this->removed; } Index: item_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item_common.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** item_common.inc.php 20 Sep 2002 18:25:01 -0000 1.2 --- item_common.inc.php 22 Sep 2002 23:37:35 -0000 1.3 *************** *** 110,114 **** // group associated with an item. $arr is an array with // "gid" and "groupAccess", or an Item. ! // If the user isn't found in $users, it'll be taken from the // database. function groupInfo(&$arr, &$users) --- 110,115 ---- // group associated with an item. $arr is an array with // "gid" and "groupAccess", or an Item. ! // $users is an array as returned by UserGroup::getBrief(). ! // If the group isn't found in $users, it'll be read from the [...151 lines suppressed...] + if(c == 1) + return confirm("Really "+act+" this <?= $itemname ?>?"); + return confirm("Really "+act+" these "+c+" <?= $itemname ?>s?"); + } + </script> + <tr><td colspan=<?= $cols ?>><input type=submit name=i_delmarked + value="Delete marked <?= $itemname ?>s" + onClick="return confirmDel('delete')"> + <? + if($showundelete) + { + ?> + <input type=submit name=i_undelmarked + value="Undelete marked <?= $itemname ?>s" + onClick="return confirmDel('undelete')"> + <? + } + echo "</td></tr>\n"; } Index: labeled_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_edit.phtml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** labeled_edit.phtml 20 Sep 2002 18:25:01 -0000 1.16 --- labeled_edit.phtml 22 Sep 2002 23:37:35 -0000 1.17 *************** *** 283,287 **** else { ! if($lext->getOwner() == $curUser->getId() && acc(BUA_BIO_EDIT)) { if($lext->getRemoved()) --- 283,287 ---- else { ! if($lext->mayDelete($curUser, BUA_BIO_EDIT)) { if($lext->getRemoved()) *************** *** 300,304 **** } } ! if($lext->isShared($curUser, true) && acc(BUA_BIO_EDIT)) { echo "<tr><td colspan=2><a ". --- 300,304 ---- } } ! if($lext->mayEdit($curUser, BUA_BIO_EDIT)) { echo "<tr><td colspan=2><a ". Index: labeled_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_list.phtml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** labeled_list.phtml 20 Sep 2002 18:25:01 -0000 1.14 --- labeled_list.phtml 22 Sep 2002 23:37:35 -0000 1.15 *************** *** 37,41 **** // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("LabeledExtract", $users, $curUser); $searchfields = array("Name", "Description", "Extract", "Sample", --- 37,41 ---- // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("LabeledExtract", $curUser); $searchfields = array("Name", "Description", "Extract", "Sample", *************** *** 84,88 **** $s =& $lexts[$i]; ! if(isset($s["samplePublic"])) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". --- 84,88 ---- $s =& $lexts[$i]; ! if($s["samplePublic"]) { $slink = "<a href='sample_edit.phtml?i_samp=$s[sample]'>". *************** *** 91,95 **** else $slink = html($s["sampleName"]); ! if(isset($s["extractPublic"])) { $elink = "<a href='extract_edit.phtml?i_ext=$s[extract]'>". --- 91,95 ---- else $slink = html($s["sampleName"]); ! if($s["extractPublic"]) { $elink = "<a href='extract_edit.phtml?i_ext=$s[extract]'>". *************** *** 130,134 **** echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); ?> --- 130,134 ---- echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $curUser); showDelLinks($cols); ?> Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** plate.inc.php 12 Sep 2002 13:23:22 -0000 1.34 --- plate.inc.php 22 Sep 2002 23:37:35 -0000 1.35 *************** *** 25,300 **** // require_once("item.inc.php"); - define("CLEN_PLATETYPE_NAME", CLEN_ITEM_NAME); - define("CLEN_PLATETYPE_NAMEPREFIX", 40); define("CLEN_PLATE_NAME", 30); define("CLEN_PLATE_BARCODE", 30); - define("CLEN_PLATEEVENTTYPE_NAME", 40); - - class PlateType extends Item [...665 lines suppressed...] ! $arr[] = $row; return $arr; } *************** *** 753,766 **** { return parent::getNameFromId("Plate", $id); - } - - // Returns an array with 0=>name,1=>typename - function getNameAndType($id) - { - $query = "SELECT p.name, pt.name FROM Plate p, PlateType pt ". - "WHERE pt.id = p.`plateType` AND p.id = ".(int)$id; - $res = query($query); - if($row =& db_fetch_row($res)) return $row; - return false; } --- 390,393 ---- Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** plate_edit.phtml 20 Sep 2002 18:25:02 -0000 1.29 --- plate_edit.phtml 22 Sep 2002 23:37:35 -0000 1.30 *************** *** 31,34 **** --- 31,35 ---- require_once("search.inc.php"); require_once("searchhtml.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_ARRAY_READ); Index: plate_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_list.phtml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** plate_list.phtml 5 Aug 2002 11:29:34 -0000 1.27 --- plate_list.phtml 22 Sep 2002 23:37:35 -0000 1.28 *************** *** 27,75 **** require_once("protocol.inc.php"); require_once("plate.inc.php"); require_once("search.inc.php"); require_once("searchhtml.inc.php"); verifyAccess(BUA_ARRAY_READ); ! $err = ""; ! if(isset($i_delete) && acc(BUA_ARRAY_EDIT)) ! { [...306 lines suppressed...] ! "<td>".worldInfo($p)."</td>\n"; ! for($j = 0; $j < count($eventTypes); $j++) ! echo "<td>".htmldate($p["evDate$j"])."</td>\n"; ! echo "<td>$par</td>". ! "<td>$uo</td>". ! "<td>$dau</td>". ! "</tr>\n"; } ! $cols = count($headerfields); if($links != "") ! echo "<tr><td colspan=$cols>$links</td></tr>\n"; ! groupAccessFooter($cols, $curUser); ! massDeleteInput($cols, "plate", showDelValue() !== 0); ! showDelLinks($cols); ! ?> + </form> </table> </body> Index: platetype_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/platetype_edit.phtml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** platetype_edit.phtml 10 Sep 2002 23:06:22 -0000 1.14 --- platetype_edit.phtml 22 Sep 2002 23:37:35 -0000 1.15 *************** *** 26,32 **** require_once("init.inc.php"); require_once("protocol.inc.php"); ! require_once("plate.inc.php"); require_once("search.inc.php"); require_once("searchhtml.inc.php"); verifyAccess(BUA_ARRAY_READ); --- 26,33 ---- require_once("init.inc.php"); require_once("protocol.inc.php"); [...563 lines suppressed...] + "<th>Description</th><th>Added</th><th>Added by</th></tr>\n"; + } + $void = array(); + for($i = 0, $odd = 0; $i < count($eventTypes); $i++, $odd ^= 1) + { + $pet =& $eventTypes[$i]; + if(isset($protoTypes[$pet->getProtocolType()])) + $pt = html($protoTypes[$pet->getProtocolType()]); + else + $pt = "<span class=red>Unknown</span>"; + echo "<tr bgcolor=$tdbg[$odd]>". + "<td>".html($pet->getName()).remMark($pet)."</td>". + "<td>".$pt."</td>". + "<td>".html($pet->getDescr())."</td>". + "<td>".htmldate($pet->getAddedDate())."</td>". + "<td>".userInfo($pet, $void)."</td>". + "</tr>\n"; + } } ?> Index: platetype_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/platetype_list.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** platetype_list.phtml 5 Aug 2002 11:19:01 -0000 1.9 --- platetype_list.phtml 22 Sep 2002 23:37:35 -0000 1.10 *************** *** 29,38 **** require_once("search.inc.php"); require_once("searchhtml.inc.php"); verifyAccess(BUA_ARRAY_READ); ! $headerfields = array("Name", "Wells", "Events", "Well annotation", ! "Description"); ! $sortorder = array(1, 1, 0, 0, 1); $defsort = 0; [...111 lines suppressed...] "<td valign=top>".implode("<br>\n", $earr)."</td>\n". "<td valign=top>".implode("<br>\n", $annarr)."</td>\n". *************** *** 87,91 **** "</tr>\n"; } ! if($addlink != "") echo "<tr><td colspan=5>$addlink</td></tr>\n"; ?> </table> --- 109,118 ---- "</tr>\n"; } ! $cols = count($headerfields); ! if($addlink != "") ! echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! ! groupAccessFooter($cols, $curUser); ! showDelLinks($cols); ?> </table> Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** sample_edit.phtml 20 Sep 2002 18:25:02 -0000 1.21 --- sample_edit.phtml 22 Sep 2002 23:37:35 -0000 1.22 *************** *** 194,201 **** dateAndOwnerTable($samp, $curUser, true); ! if(!$sampid) $annots = array(); ! else $annots = SampleAnnotation::getBriefForSample($sampid); ! if($annots) echo "<tr><th>Annotation</th><th>Value</th></tr>\n"; ! else echo "<tr><th>Annotations</th><td>None</td></tr>\n"; for(reset($annots), $odd=1; list($id, $arr) = each($annots); $odd ^= 1) { --- 194,205 ---- dateAndOwnerTable($samp, $curUser, true); ! if(!$sampid) ! $annots = array(); ! else ! $annots = SampleAnnotation::getBriefForSample($sampid, $curUser); ! if($annots) ! echo "<tr><th>Annotation</th><th>Value</th></tr>\n"; ! else ! echo "<tr><th>Annotations</th><td>None</td></tr>\n"; for(reset($annots), $odd=1; list($id, $arr) = each($annots); $odd ^= 1) { *************** *** 213,217 **** else { ! if($samp->getOwner() == $curUser->getId() && acc(BUA_BIO_EDIT)) { if($samp->getRemoved()) --- 217,221 ---- else { ! if($samp->mayDelete($curUser, BUA_BIO_EDIT)) { if($samp->getRemoved()) *************** *** 230,234 **** } } ! if($samp->isShared($curUser, true) && acc(BUA_BIO_EDIT)) { echo "<tr><td colspan=2><a ".href("sample_edit.phtml". --- 234,238 ---- } } ! if($samp->mayEdit($curUser, BUA_BIO_EDIT)) { echo "<tr><td colspan=2><a ".href("sample_edit.phtml". *************** *** 254,260 **** <tr><th colspan=2 class=subhead>Annotations</th></tr> <? ! $annots = SampleAnnotation::getBriefForSample($sampid); ! if($annots) echo "<tr><th>Annotation</th><th>Value</th></tr>\n"; ! else echo "<tr><td colspan=2>None</td></tr>\n"; for(reset($annots), $odd=1; list($id, $arr) = each($annots); $odd ^= 1) { --- 258,266 ---- <tr><th colspan=2 class=subhead>Annotations</th></tr> <? ! $annots = SampleAnnotation::getBriefForSample($sampid, $curUser); ! if($annots) ! echo "<tr><th>Annotation</th><th>Value</th></tr>\n"; ! else ! echo "<tr><td colspan=2>None</td></tr>\n"; for(reset($annots), $odd=1; list($id, $arr) = each($annots); $odd ^= 1) { Index: sample_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_list.phtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** sample_list.phtml 20 Sep 2002 18:25:02 -0000 1.17 --- sample_list.phtml 22 Sep 2002 23:37:35 -0000 1.18 *************** *** 41,45 **** // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("Sample", $users, $curUser); $searchfields = array("Name", "Description", "Owner", "Sample date", --- 41,45 ---- // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle("Sample", $curUser); $searchfields = array("Name", "Description", "Owner", "Sample date", *************** *** 56,60 **** else { ! $annottypes = SampleAnnotationType::getBasic(showDelSublist()); $headerfields = array("Name"); for(reset($annottypes); list(, $arr) = each($annottypes); ) --- 56,61 ---- else { ! $annottypes = SampleAnnotationType::getBasic($curUser, ! showDelSublist()); $headerfields = array("Name"); for(reset($annottypes); list(, $arr) = each($annottypes); ) *************** *** 163,167 **** $anns = SampleAnnotation::getBrieferForSample($s["id"], ! showDelSublist()); echo "<tr bgcolor=$tdbg[$odd]>". --- 164,168 ---- $anns = SampleAnnotation::getBrieferForSample($s["id"], ! $curUser, showDelSublist()); echo "<tr bgcolor=$tdbg[$odd]>". *************** *** 182,188 **** if($samples && !$view) ! { ! groupAccessFooter($cols, $users, $curUser); ! } showDelLinks($cols); --- 183,187 ---- if($samples && !$view) ! groupAccessFooter($cols, $curUser); showDelLinks($cols); Index: sampleannot_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannot_edit.phtml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sampleannot_edit.phtml 16 Sep 2002 14:20:57 -0000 1.11 --- sampleannot_edit.phtml 22 Sep 2002 23:37:35 -0000 1.12 *************** *** 50,88 **** { if(!$sat->read($i_sat)) $err = "No such annotation type"; } ! else { $sat->setOptions(10); $sat->setOwner($curUser->getId()); } ! $satid = $sat->getId(); [...169 lines suppressed...] - html(Submitter::getNameFromId($sat->getOwner())) ?></td></tr> <tr><th>Type</th><td><select name=i_type onChange='this.form.submit()'> <? --- 162,165 ---- *************** *** 171,176 **** ?> </select></td></tr> - <? if($sat->getValueType() != "e") { --- 172,178 ---- ?> </select></td></tr> <? + dateAndOwnerTable($sat, $curUser, true); + if($sat->getValueType() != "e") { Index: sampleannot_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannot_list.phtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sampleannot_list.phtml 16 Sep 2002 14:20:57 -0000 1.10 --- sampleannot_list.phtml 22 Sep 2002 23:37:35 -0000 1.11 *************** *** 33,41 **** showDelPrep(); $searchfields = array("Name", "Description", "Owner", "Added"); $fieldtype = array(0, 0, 0, 1); $headerfields = array("Name", "Type", "Options", "Default", ! "Description", "Added", "Owner"); ! $sortorder = array(1, 1, 1, 1, 1, -1, 1); $defsort = 0; --- 33,48 ---- [...62 lines suppressed...] ?> --- 90,107 ---- "<td>".html($s["options"])."</td>". "<td>".html($s["defaultValue"])."</td>". "<td>".htmldate($s["addedDate"])."</td>". "<td>".html($s["userName"])."</td>". + "<td>".groupAccessCheckbox($s["id"])."</td>". + "<td>".groupInfo($s, $users)."</td>". + "<td>".worldInfo($s)."</td>". + "<td>".html($s["descr"])."</td>". "</tr>\n"; } ! $cols = count($headerfields); if($addlink != "") echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; + + groupAccessFooter($cols, $curUser); showDelLinks($cols); ?> Index: sampleannotation.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannotation.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** sampleannotation.inc.php 16 Sep 2002 14:20:57 -0000 1.18 --- sampleannotation.inc.php 22 Sep 2002 23:37:35 -0000 1.19 *************** *** 39,43 **** { $this->Item("SampleAnnotationType", $name, $descr, $owner, $addedDate, ! $id, $removed); $this->id = (int)$id; $this->name = $name; --- 39,43 ---- { $this->Item("SampleAnnotationType", $name, $descr, $owner, $addedDate, ! $id, $removed, 0, 0, 0); $this->id = (int)$id; [...238 lines suppressed...] --- 304,308 ---- // Returns array id => annotation ! function getBrieferForSample($sample, &$user, $removed = 0) { $query = "SELECT sa.`annotationType`, sa.annotation ". *************** *** 326,330 **** "WHERE sa.sample = ".(int)$sample." ". "AND sat.id = sa.`annotationType` ". ! Item::whereRemovedAnd("sat", $removed); "ORDER BY sa.`annotationType`"; $arr = array(); --- 310,315 ---- "WHERE sa.sample = ".(int)$sample." ". "AND sat.id = sa.`annotationType` ". ! Item::whereRemovedAnd("sat", $removed)." ". ! "AND ".Item::whereShared("sat", $user)." ". "ORDER BY sa.`annotationType`"; $arr = array(); Index: upload.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/upload.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** upload.inc.php 10 Sep 2002 23:06:35 -0000 1.21 --- upload.inc.php 22 Sep 2002 23:37:35 -0000 1.22 *************** *** 31,61 **** class Upload extends Item { ! var $fileSize, $mimeType, $hidden; function Upload($name = "", $descr = "", $owner = 0, $addedDate = "", ! $fileSize = 0, $mimeType = "", $hidden = 0, $id = 0) { $this->Item("Upload", $name, $descr, $owner, ! $addedDate == "" ? now() : $addedDate, $id); $this->fileSize = (int)$fileSize; [...464 lines suppressed...] ! $query = "SELECT up.*, ug.name AS `userName` ". ! "FROM Upload up, UserGroup ug ". ! "WHERE ug.id = up.owner ".$search->getExtraWhere()." ". ! $search->getWhere()." $ob ".$search->makeLimit(); $arr = array(); $res = query($query); ! while($row =& db_fetch_assoc($res)) ! $arr[] = $row; return $arr; } ! function isOwner($id, $userid) { ! return parent::isOwner("Upload", $id, $userid); } ! function isSharedId($id, &$user) { ! return parent::isSharedId("Upload", $id, $user); } } Index: upload_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/upload_list.phtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** upload_list.phtml 29 Aug 2002 16:51:34 -0000 1.3 --- upload_list.phtml 22 Sep 2002 23:37:35 -0000 1.4 *************** *** 28,86 **** require_once("search.inc.php"); require_once("searchhtml.inc.php"); verifyAccess(BUA_NONE); $up = new Upload(); ! $err = $up->handleUpload("i_file", false, isset($i_descr) ? $i_descr : ""); $others = isset($i_others) && $i_others ? 1 : 0; - [...242 lines suppressed...] ! "<a href=\"download.phtml/$id.0/$fname\">View</a>]</td>". "<td align=right>".$s["fileSize"]."</td>". "<td>".htmldatetime($s["addedDate"])."</td>". ! "<td>".html($s["userName"])."</td>". ! "<td>".groupAccessCheckbox($s["id"])."</td>". ! "<td>".groupInfo($s, $users)."</td>". ! "<td>".worldInfo($s)."</td>". ! "<td>".html($s["descr"])."</td>". ! "</tr>\n"; } + $cols = count($headerfields) + 1; ! groupAccessFooter($cols, $curUser); ! if(!$others) { ! massDeleteInput($cols, "file", showDelValue() !== 0); } + showDelLinks($cols); ?> </form> Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** user.inc.php 20 Sep 2002 18:25:02 -0000 1.13 --- user.inc.php 22 Sep 2002 23:37:35 -0000 1.14 *************** *** 94,107 **** } ! // Returns array with id->name ! function getBrief($removed = 0) { ! $query = "SELECT i.id, i.name FROM UserGroup i ". "WHERE ".db_true()." ". Item::whereRemovedAnd("i", $removed); $res = query($query); $arr = array(); ! while($row =& db_fetch_row($res)) ! $arr[$row[0]] = $row[1]; return $arr; } --- 94,107 ---- } ! // Returns array with id->array(name, removed) ! function getBrief($removed = NULL) { ! $query = "SELECT i.id, i.name, i.removed FROM UserGroup i ". "WHERE ".db_true()." ". Item::whereRemovedAnd("i", $removed); $res = query($query); $arr = array(); ! while($row =& db_fetch_assoc($res)) ! $arr[$row["id"]] = $row; return $arr; } *************** *** 115,118 **** --- 115,122 ---- { return parent::getNameFromId("UserGroup", $id); + } + function getBasicFromId($id) + { + return parent::getBasicFromId("UserGroup", $id); } Index: ware_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware_edit.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ware_edit.phtml 20 Sep 2002 18:25:04 -0000 1.9 --- ware_edit.phtml 22 Sep 2002 23:37:35 -0000 1.10 *************** *** 111,115 **** if($err == "") ! $err = handleDelete($ware, $curUser); if($edit) $what = $wareid ? "Edit" : "New"; --- 111,115 ---- if($err == "") ! $err = handleDelete($ware, $curUser, BUA_WARE_EDIT); if($edit) $what = $wareid ? "Edit" : "New"; Index: ware_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware_list.phtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ware_list.phtml 20 Sep 2002 18:25:04 -0000 1.8 --- ware_list.phtml 22 Sep 2002 23:37:35 -0000 1.9 *************** *** 48,52 **** // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle($waretype, $users, $curUser); $searchfields = array("Name", "Owner", "Date added"); --- 48,52 ---- // Sharing $users = UserGroup::getBrief(); ! groupAccessHandle($waretype, $curUser); $searchfields = array("Name", "Owner", "Date added"); *************** *** 110,114 **** echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); ?> --- 110,114 ---- echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! groupAccessFooter($cols, $curUser); showDelLinks($cols); ?> |
From: <tr...@us...> - 2002-09-20 18:26:09
|
Update of /cvsroot/basedb/basedb/exec/source/pca In directory usw-pr-cvs1:/tmp/cvs-serv14537/pca Added Files: .cvsignore Log Message: includes binary 'pca' --- NEW FILE: .cvsignore --- pca |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv14162 Modified Files: acquisition.inc.php bio.inc.php extract_edit.phtml extract_list.phtml hyb.inc.php hyb_common.inc.php hyb_edit.phtml hyb_image.phtml hyb_list.phtml image.inc.php item.inc.php item_common.inc.php labeled_edit.phtml labeled_list.phtml plate_edit.phtml sample_edit.phtml sample_list.phtml user.inc.php ware.inc.php ware_edit.phtml ware_list.phtml Added Files: closeme.phtml Log Message: More changes towards groups, data hiding --- NEW FILE: closeme.phtml --- <? // $Id: closeme.phtml,v 1.1 2002/09/20 18:25:00 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 // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // require_once("newinit.inc.php"); $pageTitle="$config[codename] - OK"; require_once("htmlinit.phtml"); ?> <table <?= $cellpad ?>> <tr><th class=pagehead>Operation completed</td></tr> <tr><td class=large>[<a href="javascript:window.close()" >Close this window</a>]</td></tr> </table> </body> </html> Index: acquisition.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/acquisition.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** acquisition.inc.php 10 Sep 2002 23:04:36 -0000 1.16 --- acquisition.inc.php 20 Sep 2002 18:24:59 -0000 1.17 *************** *** 38,42 **** $id = 0) { ! $this->Item("ImageAcquisition", $name, $descr, $owner, $addedDate, $id); $this->hybridization = (int)$hybridization; $this->scanDate = $scanDate; --- 38,43 ---- $id = 0) { ! $this->Item("ImageAcquisition", $name, $descr, $owner, $addedDate, ! $id, 0, 0, 0, 0); [...217 lines suppressed...] ! "WHERE hw.id = ia.scanner AND ug.id = ia.owner ". $search->getWhere()." ".$search->getExtraWhere()." ". "GROUP BY ia.id $ss2 $ob ".$search->makeLimit(); *************** *** 219,232 **** return 0; } - - function lockId($id, $exclusive) - { - return parent::lockItem("ImageAcquisition", $id, $exclusive); - } - function unlockId($id, $exclusive) - { - return parent::unlockItem("ImageAcquisition", $id, $exclusive); - } - } --- 158,161 ---- Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** bio.inc.php 16 Sep 2002 14:20:57 -0000 1.26 --- bio.inc.php 20 Sep 2002 18:25:00 -0000 1.27 *************** *** 39,43 **** { $this->Item("Sample", $name, $descr, $owner, $addedDate, ! $id, $removed); $this->tissue = (int)$tissue; $this->sampleDate = $sampleDate; --- 39,43 ---- { $this->Item("Sample", $name, $descr, $owner, $addedDate, ! $id, $removed, 0, 0, 0); $this->tissue = (int)$tissue; [...489 lines suppressed...] + function countForExtract($extract) { *************** *** 805,811 **** } ! function isSharedId($id, $owner) { ! return parent::isSharedId("LabeledExtract", $id, $owner); } } --- 785,791 ---- } ! function isSharedId($id, &$user, $write = 0) { ! return parent::isSharedId("LabeledExtract", $id, $user, $write); } } Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** extract_edit.phtml 16 Sep 2002 14:20:57 -0000 1.16 --- extract_edit.phtml 20 Sep 2002 18:25:00 -0000 1.17 *************** *** 34,66 **** $err = ""; $edit = true; ! if(isset($i_act) && $i_act == "upd") { ! $ext = new Extract(); ! if($i_ext > 0) { ! if(!$ext->read($i_ext, $curUser->getId())) ! $err = "No such extract"; ! else if($ext->getOwner() != $curUser->getId()) [...296 lines suppressed...] <tr><th>Protocol</th><td><?= html($pname) ?></td></tr> *************** *** 311,319 **** <tr><th>Extracted quantity (µg)</th><td><?= $ext->getQuantity() ?></td></tr> <tr><th>Quantity left (µg)</th><td><?= $ext->getQuantityLeft() ?></td></tr> ! <tr><th>Extracted</th><td><?= html($ext->getExtractionDate()) ?></td></tr> ! <tr><th>Added</th><td><?= html($ext->getAddedDate()) ?></td></tr> ! <tr><th>Owner</th><td><?= html($uname) ?></td></tr> ! <tr><th>Public</th><td><?= $ext->isSharedWith(0) ? "Yes" : "No" ?></td></tr> <? if(!$ext->getRemoved()) { --- 301,307 ---- <tr><th>Extracted quantity (µg)</th><td><?= $ext->getQuantity() ?></td></tr> <tr><th>Quantity left (µg)</th><td><?= $ext->getQuantityLeft() ?></td></tr> ! <tr><th>Extracted</th><td><?= htmldate($ext->getExtractionDate()) ?></td></tr> <? + dateAndOwnerTable($ext, $curUser); if(!$ext->getRemoved()) { Index: extract_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_list.phtml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** extract_list.phtml 12 Sep 2002 22:37:56 -0000 1.12 --- extract_list.phtml 20 Sep 2002 18:25:00 -0000 1.13 *************** *** 35,46 **** showDelPrep(); $searchfields = array("Name", "Description", "Sample", "Owner", "Date added", "Extraction date", "Protocol", "Quantity left"); $fieldtype = array(0, 0, 0, 0, 1, 1, 0, 2); ! $headerfields = array("Name", "Sample", "Extracted", "Protocol", ! "Owner", "Public", "µg left", "Labelings", "Hybridizations"); ! $sortorder = array(1, 1, -1, 1, 1, -1, 1, 0, 0); $defsort = 0; - [...94 lines suppressed...] ?> --- 109,126 ---- "<td>$slink</td>". "<td>".html($s["extractionDate"])."</td>". "<td>".html($s["userName"])."</td>". ! "<td>".groupAccessCheckbox($s["id"])."</td>". ! "<td>".groupInfo($s, $users)."</td>". ! "<td>".worldInfo($s)."</td>". ! "<td>".html($s["protocolName"])."</td>". "<td>".$qty."</td>". "<td>".$labs."</td>". "<td>".$hybs."</td></tr>\n"; } ! $cols = 11; if($addlink != "") echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; + + groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); ?> Index: hyb.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb.inc.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** hyb.inc.php 12 Sep 2002 22:37:56 -0000 1.22 --- hyb.inc.php 20 Sep 2002 18:25:00 -0000 1.23 *************** *** 38,42 **** { $this->Item("Hybridization", $name, $descr, $owner, $addedDate, ! $id, $removed); $this->hybridizationDate = $hybridizationDate; $this->protocol = (int)$protocol; --- 38,42 ---- { $this->Item("Hybridization", $name, $descr, $owner, $addedDate, ! $id, $removed, 0, 0, 0); $this->hybridizationDate = $hybridizationDate; [...242 lines suppressed...] } ! function isSharedId($id, &$user, $write = 0) { ! return parent::isSharedId("Hybridization", $id, $user, $write); } *************** *** 319,324 **** $query = "UPDATE HybridizedLabeled SET quantity = quantity + $amount ". "WHERE hybridization = $this->id AND position = ".(int)$position; ! query($query); ! return db_affected_rows() > 0; } } --- 288,292 ---- $query = "UPDATE HybridizedLabeled SET quantity = quantity + $amount ". "WHERE hybridization = $this->id AND position = ".(int)$position; ! return query($query) && db_affected_rows() > 0; } } Index: hyb_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_common.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** hyb_common.inc.php 29 Aug 2002 16:51:33 -0000 1.6 --- hyb_common.inc.php 20 Sep 2002 18:25:00 -0000 1.7 *************** *** 27,30 **** --- 27,31 ---- require_once("bio.inc.php"); require_once("array.inc.php"); + require_once("item_common.inc.php"); function hybInfo(&$hyb) *************** *** 33,95 **** $hybid = $hyb->getId(); [...112 lines suppressed...] <tr><th>Hybridized</th><td><?= html($hyb->getHybridizationDate()) ?></td></tr> <? + dateAndOwnerTable($hyb, $curUser); } function acquisitionInfo(&$acq) { + global $curUser; $scanner = Hardware::getNameVersionFromId($acq->getScanner()); ?> ! <tr><th>Image set</th><td><?= html($acq->getName()).remMark($acq) ?></td></tr> <tr><th>Description</th><td><?= html($acq->getDescr()) ?></td></tr> ! <tr><th>Scanner</th><td><?= html($scanner["name"]). ! remMark($scanner["removed"]) ?></td></tr> <tr><th>Scanner version</th><td><?= html($scanner["version"]) ?></td></tr> <tr><th>Scan date</th><td><?= htmldate($acq->getScanDate()) ?></td></tr> <? + dateAndOwnerTable($acq, $curUser); } Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** hyb_edit.phtml 10 Sep 2002 23:05:13 -0000 1.32 --- hyb_edit.phtml 20 Sep 2002 18:25:00 -0000 1.33 *************** *** 35,208 **** require_once("search.inc.php"); require_once("searchhtml.inc.php"); verifyAccess(BUA_BIO_READ); setLocation("hyb_list.phtml"); $err = ""; $edit = true; ! if(isset($i_act) && $i_act == "upd") { [...591 lines suppressed...] html($a["name"])."</a></td>". ! "<td>".$scanner."</td>". "<td>".html($a["scannerVersion"])."</td>". "<td>".htmldate($a["scanDate"])."</td>". + "<td>".html($a["userName"])."</td>". + "<td>".groupAccessCheckbox($a["id"])."</td>". + "<td>".groupInfo($a, $users)."</td>". + "<td>".worldInfo($a)."</td>". "<td>".html($a["images"])."</td>". "<td>".implode(", ", $raws)."</td>". "</tr>\n"; } ! $cols = 10; ! if($addscan != "") ! echo "<tr><td colspan=$cols>$addscan</td></tr>\n"; ! ! groupAccessFooter($cols, $users, $curUser); ! showDelLinks($cols); echo "</table>\n"; } Index: hyb_image.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_image.phtml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** hyb_image.phtml 10 Sep 2002 23:05:22 -0000 1.23 --- hyb_image.phtml 20 Sep 2002 18:25:01 -0000 1.24 *************** *** 34,40 **** --- 34,42 ---- require_once("search.inc.php"); require_once("searchhtml.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_BIO_READ); setLocation("hyb_list.phtml"); + showDelPrep(); $err = ""; [...439 lines suppressed...] if($edit) { --- 448,464 ---- } unset($a); ! $cols = 7; ! if(!$edit && $acq->isShared($curUser, true) && acc(BUA_BIO_EDIT)) { ! echo "<tr><td colspan=$cols class=large><a ". href("hyb_image.phtml?i_acq=$acqid&i_edit=1", 1). ">Add images</a></td></tr>\n"; } + showDelLinks($cols); echo "</table>\n"; } ! // Allow the user to upload new images if he/she/it has ! // write access to the acquisition if($edit) { Index: hyb_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_list.phtml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** hyb_list.phtml 5 Aug 2002 11:29:34 -0000 1.12 --- hyb_list.phtml 20 Sep 2002 18:25:01 -0000 1.13 *************** *** 30,35 **** --- 30,41 ---- require_once("search.inc.php"); require_once("searchhtml.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_BIO_READ); + showDelPrep(); + + // Sharing + $users = UserGroup::getBrief(); [...143 lines suppressed...] "<td>".html($s["protocolName"])."</td>". "<td>".html($s["scans"])."</td>". *************** *** 99,103 **** "</tr>\n"; } ! if($addlink != "") echo "<tr><td colspan=9>$addlink</td></tr>\n"; ?> </table> --- 131,140 ---- "</tr>\n"; } ! $cols = 12; ! if($addlink != "") ! echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! ! groupAccessFooter($cols, $users, $curUser); ! showDelLinks($cols); ?> </table> Index: image.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/image.inc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** image.inc.php 10 Sep 2002 23:05:29 -0000 1.14 --- image.inc.php 20 Sep 2002 18:25:01 -0000 1.15 *************** *** 36,40 **** $imageAcquisition = 0, $channels = 0, $fileSize = 0, $id = 0) { ! $this->Item("Image", $name, $descr, $owner, $addedDate, $id); $this->imageAcquisition = (int)$imageAcquisition; $this->channels = (int)$channels; --- 36,40 ---- $imageAcquisition = 0, $channels = 0, $fileSize = 0, $id = 0) { ! $this->Item("Image", $name, $descr, $owner, $addedDate, $id, 0); $this->imageAcquisition = (int)$imageAcquisition; [...165 lines suppressed...] $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT im.* , ug.name AS `userName` ". ! "FROM Image im, UserGroup ug WHERE ug.id = im.owner ". $search->getWhere()." ".$search->getExtraWhere()." ". "$ob ".$search->makeLimit(); *************** *** 192,195 **** --- 160,169 ---- { return parent::isOwner("Image", $id, $owner); + } + + function isShared(&$user, $write = 0) + { + return parent::isSharedId("ImageAcquisition", $this->imageAcquisition, + $user, $write); } } Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** item.inc.php 16 Sep 2002 14:20:57 -0000 1.31 --- item.inc.php 20 Sep 2002 18:25:01 -0000 1.32 *************** *** 33,40 **** { var $type, $id, $name, $descr, $owner, $addedDate, $removed, ! $readAccess; function Item($type, $name, $descr, $owner, $addedDate, $id, ! $removed = NULL, $hasAccess = false) { $this->type = $type; --- 33,41 ---- { [...354 lines suppressed...] ! function updateGroupAccessId($type, $id, $acc) { ! return Item::updateColumn($type, $id, ! "groupAccess", max(0, min(2, (int)$acc))); } ! function updateWorldAccess($acc) { ! $this->setWorldAccess($acc); ! return Item::updateColumn($this->type, $this->id, ! "worldAccess", $this->worldAccess); } ! function updateWorldAccessId($type, $id, $acc) { ! return Item::updateColumn($type, $id, ! "worldAccess", max(0, min(1, (int)$acc))); } + // Locking functions Index: item_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item_common.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** item_common.inc.php 12 Sep 2002 22:37:56 -0000 1.1 --- item_common.inc.php 20 Sep 2002 18:25:01 -0000 1.2 *************** *** 25,28 **** --- 25,319 ---- // + // Functions that have to do with group/world privileges + + function getPrivilegeNames() + { + return array("--", "r-", "rw"); + } + [...266 lines suppressed...] + global $i_delete; + if(acc(BUA_BIO_EDIT) && isset($i_delete) && $i_delete) + { + $undel = $i_delete == 2; + $act = $undel ? "undelete" : "delete"; + if($item->getOwner() != $user->getId()) + $err = "Can't $act someone else's ".$item->getType(); + else if($item->getRemoved() && !$undel) + $err = $item->getType()." already deleted"; + else if(!$item->getRemoved() && $undel) + $err = $item->getType()." isn't deleted - can't undelete"; + else if(!$item->updateRemoved(!$undel)) + $err = "Unable to $act ".$item->getType(); + if($err == "") + redirect($GLOBALS["location"]); + } + } + // Input: Item object or scalar. Output: string denoting deleted item. function remMark(&$obj) Index: labeled_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_edit.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** labeled_edit.phtml 12 Sep 2002 22:37:56 -0000 1.15 --- labeled_edit.phtml 20 Sep 2002 18:25:01 -0000 1.16 *************** *** 34,67 **** $err = ""; $edit = true; ! if(isset($i_act) && $i_act == "upd") { ! $lext = new LabeledExtract(); ! if($i_lext > 0) { ! if(!$lext->read($i_lext, $curUser->getId())) ! $err = "No such labeled extract"; ! else if($lext->getOwner() != $curUser->getId()) [...300 lines suppressed...] ! <tr><th>Description</th><td><?= html($lext->getDescr()) ?></td></tr> <tr><th>Label</th><td><?= html($lext->getLabel()) ?></td></tr> <tr><th>Quantity of extract labeled (µg)</th><td><?= *************** *** 334,341 **** <tr><th>Quantity left</th><td><?= $lext->getQuantityLeft() ?></td></tr> <tr><th>Labeled</th><td><?= html($lext->getLabelingDate()) ?></td></tr> - <tr><th>Added</th><td><?= html($lext->getAddedDate()) ?></td></tr> - <tr><th>Owner</th><td><?= html($uname) ?></td></tr> - <tr><th>Public</th><td><?= $lext->isSharedWith(0) ? "Yes" : "No" ?></td></tr> <? if(!$lext->getRemoved()) { --- 328,333 ---- <tr><th>Quantity left</th><td><?= $lext->getQuantityLeft() ?></td></tr> <tr><th>Labeled</th><td><?= html($lext->getLabelingDate()) ?></td></tr> <? + dateAndOwnerTable($lext, $curUser); if(!$lext->getRemoved()) { Index: labeled_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_list.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** labeled_list.phtml 12 Sep 2002 22:37:56 -0000 1.13 --- labeled_list.phtml 20 Sep 2002 18:25:01 -0000 1.14 *************** *** 35,46 **** showDelPrep(); $searchfields = array("Name", "Description", "Extract", "Sample", "Date added", "Labeling date", "Protocol", "Quantity left"); $fieldtype = array(0, 0, 0, 0, 1, 1, 0, 2); ! $headerfields = array("Labeled extract", "Label", "Extract", "Sample", ! "Labeled", "Protocol", "µg left", "Hybridizations"); ! $sortorder = array(1, 1, 1, 1, -1, 1, 1, 0); $defsort = 0; - [...84 lines suppressed...] ?> --- 117,134 ---- "<td>$elink</td>". "<td>$slink</td>". ! "<td>".htmldate($s["labelingDate"])."</td>". ! "<td>".html($s["userName"])."</td>". ! "<td>".groupAccessCheckbox($s["id"])."</td>". ! "<td>".groupInfo($s, $users)."</td>". ! "<td>".worldInfo($s)."</td>". "<td>".html($s["protocolName"])."</td>". "<td>".$qty."</td>". "<td>".$hybs."</td></tr>\n"; } ! $cols = 12; if($addlink != "") echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; + + groupAccessFooter($cols, $users, $curUser); showDelLinks($cols); ?> Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** plate_edit.phtml 10 Sep 2002 23:06:15 -0000 1.28 --- plate_edit.phtml 20 Sep 2002 18:25:02 -0000 1.29 *************** *** 127,130 **** --- 127,137 ---- else if($v < 10) $vf = "setWellGrowth"; else continue; + $maxrow = 8; + $maxcol = 12; + if($ptype->getWells() == 384) + { + $maxrow *= 2; + $maxcol *= 2; + } $arr = explode(",", $i_wells[$i]); for($j = 0; $j < count($arr); $j++) *************** *** 139,146 **** $row = ord(strtoupper($w[0])) - 64; $col = (int)substr($w, 1); ! if($row < 1 || $row > 8 || $col < 1 || $col > 12) { $err = "Bad well specifier '".html($w). ! "' on position $i:$j"; break; } --- 146,153 ---- $row = ord(strtoupper($w[0])) - 64; $col = (int)substr($w, 1); ! if($row < 1 || $row > $maxrow || $col < 1 || $col > $maxcol) { $err = "Bad well specifier '".html($w). ! "' on position ".($j+1)." in input box ".($i+1); break; } Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** sample_edit.phtml 16 Sep 2002 14:20:57 -0000 1.20 --- sample_edit.phtml 20 Sep 2002 18:25:02 -0000 1.21 *************** *** 41,49 **** { if(!$samp->readShared($i_samp, $curUser)) $err = "No such sample"; ! else if(!isset($i_tissue)) ! $i_tissue = SampleTissue::getAncestors($samp->getTissue()); ! $edit = $curUser->getId() == $samp->getOwner() && ! isset($i_edit) && $i_edit; } else --- 41,55 ---- [...240 lines suppressed...] + echo "<select name='i_tissue[$lvl]' onChange='this.form.submit()'>". + "<option value=0>None\n"; + $anc = isset($i_tissue[$lvl]) ? $i_tissue[$lvl] : 0; + for($shown = 0, $i = 0; $i < count($tarr); $i++) + { + if($anc == $tarr[$i]->getId()) + { + $sel = "selected"; + $shown = 1; + } + else $sel = ""; + echo "<option $sel value=".$tarr[$i]->getId().">". + html($tarr[$i]->getName()); + } + echo "</select>\n"; + if($shown) showSelect($i_tissue, $lvl + 1); + } + + ?> \ No newline at end of file Index: sample_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_list.phtml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** sample_list.phtml 16 Sep 2002 14:20:57 -0000 1.16 --- sample_list.phtml 20 Sep 2002 18:25:02 -0000 1.17 *************** *** 40,85 **** // Sharing - if(!isset($i_sh) || !is_array($i_sh)) - $i_sh = array(); - $userid = $curUser->getId(); $users = UserGroup::getBrief(); ! unset($users[$userid]); ! ! if(isset($i_unsh) && isset($i_user) && ! Sample::isOwner($i_unsh, $userid)) [...206 lines suppressed...] ! <? ! for(reset($users); list($id, $n) = each($users); ) ! { ! $sel = isset($i_shwho) && $id == $i_shwho ? "selected" : ""; ! echo "<option $sel value=$id>".html($n, 0)."\n"; ! } ! ?> ! </select><input type=submit name=i_shgo value='Ok'> ! <input type=submit name=i_shunall value="Unshare with all" ! onClick="return confirm('Are you sure?')"> ! </td></tr> ! <? } --- 183,187 ---- if($samples && !$view) { ! groupAccessFooter($cols, $users, $curUser); } Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** user.inc.php 16 Sep 2002 14:20:57 -0000 1.12 --- user.inc.php 20 Sep 2002 18:25:02 -0000 1.13 *************** *** 38,41 **** --- 38,43 ---- { var $accessMask; + // This is filled in on read(), and is used by Item + var $groups; function UserGroup($name = "", $descr = "", $owner = 0, $addedDate = "", *************** *** 45,48 **** --- 47,51 ---- [...130 lines suppressed...] - { - $c4 = $c * 4; - $this->groupMasks[] = sprintf("%04x%04x%04x%04x", - $msk[$c4+3], $msk[$c4+2], $msk[$c4+1], $msk[$c4+0]); - } } --- 189,192 ---- *************** *** 333,341 **** { return $this->lastPlateTypeCreated; - } - - function getGroupMasks() - { - return $this->groupMasks; } --- 337,340 ---- Index: ware.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ware.inc.php 10 Sep 2002 23:06:36 -0000 1.13 --- ware.inc.php 20 Sep 2002 18:25:03 -0000 1.14 *************** *** 31,35 **** class Ware extends Item { ! var $version, $shown; function Ware() --- 31,35 ---- class Ware extends Item { ! var $version; [...311 lines suppressed...] ! return parent::unlockItem("Hardware", $id, $exclusive); } } --- 206,221 ---- // Get array id=>array(name,version) ! function getBrief(&$user, $removed = 0) { ! return parent::getBrief("Hardware", $user, $removed); } ! function prepareSearch(&$search, &$user, $hpp, $removed = NULL) { ! return parent::prepareSearch($search, "Hardware", $user, $hpp, $removed); } ! function isSharedId($id, &$user, $write = 0) { ! return parent::isSharedId("Hardware", $id, $user, $write); } } Index: ware_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware_edit.phtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ware_edit.phtml 10 Sep 2002 23:06:37 -0000 1.8 --- ware_edit.phtml 20 Sep 2002 18:25:04 -0000 1.9 *************** *** 26,32 **** require_once("init.inc.php"); require_once("ware.inc.php"); verifyAccess(BUA_BIO_READ); ! setLocation("ware_list.phtml"); if(isset($i_type) && $i_type == "hard") --- 26,41 ---- require_once("init.inc.php"); require_once("ware.inc.php"); [...267 lines suppressed...] ! ">Delete $lwaretypen</a></td></tr>\n"; ! } ! } ! if($ware->isShared($curUser, true) && acc(BUA_WARE_EDIT)) { ?> <tr><td colspan=2><a <?= href("ware_edit.phtml?i_type=$typeprefix". "&i_w=$wareid&i_edit=1&i_popup=$popup", 1) ?> >Edit <?= $lwaretypen ?></a></td></tr> <? } + $void = array(); ?> ! <tr><th>Name</th><td><?= html($ware->getName()).remMark($ware) ?></td></tr> <tr><th>Version</th><td><?= html($ware->getVersion()) ?></td></tr> <tr><th>Description</th><td><?= html($ware->getDescr()) ?></td></tr> <? + dateAndOwnerTable($ware, $curUser); } ?> Index: ware_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/ware_list.phtml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ware_list.phtml 5 Aug 2002 11:29:35 -0000 1.7 --- ware_list.phtml 20 Sep 2002 18:25:04 -0000 1.8 *************** *** 28,34 **** --- 28,37 ---- require_once("search.inc.php"); require_once("searchhtml.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_BIO_READ); + showDelPrep(); + // Figure out if this is hardware or software if(isset($i_type) && $i_type == "hard") [...97 lines suppressed...] echo "<tr bgcolor=$tdbg[$odd]>". "<td><a href='ware_edit.phtml?i_w=$a[id]&i_type=$typeprefix'>". ! html($a["name"])."</a>".remMark($a["removed"])."</td>". "<td>".html($a["version"])."</td>". "<td>".htmldate($a["addedDate"])."</td>". ! "<td>".html($a["userName"])."</td>". ! "<td>".groupAccessCheckbox($a["id"])."</td>". ! "<td>".groupInfo($a, $users)."</td>". ! "<td>".worldInfo($a)."</td>". ! "</tr>\n"; } ! $cols = count($headerfields); ! if($addlink != "") ! echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! ! groupAccessFooter($cols, $users, $curUser); ! showDelLinks($cols); ?> </form> |
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv19687 Modified Files: bio.inc.php common.inc.php extract_edit.phtml index.phtml item.inc.php left.phtml newinit.inc.php sample_annotate.phtml sample_edit.phtml sample_list.phtml sampleannot_edit.phtml sampleannot_list.phtml sampleannotation.inc.php session.inc.php test.phtml user.inc.php Log Message: Started work on new user/group system Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** bio.inc.php 12 Sep 2002 22:37:56 -0000 1.25 --- bio.inc.php 16 Sep 2002 14:20:57 -0000 1.26 *************** *** 26,30 **** // require_once("item.inc.php"); - /*require_once("project.inc.php");*/ define("CLEN_SAMPLE_NAME", CLEN_ITEM_NAME); --- 26,29 ---- *************** *** 90,96 **** $ok = true; [...187 lines suppressed...] { ! return parent::isSharedId("Sample", $id, $user); ! } ! function shareId($id, $userid) ! { ! return parent::shareId("Sample", $id, $userid); ! } ! function unshareId($id, $userid) ! { ! return parent::unshareId("Sample", $id, $userid); ! } ! function shareExclusiveId($id, $userid) ! { ! return parent::shareExclusiveId("Sample", $id, $userid); ! } ! function getSharersForId($id) ! { ! return parent::getSharersForId("Sample", $id); } } Index: common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/common.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** common.inc.php 9 Sep 2002 10:56:08 -0000 1.19 --- common.inc.php 16 Sep 2002 14:20:57 -0000 1.20 *************** *** 38,42 **** "adminEmail", "uploadDir", "tempDir", "jobDir", "rawFileDir", "rawImageDir", "printMapDir", "execDir", "webDir", "gnuplot", ! "mime.types"); foreach($cfgvars as $v) { --- 38,42 ---- "adminEmail", "uploadDir", "tempDir", "jobDir", "rawFileDir", "rawImageDir", "printMapDir", "execDir", "webDir", "gnuplot", ! "mime.types", "displayCookie", "accessColumns"); foreach($cfgvars as $v) { Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** extract_edit.phtml 12 Sep 2002 22:37:56 -0000 1.15 --- extract_edit.phtml 16 Sep 2002 14:20:57 -0000 1.16 *************** *** 91,95 **** $ext->setQuantityLeft($i_qty, true); } ! ignore_user_about($iua); $extid = $ext->getId(); --- 91,95 ---- $ext->setQuantityLeft($i_qty, true); } ! ignore_user_abort($iua); $extid = $ext->getId(); *************** *** 231,235 **** ?> ! <tr><th>Date added</th><td><?= html($ext->getAddedDate()) ?></td></tr> <? if(isset($i_ext)) --- 231,235 ---- ?> ! <tr><th>Date added</th><td><?= htmldate($ext->getAddedDate()) ?></td></tr> <? if(isset($i_ext)) Index: index.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/index.phtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.phtml 29 Aug 2002 16:51:34 -0000 1.17 --- index.phtml 16 Sep 2002 14:20:57 -0000 1.18 *************** *** 42,46 **** setcookie($config["cookieName"], $curSession->cookie->getCookie(), 0, $config["urlpath"]); ! EventLog::log('login', $curSession->user->getUserName()); } else --- 42,46 ---- setcookie($config["cookieName"], $curSession->cookie->getCookie(), 0, $config["urlpath"]); ! EventLog::log('login', $curSession->user->getName()); } else *************** *** 63,67 **** --- 63,69 ---- else if(isset($_COOKIE[$config["cookieName"]]) && $_COOKIE[$config["cookieName"]] != "" && !$loggedIn) + { $err = 1; + } // Save display settings if they've been submitted. *************** *** 78,82 **** isset($i_showlogo) && isset($i_showlogo[$logo])); } ! setcookie("display", $curDisplay->getCookie(), 0x7fffffff, $config["urlpath"]); } --- 80,84 ---- isset($i_showlogo) && isset($i_showlogo[$logo])); } ! setcookie($config["displayCookie"], $curDisplay->getCookie(), 0x7fffffff, $config["urlpath"]); } Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** item.inc.php 12 Sep 2002 22:37:56 -0000 1.30 --- item.inc.php 16 Sep 2002 14:20:57 -0000 1.31 *************** *** 32,39 **** class Item { ! var $type, $id, $name, $descr, $owner, $addedDate, $removed; function Item($type, $name, $descr, $owner, $addedDate, $id, ! $removed = NULL) { $this->type = $type; --- 32,40 ---- class Item [...437 lines suppressed...] ! function isSharedId($type, $id, &$user) { $id = (int)$id; $user = (int)$user; ! $query = "SELECT 1 FROM $type i ". ! "WHERE i.id = $id AND ".Item::whereShared("i", $user); $res = query($query); return db_num_rows($res) > 0; } ! // Returns true if $userid owns item $id of type $type. ! function isOwner($type, $id, $userid) { $query = "SELECT owner FROM $type WHERE id = ".(int)$id; $res = query($query); if($row =& db_fetch_row($res)) ! return $row[0] == (int)$userid; return false; } Index: left.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/left.phtml,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** left.phtml 10 Sep 2002 23:05:58 -0000 1.46 --- left.phtml 16 Sep 2002 14:20:57 -0000 1.47 *************** *** 32,36 **** if($loggedIn && isset($i_broad) && $i_broad != "" && acc(BUA_BROADCAST)) { ! EventLog::log("broadcast", $curUser->getUserName().": ". substr($i_broad, 0, 60)); } --- 32,36 ---- if($loggedIn && isset($i_broad) && $i_broad != "" && acc(BUA_BROADCAST)) { ! EventLog::log("broadcast", $curUser->getName().": ". substr($i_broad, 0, 60)); } *************** *** 115,119 **** ?> <tr><td class=tiny>Logged in as ! <span class=special><?= html($curUser->getUserName()) ?></span> [<a target=_top href="index.phtml?i_logout=1">Log out</a>]<br> Users online: <?= $loggedin ?></td></tr> --- 115,119 ---- ?> <tr><td class=tiny>Logged in as ! <span class=special><?= html($curUser->getName()) ?></span> [<a target=_top href="index.phtml?i_logout=1">Log out</a>]<br> Users online: <?= $loggedin ?></td></tr> *************** *** 255,260 **** <? } ! else echo "<tr><th class=subhead><a target=_top href='index.phtml". ! "?l=upl&m=upload_list.phtml'>Uploads</a></td></tr>\n"; if(!$loggedIn || !acc(BUA_ANALYZE)) {} --- 255,263 ---- <? } ! else ! { ! echo "<tr><th class=subhead><a target=_top href='index.phtml". ! "?l=upl&m=upload_list.phtml'>Uploads</a></td></tr>\n"; ! } if(!$loggedIn || !acc(BUA_ANALYZE)) {} *************** *** 272,276 **** ?> <tr><td><img src='img/1.gif' alt='' width=1 height=1></td></tr> ! <tr><td><a target=main href='experiment_edit.phtml?i_e=-1&location=experiment_list.phtml' >Current experiment</a></td></tr> <? --- 275,280 ---- ?> <tr><td><img src='img/1.gif' alt='' width=1 height=1></td></tr> ! <tr><td><a target=main ! href='experiment_edit.phtml?i_e=-1&location=experiment_list.phtml' >Current experiment</a></td></tr> <? *************** *** 278,282 **** { ?> ! <tr><td><a target=main href='gene_explore.phtml?i_set=-1&location=experiment_list.phtml' >Experiment Explorer</a></td></tr> <? --- 282,287 ---- { ?> ! <tr><td><a target=main ! href='gene_explore.phtml?i_set=-1&location=experiment_list.phtml' >Experiment Explorer</a></td></tr> <? Index: newinit.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/newinit.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** newinit.inc.php 7 Sep 2002 11:36:32 -0000 1.10 --- newinit.inc.php 16 Sep 2002 14:20:57 -0000 1.11 *************** *** 44,48 **** Session::purgeSessions($config["sessionTimeout"]); ! // Override $PHP_SELF with what's supposed to be the relative path. $GLOBALS["PHP_SELF"] = ereg_replace(".*/", "", $_SERVER["SCRIPT_NAME"]); --- 44,50 ---- Session::purgeSessions($config["sessionTimeout"]); ! // Override $PHP_SELF with what's supposed to be the relative path ! // of the script. This also gets rid of PATH_INFO, which is otherwise ! // included in PHP_SELF. $GLOBALS["PHP_SELF"] = ereg_replace(".*/", "", $_SERVER["SCRIPT_NAME"]); *************** *** 59,63 **** redirect("nologin.phtml?location=".urlencode($url)); } ! $GLOBALS["curUser"] = new Submitter(); return false; } --- 61,65 ---- redirect("nologin.phtml?location=".urlencode($url)); } ! $GLOBALS["curUser"] = new UserAccount(); return false; } Index: sample_annotate.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_annotate.phtml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sample_annotate.phtml 29 Aug 2002 16:51:34 -0000 1.11 --- sample_annotate.phtml 16 Sep 2002 14:20:57 -0000 1.12 *************** *** 70,74 **** for(reset($i_del); list($id) = each($i_del); ) { ! SampleAnnotation::removeId($sampid, $id); unset($i_use[$id]); } --- 70,74 ---- for(reset($i_del); list($id) = each($i_del); ) { ! SampleAnnotation::remove($sampid, $id); unset($i_use[$id]); } Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** sample_edit.phtml 12 Sep 2002 22:37:56 -0000 1.19 --- sample_edit.phtml 16 Sep 2002 14:20:57 -0000 1.20 *************** *** 40,44 **** if(isset($i_samp) && $i_samp) { ! if(!$samp->read($i_samp, $curUser->getId())) $err = "No such sample"; else if(!isset($i_tissue)) --- 40,44 ---- if(isset($i_samp) && $i_samp) { ! if(!$samp->readShared($i_samp, $curUser)) $err = "No such sample"; else if(!isset($i_tissue)) *************** *** 76,80 **** $newsamp = $samp->getId() == 0; ! $iua = ignore_user_abort(1); // To ensure sharing gets done if($err != "") {} else if(!acc(BUA_BIO_EDIT)) --- 76,80 ---- $newsamp = $samp->getId() == 0; ! if($err != "") {} else if(!acc(BUA_BIO_EDIT)) *************** *** 88,99 **** else $err = "Unable to save sample"; } - else - { - if(isset($i_public)) - $samp->share(0); - else - $samp->share($curUser->getId(), true); - } - ignore_user_abort($iua); $sampid = $samp->getId(); --- 88,91 ---- *************** *** 217,227 **** } - if(isset($i_public)) $pub = "checked"; - else $pub = $samp->isSharedWith(0) ? "checked" : ""; - ?> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr ><?= html($samp->getDescr(), 0) ?></textarea></td></tr> - <tr><th>Public</th><td><input type=checkbox name=i_public <?= $pub ?>></td></tr> <tr><th>Sample date</th><td><input type=text name=i_sdate size=10 value="<?= html($samp->getSampleDate(), 0) ?>"> --- 209,215 ---- *************** *** 274,278 **** } ! $uname = Submitter::getNameFromId($samp->getOwner()); $tnames = SampleTissue::getAncestorNames($samp->getTissue()); if(!count($tnames)) --- 262,266 ---- } ! $uname = UserGroup::getNameFromId($samp->getOwner()); $tnames = SampleTissue::getAncestorNames($samp->getTissue()); if(!count($tnames)) *************** *** 286,290 **** <tr><th>Date added</th><td><?= htmldate($samp->getAddedDate()) ?></td></tr> <tr><th>Owner</th><td><?= html($uname) ?></td></tr> - <tr><th>Public</th><td><?= $samp->isSharedWith(0) ? "Yes" : "No" ?></td></tr> <tr><td colspan=2 class=tiny> </td></tr> <tr><th colspan=2 class=subhead>Annotations</th></tr> --- 274,277 ---- Index: sample_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_list.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** sample_list.phtml 12 Sep 2002 22:37:56 -0000 1.15 --- sample_list.phtml 16 Sep 2002 14:20:57 -0000 1.16 *************** *** 39,42 **** --- 39,86 ---- showDelPrep(); + // Sharing + if(!isset($i_sh) || !is_array($i_sh)) + $i_sh = array(); + $userid = $curUser->getId(); + $users = UserGroup::getBrief(); + unset($users[$userid]); + [...261 lines suppressed...] + <option value=1>Share + <option value=0 <?= isset($i_shhow) && !$i_shhow ? "selected" : "" + ?>>Unshare</select> marked samples with + <select name=i_shwho> + <? + for(reset($users); list($id, $n) = each($users); ) + { + $sel = isset($i_shwho) && $id == $i_shwho ? "selected" : ""; + echo "<option $sel value=$id>".html($n, 0)."\n"; + } + ?> + </select><input type=submit name=i_shgo value='Ok'> + <input type=submit name=i_shunall value="Unshare with all" + onClick="return confirm('Are you sure?')"> + </td></tr> + <? + } + showDelLinks($cols); ?> Index: sampleannot_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannot_edit.phtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sampleannot_edit.phtml 10 Sep 2002 23:06:29 -0000 1.10 --- sampleannot_edit.phtml 16 Sep 2002 14:20:57 -0000 1.11 *************** *** 26,29 **** --- 26,30 ---- require_once("init.inc.php"); require_once("sampleannotation.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_BIO_ANNOT); *************** *** 44,108 **** $edit = true; $err = ""; [...169 lines suppressed...] ! } ! ?> <tr><th>Name</th><td><input type=text size=30 name=i_name maxlength=<?= CLEN_SAMPLEANNOTATION_NAME ?> value="<?= html($sat->getName(), 0) ?>"> <?= webHelp(59) ?></td></tr> + <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr + ><?= html($sat->getDescr(), 0) ?></textarea></td></tr> + + <tr><th>Date added</th><td><?= htmldate($sat->getAddedDate()) ?></td></tr> + <tr><th>Added by</th><td><?= + html(Submitter::getNameFromId($sat->getOwner())) ?></td></tr> <tr><th>Type</th><td><select name=i_type onChange='this.form.submit()'> <? *************** *** 169,170 **** --- 203,205 ---- </body> </html> + Index: sampleannot_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannot_list.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sampleannot_list.phtml 29 Aug 2002 16:51:34 -0000 1.9 --- sampleannot_list.phtml 16 Sep 2002 14:20:57 -0000 1.10 *************** *** 26,31 **** --- 26,44 ---- require_once("init.inc.php"); require_once("sampleannotation.inc.php"); + require_once("search.inc.php"); + require_once("searchhtml.inc.php"); + require_once("item_common.inc.php"); verifyAccess(BUA_BIO_READ); + showDelPrep(); + [...82 lines suppressed...] echo "<tr bgcolor=$tdbg[$odd]>". ! "<td>$link".remMark($s["removed"])."</td>". ! "<td>".html($types[$s["valueType"]])."</td>". ! "<td>".html($s["options"])."</td>". ! "<td>".html($s["defaultValue"])."</td>". ! "<td>".html($s["descr"])."</td>". ! "<td>".htmldate($s["addedDate"])."</td>". ! "<td>".html($s["userName"])."</td>". "</tr>\n"; } ! $cols = 7; ! if($addlink != "") ! echo "<tr><td colspan=$cols>$addlink</td></tr>\n"; ! showDelLinks($cols); ?> + </form> </table> Index: sampleannotation.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannotation.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** sampleannotation.inc.php 10 Sep 2002 23:06:29 -0000 1.17 --- sampleannotation.inc.php 16 Sep 2002 14:20:57 -0000 1.18 *************** *** 24,28 **** // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ! require_once("db.inc.php"); define("CLEN_SAMPLEANNOTATION_NAME", 40); --- 24,28 ---- // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ! require_once("item.inc.php"); [...421 lines suppressed...] ! "FROM SampleAnnotation sa, SampleAnnotationType sat ". ! "WHERE sa.sample = ".(int)$sample." ". ! "AND sat.id = sa.`annotationType` ". ! Item::whereRemovedAnd("sat", $removed); ! "ORDER BY sa.`annotationType`"; $arr = array(); $res = query($query); *************** *** 297,301 **** } ! function removeId($sample, $annotationType) { $sample = (int)$sample; --- 335,339 ---- } ! function remove($sample, $annotationType) { $sample = (int)$sample; Index: session.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/session.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** session.inc.php 8 Sep 2002 22:38:08 -0000 1.6 --- session.inc.php 16 Sep 2002 14:20:57 -0000 1.7 *************** *** 42,46 **** function read($cookie = "", $ip = "") { ! if($cookie != "") $this->cookie = $cookie; $query = "SELECT * FROM Cookie ". --- 42,47 ---- function read($cookie = "", $ip = "") { ! if($cookie != "") ! $this->cookie = $cookie; $query = "SELECT * FROM Cookie ". *************** *** 81,86 **** { $query = "UPDATE Cookie SET ". ! "`lastSeen` = NOW(), ". ! "`IP` = '".addslashes($this->IP)."' ". "WHERE cookie = '".addslashes($this->cookie)."'"; return (bool)query($query); --- 82,86 ---- { $query = "UPDATE Cookie SET ". ! "`lastSeen` = NOW() ". "WHERE cookie = '".addslashes($this->cookie)."'"; return (bool)query($query); *************** *** 154,158 **** function Session() { ! $this->user = new Submitter(); $this->cookie = new Cookie(); } --- 154,158 ---- function Session() { ! $this->user = new UserAccount(); $this->cookie = new Cookie(); } *************** *** 175,185 **** } ! // Update time and IP address now. ! $this->cookie->setIP($remoteAddr); $this->cookie->write(); return true; } ! function attemptLogin($userName, $password, $remoteAddr = "") { // Correct username and password? --- 175,184 ---- } ! // Update cookie timestamp. $this->cookie->write(); return true; } ! function attemptLogin($userName, $password, $remoteAddr) { // Correct username and password? *************** *** 213,226 **** } - 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; - } } --- 212,215 ---- Index: test.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/test.phtml,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** test.phtml 12 Sep 2002 11:45:26 -0000 1.48 --- test.phtml 16 Sep 2002 14:20:57 -0000 1.49 *************** *** 26,33 **** header("content-type: text/plain"); ! echo "old PHP_SELF: $_SERVER[PHP_SELF]\n"; ! require_once("init.inc.php"); - echo "new PHP_SELF: $PHP_SELF\n"; /*echo "Testing db...\n"; --- 26,52 ---- header("content-type: text/plain"); ! function foo($s1, $s2) ! { ! for($sub = 0; $sub < 3; $sub++) ! { ! sscanf(substr($s1, $sub * 6, 6), "%x", $a); ! sscanf(substr($s2, $sub * 6, 6), "%x", $b); ! if($a & $b) return 1; ! } ! return 0; ! } ! ! for($p = 3; $p < 32; $p += 4) ! { ! $s = sprintf("%x", 1 << $p); ! $s = "$s$s"; ! echo "$s / 192 : ".foo($s, "300")."\n"; ! echo "$s / 8.. : ".foo($s, "80000000")."\n"; ! echo "$s / max : ".foo($s, "ffffffff")."\n"; ! } ! ! ! //require_once("init.inc.php"); /*echo "Testing db...\n"; Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** user.inc.php 11 Sep 2002 09:02:50 -0000 1.11 --- user.inc.php 16 Sep 2002 14:20:57 -0000 1.12 *************** *** 25,107 **** // require_once("db.inc.php"); ! define("CLEN_SUBMITTER_USERNAME", 40); ! define("CLEN_SUBMITTER_NAME", 40); ! define("CLEN_SUBMITTER_EMAIL", 80); ! define("CLEN_SUBMITTER_ADDRESS", 255); ! define("CLEN_SUBMITTER_PHONE", 60); ! define("CLEN_SUBMITTER_FAX", 60); [...689 lines suppressed...] ! $query = "SELECT ug.*, ua.*, ". ! "(ug.`accessMask` & (".BUA_SUPERUSER.")) AS `superUser` ". ! "FROM UserGroup ug, UserAccount ua ". ! "WHERE ug.id = ua.`userGroup` ".$search->getWhere()." ". ! $search->getExtraWhere()." $ob ".$search->makeLimit(); $arr = array(); $res = query($query); + $now = strtotime(now()); while($row =& db_fetch_assoc($res)) { ! $row["daysLeft"] = (strtotime($row["activeUntil"]) - $now) / 86400; $arr[] = $row; } return $arr; } + } |