Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv8081 Modified Files: acquisition.inc.php array.inc.php array_batch.phtml array_common.inc.php array_edit.phtml array_print.phtml bio.inc.php bioassay.inc.php bioassayset.inc.php eventlog.inc.php experiment.inc.php experiment_common.inc.php experiment_edit.phtml experiment_list.phtml extract_edit.phtml genelist.inc.php genelist_edit.phtml hyb.inc.php hyb_edit.phtml hyb_image.phtml hyb_result.phtml image.inc.php item.inc.php job.inc.php labeled_edit.phtml left.phtml misc.inc.php molecule.inc.php molecule_list.phtml news.inc.php news_edit.phtml plate.inc.php plate_arrange.phtml plate_edit.phtml plate_upload.phtml platetype_edit.phtml probe_search.phtml program.inc.php program_edit.phtml protocol.inc.php protocol_edit.phtml raw.inc.php raw_common.inc.php raw_edit.phtml sample_edit.phtml sampleannot_edit.phtml sampleannotation.inc.php sampletissue.inc.php sampletissue_tree.phtml search.inc.php searchhtml.inc.php trans_create.phtml transformation.inc.php upload.inc.php user.inc.php user_edit.phtml ware.inc.php ware_edit.phtml wizzzard.inc.php wizzzard_new.phtml Log Message: Defined constants CLEN_... with text column length limits, added maxlength to text INPUTs Index: acquisition.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/acquisition.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** acquisition.inc.php 10 Sep 2002 09:29:44 -0000 1.15 --- acquisition.inc.php 10 Sep 2002 23:04:36 -0000 1.16 *************** *** 28,31 **** --- 28,33 ---- require_once("hyb.inc.php"); + define("CLEN_IMAGEACQUISITION_NAME", 60); + class ImageAcquisition extends Item { *************** *** 121,124 **** --- 123,130 ---- } + function setName($val) + { + $this->name = maxlen($val, CLEN_IMAGEACQUISITION_NAME); + } function setHybridization($val) { *************** *** 127,131 **** function setscanDate($val) { ! $this->scanDate = $val; } --- 133,137 ---- function setscanDate($val) { ! $this->scanDate = strtodate($val); } Index: array.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array.inc.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** array.inc.php 9 Sep 2002 19:55:46 -0000 1.36 --- array.inc.php 10 Sep 2002 23:04:36 -0000 1.37 *************** *** 27,30 **** --- 27,36 ---- 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); + class ArrayType extends Item { *************** *** 143,147 **** function setPlatform($val) { ! $this->platform = $val; } function setProtocol($val) --- 149,153 ---- function setPlatform($val) { ! $this->platform = maxlen($val, CLEN_ARRAYTYPE_PLATFORM); } function setProtocol($val) *************** *** 607,619 **** function setprintStartDate($val) { ! $this->printStartDate = $val; } function setprintEndDate($val) { ! $this->printEndDate = $val; } function setsurfaceType($val) { ! $this->surfaceType = $val; } function setprotocol($val) --- 613,625 ---- function setprintStartDate($val) { ! $this->printStartDate = strtodate($val); } function setprintEndDate($val) { ! $this->printEndDate = strtodate($val); } function setsurfaceType($val) { ! $this->surfaceType = maxlen($val, CLEN_ARRAYBATCH_SURFACETYPE); } function setprotocol($val) Index: array_batch.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_batch.phtml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** array_batch.phtml 7 Sep 2002 11:36:31 -0000 1.18 --- array_batch.phtml 10 Sep 2002 23:04:37 -0000 1.19 *************** *** 153,158 **** ?> <tr><th>Array design</th><td><?= $link ?></td></tr> ! <tr><th>Print name</th><td><input type=text name=i_name size=10 value="<?= ! html($ab->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_descr cols=40 rows=4 wrap=soft><?= html($ab->getDescr(), 0) ?></textarea></td></tr> --- 153,159 ---- ?> <tr><th>Array design</th><td><?= $link ?></td></tr> ! <tr><th>Print name</th><td><input type=text name=i_name size=10 ! maxlength=<?= CLEN_ARRAYBATCH_NAME ?> ! value="<?= html($ab->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_descr cols=40 rows=4 wrap=soft><?= html($ab->getDescr(), 0) ?></textarea></td></tr> *************** *** 160,168 **** wrap=soft><?= html($ab->getNotes(), 0) ?></textarea></td></tr> <tr><th>Print started (Y-m-d H:m:s)</th><td><input type=text name=i_sdate ! size=18 value="<?= html($ab->getPrintStartDate(), 0) ?>"></td></tr> <tr><th>Print ended (Y-m-d H:m:s)</th><td><input type=text name=i_edate ! size=18 value="<?= html($ab->getPrintEndDate(), 0) ?>"></td></tr> ! <tr><th>Surface type</th><td><input type=text name=i_surf ! size=18 value="<?= html($ab->getSurfaceType(), 0) ?>"></td></tr> <tr><th>Printing protocol</th><td><select name=i_proto> <? --- 161,174 ---- wrap=soft><?= html($ab->getNotes(), 0) ?></textarea></td></tr> <tr><th>Print started (Y-m-d H:m:s)</th><td><input type=text name=i_sdate ! size=18 value="<?= html($ab->getPrintStartDate(), 0) ?>"> ! <input type=button value="Now" ! onClick="this.form.i_sdate.value='<?= now() ?>'"></td></tr> <tr><th>Print ended (Y-m-d H:m:s)</th><td><input type=text name=i_edate ! size=18 value="<?= html($ab->getPrintEndDate(), 0) ?>"> ! <input type=button value="Now" ! onClick="this.form.i_edate.value='<?= now() ?>'"></td></tr> ! <tr><th>Surface type</th><td><input type=text name=i_surf size=18 ! maxlength=<?= CLEN_ARRAYBATCH_SURFACETYPE ?> ! value="<?= html($ab->getSurfaceType(), 0) ?>"></td></tr> <tr><th>Printing protocol</th><td><select name=i_proto> <? Index: array_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_common.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** array_common.inc.php 29 Aug 2002 16:51:33 -0000 1.10 --- array_common.inc.php 10 Sep 2002 23:04:40 -0000 1.11 *************** *** 297,311 **** else $e = "<td class=red>$errs[$pos]</td>"; ! echo "<tr bgcolor=$tdbg[$odd]>". ! "<td><input type=text size=14 name='i_barcode[$pos]' ". ! "value=\"".html($bc, 0)."\"></td>". ! "<td>".$pos."</td>". ! "<td><select name='i_state[$pos]'><option $dn value=0>No". ! "<option $dy value=1>Yes</select></td>". ! "<td>".$hlink."</td>". ! "<td>".html($b["userName"])."</td>". ! "<td><input type=text size=40 name='i_adescr[$pos]' ". ! "value=\"".html($descr, 0)."\"></td>". ! "$e</tr>\n"; unset($i_barcode[$pos]); } --- 297,317 ---- else $e = "<td class=red>$errs[$pos]</td>"; ! ?> ! <tr bgcolor=<? $tdbg[$odd] ?>> ! <td><input type=text size=14 name='i_barcode[<?= $pos ?>]' ! maxlength=<?= CLEN_ARRAY_BARCODE ?> ! value="<?= html($bc, 0) ?>"></td> ! <td><?= $pos ?></td> ! <td><select name='i_state[<?= $pos ?>]'> ! <option <?= $dn ?> value=0>No ! <option <?= $dy ?> value=1>Yes ! </select></td> ! <td><?= $hlink ?></td> ! <td><?= html($b["userName"]) ?></td> ! <td><input type=text size=40 name='i_adescr[$pos]' ! value="<?= html($descr, 0) ?>"></td> ! <?= $e ?> ! </tr> ! <? unset($i_barcode[$pos]); } *************** *** 326,329 **** --- 332,336 ---- echo "<tr bgcolor=$tdbg[$odd]>". "<td><input type=text size=14 name='i_barcode[$pos]' ". + "maxlength=".CLEN_ARRAY_BARCODE." ". "value=\"".html($bc, 0)."\"></td>". "<td>".$pos." (new)</td>". *************** *** 344,347 **** --- 351,355 ---- echo "<tr bgcolor=$tdbg[$odd]>". "<td><input type=text size=14 name='i_barcode[$pos]' ". + "maxlength=".CLEN_ARRAY_BARCODE." ". "value=''></td>". "<td>".$pos." (new)</td>". *************** *** 358,363 **** <? } - - ?> --- 366,369 ---- Index: array_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_edit.phtml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** array_edit.phtml 29 Aug 2002 16:51:33 -0000 1.21 --- array_edit.phtml 10 Sep 2002 23:04:45 -0000 1.22 *************** *** 162,167 **** --- 162,169 ---- <tr><th>Design name</th><td><input type=text size=20 name=i_name + maxlength=<?= CLEN_ARRAYTYPE_NAME ?> value="<?= html($at->getName(), 0) ?>"></td></tr> <tr><th>Platform type</th><td><input type=text size=20 name=i_plat + maxlength=<?= CLEN_ARRAYTYPE_PLATFORM ?> value="<?= html($at->getPlatform(), 0) ?>"></td></tr> <tr><th>Configuration (protocol)</th><td> Index: array_print.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/array_print.phtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** array_print.phtml 29 Aug 2002 16:51:33 -0000 1.17 --- array_print.phtml 10 Sep 2002 23:04:47 -0000 1.18 *************** *** 157,161 **** ?> ick 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> </form> --- 157,162 ---- ?> ick 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> </form> Index: bio.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bio.inc.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** bio.inc.php 9 Sep 2002 19:55:46 -0000 1.23 --- bio.inc.php 10 Sep 2002 23:04:50 -0000 1.24 *************** *** 28,31 **** --- 28,35 ---- /*require_once("project.inc.php");*/ + define("CLEN_SAMPLE_NAME", CLEN_ITEM_NAME); + define("CLEN_EXTRACT_NAME", CLEN_ITEM_NAME); + define("CLEN_LABELEDEXTRACT_NAME", CLEN_ITEM_NAME); + class Sample extends Item { Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassay.inc.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** bioassay.inc.php 10 Sep 2002 10:57:41 -0000 1.35 --- bioassay.inc.php 10 Sep 2002 23:04:52 -0000 1.36 *************** *** 29,32 **** --- 29,34 ---- require_once("search.inc.php"); + define("CLEN_BIOASSAY_NAME", 50); + class BioAssay extends Item { *************** *** 131,134 **** --- 133,140 ---- [...137 lines suppressed...] *** 1017,1025 **** $groups = array("rbad.block", "rbad.flags", ! "FLOOR(LOG(bad.ratio)/LOG(2)+.5)"); $rawgroups = array(1, 1, 0, 1, 1); if($histbox == -1) { ! $groups[2] = "FLOOR(LOG(bad.ratio)*30+.5)"; $rawgroups[2] = 1; $extra = "rbad.dia,"; --- 1032,1040 ---- $groups = array("rbad.block", "rbad.flags", ! "ROUND(".db_func_log("bad.ratio", 2).")"); $rawgroups = array(1, 1, 0, 1, 1); if($histbox == -1) { ! $groups[2] = "ROUND(".db_func_log("bad.ratio")."*30.)"; $rawgroups[2] = 1; $extra = "rbad.dia,"; Index: bioassayset.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassayset.inc.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** bioassayset.inc.php 10 Sep 2002 10:57:41 -0000 1.27 --- bioassayset.inc.php 10 Sep 2002 23:04:54 -0000 1.28 *************** *** 29,32 **** --- 29,34 ---- require_once("transformation.inc.php"); + define("CLEN_BIOASSAYSET_NAME", 30); + class BioAssaySet extends Item { *************** *** 164,167 **** --- 166,173 ---- } + function setName($val) + { + $this->name = maxlen($val, CLEN_BIOASSAYSET_NAME); + } function setexperiment($val) { *************** *** 253,257 **** $id = (int)$id; $query = "SELECT COUNT(*) FROM BioAssay ". ! "WHERE bioAssaySet = $id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; --- 259,263 ---- $id = (int)$id; $query = "SELECT COUNT(*) FROM BioAssay ". ! "WHERE `bioAssaySet` = $id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; *************** *** 270,274 **** $query = "SELECT COUNT(*) ". "FROM BioAssay ba, $config[dbDynamic]BioAssayData$expid bad ". ! "WHERE ba.bioAssaySet = $id AND bad.bioAssay = ba.id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; --- 276,280 ---- $query = "SELECT COUNT(*) ". "FROM BioAssay ba, $config[dbDynamic]BioAssayData$expid bad ". ! "WHERE ba.`bioAssaySet` = $id AND bad.`bioAssay` = ba.id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; *************** *** 287,291 **** $query = "SELECT COUNT(*) ". "FROM $config[dbDynamic]BioAssaySetGene$expid ". ! "WHERE bioAssaySet = $id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; --- 293,297 ---- $query = "SELECT COUNT(*) ". "FROM $config[dbDynamic]BioAssaySetGene$expid ". ! "WHERE `bioAssaySet` = $id"; $res = query($query); if($row =& db_fetch_row($res)) return $row[0]; Index: eventlog.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/eventlog.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** eventlog.inc.php 8 Sep 2002 22:38:08 -0000 1.5 --- eventlog.inc.php 10 Sep 2002 23:04:57 -0000 1.6 *************** *** 26,29 **** --- 26,31 ---- require_once("db.inc.php"); + define("CLEN_EVENTLOG_MESSAGE", 255); + class EventLog { *************** *** 32,36 **** $query = "INSERT INTO EventLog ". "(`eventDate`, `eventType`, message) VALUES ". ! "(NOW(), '".addslashes($type)."', '".addslashes($message)."')"; return (bool)query($query); } --- 34,39 ---- $query = "INSERT INTO EventLog ". "(`eventDate`, `eventType`, message) VALUES ". ! "(NOW(), '".addslashes($type)."', ". ! "'".addslashes(maxlen($message, CLEN_EVENTLOG_MESSAGE))."')"; return (bool)query($query); } Index: experiment.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment.inc.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** experiment.inc.php 9 Sep 2002 10:56:08 -0000 1.49 --- experiment.inc.php 10 Sep 2002 23:04:59 -0000 1.50 *************** *** 27,30 **** --- 27,39 ---- require_once("bioassayset.inc.php"); + define("CLEN_EXPERIMENT_NAME", 30); + define("CLEN_EXPERIMENT_AUTHORS", 65535); + define("CLEN_EXPERIMENT_AFFILIATIONS", 65535); + define("CLEN_EXPERIMENT_EXPERIMENTTYPE", 255); + define("CLEN_EXPERIMENT_EXPERIMENTDESIGN", 65535); + define("CLEN_EXPERIMENT_PUBLICATIONS", 65535); + define("CLEN_EXPERIMENT_ABSTRACT", 65535); + define("CLEN_EXPERIMENT_PUBMEDID", 40); + class Experiment extends Item { *************** *** 210,213 **** --- 219,226 ---- } + function setName($val) + { + $this->name = maxlen($val, CLEN_EXPERIMENT_NAME); + } function setshownTab($val) { *************** *** 241,269 **** function setauthors($val) { ! $this->authors = $val; } function setaffiliations($val) { ! $this->affiliations = $val; } function setexperimentType($val) { ! $this->experimentType = $val; } function setexperimentDesign($val) { ! $this->experimentDesign = $val; } function setpublication($val) { ! $this->publication = $val; } function setabstract($val) { ! $this->abstract = $val; } function setpubMedId($val) { ! $this->pubMedId = $val; } function setpublicationDate($val) --- 254,282 ---- function setauthors($val) { ! $this->authors = maxlen($val, CLEN_EXPERIMENT_AUTHORS); } function setaffiliations($val) { ! $this->affiliations = maxlen($val, CLEN_EXPERIMENT_AFFILIATIONS); } function setexperimentType($val) { ! $this->experimentType = maxlen($val, CLEN_EXPERIMENT_EXPERIMENTTYPE); } function setexperimentDesign($val) { ! $this->experimentDesign = maxlen($val, CLEN_EXPERIMENT_EXPERIMENTDESIGN); } function setpublication($val) { ! $this->publication = maxlen($val, CLEN_EXPERIMENT_PUBLICATION); } function setabstract($val) { ! $this->abstract = maxlen($val, CLEN_EXPERIMENT_ABSTRACT); } function setpubMedId($val) { ! $this->pubMedId = maxlen($val, CLEN_EXPERIMENT_PUBMEDID); } function setpublicationDate($val) Index: experiment_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment_common.inc.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** experiment_common.inc.php 29 Aug 2002 16:51:33 -0000 1.31 --- experiment_common.inc.php 10 Sep 2002 23:05:00 -0000 1.32 *************** *** 351,354 **** --- 351,355 ---- <input type=hidden name=i_setupdate value=<?= $setid ?>> <tr><th>Name</th><td><input type=text name=i_setname size=15 + maxlength=<?= CLEN_BIOASSAYSET_NAME ?> value="<?= html($set->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_setdescr cols=50 rows=5 *************** *** 545,548 **** --- 546,550 ---- <input type=hidden name=i_tranupdate value=<?= $tranid ?>> <tr><th>Name</th><td><input type=text name=i_tranname size=15 + maxlength=<?= CLEN_TRANSFORMATION_NAME ?> value="<?= html($tran->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_trandescr cols=50 rows=5 Index: experiment_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment_edit.phtml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** experiment_edit.phtml 29 Aug 2002 16:51:33 -0000 1.25 --- experiment_edit.phtml 10 Sep 2002 23:05:00 -0000 1.26 *************** *** 251,254 **** --- 251,255 ---- ?> <tr><th>Name</th><td><input type=text size=30 name=i_name + maxlength=<?= CLEN_EXPERIMENT_NAME ?> value="<?= html($exp->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea cols=70 rows=5 name=i_descr><?= *************** *** 259,264 **** --- 260,267 ---- html($exp->getAffiliations(), 0) ?></textarea></td></tr> <tr><th>Experiment type</th><td><input type=text size=30 name=i_etype + maxlength=<?= CLEN_EXPERIMENT_EXPERIMENTTYPE ?> value="<?= html($exp->getExperimentType(), 0) ?>"></td></tr> <tr><th>Experiment design</th><td><input type=text size=30 name=i_edesign + maxlength=<?= CLEN_EXPERIMENT_EXPERIMENTDESIGN ?> value="<?= html($exp->getExperimentDesign(), 0) ?>"></td></tr> <tr><th>Publication</th><td><textarea cols=70 rows=5 name=i_publ><?= *************** *** 267,273 **** html($exp->getAbstract(), 0) ?></textarea></td></tr> <tr><th>PubMed ID</th><td><input type=text size=30 name=i_pubmed value="<?= html($exp->getPubMedId(), 0) ?>"></td></tr> <tr><th>Publication date</th><td><input type=text size=30 name=i_pubdate ! value="<?= htmldate($exp->getPublicationDate(), false) ?>"></td></tr> <tr><td colspan=2><input type=submit value="Accept" name=i_ok></td></tr> <? --- 270,279 ---- html($exp->getAbstract(), 0) ?></textarea></td></tr> <tr><th>PubMed ID</th><td><input type=text size=30 name=i_pubmed + maxlength=<?= CLEN_EXPERIMENT_PUBMEDID ?> value="<?= html($exp->getPubMedId(), 0) ?>"></td></tr> <tr><th>Publication date</th><td><input type=text size=30 name=i_pubdate ! value="<?= htmldate($exp->getPublicationDate(), false) ?>"> ! <input type=button value="Today" ! onClick="this.form.i_pubdate.value='<?= today() ?>'"></td></tr> <tr><td colspan=2><input type=submit value="Accept" name=i_ok></td></tr> <? *************** *** 382,386 **** <? $opt = "Create new BioAssaySet ".webHelp(42)." called ". ! "<input type=text name=i_setname size=12> from ". "<select name=i_setrawsource>". "<option value='1_0_-1_0_0_0_0'>Mean FG - Mean BG\n". --- 388,393 ---- <? $opt = "Create new BioAssaySet ".webHelp(42)." called ". ! "<input type=text name=i_setname size=12 ". ! "maxlength=".CLEN_BIOASSAY_NAME."> from ". "<select name=i_setrawsource>". "<option value='1_0_-1_0_0_0_0'>Mean FG - Mean BG\n". Index: experiment_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/experiment_list.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** experiment_list.phtml 5 Aug 2002 11:29:32 -0000 1.9 --- experiment_list.phtml 10 Sep 2002 23:05:01 -0000 1.10 *************** *** 95,99 **** <p><table <?= $cellpad ?>> <tr><td>Start new experiment: ! <input type=text size=10 name=i_expname> <input type=submit value='Go' name=i_expgo></td></tr> </form> --- 95,100 ---- <p><table <?= $cellpad ?>> <tr><td>Start new experiment: ! <input type=text size=10 name=i_expname ! maxlength=<?= CLEN_EXPERIMENT_NAME ?>> <input type=submit value='Go' name=i_expgo></td></tr> </form> Index: extract_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/extract_edit.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** extract_edit.phtml 29 Aug 2002 16:51:33 -0000 1.13 --- extract_edit.phtml 10 Sep 2002 23:05:02 -0000 1.14 *************** *** 202,205 **** --- 202,206 ---- <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> Index: genelist.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** genelist.inc.php 9 Sep 2002 06:29:34 -0000 1.21 --- genelist.inc.php 10 Sep 2002 23:05:02 -0000 1.22 *************** *** 26,29 **** --- 26,31 ---- require_once("item.inc.php"); + define("CLEN_GENELIST_NAME", 50); + class GeneList extends Item { *************** *** 85,88 **** --- 87,94 ---- } + function setName($val) + { + $this->name = maxlen($val, CLEN_GENELIST_NAME); + } function setExperiment($val) { Index: genelist_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/genelist_edit.phtml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** genelist_edit.phtml 7 Sep 2002 13:11:44 -0000 1.14 --- genelist_edit.phtml 10 Sep 2002 23:05:05 -0000 1.15 *************** *** 170,173 **** --- 170,174 ---- <tr><th>Name</th><td colspan=3><input type=text size=30 name=i_name + maxlength=<?= CLEN_GENELIST_NAME ?> value="<?= html($glist->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td colspan=3><textarea cols=40 rows=5 name=i_descr Index: hyb.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb.inc.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** hyb.inc.php 9 Sep 2002 19:55:46 -0000 1.20 --- hyb.inc.php 10 Sep 2002 23:05:10 -0000 1.21 *************** *** 27,30 **** --- 27,32 ---- require_once("bio.inc.php"); + define("CLEN_HYBRIDIZATION_NAME", CLEN_ITEM_NAME); + class Hybridization extends Item { Index: hyb_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_edit.phtml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** hyb_edit.phtml 29 Aug 2002 16:51:34 -0000 1.31 --- hyb_edit.phtml 10 Sep 2002 23:05:13 -0000 1.32 *************** *** 229,232 **** --- 229,233 ---- <tr><th>Name</th><td><input type=text size=30 name=i_name + maxlength=<?= CLEN_HYBRIDIZATION_NAME ?> value="<?= html($hyb->getName(), 0) ?>"></td></tr> <? Index: hyb_image.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_image.phtml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** hyb_image.phtml 29 Aug 2002 16:51:34 -0000 1.22 --- hyb_image.phtml 10 Sep 2002 23:05:22 -0000 1.23 *************** *** 283,286 **** --- 283,287 ---- <tr><th>Hybridization</th><td><?= html($hyb->getName()) ?></td></tr> <tr><th>Image set name</th><td><input type=text size=30 name=i_name + maxlength=<?= CLEN_IMAGEACQUISITION_NAME ?> value="<?= html($acq->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea wrap=soft cols=45 rows=6 name=i_descr Index: hyb_result.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/hyb_result.phtml,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** hyb_result.phtml 7 Sep 2002 11:36:32 -0000 1.53 --- hyb_result.phtml 10 Sep 2002 23:05:26 -0000 1.54 *************** *** 175,178 **** --- 175,179 ---- <tr><th>Data set(RawBioAssay) name <?= webHelp(82) ?></th> <td><input type=text name=i_name size=30 + maxlength=<?= CLEN_RAWBIOASSAY_NAME ?> value="<?= html($raw->getName(), 0) ?>"></td></tr> <tr><th>Feature extraction software</th><td> Index: image.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/image.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** image.inc.php 10 Sep 2002 09:29:44 -0000 1.13 --- image.inc.php 10 Sep 2002 23:05:29 -0000 1.14 *************** *** 27,30 **** --- 27,32 ---- require_once("acquisition.inc.php"); + define("CLEN_IMAGE_NAME", 150); + class Image extends Item { *************** *** 110,113 **** --- 112,119 ---- } + function setName($val) + { + $this->name = maxlen($val, CLEN_IMAGE_NAME); + } function setimageAcquisition($val) { Index: item.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/item.inc.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** item.inc.php 9 Sep 2002 19:55:26 -0000 1.27 --- item.inc.php 10 Sep 2002 23:05:33 -0000 1.28 *************** *** 27,30 **** --- 27,33 ---- require_once("misc.inc.php"); + define("CLEN_ITEM_NAME", 40); + define("CLEN_ITEM_DESCR", 255); + class Item { *************** *** 116,124 **** function setName($val) { ! $this->name = printable($val); } function setDescr($val) { ! $this->descr = $val; } function setAddedDate($val) --- 119,127 ---- function setName($val) { ! $this->name = printable(maxlen($val, CLEN_ITEM_NAME)); } function setDescr($val) { ! $this->descr = maxlen($val, CLEN_ITEM_DESCR); } function setAddedDate($val) Index: job.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/job.inc.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** job.inc.php 10 Sep 2002 10:57:41 -0000 1.38 --- job.inc.php 10 Sep 2002 23:05:42 -0000 1.39 *************** *** 27,30 **** --- 27,32 ---- require_once("transformation.inc.php"); + define("CLEN_JOBSETTING_SETTING", 65535); + class Job { Index: labeled_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/labeled_edit.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** labeled_edit.phtml 29 Aug 2002 16:51:34 -0000 1.13 --- labeled_edit.phtml 10 Sep 2002 23:05:53 -0000 1.14 *************** *** 211,214 **** --- 211,215 ---- ?> <tr><th>Name</th><td><input type=text size=20 name=i_name + maxlength=<?= CLEN_LABELEDEXTRACT_NAME ?> value="<?= html($lext->getName(), 0) ?>"></td></tr> Index: left.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/left.phtml,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** left.phtml 8 Sep 2002 22:38:08 -0000 1.45 --- left.phtml 10 Sep 2002 23:05:58 -0000 1.46 *************** *** 135,142 **** <input type=hidden name=location value="index.phtml"> <tr><td><?= $txt ?></td></tr> ! <tr><td class=tiny align=right>Login: <input class=tiny name=i_login type=text ! size=9 value="<?= isset($i_un) ? html($i_un, 0) : "" ?>"></td></tr> ! <tr><td class=tiny align=right>Pass: <input class=tiny name=i_password type=password ! size=9></td></tr> <tr><td align=right><input class=tiny type=submit value="Log in"></td></tr> <? --- 135,142 ---- <input type=hidden name=location value="index.phtml"> <tr><td><?= $txt ?></td></tr> ! <tr><td class=tiny align=right>Login: <input class=tiny name=i_login ! type=text size=9 value="<?= isset($i_un) ? html($i_un, 0) : "" ?>"></td></tr> ! <tr><td class=tiny align=right>Pass: <input class=tiny ! name=i_password type=password size=9></td></tr> <tr><td align=right><input class=tiny type=submit value="Log in"></td></tr> <? Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** misc.inc.php 9 Sep 2002 06:39:01 -0000 1.35 --- misc.inc.php 10 Sep 2002 23:06:00 -0000 1.36 *************** *** 40,47 **** } ! function maxlen(&$txt, $len) { ! if(strlen($txt) > $len) return substr($txt, 0, $len) . "..."; ! else return $txt; } --- 40,49 ---- } ! function maxlen(&$txt, $len, $etc = "") { ! if(strlen($txt) > $len) ! return substr($txt, 0, $len).$etc; ! else ! return $txt; } *************** *** 323,326 **** --- 325,333 ---- { return date("Y-m-d H:i:s"); + } + + function today() + { + return date("Y-m-d"); } Index: molecule.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule.inc.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** molecule.inc.php 9 Sep 2002 19:55:46 -0000 1.31 --- molecule.inc.php 10 Sep 2002 23:06:03 -0000 1.32 *************** *** 27,30 **** --- 27,53 ---- 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 [...93 lines suppressed...] { ! $this->geneSymbol = maxlen($val, CLEN_MOLECULE_GENESYMBOL); } function setChromosome($val) { ! $this->chromosome = maxlen($val, CLEN_MOLECULE_CHROMOSOME); } function setCytoBand($val) { ! $this->cytoBand = maxlen($val, CLEN_MOLECULE_CYTOBAND); } function setMarkers($val) { ! $this->markers = maxlen($val, CLEN_MOLECULE_MARKERS); } function setAntibiotics($val) { ! $this->antibiotics = maxlen($val, CLEN_MOLECULE_ANTIBIOTICS); } function setLocusLink($val) Index: molecule_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/molecule_list.phtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** molecule_list.phtml 5 Aug 2002 11:29:34 -0000 1.8 --- molecule_list.phtml 10 Sep 2002 23:06:05 -0000 1.9 *************** *** 156,160 **** $s["cloneId"])."</td>". "<td>".html($s["geneSymbol"])."</td>". ! "<td>".html(maxlen($s["geneName"], 40))."</td>". "<td>".html($s["chromosome"])."</td>". "<td>".html($s["cytoBand"])."</td>". --- 156,160 ---- $s["cloneId"])."</td>". "<td>".html($s["geneSymbol"])."</td>". ! "<td>".html(maxlen($s["geneName"], 40, "..."))."</td>". "<td>".html($s["chromosome"])."</td>". "<td>".html($s["cytoBand"])."</td>". Index: news.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/news.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** news.inc.php 9 Sep 2002 06:29:34 -0000 1.8 --- news.inc.php 10 Sep 2002 23:06:06 -0000 1.9 *************** *** 26,29 **** --- 26,31 ---- require_once("item.inc.php"); + define("CLEN_NEWS_NAME", 255); + class News extends Item { *************** *** 40,43 **** --- 42,50 ---- { return parent::write(array()); + } + + function setName($val) + { + $this->name = printable(maxlen($val, CLEN_NEWS_NAME)); } Index: news_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/news_edit.phtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** news_edit.phtml 29 Aug 2002 16:51:34 -0000 1.5 --- news_edit.phtml 10 Sep 2002 23:06:07 -0000 1.6 *************** *** 96,99 **** --- 96,100 ---- <tr><th>Title</th><td><input type=text size=50 name=i_name + maxlength=<?= CLEN_NEWS_NAME ?> value="<?= html($news->getName(), 0) ?>"></td></tr> <tr><th>News text</th><td><textarea cols=60 rows=9 name=i_descr Index: plate.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate.inc.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** plate.inc.php 9 Sep 2002 19:55:46 -0000 1.32 --- plate.inc.php 10 Sep 2002 23:06:13 -0000 1.33 *************** *** 26,29 **** --- 26,35 ---- 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 { *************** *** 115,119 **** function setNamePrefix($val) { ! $this->namePrefix = $val; } function setParentSuffix($val) --- 121,125 ---- function setNamePrefix($val) { ! $this->namePrefix = maxlen($val, CLEN_PLATETYPE_NAMEPREFIX); } function setParentSuffix($val) *************** *** 385,388 **** --- 391,398 ---- + function setName($val) + { + $this->name = printable(maxlen($val, CLEN_PLATE_NAME)); + } function resetId() { *************** *** 399,404 **** function setBarcode($val) { ! if($val === false || $val === NULL) $this->barcode = NULL; ! else $this->barcode = $val; } --- 409,416 ---- function setBarcode($val) { ! if($val === false || $val === NULL) ! $this->barcode = NULL; ! else ! $this->barcode = maxlen($val, CLEN_PLATE_BARCODE); } Index: plate_arrange.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_arrange.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** plate_arrange.phtml 5 Aug 2002 11:29:34 -0000 1.15 --- plate_arrange.phtml 10 Sep 2002 23:06:13 -0000 1.16 *************** *** 193,197 **** You may enter a string to be used as a prefix for the names of the plates. </td></tr> ! <form method=post action='<?= $PHP_SELF ?>'> <input type=hidden name=location value="<?= html($location, 0) ?>"> <tr><th>Plates</th><td><input type=text name=i_384s size=5 value=1></td></tr> --- 193,197 ---- You may enter a string to be used as a prefix for the names of the plates. </td></tr> ! <form method=post action='plate_arrange.phtml'> <input type=hidden name=location value="<?= html($location, 0) ?>"> <tr><th>Plates</th><td><input type=text name=i_384s size=5 value=1></td></tr> *************** *** 296,303 **** echo "<option $sel value=$id>".html($n)."\n"; } ! $edate = isset($i_edate[$eid]) ? html($i_edate[$eid], 0) : ""; ! echo "</select></td>". ! "<td><input type=text size=15 name=i_edate[$eid] ". ! "value=\"$edate\"></td></tr>\n"; } unset($e); --- 296,307 ---- echo "<option $sel value=$id>".html($n)."\n"; } ! ?> ! </select></td> ! <td><input type=text size=15 name="i_edate[<?= $eid ?>]" ! value="<?= isset($i_edate[$eid]) ? html($i_edate[$eid], 0) : "" ?>"> ! <input type=button value="Today" ! onClick="this.form['i_edate[<?= $eid ?>]'].value='<?= today()?>'" ! ></td></tr> ! <? } unset($e); *************** *** 338,341 **** --- 342,346 ---- </td><th>Name</th> <td><input type=text size=25 name='i_384name[<?= $newpos ?>]' + maxlength=<?= CLEN_PLATE_NAME ?> value="<?= html($name, 0) ?>" onFocus='foc(<?= $newpos ?>)'> <?= webHelp(24) ?></td> Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** plate_edit.phtml 9 Sep 2002 06:39:01 -0000 1.27 --- plate_edit.phtml 10 Sep 2002 23:06:15 -0000 1.28 *************** *** 286,292 **** --- 286,294 ---- <tr><th><?= $clone ? "Daughter plate name" : "Name" ?></th> <td><input type=text size=20 name=i_name + maxlength=<?= CLEN_PLATE_NAME ?> value="<?= html($plate->getName(), 0) ?>"> (<?= html($ptype->getName()) ?>)</td></tr> <tr><th>Barcode</th><td><input type=text size=20 name=i_bc + maxlength=<?= CLEN_PLATE_BARCODE ?> value="<?= html($plate->getBarcode(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr Index: plate_upload.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_upload.phtml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** plate_upload.phtml 9 Sep 2002 19:55:46 -0000 1.28 --- plate_upload.phtml 10 Sep 2002 23:06:17 -0000 1.29 *************** *** 78,82 **** ?> <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> </form> --- 78,83 ---- ?> <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> </form> *************** *** 133,136 **** --- 134,140 ---- html(addslashes($ptypes[$i]->getNamePrefix()), 0)."\";"; } + + if(isset($i_pref)) + $ptype->setNamePrefix($i_pref); ?> <script> *************** *** 152,158 **** </select></td></tr> <tr><th>Plate name prefix</th><td><input type=text size=15 ! name=i_pref value="<?= ! html(isset($i_pref) ? $i_pref : $ptype->getNamePrefix(), 0) ! ?>"></td></tr> <script>setPref(document.forms[0].i_pt);</script> <tr><th>Plate name padding</th><td>to --- 156,161 ---- </select></td></tr> <tr><th>Plate name prefix</th><td><input type=text size=15 ! name=i_pref maxlength=<?= CLEN_PLATETYPE_NAMEPREFIX ?> ! value="<?= html($ptype->getNamePrefix() 0) ?>"></td></tr> <script>setPref(document.forms[0].i_pt);</script> <tr><th>Plate name padding</th><td>to *************** *** 224,229 **** for(reset($protos); list($id, $n) = each($protos); ) echo "<option value=$id>".html($n)."\n"; ! echo "</select></td><td><input type=text size=15 ". ! "name=i_edate[$e[id]]></td></tr>\n"; } unset($e); --- 227,236 ---- for(reset($protos); list($id, $n) = each($protos); ) echo "<option value=$id>".html($n)."\n"; ! ?> ! </select></td><td><input type=text size=15 ! name="i_edate[<?= $e[id] ?>]"> <input type=button value="Today" ! onClick="this.form['i_edate[<?= $e[id] ?>]'].value='<?= today() ! ?>'"></td></tr> ! <? } unset($e); *************** *** 236,242 **** { $name = $i_pref . str_pad($pnum, $pad, " ", STR_PAD_LEFT); ! echo "<tr><td>".html($pnum)."</td><td><input type=text ". ! "name=\"i_pname[".html($pnum)."]\" value=\"".html($name)."\">". ! "</td><td>$wells</td></tr>\n"; } ?> --- 243,253 ---- { $name = $i_pref . str_pad($pnum, $pad, " ", STR_PAD_LEFT); ! ?> ! <tr><td><?= html($pnum) ?></td> ! <td><input type=text name="i_pname[<?= html($pnum) ?>]" ! size=15 maxlength=<?= CLEN_PLATE_NAME ?> ! value="<?= html($name, 0) ?>"></td> ! <td><?= $wells ?></td></tr> ! <? } ?> Index: platetype_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/platetype_edit.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** platetype_edit.phtml 9 Sep 2002 19:55:46 -0000 1.13 --- platetype_edit.phtml 10 Sep 2002 23:06:22 -0000 1.14 *************** *** 182,185 **** --- 182,186 ---- <tr><th>Name</th><td><input type=text size=20 name=i_name + maxlength=<?= CLEN_PLATETYPE_NAME ?> value="<?= html($ptype->getName(), 0) ?>"></td></tr> <? *************** *** 196,199 **** --- 197,201 ---- ?> <tr><th>Plate name prefix</th><td><input type=text size=20 name=i_prefix + maxlength=<?= CLEN_PLATETYPE_NAMEPREFIX ?> value="<?= html($ptype->getNamePrefix(), 0) ?>"></td></tr> <tr><th>Append parent plate name</th><td><input type=checkbox name=i_suffix *************** *** 210,213 **** --- 212,216 ---- { echo "<tr><td><input type=text size=20 name='i_ename[]' ". + "maxlength=".CLEN_PLATETYPE_NAMEPREFIX." ". "value=\"".html($eventTypes[$i]["name"], 0)."\"></td>\n". "<td><select name='i_proto[]'>"; *************** *** 229,232 **** --- 232,236 ---- $id = $eventTypes[$i]["id"]; echo "<tr><td><input type=text size=20 name='i_ename[$id]' ". + "maxlength=".CLEN_PLATETYPE_NAMEPREFIX." ". "value=\"".html($eventTypes[$i]["name"], 0)."\"></td>". "<td>".html($protoTypes[$eventTypes[$i]["protocolType"]]). Index: probe_search.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/probe_search.phtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** probe_search.phtml 5 Aug 2002 11:29:35 -0000 1.2 --- probe_search.phtml 10 Sep 2002 23:06:24 -0000 1.3 *************** *** 105,109 **** $s["cloneId"])."</td>". "<td>".html($s["geneSymbol"])."</td>". ! "<td>".html(maxlen($s["geneName"], 40))."</td>". "</tr>\n"; } --- 105,109 ---- $s["cloneId"])."</td>". "<td>".html($s["geneSymbol"])."</td>". ! "<td>".html(maxlen($s["geneName"], 40, "..."))."</td>". "</tr>\n"; } Index: program.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/program.inc.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** program.inc.php 10 Sep 2002 10:57:41 -0000 1.23 --- program.inc.php 10 Sep 2002 23:06:25 -0000 1.24 *************** *** 27,30 **** --- 27,34 ---- require_once("sampleannotation.inc.php"); + define("CLEN_PROGRAM_NAME", CLEN_ITEM_NAME); + define("CLEN_PROGRAM_EXECNAME", 40); + define("CLEN_PROGRAM_URL", 255); + class Program extends Item { *************** *** 120,124 **** function setExecName($val) { ! $this->execName = $val; } function setUsedColumns($val) --- 124,128 ---- function setExecName($val) { ! $this->execName = printable(maxlen($val, CLEN_PROGRAM_EXECNAME)); } function setUsedColumns($val) *************** *** 144,148 **** function setUrl($val) { ! $this->url = $val; } --- 148,152 ---- function setUrl($val) { ! $this->url = printable(maxlen($val, CLEN_PROGRAM_URL)); } Index: program_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/program_edit.phtml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** program_edit.phtml 31 Aug 2002 11:44:03 -0000 1.21 --- program_edit.phtml 10 Sep 2002 23:06:27 -0000 1.22 *************** *** 273,278 **** --- 273,280 ---- <tr><th>Name</th><td colspan=3><input type=text size=25 name=i_name + maxlength=<?= CLEN_PROGRAM_NAME ?> value="<?= html($prog->getName(), 0) ?>"></td></tr> <tr><th>Name of executable</th><td colspan=3><input type=text size=25 + maxlength=<?= CLEN_PROGRAM_EXECNAME ?> name=i_ename value="<?= html($prog->getExecName(), 0) ?>"></td></tr> *************** *** 281,285 **** $prog->getOnServer() ? "checked" : "" ?>></td></tr> <tr><th>Associated URL</th><td colspan=3><input type=text size=45 ! name=i_url value="<?= html($prog->getUrl(), 0) ?>"></td></tr> <tr><th>Description / Help text</th><td colspan=3><textarea name=i_descr rows=8 cols=60 wrap=soft><?= html($prog->getDescr(), 0) --- 283,288 ---- $prog->getOnServer() ? "checked" : "" ?>></td></tr> <tr><th>Associated URL</th><td colspan=3><input type=text size=45 ! name=i_url maxlength=<?= CLEN_PROGRAM_URL ?> ! value="<?= html($prog->getUrl(), 0) ?>"></td></tr> <tr><th>Description / Help text</th><td colspan=3><textarea name=i_descr rows=8 cols=60 wrap=soft><?= html($prog->getDescr(), 0) Index: protocol.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** protocol.inc.php 8 Sep 2002 23:12:40 -0000 1.9 --- protocol.inc.php 10 Sep 2002 23:06:27 -0000 1.10 *************** *** 27,30 **** --- 27,33 ---- require_once("upload.inc.php"); + define("CLEN_PROTOCOL_NAME", 30); + + class Protocol { *************** *** 119,123 **** function setName($val) { ! $this->name = $val; } function setDescr($val) --- 122,126 ---- function setName($val) { ! $this->name = maxlen($val, CLEN_PROTOCOL_NAME); } function setDescr($val) Index: protocol_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/protocol_edit.phtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** protocol_edit.phtml 29 Aug 2002 16:51:34 -0000 1.8 --- protocol_edit.phtml 10 Sep 2002 23:06:27 -0000 1.9 *************** *** 99,102 **** --- 99,103 ---- <tr><th>Protocol name</th><td><input type=text name=i_name size=30 + maxlength=<?= CLEN_PROTOCOL_NAME ?> value="<?= html($proto->getName(), 0) ?>"></td></tr> *************** *** 125,129 **** { $hasfile = 1; ! echo "<td>".html($upl->getName())." (".$upl->getFileSize()." bytes) uploaded ". substr($upl->getAddedDate(), 0, 16)."</td></tr>\n"; } --- 126,131 ---- { $hasfile = 1; ! echo "<td>".html($upl->getName())." (".$upl->getFileSize(). ! " bytes) uploaded ". substr($upl->getAddedDate(), 0, 16)."</td></tr>\n"; } *************** *** 146,150 **** </select></td></tr> <tr><th>Upload another file</th><td><input type=file name=i_file></td></tr> ! <tr><th>File description</th><td><input type=text name=i_fdescr size=30></td></tr> <tr><td colspan=2><input type=submit value="Accept"></td></tr> --- 148,153 ---- </select></td></tr> <tr><th>Upload another file</th><td><input type=file name=i_file></td></tr> ! <tr><th>File description</th><td><input type=text ! name=i_fdescr size=30></td></tr> <tr><td colspan=2><input type=submit value="Accept"></td></tr> Index: raw.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw.inc.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** raw.inc.php 10 Sep 2002 10:57:41 -0000 1.37 --- raw.inc.php 10 Sep 2002 23:06:28 -0000 1.38 *************** *** 29,32 **** --- 29,34 ---- require_once("acquisition.inc.php"); + define("CLEN_RAWBIOASSAY_NAME", 60); + class RawBioAssay extends Item { *************** *** 158,161 **** --- 160,167 ---- } + function setName($val) + { + $this->name = maxlen($val, CLEN_RAWBIOASSAY_NAME); + } function setLabeledCh1($val) { *************** *** 649,653 **** { $histbox = (float)$histbox; ! $xc = "FLOOR($xc/$histbox)*$histbox"; $yc = "COUNT(*)"; $groupby = "GROUP BY `C`, `A` ". --- 655,659 ---- { $histbox = (float)$histbox; ! $xc = "ROUND($xc/$histbox)*$histbox"; $yc = "COUNT(*)"; $groupby = "GROUP BY `C`, `A` ". *************** *** 658,666 **** $third = (int)$third; $groups = array("rbad.block", "rbad.flags", ! "FLOOR(.5+".db_func_log("(rbad.`FCh1Mean`-rbad.`BCh1Mean`)/". "(rbad.`FCh2Mean`-rbad.`BCh2Mean`)", 2).")"); if($histbox == -1) { ! $groups[2] = "FLOOR(.5+30.*". db_func_log("(rbad.`FCh1Mean`-rbad.`BCh1Mean`)/". "(rbad.`FCh2Mean`-rbad.`BCh2Mean`)").")"; --- 664,672 ---- $third = (int)$third; $groups = array("rbad.block", "rbad.flags", ! "ROUND(".db_func_log("(rbad.`FCh1Mean`-rbad.`BCh1Mean`)/". "(rbad.`FCh2Mean`-rbad.`BCh2Mean`)", 2).")"); if($histbox == -1) { ! $groups[2] = "ROUND(30.*". db_func_log("(rbad.`FCh1Mean`-rbad.`BCh1Mean`)/". "(rbad.`FCh2Mean`-rbad.`BCh2Mean`)").")"; Index: raw_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw_common.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** raw_common.inc.php 29 Aug 2002 16:51:34 -0000 1.17 --- raw_common.inc.php 10 Sep 2002 23:06:28 -0000 1.18 *************** *** 151,155 **** for($j = 1; $j <= 2; $j++) { ! if(!$s["sample$j"]) $slink[$j] = html(""); else if(acc(BUA_BIO_READ) && Sample::isSharedId($s["sample$j"], $userid)) --- 151,156 ---- for($j = 1; $j <= 2; $j++) { ! if(!$s["sample$j"]) ! $slink[$j] = html(""); else if(acc(BUA_BIO_READ) && Sample::isSharedId($s["sample$j"], $userid)) *************** *** 248,252 **** ?> </select><br> ! or start new experiment: <input type=text size=10 name=i_expname> <input type=submit value='Go' name=i_expgo></td></tr> </table> --- 249,254 ---- ?> </select><br> ! or start new experiment: <input type=text size=10 ! maxlength=<?= CLEN_EXPERIMENT_NAME ?> name=i_expname> <input type=submit value='Go' name=i_expgo></td></tr> </table> Index: raw_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw_edit.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** raw_edit.phtml 29 Aug 2002 16:51:34 -0000 1.15 --- raw_edit.phtml 10 Sep 2002 23:06:28 -0000 1.16 *************** *** 114,123 **** { ?> ! <form method=post enctype="multipart/form-data" action='<?= ! $PHP_SELF."?i_r=".$raw->getId() ?>'> <input type=hidden name=i_act value=upd> <input type=hidden name=location value="<?= html($location, 0) ?>"> <tr><th>Name</th><td><input type=text size=30 name=i_name value="<?= html($raw->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr --- 114,124 ---- { ?> ! <form method=post enctype="multipart/form-data" ! action='raw_edit.phtml?i_r=<?= $raw->getId() ?>'> <input type=hidden name=i_act value=upd> <input type=hidden name=location value="<?= html($location, 0) ?>"> <tr><th>Name</th><td><input type=text size=30 name=i_name + maxlength=<?= CLEN_RAWBIOASSAY_NAME ?> value="<?= html($raw->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea cols=50 rows=5 name=i_descr Index: sample_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sample_edit.phtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** sample_edit.phtml 29 Aug 2002 16:51:34 -0000 1.17 --- sample_edit.phtml 10 Sep 2002 23:06:29 -0000 1.18 *************** *** 151,154 **** --- 151,155 ---- <tr><th>Name</th><td><input type=text size=30 name=i_name + maxlength=<?= CLEN_SAMPLE_NAME ?> value="<?= html($samp->getName(), 0) ?>"></td></tr> <? Index: sampleannot_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannot_edit.phtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sampleannot_edit.phtml 29 Aug 2002 16:51:34 -0000 1.9 --- sampleannot_edit.phtml 10 Sep 2002 23:06:29 -0000 1.10 *************** *** 124,127 **** --- 124,128 ---- <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> *************** *** 161,164 **** --- 162,166 ---- ?> <tr><th>Default value</th><td><input type=text size=30 name=i_def + maxlength=<?= CLEN_SAMPLEANNOTATION_DEFAULTVALUE ?> value="<?= html($sat->getDefaultValue(), 0) ?>"></td></tr> <tr><td colspan=2><input type=submit value="Accept" name=i_ok></td></tr> Index: sampleannotation.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampleannotation.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** sampleannotation.inc.php 8 Sep 2002 22:38:08 -0000 1.16 --- sampleannotation.inc.php 10 Sep 2002 23:06:29 -0000 1.17 *************** *** 26,29 **** --- 26,33 ---- require_once("db.inc.php"); + define("CLEN_SAMPLEANNOTATION_NAME", 40); + define("CLEN_SAMPLEANNOTATION_OPTIONS", 255); + define("CLEN_SAMPLEANNOTATION_DEFAULTVALUE", 255); + class SampleAnnotationType { *************** *** 100,104 **** function setName($val) { ! $this->name = $val; } function setValueType($val) --- 104,108 ---- function setName($val) { ! $this->name = maxlen($val, CLEN_SAMPLEANNOTATION_NAME); } function setValueType($val) *************** *** 120,125 **** { if($this->valueType == "e") ! $this->options = $val; ! else $this->options = (int)$val; } function setDefaultValue($val) --- 124,130 ---- { if($this->valueType == "e") ! $this->options = maxlen($val, CLEN_SAMPLEANNOTATION_OPTIONS); ! else ! $this->options = (int)$val; } function setDefaultValue($val) *************** *** 129,133 **** else if($this->valueType == "f") $this->defaultValue = (float)$val; ! else $this->defaultValue = $val; } --- 134,142 ---- else if($this->valueType == "f") $this->defaultValue = (float)$val; ! else ! { ! $this->defaultValue = ! maxlen($val, CLEN_SAMPLEANNOTATION_DEFAULTVALUE); ! } } Index: sampletissue.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampletissue.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sampletissue.inc.php 8 Sep 2002 22:38:08 -0000 1.8 --- sampletissue.inc.php 10 Sep 2002 23:06:30 -0000 1.9 *************** *** 26,29 **** --- 26,31 ---- require_once("db.inc.php"); + define("CLEN_SAMPLETISSUE_NAME", 40); + class SampleTissue { *************** *** 96,100 **** function setName($val) { ! $this->name = $val; } --- 98,102 ---- function setName($val) { ! $this->name = maxlen($val, CLEN_SAMPLETISSUE_NAME); } Index: sampletissue_tree.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/sampletissue_tree.phtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sampletissue_tree.phtml 5 Aug 2002 11:29:35 -0000 1.8 --- sampletissue_tree.phtml 10 Sep 2002 23:06:30 -0000 1.9 *************** *** 89,94 **** <form name=ff method=post action="sampletissue_tree.phtml?i_t=<?= $tissueid ?>"> ! <tr><th>Rename</th><td><input type=text name=i_name value="<?= ! html($tissue->getName(), 0) ?>" size=14> <input type=submit value="Ok"> <?= webHelp(57) ?></td></tr> <input type=hidden name=i_newchild value=""> --- 89,95 ---- <form name=ff method=post action="sampletissue_tree.phtml?i_t=<?= $tissueid ?>"> ! <tr><th>Rename</th><td><input type=text name=i_name ! maxlength=<?= CLEN_SAMPLETISSU_NAME ?> ! value="<?= html($tissue->getName(), 0) ?>" size=14> <input type=submit value="Ok"> <?= webHelp(57) ?></td></tr> <input type=hidden name=i_newchild value=""> Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** search.inc.php 9 Sep 2002 06:21:20 -0000 1.38 --- search.inc.php 10 Sep 2002 23:06:30 -0000 1.39 *************** *** 85,88 **** --- 85,92 ---- require_once("db.inc.php"); require_once("genelist.inc.php"); + + define("CLEN_SEARCHCRITERION_SEARCHSTRING", 255); + define("CLEN_PRESET_NAME", 40); + define("BASE_EXTRACOL", 50); *************** *** 175,179 **** function setName($val) { ! $this->name = printable($val); } function setSearch($val) --- 179,183 ---- function setName($val) { ! $this->name = printable(maxlen($val, CLEN_PRESET_NAME)); } function setSearch($val) *************** *** 865,869 **** function setValue($val) { ! $this->searchString = $val; } --- 869,873 ---- function setValue($val) { ! $this->searchString = maxlen($val, CLEN_SEARCHCRITERION_SEARCHSTRING); } Index: searchhtml.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/searchhtml.inc.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** searchhtml.inc.php 29 Aug 2002 16:51:34 -0000 1.39 --- searchhtml.inc.php 10 Sep 2002 23:06:30 -0000 1.40 *************** *** 343,346 **** --- 343,347 ---- { echo "<td><input type=text name='i_value${tableId}[$pos]' size=20 ". + "maxlength=".CLEN_SEARCHCRITERION_SEARCHSTRING." ". "value=\"".html($val, 0)."\"></td>\n"; } *************** *** 424,428 **** { echo "<td><input type=text name='i_value${tableId}[0]' size=20 ". ! "</td>\n"; } else // enum --- 425,429 ---- { echo "<td><input type=text name='i_value${tableId}[0]' size=20 ". ! "maxlength=".CLEN_SEARCHCRITERION_SEARCHSTRING." </td>\n"; } else // enum *************** *** 463,466 **** --- 464,468 ---- } echo "Save current as new preset <input type=text ". + "maxlength=".CLEN_PRESET_NAME." ". "name=i_presetname${tableId} size=8>". "<input type=submit value='Ok' name='i_presetact${tableId}[new]'>"; Index: trans_create.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/trans_create.phtml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** trans_create.phtml 10 Sep 2002 10:57:41 -0000 1.24 --- trans_create.phtml 10 Sep 2002 23:06:30 -0000 1.25 *************** *** 332,335 **** --- 332,336 ---- <tr><th>Filtering name</th><td><input type=text name=i_tname size=20 + maxlength=<?= CLEN_TRANSFORMATION_NAME ?> value="<?= html($tran->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_tdescr cols=50 rows=3 *************** *** 337,340 **** --- 338,342 ---- <tr><th>Child BioAssaySet</th><td><input type=text name=i_sname size=20 + maxlength=<?= CLEN_BIOASSAYSET_NAME ?> value="<?= html($newset->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_sdescr cols=50 rows=3 *************** *** 373,376 **** --- 375,379 ---- ?></td></tr> <tr><th>Job name</th><td><input type=text name=i_tname size=20 + maxlength=<?= CLEN_TRANSFORMATION_NAME ?> value="<?= html($tran->getName(), 0) ?>"></td></tr> <tr><th>Description</th><td><textarea name=i_tdescr rows=3 cols=50 *************** *** 451,454 **** --- 454,458 ---- $size = max(1, (int)$arr["options"]); echo "<input type=text name='i_sett[$pos]... [truncated message content] |