Skip to content

Commit

Permalink
Merge pull request #34 from BioKIC/master
Browse files Browse the repository at this point in the history
Merging BioKIC/Symbiota-light into CCH2 Symbiota-light code repository
  • Loading branch information
egbot authored Mar 4, 2021
2 parents 10266fa + 3a77fdd commit 0ee45b9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion classes/DwcArchiverCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,8 @@ private function writeOccurrenceFile(){
elseif($this->schemaType == 'backup') unset($r['collid']);

if($ocnStr = $dwcOccurManager->getAdditionalCatalogNumberStr($r['occid'])) $r['otherCatalogNumbers'] = $ocnStr;
if($assocStr = $dwcOccurManager->getAssociationStr($r['occid'])) $r['t_associatedOccurrences'] = $assocStr;
if($assocOccurStr = $dwcOccurManager->getAssociationStr($r['occid'])) $r['t_associatedOccurrences'] = $assocOccurStr;
if($assocTaxa = $dwcOccurManager->getAssocTaxa($r['occid'])) $r['associatedTaxa'] = $assocTaxa;
//$dwcOccurManager->appendUpperTaxonomy($r);
$dwcOccurManager->appendUpperTaxonomy2($r);
if($rankStr = $dwcOccurManager->getTaxonRank($r['rankid'])) $r['t_taxonRank'] = $rankStr;
Expand Down
15 changes: 15 additions & 0 deletions classes/DwcArchiverOccurrence.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,21 @@ public function getAssociationStr($occid){
return trim($retStr,' |');
}

public function getAssocTaxa($occid){
$retStr = '';
if($occid){
$sql = 'SELECT assocID, relationship, subType, verbatimSciname FROM omoccurassociations WHERE occid = '.$occid.' AND verbatimSciname IS NOT NULL ';
$rs = $this->conn->query($sql);
if($rs){
while($r = $rs->fetch_object()){
$retStr .= '|'.$r->relationship.($r->subType?' ('.$r->subType.')':'').': '.$r->verbatimSciname;
}
$rs->free();
}
}
return trim($retStr,' |');
}

private function getInverseRelationship($relationship){
if(!$this->relationshipArr) $this->setRelationshipArr();
if(array_key_exists($relationship, $this->relationshipArr)) return $this->relationshipArr[$relationship];
Expand Down
3 changes: 2 additions & 1 deletion config/schema-1.0/dev/db_schema_patch_pending.sql
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ ALTER TABLE `uploadspecparameters`
ADD CONSTRAINT `FK_uploadspecparameters_uid` FOREIGN KEY (`createdUid`) REFERENCES `users` (`uid`) ON DELETE SET NULL ON UPDATE SET NULL;

ALTER TABLE `uploadspecparameters`
CHANGE COLUMN `Path` `Path` VARCHAR(500) NULL DEFAULT NULL ;
CHANGE COLUMN `Path` `Path` VARCHAR(500) NULL DEFAULT NULL,
CHANGE COLUMN `QueryStr` `QueryStr` TEXT NULL DEFAULT NULL;

ALTER TABLE `uploadimagetemp`
CHANGE COLUMN `specimengui` `sourceIdentifier` VARCHAR(150) NULL DEFAULT NULL;
Expand Down
18 changes: 8 additions & 10 deletions js/symb/collections.labeldynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
* Requires modern browsers (HTML5)
*
* Author: Laura Rocha Prado ([email protected])
* Version: Dec 2020
* Version: Fev 2021
*/

let body = document.querySelector('body');
let page = document.querySelector('.body');
let labelPage = document.querySelector('.body');

let controls = document.createElement('div');
controls.classList.add('controls');
Expand All @@ -36,20 +35,19 @@ printBtn.onclick = function () {

controls.appendChild(editBtn);
controls.appendChild(printBtn);
body.prepend(controls);
document.body.prepend(controls);

function toggleEdits() {
let isEditable = page.contentEditable === 'true';
let btn = body.querySelector('#edit');
let isEditable = labelPage.contentEditable === 'true';
if (isEditable) {
console.log(isEditable);
page.contentEditable = 'false';
labelPage.contentEditable = 'false';
document.querySelector('#edit').innerText = 'Edit Labels Text';
page.style.border = 'none';
labelPage.style.border = 'none';
} else {
console.log(isEditable);
page.contentEditable = 'true';
labelPage.contentEditable = 'true';
document.querySelector('#edit').innerText = 'Save';
page.style.border = '2px solid #03fc88';
labelPage.style.border = '2px solid #03fc88';
}
}

0 comments on commit 0ee45b9

Please sign in to comment.