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"]); + } + ?> |