Skip to content

Commit

Permalink
Merge pull request #1592 from BioKIC/temp-branch-to-resolve-conflict
Browse files Browse the repository at this point in the history
Hotfix 2024 07 25 (#1591)
  • Loading branch information
egbot authored Aug 5, 2024
2 parents e9e9045 + 024e9a0 commit bf501a3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 20 deletions.
13 changes: 11 additions & 2 deletions checklists/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,20 @@
<h2 class="checklist-header">
<?php
$projName = $projArr['name'];
if($pid) echo '<a href="../projects/index.php?pid=' . $pid . '">';
if($projName == 'Miscellaneous Inventories') $projName = $LANG['MISC_INVENTORIES'];
echo $projName;
if($pid) echo '</a>';
if(!empty($projArr['displayMap'])){
?>
<a href="<?php echo "clgmap.php?pid=" . $pid; ?>" title='<?= $LANG['SHOW_MAP'] ?>'>
<img src='../images/world.png' style='width:10px;border:0' />
</a>
<?php
}
?>
<a class="button button-tertiary btn-medium-font" style="gap:0.5rem" href="<?php echo "clgmap.php?pid=" . htmlspecialchars($pid, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?>" title='<?php echo htmlspecialchars($LANG['SHOW_MAP'], ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?>'>
<?php echo $LANG['MAP']; ?> <img src='../images/world.png' style='width:1em;border:0' alt='<?php echo $LANG['IMG_OF_GLOBE']; ?>' />
<a class="button button-tertiary btn-medium-font" style="gap:0.5rem" href="<?= "clgmap.php?pid=" . $pid ?>" title='<?= $LANG['SHOW_MAP'] ?>'>
<?= $LANG['MAP'] ?> <img src='../images/world.png' style='width:1em;border:0' alt='<?= $LANG['IMG_OF_GLOBE'] ?>' />
</a>
</h2>
<ul class="checklist-ul">
Expand Down
18 changes: 12 additions & 6 deletions classes/ChecklistManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,17 +685,22 @@ public function addNewSpecies($postArr){
//Checklist index page functions
public function getChecklists($limitToKey=false){
$retArr = Array();
$sql = 'SELECT p.pid, p.projname, p.ispublic, c.clid, c.name, c.access, c.defaultSettings, COUNT(l.tid) AS sppcnt
$sql = 'SELECT p.pid, p.projname, p.ispublic, c.clid, c.name, c.access, c.defaultSettings, c.latCentroid
FROM fmchecklists c LEFT JOIN fmchklstprojlink cpl ON c.clid = cpl.clid
INNER JOIN fmchklsttaxalink l ON c.clid = l.clid
LEFT JOIN fmprojects p ON cpl.pid = p.pid
WHERE ((c.access LIKE "public%") ';
if(isset($GLOBALS['USER_RIGHTS']['ClAdmin']) && $GLOBALS['USER_RIGHTS']['ClAdmin']) $sql .= 'OR (c.clid IN('.implode(',',$GLOBALS['USER_RIGHTS']['ClAdmin']).'))';
WHERE c.type != "excludespp" AND ((c.access LIKE "public%") ';
if(isset($GLOBALS['USER_RIGHTS']['ClAdmin']) && $GLOBALS['USER_RIGHTS']['ClAdmin']){
$sql .= 'OR (c.clid IN('.implode(',',$GLOBALS['USER_RIGHTS']['ClAdmin']).'))';
}
$sql .= ') AND ((p.pid IS NULL) OR (p.ispublic = 1) ';
if(isset($GLOBALS['USER_RIGHTS']['ProjAdmin']) && $GLOBALS['USER_RIGHTS']['ProjAdmin']) $sql .= 'OR (p.pid IN('.implode(',',$GLOBALS['USER_RIGHTS']['ProjAdmin']).'))';
if(isset($GLOBALS['USER_RIGHTS']['ProjAdmin']) && $GLOBALS['USER_RIGHTS']['ProjAdmin']){
$sql .= 'OR (p.pid IN('.implode(',',$GLOBALS['USER_RIGHTS']['ProjAdmin']).'))';
}
$sql .= ') ';
if($this->pid) $sql .= 'AND (p.pid = '.$this->pid.') ';
$sql .= 'GROUP BY p.projname, c.Name HAVING sppcnt > 10';
//Following line limits result to only checklists that have a linked taxon or is a parent checklist with possible inherited taxa
$sql .= 'AND c.clid IN(SELECT clid FROM fmchklsttaxalink UNION DISTINCT SELECT clid FROM fmchklstchildren) ';
$sql .= 'ORDER BY p.projname, c.name';
$rs = $this->conn->query($sql);
while($row = $rs->fetch_object()){
if($limitToKey){
Expand All @@ -709,6 +714,7 @@ public function getChecklists($limitToKey=false){
$pid = 0;
$projName = 'Miscellaneous Inventories';
}
if($row->latCentroid) $retArr[$pid]['displayMap'] = 1;
$retArr[$pid]['name'] = $this->cleanOutStr($projName);
$retArr[$pid]['clid'][$row->clid] = $this->cleanOutStr($row->name).($row->access=='private'?' (Private)':'');
}
Expand Down
25 changes: 15 additions & 10 deletions classes/DwcArchiverPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,22 +316,27 @@ private function aasort(&$array, $key){
}

public function humanFileSize($filePath) {
$x = false;
if(substr($filePath,0,4)=='http') {
$x = array_change_key_case(get_headers($filePath, 1),CASE_LOWER);
if( strcasecmp($x[0], 'HTTP/1.1 200 OK') != 0 ) {
$x = $x['content-length'][1];
}
else {
$x = $x['content-length'];
if($headerArr = @get_headers($filePath, 1)){
$x = array_change_key_case($headerArr, CASE_LOWER);
if( strcasecmp($x[0], 'HTTP/1.1 200 OK') != 0 ) {
$x = $x['content-length'][1];
}
else {
$x = $x['content-length'];
}
}
}
else {
$x = @filesize($filePath);
}
$x = round($x/1000000, 1);
if(!$x) $x = 0.1;

return $x.'M ';
if($x !== false){
$x = round($x/1000000, 1);
if(!$x) $x = 0.1;
return $x.'M';
}
return '?M';
}
}
?>
2 changes: 1 addition & 1 deletion config/symbbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
header('X-Frame-Options: DENY');
header('Cache-control: private'); // IE 6 FIX
date_default_timezone_set('America/Phoenix');
$CODE_VERSION = '3.0.32';
$CODE_VERSION = '3.0.33';

set_include_path(get_include_path() . PATH_SEPARATOR . $SERVER_ROOT . PATH_SEPARATOR . $SERVER_ROOT.'/config/' . PATH_SEPARATOR . $SERVER_ROOT.'/classes/');

Expand Down
6 changes: 5 additions & 1 deletion ident/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
foreach($projArr as $pidKey => $pArr){
$clArr = $pArr['clid'];
echo '<div style="margin:3px 0px 0px 15px;">';
echo '<h3>'.$pArr['name'].' <a href="../checklists/clgmap.php?pid=' . htmlspecialchars($pidKey, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) . '&target=keys"><img src="../images/world.png" style="width:10px;border:0" /></a></h3>';
echo '<h3>' . $pArr['name'];
if(!empty($pArr['displayMap'])){
echo ' <a href="../checklists/clgmap.php?pid=' . $pidKey . '&target=keys"><img src="../images/world.png" style="width:10px;border:0" /></a>';
}
echo '</h3>';
echo '<div><ul>';
foreach($clArr as $clid => $clName){
echo '<li><a href="key.php?clid=' . htmlspecialchars($clid, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) . '&pid=' . htmlspecialchars($pidKey, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) . '&taxon=All+Species">' . htmlspecialchars($clName, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) . '</a></li>';
Expand Down

0 comments on commit bf501a3

Please sign in to comment.