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