webstaff: Acquisitions Administration
authorJason Etheridge <jason@esilibrary.com>
Tue, 18 Oct 2016 17:48:50 +0000 (13:48 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:04 +0000 (14:10 -0500)
FIXME:

* Acq Admin -> Distribution Formulas -> Formula Detail Page : render problem, no uncaught exceptions
* Acq Admin -> Funds : TypeError: openils.XUL.localStorage is not a function

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/admin/acq/index.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/admin/acq/t_splash.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/admin/acq/app.js [new file with mode: 0644]

diff --git a/Open-ILS/src/templates/staff/admin/acq/index.tt2 b/Open-ILS/src/templates/staff/admin/acq/index.tt2
new file mode 100644 (file)
index 0000000..f5a8b7a
--- /dev/null
@@ -0,0 +1,15 @@
+[%
+  WRAPPER "staff/base.tt2";
+  ctx.page_title = l("Acquisitions Administration"); 
+  ctx.page_app = "egAcqAdmin";
+%]
+
+[% BLOCK APP_JS %]
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/admin/acq/app.js"></script>
+<link rel="stylesheet" href="[% ctx.base_path %]/staff/css/admin.css" />
+[% END %]
+
+<div ng-view></div>
+
+[% END %]
diff --git a/Open-ILS/src/templates/staff/admin/acq/t_splash.tt2 b/Open-ILS/src/templates/staff/admin/acq/t_splash.tt2
new file mode 100644 (file)
index 0000000..4723795
--- /dev/null
@@ -0,0 +1,49 @@
+
+<div class="container-fluid" style="text-align:center">
+  <div class="alert alert-info alert-less-pad strong-text-2">
+    <span>[% l('Acquisitions Administration') %]</span>
+  </div>
+</div>
+
+<div class="container admin-splash-container">
+
+[%
+    interfaces = [
+     [ l('Currency Types'), "./admin/acq/currency_type/list" ]
+    ,[ l('Distribution Formulas'), "./admin/acq/conify/distribution_formula" ]
+    ,[ l('EDI Accounts'), "./admin/acq/conify/edi_account" ]
+    ,[ l('EDI Messages'), "./admin/acq/po/edi_messages" ]
+    ,[ l('Exchange Rates'), "./admin/acq/conify/exchange_rate" ]
+    ,[ l('Fund Tags'), "./admin/acq/conify/fund_tag" ]
+    ,[ l('Funding Sources'), "./admin/acq/funding_source/list" ]
+    ,[ l('Funds'), "./admin/acq/fund/list" ]
+    ,[ l('Providers'), "./admin/acq/conify/provider" ]
+    ,[ l('Claim Event Types'), "./admin/acq/conify/claim_event_type" ]
+    ,[ l('Claim Policies'), "./admin/acq/conify/claim_policy" ]
+    ,[ l('Claim Policy Actions'), "./admin/acq/conify/claim_policy_action" ]
+    ,[ l('Claim Types'), "./admin/acq/conify/claim_type" ]
+    ,[ l('Invoice Item Types'), "./admin/acq/conify/invoice_item_type" ]
+    ,[ l('Invoice Payment Method'), "./admin/acq/conify/invoice_payment_method" ]
+    ,[ l('Cancel Reasons'), "./admin/acq/conify/cancel_reason" ]
+    ,[ l('Line Item Alerts'), "./admin/acq/conify/lineitem_alert" ]
+    ,[ l('Line Item MARC Attribute Definitions'), "./admin/acq/conify/lineitem_marc_attr_def" ]
+   ];
+
+   USE table(interfaces, rows=9);
+%]
+
+[% FOREACH row = table.rows %]
+  <div class="row new-entry">
+    [% FOREACH item = row %][% IF item.1 %]
+    <div class="col-md-4">
+      <span class="glyphicon glyphicon-pencil"></span>
+      <a target="_self" href="[% item.1 %]">
+        [% item.0 %]
+      </a>
+    </div>
+    [% END %][% END %]
+  </div>
+[% END %]
+
+</div>
+
index 953f2d1..262ceef 100644 (file)
             </a>
           </li>
           <li>
+            <a href="./admin/acq/index" target="_self">
+              <span class="glyphicon glyphicon-usd"></span>
+              [% l('Acquisitions Administration') %]
+            </a>
+          </li>
+          <li>
             <a href="./reporter/legacy/main" target="_self">
               <span class="glyphicon glyphicon-object-align-bottom"></span>
               [% l('Reports') %]
diff --git a/Open-ILS/web/js/ui/default/staff/admin/acq/app.js b/Open-ILS/web/js/ui/default/staff/admin/acq/app.js
new file mode 100644 (file)
index 0000000..245725e
--- /dev/null
@@ -0,0 +1,60 @@
+angular.module('egAcqAdmin',
+    ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod'])
+
+.config(['$routeProvider','$locationProvider','$compileProvider', 
+ function($routeProvider , $locationProvider , $compileProvider) {
+
+    $locationProvider.html5Mode(true);
+    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); 
+    var resolver = {delay : function(egStartup) {return egStartup.go()}};
+
+    var eframe_template = 
+        '<eg-embed-frame url="acq_admin_url" handlers="funcs"></eg-embed-frame>';
+
+    $routeProvider.when('/admin/acq/:noun/:verb/:extra?', {
+        template: eframe_template,
+        controller: 'EmbedAcqCtl',
+        resolve : resolver
+    });
+
+    // default page 
+    $routeProvider.otherwise({
+        templateUrl : './admin/acq/t_splash',
+        resolve : resolver
+    });
+}])
+
+.controller('EmbedAcqCtl',
+       ['$scope','$routeParams','$location','egCore',
+function($scope , $routeParams , $location , egCore) {
+
+    $scope.funcs = {
+        ses : egCore.auth.token(),
+    }
+
+    var acq_path = '/eg/';
+
+    if ($routeParams.noun == 'conify') {
+        acq_path += 'conify/global/acq/' + $routeParams.verb
+            + (typeof $routeParams.extra != 'undefined'
+                ? '/' + $routeParams.extra
+                : '')
+            + location.search;
+    } else {
+        acq_path += 'acq/'
+            + $routeParams.noun + '/' + $routeParams.verb
+            + (typeof $routeParams.extra != 'undefined'
+                ? '/' + $routeParams.extra
+                : '')
+            + location.search;
+    }
+
+    // embed URL must include protocol/domain or it will be loaded via
+    // push-state, resulting in an infinitely nested pages.
+    $scope.acq_admin_url =
+        $location.absUrl().replace(/\/eg\/staff.*/, acq_path);
+
+    console.log('Loading Admin Acq URL: ' + $scope.acq_admin_url);
+
+}])
+