Skip to content

Commit

Permalink
Occurrence Label debugging continued
Browse files Browse the repository at this point in the history
  • Loading branch information
egbot committed Nov 11, 2020
1 parent 947e7d6 commit 0caab58
Showing 1 changed file with 58 additions and 40 deletions.
98 changes: 58 additions & 40 deletions collections/reports/labelmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,19 @@ function openPopup(urlStr){
return false;
}

function changeFormExport(action,target){
var f = document.selectform;
if(action == "labelsword.php" && document.getElementById('packetradio').checked == true){
function changeFormExport(buttonElem, action, target){
var f = buttonElem.form;
if(action == "labeldynamic.php" && buttonElem.value == "Print in Browser"){
labelFormatSelected = false;
if(f["labelformatindex-g"] && f["labelformatindex-g"].value != "") labelFormatSelected = true;
if(f["labelformatindex-c"] && f["labelformatindex-c"].value != "") labelFormatSelected = true;
if(f["labelformatindex-u"] && f["labelformatindex-u"].value != "") labelFormatSelected = true;
if(!labelFormatSelected){
alert("Please select a Label Format Profile");
return false;
}
}
else if(action == "labelsword.php" && f.packetradio.checked == true){
alert("Packet labels are not yet available as a Word document");
return false;
}
Expand Down Expand Up @@ -343,37 +353,31 @@ function labelFormatChanged(selObj,catStr){
</table>
<fieldset style="margin-top:15px;">
<legend>Label Printing</legend>
<?php
if($labelFormatArr){
?>
<div class="fieldDiv">
<div class="fieldLabel">Predefined Label Format:</div>
<div class="fieldElement">
<?php
foreach($labelFormatArr as $cat => $catArr){
$catStr = 'Portal defined profiles';
if($cat == 'c') $catStr = 'Collection defined profiles';
if($cat == 'u') $catStr = 'User defined profiles';
?>
<div>
<select name="labelformatindex<?php echo '-'.$cat; ?>" onchange="labelFormatChanged(this,'<?php echo $cat; ?>')">
<option value=""><?php echo $catStr; ?></option>
<option value="">=========================================</option>
<?php
foreach($catArr as $k => $labelArr){
echo '<option value="'.$k.'">'.$labelArr['name'].'</option>';
}
?>
</select>
</div>
<?php
}
<div class="fieldDiv">
<div class="fieldLabel">Label Format Profiles:</div>
<div class="fieldElement">
<?php
foreach($labelFormatArr as $cat => $catArr){
$catStr = 'Portal defined profiles';
if($cat == 'c') $catStr = 'Collection defined profiles';
if($cat == 'u') $catStr = 'User defined profiles';
?>
</div>
<div>
<select name="labelformatindex<?php echo '-'.$cat; ?>" onchange="labelFormatChanged(this,'<?php echo $cat; ?>')">
<option value=""><?php echo $catStr; ?></option>
<option value="">=========================================</option>
<?php
foreach($catArr as $k => $labelArr){
echo '<option value="'.$k.'">'.$labelArr['name'].'</option>';
}
?>
</select>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
<div class="fieldDiv">
<div class="fieldLabel">Heading Prefix:</div>
<div class="fieldElement">
Expand All @@ -387,7 +391,7 @@ function labelFormatChanged(selObj,catStr){
<input type="radio" id="lhmid2" name="lhmid" value="2" />State
<input type="radio" id="lhmid3" name="lhmid" value="3" />County
<input type="radio" id="lhmid4" name="lhmid" value="4" />Family
<input type="radio" id="lhmid0" name="lhmid" value="0" />Blank
<input type="radio" id="lhmid0" name="lhmid" value="0" checked/>Blank
</div>
</div>
<div class="fieldDiv">
Expand Down Expand Up @@ -432,27 +436,41 @@ function labelFormatChanged(selObj,catStr){
?>
<div style="float:left;">
<fieldset style="margin:10px;width:225px;">
<legend><b>Label Format</b></legend>
<legend><b>Column Count</b></legend>
<input type="radio" id="columncount1" name="columncount" value="1" /> 1 columns per page<br/>
<input type="radio" id="columncount2" name="columncount" value="2" /> 2 columns per page<br/>
<input type="radio" id="columncount2" name="columncount" value="2" checked /> 2 columns per page<br/>
<input type="radio" id="columncount3" name="columncount" value="3" /> 3 columns per page<br/>
<input id="packetradio" type="radio" name="columncount" value="packet" /> packet labels<br/>
</fieldset>
</div>
<div style="float:left;margin: 15px 50px;">
<input type="hidden" name="collid" value="<?php echo $collid; ?>" />
<input type="submit" name="submitaction" onclick="changeFormExport('labeldynamic.php','_blank');" value="Print in Browser" />
<br/><br/>
<input type="submit" name="submitaction" onclick="changeFormExport('labeldynamic.php','_self');" value="Export to CSV" />
<div style="margin:10px">
<input type="submit" name="submitaction" onclick="return changeFormExport(this,'labeldynamic.php','_blank');" value="Print in Browser" <?php echo ($labelFormatArr?'':'DISABLED title="Browser based label printing has not been activated within the portal. Contact Portal Manager to activate this feature."'); ?> />
</div>
<div style="margin:10px">
<input type="submit" name="submitaction" onclick="return changeFormExport(this,'labeldynamic.php','_self');" value="Export to CSV" />
</div>
<?php
if($reportsWritable){
?>
<br/><br/>
<input type="submit" name="submitaction" onclick="return changeFormExport('labelsword.php','_self');" value="Export to DOCX" />
<div style="margin:10px">
<input type="submit" name="submitaction" onclick="return changeFormExport(this,'labelsword.php','_self');" value="Export to DOCX" />
</div>
<?php
}
?>
</div>
<?php
if($reportsWritable){
?>
<div style="clear:both;padding:10px 0px">
Note: Output of variable Label Formats as a Word document is not yet supported<br/>A possible work around is to print labels as PDF and
then convert to a Word doc using Adobe tools.<br/>Another alternatively, is to output the data as CSV and then setup a Mail Merge Word document.
</div>
<?php
}
?>
</fieldset>
</form>
<?php
Expand Down

0 comments on commit 0caab58

Please sign in to comment.