Skip to content

Commit

Permalink
Merge pull request #29 from greatergoodcharities/master
Browse files Browse the repository at this point in the history
Merge BioKIC/Symbiota hotfix
  • Loading branch information
egbot authored Dec 10, 2023
2 parents 226dd1a + a171528 commit 4bec1d3
Show file tree
Hide file tree
Showing 63 changed files with 2,352 additions and 2,207 deletions.
25 changes: 16 additions & 9 deletions checklists/checklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$limitImagesToVouchers = array_key_exists('voucherimages', $_REQUEST) ? filter_var($_REQUEST['voucherimages'], FILTER_SANITIZE_NUMBER_INT) : 0;
$showVouchers = array_key_exists('showvouchers', $_REQUEST) ? filter_var($_REQUEST['showvouchers'], FILTER_SANITIZE_NUMBER_INT) : 0;
$showAlphaTaxa = array_key_exists('showalphataxa', $_REQUEST) ? filter_var($_REQUEST['showalphataxa'], FILTER_SANITIZE_NUMBER_INT) : 0;
$showSubgenera = array_key_exists('showsubgenera', $_REQUEST) ? filter_var($_REQUEST['showsubgenera'], FILTER_SANITIZE_NUMBER_INT) : 0;
$searchCommon = array_key_exists('searchcommon', $_REQUEST) ? filter_var($_REQUEST['searchcommon'], FILTER_SANITIZE_NUMBER_INT) : 0;
$searchSynonyms = array_key_exists('searchsynonyms', $_REQUEST) ? filter_var($_REQUEST['searchsynonyms'], FILTER_SANITIZE_NUMBER_INT) : 0;
$defaultOverride = array_key_exists('defaultoverride', $_REQUEST) ? filter_var($_REQUEST['defaultoverride'], FILTER_SANITIZE_NUMBER_INT) : 0;
Expand Down Expand Up @@ -68,6 +69,7 @@
if($limitImagesToVouchers) $clManager->setLimitImagesToVouchers(true);
if($showVouchers) $clManager->setShowVouchers(true);
if($showAlphaTaxa) $clManager->setShowAlphaTaxa(true);
if($showSubgenera) $clManager->setShowSubgenera(true);
$clid = $clManager->getClid();
$pid = $clManager->getPid();

Expand All @@ -78,10 +80,12 @@
elseif(array_key_exists('printlist_x',$_POST)){
$printMode = 1;
}

$isEditor = false;
$isEditor = 0;
if($IS_ADMIN || (array_key_exists('ClAdmin',$USER_RIGHTS) && in_array($clid,$USER_RIGHTS['ClAdmin']))){
$isEditor = true;
$isEditor = 1;
}
elseif($clArray['access'] == 'private-strict'){
$isEditor = false;
}
if($isEditor && array_key_exists('formsubmit',$_POST)){
if($_POST['formsubmit'] == 'AddSpecies'){
Expand Down Expand Up @@ -152,7 +156,7 @@ function changeImageSource(elem){
<!-- This is inner text! -->
<div id='innertext'>
<?php
if(($clid || $dynClid) && $clArray){
if(($clid || $dynClid) && $clArray && is_numeric($isEditor)){
if($clid && $isEditor){
?>
<div class="printoff" style="float:right;width:auto;">
Expand Down Expand Up @@ -742,11 +746,14 @@ function changeImageSource(elem){
<?php
}
else{
?>
<div style="color:red;">
<?php echo $LANG['CHECKNULL']; ?>!
</div>
<?php
echo '<div style="color:red;">';
if($clArray['access'] == 'private-strict'){
echo $LANG['IS_PRIVATE'];
}
else{
echo $LANG['CHECKNULL'];
}
echo '</div>';
}
?>
</div>
Expand Down
3 changes: 2 additions & 1 deletion checklists/checklistadminmeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ function openMappingPolyAid() {
<b><?php echo (isset($LANG['ACCESS'])?$LANG['ACCESS']:'Access'); ?>:</b>
<select name="access">
<option value="private"><?php echo (isset($LANG['PRIVATE'])?$LANG['PRIVATE']:'Private');?></option>
<option value="public" <?php echo ($clArray && $clArray["access"]=="public"?"selected":""); ?>><?php echo (isset($LANG['PUBLIC'])?$LANG['PUBLIC']:'Public');?></option>
<option value="private-strict" <?php echo ($clArray && $clArray['access']=='private-strict'?'selected':''); ?>><?php echo $LANG['PRIVATE_STRICT'];?></option>
<option value="public" <?php echo ($clArray && $clArray['access']=='public'?'selected':''); ?>><?php echo (isset($LANG['PUBLIC'])?$LANG['PUBLIC']:'Public');?></option>
</select>
</div>
<div style="clear:both;float:left;margin-top:15px;">
Expand Down
2 changes: 1 addition & 1 deletion classes/APITaxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __destruct(){

public function getTaxon($sciname){
$retArr = array();
$sciname = preg_replace('/[^a-zA-Z\-\.× ]+/', '', $sciname);
$sciname = preg_replace('/[^a-zA-Z\-\.× ()]+/', '', $sciname);
$sql = 'SELECT tid, sciname, author FROM taxa WHERE (sciname = "'.$sciname.'")';
if(preg_match('/\s{1}\D{1}\s{1}/i',$sciname)){
$sciname = preg_replace('/\s{1}x{1}\s{1}|\s{1}×{1}\s{1}/i', ' _ ', $sciname);
Expand Down
Loading

0 comments on commit 4bec1d3

Please sign in to comment.