From aa691326035d794dd4f32430d4ffda9e19a451e1 Mon Sep 17 00:00:00 2001 From: Edward Gilbert Date: Fri, 2 Apr 2021 17:39:25 -0400 Subject: [PATCH 1/3] Occurrence Detail Trait debugging - Adjustment to display of trait/state terms to better represent true/false trait types --- classes/OccurrenceIndividual.php | 14 ++++++++++---- collections/individual/index.php | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/classes/OccurrenceIndividual.php b/classes/OccurrenceIndividual.php index 26bcde9444..ef23dc742a 100644 --- a/classes/OccurrenceIndividual.php +++ b/classes/OccurrenceIndividual.php @@ -367,7 +367,7 @@ public function getDuplicateArr(){ public function getTraitArr(){ $retArr = array(); if($this->occid){ - $sql = 'SELECT t.traitid, t.traitName, t.description AS t_desc, t.refUrl AS t_url, s.stateid, s.stateName, s.description AS s_desc, s.refUrl AS s_url, d.parentstateid '. + $sql = 'SELECT t.traitid, t.traitName, t.traitType, t.description AS t_desc, t.refUrl AS t_url, s.stateid, s.stateName, s.description AS s_desc, s.refUrl AS s_url, d.parentstateid '. 'FROM tmattributes a INNER JOIN tmstates s ON a.stateid = s.stateid '. 'INNER JOIN tmtraits t ON s.traitid = t.traitid '. 'LEFT JOIN tmtraitdependencies d ON t.traitid = d.traitid '. @@ -378,6 +378,7 @@ public function getTraitArr(){ $retArr[$r->traitid]['name'] = $r->traitName; $retArr[$r->traitid]['desc'] = $r->t_desc; $retArr[$r->traitid]['url'] = $r->t_url; + $retArr[$r->traitid]['type'] = $r->traitType; $retArr[$r->traitid]['depStateID'] = $r->parentstateid; $retArr[$r->traitid]['state'][$r->stateid]['name'] = $r->stateName; $retArr[$r->traitid]['state'][$r->stateid]['desc'] = $r->s_desc; @@ -404,7 +405,9 @@ public function getTraitArr(){ public function echoTraitDiv($traitArr, $targetID, $ident = 15){ $tArr = $traitArr[$targetID]; foreach($tArr['state'] as $stateID => $sArr){ - $this->echoTraitUnit($sArr,$ident); + $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); @@ -413,10 +416,13 @@ public function echoTraitDiv($traitArr, $targetID, $ident = 15){ } } - public function echoTraitUnit($outArr, $indent=0){ + public function echoTraitUnit($outArr, $label = '', $indent=0){ echo '
'; if($outArr['url']) echo ''; - echo ''.$outArr['name'].' '; + echo ''; + if($label) echo $label.' '; + echo $outArr['name']; + echo ''; if($outArr['url']) echo ''; if($outArr['desc']) echo ': '.$outArr['desc']; echo '
'; diff --git a/collections/individual/index.php b/collections/individual/index.php index a3919d5667..78846a76d2 100644 --- a/collections/individual/index.php +++ b/collections/individual/index.php @@ -252,6 +252,7 @@ function initializeMap(){ .imgDiv{ max-width:200; float:left; text-align:center; padding:5px } .occur-ref{ margin: 10px 0px } .traitDiv{ margin:20px; } + .traitName{ font-weight:bold; } From 62ba5cd7c03975dba055652a2ec0311254cd3c10 Mon Sep 17 00:00:00 2001 From: Laura Rocha Prado Date: Fri, 2 Apr 2021 17:21:46 -0700 Subject: [PATCH 2/3] adds line left spacing option in label gui - Adds a dropdown in the "line" editor to select a spacing to be added to the left of each line in the visual label format editor --- js/symb/collections.labeljsongui.js | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/js/symb/collections.labeljsongui.js b/js/symb/collections.labeljsongui.js index 321f200cb4..c8959159df 100644 --- a/js/symb/collections.labeljsongui.js +++ b/js/symb/collections.labeljsongui.js @@ -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'); From aa46530c226f931c85087a1484fe26d7af945629 Mon Sep 17 00:00:00 2001 From: Edward Gilbert Date: Sun, 4 Apr 2021 10:52:54 -0400 Subject: [PATCH 3/3] Occurrence Editor bug fix --- classes/OccurrenceIndividual.php | 18 ++++++++++-------- collections/editor/occurrenceeditor.php | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/classes/OccurrenceIndividual.php b/classes/OccurrenceIndividual.php index ef23dc742a..cc75dbd360 100644 --- a/classes/OccurrenceIndividual.php +++ b/classes/OccurrenceIndividual.php @@ -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); + } } } } diff --git a/collections/editor/occurrenceeditor.php b/collections/editor/occurrenceeditor.php index b548b4ed2b..a8619c93f9 100644 --- a/collections/editor/occurrenceeditor.php +++ b/collections/editor/occurrenceeditor.php @@ -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();