<div class="row">
<div class="col-md-12">
- <h2>[% l('Remote Printer Settings') %]</h2>
-
- <div class="alert alert-warning" ng-if="!hatchIsOpen()">
-[% l('Remote printing is not available on this browser. The settings below will have no effect.') %]
- </div>
+ <h2>[% l('Hatch Printer Settings') %]</h2>
<div class="alert alert-warning"
ng-if="hatchIsOpen() && !useHatchPrinting()">
<p>
-[% l("Remote printing is not enabled on this browser. The settings below will have no effect until remote printing is enabled.") %]
+[% l("Hatch printing is not enabled on this browser. The settings below will have no effect until Hatch printing is enabled.") %]
<a href="./admin/workstation/hatch" target="_self"
title="[% l('Hatch Administration') %]">
- [% l('Enable Remote Printing.') %]
+ [% l('Enable Hatch Printing.') %]
</a>
</p>
</div>
<div class="tab-content">
<div class="tab-pane active">
+ <div class="alert alert-warning" ng-if="!isTestView && !hatchIsOpen()">
+[% l('Hatch is not installed in this browser. Printing must be configured via the native browser print configuration.') %]
+ </div>
+
<!-- printer config UI -->
- <div class="row" ng-hide="isTestView">
+ <div class="row" ng-hide="isTestView || !hatchIsOpen()">
<div class="col-md-6">
<div class="input-group">
<div class="input-group-btn" uib-dropdown>
</div>
</div><!-- row -->
- <div class="row" ng-hide="isTestView">
+ <div class="row" ng-hide="isTestView || !hatchIsOpen()">
<div class="col-md-10">
<div class="row">
<div class="col-md-1"></div>
</div><!-- col -->
</div><!-- row -->
- <div class="row" ng-hide="isTestView">
+ <div class="row" ng-hide="isTestView || !hatchIsOpen()">
<div class="col-md-12">
<h3>[% l('Compiled Printer Settings') %]</h3>
<pre>{{printerConfString()}}</pre>
}
$scope.setContext('default');
+ $scope.setContentType = function(type) { $scope.contentType = type }
+ $scope.setContentType('text/plain');
+
$scope.useHatchPrinting = function() {
return egCore.hatch.usePrinting();
}
return printer;
}
- // fetch info on all remote printers
- egCore.hatch.getPrinters()
- .then(function(printers) {
- $scope.printers = printers;
-
- var def = $scope.getPrinterByAttr('is-default', true);
- if (!def && printers.length) def = printers[0];
-
- if (def) {
- $scope.defaultPrinter = def;
- loadPrinterOptions(def.name);
- }
- }).then(function() {
- angular.forEach(
- ['default','receipt','label','mail','offline'],
- function(ctx) {
- egCore.hatch.getPrintConfig(ctx).then(function(conf) {
- if (conf) {
- $scope.printConfig[ctx] = conf;
- } else {
- $scope.resetPrinterSettings(ctx);
- }
- });
- }
- );
- });
-
$scope.resetPrinterSettings = function(context) {
$scope.printConfig[context] = {
context : context,
loadPrinterOptions(name);
}
- // for testing
- $scope.setContentType = function(type) { $scope.contentType = type }
-
$scope.testPrint = function(withDialog) {
if ($scope.contentType == 'text/plain') {
egCore.print.print({
}
}
- $scope.setContentType('text/plain');
+ // Load startup data....
+ // Don't bother talking to Hatch if it's not there.
+ if (!egCore.hatch.hatchAvailable) return;
+
+ // fetch info on all remote printers
+ egCore.hatch.getPrinters()
+ .then(function(printers) {
+ $scope.printers = printers;
+
+ var def = $scope.getPrinterByAttr('is-default', true);
+ if (!def && printers.length) def = printers[0];
+
+ if (def) {
+ $scope.defaultPrinter = def;
+ loadPrinterOptions(def.name);
+ }
+ }).then(function() {
+ angular.forEach(
+ ['default','receipt','label','mail','offline'],
+ function(ctx) {
+ egCore.hatch.getPrintConfig(ctx).then(function(conf) {
+ if (conf) {
+ $scope.printConfig[ctx] = conf;
+ } else {
+ $scope.resetPrinterSettings(ctx);
+ }
+ });
+ }
+ );
+ });
}])
function refreshKeys() {
$scope.keys = {local : [], remote : []};
- egCore.hatch.getRemoteKeys().then(
- function(keys) { $scope.keys.remote = keys.sort() })
+ if (egCore.hatch.hatchAvailable) {
+ egCore.hatch.getRemoteKeys().then(
+ function(keys) { $scope.keys.remote = keys.sort() })
+ }
// local calls are non-async
$scope.keys.local = egCore.hatch.getLocalKeys();