--- /dev/null
+<!--
+ MFHD creation dialog
+-->
+<div>
+ <div class="modal-header">
+ <button type="button" class="close"
+ ng-click="cancel()" aria-hidden="true">×</button>
+ <h4 class="modal-title alert alert-info">Create new MFHD</h4>
+ </div>
+ <div class="modal-body">
+ <label for="mfhd_lib_selector">
+ [% l('Select a library') %]
+ </label>
+ <eg-org-selector id="mfhd_lib_selector"
+ selected="mfhd_lib">
+ </eg-org-selector>
+ </div>
+ <div class="modal-footer">
+ [% dialog_footer %]
+ <input type="submit" class="btn btn-primary"
+ ng-click="ok()" value="[% l('Create') %]"/>
+ <button class="btn btn-warning"
+ ng-click="cancel()">[% l('Cancel') %]</button>
+ </div>
+</div>
--- /dev/null
+/**
+ * MFHD tools and directives.
+ */
+angular.module('egMfhdMod', ['egCoreMod', 'ui.bootstrap'])
+
+.factory('egMfhdCreateDialog',
+ ['$uibModal','egCore',
+function($uibModal , egCore) {
+ var service = {};
+
+ service.open = function(bibId, orgId) {
+ return $uibModal.open({
+ templateUrl: './share/t_mfhd_create_dialog',
+ controller: ['$scope', '$uibModalInstance',
+ function($scope, $uibModalInstance) {
+ $scope.mfhd_lib = orgId ?
+ egCore.org.get(orgId) :
+ null;
+ $scope.ok = function() {
+ egCore.net.request(
+ 'open-ils.cat',
+ 'open-ils.cat.serial.record.xml.create',
+ egCore.auth.token(),
+ 1, // source
+ $scope.mfhd_lib.id(),
+ bibId
+ ).then(function() {
+ $uibModalInstance.close()
+ });
+ }
+ $scope.cancel = function() {
+ $uibModalInstance.dismiss();
+ }
+ }
+ ]
+ })
+ }
+
+ return service;
+}
+])