Skip to content

Commit

Permalink
Merge pull request #46 from BioKIC/master
Browse files Browse the repository at this point in the history
Merge updates from BioKIC/Symbiota
  • Loading branch information
GregoryPost authored Jan 18, 2023
2 parents 44d7edf + 5ecb5e7 commit b0ed194
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 49 deletions.
2 changes: 1 addition & 1 deletion admin/portalindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if(!$SYMB_UID) header('Location: '.$CLIENT_ROOT.'/profile/index.php?refurl=../admin/portalindex.php?'.htmlspecialchars($_SERVER['QUERY_STRING'], ENT_QUOTES));

$portalID = array_key_exists('portalid', $_REQUEST) ? filter_var($_REQUEST['portalid'], FILTER_SANITIZE_NUMBER_INT : 0;
$portalID = array_key_exists('portalid', $_REQUEST) ? filter_var($_REQUEST['portalid'], FILTER_SANITIZE_NUMBER_INT) : 0;
$remoteID = array_key_exists('remoteid', $_REQUEST) ? filter_var($_REQUEST['remoteid'], FILTER_SANITIZE_NUMBER_INT) : 0;
$remotePath = array_key_exists('remotePath', $_POST) ? filter_var($_POST['remotePath'], FILTER_SANITIZE_URL) : '';
$formSubmit = array_key_exists('formsubmit', $_POST) ? $_POST['formsubmit'] : '';
Expand Down
4 changes: 2 additions & 2 deletions checklists/checklistadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
<?php
include_once($SERVER_ROOT.'/includes/head.php');
?>
<script src="../js/jquery.js type="text/javascript""></script>
<script src="../js/jquery-ui.js type="text/javascript""></script>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/jquery-ui.js" type="text/javascript"></script>
<script src="../js/tinymce/tinymce.min.js" type="text/javascript"></script>
<script type="text/javascript">
var clid = <?php echo $clid; ?>;
Expand Down
18 changes: 8 additions & 10 deletions classes/DwcArchiverCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ public function createDwcArchive($fileNameSeed = ''){
unlink($this->targetPath . $this->ts . '-meta.xml');
if ($this->schemaType == 'dwc') rename($this->targetPath . $this->ts . '-eml.xml', $this->targetPath . str_replace('.zip', '.eml', $fileName));
else unlink($this->targetPath . $this->ts . '-eml.xml');
if (file_exists($this->targetPath . $this->ts . '-citation.txt')) unlink($this->targetPath . $this->ts . '-citation.txt');
}
else {
$this->errorMessage = 'FAILED to create archive file due to failure to return occurrence records; check and adjust search variables';
Expand Down Expand Up @@ -2026,26 +2027,26 @@ private function writeCitationFile(){

// Decides which citation format to use according to $citationVarArr
// Checks first argument in query params
$citationFormat = 'portal';
$citationPrefix = 'Portal';
switch (array_key_first($citationParamsArr)) {
case "archivedcollid":
$collData = $_SESSION['colldata'];
// if collData includes a gbiftitle, pass it to the citation
if (array_key_exists('gbiftitle', $collData)) {
if (isset($_SESSION['colldata']) && array_key_exists('gbiftitle', $_SESSION['colldata'])) {
$citationFormat = "gbif";
} else {
$citationFormat = "collection";
}
$citationPrefix = "Collection Page, Archived DwC-A package created";
break;
case "collid":
$collData = $_SESSION['colldata'];
// if collData includes a gbiftitle, pass it to the citation
if ($collData && array_key_exists('gbiftitle', $collData)) {
$citationFormat = "gbif";
if (isset($_SESSION['colldata']) && array_key_exists('gbiftitle', $_SESSION['colldata'])) {
$citationFormat = 'gbif';
} else {
$citationFormat = "collection";
$citationFormat = 'collection';
}
$citationPrefix = "Collection Page, Live data downloaded";
$citationPrefix = 'Collection Page, Live data downloaded';
break;
case "db":
$citationFormat = "portal";
Expand All @@ -2057,9 +2058,6 @@ private function writeCitationFile(){
$dArr['name'] = $_SESSION['datasetName'];
$datasetid = $_SESSION['datasetid'];
break;
default:
$citationFormat = "portal";
$citationPrefix = "Portal";
}

$output = "This data package was downloaded from a " . $GLOBALS['DEFAULT_TITLE'] . " " . $citationPrefix . " on " . date('Y-m-d H:i:s') . ".\n\nPlease use the following format to cite this dataset:\n";
Expand Down
6 changes: 3 additions & 3 deletions classes/OccurrenceIndividual.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,17 +453,17 @@ private function setMaterialSamples(){

private function setSource(){
if(isset($GLOBALS['ACTIVATE_PORTAL_INDEX']) && $GLOBALS['ACTIVATE_PORTAL_INDEX']){
$sql = 'SELECT o.targetOccid, o.refreshTimestamp, o.verification, i.urlRoot, i.portalName
$sql = 'SELECT o.remoteOccid, o.refreshTimestamp, o.verification, i.urlRoot, i.portalName
FROM portaloccurrences o INNER JOIN portalpublications p ON o.pubid = p.pubid
INNER JOIN portalindex i ON p.portalID = i.portalID
WHERE (o.occid = '.$this->occid.') AND (p.direction = "import")';
if($rs = $this->conn->query($sql)){
while($r = $rs->fetch_object()){
$this->occArr['source']['type'] = 'symbiota';
$this->occArr['source']['url'] = $r->urlRoot.'/collections/individual/index.php?occid='.$r->targetOccid;
$this->occArr['source']['url'] = $r->urlRoot.'/collections/individual/index.php?occid='.$r->remoteOccid;
$this->occArr['source']['sourceName'] = $r->portalName;
$this->occArr['source']['refreshTimestamp'] = $r->refreshTimestamp;
$this->occArr['source']['sourceID'] = $r->targetOccid;
$this->occArr['source']['sourceID'] = $r->remoteOccid;
}
$rs->free();
}
Expand Down
12 changes: 6 additions & 6 deletions collections/individual/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -997,18 +997,18 @@ function initializeMap(){
echo '<div><label>'.$displayTitle.':</label> <a href="'.$occArr['source']['url'].'" target="_blank">'.$displayStr.'</a></div>';
echo '<div style="float:left;">';
if(isset($occArr['source']['sourceName'])){
echo '<div>'.$LANG['DATA_SOURCE'].': '.$occArr['source']['sourceName'].'</div>';
if($recordType == 'symbiota') echo '<div><label>Source management: </label>Live managed record within a Symbiota portal</div>';
echo '<div><label>'.$LANG['DATA_SOURCE'].':</label> '.$occArr['source']['sourceName'].'</div>';
if($recordType == 'symbiota') echo '<div><label>Source management:</label> Live managed record within a Symbiota portal</div>';
}
if(array_key_exists('fieldsModified',$_POST)){
echo '<div>'.$LANG['REFRESH_DATE'].': '.(isset($occArr['source']['refreshTimestamp'])?$occArr['source']['refreshTimestamp']:'').'</div>';
echo '<div><label>'.$LANG['REFRESH_DATE'].':</label> '.(isset($occArr['source']['refreshTimestamp'])?$occArr['source']['refreshTimestamp']:'').'</div>';
//Input from refersh event
$dataStatus = filter_var($_POST['dataStatus'], FILTER_SANITIZE_STRING);
$fieldsModified = filter_var($_POST['fieldsModified'], FILTER_SANITIZE_STRING);
$sourceDateLastModified = filter_var($_POST['sourceDateLastModified'], FILTER_SANITIZE_STRING);
echo '<div>'.$LANG['UPDATE_STATUS'].': '.$dataStatus.'</div>';
echo '<div>'.$LANG['FIELDS_MODIFIED'].': '.$fieldsModified.'</div>';
echo '<div>'.$LANG['SOURCE_DATE_LAST_MODIFIED'].': '.$sourceDateLastModified.'</div>';
echo '<div><label>'.$LANG['UPDATE_STATUS'].':</label> '.$dataStatus.'</div>';
echo '<div><label>'.$LANG['FIELDS_MODIFIED'].':</label> '.$fieldsModified.'</div>';
echo '<div><label>'.$LANG['SOURCE_DATE_LAST_MODIFIED'].':</label> '.$sourceDateLastModified.'</div>';
}
echo '</div>';
if($SYMB_UID && $recordType == 'symbiota'){
Expand Down
27 changes: 27 additions & 0 deletions css/v202209/symbiota/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,33 @@ hr {
padding: 10px 4px;
}

/* styled table */
table.styledtable {
table-layout: auto;
width: 100%;
border-collapse: collapse;
}

table.styledtable th {
text-align: left;
padding: 4px;
border: 1px solid gray;
background-color: #dbe5f1;
color: black;
}

table.styledtable td {
padding: 3px;
border: 1px solid gray;
background-color: #efefef;
}

table.styledtable tr.alt td {
color: #000000;
background-color: #dfdfdf;
}


/***********************************************************************/

/* Utility classes
Expand Down
48 changes: 21 additions & 27 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@
and then override the css definitions called within base.css
6. Misc: rename usagepolicy_template.php to usagepolicy.php, and modify as needed
4. File permissions - the web server needs write access to the following files and folders
* All folders in /temp/ (e.g. sudo chmod -R 777 temp/)
* /content/collicon/
* /content/dwca/
* /content/logs/
* All folders in /temp (e.g. sudo chmod -R 777 temp/)
* /content/collicon
* /content/dwca
* /content/logs
* /api/storage/logs


## DATA
Expand All @@ -66,30 +67,28 @@
checklist, identification, key, and taxon profile (common names, text descriptions, etc).
While user interfaces have been developed for web management for most of these data layers, some table tables still need to be managed via the backend (e.g. loaded by hand).
1. User and permissions - Default administrative user has been installed with following login: username = admin; password: admin.
It is highly recommend that you change the password, or better yet, create a new admin user, assign admin rights, and then delete default admin user.
It is highly recommend that you change the password, or better yet, create a new admin user, assign admin rights,
and then delete default admin user.
Management control panel for permissions is available within Data Managment Panel on the sitemap page.
2. Taxonomic Thesaurus - Taxon names are stored within the 'taxa' table.
Taxonomic hierarchy and placement definitions are controled in the
'taxstatus' table. A recursive data relationship within the 'taxstatus'
table defines the taxonomic hierarchy. While multiple taxonomic thesauri
can be defined, one of the thesauri needs to function as the central
taxonomy. Names must be added in order from upper taxonomic levels to
lower (e.g. kingdom, class, order, variety). Accepted names must be
loaded before non-accepted names.
Taxonomic hierarchy and placement definitions are controled in the 'taxstatus' table.
A recursive data relationship within the 'taxstatus' table defines the taxonomic hierarchy.
While multiple taxonomic thesauri can be defined, one of the thesauri needs to function as the central taxonomy.
Names must be added in order from upper taxonomic levels to lower (e.g. kingdom, class, order, variety).
Accepted names must be loaded before non-accepted names.
1. Names can be added one-by-one using taxonomic management tools (see sitemap.php)
2. Name can be imported from taxnomic authorities (e.g. Catalog of Life, WoRMS, TROPICOS, etc)
based on occurrence data loaded into the system using cleaning tools
found in Data Cleaning Tools => Analyze taxonomic names... This is recommended.
based on occurrence data loaded into the system using cleaning tools
found in Data Cleaning Tools => Analyze taxonomic names... This is recommended.
3. Batch Loader - Multiple names can be loaded from a flat,
tab-delimited text file. See instructions on the Batch Taxon
Loader for detailed instructions. See instructions on the
batch loader for loading multiple names from a flat file.
4. Look in /config/schema/data/ folder to find taxonomic
thesaurus data that may serve as a base for your taxonomic
thesaurus.
3. Occurrence (Specimen) Data: SuperAdmin can create new collection instances via
Data Management pane within sitemap. Within the collection's data managment menu, one can
provide admin and read access to new users, add/edit occurrences, batch load data, etc.
3. Occurrence (Specimen) Data: SuperAdmin can create new collection instances via Data Management pane within sitemap.
Within the collection's data managment menu, one can provide admin and read access to new users, add/edit occurrences, batch load data, etc.
4. Images - to be completed
5. Floristic data - to be completed
6. Identification key data - to be completed
Expand All @@ -98,14 +97,9 @@

UPDATES
=======
1. Code updates - If you installed through the GitHub using the clone command,
code changes and bugs fixes can be integrated into your local checkout
using the Git Desktop client of running the "git pull" command
2. Database schema updates - Some php code updates will require database
schema modifications. Schema changes can be applied by running new
schema patches added since the last update (MySQL command line:
source db_schema_patch_1.1.sql). Current Symbiota version numbers are
listed at the bottom of sitemap.php page. Make sure to run the scripts
in the correct order (e.g. db_schema_patch_1.1.sql, then
db_schema_patch_1.2.sql, etc)
1. Code updates - If you installed through the GitHub using the clone command, code changes and bugs fixes can be integrated into your local checkout using the Git Desktop client of running the "git pull" command
2. Database schema updates - Some php code updates will require database schema modifications.
Schema changes can be applied by running new schema patches added since the last update (MySQL command line: source db_schema_patch_1.1.sql).
Current Symbiota version numbers are listed at the bottom of sitemap.php page.
Make sure to run the scripts in the correct order (e.g. db_schema_patch_1.1.sql, then db_schema_patch_1.2.sql, etc)

0 comments on commit b0ed194

Please sign in to comment.