Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occurrence Editor Custom Template Development #68

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion classes/OccurrenceDownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,14 @@ public function getProcessingStatusList($collid = 0){
if($collid){
$sql .= 'WHERE collid = '.$collid;
}
$sql .= ' ORDER BY processingstatus ASC';
$rs = $this->conn->query($sql);
while($r = $rs->fetch_object()){
if($r->processingstatus) $psArr[] = $r->processingstatus;
}
$rs->free();
//Special sort
$templateArr = array('unprocessed','unprocessed-nlp','pending duplicate','stage 1','stage 2','stage 3','pending review','reviewed');
$templateArr = array('unprocessed','unprocessed-nlp','stage 1','stage 2','stage 3','pending duplicate','pending review','expert required','reviewed', 'closed');
//Get all active processing statuses and then merge all extra statuses that may exists for one reason or another
return array_merge(array_intersect($templateArr,$psArr),array_diff($psArr,$templateArr));
}
Expand Down
4 changes: 2 additions & 2 deletions classes/SpecProcessorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ public function getSpecNoOcr($procStatus = ''){
public function getProcessingStatusList(){
$retArr = array();
if($this->collid){
$sql = 'SELECT DISTINCT processingstatus FROM omoccurrences WHERE collid = '.$this->collid;
$sql = 'SELECT DISTINCT processingstatus FROM omoccurrences WHERE collid = '.$this->collid.' ORDER BY processingstatus ASC';
//echo $sql;
$rs = $this->conn->query($sql);
while($r = $rs->fetch_object()){
if($r->processingstatus) $retArr[] = $r->processingstatus;
}
$rs->free();
sort($retArr);
//sort($retArr);
}
return $retArr;
}
Expand Down
57 changes: 48 additions & 9 deletions collections/admin/specupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@
$duManager->setVerifyImageUrls($verifyImages);
$duManager->setProcessingStatus($processingStatus);

//Bring in config variables
if($duManager->getCollInfo('colltype') == 'General Observations'){
if(file_exists('../editor/includes/config/occurVarGenObs'.$SYMB_UID.'.php')){
//Specific to particular general observation collection
include('../editor/includes/config/occurVarGenObs'.$SYMB_UID.'.php');
}
elseif(file_exists('../editor/includes/config/occurVarGenObsDefault.php')){
//Specific to Default values for portal
include('../editor/includes/config/occurVarGenObsDefault.php');
}
}
else{
if($collid && file_exists('../editor/includes/config/occurVarColl'.$collid.'.php')){
//Specific to particular collection
include('../editor/includes/config/occurVarColl'.$collid.'.php');
}
elseif(file_exists('../editor/includes/config/occurVarDefault.php')){
//Specific to Default values for portal
include('../editor/includes/config/occurVarDefault.php');
}
}

if($action == 'Automap Fields'){
$autoMap = true;
}
Expand Down Expand Up @@ -642,8 +664,16 @@ function pkChanged(selObj){
<?php
}
}
$processingList = array('unprocessed' => 'Unprocessed', 'stage 1' => 'Stage 1', 'stage 2' => 'Stage 2', 'stage 3' => 'STAGE_3', 'pending review' => 'Pending Review',
'expert required' => 'Expert Required', 'pending review-nfn' => 'Pending Review-NfN', 'reviewed' => 'Reviewed', 'closed' => 'Closed');

// Set the list of processing statuses, from the collection editor template
$processingStatusArr = array();
if(defined('PROCESSINGSTATUS') && PROCESSINGSTATUS){
$processingStatusArr = PROCESSINGSTATUS;
}
else{
$processingStatusArr = array('unprocessed','unprocessed/NLP','stage 1','stage 2','stage 3','pending duplicate','pending review-nfn','pending review','expert required','reviewed','closed');
}

if($ulPath && ($uploadType == $DWCAUPLOAD || $uploadType == $IPTUPLOAD)){
//Data has been uploaded and it's a DWCA upload type
if($duManager->analyzeUpload()){
Expand Down Expand Up @@ -826,8 +856,11 @@ function pkChanged(selObj){
<option value=""><?php echo (isset($LANG['NO_SETTING'])?$LANG['NO_SETTING']:'Leave as is / No Explicit Setting'); ?></option>
<option value="">--------------------------</option>
<?php
foreach($processingList as $ps){
echo '<option value="'.$ps.'">'.ucwords($ps).'</option>';
foreach($processingStatusArr as $v){

$keyOut = strtolower($v);

echo '<option value="'.$keyOut.'">'.ucwords($v).'</option>';
}
?>
</select>
Expand Down Expand Up @@ -871,8 +904,11 @@ function pkChanged(selObj){
<option value=""><?php echo (isset($LANG['NO_SETTING'])?$LANG['NO_SETTING']:'Leave as is / No Explicit Setting'); ?></option>
<option value="">--------------------------</option>
<?php
foreach($processingList as $ps){
echo '<option value="'.$ps.'">'.ucwords($ps).'</option>';
foreach($processingStatusArr as $v){

$keyOut = strtolower($v);

echo '<option value="'.$keyOut.'">'.ucwords($v).'</option>';
}
?>
</select>
Expand Down Expand Up @@ -1001,8 +1037,11 @@ function pkChanged(selObj){
<option value=""><?php echo (isset($LANG['NO_SETTING'])?$LANG['NO_SETTING']:'Leave as is / No Explicit Setting'); ?></option>
<option value="">--------------------------</option>
<?php
foreach($processingList as $ps){
echo '<option value="'.$ps.'">'.ucwords($ps).'</option>';
foreach($processingStatusArr as $v){

$keyOut = strtolower($v);

echo '<option value="'.$keyOut.'">'.ucwords($v).'</option>';
}
?>
</select>
Expand Down Expand Up @@ -1055,4 +1094,4 @@ function pkChanged(selObj){
include($SERVER_ROOT.'/includes/footer.php');
?>
</body>
</html>
</html>
58 changes: 34 additions & 24 deletions collections/editor/batchdeterminations.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
}
}
}

// Add collection customization variables
if($collid && file_exists('includes/config/occurVarColl'.$collid.'.php')){
//Specific to particular collection
include('includes/config/occurVarColl'.$collid.'.php');
}
elseif(file_exists('includes/config/occurVarDefault.php')){
//Specific to Default values for portal
include('includes/config/occurVarDefault.php');
}
?>

<html>
Expand Down Expand Up @@ -315,12 +325,12 @@ function openPopup(urlStr){
</div>
<div style="margin:15px;width:700px;">
<form name="accqueryform" action="batchdeterminations.php" method="post" onsubmit="return submitAccForm(this);">
<div>
<b><?php echo $LANG['CATNUM']; ?>:</b>
<div title="<?php echo (defined('CATALOGNUMBERTIP') ? CATALOGNUMBERTIP : ''); ?>">
<b><?php echo (defined('CATALOGNUMBERLABEL')?CATALOGNUMBERLABEL:(isset($LANG['CATNUM'])?$LANG['CATNUM']:'Catalog Number')); ?>:</b>
<input name="catalognumber" type="text" style="border-color:green;width:200px;" />
<span style="margin-left:20px"><input name="allcatnum" type="checkbox" checked /> <?php echo $LANG['TARGET_ALL']; ?></span>
</div>
<div>
<div title="<?php echo (defined('DETERMINATIONTAXONTIP') ? DETERMINATIONTAXONTIP : ''); ?>">
<b><?php echo $LANG['TAXON']; ?>:</b>
<input type="text" id="nomsciname" name="sciname" style="width:260px;" onfocus="initScinameAutocomplete(this.form)" />
</div>
Expand Down Expand Up @@ -354,8 +364,8 @@ function openPopup(urlStr){
<thead>
<tr>
<th style="width:25px;text-align:center;">&nbsp;</th>
<th style="width:125px;text-align:center;"><?php echo $LANG['CATNUM']; ?></th>
<th style="width:300px;text-align:center;"><?php echo $LANG['SCINAME']; ?></th>
<th style="width:125px;text-align:center;"><?php echo (defined('CATALOGNUMBERLABEL')?CATALOGNUMBERLABEL:(isset($LANG['CATNUM'])?$LANG['CATNUM']:'Catalog Number')); ?></th>
<th style="width:300px;text-align:center;"><?php echo (defined('SCIENTIFICNAMELABEL')?SCIENTIFICNAMELABEL:(isset($LANG['SCINAME'])?$LANG['SCINAME']:'Scientific Name')); ?></th>
<th style="text-align:center;"><?php echo $LANG['COLLECTOR_LOCALITY']; ?></th>
</tr>
</thead>
Expand All @@ -364,7 +374,7 @@ function openPopup(urlStr){
<div id="newdetdiv" style="">
<fieldset style="margin: 15px 15px 0px 15px;padding:15px;">
<legend><b><?php echo $LANG['NEW_DET_DETAILS']; ?></b></legend>
<div style='margin:3px;position:relative;height:35px'>
<div style='margin:3px;position:relative;height:35px' title="<?php echo (defined('ANNOTATIONTYPETIP') ? ANNOTATIONTYPETIP : ''); ?>">
<div style="float:left;">
<b><?php echo $LANG['ANNOTATION_TYPE']; ?>:</b>
</div>
Expand All @@ -374,48 +384,48 @@ function openPopup(urlStr){
</div>
</div>
<div style="clear:both;margin:15px 0px"><hr /></div>
<div id="idQualifierDiv" style='margin:3px;clear:both'>
<b><?php echo $LANG['ID_QUALIFIER']; ?>:</b>
<div id="idQualifierDiv" style='margin:3px;clear:both' title="<?php echo (defined('IDENTIFICATIONQUALIFIERTIP') ? IDENTIFICATIONQUALIFIERTIP : 'e.g. cf, aff, etc'); ?>">
<b><?php echo (defined('IDENTIFICATIONQUALIFIERLABEL')?IDENTIFICATIONQUALIFIERLABEL:(isset($LANG['ID_QUALIFIER'])?$LANG['ID_QUALIFIER']:'Identification Qualifier')); ?>:</b>
<input type="text" name="identificationqualifier" title="e.g. cf, aff, etc" />
</div>
<div style='margin:3px;'>
<b><?php echo $LANG['SCINAME']; ?>:</b>
<div style='margin:3px;' title="<?php echo (defined('SCIENTIFICNAMETIP') ? SCIENTIFICNAMETIP : ''); ?>">
<b><?php echo (defined('SCIENTIFICNAMELABEL')?SCIENTIFICNAMELABEL:(isset($LANG['SCINAME'])?$LANG['SCINAME']:'Scientific Name')); ?>:</b>
<input type="text" id="dafsciname" name="sciname" style="background-color:lightyellow;width:350px;" onfocus="initDetAutocomplete(this.form)" />
<input type="hidden" id="daftidtoadd" name="tidtoadd" value="" />
<input type="hidden" name="family" value="" />
</div>
<div style='margin:3px;'>
<b><?php echo $LANG['AUTHOR']; ?>:</b>
<div style='margin:3px;' title="<?php echo (defined('SCIENTIFICNAMEAUTHORSHIPTIP') ? SCIENTIFICNAMEAUTHORSHIPTIP : ''); ?>">
<b><?php echo (defined('SCIENTIFICNAMEAUTHORSHIPLABEL')?SCIENTIFICNAMEAUTHORSHIPLABEL:(isset($LANG['AUTHOR'])?$LANG['AUTHOR']:'Author')); ?>:</b>
<input type="text" name="scientificnameauthorship" style="width:200px;" />
</div>
<div id="codDiv" style='margin:3px;'>
<b><?php echo $LANG['CONFIDENCE']; ?>:</b>
<div id="codDiv" style='margin:3px;' title="<?php echo (defined('IDCONFIDENCETIP') ? IDCONFIDENCETIP : ''); ?>">
<b><?php echo (defined('IDCONFIDENCELABEL')?IDCONFIDENCELABEL:(isset($LANG['CONFIDENCE'])?$LANG['CONFIDENCE']:'Confidence of Determination')); ?>:</b>
<select name="confidenceranking">
<option value="8"><?php echo $LANG['HIGH']; ?></option>
<option value="5" selected><?php echo $LANG['MEDIUM']; ?></option>
<option value="2"><?php echo $LANG['LOW']; ?></option>
</select>
</div>
<div id="identifiedByDiv" style='margin:3px;'>
<b><?php echo $LANG['DETERMINER']; ?>:</b>
<div id="identifiedByDiv" style='margin:3px;' title="<?php echo (defined('IDENTIFIEDBYTIP') ? IDENTIFIEDBYTIP : ''); ?>">
<b><?php echo (defined('IDENTIFIEDBYLABEL')?IDENTIFIEDBYLABEL:(isset($LANG['DETERMINER'])?$LANG['DETERMINER']:'Determiner')); ?>:</b>
<input type="text" name="identifiedby" id="identifiedby" style="background-color:lightyellow;width:200px;" />
</div>
<div id="dateIdentifiedDiv" style='margin:3px;'>
<b><?php echo $LANG['DATE']; ?>:</b>
<div id="dateIdentifiedDiv" style='margin:3px;' title="<?php echo (defined('DATEIDENTIFIEDTIP') ? DATEIDENTIFIEDTIP : ''); ?>">
<b><?php echo (defined('DATEIDENTIFIEDLABEL')?DATEIDENTIFIEDLABEL:(isset($LANG['DATE'])?$LANG['DATE']:'Date')); ?>:</b>
<input type="text" name="dateidentified" id="dateidentified" style="background-color:lightyellow;" onchange="detDateChanged(this.form);" />
</div>
<div style='margin:3px;'>
<b><?php echo $LANG['REFERENCE']; ?>:</b>
<div style='margin:3px;' title="<?php echo (defined('IDENTIFICATIONREFERENCETIP') ? IDENTIFICATIONREFERENCETIP : ''); ?>">
<b><?php echo (defined('IDENTIFICATIONREFERENCELABEL')?IDENTIFICATIONREFERENCELABEL:(isset($LANG['REFERENCE'])?$LANG['REFERENCE']:'Reference')); ?>:</b>
<input type="text" name="identificationreferences" style="width:350px;" />
</div>
<div style='margin:3px;'>
<b><?php echo $LANG['NOTES']; ?>:</b>
<div style='margin:3px;' title="<?php echo (defined('IDENTIFICATIONREMARKSTIP') ? IDENTIFICATIONREMARKSTIP : ''); ?>">
<b><?php echo (defined('IDENTIFICATIONREMARKSLABEL')?IDENTIFICATIONREMARKSLABEL:(isset($LANG['NOTES'])?$LANG['NOTES']:'Notes')); ?>:</b>
<input type="text" name="identificationremarks" style="width:350px;" />
</div>
<div id="makeCurrentDiv" style='margin:3px;'>
<div id="makeCurrentDiv" style='margin:3px;'title="<?php echo (defined('MAKECURRENTDETERMINATIONTIP') ? MAKECURRENTDETERMINATIONTIP : ''); ?>">
<input type="checkbox" name="makecurrent" value="1" checked /> <?php echo $LANG['MAKE_CURRENT']; ?>
</div>
<div style='margin:3px;'>
<div style='margin:3px;' title="<?php echo (defined('ANNOTATIONPRINTQUEUETIP') ? ANNOTATIONPRINTQUEUETIP : ''); ?>">
<input type="checkbox" name="printqueue" value="1" checked /> <?php echo $LANG['ADD_PRINT_QUEUE']; ?>
<a href="../reports/annotationmanager.php?collid=<?php echo $collid; ?>" target="_blank"><img src="../../images/list.png" style="width:13px" title="<?php echo $LANG['DISPLAY_QUEUE']; ?>" /></a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions collections/editor/dev/occurdataentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<a href="#" onclick="parseVerbatimElevation(document.entryform);return false">&lt;&lt;</a>
</div>
<div style="float:left;">
<?php echo (defined('VERBATIMELEVATION')?VERBATIMELEVATION:'Verbatim Elevation'); ?>
<?php echo (defined('VERBATIMELEVATIONLABEL')?VERBATIMELEVATIONLABEL:'Verbatim Elevation'); ?>
<br/>
<input type="text" name="verbatimelevation" tabindex="62" maxlength="255" value="<?php echo array_key_exists('verbatimelevation',$occArr)?$occArr['verbatimelevation']:''; ?>" onchange="verbatimElevationChanged(this.form);" title="" />
</div>
Expand Down Expand Up @@ -324,7 +324,7 @@
<?php echo (defined('ASSOCIATEDTAXALABEL')?ASSOCIATEDTAXALABEL:'Associated Taxa'); ?><br/>
<textarea name="associatedtaxa" tabindex="84"><?php echo array_key_exists('associatedtaxa',$occArr)?$occArr['associatedtaxa']:''; ?></textarea>
<?php
if(!isset($ACTIVATEASSOCTAXAAID) || $ACTIVATEASSOCTAXAAID){
if(!defined('ACTIVATEASSOCTAXAAID') || ACTIVATEASSOCTAXAAID){
echo '<a href="#" onclick="openAssocSppAid();return false;"><img src="../../images/list.png" /></a>';
}
?>
Expand All @@ -349,7 +349,7 @@
<?php echo (defined('OTHERCATALOGNUMBERSLABEL')?OTHERCATALOGNUMBERSLABEL:'Other Numbers'); ?>
<a href="#" onclick="return dwcDoc('otherCatalogNumbers')"><img class="docimg" src="../../images/qmark.png" /></a>
<br/>
<input type="text" name="othercatalognumbers" tabindex="4" maxlength="255" value="<?php echo array_key_exists('othercatalognumbers',$occArr)?$occArr['othercatalognumbers']:''; ?>" onchange="fieldChanged('othercatalognumbers');<?php if(defined('OTHERCATNUMDUPECHECK') && OTHERCATNUMDUPECHECK) echo 'searchDupesOtherCatalogNumbers(this.form)'; ?>" />
<input type="text" name="othercatalognumbers" tabindex="4" maxlength="255" value="<?php echo array_key_exists('othercatalognumbers',$occArr)?$occArr['othercatalognumbers']:''; ?>" onchange="fieldChanged('othercatalognumbers');<?php if(!defined('OTHERCATNUMDUPECHECK') || OTHERCATNUMDUPECHECK) echo 'searchDupesOtherCatalogNumbers(this.form)'; ?>" />
</div>
<div id="recordNumberDiv">
<?php echo (defined('RECORDNUMBERLABEL')?RECORDNUMBERLABEL:'Number'); ?>
Expand Down
2 changes: 1 addition & 1 deletion collections/editor/dev/occureditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ function requestImage(){
<br/>
<textarea name="associatedtaxa" tabindex="84" onchange="fieldChanged('associatedtaxa');"><?php echo array_key_exists('associatedtaxa',$occArr)?$occArr['associatedtaxa']:''; ?></textarea>
<?php
if(!isset($ACTIVATEASSOCTAXAAID) || $ACTIVATEASSOCTAXAAID){
if(!defined('ACTIVATEASSOCTAXAAID') || ACTIVATEASSOCTAXAAID){
echo '<a href="#" onclick="openAssocSppAid();return false;"><img class="editimg" src="../../images/list.png" /></a>';
}
?>
Expand Down
Loading