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> <? } |