Skip to content

Commit

Permalink
Merge pull request #40 from BioKIC/master
Browse files Browse the repository at this point in the history
Occurrence Editor bug fix
  • Loading branch information
egbot authored Apr 4, 2021
2 parents b2788c9 + 422b461 commit 74f9d26
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
18 changes: 10 additions & 8 deletions classes/OccurrenceIndividual.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,16 @@ public function getTraitArr(){
}

public function echoTraitDiv($traitArr, $targetID, $ident = 15){
$tArr = $traitArr[$targetID];
foreach($tArr['state'] as $stateID => $sArr){
$label = '';
if($tArr['type'] == 'TF') $label = $traitArr[$targetID]['name'];
$this->echoTraitUnit($sArr, $label, $ident);
if(array_key_exists('depTraitID',$sArr)){
foreach($sArr['depTraitID'] as $depTraitID){
$this->echoTraitDiv($traitArr, $depTraitID, $ident+15);
if(array_key_exists($targetID,$traitArr)){
$tArr = $traitArr[$targetID];
foreach($tArr['state'] as $stateID => $sArr){
$label = '';
if($tArr['type'] == 'TF') $label = $traitArr[$targetID]['name'];
$this->echoTraitUnit($sArr, $label, $ident);
if(array_key_exists('depTraitID',$sArr)){
foreach($sArr['depTraitID'] as $depTraitID){
$this->echoTraitDiv($traitArr, $depTraitID, $ident+15);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion collections/editor/occurrenceeditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
}
//Only full editors can perform following actions
if($isEditor == 1 || $isEditor == 2){
if($action == 'Add Record'){
if($action == 'addOccurRecord'){
if($occManager->addOccurrence($_POST)){
$occManager->setQueryVariables();
$qryCnt = $occManager->getQueryRecordCount();
Expand Down
36 changes: 36 additions & 0 deletions js/symb/collections.labeljsongui.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,42 @@ const dropdownsArr = [
{ value: 'mb-12', text: '12' },
],
},
{
id: 'ml',
name: 'spacing-left',
group: 'field-block',
options: [
{ value: '', text: 'Line Spacing Left' },
{ value: 'ml-0', text: '0' },
{ value: 'ml-1', text: '1' },
{ value: 'ml-2', text: '2' },
{ value: 'ml-3', text: '3' },
{ value: 'ml-4', text: '4' },
{ value: 'ml-5', text: '5' },
{ value: 'ml-6', text: '6' },
{ value: 'ml-8', text: '8' },
{ value: 'ml-10', text: '10' },
{ value: 'ml-12', text: '12' },
],
},
// {
// id: 'mr',
// name: 'spacing-right',
// group: 'field-block',
// options: [
// { value: '', text: 'Line Spacing Right' },
// { value: 'mr-0', text: '0' },
// { value: 'mr-1', text: '1' },
// { value: 'mr-2', text: '2' },
// { value: 'mr-3', text: '3' },
// { value: 'mr-4', text: '4' },
// { value: 'mr-5', text: '5' },
// { value: 'mr-6', text: '6' },
// { value: 'mr-8', text: '8' },
// { value: 'mr-10', text: '10' },
// { value: 'mr-12', text: '12' },
// ],
// },
];
const dummy = document.getElementById('dummy');
const fieldDiv = document.getElementById('fields');
Expand Down

0 comments on commit 74f9d26

Please sign in to comment.