Skip to content

Commit

Permalink
Add author to quick taxon search
Browse files Browse the repository at this point in the history
- Display scientific name with author within quick taxon search feature found on index page, which allows user to differentiate between homonyms
Addresses issue BioKIC#1551
  • Loading branch information
egbot committed Aug 6, 2024
1 parent 2c015f0 commit 46612eb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion classes/ChecklistManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,8 @@ public function getSpeciesSearch($term){
$sql = 'SELECT tid, sciname, author FROM taxa WHERE (rankid > 179) AND (sciname LIKE "'.$term.'%")';
$rs = $this->conn->query($sql);
while($r = $rs->fetch_object()){
$retArr[] = $r->sciname . ' ' . $r->author;
$retArr[$r->tid]['id'] = $r->tid;
$retArr[$r->tid]['value'] = $r->sciname . ' ' . $r->author;
}
$rs->free();
}
Expand Down
28 changes: 24 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,27 @@
<script src="<?= $CLIENT_ROOT ?>/js/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
var clientRoot = "<?= $CLIENT_ROOT ?>";
$(document).ready(function() {
$("#qstaxa").autocomplete({
source: function( request, response ) {
$.getJSON( "checklists/rpc/speciessuggest.php", { term: request.term }, response );
},
minLength: 3,
autoFocus: true,
select: function( event, ui ) {
if(ui.item){
$( "#qstaxa" ).val(ui.item.value);
$( "#qstid" ).val(ui.item.id);
}
},
change: function( event, ui ) {
if(ui.item === null) {
$( "#qstid" ).val("");
}
}
});
});
</script>
<script src="<?= $CLIENT_ROOT ?>/js/symb/api.taxonomy.taxasuggest.js" type="text/javascript"></script>
<script src="<?= $CLIENT_ROOT ?>/js/jquery.slides.js"></script>
<meta name='keywords' content='lichens,natural history collections,flora,checklists,species lists' />
</head>
Expand All @@ -49,7 +68,8 @@
<!-- -------------------------QUICK SEARCH SETTINGS--------------------------------------- -->
<form name="quicksearch" id="quicksearch" action="<?= $CLIENT_ROOT ?>/taxa/index.php" method="get" onsubmit="return verifyQuickSearch(this);">
<div id="quicksearchtext" ><?= $LANG['QSEARCH_SEARCH'] ?></div>
<input id="taxa" type="text" name="taxon" style="width:275px" />
<input id="qstaxa" type="text" name="taxon" style="width:275px">
<input id="qstid" type="hidden" name="tid">
<button name="formsubmit" id="quicksearchbutton" type="submit" value="Search Terms">
<?= $LANG['QSEARCH_SEARCH_BUTTON'] ?>
</button>
Expand Down Expand Up @@ -78,14 +98,14 @@
echo $pluginManager->createSlideShow($ssId,$numSlides,$width,$numDays,$imageType,$clid,$dayInterval);
?>
</div>

<?php
if($LANG_TAG=='en'){
//Text in this block is English
?>
<div>
<h1>Welcome to The Consortium of Lichen Herbaria!</h1>

<p>
The <i>Consortium</i> serves as gateway to biodiversity data of lichenized fungi.
It unites records not only from lichen herbaria in North America, but also from
Expand Down

0 comments on commit 46612eb

Please sign in to comment.