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"); |