RewriteCond %{QUERY_STRING} (^.*$)
RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
+
+
+# General Evergreen web template processor
+<Location /eg>
+ SetHandler perl-script
+ PerlHandler OpenILS::WWW::EGWeb
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+# Note: the template processor will decline handling anything it does not
+# have an explicit configuration for, which means it will fall back to
+# Apache to serve the file. However, in the interest of speed, go ahead
+# and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
+# Add more exemptions as needed.
+<LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
+ SetHandler None
+</LocationMatch>
+
+
--- /dev/null
+<oils_web>
+ <!-- This should match the Apache Directory/Location[Match] configuration path -->
+ <base_uri>/eg</base_uri>
+
+ <!-- media_prefix can be a remote server.
+ E.g. <media_prefix>http://static.example.com/media</media_prefix> -->
+ <media_prefix/>
+
+ <!-- Where templates can be found. Paths will be checked in the order entered here.
+ It's possible to override individual or sets of templates by putting them into
+ a path in front of the default template path -->
+ <template_paths>
+ <!-- XXX we should really move these out of the default web root -->
+ <path>/openils/var/web/templates</path>
+ </template_paths>
+
+ <handlers>
+ <handler path='acq/picklist/list' template='acq/picklist/list.tt2'/>
+ <handler path='acq/picklist/view' template='acq/picklist/view.tt2'/>
+ <handler path='acq/picklist/bib_search' template='acq/picklist/bib_search.tt2'/>
+ <handler path='acq/fund/list' template='acq/financial/list_funds.tt2'/>
+ <handler path='acq/fund/view' template='acq/financial/view_fund.tt2'/>
+ <handler path='acq/funding_source/list' template='acq/financial/list_funding_sources.tt2'/>
+ <handler path='acq/funding_source/view' template='acq/financial/view_funding_source.tt2'/>
+ <handler path='acq/currency_type/list' template='acq/financial/list_currency_types.tt2'/>
+ <handler path='acq/currency_type/view' template='acq/financial/view_currency_type.tt2'/>
+ <handler path='acq/provider/list' template='acq/financial/list_providers.tt2'/>
+ <handler path='acq/provider/view' template='acq/financial/view_provider.tt2'/>
+ <handler path='acq/po/view' template='acq/po/view.tt2'/>
+ <handler path='acq/po/li_search' template='acq/po/li_search.tt2'/>
+ <handler path='acq/po/search' template='acq/po/search.tt2'/>
+ <handler path='acq/receiving/process' template='acq/receiving/process.tt2'/>
+ <handler path='acq/settings/li_attr' template='acq/settings/li_attr.tt2'/>
+ </handlers>
+</oils_web>
--- /dev/null
+package OpenILS::WWW::EGWeb;
+use strict; use warnings;
+use Template;
+use XML::Simple;
+use File::stat;
+use Apache2::Const -compile => qw(OK DECLINED HTTP_INTERNAL_SERVER_ERROR);
+use Apache2::Log;
+
+use constant OILS_HTTP_COOKIE_SKIN => 'oils:skin';
+use constant OILS_HTTP_COOKIE_THEME => 'oils:theme';
+use constant OILS_HTTP_COOKIE_LOCALE => 'oils:locale';
+
+my $web_config;
+my $web_config_file;
+my $web_config_edit_time;
+
+sub import {
+ my $self = shift;
+ $web_config_file = shift;
+ unless(-r $web_config_file) {
+ warn "Invalid web config $web_config_file";
+ return;
+ }
+ check_web_config();
+}
+
+
+sub handler {
+ my $r = shift;
+ check_web_config($r); # option to disable this
+ my $ctx = load_context($r);
+ my $base = $ctx->{base_uri};
+ my($template, $page_args) = find_template($r, $base);
+ return Apache2::Const::DECLINED unless $template;
+
+ $template = $ctx->{skin} . "/$template";
+ $ctx->{page_args} = $page_args;
+ $r->content_type('text/html; encoding=utf8');
+
+ my $tt = Template->new({
+ OUTPUT => $r,
+ INCLUDE_PATH => $ctx->{template_paths},
+ });
+
+ unless($tt->process($template, {ctx => $ctx})) {
+ $r->log->warn('Template error: ' . $tt->error);
+ return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+ return Apache2::Const::OK;
+}
+
+sub load_context {
+ my $r = shift;
+ my $cgi = CGI->new;
+ my $ctx = $web_config->{ctx};
+ $ctx->{skin} = $cgi->cookie(OILS_HTTP_COOKIE_SKIN) || 'default';
+ $ctx->{theme} = $cgi->cookie(OILS_HTTP_COOKIE_THEME) || 'default';
+ $ctx->{locale} =
+ $r->headers_in->get('Accept-Language') || # this will need some trimming
+ $cgi->cookie(OILS_HTTP_COOKIE_LOCALE) || 'en-US';
+ $r->log->debug('skin = ' . $ctx->{skin} . ' : theme = ' .
+ $ctx->{theme} . ' : locale = ' . $ctx->{locale});
+ return $ctx;
+}
+
+# Given a URI, finds the configured template and any extra page
+# arguments (trailing path info). Any extra data is returned
+# as page arguments, in the form of an array, one item per
+# /-separated URI component
+sub find_template {
+ my $r = shift;
+ my $base = shift;
+ my $path = $r->uri;
+ $path =~ s/$base//og;
+ my @parts = split('/', $path);
+ my $template = '';
+ my $page_args = [];
+ my $handler = $web_config->{handlers};
+ while(@parts) {
+ my $part = shift @parts;
+ next unless $part;
+ my $t = $handler->{$part};
+ if(ref $t) {
+ $handler = $t;
+ } else {
+ $template = $t;
+ $page_args = [@parts];
+ last;
+ }
+ }
+
+ unless($template) {
+ $r->log->warn("No template configured for path $path");
+ return ();
+ }
+
+ $r->log->debug("template = $template : page args = @$page_args");
+ return ($template, $page_args);
+}
+
+# if the web configuration file has never been loaded or has
+# changed since the last load, reload it
+sub check_web_config {
+ my $r = shift;
+ my $epoch = stat($web_config_file)->mtime;
+ unless($web_config_edit_time and $web_config_edit_time == $epoch) {
+ $r->log->debug("Reloading web config after edit...") if $r;
+ $web_config_edit_time = $epoch;
+ $web_config = parse_config($web_config_file);
+ }
+}
+
+sub parse_config {
+ my $cfg_file = shift;
+ my $data = XML::Simple->new->XMLin($cfg_file);
+ my $ctx = {};
+ my $handlers = {};
+
+ $ctx->{media_prefix} = (ref $data->{media_prefix}) ? '' : $data->{media_prefix};
+ $ctx->{base_uri} = (ref $data->{base_uri}) ? '' : $data->{base_uri};
+ $ctx->{template_paths} = [];
+
+ my $tpaths = $data->{template_paths}->{path};
+ $tpaths = [$tpaths] unless ref $tpaths;
+ push(@{$ctx->{template_paths}}, $_) for @$tpaths;
+
+ for my $handler (@{$data->{handlers}->{handler}}) {
+ my @parts = split('/', $handler->{path});
+ my $h = $handlers;
+ my $pcount = scalar(@parts);
+ for(my $i = 0; $i < $pcount; $i++) {
+ my $p = $parts[$i];
+ unless(defined $h->{$p}) {
+ if($i == $pcount - 1) {
+ $h->{$p} = $handler->{template};
+ last;
+ } else {
+ $h->{$p} = {};
+ }
+ }
+ $h = $h->{$p};
+ }
+ }
+
+ return {ctx => $ctx, handlers => $handlers};
+}
+
+
+1;
--- /dev/null
+/* import the default css for the install applications */
+@import "default/acq.css";
+@import "default/admin.css";
+/* import the dojo CSS */
+@import "/js/dojo/dojo/resources/dojo.css";
+@import "/js/dojo/dijit/themes/tundra/tundra.css";
+@import "/js/dojo/dojox/grid/_grid/Grid.css";
+
+
+html, body, #oils-base-body-block {
+ width:100%;
+ height:100%;
+ border:0;
+ margin:0;
+ padding:0;
+}
+table { border-collapse: collapse; }
+/* use this for divs whose contents should be entirely contained within the div */
+.container:after {content: ""; display: block; height: 0; clear: both; }
+
+.invisible { visibility: hidden; }
+.hidden { display: none; visibility: hidden; }
+.display { display: block; visibility: visible; }
+.oils-login-dialog td { padding: 5px; }
+
+/* main layout blocks */
+#oils-base-main-block { width: 100%; margin-top: 0px; padding-top: 0px;}
+#oils-base-navigate-block { width: 12%; vertical-align: top; float:left;}
+#oils-base-content-block { width: 87%; vertical-align: top; float:right; padding-top: 0px;}
+#oils-base-sidebar-block { width: 12%; vertical-align: top; float:left;}
+
+#oils-base-header-auto-login { padding-right: 20px; }
+#oils-base-header-block { width: 100%; text-align: right; margin-top: 0px; padding-bottom: 0px;}
+#oils-base-header-menu-block { float:left; text-align: left; width: 50%; }
+#oils-base-header-auto-login-block { float:right; text-align: right; width: 47%;}
+
+#oils-base-footer-block { width: 100%; text-align: center; vertical-align: bottom;}
+
+#oils-base-navigate-list { width: 100%; }
+.oils-base-navigate-sub-list { padding-left: 4px; }
+.oils-base-navigate-item {}
+
+/* general purpose form table */
+.oils-admin-table { width: 100%; }
+.oils-admin-table td { padding: 4px; }
+.oils-admin-table textarea { width: 400px; height: 40px; overflow:auto;}
+.oils-admin-label { width: auto; }
+
+.label { margin: 1px; }
+
+
+/* local dojo style enhancements ----------------------------------- */
+/*
+.dojoxGrid {border: 1px solid #333; height: 90%;}
+*/
+/*
+.dojoxGrid {height: 90%;}
+.dojoxGrid-cell {padding: 8px;}
+*/
+.dijitTooltipTable td {padding: 3px;} /* custom class for handling dialog tables */
+/* ----------------------------------------------------------------- */
+
--- /dev/null
+.spacer {clear: both}
+
+#oils-acq-index-block { font-weight:bold; }
+/*
+.oils-sub-navigate-block { width: 100%; text-align: left; padding: 3px;}
+.oils-sub-navigate-block span { padding: 3px; }
+*/
+
+.oils-acq-detail-content-pane {height:600px;width:100%}
+.oils-acq-basic-form-table td {padding:4px;}
+
+/* bib search */
+#oils-acq-search-container { width:100%; }
+#oils-acq-search-sources-block { width:32%; vertical-align: top; float: left; margin-right: 10px;}
+#oils-acq-search-form-block { width:63%; vertical-align: top; float:right; }
+#oils-acq-search-sources-selector { padding: 2px; }
+#oils-acq-search-sources-selector option { margin-bottom: 2px; }
+.oils-acq-search-form-row { width: 100%; }
+.oils-acq-search-form-label {}
+.oils-acq-search-form-input {}
+#oils-acq-search-sources-list { padding: 1px; }
+#oils-acq-search-sources-list li { list-style-type: none; padding-left: 0px; }
+.oils-acq-search-sources-sublist { padding: 1px; list-style-type: none;}
+.oils-acq-search-sources-sublist li { margin-left: 10px; }
+.oils-acq-search-subsources-label { margin-top: 5px; }
+#oils-acq-search-sources-label { margin-bottom: 10px; }
+#oils-acq-search-fields-label { margin-bottom: 10px; }
+#oils-acq-search-fields-submit-block { margin: 5px; text-align: center;}
+#oils-acq-search-progress {width: 100%; text-align: center;}
+#oils-acq-search-source-select option {padding: 5px;}
+#oils-acq-search-fields-tbody td {padding: 3px;}
+
+/* list of picklists */
+#oils-acq-picklist-list-table {width: 100%;}
+#oils-acq-picklist-list-table td {padding: 3px;}
+
+/* a single picklist */
+#oils-acq-picklist-table { width: 100%; }
+#oils-acq-picklist-header { padding: 4px; margin-bottom: 20px; }
+.oils-acq-picklist-records-jacket-td { width: 46px; height: 54px; }
+.oils-acq-picklist-records-jacket { width: 42px; height: 54px; padding-left: 0px; }
+.oils-acq-picklist-records-title {vertical-align: top}
+.oils-acq-picklist-records-copies {text-align: right; width: 200px}
+#oils-acq-picklist-paging-block { width: 25%; float: left; position: relative; }
+#oils-acq-picklist-actions-block { width: 75%; text-align: right; float: right; position: relative; }
+#oils-acq-picklist-header-subtable { width: 100%; }
+#oils-acq-picklist-header-block { width: 100%; display: block }
+
+/* list of pos */
+#oils-acq-po-list-table {width: 100%;}
+#oils-acq-po-list-table td {padding: 3px;}
+
+/* a single po */
+#oils-acq-po-table { width: 100%; }
+#oils-acq-po-header { padding: 4px; margin-bottom: 20px; }
+.oils-acq-po-records-jacket-td { width: 46px; }
+.oils-acq-po-records-jacket { width: 42px; height: 54px; padding-left: 0px; }
+.oils-acq-po-records-title-row {}
+.oils-acq-po-records-author-row td { padding-left: 30px; }
+.oils-acq-po-records-phys_desc-row td { padding-left: 30px; }
+.oils-acq-po-records-phys_desc-row {}
+
+#oils-acq-po-paging-block { width: 50%; text-align: left;}
+#oils-acq-po-actions-block { width: 50%; text-align: right;}
+#oils-acq-po-header-subtable { width: 100%; }
+
+#oils-acq-list-header { margin: 10px; width: 98%;}
+#oils-acq-list-header-label { float: left; }
+#oils-acq-list-header-actions { float: right; }
+
+/* purchase order line item detail page */
+#oils-acq-po-li-header { padding: 4px; margin-bottom: 20px; }
+#oils-acq-po-li-summary {}
+#oils-acq-po-li-summary td {padding: 2px;}
+.oils-acq-po-li-attr {}
+.oils-acq-po-li-attr-type {}
+.oils-acq-po-li-attr-name {}
+.oils-acq-po-li-attr-value {}
+#oils-acq-po-li-marc-block { margin-top: 10px; padding: 6px; }
+#oils-acq-po-li-details-table { width: 100%; }
+.oils-acq-po-li-detail-row {}
+
+/* picklist entry page */
+#oils-acq-lineitem-header { padding: 4px; margin-bottom: 20px; }
+#oils-acq-lineitem-summary {}
+#oils-acq-lineitem-summary td {padding: 2px;}
+.oils-acq-lineitem-attr {}
+.oils-acq-lineitem-attr-type {}
+.oils-acq-lineitem-attr-name {}
+.oils-acq-lineitem-attr-value {}
+#oils-acq-lineitem-marc-block { margin-top: 10px; padding: 6px; }
+
+
+
--- /dev/null
+#oils-admin-object-actions { width: 100%; padding: 2px; margin: 2px; text-align: right;}
+#oils-admin-object-table { width: 100%; }
+#oils-admin-object-table td { padding: 3px; }
--- /dev/null
+/* import the default css for the install applications */
+@import "default/acq.css";
+@import "default/admin.css";
+
+body { font-size: 80%; }
+
+#oils-base-body-block {}
+/*
+#oils-base-navigate-block {border: 2px solid #85C777; background: #6BA160;}
+#oils-base-navigate-block {border: 2px solid #f8f7f1; background: #fffdf1;}
+*/
+#oils-base-navigate-block {background: #d9e8f9;}
+
+#oils-base-navigate-block a { color: #000000; }
+#oils-base-content-block {}
+#oils-base-sidebar-block {}
+#oils-base-footer-block {padding: 3px; margin-top: 20px; border-top: 1px solid #5E5E5E;}
+/*
+#oils-base-header-block {border-bottom: 1px solid #5E5E5E; border: 2px solid #85C777; background: #6BA160;}
+*/
+#oils-base-header-block {border-bottom: 1px solid #d9e8f9;}
+
+
+#oils-base-navigate-list { width: 100%; }
+.oils-base-navigate-sub-list { margin-left: 14px; }
+/*.oils-base-navigate-item {border: 2px solid #85C777; background: #6BA160;}*/
+.oils-base-navigate-item:hover { background: #85C777; }
+
+/*
+#oils-base-navigate-table td:hover { background: #85C777; }
+.oils-base-sub-navigate-block { border: 2px solid #6BA160; background: #85C777;}
+.oils-base-sub-navigate-block a { color: #000000; }
+*/
+
+#oils-base-header-user-info { font-weight: bold; margin-right: 8px;}
+
+
+.label { font-weight: bold; }
+
+/*
+.oils-admin-table td { border-bottom: 1px solid #5E5E5E; }
+*/
+.oils-admin-table td { border-bottom: 1px solid #d9e8f9; }
+.oils-admin-label { font-weight: bold; }
+
+.oils-acq-nav-link {
+ padding:0px 3px 3px 3px;
+ border-top:1px solid #F8F7F1;
+ border-bottom:1px solid #F8F7F1;
+ font-size: 105%;
+}
+.oils-acq-nav-link a { text-decoration:none; }
+.oils-acq-nav-link-active {
+ background:#FFFDF3;
+ border-top:1px solid #ACA899;
+ border-bottom:1px solid #ACA899;
+}
+
--- /dev/null
+
+#oils-acq-index-div { font-weight:bold; }
+
+#oils-acq-search-container { width:100%; }
+#oils-acq-search-sources-div { width:20%; float:left; }
+#oils-acq-search-form-div { width:80%; float:right; }
+#oils-acq-search-z39-sources-table thead td { font-weight: bold; }
+#oils-acq-search-z39-sources-table tbody td { width: 33%; }
+#oils-acq-search-sources-label { font-weight: bold; border-bottom: 1px solid #6BA160;}
+#oils-acq-search-fields-label { font-weight: bold; border-bottom: 1px solid #6BA160;}
+#oils-acq-search-subsources-label { font-weight: bold; }
+#oils-acq-search-fields-submit-block { border: 2px solid #A1A1A1; }
+
+/* list of picklists */
+#oils-acq-picklist-list-table {width: 100%;}
+#oils-acq-picklist-list-table thead td {font-weight:bold;}
+
+/* picklist display */
+#oils-acq-picklist-table thead tr { border: 1px solid #A1A1A1; }
+#oils-acq-picklist-header {border: 1px solid #85C777;}
+#oils-acq-lineitem-header {border: 1px solid #85C777;}
+#oils-acq-picklist-name { font-weight: bold; font-style: italic; }
+.oils-acq-picklist-attributes { font-size: 90%; margin-left: 15px;}
+.oils-acq-lineitem-attributes { font-size: 90%; margin-left: 15px;}
+.oils-acq-picklist-records-phys_desc-row { border-bottom: 1px solid #6BA160; }
+.oils-acq-picklist-picklist-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; }
+.oils-acq-picklist-records-service-td { font-size: 85%; }
+.oils-acq-lineitem-delete-link { font-size: 85%; }
+#oils-acq-picklist-header-subtable tr { border: none; }
+
+/* po display */
+#oils-acq-po-table thead tr { border: 1px solid #A1A1A1; }
+#oils-acq-po-header {border: 1px solid #85C777;}
+#oils-acq-po-li-header {border: 1px solid #85C777;}
+#oils-acq-po-name { font-weight: bold; font-style: italic; }
+.oils-acq-po-attributes { font-size: 90%; margin-left: 15px;}
+.oils-acq-po-li-attributes { font-size: 90%; margin-left: 15px;}
+.oils-acq-po-records-phys_desc-row { border-bottom: 1px solid #6BA160; }
+.oils-acq-po-po-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; }
+.oils-acq-po-records-service-td { font-size: 85%; }
+.oils-acq-po-li-delete-link { font-size: 85%; }
+#oils-acq-po-header-subtable tr { border: none; }
+
+/*
+#oils-acq-list-header {border-bottom: 1px solid #6BA160;}
+*/
+#oils-acq-list-header {border-bottom: 2px solid #d9e8f9;}
+#oils-acq-list-header-label { font-weight: bold; font-size: 110%; }
+#oils-acq-list-header-actions { font-weight: bold; }
+
+
+/* entry display */
+#oils-acq-lineitem-marc-block { border: 1px solid #6BA160; }
--- /dev/null
+#oils-admin-object-table tr { border-bottom: 1px solid #6BA160; }
--- /dev/null
+dojo.require('dijit.Dialog');
+dojo.require('fieldmapper.dojoData');
+dojo.require('openils.User');
+dojo.require('dojo.cookie');
+dojo.require('openils.CGI');
+dojo.require('openils.Event');
+
+function oilsSetupUser() {
+ var authtoken = new openils.CGI().param('ses') || dojo.cookie('ses');
+ var user;
+ if(authtoken) user = new openils.User({authtoken:authtoken});
+ if(!authtoken || openils.Event.parse(user.user)) {
+ dojo.cookie('ses', openils.User.authtoken, {expires:-1, path:'/'});
+ openils.User.authtoken = null;
+ dojo.addOnLoad(function(){oilsLoginDialog.show();});
+ return;
+ }
+ dojo.cookie('ses', authtoken, {path : oilsCookieBase});
+ openils.User.authtoken = authtoken;
+}
+
+function oilsDoLogin() {
+ var user = new openils.User();
+ user.login({
+ username: dojo.byId('oils-login-username').value,
+ passwd: dojo.byId('oils-login-password').value,
+ type: 'staff' // hardcode for now
+ });
+ dojo.cookie('ses', user.authtoken, {path : oilsCookieBase});
+ return true;
+}
+
+oilsSetupUser();
+
--- /dev/null
+dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('dijit.layout.SplitContainer');
+dojo.require('dijit.Dialog');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+dojo.require('dojo.date.locale');
+dojo.require('dojo.date.stamp');
+
+
+dojo.require("openils.User");
+dojo.require("openils.acq.Fund");
+dojo.require("openils.acq.Lineitem");
+dojo.require('openils.acq.Provider');
+dojo.require("openils.widget.FundSelector");
+dojo.require('openils.editors');
+dojo.require('openils.Event');
+dojo.require("openils.widget.OrgUnitFilteringSelect");
+dojo.require("fieldmapper.OrgUtils");
+
+/* put all the accessors, etc. into a local object for namespacing */
+var JUBGrid = {
+ jubGrid : null,
+ lineitems : [], // full list of lineitem objects to display
+ getLi : function(id) {
+ // given an ID, returns the lineitem object from the list
+ for(var i in JUBGrid.lineitems) {
+ var li = JUBGrid.lineitems[i];
+ if(li.id() == id)
+ return li;
+ }
+ },
+
+ _getMARCAttr : function(rowIndex, attr) {
+ var data = JUBGrid.jubGrid.model.getRow(rowIndex);
+ if (!data) return '';
+ return new openils.acq.Lineitem(
+ {lineitem:JUBGrid.getLi(data.id)}).findAttr(attr, 'lineitem_marc_attr_definition')
+ },
+ getJUBTitle : function(rowIndex) {
+ return JUBGrid._getMARCAttr(rowIndex, 'title');
+ },
+ getJUBAuthor : function(rowIndex) {
+ return JUBGrid._getMARCAttr(rowIndex, 'author');
+ },
+ getJUBIsbn : function(rowIndex) {
+ return JUBGrid._getMARCAttr(rowIndex, 'isbn');
+ },
+ getJUBActualPrice : function(rowIndex) {
+ var data = JUBGrid.jubGrid.model.getRow(rowIndex);
+ if (!data) return '';
+ var price = new openils.acq.Lineitem(
+ {lineitem:JUBGrid.getLi(data.id)}).getActualPrice();
+ if(price) return price.price;
+ return ''
+ },
+ getJUBEstimatedPrice : function(rowIndex) {
+ var data = JUBGrid.jubGrid.model.getRow(rowIndex);
+ if (!data) return '';
+ var price = new openils.acq.Lineitem(
+ {lineitem:JUBGrid.getLi(data.id)}).getEstimatedPrice();
+ if(price) return price.price;
+ return ''
+ },
+ getJUBPubdate : function(rowIndex) {
+ return JUBGrid._getMARCAttr(rowIndex, 'pubdate');
+ },
+ getProvider : function(rowIndex) {
+ data = JUBGrid.jubGrid.model.getRow(rowIndex);
+ if(!data || !data.provider) return;
+ return openils.acq.Provider.retrieve(data.provider).code();
+ },
+ getRecvTime : function(rowIndex) {
+ var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+ if (!(data && data.recv_time)) return '';
+ var date = dojo.date.stamp.fromISOString(data.recv_time);
+ return dojo.date.locale.format(date, {formatLength:'medium'});
+ },
+ getCopyLocation : function(rowIndex) {
+ var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+ if(!data || !data.location) return '';
+ return openils.CopyLocation.retrieve(data.location).name();
+ },
+ getLIDFundName : function(rowIndex) {
+ var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+ if (!data || !data.fund) return;
+ try {
+ return openils.acq.Fund.retrieve(data.fund).name();
+ } catch (evt) {
+ return data.fund;
+ }
+ },
+ getLIDFundCode : function(rowIndex) {
+ var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+ if (!data || !data.fund) return;
+ try {
+ return openils.acq.Fund.retrieve(data.fund).code();
+ } catch (evt) {
+ return data.fund;
+ }
+ },
+ getLIDLibName : function(rowIndex) {
+ var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+ if (!data || !data.owning_lib) return;
+ return fieldmapper.aou.findOrgUnit(data.owning_lib).shortname();
+ },
+
+ gridDataChanged : function(newVal, rowIdx, cellIdx) {
+ // cellIdx == -1 if you are editing a column that
+ // is not represented in the data model. Khaaaaaaan!!!
+ },
+
+ populate : function(gridWidget, model, lineitems) {
+ for (var i in lineitems) {
+ JUBGrid.lineitems[lineitems[i].id()] = lineitems[i];
+ }
+ JUBGrid.jubGrid = gridWidget;
+ JUBGrid.jubGrid.setModel(model);
+ if(JUBGrid.showDetails) {
+ dojo.connect(gridWidget, "onRowClick",
+ function(evt) {
+ var jub = model.getRow(evt.rowIndex);
+ var grid;
+
+ JUBGrid.jubDetailGrid.lineitemID = jub.id;
+
+ //if (jub.state == "approved") {
+ if (false) { // need finer grained control here
+ grid = JUBGrid.jubDetailGridLayoutReadOnly;
+ } else {
+ grid = JUBGrid.jubDetailGridLayout;
+ }
+ openils.acq.Lineitem.loadLIDGrid(
+ JUBGrid.jubDetailGrid,
+ JUBGrid.jubGrid.model.getRow(evt.rowIndex).id, grid);
+ }
+ );
+ }
+ // capture changes to lineitems
+ dojo.connect(model.store, "onSet", JUBGrid.onJUBSet);
+ gridWidget.update();
+ },
+
+ approveJUB: function(evt) {
+ var list = [];
+ var selected = JUBGrid.jubGrid.selection.getSelected();
+ for (var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ JUBGrid.approveSingleJUB(JUBGrid.jubGrid.model.getRow(rowIdx));
+ }
+ },
+
+ approveSingleJUB: function(jub) {
+ var li = new openils.acq.Lineitem({lineitem:JUBGrid.getLi(jub.id)});
+ var approveStore = function(evt) {
+ if (evt) {
+ // something bad happened
+ console.log("jubgrid.js: approveJUB: error:");
+ console.dir(evt);
+ alert("Error: "+evt.desc);
+ } else {
+ var approveACQLI = function(jub, rq) {
+ JUBGrid.jubGrid.model.store.setValue(jub, "state", "approved");
+ JUBGrid.jubGrid.model.refresh();
+ JUBGrid.jubGrid.update();
+ // Reload lineitem details, read-only
+ //openils.acq.Lineitem.loadLIDGrid(JUBGrid.jubDetailGrid, li.id(), JUBGrid.jubDetailGridLayout);
+ //JUBGrid.jubDetailGridLayoutReadOnly);
+ };
+ JUBGrid.jubGrid.model.store.fetch({query:{id:jub.id}, onItem: approveACQLI});
+ }
+ };
+
+ li.approve(approveStore);
+ },
+
+
+ removeSelectedJUBs: function(evt) {
+
+ function deleteList(list, idx, oncomplete) {
+ if(idx >= list.length)
+ return oncomplete();
+ fieldmapper.standardRequest([
+ 'open-ils.acq',
+ 'open-ils.acq.lineitem.delete'],
+ { async: true,
+ params: [openils.User.authtoken, list[idx].id()],
+ oncomplete: function(r) {
+ var res = r.recv().content();
+ if(openils.Event.parse(res))
+ alert(openils.Event.parse(res));
+ deleteList(list, ++idx, oncomplete);
+ }
+ }
+ );
+ }
+
+ var lineitems = JUBGrid.lineitems;
+ var deleteMe = [];
+ var keepMe = [];
+ var selected = JUBGrid.jubGrid.selection.getSelected();
+
+ for(var id in lineitems) {
+ var deleted = false;
+ for(var i = 0; i < selected.length; i++) {
+ var rowIdx = selected[i];
+ var jubid = JUBGrid.jubGrid.model.getRow(rowIdx).id;
+ if(jubid == id) {
+ if (lineitems[id].state() == 'new') {
+ deleteMe.push(lineitems[id]);
+ deleted = true;
+ } else {
+ alert("Can not delete line item "+id+
+ ": item is "+lineitems[id].state());
+ }
+ }
+ }
+ if(!deleted)
+ keepMe[id] = lineitems[id];
+ }
+
+ JUBGrid.lineitems = keepMe;
+ deleteList(deleteMe, 0, function(){
+ JUBGrid.jubGrid.model.store =
+ new dojo.data.ItemFileReadStore({data:jub.toStoreData(keepMe)});
+ JUBGrid.jubGrid.model.refresh();
+ JUBGrid.jubGrid.update();
+ });
+ },
+
+ deleteLID: function(evt) {
+ var list =[];
+ var selected = JUBGrid.jubDetailGrid.selection.getSelected();
+ for (var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var lid = JUBGrid.jubDetailGrid.model.getRow(rowIdx);
+ var deleteFromStore = function (evt) {
+
+ if (evt) {
+ // something bad happened
+ alert("Error: "+evt.desc);
+ } else {
+ var deleteItem = function(item, rq) {
+ JUBGrid.jubDetailGrid.model.store.deleteItem(item);
+ };
+ var updateCount = function(item) {
+ var newval = JUBGrid.jubGrid.model.store.getValue(item, "item_count");
+ JUBGrid.jubGrid.model.store.setValue(item, "item_count", newval-1);
+ JUBGrid.jubGrid.update();
+ };
+
+ JUBGrid.jubDetailGrid.model.store.fetch({query:{id:lid.id},
+ onItem: deleteItem});
+ JUBGrid.jubGrid.model.store.fetch({query:{id:JUBGrid.jubDetailGrid.lineitemID},
+ onItem: updateCount});
+ }
+ JUBGrid.jubDetailGrid.update();
+ };
+
+ openils.acq.Lineitem.deleteLID(lid.id, deleteFromStore);
+ }
+ },
+
+ createLID: function(fields) {
+ fields['lineitem'] = JUBGrid.jubDetailGrid.lineitemID;
+ var addToStore = function (lid) {
+ JUBGrid.jubDetailGrid.model.store.newItem(acqlid.toStoreData([lid]).items[0]);
+ JUBGrid.jubDetailGrid.refresh();
+ JUBGrid.jubGrid.update();
+ JUBGrid.jubGrid.refresh();
+ }
+ openils.acq.Lineitem.createLID(fields, addToStore);
+ },
+
+ receiveLID: function(evt) {
+ var list =[];
+ var selected = JUBGrid.jubDetailGrid.selection.getSelected();
+ for (var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var lid = JUBGrid.jubDetailGrid.model.getRow(rowIdx);
+ list.push(lid.id);
+ }
+ if(lid != null) { // is at least one selected?
+ JUBGrid._receiveLIDList(list, 0,
+ function() {
+ delete openils.acq.Lineitem.ModelCache[lid.lineitem];
+ openils.acq.Lineitem.loadLIDGrid(
+ JUBGrid.jubDetailGrid, lid.lineitem, JUBGrid.jubDetailGridLayout);
+ }
+ );
+ }
+ },
+
+ // loop through the list of LIDs and mark them as received
+ _receiveLIDList: function(list, idx, callback) {
+ if(idx >= list.length)
+ return callback();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem_detail.receive'],
+ { asnync: true,
+ params: [openils.User.authtoken, list[idx++]],
+ oncomplete: function(r) {
+ var res = r.recv().content();
+ if(e = openils.Event.parse(res))
+ return alert(e);
+ JUBGrid._receiveLIDList(list, idx, callback);
+ }
+ }
+ );
+ },
+
+
+ // called when a lineitem is edited
+ onJUBSet: function (griditem, attr, oldVal,newVal) {
+ var item;
+
+ var updateDone = function(r) {
+ var stat = r.recv().content();
+ if(e = openils.Event.parse(stat))
+ console.dir(e);
+ };
+
+ // after an attribute has been updated
+ var attrUpdateDone = function(r, attr) {
+ var res = r.recv().content();
+ if(e = openils.Event.parse(res))
+ return alert(e);
+
+ var oldVal = new openils.acq.Lineitem(
+ {lineitem:item}).findAttr(attr, 'lineitem_local_attr_definition');
+
+ if(oldVal) {
+ // if this attr already exists on the object, just update the value
+ for(var i = 0; i < item.attributes().length; i++) {
+ var attrobj = item.attributes()[i];
+ if(attrobj.attr_type() == 'lineitem_local_attr_definition' && attrobj.attr_name() == attr) {
+ attrobj.attr_value(newVal);
+ }
+ }
+ } else {
+ // if this is a new attribute, create a new object to match reality
+ liad = new acqlia();
+ liad.attr_type('lineitem_local_attr_definition');
+ liad.attr_value(newVal);
+ liad.attr_name(attr);
+ liad.id(res);
+ item.attributes().push(liad);
+ }
+ }
+
+ if (oldVal == newVal) {
+ return;
+ }
+
+ item = JUBGrid.lineitems[griditem.id];
+ if (attr == "provider") {
+ if(newVal == '')
+ newVal = null;
+ item.provider(newVal);
+
+ } else if(attr == 'estimated_price' || attr == 'actual_price') {
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem_local_attr.set'],
+ { async: true,
+ params: [openils.User.authtoken, item.id(), attr, newVal],
+ oncomplete: function(r) {attrUpdateDone(r, attr); }
+ }
+ );
+ } else {
+ //alert("Unexpected attr in Picklist.onSet: '"+attr+"'");
+ return;
+ }
+
+ fieldmapper.standardRequest(
+ ["open-ils.acq", "open-ils.acq.lineitem.update"],
+ {params: [openils.User.authtoken, item],
+ oncomplete: updateDone
+ }
+ );
+ },
+};
+
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+dojo.require('openils.acq.CurrencyType');
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+dojo.require('fieldmapper.dojoData');
+
+var currencyTypes = [];
+
+function loadCTypesGrid() {
+ openils.acq.CurrencyType.fetchAll(
+ function(types) {
+ var store = new dojo.data.ItemFileReadStore(
+ {data:acqct.toStoreData(types, 'code', {identifier:'code'})});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{code:'*'}});
+ currencyTypeListGrid.setModel(model);
+ currencyTypeListGrid.update();
+ }
+ );
+}
+
+
+openils.Util.addOnLoad(loadCTypesGrid);
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require('openils.acq.FundingSource');
+dojo.require('openils.acq.CurrencyType');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+
+function getOrgInfo(rowIndex) {
+ data = fundingSourceListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function getBalanceInfo(rowIndex) {
+ data = fundingSourceListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return new String(openils.acq.FundingSource.cache[data.id].summary().balance);
+}
+
+function loadFSGrid() {
+ openils.acq.FundingSource.createStore(
+ function(storeData) {
+ var store = new dojo.data.ItemFileReadStore({data:storeData});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fundingSourceListGrid.setModel(model);
+ fundingSourceListGrid.update();
+ }
+ );
+}
+
+openils.Util.addOnLoad(loadFSGrid);
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+dojo.require('openils.acq.CurrencyType');
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+dojo.require('openils.acq.Fund');
+
+function getOrgInfo(rowIndex) {
+ data = fundListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.org).shortname();
+}
+
+function getBalanceInfo(rowIndex) {
+ data = fundListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return new String(openils.acq.Fund.cache[data.id].summary().combined_balance);
+}
+
+
+function loadFundGrid() {
+ openils.acq.Fund.createStore(
+ function(storeData) {
+ var store = new dojo.data.ItemFileReadStore({data:storeData});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fundListGrid.setModel(model);
+ fundListGrid.update();
+
+ var yearStore = {identifier:'year', name:'year', items:[]};
+
+ var added = [];
+ for(var i = 0; i < storeData.items.length; i++) {
+ var year = storeData.items[i].year;
+ if(added.indexOf(year) == -1) {
+ yearStore.items.push({year:year});
+ added.push(year);
+ }
+ }
+ yearStore.items = yearStore.items.sort().reverse();
+ fundFilterYearSelect.store = new dojo.data.ItemFileReadStore({data:yearStore});
+ var today = new Date().getFullYear().toString();
+ fundFilterYearSelect.setValue((added.indexOf(today != -1)) ? today : added[0]);
+ }
+ );
+}
+
+function filterGrid() {
+ var year = fundFilterYearSelect.getValue();
+ if(year)
+ fundListGrid.model.query = {year:year};
+ else
+ fundListGrid.model.query = {id:'*'};
+ fundListGrid.model.refresh();
+ fundListGrid.update();
+}
+
+openils.Util.addOnLoad(loadFundGrid);
+
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+
+dojo.require('openils.acq.CurrencyType');
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+dojo.require('openils.acq.Provider');
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+function getOrgInfo(rowIndex) {
+ data = providerListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function loadProviderGrid() {
+ openils.acq.Provider.createStore(
+ function(storeData) {
+ var store = new dojo.data.ItemFileReadStore({data:storeData});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ providerListGrid.setModel(model);
+ providerListGrid.update();
+ }
+ );
+}
+function createProvider(fields) {
+ openils.acq.Provider.create(fields, function(){loadProviderGrid()});
+}
+
+
+openils.Util.addOnLoad(loadProviderGrid);
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.layout.ContentPane');
+dojo.require('dojox.grid.Grid');
+
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('openils.acq.Fund');
+dojo.require('openils.acq.FundingSource');
+dojo.require('openils.Event');
+dojo.require('openils.User');
+dojo.require('openils.Util');
+
+var fund = null;
+
+function getSummaryInfo(rowIndex) {
+ return new String(fund.summary()[this.field]);
+}
+
+function createAllocation(fields) {
+ fields.fund = fundID;
+ if(isNaN(fields.percent)) fields.percent = null;
+ if(isNaN(fields.amount)) fields.amount = null;
+ //openils.acq.Fund.createAllocation(fields, resetPage);
+ openils.acq.Fund.createAllocation(fields,
+ function(r){location.href = location.href;});
+}
+
+function getOrgInfo(rowIndex) {
+ data = fundGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.org).shortname();
+}
+
+function getXferDest(rowIndex) {
+ data = this.grid.model.getRow(rowIndex);
+ if(!(data && data.xfer_destination)) return '';
+ return data.xfer_destination;
+}
+
+function loadFundGrid() {
+ var store = new dojo.data.ItemFileReadStore({data:acqf.toStoreData([fund])});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fundGrid.setModel(model);
+ fundGrid.update();
+}
+
+function loadAllocationGrid() {
+ if(fundAllocationGrid.isLoaded) return;
+ var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.allocations())});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fundAllocationGrid.setModel(model);
+ fundAllocationGrid.update();
+ fundAllocationGrid.isLoaded = true;
+}
+
+function loadDebitGrid() {
+ if(fundDebitGrid.isLoaded) return;
+ var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.debits())});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fundDebitGrid.setModel(model);
+ fundDebitGrid.update();
+ fundDebitGrid.isLoaded = true;
+}
+
+function fetchFund() {
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.fund.retrieve'],
+ { async: true,
+ params: [
+ openils.User.authtoken, fundID,
+ {flesh_summary:1, flesh_allocations:1, flesh_debits:1}
+ /* TODO grab allocations and debits only on as-needed basis */
+ ],
+ oncomplete: function(r) {
+ fund = r.recv().content();
+ loadFundGrid(fund);
+ }
+ }
+ );
+}
+
+openils.Util.addOnLoad(fetchFund);
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.layout.ContentPane');
+dojo.require("dijit.form.FilteringSelect");
+dojo.require("dijit.form.Textarea");
+dojo.require("dijit.form.CurrencyTextBox");
+dojo.require('dojox.grid.Grid');
+
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('openils.acq.FundingSource');
+dojo.require('openils.acq.Fund');
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+
+var ses = new OpenSRF.ClientSession('open-ils.acq');
+var fundingSource = null;
+
+function resetPage() {
+ fundingSource = null;
+ fsCreditGrid.isLoaded = false;
+ fsAllocationGrid.isLoaded = false;
+ loadFS();
+}
+
+/** creates a new funding_source_credit from the dialog ----- */
+function applyFSCredit(fields) {
+ fields.funding_source = fundingSourceID;
+ openils.acq.FundingSource.createCredit(fields, resetPage);
+}
+
+function applyFSAllocation(fields) {
+ fields.funding_source = fundingSourceID;
+ if(isNaN(fields.percent)) fields.percent = null;
+ if(isNaN(fields.amount)) fields.amount = null;
+ openils.acq.Fund.createAllocation(fields, resetPage);
+}
+
+/** fetch the fleshed funding source ----- */
+function loadFS() {
+ var req = ses.request(
+ 'open-ils.acq.funding_source.retrieve',
+ openils.User.authtoken, fundingSourceID,
+ {flesh_summary:1, flesh_credits:1,flesh_allocations:1}
+ );
+
+ req.oncomplete = function(r) {
+ var msg = req.recv();
+ fundingSource = msg.content();
+ var evt = openils.Event.parse(fundingSource);
+ if(evt) {
+ alert(evt);
+ return;
+ }
+ loadFSGrid();
+ }
+ req.send();
+}
+
+/** Some grid rendering accessor functions ----- */
+function getOrgInfo(rowIndex) {
+ data = fundingSourceGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function getSummaryInfo(rowIndex) {
+ return new String(fundingSource.summary()[this.field]);
+}
+
+/** builds the credits grid ----- */
+function loadFSGrid() {
+ if(!fundingSource) return;
+ var store = new dojo.data.ItemFileReadStore({data:acqfs.toStoreData([fundingSource])});
+ var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fundingSourceGrid.setModel(model);
+ fundingSourceGrid.update();
+}
+
+
+/** builds the credits grid ----- */
+function loadCreditGrid() {
+ if(fsCreditGrid.isLoaded) return;
+ var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fundingSource.credits())});
+ var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fsCreditGrid.setModel(model);
+ fsCreditGrid.update();
+ fsCreditGrid.isLoaded = true;
+}
+
+/** builds the allocations grid ----- */
+function loadAllocationGrid() {
+ if(fsAllocationGrid.isLoaded) return;
+ var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fundingSource.allocations())});
+ var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ fsAllocationGrid.setModel(model);
+ fsAllocationGrid.update();
+ fsAllocationGrid.isLoaded = true;
+}
+
+openils.Util.addOnLoad(loadFS);
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.layout.ContentPane');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dojox.grid.Grid');
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('openils.acq.Provider');
+dojo.require('openils.Event');
+dojo.require('openils.User');
+dojo.require('openils.Util');
+
+var provider = null;
+var marcRegex = /^\/\/\*\[@tag="(\d+)"]\/\*\[@code="(\w)"]$/;
+
+function getOrgInfo(rowIndex) {
+ data = providerGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function getTag(rowIdx) {
+ data = padGrid.model.getRow(rowIdx);
+ if(!data) return;
+ return data.xpath.replace(marcRegex, '$1');
+}
+
+function getSubfield(rowIdx) {
+ data = padGrid.model.getRow(rowIdx);
+ if(!data) return;
+ return data.xpath.replace(marcRegex, '$2');
+}
+
+
+function loadProviderGrid() {
+ var store = new dojo.data.ItemFileReadStore({data:acqpro.toStoreData([provider])});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ providerGrid.setModel(model);
+ providerGrid.update();
+}
+
+function loadPADGrid() {
+ openils.acq.Provider.retrieveLineitemProviderAttrDefs(providerId,
+ function(attrs) {
+ var store = new dojo.data.ItemFileReadStore({data:acqlipad.toStoreData(attrs)});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ padGrid.setModel(model);
+ padGrid.update();
+ }
+ );
+}
+
+
+function fetchProvider() {
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.provider.retrieve'],
+ { async: true,
+ params: [ openils.User.authtoken, providerId ],
+ oncomplete: function(r) {
+ provider = r.recv().content();
+ loadProviderGrid(provider);
+ }
+ }
+ );
+}
+
+function createOrderRecordField(fields) {
+ fields.provider = providerId;
+ if(!fields.xpath)
+ fields.xpath = '//*[@tag="'+fields.tag+'"]/*[@code="'+fields.subfield+'"]';
+ delete fields.tag;
+ delete fields.subfield;
+ openils.acq.Provider.createLineitemProviderAttrDef(fields,
+ function(id) {
+ loadPADGrid();
+ }
+ );
+}
+
+function setORDesc() {
+ var code = dijit.byId('oils-acq-provider-or-code');
+ var desc = dijit.byId('oils-acq-provider-or-desc');
+ desc.setValue(code.getDisplayedValue());
+}
+
+function deleteORDataFields() {
+ var list = []
+ var selected = padGrid.selection.getSelected();
+ for(var idx = 0; idx < selected.length; idx++)
+ list.push(padGrid.model.getRow(selected[idx]).id);
+ openils.acq.Provider.lineitemProviderAttrDefDeleteList(
+ list, function(){loadPADGrid();});
+}
+
+
+openils.Util.addOnLoad(fetchProvider);
+
+
--- /dev/null
+dojo.require('dojox.form.CheckedMultiSelect');
+dojo.require('fieldmapper.Fieldmapper');
+dojo.require('dijit.ProgressBar');
+dojo.require('dijit.form.Form');
+dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.NumberSpinner');
+dojo.require('openils.Event');
+dojo.require('openils.acq.Picklist');
+dojo.require('openils.acq.Lineitem');
+dojo.require('openils.User');
+dojo.require('openils.Util');
+
+var searchFields = [];
+var resultPicklist;
+var resultLIs;
+var selectedLIs;
+var recvCount = 0;
+var sourceCount = 0; // how many sources are we searching
+var user = new openils.User();
+var searchLimit = 10;
+
+function drawForm() {
+
+ var sources = fieldmapper.standardRequest(
+ ['open-ils.search', 'open-ils.search.z3950.retrieve_services'],
+ [user.authtoken]
+ );
+
+ openils.Event.parse_and_raise(sources);
+
+ for(var name in sources) {
+ source = sources[name];
+ bibSourceSelect.addOption(name, name+':'+source.host);
+ for(var attr in source.attrs)
+ if(!attr.match(/^#/)) // xml comment nodes
+ searchFields.push(source.attrs[attr]);
+ }
+
+ searchFields = searchFields.sort(
+ function(a,b) {
+ if(a.label < b.label)
+ return -1;
+ if(a.label > b.label)
+ return 1;
+ return 0;
+ }
+ );
+
+ var tbody = dojo.byId('oils-acq-search-fields-tbody');
+ var tmpl = tbody.removeChild(dojo.byId('oils-acq-search-fields-template'));
+
+ for(var f in searchFields) {
+ var field = searchFields[f];
+ if(dijit.byId('text_input_'+field.name)) continue;
+ var row = tmpl.cloneNode(true);
+ tbody.insertBefore(row, dojo.byId('oils-acq-seach-fields-count-row'));
+ var labelCell = dojo.query('[name=label]', row)[0];
+ var inputCell = dojo.query('[name=input]', row)[0];
+ labelCell.appendChild(document.createTextNode(field.label));
+ input = new dijit.form.TextBox({name:field.name, label:field.label, id:'text_input_'+field.name});
+ inputCell.appendChild(input.domNode);
+ }
+}
+
+function doSearch(values) {
+ dojo.style('searchProgress', 'visibility', 'visible');
+ searchProgress.update({progress: 0});
+
+ search = {
+ service : [],
+ username : [],
+ password : [],
+ search : {},
+ limit : values.limit,
+ offset : searchOffset
+ };
+ searchLimit = values.limit;
+ delete values.limit;
+
+ var selected = bibSourceSelect.getValue();
+ for(var i = 0; i < selected.length; i++) {
+ search.service.push(selected[i]);
+ search.username.push('');
+ search.password.push('');
+ sourceCount++;
+ }
+
+ for(var v in values) {
+ if(values[v]) {
+ var input = dijit.byId('text_input_'+v);
+ search.search[v] = values[v];
+ }
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.picklist.search.z3950'],
+ { async: true,
+ params: [user.authtoken, search],
+ onresponse: handleResult,
+ }
+ );
+}
+
+function handleResult(r) {
+ var result = r.recv().content();
+ if(openils.Event.parse(result)) {
+ alert(openils.Event.parse(result));
+ dojo.style('searchProgress', 'visibility', 'hidden');
+ return;
+ }
+ if(result.complete)
+ return viewResults(result.picklist_id);
+ searchProgress.update({maximum: result.total, progress: result.progress});
+}
+
+function viewResults(plId) {
+ var plist = new openils.acq.Picklist(plId,
+ function(model) {
+ resultLIs = plist._items;
+ dojo.style('oils-acq-pl-search-results', 'visibility', 'visible');
+ JUBGrid.populate(plResultGrid, model, plist._items);
+ },
+ {flesh_attrs:1, clear_marc:1, limit: searchLimit}
+ );
+ resultPicklist = plist._plist;
+}
+
+function loadPLSelect() {
+ var plList = [];
+ function handleResponse(r) {
+ plList.push(r.recv().content());
+ }
+ var method = 'open-ils.acq.picklist.user.retrieve';
+ fieldmapper.standardRequest(
+ ['open-ils.acq', method],
+ { async: true,
+ params: [openils.User.authtoken],
+ onresponse: handleResponse,
+ oncomplete: function() {
+ plAddExistingSelect.store =
+ new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(plList)});
+ plAddExistingSelect.setValue();
+ }
+ }
+ );
+}
+
+
+function saveResults(values) {
+ selectedLIs = resultLIs;
+
+ if(values.which == 'selected') {
+ selectedLIs = [];
+ var selected = plResultGrid.selection.getSelected();
+ for(var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var id = plResultGrid.model.getRow(rowIdx).id;
+ for(var i = 0; i < resultLIs.length; i++) {
+ var pl = resultLIs[i];
+ if(pl.id() == id) {
+ selectedLIs.push(pl);
+ }
+ }
+ }
+ }
+
+ if(values.new_name && values.new_name != '') {
+ // save selected lineitems to a new picklist
+ if(values.which = 'selected') {
+ openils.acq.Picklist.create(
+ {name: values.new_name},
+ function(id) {
+ updateLiList(id, selectedLIs, 0,
+ function(){location.href = 'view/' + id});
+ }
+ );
+ } else {
+ // save all == change the name of the results picklist
+ resultPicklist.name(values.new_name);
+ openils.acq.Picklist.update(resultPicklist,
+ function(stat) {
+ location.href = 'view/' + resultPicklist.id();
+ }
+ );
+ }
+ } else if(values.existing_pl) {
+ // update lineitems to use an existing picklist
+ updateLiList(values.existing_pl, selectedLIs, 0,
+ function(){location.href = 'view/' + values.existing_pl});
+ }
+}
+
+function updateLiList(pl, list, idx, oncomplete) {
+ if(idx >= list.length)
+ return oncomplete();
+ var li = selectedLIs[idx];
+ li.picklist(pl);
+ new openils.acq.Lineitem({lineitem:li}).update(
+ function(r) {
+ updateLiList(pl, list, ++idx, oncomplete);
+ }
+ );
+}
+
+openils.Util.addOnLoad(drawForm);
--- /dev/null
+dojo.require('dojox.grid.Grid');
+dojo.require('dijit.Dialog');
+dojo.require('dijit.form.Button');
+dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.Button');
+dojo.require('openils.acq.Picklist');
+dojo.require('openils.Util');
+
+var plList = [];
+var listAll = false;
+
+function makeGridFromList() {
+ var store = new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(plList)});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ plListGrid.setModel(model);
+ plListGrid.update();
+}
+
+
+function loadGrid() {
+ var method = 'open-ils.acq.picklist.user.retrieve.atomic';
+ if(listAll)
+ method = method.replace(/user/, 'user.all');
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', method],
+ { async: true,
+ params: [openils.User.authtoken,
+ {flesh_lineitem_count:1, flesh_username:1}],
+ oncomplete: function(r) {
+ var resp = r.recv().content();
+ if(e = openils.Event.parse(resp))
+ return alert(e);
+ plList = resp;
+ makeGridFromList();
+ }
+ }
+ );
+}
+
+function createPL(fields) {
+ if(fields.name == '') return;
+ openils.acq.Picklist.create(fields,
+ function(plId) {
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.picklist.retrieve'],
+ { async: true,
+ params: [openils.User.authtoken, plId,
+ {flesh_lineitem_count:1, flesh_username:1}],
+ oncomplete: function(r) {
+ var pl = r.recv().content();
+ plList.push(pl);
+ makeGridFromList();
+ }
+ }
+ );
+ }
+ );
+}
+
+function deleteFromGrid() {
+ var list = []
+ var selected = plListGrid.selection.getSelected();
+ for(var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var id = plListGrid.model.getRow(rowIdx).id;
+ for(var i = 0; i < plList.length; i++) {
+ var pl = plList[i];
+ if(pl.id() == id && pl.owner() == new openils.User().user.usrname()) {
+ list.push(id);
+ plList = (plList.slice(0, i) || []).concat(plList.slice(i+1, plList.length) || []);
+ }
+ }
+ }
+ openils.acq.Picklist.deleteList(list, function() { makeGridFromList(); });
+}
+
+openils.Util.addOnLoad(loadGrid);
+
+
--- /dev/null
+dojo.require('fieldmapper.Fieldmapper');
+dojo.require('dijit.ProgressBar');
+dojo.require('dijit.form.Form');
+dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.CheckBox');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.Button');
+dojo.require("dijit.Dialog");
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+dojo.require('openils.acq.Lineitem');
+dojo.require('openils.acq.Provider');
+dojo.require('openils.acq.PO');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var recvCount = 0;
+var createAssetsSelected = false;
+var createDebitsSelected = false;
+
+var lineitems = [];
+
+function drawForm() {
+ buildProviderSelect(providerSelector);
+}
+
+function buildProviderSelect(sel, oncomplete) {
+ openils.acq.Provider.createStore(
+ function(store) {
+ sel.store = new dojo.data.ItemFileReadStore({data:store});
+ if(oncomplete)
+ oncomplete();
+ },
+ 'MANAGE_PROVIDER'
+ );
+}
+
+var liReceived;
+function doSearch(values) {
+ var search = {};
+ for(var v in values) {
+ var val = values[v];
+ if(val != null && val != '')
+ search[v] = val;
+ }
+
+ if(values.state == 'approved')
+ dojo.style('oils-acq-li-search-po-create', 'visibility', 'visible');
+ else
+ dojo.style('oils-acq-li-search-po-create', 'visibility', 'hidden');
+
+ //search = [search, {limit:searchLimit, offset:searchOffset}];
+ search = [search, {}];
+ options = {clear_marc:1, flesh_attrs:1};
+
+ liReceived = 0;
+ lineitems = [];
+ dojo.style('searchProgress', 'visibility', 'visible');
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem.search'],
+ { async: true,
+ params: [openils.User.authtoken, search, options],
+ onresponse: handleResult,
+ oncomplete: viewList
+ }
+ );
+}
+
+function handleResult(r) {
+ var result = r.recv().content();
+ searchProgress.update({maximum: searchLimit, progress: ++liReceived});
+ lineitems.push(result);
+}
+
+function viewList() {
+ dojo.style('searchProgress', 'visibility', 'hidden');
+ dojo.style('oils-acq-li-search-result-grid', 'visibility', 'visible');
+ var store = new dojo.data.ItemFileWriteStore(
+ {data:jub.toStoreData(lineitems, null,
+ {virtualFields:['estimated_price', 'actual_price']})});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ JUBGrid.populate(liGrid, model, lineitems);
+}
+
+function createPOFromLineitems(fields) {
+ var po = new acqpo();
+ po.provider(newPOProviderSelector.getValue());
+ createAssetsSelected = fields.create_assets;
+ createDebitsSelected = fields.create_debits;
+
+ if(fields.which == 'selected') {
+ // find the selected lineitems
+ var selected = liGrid.selection.getSelected();
+ var selList = [];
+ for(var idx = 0; idx < selected.length; idx++) {
+ var rowIdx = selected[idx];
+ var id = liGrid.model.getRow(rowIdx).id;
+ for(var i = 0; i < lineitems.length; i++) {
+ var li = lineitems[i];
+ if(li.id() == id && !li.purchase_order() && li.state() == 'approved')
+ selList.push(lineitems[i]);
+ }
+ }
+ } else {
+ selList = lineitems;
+ }
+
+ if(selList.length == 0) return;
+
+ openils.acq.PO.create(po,
+ function(poId) {
+ if(e = openils.Event.parse(poId))
+ return alert(e);
+ updateLiList(poId, selList);
+ }
+ );
+}
+
+function updateLiList(poId, selList) {
+ _updateLiList(poId, selList, 0);
+}
+
+function checkCreateDebits(poId) {
+ if(!createDebitsSelected)
+ return viewPO(poId);
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.purchase_order.debits.create'],
+ { async: true,
+ params: [openils.User.authtoken, poId, {encumbrance:1}],
+ oncomplete : function(r) {
+ var total = r.recv().content();
+ if(e = openils.Event.parse(total))
+ return alert(e);
+ viewPO(poId);
+ }
+ }
+ );
+}
+
+function viewPO(poId) {
+ location.href = 'view/' + poId;
+}
+
+function _updateLiList(poId, selList, idx) {
+ if(idx >= selList.length) {
+ if(createAssetsSelected)
+ return createAssets(poId);
+ else
+ return checkCreateDebits(poId);
+ }
+ var li = selList[idx];
+ li.purchase_order(poId);
+ li.state('in-process');
+ new openils.acq.Lineitem({lineitem:li}).update(
+ function(stat) {
+ _updateLiList(poId, selList, ++idx);
+ }
+ );
+}
+
+function createAssets(poId) {
+ searchProgress.update({progress: 0});
+ dojo.style('searchProgress', 'visibility', 'visible');
+
+ function onresponse(r) {
+ var stat = r.recv().content();
+ if(e = openils.Event.parse(stat))
+ return alert(e);
+ searchProgress.update({maximum: stat.total, progress: stat.progress});
+ }
+
+ function oncomplete(r) {
+ dojo.style('searchProgress', 'visibility', 'hidden');
+ checkCreateDebits(poId);
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq','open-ils.acq.purchase_order.assets.create'],
+ { async: true,
+ params: [openils.User.authtoken, poId],
+ onresponse : onresponse,
+ oncomplete : oncomplete
+ }
+ );
+}
+
+
+openils.Util.addOnLoad(drawForm);
+
--- /dev/null
+dojo.require('dijit.form.Form');
+dojo.require('dijit.form.Button');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.NumberTextBox');
+dojo.require('dojox.grid.Grid');
+dojo.require('openils.acq.Provider');
+dojo.require('fieldmapper.OrgUtils');
+dojo.require('dojo.date.locale');
+dojo.require('dojo.date.stamp');
+dojo.require('openils.User');
+dojo.require('openils.Util');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+function getOrgInfo(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function getProvider(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return openils.acq.Provider.retrieve(data.provider).name();
+}
+
+function getPOOwner(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return new openils.User({id:data.owner}).user.usrname();
+}
+
+function getDateTimeField(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ var date = dojo.date.stamp.fromISOString(data[this.field]);
+ return dojo.date.locale.format(date, {formatLength:'medium'});
+}
+
+function doSearch(fields) {
+ var itemList = [];
+ if(!isNaN(fields.id))
+ fields = {id:fields.id};
+ else
+ delete fields.id;
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.purchase_order.search'],
+ {
+ async:1,
+ params: [openils.User.authtoken, fields],
+ onresponse : function(r) {
+ var msg = r.recv();
+ if(msg) itemList.push(msg.content());
+ },
+ oncomplete : function(r) {
+ dojo.style('po-grid', 'visibility', 'visible');
+ var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData(itemList)});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ poGrid.setModel(model);
+ poGrid.update();
+ },
+ }
+ );
+}
+
+function loadForm() {
+
+ /* load the providers */
+ openils.acq.Provider.createStore(
+ function(store) {
+ providerSelector.store =
+ new dojo.data.ItemFileReadStore({data:store});
+ },
+ 'MANAGE_PROVIDER'
+ );
+
+ new openils.User().buildPermOrgSelector('VIEW_PURCHASE_ORDER', poSearchOrderingAgencySelect);
+}
+
+openils.Util.addOnLoad(loadForm);
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.layout.ContentPane');
+dojo.require('dojox.grid.Grid');
+dojo.require('openils.acq.PO');
+dojo.require('openils.Event');
+dojo.require('openils.User');
+dojo.require('openils.Util');
+dojo.require('fieldmapper.OrgUtils');
+dojo.require('openils.acq.Provider');
+dojo.require('openils.acq.Lineitem');
+dojo.require('dojo.date.locale');
+dojo.require('dojo.date.stamp');
+
+var PO = null;
+var lineitems = [];
+
+function getOrgInfo(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function getProvider(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return openils.acq.Provider.retrieve(data.provider).code();
+}
+
+function getPOOwner(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return new openils.User({id:data.owner}).user.usrname();
+}
+
+function getDateTimeField(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ var date = dojo.date.stamp.fromISOString(data[this.field]);
+ return dojo.date.locale.format(date, {formatLength:'medium'});
+}
+
+function loadPOGrid() {
+ if(!PO) return;
+ var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData([PO])});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ poGrid.setModel(model);
+ poGrid.update();
+}
+
+function loadLIGrid() {
+ if(liGrid.isLoaded) return;
+
+ function load(po) {
+ lineitems = po.lineitems();
+ var store = new dojo.data.ItemFileReadStore({data:jub.toStoreData(lineitems)});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ JUBGrid.populate(liGrid, model, lineitems)
+ }
+
+ openils.acq.PO.retrieve(poId, load, {flesh_lineitems:1, clear_marc:1});
+ liGrid.isLoaded = true;
+}
+
+function loadPage() {
+ fetchPO();
+}
+
+function fetchPO() {
+ openils.acq.PO.retrieve(poId,
+ function(po) {
+ PO = po;
+ loadPOGrid();
+ },
+ {flesh_lineitem_count:1}
+ );
+}
+
+openils.Util.addOnLoad(loadPage);
--- /dev/null
+dojo.require('fieldmapper.Fieldmapper');
+dojo.require('dijit.ProgressBar');
+dojo.require('dijit.form.Form');
+dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.CheckBox');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.Button');
+dojo.require("dijit.Dialog");
+dojo.require('openils.Event');
+dojo.require('openils.Util');
+dojo.require('openils.acq.Lineitem');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var lineitems = [];
+
+function drawForm() {
+ new openils.User().buildPermOrgSelector('VIEW_PURCHASE_ORDER', orderingAgencySelect);
+}
+
+var liReceived;
+function doSearch(values) {
+
+ var search = {
+ attr_values : [values.identifier],
+ po_agencies : (values.ordering_agency) ? [values.ordering_agency] : null,
+ li_states : ['in-process']
+ };
+
+ options = {clear_marc:1, flesh_attrs:1};
+ liReceived = 0;
+ dojo.style('searchProgress', 'visibility', 'visible');
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem.search.ident'],
+ { async: true,
+ params: [openils.User.authtoken, search, options],
+ onresponse: handleResult,
+ oncomplete: viewList
+ }
+ );
+}
+
+var searchLimit = 10; // ?
+function handleResult(r) {
+ var result = r.recv().content();
+ searchProgress.update({maximum: searchLimit, progress: ++liReceived});
+ lineitems.push(result);
+}
+
+function viewList() {
+ dojo.style('searchProgress', 'visibility', 'hidden');
+ dojo.style('oils-acq-recv-grid', 'visibility', 'visible');
+ var store = new dojo.data.ItemFileWriteStore(
+ {data:jub.toStoreData(lineitems, null,
+ {virtualFields:['estimated_price', 'actual_price']})});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ JUBGrid.populate(liGrid, model, lineitems);
+}
+
+openils.Util.addOnLoad(drawForm);
+
--- /dev/null
+dojo.require("dijit.Dialog");
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.layout.ContentPane');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.TextBox');
+dojo.require('dojox.grid.Grid');
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('openils.Event');
+dojo.require('openils.User');
+dojo.require('openils.acq.LineitemAttr');
+
+var provider = null;
+var marcRegex = /^\/\/\*\[@tag="(\d+)"]\/\*\[@code="(\w)"]$/;
+var attrDefStores;
+
+
+function getOrgInfo(rowIndex) {
+ data = providerGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return fieldmapper.aou.findOrgUnit(data.owner).shortname();
+}
+
+function getTag(rowIdx) {
+ data = this.grid.model.getRow(rowIdx);
+ if(!data) return;
+ return data.xpath.replace(marcRegex, '$1');
+}
+
+function getSubfield(rowIdx) {
+ data = this.grid.model.getRow(rowIdx);
+ if(!data) return;
+ return data.xpath.replace(marcRegex, '$2');
+}
+
+
+function loadStores(onload) {
+ if(attrDefStores)
+ return onload();
+ openils.acq.LineitemAttr.createAttrDefStores(
+ function(stores) {
+ attrDefStores = stores;
+ onload();
+ }
+ )
+}
+
+
+function loadMarcAttrGrid() {
+ loadStores(
+ function() {
+ var store = new dojo.data.ItemFileReadStore({data:attrDefStores.marc});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ liMarcAttrGrid.setModel(model);
+ liMarcAttrGrid.update();
+ }
+ );
+}
+
+function loadGeneratedAttrGrid() {
+ loadStores(
+ function() {
+ var store = new dojo.data.ItemFileReadStore({data:attrDefStores.generated});
+ var model = new dojox.grid.data.DojoData(
+ null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ liGeneratedAttrGrid.setModel(model);
+ liGeneratedAttrGrid.update();
+ }
+ );
+}
+
+/*
+function createOrderRecordField(fields) {
+ fields.provider = providerId;
+ if(!fields.xpath)
+ fields.xpath = '//*[@tag="'+fields.tag+'"]/*[@code="'+fields.subfield+'"]';
+ delete fields.tag;
+ delete fields.subfield;
+ openils.acq.Provider.createLineitemProviderAttrDef(fields,
+ function(id) {
+ loadPADGrid();
+ }
+ );
+}
+
+function setORDesc() {
+ var code = dijit.byId('oils-acq-provider-or-code');
+ var desc = dijit.byId('oils-acq-provider-or-desc');
+ desc.setValue(code.getDisplayedValue());
+}
+
+function deleteORDataFields() {
+ var list = []
+ var selected = padGrid.selection.getSelected();
+ for(var idx = 0; idx < selected.length; idx++)
+ list.push(padGrid.model.getRow(selected[idx]).id);
+ openils.acq.Provider.lineitemProviderAttrDefDeleteList(
+ list, function(){loadPADGrid();});
+}
+*/
+
+
+//dojo.addOnLoad(loadLIAttrGrid);
+
+
+++ /dev/null
-recursive-include oilsweb/public *
-recursive-include oilsweb/templates *
+++ /dev/null
-
-# oilsweb - Pylons development environment configuration
-#
-# The %(here)s variable will be replaced with the parent directory of this file
-#
-[DEFAULT]
-debug = true
-# Uncomment and replace with the address which should receive any error reports
-#email_to = you@yourdomain.com
-smtp_server = localhost
-error_email_from = paste@localhost
-
-[server:main]
-use = egg:Paste#http
-#host = 0.0.0.0
-host = 216.154.195.227
-port = 5000
-
-[app:main]
-use = egg:oilsweb
-full_stack = true
-cache_dir = %(here)s/data
-beaker.session.key = oilsweb
-beaker.session.secret = somesecret
-# If you'd like to fine-tune the individual locations of the cache data dirs
-# for the Cache data, or the Session saves, un-comment the desired settings
-# here:
-#beaker.cache.data_dir = %(here)s/data/cache
-#beaker.session.data_dir = %(here)s/data/sessions
-beaker.session.type = ext:memcached
-beaker.session.url = 127.0.0.1:11211
-
-# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
-# Debug mode will enable the interactive debugging tool, allowing ANYONE to
-# execute malicious code after an exception is raised.
-#set debug = false
-
-# ----------------------------------------------------------------
-# OpenSRF / OpenILS / Custom configs
-# ----------------------------------------------------------------
-osrf_config = /openils/conf/opensrf_core.xml
-osrf_config_ctxt = config.opensrf
-oils_prefix = /oils
-
-# media_prefix can be a path or full URL
-oils_media_prefix = /oils/media
-
-# added_content_prefix can be a path or full URL
-oils_added_content_prefix = http://dev.gapines.org/opac/extras/ac
-
-# URL relative to the app root where XSL files are found
-oils_xsl_prefix = oilsweb/public/oils/media/xsl
-oils_xsl_acq_bib = acq-bibdata-marc.xslt
-oils_xsl_marc2html = oilsMARC21slim2HTML.xsl
-
-# how long do we cache search results for
-oils_bib_cache_time = 3200
-
-# path to extra templates or overridden templates
-local_templates = /openils/var/web/oilsweb/oilsweb/local_templates
-
-# if uncommented, they system will login automatically using
-# these credentials. Note that this user will either need to
-# be an superuser or have appropriate ACQ perms
-#oils_demo_user = demo-admin
-#oils_demo_password = demo123
-#oils_demo_workstation = BR1-demo
-
-
-# when using the opensrf translator proxy, define the
-# translator host and path here
-#osrf_http_translator_host = localhost:80
-#osrf_http_translator_path = /osrf-http-translator
-
-
-
-# Logging configuration
-[loggers]
-keys = root, oilsweb
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-[logger_root]
-level = INFO
-handlers = console
-
-[logger_oilsweb]
-level = DEBUG
-handlers =
-qualname = oilsweb
-
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
-
-[formatter_generic]
-format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
-datefmt = %H:%M:%S
+++ /dev/null
-oilsweb
-+++++++
-
-This is the main index page of your documentation. It should be written in
-`reStructuredText format <http://docutils.sourceforge.net/rst.html>`_.
-
-You can generate your documentation in HTML format by running this command::
-
- setup.py pudge
-
-For this to work you will need to download and install ``buildutils`` and
-``pudge``.
+++ /dev/null
-Metadata-Version: 1.0
-Name: oilsweb
-Version: 0.0.0dev-r9917
-Summary: UNKNOWN
-Home-page: UNKNOWN
-Author: UNKNOWN
-Author-email: UNKNOWN
-License: UNKNOWN
-Description: UNKNOWN
-Platform: UNKNOWN
+++ /dev/null
-MANIFEST.in
-development.ini
-setup.cfg
-setup.py
-docs/index.txt
-oilsweb/__init__.py
-oilsweb/websetup.py
-oilsweb.egg-info/PKG-INFO
-oilsweb.egg-info/SOURCES.txt
-oilsweb.egg-info/dependency_links.txt
-oilsweb.egg-info/entry_points.txt
-oilsweb.egg-info/paste_deploy_config.ini_tmpl
-oilsweb.egg-info/paster_plugins.txt
-oilsweb.egg-info/requires.txt
-oilsweb.egg-info/top_level.txt
-oilsweb/config/__init__.py
-oilsweb/config/environment.py
-oilsweb/config/middleware.py
-oilsweb/config/routing.py
-oilsweb/controllers/__init__.py
-oilsweb/controllers/acq_admin.py
-oilsweb/controllers/admin.py
-oilsweb/controllers/base.py
-oilsweb/controllers/error.py
-oilsweb/controllers/template.py
-oilsweb/controllers/translator.py
-oilsweb/controllers/acq/__init__.py
-oilsweb/controllers/acq/base.py
-oilsweb/controllers/acq/currency_type.py
-oilsweb/controllers/acq/fund.py
-oilsweb/controllers/acq/funding_source.py
-oilsweb/controllers/acq/picklist.py
-oilsweb/controllers/acq/po.py
-oilsweb/controllers/acq/provider.py
-oilsweb/lib/__init__.py
-oilsweb/lib/app_globals.py
-oilsweb/lib/base.py
-oilsweb/lib/bib.py
-oilsweb/lib/context.py
-oilsweb/lib/helpers.py
-oilsweb/lib/request.py
-oilsweb/lib/user.py
-oilsweb/lib/util.py
-oilsweb/lib/acq/__init__.py
-oilsweb/lib/acq/fund.py
-oilsweb/lib/acq/picklist.py
-oilsweb/lib/acq/po_manager.py
-oilsweb/lib/acq/provider_mgr.py
-oilsweb/middleware/__init__.py
-oilsweb/middleware/hilite.py
-oilsweb/middleware/xmllint.py
-oilsweb/model/__init__.py
-oilsweb/public/test.html
-oilsweb/public/oils/media/css/skin/default.css
-oilsweb/public/oils/media/css/skin/default/acq.css
-oilsweb/public/oils/media/css/skin/default/admin.css
-oilsweb/public/oils/media/css/theme/default.css
-oilsweb/public/oils/media/css/theme/default/acq.css
-oilsweb/public/oils/media/css/theme/default/admin.css
-oilsweb/public/oils/media/images/eg_logo.jpg
-oilsweb/public/oils/media/images/eg_tiny_logo.jpg
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_currency_types.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funding_sources.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_funds.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_providers.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_fund.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_funding_source.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/view_list.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js
-oilsweb/public/oils/media/ui_js/oils/default/acq/po/view_po.js
-oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
-oilsweb/public/oils/media/xsl/acq-bibdata-marc.xslt
-oilsweb/public/oils/media/xsl/oilsMARC21slim2HTML.xsl
-oilsweb/templates/oils/base.html
-oilsweb/templates/oils/default/base.html
-oilsweb/templates/oils/default/dashboard.html
-oilsweb/templates/oils/default/footer.html
-oilsweb/templates/oils/default/header.html
-oilsweb/templates/oils/default/menu.html
-oilsweb/templates/oils/default/navigate.html
-oilsweb/templates/oils/default/acq/admin.html
-oilsweb/templates/oils/default/acq/base.html
-oilsweb/templates/oils/default/acq/index.html
-oilsweb/templates/oils/default/acq/financial/base.html
-oilsweb/templates/oils/default/acq/financial/create_fund.html
-oilsweb/templates/oils/default/acq/financial/create_fund_allocation.html
-oilsweb/templates/oils/default/acq/financial/create_funding_source.html
-oilsweb/templates/oils/default/acq/financial/create_funding_source_credit.html
-oilsweb/templates/oils/default/acq/financial/create_provider.html
-oilsweb/templates/oils/default/acq/financial/list_currency_types.html
-oilsweb/templates/oils/default/acq/financial/list_funding_sources.html
-oilsweb/templates/oils/default/acq/financial/list_funds.html
-oilsweb/templates/oils/default/acq/financial/list_providers.html
-oilsweb/templates/oils/default/acq/financial/view_fund.html
-oilsweb/templates/oils/default/acq/financial/view_funding_source.html
-oilsweb/templates/oils/default/acq/financial/view_provider.html
-oilsweb/templates/oils/default/acq/picklist/base.html
-oilsweb/templates/oils/default/acq/picklist/bib_search.html
-oilsweb/templates/oils/default/acq/picklist/lineitem_summary.html
-oilsweb/templates/oils/default/acq/picklist/picklist_summary.html
-oilsweb/templates/oils/default/acq/picklist/view.html
-oilsweb/templates/oils/default/acq/picklist/view_lineitem.html
-oilsweb/templates/oils/default/acq/picklist/view_list.html
-oilsweb/templates/oils/default/acq/po/.view_po.html.swp
-oilsweb/templates/oils/default/acq/po/base.html
-oilsweb/templates/oils/default/acq/po/create.html
-oilsweb/templates/oils/default/acq/po/li_search.html
-oilsweb/templates/oils/default/acq/po/marc_upload.html
-oilsweb/templates/oils/default/acq/po/po_li_summary.html
-oilsweb/templates/oils/default/acq/po/po_summary.html
-oilsweb/templates/oils/default/acq/po/search.html
-oilsweb/templates/oils/default/acq/po/view_lineitem.html
-oilsweb/templates/oils/default/acq/po/view_po.html
-oilsweb/templates/oils/default/acq/po/view_po_list.html
-oilsweb/templates/oils/default/admin/base.html
-oilsweb/templates/oils/default/admin/index.html
-oilsweb/templates/oils/default/admin/object.html
-oilsweb/templates/oils/default/admin/widgets.html
-oilsweb/templates/oils/default/common/jubgrid.html
-oilsweb/templates/oils/default/common/widgets.html
-oilsweb/tests/__init__.py
-oilsweb/tests/test_models.py
-oilsweb/tests/functional/__init__.py
-oilsweb/tests/functional/test_acq.py
-oilsweb/tests/functional/test_admin.py
-oilsweb/tests/functional/test_base.py
\ No newline at end of file
+++ /dev/null
-
- [paste.app_factory]
- main = oilsweb.config.middleware:make_app
-
- [paste.app_install]
- main = pylons.util:PylonsInstaller
-
\ No newline at end of file
+++ /dev/null
-#
-# oilsweb - Pylons configuration
-#
-# The %(here)s variable will be replaced with the parent directory of this file
-#
-[DEFAULT]
-debug = true
-email_to = you@yourdomain.com
-smtp_server = localhost
-error_email_from = paste@localhost
-
-[server:main]
-use = egg:Paste#http
-host = 0.0.0.0
-port = 5000
-
-[app:main]
-use = egg:oilsweb
-full_stack = true
-cache_dir = %(here)s/data
-beaker.session.key = oilsweb
-beaker.session.secret = ${app_instance_secret}
-app_instance_uuid = ${app_instance_uuid}
-
-# If you'd like to fine-tune the individual locations of the cache data dirs
-# for the Cache data, or the Session saves, un-comment the desired settings
-# here:
-#beaker.cache.data_dir = %(here)s/data/cache
-#beaker.session.data_dir = %(here)s/data/sessions
-
-# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
-# Debug mode will enable the interactive debugging tool, allowing ANYONE to
-# execute malicious code after an exception is raised.
-set debug = false
-
-
-# Logging configuration
-[loggers]
-keys = root
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-[logger_root]
-level = INFO
-handlers = console
-
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
-
-[formatter_generic]
-format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s
+++ /dev/null
-Pylons
-WebHelpers
-PasteScript
+++ /dev/null
-Pylons>=0.9.6.1
\ No newline at end of file
+++ /dev/null
-"""Pylons environment configuration"""
-import os
-
-from pylons import config
-
-import oilsweb.lib.app_globals as app_globals
-import oilsweb.lib.helpers
-from oilsweb.config.routing import make_map
-
-def load_environment(global_conf, app_conf):
- """Configure the Pylons environment via the ``pylons.config``
- object
- """
- # Pylons paths
- root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- paths = dict(root=root,
- controllers=os.path.join(root, 'controllers'),
- static_files=os.path.join(root, 'public'),
- templates=[app_conf.get('local_templates', ''), os.path.join(root, 'templates')])
-
- # Initialize config with the basic options
- config.init_app(global_conf, app_conf, package='oilsweb',
- template_engine='mako', paths=paths)
-
- config['routes.map'] = make_map()
- config['pylons.g'] = app_globals.Globals()
- config['pylons.h'] = oilsweb.lib.helpers
-
- # Customize templating options via this variable
- tmpl_options = config['buffet.template_options']
-
- # CONFIGURATION OPTIONS HERE (note: all config options will override
- # any Pylons config options)
+++ /dev/null
-"""Pylons middleware initialization"""
-from paste.cascade import Cascade
-from paste.registry import RegistryManager
-from paste.urlparser import StaticURLParser
-from paste.deploy.converters import asbool
-
-from pylons import config
-from pylons.error import error_template
-from pylons.middleware import error_mapper, ErrorDocuments, ErrorHandler, \
- StaticJavascripts
-from pylons.wsgiapp import PylonsApp
-
-from oilsweb.config.environment import load_environment
-
-def make_app(global_conf, full_stack=True, **app_conf):
- """Create a Pylons WSGI application and return it
-
- ``global_conf``
- The inherited configuration for this application. Normally from
- the [DEFAULT] section of the Paste ini file.
-
- ``full_stack``
- Whether or not this application provides a full WSGI stack (by
- default, meaning it handles its own exceptions and errors).
- Disable full_stack when this application is "managed" by
- another WSGI middleware.
-
- ``app_conf``
- The application's local configuration. Normally specified in the
- [app:<name>] section of the Paste ini file (where <name>
- defaults to main).
- """
- # Configure the Pylons environment
- load_environment(global_conf, app_conf)
-
- # The Pylons WSGI app
- app = PylonsApp()
-
- # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
-
- if asbool(full_stack):
- # Handle Python exceptions
- app = ErrorHandler(app, global_conf, error_template=error_template,
- **config['pylons.errorware'])
-
- # Display error documents for 401, 403, 404 status codes (and
- # 500 when debug is disabled)
- app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf)
-
- # Establish the Registry for this application
- app = RegistryManager(app)
-
- # Static files
- javascripts_app = StaticJavascripts()
- static_app = StaticURLParser(config['pylons.paths']['static_files'])
- app = Cascade([static_app, javascripts_app, app])
-
-# import oilsweb.middleware.xmllint
-# app = oilsweb.middleware.xmllint.XMLLintMiddleware(app)
-
- return app
-
+++ /dev/null
-"""Routes configuration
-
-The more specific and detailed routes should be defined first so they
-may take precedent over the more generic routes. For more information
-refer to the routes manual at http://routes.groovie.org/docs/
-"""
-from pylons import config
-from routes import Mapper
-
-def make_map():
- """Create, configure and return the routes Mapper"""
- map = Mapper(directory=config['pylons.paths']['controllers'],
- always_scan=config['debug'])
-
- # The ErrorController route (handles 404/500 error pages); it should
- # likely stay at the top, ensuring it can always be resolved
- map.connect('error/:action/:id', controller='error')
-
- # CUSTOM ROUTES HERE
-
- prefix = ''
- if not config.get('use_mod_python'):
- prefix = 'oils/'
-
- map.connect(prefix+':controller/:action')
- map.connect(prefix+':controller/:action/:id')
- map.connect(prefix+'admin/:action/:type/:id', controller='admin')
- map.connect(prefix+'admin/:action/:type', controller='admin')
-
- map.connect('osrf-http-translator', controller='translator', action='proxy')
-
- ''' trying a different set of admin routes above...
- map.connect('acq_admin', 'oils/admin', controller='acq_admin')
- map.connect('acq_admin_object', 'oils/admin/:object', controller='acq_admin')
- map.connect('acq_admin_direct', 'oils/admin/direct/:object/:id', controller='acq_admin')
- '''
- map.connect('*url', controller='template', action='view')
-
- return map
+++ /dev/null
-from oilsweb.lib.context import Context, SubContext, ContextItem
-
-# ----------------------------------------------------------------
-# Define the CGI params for this application
-# ----------------------------------------------------------------
-
-class AcqContext(SubContext):
- def __init__(self):
-
- # -------------------------------------------------------------
- # URL params
- self.query = ContextItem(cgi_name='acq.q')
- self.search_class = ContextItem(cgi_name='acq.sc', multi=True)
- self.search_source = ContextItem(cgi_name='acq.ss', multi=True)
- self.picked_records = ContextItem(cgi_name='acq.sr', multi=True)
- self.offset = ContextItem(cgi_name='acq.os', default_value=0)
- self.limit = ContextItem(cgi_name='acq.li', default_value=10)
-
- # -------------------------------------------------------------
- # shared objects and data
- self.prefix = ContextItem()
- self.z39_sources = ContextItem()
- self.search_classes = ContextItem()
- self.search_classes_sorted = ContextItem()
-
- self.picklist = ContextItem() # picklist object
- self.picklist_list = ContextItem() # list of picklist objects
- self.picklist_id_list = ContextItem(cgi_name='acq.plil', multi=True) # list of picklist IDs
- self.picklist_name = ContextItem(cgi_name='acq.pln')
- self.picklist_action = ContextItem(cgi_name='acq.pla')
- self.picklist_source_id = ContextItem(cgi_name='acq.plsi')
- self.picklist_dest_id = ContextItem(cgi_name='acq.pldi')
-
- self.lineitem = ContextItem() # lineitem object
- self.lineitem_id = ContextItem(cgi_name='acq.liid')
- self.lineitem_item_count = ContextItem(cgi_name='acq.pllic')
- self.lineitem_id_list = ContextItem(cgi_name='acq.pleil', multi=True)
- self.lineitem_detail_id = ContextItem(cgi_name='acq.lidid')
-
- self.currency_types = ContextItem()
-
- self.fund = ContextItem()
- self.fund_id = ContextItem(cgi_name='acq.fi')
- self.fund_list = ContextItem(cgi_name='acq.fl')
- self.fund_name = ContextItem(cgi_name='acq.fn')
- self.fund_year = ContextItem(cgi_name='acq.fc')
- self.fund_org = ContextItem(cgi_name='acq.fo')
- self.fund_currency_type = ContextItem(cgi_name='acq.fc')
- self.fund_summary = ContextItem()
-
- self.funding_source = ContextItem()
- self.funding_source_id = ContextItem(cgi_name='acq.fsi')
- self.funding_source_list = ContextItem()
- self.funding_source_name = ContextItem(cgi_name='acq.fsn')
- self.funding_source_currency_type = ContextItem(cgi_name='acq.fsc')
- self.funding_source_owner = ContextItem(cgi_name='acq.fso')
- self.funding_source_credit_amount = ContextItem(cgi_name='acq.fsca')
- self.funding_source_credit_note = ContextItem(cgi_name='acq.fscn')
-
- self.fund_allocation = ContextItem()
- self.fund_allocation_list = ContextItem()
- self.fund_allocation_source= ContextItem(cgi_name='acq.fas')
- self.fund_allocation_fund = ContextItem(cgi_name='acq.faf')
- self.fund_allocation_amount = ContextItem(cgi_name='acq.faa')
- self.fund_allocation_percent = ContextItem(cgi_name='acq.fap')
- self.fund_allocation_note = ContextItem(cgi_name='acq.fan')
-
- self.provider = ContextItem()
- self.provider_id = ContextItem(cgi_name='acq.proid')
- self.provider_list = ContextItem()
- self.provider_name = ContextItem(cgi_name='acq.pn')
- self.provider_currency_type = ContextItem(cgi_name='acq.pct')
- self.provider_owner = ContextItem(cgi_name='acq.po')
-
- self.po = ContextItem()
- self.po_list = ContextItem()
- self.po_id = ContextItem(cgi_name='acq.poid')
- self.po_li_id_list = ContextItem(cgi_name='acq.poliil', multi=True)
- self.po_li = ContextItem()
- self.po_li_sum = ContextItem()
-
- self.lineitem_marc_html = ContextItem()
-
- def postinit(self):
- self.prefix.value = "%s/acq" % Context.get_context().core.prefix.value
-
-Context.apply_sub_context('acq', AcqContext)
-
+++ /dev/null
-from oilsweb.lib.base import *
-from oilsweb.lib.request import RequestMgr
-
-class BaseController(BaseController):
- def index(self):
- return RequestMgr().render('acq/index.html')
+++ /dev/null
-from oilsweb.lib.base import *
-from oilsweb.lib.request import RequestMgr
-
-class CurrencyTypeController(BaseController):
- def list(self, **kwargs):
- r = RequestMgr()
- return r.render('acq/financial/list_currency_types.html')
-
+++ /dev/null
-from oilsweb.lib.base import *
-import pylons
-from oilsweb.lib.request import RequestMgr
-import oilsweb.lib.user
-import osrf.net_obj
-import oils.const
-from osrf.ses import ClientSession
-from oils.event import Event
-from oils.org import OrgUtil
-
-
-class FundController(BaseController):
-
- def view(self, **kwargs):
- r = RequestMgr()
- r.ctx.acq.fund_id = kwargs['id']
- return r.render('acq/financial/view_fund.html')
-
- def list(self):
- return RequestMgr().render('acq/financial/list_funds.html')
-
-
+++ /dev/null
-from oilsweb.lib.base import *
-import pylons
-from oilsweb.lib.request import RequestMgr
-import osrf.net_obj
-import oils.const
-from osrf.ses import ClientSession
-from oils.event import Event
-from oils.org import OrgUtil
-
-class FundingSourceController(BaseController):
-
- def view(self, **kwargs):
- r = RequestMgr()
- r.ctx.acq.funding_source_id = kwargs['id']
- return r.render('acq/financial/view_funding_source.html')
-
- def list(self):
- return RequestMgr().render('acq/financial/list_funding_sources.html')
-
-
+++ /dev/null
-from oilsweb.lib.base import *
-import logging, pylons
-import oilsweb.lib.context, oilsweb.lib.util
-import oilsweb.lib.bib
-import oils.const, oils.utils.utils
-import osrf.net_obj
-
-import simplejson
-
-from osrf.ses import ClientSession
-from oils.event import Event
-from oils.org import OrgUtil
-from oilsweb.lib.request import RequestMgr
-
-class PicklistController(BaseController):
-
- def view(self, **kwargs):
- r = RequestMgr()
- r.ctx.acq.picklist.value = kwargs['id']
- return r.render('acq/picklist/view.html')
-
- def list(self):
- r = RequestMgr()
- return r.render('acq/picklist/view_list.html')
-
- def listall(self):
- r = RequestMgr()
- return r.render('acq/picklist/view_list.html')
-
- def bib_search(self):
- r = RequestMgr()
- return r.render('acq/picklist/bib_search.html')
-
-
+++ /dev/null
-from oilsweb.lib.base import *
-from oilsweb.lib.request import RequestMgr
-import oilsweb.lib.user
-import osrf.net_obj
-import oils.const
-from osrf.ses import ClientSession
-from oils.event import Event
-from oils.org import OrgUtil
-import mx.DateTime.ISO
-
-class PoController(BaseController):
-
- # Render display of individual PO: list of line items
- def view(self, **kwargs):
- r = RequestMgr()
- r.ctx.acq.po_id.value = kwargs['id']
- return r.render('acq/po/view_po.html')
-
- def li_search(self):
- r = RequestMgr()
- return r.render('acq/po/li_search.html')
-
- def search(self):
- r = RequestMgr()
- return r.render('acq/po/search.html')
-
- def marc_upload(self):
- '''
- Requires pymarc-1.5, elementree
- $ easy_install elementtree
- $ easy_install http://pypi.python.org/packages/source/p/pymarc/pymarc-1.5.tar.gz
-
- Takes a MARC file, converts it to marcxml, and creates a new PO
- and lineitems from the data.
- '''
-
- import pymarc
- import pymarc.reader
- import pymarc.marcxml
- import pylons
- import oils.system
-
- r = RequestMgr()
-
- oils.system.System.remote_connect(
- config_file = pylons.config['osrf_config'],
- config_context = pylons.config['osrf_config_ctxt'])
-
- if 'marc_file' in r.request.params:
-
- provider_id = r.request.params['provider']
- authtoken = r.request.params['authtoken']
-
- # first, create the PO
- po = osrf.net_obj.NetworkObject.acqpo()
- po.provider(provider_id)
- po.state('in-process')
- po_id = ClientSession.atomic_request(
- 'open-ils.acq',
- 'open-ils.acq.purchase_order.create', authtoken, po)
- oils.event.Event.parse_and_raise(po_id)
-
- provider = ClientSession.atomic_request(
- 'open-ils.acq',
- 'open-ils.acq.provider.retrieve', authtoken, provider_id)
- oils.event.Event.parse_and_raise(provider)
-
- # now, parse the MARC and create a lineitem per record
- marc_reader = pymarc.reader.MARCReader(r.request.params['marc_file'].file)
- for record in marc_reader:
-
- lineitem = osrf.net_obj.NetworkObject.jub()
- lineitem.marc(pymarc.marcxml.record_to_xml(record))
- lineitem.provider(provider_id)
- lineitem.purchase_order(po_id)
- lineitem.source_label(provider.code()) # XXX where should this really come from?
- lineitem.state('in-process')
-
- stat = ClientSession.atomic_request(
- 'open-ils.acq',
- 'open-ils.acq.lineitem.create', authtoken, lineitem)
- oils.event.Event.parse_and_raise(stat)
- return redirect_to(controller='acq/po', action='view', id=po_id)
-
- return r.render('acq/po/marc_upload.html')
+++ /dev/null
-from oilsweb.lib.base import *
-from oilsweb.lib.request import RequestMgr
-from osrf.ses import ClientSession
-from osrf.net_obj import NetworkObject
-from oils.event import Event
-from oils.org import OrgUtil
-from oilsweb.lib.user import User
-import oils.const
-
-class ProviderController(BaseController):
-
- def view(self, **kwargs):
- r = RequestMgr()
- r.ctx.acq.provider_id = kwargs['id']
- return r.render('acq/financial/view_provider.html')
-
- def list(self):
- return RequestMgr().render('acq/financial/list_providers.html')
-
-
+++ /dev/null
-from oilsweb.lib.base import *
-import logging, pylons
-import oilsweb.lib.context, oilsweb.lib.util
-import oilsweb.lib.bib
-import oils.const, oils.utils.utils
-import osrf.net_obj
-
-import simplejson
-
-from osrf.ses import ClientSession
-from oils.event import Event
-from oils.org import OrgUtil
-from oilsweb.lib.request import RequestMgr
-
-class ReceivingController(BaseController):
-
- def process(self, **kwargs):
- r = RequestMgr()
- return r.render('acq/receiving/process.html')
+++ /dev/null
-from oilsweb.lib.base import *
-from oilsweb.lib.request import RequestMgr
-import oilsweb.lib.user
-import osrf.net_obj
-import oils.const
-from osrf.ses import ClientSession
-from oils.event import Event
-from oils.org import OrgUtil
-
-class SettingsController(BaseController):
- def li_attr(self, **kwargs):
- return RequestMgr().render('acq/settings/li_attr.html')
+++ /dev/null
-import logging
-
-from oilsweb.lib.request import RequestMgr
-from oilsweb.lib.base import *
-from oilsweb.lib.context import Context, SubContext, ContextItem
-
-log = logging.getLogger(__name__)
-
-
-class BaseContext(SubContext):
- def postinit(self):
- self.prefixvalue = "%s/base" % Context.get_context().core.prefix.value
-Context.apply_sub_context('base', BaseContext)
-
-
-class BaseController(BaseController):
- ''' Controller for globally shared interfaces '''
-
- def dashboard(self):
- r = RequestMgr()
- return r.render('dashboard.html')
-
+++ /dev/null
-import os.path
-
-import paste.fileapp
-from pylons.middleware import error_document_template, media_path
-
-from oilsweb.lib.base import *
-
-class ErrorController(BaseController):
- """Generates error documents as and when they are required.
-
- The ErrorDocuments middleware forwards to ErrorController when error
- related status codes are returned from the application.
-
- This behaviour can be altered by changing the parameters to the
- ErrorDocuments middleware in your config/middleware.py file.
- """
-
- def document(self):
- """Render the error document"""
- page = error_document_template % \
- dict(prefix=request.environ.get('SCRIPT_NAME', ''),
- code=request.params.get('code', ''),
- message=request.params.get('message', ''))
- return page
-
- def img(self, id):
- """Serve Pylons' stock images"""
- return self._serve_file(os.path.join(media_path, 'img', id))
-
- def style(self, id):
- """Serve Pylons' stock stylesheets"""
- return self._serve_file(os.path.join(media_path, 'style', id))
-
- def _serve_file(self, path):
- """Call Paste's FileApp (a WSGI application) to serve the file
- at the specified path
- """
- fapp = paste.fileapp.FileApp(path)
- return fapp(request.environ, self.start_response)
+++ /dev/null
-from oilsweb.lib.base import *
-
-class TemplateController(BaseController):
-
- def view(self, url):
- """By default, the final controller tried to fulfill the request
- when no other routes match. It may be used to display a template
- when all else fails, e.g.::
-
- def view(self, url):
- return render('/%s' % url)
-
- Or if you're using Mako and want to explicitly send a 404 (Not
- Found) response code when the requested template doesn't exist::
-
- import mako.exceptions
-
- def view(self, url):
- try:
- return render('/%s' % url)
- except mako.exceptions.TopLevelLookupException:
- abort(404)
-
- By default this controller aborts the request with a 404 (Not
- Found)
- """
- abort(404)
+++ /dev/null
-from oilsweb.lib.base import *
-import urllib2, urllib, httplib
-import osrf.json
-import pylons
-
-class TranslatorController(BaseController):
- ''' This controller acts as a proxy for the OpenSRF http translator
- so that paster can handle opensrf AJAX requests. '''
- def proxy(self):
- try:
- headers = {}
- for k,v in request.headers.iteritems():
- headers[k] = v
- conn = httplib.HTTPConnection(pylons.config['osrf_http_translator_host'])
- conn.request("POST", pylons.config['osrf_http_translator_path'],
- urllib.urlencode({'osrf-msg':request.params['osrf-msg']}), headers)
- resp = conn.getresponse()
- for h in resp.getheaders():
- response.headers[h[0]] = h[1]
- return resp.read()
- except Exception, e:
- import sys
- sys.stderr.write(unicode(e) + '\n')
-
+++ /dev/null
-from oilsweb.lib.context import Context, SubContext, ContextItem
-import osrf.ses, oils.utils.csedit, pylons.config, oils.utils.utils, oils.event
-import oilsweb.lib.user
-from gettext import gettext as _
-import oils.org
-
-class CoreContext(SubContext):
- # cache the authenticated user info
- def __init__(self):
- self.prefix = ContextItem() # web prefix
- self.media_prefix = ContextItem() # media prefix
- self.ac_prefix = ContextItem() # added content prefix
- self.skin = ContextItem() # web skin
- self.theme = ContextItem() # web theme
- self.authtoken = ContextItem(cgi_name='ses', session=True) # authtoken string
- self.user = ContextItem() # logged in user object
- self.workstation = ContextItem() # workstation object
- self.use_demo = ContextItem(cgi_name='demo') # use the demo login
- self.org_tree = ContextItem() # full org tree
- self.page = ContextItem() # the current page
-
- self.work_orgs = ContextItem()
-
- # place to store perm org sets for a given permission
- self.high_perm_orgs = ContextItem(default_value={})
-
- # place to store slim perm org trees
- self.perm_tree = ContextItem(default_value={})
-
- def postinit(self):
- self.prefix.value = pylons.config['oils_prefix']
- self.media_prefix.value = pylons.config['oils_media_prefix']
- self.ac_prefix.value = pylons.config['oils_added_content_prefix']
- self.skin.value = 'default' # XXX
- self.theme.value = 'default' # XXX
- #usermgr = oilsweb.lib.user.User(self)
- #usermgr.fetch_user()
- #self.work_orgs = usermgr.fetch_work_orgs()
-
-Context.apply_sub_context('core', CoreContext)
+++ /dev/null
-"""The application's Globals object"""
-from pylons import config
-import oilsweb.lib.util
-
-class Globals(object):
- """Globals acts as a container for objects available throughout the
- life of the application
- """
-
- def __init__(self):
- pass
-
-
+++ /dev/null
-"""The base Controller API
-
-Provides the BaseController class for subclassing, and other objects
-utilized by Controllers.
-"""
-from pylons import c, cache, config, g, request, response, session
-from pylons.controllers import WSGIController
-from pylons.controllers.util import abort, etag_cache, redirect_to
-from pylons.decorators import jsonify, validate
-from pylons.i18n import _, ungettext, N_
-from pylons.templating import render
-
-import oilsweb.lib.helpers as h
-import oilsweb.model as model
-
-class BaseController(WSGIController):
-
- def __call__(self, environ, start_response):
- """Invoke the Controller"""
- # WSGIController.__call__ dispatches to the Controller method
- # the request is routed to. This routing information is
- # available in environ['pylons.routes_dict']
- return WSGIController.__call__(self, environ, start_response)
-
-# Include the '_' function in the public names
-__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
- or __name == '_']
+++ /dev/null
-import os, re
-import pylons
-import osrf.ses
-import oils.utils.csedit
-import oilsweb.lib.util
-
-def marc_to_html(marcxml):
- # create a path building utility function ....
- xslFile = os.path.join(pylons.config['oils_xsl_prefix'], pylons.config['oils_xsl_marc2html'])
- html = oilsweb.lib.util.apply_xsl(marcxml, xslFile)
- return html
-
-def scrub_isbn(isbn):
- ''' removes trailing data from an ISBN '''
- if not isbn: return ''
- return re.sub('\s.*','', isbn)
-
-
+++ /dev/null
-from oilsweb.lib.util import childInit
-import cgi
-
-# global context
-_context = None
-# global collection of sub-contexts
-_subContexts = {}
-
-class ContextItem(object):
- ''' Defines a single field on a subcontext object. '''
- def __init__(self, **kwargs):
- self.app = None
- self.name = kwargs.get('name')
- self.cgi_name = kwargs.get('cgi_name')
- self.default_value = kwargs.get('default_value')
- self.qname = None
- self.multi = kwargs.get('multi')
- self.session = kwargs.get('session')
- self.value = self.default_value
-
-class SubContext(object):
- ''' A SubContext is a class-specific context object that lives inside the global context object '''
- def _fields(self):
- ''' Returns all public fields for this subcontext '''
- return [ f for f in dir(self) if f[0:1] != '_' and
- getattr(self, f).__class__.__name__.find('method') < 0 ]
-
- def postinit(self):
- ''' Overide with any post-global-init initialization '''
- pass
-
-class Context(object):
- ''' Global context object '''
-
- def __init__(self):
- self._fields = []
- self._req = None
- self._resp = None
-
- def make_query_string(self):
- ''' Compiles a CGI query string from the collection of values
- stored in the subcontexts '''
-
- q = ''
- for f in self._fields:
- if f.cgi_name and not f.session:
- val = f.value
- if val != f.default_value:
- if isinstance(val, list):
- for v in val:
- if isinstance(val, str) or isinstance(val, unicode):
- q += f.cgi_name+'='+cgi.escape(v)+'&'
- else:
- if isinstance(val, str) or isinstance(val, unicode):
- q += f.cgi_name+'='+cgi.escape(val)+'&'
-
- return q[:-1] # strip the trailing &
-
- def apply_session_vars(self):
- from oilsweb.lib.base import session
- for f in self._fields:
- if f.cgi_name and f.session:
- val = f.value
- if val is not None and val != f.default_value:
- session[f.cgi_name] = val
-
- @staticmethod
- def apply_sub_context(app, ctx):
- global _subContexts
- _subContexts[app] = ctx
-
- @staticmethod
- def get_context():
- global _context
- return _context
-
- @staticmethod
- def init(req, resp):
- global _context, _subContexts
- from oilsweb.lib.base import session
- c = _context = Context()
- c._req = req
- c._resp = resp
- #childInit()
-
- for app, ctx in _subContexts.iteritems():
- ctx = ctx()
- setattr(c, app, ctx)
- for name in ctx._fields():
-
- item = getattr(ctx, name)
- item.app = app
- item.name = name
- c._fields.append(item)
-
- # -------------------------------------------------------------------
- # Load the cgi/session data. First try the URL params, then try the
- # session cache, and finally see if the data is in a cookie. If
- # no data is found, use the default
- # -------------------------------------------------------------------
- if item.cgi_name:
- if item.cgi_name in req.params:
- if item.multi:
- item.value = req.params.getall(item.cgi_name)
- else:
- item.value = req.params[item.cgi_name]
- else:
- if item.session:
- if item.cgi_name in session:
- item.value = session[item.cgi_name]
- set = True
- else:
- if item.cgi_name in req.cookies:
- item.value = req.cookies[item.cgi_name]
-
- # run postinit after all contexts have been loaded
- for app in _subContexts.keys():
- ctx = getattr(c, app)
- ctx.postinit()
-
- return c
+++ /dev/null
-"""Helper functions
-
-Consists of functions to typically be used within templates, but also
-available to Controllers. This module is available to both as 'h'.
-"""
-from webhelpers import *
+++ /dev/null
-import pylons
-from oilsweb.lib.base import *
-import oilsweb.lib.context
-
-class RequestMgr(object):
- ''' This is container class for aggregating the various Pylons global
- variables, initializing the local and pylons context objects, and
- rendering templates based on the skin
- '''
-
- def __init__(self):
- # pylons request object
- self.request = request
- # pylons response object
- self.response = response
- # pylons session
- self.session = session
- # our local context object.
- self.ctx = oilsweb.lib.context.Context.init(request, response)
- # the global pylons context object
- self.pylons_context = c
- # true if we've saved the session/cookie data, etc.
- self.finalized = False
-
- def finalize(self):
- ''' Perform any last minute cleanup just prior to sending the result '''
- if not self.finalized:
- self.ctx.apply_session_vars()
- self.session.save()
- self.pylons_context.oils = self.ctx
- self.finalized = True
-
- def render(self, tpath):
- ''' Renders the given template using the configured skin.
- @param tpath The path to the template. The tpath should
- only include the path to the template after the skin component.
- E.g. if the full path is /oils/myskin/base/dashboard.html, tpath
- would be 'base/dashboard.html'
- '''
- self.finalize()
- self.ctx.core.page.value = tpath
- return pylons.templating.render('oils/%s/%s' % (self.ctx.core.skin.value, tpath))
-
-
-
+++ /dev/null
-import osrf.ses, oils.utils.csedit, pylons.config, oils.utils.utils, oils.event, oils.const
-from gettext import gettext as _
-
-class AuthException(Exception):
- def __init__(self, info=''):
- self.info = info
- def __str__(self):
- return "%s: %s" % (self.__class__.__name__, unicode(self.info))
-
-class User(object):
- ''' General purpose user utility methods '''
-
- def __init__(self, ctx):
- self.ctx = ctx
-
- def try_auto_login(self):
- if pylons.config.get('oils_demo_user'):
- evt = oils.utils.utils.login(
- pylons.config['oils_demo_user'],
- pylons.config['oils_demo_password'],
- 'staff',
- pylons.config['oils_demo_workstation'])
- oils.event.Event.parse_and_raise(evt)
- self.ctx.authtoken.value = evt['payload']['authtoken']
-
- def fetch_user(self):
- ''' Grab the logged in user and their workstation '''
-
- if not self.ctx.authtoken.value:
- self.try_auto_login()
-
- if not self.ctx.authtoken.value:
- raise AuthException(_('No authentication token provided'))
-
- self.ctx.user.value = osrf.ses.ClientSession.atomic_request(
- 'open-ils.auth',
- 'open-ils.auth.session.retrieve', self.ctx.authtoken.value)
-
- evt = oils.event.Event.parse_event(self.ctx.user.value)
- if evt and evt.text_code == 'NO_SESSION':
- # our authtoken has timed out. See if we can autologin
- self.try_auto_login()
- if not self.ctx.authtoken.value:
- raise AuthException(_('No authentication token provided'))
- self.ctx.user.value = osrf.ses.ClientSession.atomic_request(
- 'open-ils.auth',
- 'open-ils.auth.session.retrieve', self.ctx.authtoken.value)
- oils.event.Event.parse_and_raise(self.ctx.user.value)
-
- self.ctx.workstation.value = oils.utils.csedit.CSEditor().retrieve_actor_workstation(self.ctx.user.value.wsid())
- if not self.ctx.workstation.value:
- raise AuthException(_('No workstation found'))
-
- def fetch_work_orgs(self):
- work_orgs = osrf.ses.ClientSession.atomic_request(
- 'open-ils.actor',
- 'open-ils.actor.user.get_work_ous.ids',
- self.ctx.authtoken.value)
- oils.event.Event.parse_and_raise(work_orgs)
- return work_orgs
-
- def highest_work_perm_set(self, perm):
- perm_orgs = osrf.ses.ClientSession.atomic_request(
- 'open-ils.actor',
- 'open-ils.actor.user.work_perm.highest_org_set', self.ctx.authtoken.value, perm);
- self.ctx.high_perm_orgs.value[perm] = perm_orgs
- return perm_orgs
-
- def highest_work_perm_tree(self, perm):
- perm_orgs = self.highest_work_perm_set(perm)
- if len(perm_orgs) == 0:
- return None
- self.ctx.perm_tree.value[perm] = oils.org.OrgUtil.get_union_tree(perm_orgs)
- return self.ctx.perm_tree.value[perm]
-
- def fetch_user_setting(self, setting):
- setting = osrf.ses.ClientSession.atomic_request(
- oils.const.OILS_APP_ACTOR,
- 'open-ils.actor.patron.settings.retrieve',
- self.ctx.authtoken.value, self.ctx.user.value.id(), setting)
- oils.event.Event.parse_and_raise(setting)
- return setting
-
- def get_date_format(self):
- setting = self.fetch_user_setting('common.date_format')
- if not setting:
- return '%Y-%m-%d'
- return setting
-
- def get_datetime_format(self):
- setting = self.fetch_user_setting('common.datetime_format')
- if not setting:
- return '%Y-%m-%d %H:%M'
- return setting
-
-
+++ /dev/null
-import pylons.config, pylons.templating
-import libxml2, libxslt
-
-def childInit():
- ''' Global child-init handler.
-
- 1. Connects to the OpenSRF network.
- 2. Parses the IDL file
- '''
-
- import oils.system
- oils.system.System.remote_connect(
- config_file = pylons.config['osrf_config'],
- config_context = pylons.config['osrf_config_ctxt'],
- connect_cache = True)
-
-_parsedSheets = {}
-def apply_xsl(xmlStr, xslFile, xslParams={}):
- ''' Applies xslFile to xmlStr and returns the string result '''
- doc = libxml2.parseDoc(xmlStr)
- stylesheet = _parsedSheets.get(xslFile)
-
- if not stylesheet:
- styledoc = _parsedSheets.get(xslFile) or libxml2.parseFile(xslFile)
- stylesheet = libxslt.parseStylesheetDoc(styledoc)
- _parsedSheets[xslFile] = stylesheet
-
- result = stylesheet.applyStylesheet(doc, xslParams)
- return stylesheet.saveResultToString(result)
-
-
+++ /dev/null
-/* import the default css for the install applications */
-@import "default/acq.css";
-@import "default/admin.css";
-/* import the dojo CSS */
-@import "../../js/dojo/dojox/grid/_grid/Grid.css";
-@import "../../js/dojo/dijit/themes/tundra/tundra.css";
-@import "../../js/dojo/dojo/resources/dojo.css";
-
-
-
-
-/* base default style */
-
-/** Generic style ------------------------------ **/
-/* use this for divs whose contents should be entirely contained within the div */
-.container:after {content: ""; display: block; height: 0; clear: both; }
-table { border-collapse: collapse; }
-
-html, body, #oils-base-body-block {
- width:100%;
- height:100%;
- border:0;
- margin:0;
- padding:0;
-}
-
-.invisible { visibility: hidden; }
-.hidden { display: none; visibility: hidden; }
-.display { display: block; visibility: visible; }
-
-/* main layout blocks */
-#oils-base-main-block { width: 100%; margin-top: 0px; padding-top: 0px;}
-#oils-base-navigate-block { width: 12%; vertical-align: top; float:left;}
-#oils-base-content-block { width: 87%; vertical-align: top; float:right; padding-top: 0px;}
-#oils-base-sidebar-block { width: 12%; vertical-align: top; float:left;}
-
-#oils-base-header-auto-login { padding-right: 20px; }
-#oils-base-header-block { width: 100%; text-align: right; margin-top: 0px; padding-bottom: 0px;}
-#oils-base-header-menu-block { float:left; text-align: left; width: 50%; }
-#oils-base-header-auto-login-block { float:right; text-align: right; width: 47%;}
-
-#oils-base-footer-block { width: 100%; text-align: center; vertical-align: bottom;}
-
-#oils-base-navigate-list { width: 100%; }
-.oils-base-navigate-sub-list { padding-left: 4px; }
-.oils-base-navigate-item {}
-
-/* general purpose form table */
-.oils-admin-table { width: 100%; }
-.oils-admin-table td { padding: 4px; }
-.oils-admin-table textarea { width: 400px; height: 40px; overflow:auto;}
-.oils-admin-label { width: auto; }
-
-.label { margin: 1px; }
-
-
-/* local dojo style enhancements ----------------------------------- */
-/*
-.dojoxGrid {border: 1px solid #333; height: 90%;}
-*/
-.dojoxGrid {height: 90%;}
-.dojoxGrid-cell {padding: 8px;}
-.dijitTooltipTable td {padding: 3px;} /* custom class for handling dialog tables */
-/* ----------------------------------------------------------------- */
-
+++ /dev/null
-.spacer {clear: both}
-
-#oils-acq-index-block { font-weight:bold; }
-/*
-.oils-sub-navigate-block { width: 100%; text-align: left; padding: 3px;}
-.oils-sub-navigate-block span { padding: 3px; }
-*/
-
-.oils-acq-detail-content-pane {height:600px;width:100%}
-.oils-acq-basic-form-table td {padding:4px;}
-
-/* bib search */
-#oils-acq-search-container { width:100%; }
-#oils-acq-search-sources-block { width:32%; vertical-align: top; float: left; margin-right: 10px;}
-#oils-acq-search-form-block { width:63%; vertical-align: top; float:right; }
-#oils-acq-search-sources-selector { padding: 2px; }
-#oils-acq-search-sources-selector option { margin-bottom: 2px; }
-.oils-acq-search-form-row { width: 100%; }
-.oils-acq-search-form-label {}
-.oils-acq-search-form-input {}
-#oils-acq-search-sources-list { padding: 1px; }
-#oils-acq-search-sources-list li { list-style-type: none; padding-left: 0px; }
-.oils-acq-search-sources-sublist { padding: 1px; list-style-type: none;}
-.oils-acq-search-sources-sublist li { margin-left: 10px; }
-.oils-acq-search-subsources-label { margin-top: 5px; }
-#oils-acq-search-sources-label { margin-bottom: 10px; }
-#oils-acq-search-fields-label { margin-bottom: 10px; }
-#oils-acq-search-fields-submit-block { margin: 5px; text-align: center;}
-#oils-acq-search-progress {width: 100%; text-align: center;}
-#oils-acq-search-source-select option {padding: 5px;}
-#oils-acq-search-fields-tbody td {padding: 3px;}
-
-/* list of picklists */
-#oils-acq-picklist-list-table {width: 100%;}
-#oils-acq-picklist-list-table td {padding: 3px;}
-
-/* a single picklist */
-#oils-acq-picklist-table { width: 100%; }
-#oils-acq-picklist-header { padding: 4px; margin-bottom: 20px; }
-.oils-acq-picklist-records-jacket-td { width: 46px; height: 54px; }
-.oils-acq-picklist-records-jacket { width: 42px; height: 54px; padding-left: 0px; }
-.oils-acq-picklist-records-title {vertical-align: top}
-.oils-acq-picklist-records-copies {text-align: right; width: 200px}
-#oils-acq-picklist-paging-block { width: 25%; float: left; position: relative; }
-#oils-acq-picklist-actions-block { width: 75%; text-align: right; float: right; position: relative; }
-#oils-acq-picklist-header-subtable { width: 100%; }
-#oils-acq-picklist-header-block { width: 100%; display: block }
-
-/* list of pos */
-#oils-acq-po-list-table {width: 100%;}
-#oils-acq-po-list-table td {padding: 3px;}
-
-/* a single po */
-#oils-acq-po-table { width: 100%; }
-#oils-acq-po-header { padding: 4px; margin-bottom: 20px; }
-.oils-acq-po-records-jacket-td { width: 46px; }
-.oils-acq-po-records-jacket { width: 42px; height: 54px; padding-left: 0px; }
-.oils-acq-po-records-title-row {}
-.oils-acq-po-records-author-row td { padding-left: 30px; }
-.oils-acq-po-records-phys_desc-row td { padding-left: 30px; }
-.oils-acq-po-records-phys_desc-row {}
-
-#oils-acq-po-paging-block { width: 50%; text-align: left;}
-#oils-acq-po-actions-block { width: 50%; text-align: right;}
-#oils-acq-po-header-subtable { width: 100%; }
-
-#oils-acq-list-header { margin: 10px; width: 98%;}
-#oils-acq-list-header-label { float: left; }
-#oils-acq-list-header-actions { float: right; }
-
-/* purchase order line item detail page */
-#oils-acq-po-li-header { padding: 4px; margin-bottom: 20px; }
-#oils-acq-po-li-summary {}
-#oils-acq-po-li-summary td {padding: 2px;}
-.oils-acq-po-li-attr {}
-.oils-acq-po-li-attr-type {}
-.oils-acq-po-li-attr-name {}
-.oils-acq-po-li-attr-value {}
-#oils-acq-po-li-marc-block { margin-top: 10px; padding: 6px; }
-#oils-acq-po-li-details-table { width: 100%; }
-.oils-acq-po-li-detail-row {}
-
-/* picklist entry page */
-#oils-acq-lineitem-header { padding: 4px; margin-bottom: 20px; }
-#oils-acq-lineitem-summary {}
-#oils-acq-lineitem-summary td {padding: 2px;}
-.oils-acq-lineitem-attr {}
-.oils-acq-lineitem-attr-type {}
-.oils-acq-lineitem-attr-name {}
-.oils-acq-lineitem-attr-value {}
-#oils-acq-lineitem-marc-block { margin-top: 10px; padding: 6px; }
-
-
-
+++ /dev/null
-#oils-admin-object-actions { width: 100%; padding: 2px; margin: 2px; text-align: right;}
-#oils-admin-object-table { width: 100%; }
-#oils-admin-object-table td { padding: 3px; }
+++ /dev/null
-/* import the default css for the install applications */
-@import "default/acq.css";
-@import "default/admin.css";
-
-body { font-size: 80%; }
-
-#oils-base-body-block {}
-/*
-#oils-base-navigate-block {border: 2px solid #85C777; background: #6BA160;}
-#oils-base-navigate-block {border: 2px solid #f8f7f1; background: #fffdf1;}
-*/
-#oils-base-navigate-block {background: #d9e8f9;}
-
-#oils-base-navigate-block a { color: #000000; }
-#oils-base-content-block {}
-#oils-base-sidebar-block {}
-#oils-base-footer-block {padding: 3px; margin-top: 20px; border-top: 1px solid #5E5E5E;}
-/*
-#oils-base-header-block {border-bottom: 1px solid #5E5E5E; border: 2px solid #85C777; background: #6BA160;}
-*/
-#oils-base-header-block {border-bottom: 1px solid #d9e8f9;}
-
-
-#oils-base-navigate-list { width: 100%; }
-.oils-base-navigate-sub-list { margin-left: 14px; }
-/*.oils-base-navigate-item {border: 2px solid #85C777; background: #6BA160;}*/
-.oils-base-navigate-item:hover { background: #85C777; }
-
-/*
-#oils-base-navigate-table td:hover { background: #85C777; }
-.oils-base-sub-navigate-block { border: 2px solid #6BA160; background: #85C777;}
-.oils-base-sub-navigate-block a { color: #000000; }
-*/
-
-#oils-base-header-user-info { font-weight: bold; margin-right: 8px;}
-
-
-.label { font-weight: bold; }
-
-/*
-.oils-admin-table td { border-bottom: 1px solid #5E5E5E; }
-*/
-.oils-admin-table td { border-bottom: 1px solid #d9e8f9; }
-.oils-admin-label { font-weight: bold; }
-
-.oils-acq-nav-link {
- padding:0px 3px 3px 3px;
- border-top:1px solid #F8F7F1;
- border-bottom:1px solid #F8F7F1;
- font-size: 105%;
-}
-.oils-acq-nav-link a { text-decoration:none; }
-.oils-acq-nav-link-active {
- background:#FFFDF3;
- border-top:1px solid #ACA899;
- border-bottom:1px solid #ACA899;
-}
-
+++ /dev/null
-
-#oils-acq-index-div { font-weight:bold; }
-
-#oils-acq-search-container { width:100%; }
-#oils-acq-search-sources-div { width:20%; float:left; }
-#oils-acq-search-form-div { width:80%; float:right; }
-#oils-acq-search-z39-sources-table thead td { font-weight: bold; }
-#oils-acq-search-z39-sources-table tbody td { width: 33%; }
-#oils-acq-search-sources-label { font-weight: bold; border-bottom: 1px solid #6BA160;}
-#oils-acq-search-fields-label { font-weight: bold; border-bottom: 1px solid #6BA160;}
-#oils-acq-search-subsources-label { font-weight: bold; }
-#oils-acq-search-fields-submit-block { border: 2px solid #A1A1A1; }
-
-/* list of picklists */
-#oils-acq-picklist-list-table {width: 100%;}
-#oils-acq-picklist-list-table thead td {font-weight:bold;}
-
-/* picklist display */
-#oils-acq-picklist-table thead tr { border: 1px solid #A1A1A1; }
-#oils-acq-picklist-header {border: 1px solid #85C777;}
-#oils-acq-lineitem-header {border: 1px solid #85C777;}
-#oils-acq-picklist-name { font-weight: bold; font-style: italic; }
-.oils-acq-picklist-attributes { font-size: 90%; margin-left: 15px;}
-.oils-acq-lineitem-attributes { font-size: 90%; margin-left: 15px;}
-.oils-acq-picklist-records-phys_desc-row { border-bottom: 1px solid #6BA160; }
-.oils-acq-picklist-picklist-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; }
-.oils-acq-picklist-records-service-td { font-size: 85%; }
-.oils-acq-lineitem-delete-link { font-size: 85%; }
-#oils-acq-picklist-header-subtable tr { border: none; }
-
-/* po display */
-#oils-acq-po-table thead tr { border: 1px solid #A1A1A1; }
-#oils-acq-po-header {border: 1px solid #85C777;}
-#oils-acq-po-li-header {border: 1px solid #85C777;}
-#oils-acq-po-name { font-weight: bold; font-style: italic; }
-.oils-acq-po-attributes { font-size: 90%; margin-left: 15px;}
-.oils-acq-po-li-attributes { font-size: 90%; margin-left: 15px;}
-.oils-acq-po-records-phys_desc-row { border-bottom: 1px solid #6BA160; }
-.oils-acq-po-po-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; }
-.oils-acq-po-records-service-td { font-size: 85%; }
-.oils-acq-po-li-delete-link { font-size: 85%; }
-#oils-acq-po-header-subtable tr { border: none; }
-
-/*
-#oils-acq-list-header {border-bottom: 1px solid #6BA160;}
-*/
-#oils-acq-list-header {border-bottom: 2px solid #d9e8f9;}
-#oils-acq-list-header-label { font-weight: bold; font-size: 110%; }
-#oils-acq-list-header-actions { font-weight: bold; }
-
-
-/* entry display */
-#oils-acq-lineitem-marc-block { border: 1px solid #6BA160; }
+++ /dev/null
-#oils-admin-object-table tr { border-bottom: 1px solid #6BA160; }
+++ /dev/null
-function loadUser(username, password) {
- dojo.require('dojo.cookie');
- dojo.require('openils.CGI');
- dojo.require("openils.User");
-
- openils.User.authcookie = 'ses';
- openils.User.authtoken = dojo.cookie('ses') || new openils.CGI().param('ses');
- // cache the user object as a cookie?
- //openils.User.user = JSON2js(dojo.cookie('user'));
-
- if(!username) return;
-
- dojo.require('openils.Event');
-
- function dologin() {
- openils.User.authtoken = null;
- user = new openils.User();
- user.login({
- login_type:'staff',
- username:username,
- passwd:password,
- login:true
- });
- user.getBySession();
- openils.User.authtoken = user.authtoken;
- openils.User.user = user.user;
- //dojo.cookie('user', js2JSON(openils.User.user),{path:'/'});
- }
-
- if(!openils.User.user) {
- if(openils.User.authtoken) {
- user = new openils.User();
- openils.User.user = user.user;
- if(openils.Event.parse(user.user)) // session timed out
- dologin();
- } else {
- dologin();
- }
- }
-}
-
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require('dijit.form.Button');
-dojo.require('dojox.grid.Grid');
-dojo.require('openils.acq.CurrencyType');
-dojo.require('openils.Event');
-dojo.require('fieldmapper.dojoData');
-
-var currencyTypes = [];
-
-function loadCTypesGrid() {
- openils.acq.CurrencyType.fetchAll(
- function(types) {
- var store = new dojo.data.ItemFileReadStore(
- {data:acqct.toStoreData(types, 'code', {identifier:'code'})});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{code:'*'}});
- currencyTypeListGrid.setModel(model);
- currencyTypeListGrid.update();
- }
- );
-}
-
-
-dojo.addOnLoad(loadCTypesGrid);
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require("dijit.form.FilteringSelect");
-dojo.require('openils.acq.FundingSource');
-dojo.require('openils.acq.CurrencyType');
-dojo.require('openils.widget.OrgUnitFilteringSelect');
-dojo.require('dijit.form.Button');
-dojo.require('dojox.grid.Grid');
-dojo.require('openils.Event');
-
-function getOrgInfo(rowIndex) {
- data = fundingSourceListGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function getBalanceInfo(rowIndex) {
- data = fundingSourceListGrid.model.getRow(rowIndex);
- if(!data) return;
- return new String(openils.acq.FundingSource.cache[data.id].summary().balance);
-}
-
-function loadFSGrid() {
- openils.acq.FundingSource.createStore(
- function(storeData) {
- var store = new dojo.data.ItemFileReadStore({data:storeData});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fundingSourceListGrid.setModel(model);
- fundingSourceListGrid.update();
- }
- );
-}
-
-dojo.addOnLoad(loadFSGrid);
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require("dijit.form.FilteringSelect");
-dojo.require('dijit.form.Button');
-dojo.require('dojox.grid.Grid');
-
-dojo.require('openils.widget.OrgUnitFilteringSelect');
-dojo.require('openils.acq.CurrencyType');
-dojo.require('openils.Event');
-dojo.require('openils.acq.Fund');
-
-function getOrgInfo(rowIndex) {
- data = fundListGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.org).shortname();
-}
-
-function getBalanceInfo(rowIndex) {
- data = fundListGrid.model.getRow(rowIndex);
- if(!data) return;
- return new String(openils.acq.Fund.cache[data.id].summary().combined_balance);
-}
-
-
-function loadFundGrid() {
- openils.acq.Fund.createStore(
- function(storeData) {
- var store = new dojo.data.ItemFileReadStore({data:storeData});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fundListGrid.setModel(model);
- fundListGrid.update();
-
- var yearStore = {identifier:'year', name:'year', items:[]};
-
- var added = [];
- for(var i = 0; i < storeData.items.length; i++) {
- var year = storeData.items[i].year;
- if(added.indexOf(year) == -1) {
- yearStore.items.push({year:year});
- added.push(year);
- }
- }
- yearStore.items = yearStore.items.sort().reverse();
- fundFilterYearSelect.store = new dojo.data.ItemFileReadStore({data:yearStore});
- var today = new Date().getFullYear().toString();
- fundFilterYearSelect.setValue((added.indexOf(today != -1)) ? today : added[0]);
- }
- );
-}
-
-function filterGrid() {
- var year = fundFilterYearSelect.getValue();
- if(year)
- fundListGrid.model.query = {year:year};
- else
- fundListGrid.model.query = {id:'*'};
- fundListGrid.model.refresh();
- fundListGrid.update();
-}
-
-dojo.addOnLoad(loadFundGrid);
-
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require("dijit.form.FilteringSelect");
-dojo.require('dijit.form.Button');
-dojo.require('dojox.grid.Grid');
-
-dojo.require('openils.acq.CurrencyType');
-dojo.require('openils.Event');
-dojo.require('openils.acq.Provider');
-dojo.require("fieldmapper.OrgUtils");
-dojo.require('openils.widget.OrgUnitFilteringSelect');
-
-function getOrgInfo(rowIndex) {
- data = providerListGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function loadProviderGrid() {
- openils.acq.Provider.createStore(
- function(storeData) {
- var store = new dojo.data.ItemFileReadStore({data:storeData});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- providerListGrid.setModel(model);
- providerListGrid.update();
- }
- );
-}
-function createProvider(fields) {
- openils.acq.Provider.create(fields, function(){loadProviderGrid()});
-}
-
-
-dojo.addOnLoad(loadProviderGrid);
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.layout.TabContainer');
-dojo.require('dijit.layout.ContentPane');
-dojo.require('dojox.grid.Grid');
-
-dojo.require("fieldmapper.OrgUtils");
-dojo.require('openils.acq.Fund');
-dojo.require('openils.acq.FundingSource');
-dojo.require('openils.Event');
-dojo.require('openils.User');
-
-var fund = null;
-
-function getSummaryInfo(rowIndex) {
- return new String(fund.summary()[this.field]);
-}
-
-function createAllocation(fields) {
- fields.fund = fundID;
- if(isNaN(fields.percent)) fields.percent = null;
- if(isNaN(fields.amount)) fields.amount = null;
- //openils.acq.Fund.createAllocation(fields, resetPage);
- openils.acq.Fund.createAllocation(fields,
- function(r){location.href = location.href;});
-}
-
-function getOrgInfo(rowIndex) {
- data = fundGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.org).shortname();
-}
-
-function getXferDest(rowIndex) {
- data = this.grid.model.getRow(rowIndex);
- if(!(data && data.xfer_destination)) return '';
- return data.xfer_destination;
-}
-
-function loadFundGrid() {
- var store = new dojo.data.ItemFileReadStore({data:acqf.toStoreData([fund])});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fundGrid.setModel(model);
- fundGrid.update();
-}
-
-function loadAllocationGrid() {
- if(fundAllocationGrid.isLoaded) return;
- var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.allocations())});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fundAllocationGrid.setModel(model);
- fundAllocationGrid.update();
- fundAllocationGrid.isLoaded = true;
-}
-
-function loadDebitGrid() {
- if(fundDebitGrid.isLoaded) return;
- var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.debits())});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fundDebitGrid.setModel(model);
- fundDebitGrid.update();
- fundDebitGrid.isLoaded = true;
-}
-
-function fetchFund() {
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.fund.retrieve'],
- { async: true,
- params: [
- openils.User.authtoken, fundID,
- {flesh_summary:1, flesh_allocations:1, flesh_debits:1}
- /* TODO grab allocations and debits only on as-needed basis */
- ],
- oncomplete: function(r) {
- fund = r.recv().content();
- loadFundGrid(fund);
- }
- }
- );
-}
-
-dojo.addOnLoad(fetchFund);
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require('dijit.layout.TabContainer');
-dojo.require('dijit.layout.ContentPane');
-dojo.require("dijit.form.FilteringSelect");
-dojo.require("dijit.form.Textarea");
-dojo.require("dijit.form.CurrencyTextBox");
-dojo.require('dojox.grid.Grid');
-
-dojo.require("fieldmapper.OrgUtils");
-dojo.require('openils.acq.FundingSource');
-dojo.require('openils.acq.Fund');
-dojo.require('openils.Event');
-
-var ses = new OpenSRF.ClientSession('open-ils.acq');
-var fundingSource = null;
-
-function resetPage() {
- fundingSource = null;
- fsCreditGrid.isLoaded = false;
- fsAllocationGrid.isLoaded = false;
- loadFS();
-}
-
-/** creates a new funding_source_credit from the dialog ----- */
-function applyFSCredit(fields) {
- fields.funding_source = fundingSourceID;
- openils.acq.FundingSource.createCredit(fields, resetPage);
-}
-
-function applyFSAllocation(fields) {
- fields.funding_source = fundingSourceID;
- if(isNaN(fields.percent)) fields.percent = null;
- if(isNaN(fields.amount)) fields.amount = null;
- openils.acq.Fund.createAllocation(fields, resetPage);
-}
-
-/** fetch the fleshed funding source ----- */
-function loadFS() {
- var req = ses.request(
- 'open-ils.acq.funding_source.retrieve',
- openils.User.authtoken, fundingSourceID,
- {flesh_summary:1, flesh_credits:1,flesh_allocations:1}
- );
-
- req.oncomplete = function(r) {
- var msg = req.recv();
- fundingSource = msg.content();
- var evt = openils.Event.parse(fundingSource);
- if(evt) {
- alert(evt);
- return;
- }
- loadFSGrid();
- }
- req.send();
-}
-
-/** Some grid rendering accessor functions ----- */
-function getOrgInfo(rowIndex) {
- data = fundingSourceGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function getSummaryInfo(rowIndex) {
- return new String(fundingSource.summary()[this.field]);
-}
-
-/** builds the credits grid ----- */
-function loadFSGrid() {
- if(!fundingSource) return;
- var store = new dojo.data.ItemFileReadStore({data:acqfs.toStoreData([fundingSource])});
- var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fundingSourceGrid.setModel(model);
- fundingSourceGrid.update();
-}
-
-
-/** builds the credits grid ----- */
-function loadCreditGrid() {
- if(fsCreditGrid.isLoaded) return;
- var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fundingSource.credits())});
- var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fsCreditGrid.setModel(model);
- fsCreditGrid.update();
- fsCreditGrid.isLoaded = true;
-}
-
-/** builds the allocations grid ----- */
-function loadAllocationGrid() {
- if(fsAllocationGrid.isLoaded) return;
- var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fundingSource.allocations())});
- var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- fsAllocationGrid.setModel(model);
- fsAllocationGrid.update();
- fsAllocationGrid.isLoaded = true;
-}
-
-dojo.addOnLoad(loadFS);
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require('dijit.layout.TabContainer');
-dojo.require('dijit.layout.ContentPane');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dojox.grid.Grid');
-dojo.require("fieldmapper.OrgUtils");
-dojo.require('openils.acq.Provider');
-dojo.require('openils.Event');
-dojo.require('openils.User');
-
-var provider = null;
-var marcRegex = /^\/\/\*\[@tag="(\d+)"]\/\*\[@code="(\w)"]$/;
-
-function getOrgInfo(rowIndex) {
- data = providerGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function getTag(rowIdx) {
- data = padGrid.model.getRow(rowIdx);
- if(!data) return;
- return data.xpath.replace(marcRegex, '$1');
-}
-
-function getSubfield(rowIdx) {
- data = padGrid.model.getRow(rowIdx);
- if(!data) return;
- return data.xpath.replace(marcRegex, '$2');
-}
-
-
-function loadProviderGrid() {
- var store = new dojo.data.ItemFileReadStore({data:acqpro.toStoreData([provider])});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- providerGrid.setModel(model);
- providerGrid.update();
-}
-
-function loadPADGrid() {
- openils.acq.Provider.retrieveLineitemProviderAttrDefs(providerId,
- function(attrs) {
- var store = new dojo.data.ItemFileReadStore({data:acqlipad.toStoreData(attrs)});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- padGrid.setModel(model);
- padGrid.update();
- }
- );
-}
-
-
-function fetchProvider() {
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.provider.retrieve'],
- { async: true,
- params: [ openils.User.authtoken, providerId ],
- oncomplete: function(r) {
- provider = r.recv().content();
- loadProviderGrid(provider);
- }
- }
- );
-}
-
-function createOrderRecordField(fields) {
- fields.provider = providerId;
- if(!fields.xpath)
- fields.xpath = '//*[@tag="'+fields.tag+'"]/*[@code="'+fields.subfield+'"]';
- delete fields.tag;
- delete fields.subfield;
- openils.acq.Provider.createLineitemProviderAttrDef(fields,
- function(id) {
- loadPADGrid();
- }
- );
-}
-
-function setORDesc() {
- var code = dijit.byId('oils-acq-provider-or-code');
- var desc = dijit.byId('oils-acq-provider-or-desc');
- desc.setValue(code.getDisplayedValue());
-}
-
-function deleteORDataFields() {
- var list = []
- var selected = padGrid.selection.getSelected();
- for(var idx = 0; idx < selected.length; idx++)
- list.push(padGrid.model.getRow(selected[idx]).id);
- openils.acq.Provider.lineitemProviderAttrDefDeleteList(
- list, function(){loadPADGrid();});
-}
-
-
-dojo.addOnLoad(fetchProvider);
-
-
+++ /dev/null
-dojo.require('dojox.form.CheckedMultiSelect');
-dojo.require('fieldmapper.Fieldmapper');
-dojo.require('dijit.ProgressBar');
-dojo.require('dijit.form.Form');
-dojo.require('dijit.form.TextBox');
-dojo.require('dijit.form.NumberSpinner');
-dojo.require('openils.Event');
-dojo.require('openils.acq.Picklist');
-dojo.require('openils.acq.Lineitem');
-dojo.require('openils.User');
-
-var searchFields = [];
-var resultPicklist;
-var resultLIs;
-var selectedLIs;
-var recvCount = 0;
-var sourceCount = 0; // how many sources are we searching
-var user = new openils.User();
-var searchLimit = 10;
-
-function drawForm() {
-
- var sources = fieldmapper.standardRequest(
- ['open-ils.search', 'open-ils.search.z3950.retrieve_services'],
- [user.authtoken]
- );
-
- openils.Event.parse_and_raise(sources);
-
- for(var name in sources) {
- source = sources[name];
- bibSourceSelect.addOption(name, name+':'+source.host);
- for(var attr in source.attrs)
- if(!attr.match(/^#/)) // xml comment nodes
- searchFields.push(source.attrs[attr]);
- }
-
- searchFields = searchFields.sort(
- function(a,b) {
- if(a.label < b.label)
- return -1;
- if(a.label > b.label)
- return 1;
- return 0;
- }
- );
-
- var tbody = dojo.byId('oils-acq-search-fields-tbody');
- var tmpl = tbody.removeChild(dojo.byId('oils-acq-search-fields-template'));
-
- for(var f in searchFields) {
- var field = searchFields[f];
- if(dijit.byId('text_input_'+field.name)) continue;
- var row = tmpl.cloneNode(true);
- tbody.insertBefore(row, dojo.byId('oils-acq-seach-fields-count-row'));
- var labelCell = dojo.query('[name=label]', row)[0];
- var inputCell = dojo.query('[name=input]', row)[0];
- labelCell.appendChild(document.createTextNode(field.label));
- input = new dijit.form.TextBox({name:field.name, label:field.label, id:'text_input_'+field.name});
- inputCell.appendChild(input.domNode);
- }
-}
-
-function doSearch(values) {
- dojo.style('searchProgress', 'visibility', 'visible');
- searchProgress.update({progress: 0});
-
- search = {
- service : [],
- username : [],
- password : [],
- search : {},
- limit : values.limit,
- offset : searchOffset
- };
- searchLimit = values.limit;
- delete values.limit;
-
- var selected = bibSourceSelect.getValue();
- for(var i = 0; i < selected.length; i++) {
- search.service.push(selected[i]);
- search.username.push('');
- search.password.push('');
- sourceCount++;
- }
-
- for(var v in values) {
- if(values[v]) {
- var input = dijit.byId('text_input_'+v);
- search.search[v] = values[v];
- }
- }
-
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.picklist.search.z3950'],
- { async: true,
- params: [user.authtoken, search],
- onresponse: handleResult,
- }
- );
-}
-
-function handleResult(r) {
- var result = r.recv().content();
- if(openils.Event.parse(result)) {
- alert(openils.Event.parse(result));
- dojo.style('searchProgress', 'visibility', 'hidden');
- return;
- }
- if(result.complete)
- return viewResults(result.picklist_id);
- searchProgress.update({maximum: result.total, progress: result.progress});
-}
-
-function viewResults(plId) {
- var plist = new openils.acq.Picklist(plId,
- function(model) {
- resultLIs = plist._items;
- dojo.style('oils-acq-pl-search-results', 'visibility', 'visible');
- JUBGrid.populate(plResultGrid, model, plist._items);
- },
- {flesh_attrs:1, clear_marc:1, limit: searchLimit}
- );
- resultPicklist = plist._plist;
-}
-
-function loadPLSelect() {
- var plList = [];
- function handleResponse(r) {
- plList.push(r.recv().content());
- }
- var method = 'open-ils.acq.picklist.user.retrieve';
- fieldmapper.standardRequest(
- ['open-ils.acq', method],
- { async: true,
- params: [openils.User.authtoken],
- onresponse: handleResponse,
- oncomplete: function() {
- plAddExistingSelect.store =
- new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(plList)});
- plAddExistingSelect.setValue();
- }
- }
- );
-}
-
-
-function saveResults(values) {
- selectedLIs = resultLIs;
-
- if(values.which == 'selected') {
- selectedLIs = [];
- var selected = plResultGrid.selection.getSelected();
- for(var idx = 0; idx < selected.length; idx++) {
- var rowIdx = selected[idx];
- var id = plResultGrid.model.getRow(rowIdx).id;
- for(var i = 0; i < resultLIs.length; i++) {
- var pl = resultLIs[i];
- if(pl.id() == id) {
- selectedLIs.push(pl);
- }
- }
- }
- }
-
- if(values.new_name && values.new_name != '') {
- // save selected lineitems to a new picklist
- if(values.which = 'selected') {
- openils.acq.Picklist.create(
- {name: values.new_name},
- function(id) {
- updateLiList(id, selectedLIs, 0,
- function(){location.href = 'view/' + id});
- }
- );
- } else {
- // save all == change the name of the results picklist
- resultPicklist.name(values.new_name);
- openils.acq.Picklist.update(resultPicklist,
- function(stat) {
- location.href = 'view/' + resultPicklist.id();
- }
- );
- }
- } else if(values.existing_pl) {
- // update lineitems to use an existing picklist
- updateLiList(values.existing_pl, selectedLIs, 0,
- function(){location.href = 'view/' + values.existing_pl});
- }
-}
-
-function updateLiList(pl, list, idx, oncomplete) {
- if(idx >= list.length)
- return oncomplete();
- var li = selectedLIs[idx];
- li.picklist(pl);
- new openils.acq.Lineitem({lineitem:li}).update(
- function(r) {
- updateLiList(pl, list, ++idx, oncomplete);
- }
- );
-}
-
-dojo.addOnLoad(drawForm);
+++ /dev/null
-dojo.require('dojox.grid.Grid');
-dojo.require('dijit.Dialog');
-dojo.require('dijit.form.Button');
-dojo.require('dijit.form.TextBox');
-dojo.require('dijit.form.Button');
-dojo.require('openils.acq.Picklist');
-
-var plList = [];
-var listAll = false;
-
-function makeGridFromList() {
- var store = new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(plList)});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- plListGrid.setModel(model);
- plListGrid.update();
-}
-
-
-function loadGrid() {
-
- function handleResponse(r) {
- plList.push(r.recv().content());
- }
-
- var method = 'open-ils.acq.picklist.user.retrieve';
- if(listAll)
- method = method.replace(/user/, 'user.all');
-
- fieldmapper.standardRequest(
- ['open-ils.acq', method],
- { async: true,
- params: [openils.User.authtoken,
- {flesh_lineitem_count:1, flesh_username:1}],
- onresponse: handleResponse,
- oncomplete: makeGridFromList
- }
- );
-}
-
-function createPL(fields) {
- if(fields.name == '') return;
- openils.acq.Picklist.create(fields,
- function(plId) {
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.picklist.retrieve'],
- { async: true,
- params: [openils.User.authtoken, plId,
- {flesh_lineitem_count:1, flesh_username:1}],
- oncomplete: function(r) {
- var pl = r.recv().content();
- plList.push(pl);
- makeGridFromList();
- }
- }
- );
- }
- );
-}
-
-function deleteFromGrid() {
- var list = []
- var selected = plListGrid.selection.getSelected();
- for(var idx = 0; idx < selected.length; idx++) {
- var rowIdx = selected[idx];
- var id = plListGrid.model.getRow(rowIdx).id;
- for(var i = 0; i < plList.length; i++) {
- var pl = plList[i];
- if(pl.id() == id && pl.owner() == new openils.User().user.usrname()) {
- list.push(id);
- plList = (plList.slice(0, i) || []).concat(plList.slice(i+1, plList.length) || []);
- }
- }
- }
- openils.acq.Picklist.deleteList(list, function() { makeGridFromList(); });
-}
-
-dojo.addOnLoad(loadGrid);
-
-
+++ /dev/null
-dojo.require('fieldmapper.Fieldmapper');
-dojo.require('dijit.ProgressBar');
-dojo.require('dijit.form.Form');
-dojo.require('dijit.form.TextBox');
-dojo.require('dijit.form.CheckBox');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.form.Button');
-dojo.require("dijit.Dialog");
-dojo.require('openils.Event');
-dojo.require('openils.acq.Lineitem');
-dojo.require('openils.acq.Provider');
-dojo.require('openils.acq.PO');
-dojo.require('openils.widget.OrgUnitFilteringSelect');
-
-var recvCount = 0;
-var createAssetsSelected = false;
-var createDebitsSelected = false;
-
-var lineitems = [];
-
-function drawForm() {
- buildProviderSelect(providerSelector);
-}
-
-function buildProviderSelect(sel, oncomplete) {
- openils.acq.Provider.createStore(
- function(store) {
- sel.store = new dojo.data.ItemFileReadStore({data:store});
- if(oncomplete)
- oncomplete();
- },
- 'MANAGE_PROVIDER'
- );
-}
-
-var liReceived;
-function doSearch(values) {
- var search = {};
- for(var v in values) {
- var val = values[v];
- if(val != null && val != '')
- search[v] = val;
- }
-
- if(values.state == 'approved')
- dojo.style('oils-acq-li-search-po-create', 'visibility', 'visible');
- else
- dojo.style('oils-acq-li-search-po-create', 'visibility', 'hidden');
-
- //search = [search, {limit:searchLimit, offset:searchOffset}];
- search = [search, {}];
- options = {clear_marc:1, flesh_attrs:1};
-
- liReceived = 0;
- lineitems = [];
- dojo.style('searchProgress', 'visibility', 'visible');
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.lineitem.search'],
- { async: true,
- params: [openils.User.authtoken, search, options],
- onresponse: handleResult,
- oncomplete: viewList
- }
- );
-}
-
-function handleResult(r) {
- var result = r.recv().content();
- searchProgress.update({maximum: searchLimit, progress: ++liReceived});
- lineitems.push(result);
-}
-
-function viewList() {
- dojo.style('searchProgress', 'visibility', 'hidden');
- dojo.style('oils-acq-li-search-result-grid', 'visibility', 'visible');
- var store = new dojo.data.ItemFileWriteStore(
- {data:jub.toStoreData(lineitems, null,
- {virtualFields:['estimated_price', 'actual_price']})});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- JUBGrid.populate(liGrid, model, lineitems);
-}
-
-function createPOFromLineitems(fields) {
- var po = new acqpo();
- po.provider(newPOProviderSelector.getValue());
- createAssetsSelected = fields.create_assets;
- createDebitsSelected = fields.create_debits;
-
- if(fields.which == 'selected') {
- // find the selected lineitems
- var selected = liGrid.selection.getSelected();
- var selList = [];
- for(var idx = 0; idx < selected.length; idx++) {
- var rowIdx = selected[idx];
- var id = liGrid.model.getRow(rowIdx).id;
- for(var i = 0; i < lineitems.length; i++) {
- var li = lineitems[i];
- if(li.id() == id && !li.purchase_order() && li.state() == 'approved')
- selList.push(lineitems[i]);
- }
- }
- } else {
- selList = lineitems;
- }
-
- if(selList.length == 0) return;
-
- openils.acq.PO.create(po,
- function(poId) {
- if(e = openils.Event.parse(poId))
- return alert(e);
- updateLiList(poId, selList);
- }
- );
-}
-
-function updateLiList(poId, selList) {
- _updateLiList(poId, selList, 0);
-}
-
-function checkCreateDebits(poId) {
- if(!createDebitsSelected)
- return viewPO(poId);
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.purchase_order.debits.create'],
- { async: true,
- params: [openils.User.authtoken, poId, {encumbrance:1}],
- oncomplete : function(r) {
- var total = r.recv().content();
- if(e = openils.Event.parse(total))
- return alert(e);
- viewPO(poId);
- }
- }
- );
-}
-
-function viewPO(poId) {
- location.href = 'view/' + poId;
-}
-
-function _updateLiList(poId, selList, idx) {
- if(idx >= selList.length) {
- if(createAssetsSelected)
- return createAssets(poId);
- else
- return checkCreateDebits(poId);
- }
- var li = selList[idx];
- li.purchase_order(poId);
- li.state('in-process');
- new openils.acq.Lineitem({lineitem:li}).update(
- function(stat) {
- _updateLiList(poId, selList, ++idx);
- }
- );
-}
-
-function createAssets(poId) {
- searchProgress.update({progress: 0});
- dojo.style('searchProgress', 'visibility', 'visible');
-
- function onresponse(r) {
- var stat = r.recv().content();
- if(e = openils.Event.parse(stat))
- return alert(e);
- searchProgress.update({maximum: stat.total, progress: stat.progress});
- }
-
- function oncomplete(r) {
- dojo.style('searchProgress', 'visibility', 'hidden');
- checkCreateDebits(poId);
- }
-
- fieldmapper.standardRequest(
- ['open-ils.acq','open-ils.acq.purchase_order.assets.create'],
- { async: true,
- params: [openils.User.authtoken, poId],
- onresponse : onresponse,
- oncomplete : oncomplete
- }
- );
-}
-
-
-dojo.addOnLoad(drawForm);
-
+++ /dev/null
-dojo.require('dijit.form.Form');
-dojo.require('dijit.form.Button');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.form.NumberTextBox');
-dojo.require('dojox.grid.Grid');
-dojo.require('openils.acq.Provider');
-dojo.require('fieldmapper.OrgUtils');
-dojo.require('dojo.date.locale');
-dojo.require('dojo.date.stamp');
-dojo.require('openils.User');
-dojo.require('openils.widget.OrgUnitFilteringSelect');
-
-function getOrgInfo(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function getProvider(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return openils.acq.Provider.retrieve(data.provider).name();
-}
-
-function getPOOwner(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return new openils.User({id:data.owner}).user.usrname();
-}
-
-function getDateTimeField(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- var date = dojo.date.stamp.fromISOString(data[this.field]);
- return dojo.date.locale.format(date, {formatLength:'medium'});
-}
-
-function doSearch(fields) {
- var itemList = [];
- if(!isNaN(fields.id))
- fields = {id:fields.id};
- else
- delete fields.id;
-
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.purchase_order.search'],
- {
- async:1,
- params: [openils.User.authtoken, fields],
- onresponse : function(r) {
- var msg = r.recv();
- if(msg) itemList.push(msg.content());
- },
- oncomplete : function(r) {
- dojo.style('po-grid', 'visibility', 'visible');
- var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData(itemList)});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- poGrid.setModel(model);
- poGrid.update();
- },
- }
- );
-}
-
-function loadForm() {
-
- /* load the providers */
- openils.acq.Provider.createStore(
- function(store) {
- providerSelector.store =
- new dojo.data.ItemFileReadStore({data:store});
- },
- 'MANAGE_PROVIDER'
- );
-
- new openils.User().buildPermOrgSelector('VIEW_PURCHASE_ORDER', poSearchOrderingAgencySelect);
-}
-
-dojo.addOnLoad(loadForm);
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.layout.TabContainer');
-dojo.require('dijit.layout.ContentPane');
-dojo.require('dojox.grid.Grid');
-dojo.require('openils.acq.PO');
-dojo.require('openils.Event');
-dojo.require('openils.User');
-dojo.require('fieldmapper.OrgUtils');
-dojo.require('openils.acq.Provider');
-dojo.require('openils.acq.Lineitem');
-dojo.require('dojo.date.locale');
-dojo.require('dojo.date.stamp');
-
-var PO = null;
-var lineitems = [];
-
-function getOrgInfo(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function getProvider(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return openils.acq.Provider.retrieve(data.provider).code();
-}
-
-function getPOOwner(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return new openils.User({id:data.owner}).user.usrname();
-}
-
-function getDateTimeField(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- var date = dojo.date.stamp.fromISOString(data[this.field]);
- return dojo.date.locale.format(date, {formatLength:'medium'});
-}
-
-function loadPOGrid() {
- if(!PO) return;
- var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData([PO])});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- poGrid.setModel(model);
- poGrid.update();
-}
-
-function loadLIGrid() {
- if(liGrid.isLoaded) return;
-
- function load(po) {
- lineitems = po.lineitems();
- var store = new dojo.data.ItemFileReadStore({data:jub.toStoreData(lineitems)});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- JUBGrid.populate(liGrid, model, lineitems)
- }
-
- openils.acq.PO.retrieve(poId, load, {flesh_lineitems:1, clear_marc:1});
- liGrid.isLoaded = true;
-}
-
-function loadPage() {
- fetchPO();
-}
-
-function fetchPO() {
- openils.acq.PO.retrieve(poId,
- function(po) {
- PO = po;
- loadPOGrid();
- },
- {flesh_lineitem_count:1}
- );
-}
-
-dojo.addOnLoad(loadPage);
+++ /dev/null
-dojo.require('fieldmapper.Fieldmapper');
-dojo.require('dijit.ProgressBar');
-dojo.require('dijit.form.Form');
-dojo.require('dijit.form.TextBox');
-dojo.require('dijit.form.CheckBox');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.form.Button');
-dojo.require("dijit.Dialog");
-dojo.require('openils.Event');
-dojo.require('openils.acq.Lineitem');
-dojo.require('openils.widget.OrgUnitFilteringSelect');
-
-var lineitems = [];
-
-function drawForm() {
- new openils.User().buildPermOrgSelector('VIEW_PURCHASE_ORDER', orderingAgencySelect);
-}
-
-var liReceived;
-function doSearch(values) {
-
- var search = {
- attr_values : [values.identifier],
- po_agencies : (values.ordering_agency) ? [values.ordering_agency] : null,
- li_states : ['in-process']
- };
-
- options = {clear_marc:1, flesh_attrs:1};
- liReceived = 0;
- dojo.style('searchProgress', 'visibility', 'visible');
-
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.lineitem.search.ident'],
- { async: true,
- params: [openils.User.authtoken, search, options],
- onresponse: handleResult,
- oncomplete: viewList
- }
- );
-}
-
-var searchLimit = 10; // ?
-function handleResult(r) {
- var result = r.recv().content();
- searchProgress.update({maximum: searchLimit, progress: ++liReceived});
- lineitems.push(result);
-}
-
-function viewList() {
- dojo.style('searchProgress', 'visibility', 'hidden');
- dojo.style('oils-acq-recv-grid', 'visibility', 'visible');
- var store = new dojo.data.ItemFileWriteStore(
- {data:jub.toStoreData(lineitems, null,
- {virtualFields:['estimated_price', 'actual_price']})});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- JUBGrid.populate(liGrid, model, lineitems);
-}
-
-dojo.addOnLoad(drawForm);
-
+++ /dev/null
-dojo.require("dijit.Dialog");
-dojo.require('dijit.layout.TabContainer');
-dojo.require('dijit.layout.ContentPane');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.form.TextBox');
-dojo.require('dojox.grid.Grid');
-dojo.require("fieldmapper.OrgUtils");
-dojo.require('openils.Event');
-dojo.require('openils.User');
-dojo.require('openils.acq.LineitemAttr');
-
-var provider = null;
-var marcRegex = /^\/\/\*\[@tag="(\d+)"]\/\*\[@code="(\w)"]$/;
-var attrDefStores;
-
-
-function getOrgInfo(rowIndex) {
- data = providerGrid.model.getRow(rowIndex);
- if(!data) return;
- return fieldmapper.aou.findOrgUnit(data.owner).shortname();
-}
-
-function getTag(rowIdx) {
- data = this.grid.model.getRow(rowIdx);
- if(!data) return;
- return data.xpath.replace(marcRegex, '$1');
-}
-
-function getSubfield(rowIdx) {
- data = this.grid.model.getRow(rowIdx);
- if(!data) return;
- return data.xpath.replace(marcRegex, '$2');
-}
-
-
-function loadStores(onload) {
- if(attrDefStores)
- return onload();
- openils.acq.LineitemAttr.createAttrDefStores(
- function(stores) {
- attrDefStores = stores;
- onload();
- }
- )
-}
-
-
-function loadMarcAttrGrid() {
- loadStores(
- function() {
- var store = new dojo.data.ItemFileReadStore({data:attrDefStores.marc});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- liMarcAttrGrid.setModel(model);
- liMarcAttrGrid.update();
- }
- );
-}
-
-function loadGeneratedAttrGrid() {
- loadStores(
- function() {
- var store = new dojo.data.ItemFileReadStore({data:attrDefStores.generated});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- liGeneratedAttrGrid.setModel(model);
- liGeneratedAttrGrid.update();
- }
- );
-}
-
-/*
-function createOrderRecordField(fields) {
- fields.provider = providerId;
- if(!fields.xpath)
- fields.xpath = '//*[@tag="'+fields.tag+'"]/*[@code="'+fields.subfield+'"]';
- delete fields.tag;
- delete fields.subfield;
- openils.acq.Provider.createLineitemProviderAttrDef(fields,
- function(id) {
- loadPADGrid();
- }
- );
-}
-
-function setORDesc() {
- var code = dijit.byId('oils-acq-provider-or-code');
- var desc = dijit.byId('oils-acq-provider-or-desc');
- desc.setValue(code.getDisplayedValue());
-}
-
-function deleteORDataFields() {
- var list = []
- var selected = padGrid.selection.getSelected();
- for(var idx = 0; idx < selected.length; idx++)
- list.push(padGrid.model.getRow(selected[idx]).id);
- openils.acq.Provider.lineitemProviderAttrDefDeleteList(
- list, function(){loadPADGrid();});
-}
-*/
-
-
-//dojo.addOnLoad(loadLIAttrGrid);
-
-
+++ /dev/null
-dojo.require('dojo.data.ItemFileReadStore');
-dojo.require('dijit.layout.SplitContainer');
-dojo.require('dijit.Dialog');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.form.Button');
-dojo.require('dojox.grid.Grid');
-dojo.require('dojo.date.locale');
-dojo.require('dojo.date.stamp');
-
-
-dojo.require("openils.User");
-dojo.require("openils.acq.Fund");
-dojo.require("openils.acq.Lineitem");
-dojo.require('openils.acq.Provider');
-dojo.require("openils.widget.FundSelector");
-dojo.require('openils.editors');
-dojo.require('openils.Event');
-dojo.require("openils.widget.OrgUnitFilteringSelect");
-dojo.require("fieldmapper.OrgUtils");
-
-var globalUser = new openils.User();
-
-/* put all the accessors, etc. into a local object for namespacing */
-var JUBGrid = {
- jubGrid : null,
- lineitems : [], // full list of lineitem objects to display
- getLi : function(id) {
- // given an ID, returns the lineitem object from the list
- for(var i in JUBGrid.lineitems) {
- var li = JUBGrid.lineitems[i];
- if(li.id() == id)
- return li;
- }
- },
-
- _getMARCAttr : function(rowIndex, attr) {
- var data = JUBGrid.jubGrid.model.getRow(rowIndex);
- if (!data) return '';
- return new openils.acq.Lineitem(
- {lineitem:JUBGrid.getLi(data.id)}).findAttr(attr, 'lineitem_marc_attr_definition')
- },
- getJUBTitle : function(rowIndex) {
- return JUBGrid._getMARCAttr(rowIndex, 'title');
- },
- getJUBAuthor : function(rowIndex) {
- return JUBGrid._getMARCAttr(rowIndex, 'author');
- },
- getJUBIsbn : function(rowIndex) {
- return JUBGrid._getMARCAttr(rowIndex, 'isbn');
- },
- getJUBActualPrice : function(rowIndex) {
- var data = JUBGrid.jubGrid.model.getRow(rowIndex);
- if (!data) return '';
- var price = new openils.acq.Lineitem(
- {lineitem:JUBGrid.getLi(data.id)}).getActualPrice();
- if(price) return price.price;
- return ''
- },
- getJUBEstimatedPrice : function(rowIndex) {
- var data = JUBGrid.jubGrid.model.getRow(rowIndex);
- if (!data) return '';
- var price = new openils.acq.Lineitem(
- {lineitem:JUBGrid.getLi(data.id)}).getEstimatedPrice();
- if(price) return price.price;
- return ''
- },
- getJUBPubdate : function(rowIndex) {
- return JUBGrid._getMARCAttr(rowIndex, 'pubdate');
- },
- getProvider : function(rowIndex) {
- data = JUBGrid.jubGrid.model.getRow(rowIndex);
- if(!data || !data.provider) return;
- return openils.acq.Provider.retrieve(data.provider).code();
- },
- getRecvTime : function(rowIndex) {
- var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
- if (!(data && data.recv_time)) return '';
- var date = dojo.date.stamp.fromISOString(data.recv_time);
- return dojo.date.locale.format(date, {formatLength:'medium'});
- },
- getCopyLocation : function(rowIndex) {
- var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
- if(!data || !data.location) return '';
- return openils.CopyLocation.retrieve(data.location).name();
- },
- getLIDFundName : function(rowIndex) {
- var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
- if (!data || !data.fund) return;
- try {
- return openils.acq.Fund.retrieve(data.fund).name();
- } catch (evt) {
- return data.fund;
- }
- },
- getLIDFundCode : function(rowIndex) {
- var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
- if (!data || !data.fund) return;
- try {
- return openils.acq.Fund.retrieve(data.fund).code();
- } catch (evt) {
- return data.fund;
- }
- },
- getLIDLibName : function(rowIndex) {
- var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
- if (!data || !data.owning_lib) return;
- return fieldmapper.aou.findOrgUnit(data.owning_lib).shortname();
- },
-
- gridDataChanged : function(newVal, rowIdx, cellIdx) {
- // cellIdx == -1 if you are editing a column that
- // is not represented in the data model. Khaaaaaaan!!!
- },
-
- populate : function(gridWidget, model, lineitems) {
- for (var i in lineitems) {
- JUBGrid.lineitems[lineitems[i].id()] = lineitems[i];
- }
- JUBGrid.jubGrid = gridWidget;
- JUBGrid.jubGrid.setModel(model);
- if(JUBGrid.showDetails) {
- dojo.connect(gridWidget, "onRowClick",
- function(evt) {
- var jub = model.getRow(evt.rowIndex);
- var grid;
-
- JUBGrid.jubDetailGrid.lineitemID = jub.id;
-
- //if (jub.state == "approved") {
- if (false) { // need finer grained control here
- grid = JUBGrid.jubDetailGridLayoutReadOnly;
- } else {
- grid = JUBGrid.jubDetailGridLayout;
- }
- openils.acq.Lineitem.loadLIDGrid(
- JUBGrid.jubDetailGrid,
- JUBGrid.jubGrid.model.getRow(evt.rowIndex).id, grid);
- }
- );
- }
- // capture changes to lineitems
- dojo.connect(model.store, "onSet", JUBGrid.onJUBSet);
- gridWidget.update();
- },
-
- approveJUB: function(evt) {
- var list = [];
- var selected = JUBGrid.jubGrid.selection.getSelected();
- for (var idx = 0; idx < selected.length; idx++) {
- var rowIdx = selected[idx];
- JUBGrid.approveSingleJUB(JUBGrid.jubGrid.model.getRow(rowIdx));
- }
- },
-
- approveSingleJUB: function(jub) {
- var li = new openils.acq.Lineitem({lineitem:JUBGrid.getLi(jub.id)});
- var approveStore = function(evt) {
- if (evt) {
- // something bad happened
- console.log("jubgrid.js: approveJUB: error:");
- console.dir(evt);
- alert("Error: "+evt.desc);
- } else {
- var approveACQLI = function(jub, rq) {
- JUBGrid.jubGrid.model.store.setValue(jub, "state", "approved");
- JUBGrid.jubGrid.model.refresh();
- JUBGrid.jubGrid.update();
- // Reload lineitem details, read-only
- //openils.acq.Lineitem.loadLIDGrid(JUBGrid.jubDetailGrid, li.id(), JUBGrid.jubDetailGridLayout);
- //JUBGrid.jubDetailGridLayoutReadOnly);
- };
- JUBGrid.jubGrid.model.store.fetch({query:{id:jub.id}, onItem: approveACQLI});
- }
- };
-
- li.approve(approveStore);
- },
-
-
- removeSelectedJUBs: function(evt) {
-
- function deleteList(list, idx, oncomplete) {
- if(idx >= list.length)
- return oncomplete();
- fieldmapper.standardRequest([
- 'open-ils.acq',
- 'open-ils.acq.lineitem.delete'],
- { async: true,
- params: [openils.User.authtoken, list[idx].id()],
- oncomplete: function(r) {
- var res = r.recv().content();
- if(openils.Event.parse(res))
- alert(openils.Event.parse(res));
- deleteList(list, ++idx, oncomplete);
- }
- }
- );
- }
-
- var lineitems = JUBGrid.lineitems;
- var deleteMe = [];
- var keepMe = [];
- var selected = JUBGrid.jubGrid.selection.getSelected();
-
- for(var id in lineitems) {
- var deleted = false;
- for(var i = 0; i < selected.length; i++) {
- var rowIdx = selected[i];
- var jubid = JUBGrid.jubGrid.model.getRow(rowIdx).id;
- if(jubid == id) {
- if (lineitems[id].state() == 'new') {
- deleteMe.push(lineitems[id]);
- deleted = true;
- } else {
- alert("Can not delete line item "+id+
- ": item is "+lineitems[id].state());
- }
- }
- }
- if(!deleted)
- keepMe[id] = lineitems[id];
- }
-
- JUBGrid.lineitems = keepMe;
- deleteList(deleteMe, 0, function(){
- JUBGrid.jubGrid.model.store =
- new dojo.data.ItemFileReadStore({data:jub.toStoreData(keepMe)});
- JUBGrid.jubGrid.model.refresh();
- JUBGrid.jubGrid.update();
- });
- },
-
- deleteLID: function(evt) {
- var list =[];
- var selected = JUBGrid.jubDetailGrid.selection.getSelected();
- for (var idx = 0; idx < selected.length; idx++) {
- var rowIdx = selected[idx];
- var lid = JUBGrid.jubDetailGrid.model.getRow(rowIdx);
- var deleteFromStore = function (evt) {
-
- if (evt) {
- // something bad happened
- alert("Error: "+evt.desc);
- } else {
- var deleteItem = function(item, rq) {
- JUBGrid.jubDetailGrid.model.store.deleteItem(item);
- };
- var updateCount = function(item) {
- var newval = JUBGrid.jubGrid.model.store.getValue(item, "item_count");
- JUBGrid.jubGrid.model.store.setValue(item, "item_count", newval-1);
- JUBGrid.jubGrid.update();
- };
-
- JUBGrid.jubDetailGrid.model.store.fetch({query:{id:lid.id},
- onItem: deleteItem});
- JUBGrid.jubGrid.model.store.fetch({query:{id:JUBGrid.jubDetailGrid.lineitemID},
- onItem: updateCount});
- }
- JUBGrid.jubDetailGrid.update();
- };
-
- openils.acq.Lineitem.deleteLID(lid.id, deleteFromStore);
- }
- },
-
- createLID: function(fields) {
- fields['lineitem'] = JUBGrid.jubDetailGrid.lineitemID;
- var addToStore = function (lid) {
- JUBGrid.jubDetailGrid.model.store.newItem(acqlid.toStoreData([lid]).items[0]);
- JUBGrid.jubDetailGrid.refresh();
- JUBGrid.jubGrid.update();
- JUBGrid.jubGrid.refresh();
- }
- openils.acq.Lineitem.createLID(fields, addToStore);
- },
-
- receiveLID: function(evt) {
- var list =[];
- var selected = JUBGrid.jubDetailGrid.selection.getSelected();
- for (var idx = 0; idx < selected.length; idx++) {
- var rowIdx = selected[idx];
- var lid = JUBGrid.jubDetailGrid.model.getRow(rowIdx);
- list.push(lid.id);
- }
- if(lid != null) { // is at least one selected?
- JUBGrid._receiveLIDList(list, 0,
- function() {
- delete openils.acq.Lineitem.ModelCache[lid.lineitem];
- openils.acq.Lineitem.loadLIDGrid(
- JUBGrid.jubDetailGrid, lid.lineitem, JUBGrid.jubDetailGridLayout);
- }
- );
- }
- },
-
- // loop through the list of LIDs and mark them as received
- _receiveLIDList: function(list, idx, callback) {
- if(idx >= list.length)
- return callback();
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.lineitem_detail.receive'],
- { asnync: true,
- params: [openils.User.authtoken, list[idx++]],
- oncomplete: function(r) {
- var res = r.recv().content();
- if(e = openils.Event.parse(res))
- return alert(e);
- JUBGrid._receiveLIDList(list, idx, callback);
- }
- }
- );
- },
-
-
- // called when a lineitem is edited
- onJUBSet: function (griditem, attr, oldVal,newVal) {
- var item;
-
- var updateDone = function(r) {
- var stat = r.recv().content();
- if(e = openils.Event.parse(stat))
- console.dir(e);
- };
-
- // after an attribute has been updated
- var attrUpdateDone = function(r, attr) {
- var res = r.recv().content();
- if(e = openils.Event.parse(res))
- return alert(e);
-
- var oldVal = new openils.acq.Lineitem(
- {lineitem:item}).findAttr(attr, 'lineitem_local_attr_definition');
-
- if(oldVal) {
- // if this attr already exists on the object, just update the value
- for(var i = 0; i < item.attributes().length; i++) {
- var attrobj = item.attributes()[i];
- if(attrobj.attr_type() == 'lineitem_local_attr_definition' && attrobj.attr_name() == attr) {
- attrobj.attr_value(newVal);
- }
- }
- } else {
- // if this is a new attribute, create a new object to match reality
- liad = new acqlia();
- liad.attr_type('lineitem_local_attr_definition');
- liad.attr_value(newVal);
- liad.attr_name(attr);
- liad.id(res);
- item.attributes().push(liad);
- }
- }
-
- if (oldVal == newVal) {
- return;
- }
-
- item = JUBGrid.lineitems[griditem.id];
- if (attr == "provider") {
- if(newVal == '')
- newVal = null;
- item.provider(newVal);
-
- } else if(attr == 'estimated_price' || attr == 'actual_price') {
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.lineitem_local_attr.set'],
- { async: true,
- params: [openils.User.authtoken, item.id(), attr, newVal],
- oncomplete: function(r) {attrUpdateDone(r, attr); }
- }
- );
- } else {
- //alert("Unexpected attr in Picklist.onSet: '"+attr+"'");
- return;
- }
-
- fieldmapper.standardRequest(
- ["open-ils.acq", "open-ils.acq.lineitem.update"],
- {params: [openils.User.authtoken, item],
- oncomplete: updateDone
- }
- );
- },
-};
-
+++ /dev/null
-<xsl:stylesheet version="1.0" xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc" xmlns="http://open-ils.org/spec/opensrf/ACQ/bibdata/v1">
- <xsl:output method="xml" indent="yes"/>
-
- <xsl:template match="/">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="marc:record">
- <bibdata>
-
- <!-- language -->
- <xsl:choose>
- <xsl:when test="marc:datafield[@tag='240']/marc:subfield[@code='l']">
- <xsl:for-each select="marc:datafield[@tag='240']/marc:subfield[@code='l']">
- <language><xsl:value-of select="."/></language>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="marc:datafield[@tag='041']/marc:subfield[@code='a']">
- <xsl:for-each select="marc:datafield[@tag='041']/marc:subfield[@code='a'][1]">
- <language><xsl:value-of select="."/></language>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="//marc:controlfield[@tag='008']">
- <language><xsl:value-of select="substring(//marc:controlfield[@tag='008']/text(),36,3)"/></language>
- </xsl:when>
- </xsl:choose>
-
- <!-- title -->
- <xsl:for-each select="marc:datafield[@tag='245'][1]">
- <title>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">abcmnopr</xsl:with-param>
- </xsl:call-template>
- </title>
-
- <xsl:if test="marc:subfield[@code='k']">
- <forms>
- <xsl:for-each select="marc:subfield[@code='k']">
- <form><xsl:value-of select="."/></form>
- </xsl:for-each>
- </forms>
- </xsl:if>
-
- <xsl:for-each select="marc:subfield[@code='h']">
- <medium><xsl:value-of select="."/></medium>
- </xsl:for-each>
- </xsl:for-each>
-
- <!-- author -->
- <xsl:for-each select="marc:datafield[@tag='100' or @tag='110' or @tag='113']">
- <author>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">ad</xsl:with-param>
- </xsl:call-template>
- </author>
- </xsl:for-each>
-
- <!-- publisher -->
- <xsl:for-each select="marc:datafield[@tag='260']">
- <publisher>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">b</xsl:with-param>
- </xsl:call-template>
- </publisher>
- </xsl:for-each>
-
- <!-- pubdate -->
- <xsl:for-each select="marc:datafield[@tag='260']">
- <pubdate>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">c</xsl:with-param>
- </xsl:call-template>
- </pubdate>
- </xsl:for-each>
-
- <!-- edition -->
- <xsl:for-each select="marc:datafield[@tag='250']">
- <edition>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">a</xsl:with-param>
- </xsl:call-template>
- </edition>
- </xsl:for-each>
-
- <!-- pagination -->
- <xsl:for-each select="marc:datafield[@tag='300']">
- <pagination>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">a</xsl:with-param>
- </xsl:call-template>
- </pagination>
- </xsl:for-each>
-
- <!-- physicalSize -->
- <xsl:for-each select="marc:datafield[@tag='300']">
- <physicalSize>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">c</xsl:with-param>
- </xsl:call-template>
- </physicalSize>
- </xsl:for-each>
-
- <!-- isbn -->
- <xsl:for-each select="marc:datafield[@tag='020']">
- <isbns>
- <xsl:for-each select=".">
- <isbn>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">a</xsl:with-param>
- </xsl:call-template>
- </isbn>
- </xsl:for-each>
- </isbns>
- </xsl:for-each>
-
- <!-- issn -->
- <xsl:for-each select="marc:datafield[@tag='022']">
- <issns>
- <xsl:for-each select=".">
- <issn>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">a</xsl:with-param>
- </xsl:call-template>
- </issn>
- </xsl:for-each>
- </issns>
- </xsl:for-each>
-
- <!-- price -->
- <xsl:for-each select="marc:datafield[(@tag='020' or @tag='022') and marc:subfield[@code='c']][1]">
- <price>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">c</xsl:with-param>
- </xsl:call-template>
- </price>
- </xsl:for-each>
-
- </bibdata>
- </xsl:template>
-
- <xsl:template name="subfieldSelect">
- <xsl:param name="codes"/>
- <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
- <xsl:variable name="str">
- <xsl:for-each select="marc:subfield">
- <xsl:if test="contains($codes, @code)">
- <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html"/>
-
- <xsl:template match="/">
- <div>
- <style>
- .marc_table {}
- .marc_tag_row {}
- .marc_tag_data {}
- .marc_tag_col {}
- .marc_tag_ind {}
- .marc_subfields {}
- .marc_subfield_code {
- color: blue;
- padding-left: 5px;
- padding-right: 5px;
- }
- </style>
- <xsl:apply-templates/>
- </div>
- </xsl:template>
-
- <xsl:template match="marc:record">
- <table class='marc_table'>
- <tr class='marc_tag_row'>
- <th class='marc_tag_col' NOWRAP="TRUE" ALIGN="RIGHT" VALIGN="middle">
- LDR
- </th>
- <td class='marc_tag_data' COLSPAN='3'>
- <xsl:value-of select="marc:leader"/>
- </td>
- </tr>
- <xsl:apply-templates select="marc:datafield|marc:controlfield"/>
- </table>
- </xsl:template>
-
- <xsl:template match="marc:controlfield">
- <tr class='marc_tag_row'>
- <th class='marc_tag_col' NOWRAP="TRUE" ALIGN="RIGHT" VALIGN="middle">
- <xsl:value-of select="@tag"/>
- </th>
- <td class='marc_tag_data' COLSPAN='3'>
- <xsl:value-of select="."/>
- </td>
- </tr>
- </xsl:template>
-
- <xsl:template match="marc:datafield">
- <tr class='marc_tag_row'>
- <th class='marc_tag_col' NOWRAP="TRUE" ALIGN="RIGHT" VALIGN="middle">
- <xsl:value-of select="@tag"/>
- </th>
- <td class='marc_tag_ind'>
- <xsl:value-of select="@ind1"/>
- </td>
-
- <td class='marc_tag_ind' style='border-left: 1px solid #A0A0A0; padding-left: 3px;'>
- <xsl:value-of select="@ind2"/>
- <span style='color:#FFF'>.</span>
- </td>
-
- <td class='marc_subfields'>
- <xsl:apply-templates select="marc:subfield"/>
- </td>
- </tr>
- </xsl:template>
-
- <xsl:template match="marc:subfield">
- <span class='marc_subfield_code' >
- ‡<xsl:value-of select="@code"/>
- </span><xsl:value-of select="."/>
- </xsl:template>
-
-</xsl:stylesheet>
-
-<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
-<metaInformation>
-<scenarios ><scenario default="no" name="Ray Charles" userelativepaths="yes" externalpreview="no" url="..\xml\MARC21slim\raycharles.xml" htmlbaseurl="" outputurl="" processortype="internal" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/><scenario default="yes" name="s7" userelativepaths="yes" externalpreview="no" url="..\ifla\sally7.xml" htmlbaseurl="" outputurl="" processortype="internal" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
-</metaInformation>
--->
+++ /dev/null
-# -*- coding: utf-8 -*-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!-- This file defines the most basic requirements of an XHTML block -->
-
-<% locale = 'en-US' %> <!-- XXX GET LOCALE FROM PYTHON -->
-<html xmlns='http://www.w3.org/1999/xhtml' lang='${locale}' xml:lang='${locale}'>
- ${self.block_head()}
- ${self.block_body()}
-</html>
-
-<%def name='block_head()'> <!-- haha.. blockhead -->
- <!-- Construct a sane default HTML head -->
- <head>
- <%def name="page_title()">${_('Evergreen')}</%def>
- <title>${self.page_title()}</title>
- ${self.block_css()}
- ${self.block_js()}
- </head>
-</%def>
-
-<%def name='block_body()'>
- <body class='${self.body_css()}'>${self.block_body_content()}</body>
-</%def>
-<%def name='block_body_content()'/>
-<%def name='body_css()'/>
-
-<%def name='block_css()'>
- <link rel='stylesheet' type='text/css'
- href='${c.oils.core.media_prefix.value}/css/skin/${c.oils.core.skin.value}.css'/>
- <link rel='stylesheet' type='text/css'
- href='${c.oils.core.media_prefix.value}/css/theme/${c.oils.core.theme.value}.css'/>
-</%def>
-<%def name='block_js()'>
- <script type="text/javascript" src="${c.oils.core.media_prefix.value}/js/dojo/dojo/dojo.js"
- djConfig="parseOnLoad: true"></script>
- <script src='${c.oils.core.media_prefix.value}/ui_js/oils/base.js'> </script>
-
- <script type="text/javascript">
- dojo.require("dojo.parser");
- /* import ILS object definitions */
- dojo.require("fieldmapper.Fieldmapper");
- </script>
-
- <script type='text/javascript'>
- <% import pylons %>
- var username = null;
- var password = null;
- % if 'oils_demo_user' in pylons.config:
- username = '${pylons.config.get("oils_demo_user")}';
- password = '${pylons.config.get("oils_demo_password")}';
- % endif
- dojo.addOnLoad(function(){loadUser(username, password);});
- </script>
-</%def>
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
-<%def name='block_navigate()'>
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('Currency Types')}</%def>
-<%def name="block_content()">
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('Currency Types')}</div>
-</div>
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_currency_types.js'> </script>
-
-<script type="text/javascript">
- function createCT(fields) {
- alert('create: ' + fields.code);
- }
-</script>
-
-<div class='oils-acq-actions-div'>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('New Currency Type')}</span>
-
- <div dojoType="dijit.TooltipDialog" execute="createCT(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- // XXX check perm and disable button if necessary ...
- //globalUser.buildPermOrgSelector('ADMIN_CURRENCY_TYPE', currencyTypeOwnerSelect);
- </script>
-
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="label">${_('Label:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="label"></td>
- </tr>
- <tr>
- <td><label for="name">${_('Code:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="code"></td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Create')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <button dojoType="dijit.form.Button" onclick="deleteSelectedCT()">
- ${_('Delete Selected')}
- </button>
-</div>
-
-<!-- The main grid lives here -->
-<script>
- var currencyTypeListGridStructure = [{
- cells : [[
- {name: '${_("Code")}', field:'code'},
- {name: '${_("Label")}', field:'label', width:'auto'}
- ]]
- }];
-</script>
-<div jsId='currencyTypeListGrid' dojoType="dojox.Grid" structure='currencyTypeListGridStructure'></div>
-
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('Funding Sources')}</%def>
-<%def name="block_content()">
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('Funding Sources')}</div>
-</div>
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_funding_sources.js'> </script>
-
-<script type="text/javascript">
- function createFS(fields) {
- /** Creates a new funding source */
- openils.acq.FundingSource.create(
- fields,
- function(fsId) {
- var evt = openils.Event.parse(fsId);
- if(evt) {
- alert(evt); /* XXX */
- return;
- } else {
- location.href = /* go to the details page for this fs */
- '${c.oils.acq.prefix.value}/funding_source/view/'+fsId;
- }
- }
- );
- }
-</script>
-
-<div class='oils-acq-actions-div'>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('New Funding Source')}</span>
-
- <div dojoType="dijit.TooltipDialog" execute="createFS(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- openils.acq.CurrencyType.loadSelectWidget(fsCurrencySelector);
- new openils.User().buildPermOrgSelector('ADMIN_FUNDING_SOURCE', fsOwnerSelect);
- </script>
-
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="name">${_('Name:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="name"></td>
- </tr>
- <tr>
- <td><label for="name">${_('Code:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="code"></td>
- </tr>
- <tr>
- <td><label for="currency_type">${_('Currency Type:')}</label></td>
- <td>
- <input jsId='fsCurrencySelector' name="currency_type"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </input>
- </td>
- </tr>
- <tr>
- <td valign='top'><label for="owner">${_('Owning Location:')}</label></td>
- <td>
- <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fsOwnerSelect'
- searchAttr="shortname" name="owner" autocomplete="true" labelAttr='shortname'> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Create')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <button dojoType="dijit.form.Button"
- onclick="openils.acq.FundingSource.deleteFromGrid(
- fundingSourceListGrid, function(){location.href = location.href})">
- ${_('Delete Selected')}
- </button>
-</div>
-
-<!-- The main grid lives here -->
-<script>
- function getName(rowIndex) {
- data = fundingSourceListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/funding_source/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var fsGridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', width:'auto', get:getName},
- {name: '${_("Code")}', field:'code'},
- {name: '${_("Owner")}', width:'auto', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"},
- {name: '${_("Balance")}', get:getBalanceInfo}
- ]]
- }];
-</script>
-<div id="oils-acq-funding-source-list-grid" jsId='fundingSourceListGrid' dojoType="dojox.Grid" structure='fsGridStructure'></div>
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('Funds')}</%def>
-<%def name="block_content()">
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('Funds')}</div>
-</div>
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_funds.js'> </script>
-
-<script type="text/javascript">
- function createFund(fields) {
- /** Creates a new fund source */
- openils.acq.Fund.create(
- fields,
- function(fundId) {
- var evt = openils.Event.parse(fundId);
- if(evt) {
- alert(evt); /* XXX */
- return;
- } else {
- location.href = /* go to the details page for this fund */
- '${c.oils.acq.prefix.value}/fund/view/'+fundId;
- }
- }
- );
- }
-</script>
-
-<div class='oils-acq-actions-div'>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('New Fund')}</span>
-
- <div dojoType="dijit.TooltipDialog" execute="createFund(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- openils.acq.CurrencyType.loadSelectWidget(fundCurrencySelector);
- new openils.User().buildPermOrgSelector('ADMIN_FUND', fundOwnerSelect);
- </script>
-
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="name">${_('Name:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="name"></td>
- </tr>
- <tr>
- <td><label for="name">${_('Code:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="code"></td>
- </tr>
- <tr>
- <td><label for="year">${_('Year:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="year"></td>
- </tr>
- <tr>
- <td><label for="currency_type">${_('Currency Type:')}</label></td>
- <td>
- <input jsId='fundCurrencySelector' name="currency_type"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </input>
- </td>
- </tr>
- <tr>
- <td valign='top'><label for="org">${_('Owning Location:')}</label></td>
- <td>
- <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fundOwnerSelect'
- searchAttr="shortname" name="org" autocomplete="true" labelAttr='shortname'> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Create')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <button dojoType="dijit.form.Button"
- onclick="openils.acq.Fund.deleteFromGrid(
- fundListGrid, function(){location.href = location.href})">
- ${_('Delete Selected')}
- </button>
-
- <label>${_('Year')}</label>
- <select dojoType='dijit.form.FilteringSelect' onchange='filterGrid();' style='width:100px;'
- jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
-</div>
-
-<!-- The main grid lives here -->
-<script>
- function getName(rowIndex) {
- data = fundListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/fund/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var fundListGridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', width:'auto', get:getName},
- {name: '${_("Code")}', field:'code'},
- {name: '${_("Year")}', field: "year"},
- {name: '${_("Location")}', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"},
- {name: '${_("Combined Balance")}', get:getBalanceInfo}
- ]]
- }];
-</script>
-<div jsId='fundListGrid' dojoType="dojox.Grid" structure='fundListGridStructure'></div>
-
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('Providers')}</%def>
-<%def name="block_content()">
-
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/list_providers.js'> </script>
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('Providers')}</div>
-</div>
-
-<div class='oils-acq-actions-div'>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('New Provider')}</span>
-
- <div dojoType="dijit.TooltipDialog" execute="createProvider(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- openils.acq.CurrencyType.loadSelectWidget(providerCurrencySelector);
- new openils.User().buildPermOrgSelector('ADMIN_PROVIDER', providerOwnerSelect);
- </script>
-
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="name">${_('Name:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="name"></td>
- </tr>
- <tr>
- <td><label for="code">${_('Code:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="code"></td>
- </tr>
- <tr>
- <td><label for="currency_type">${_('Currency Type:')}</label></td>
- <td>
- <input jsId='providerCurrencySelector' name="currency_type"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </input>
- </td>
- </tr>
- <tr>
- <td valign='top'><label for="owner">${_('Owning Location:')}</label></td>
- <td>
- <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='providerOwnerSelect'
- searchAttr="shortname" name="owner" autocomplete="true" labelAttr='shortname'> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Create')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-
-
-
-
-<!-- The main grid lives here -->
-<script>
- function getName(rowIndex) {
- data = providerListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/provider/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var providerGridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', get:getName, width:'auto'},
- {name: '${_("Code")}', field:'code'},
- {name: '${_("Owner")}', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"}
- ]]
- }];
-</script>
-<div jsId='providerListGrid' dojoType="dojox.Grid" structure='providerGridStructure'></div>
-
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('View Fund')}</%def>
-<%def name="block_content()">
-
-<script>
- var fundID = ${c.oils.acq.fund_id};
- function getFundingSource(rowIndex) {
- data = fundAllocationGrid.model.getRow(rowIndex);
- if(data) {
- var fs = openils.acq.FundingSource.retrieve(data.funding_source);
- return '<a href="${c.oils.acq.prefix.value}/funding_source/view/'+fs.id()+'">'+fs.name()+'</a>';
- }
- }
-</script>
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/view_fund.js'> </script>
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('Fund Details')}</div>
-</div>
-
-<div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
- <!-- Dropdown menu for creating a new funding source credit -->
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Create Allocation')}</span>
- <div dojoType="dijit.TooltipDialog" execute="createAllocation(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- openils.acq.FundingSource.createStore(
- function(store) {
- fundingSourceSelector.store =
- new dojo.data.ItemFileReadStore({data:store});
- fundingSourceSelector.setValue(store.items[0].code);
- }, 'MANAGE_FUNDING_SOURCE'
- );
- </script>
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="amount">${_('Funding Source:')} </label></td>
- <td>
- <input jsId='fundingSourceSelector' name="funding_source"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </input>
- </td>
- </tr>
- <tr>
- <td><label for="amount">${_('Amount:')} </label></td>
- <td>
- <!-- XXX get currency from funding source ... -->
- <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
- </td>
- </tr>
- <tr>
- <td><label for="amount">${_('Percent:')} </label></td>
- <td>
- <input
- dojoType="dijit.form.NumberTextBox"
- constraints="{min:0,max:100}"
- promptMessage="${_('Please enter an amount between 0 and 100')}"
- name="percent">
- </input>
- </td>
- </tr>
- <tr>
- <td><label for="note">${_('Note:')} </label></td>
- <td>
- <input dojoType="dijit.form.TextBox" name="note"> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Apply')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
- <div dojoType="dijit.layout.TabContainer">
- <div dojoType="dijit.layout.ContentPane"
- class='oils-acq-detail-content-pane' title="${_('Summary')}" selected='true'>
- <script>
- /** Define the columns for the fund grid ----- */
- var fundGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', field: "name", width:'auto'},
- {name: '${_("Code")}', field: "code"},
- {name: '${_("Currency Type")}', field: "currency_type"},
- {name: '${_("Owner")}', get:getOrgInfo},
- /*
- {name: '${_("Balance (Total - (Spent + Encumbrances))")}', get:getSummaryInfo},
- {name: '${_("Amount Allocated to this Fund")}', get:getSummaryInfo},
- {name: '${_("Spent Balance (Total - Spent)")}', get:getSummaryInfo},
- {name: '${_("Total Debits (Spent + Encumbered)")}', get:getSummaryInfo},
- */
- {name: '${_("Balance")}', get:getSummaryInfo, field:'combined_balance'},
- {name: '${_("Total Allocated")}', get:getSummaryInfo, field:'allocation_total'},
- {name: '${_("Spent Balance")}', get:getSummaryInfo, field:'spent_balance'},
- {name: '${_("Total Debits")}', get:getSummaryInfo, field:'debit_total'},
- {name: '${_("Total Spent")}', get:getSummaryInfo, field:'spent_total'},
- {name: '${_("Total Encumbered")}', get:getSummaryInfo, field:'encumbrance_total'}
- ]]
- }];
- </script>
- <div jsId='fundGrid' dojoType="dojox.Grid" structure='fundGridLayout'> </div>
- </div>
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Allocations')}">
- <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
- <script>
- /** Define the columns for the funding source allocations grid ----- */
- var fundAllocationGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Funding Source")}', field: "fund", get:getFundingSource},
- {name: '${_("Amount")}', field: "amount"},
- {name: '${_("Percent")}', field: "percent"},
- {name: '${_("Allocated By")}', field: "allocator"},
- {name: '${_("Note")}', field: "note", width:'auto'},
- ]]
- }];
- </script>
- <div jsId='fundAllocationGrid' dojoType="dojox.Grid" structure='fundAllocationGridLayout'> </div>
- </div>
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Debits')}">
- <script type='dojo/connect' event='onShow'>loadDebitGrid();</script>
- <script>
- /** Define the columns for the funding source credits grid ----- */
- var fundDebitGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Origin Amount")}', field: "origin_amount"},
- {name: '${_("Origin Currency Type")}', field: "origin_currency_type"},
- {name: '${_("Amount")}', field: "amount"},
- {name: '${_("Encumbrance")}', field: "encumbrance"},
- {name: '${_("Debit Type")}', field: "debit_type"},
- {name: '${_("Transfer Destination")}', field: "xfer_destination", get:getXferDest},
- ]]
- }];
- </script>
- <div jsId='fundDebitGrid' dojoType="dojox.Grid" structure='fundDebitGridLayout'> </div>
- </div>
- </div>
-</div>
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%namespace file='../../common/widgets.html' name='widget'/>
-<%def name="page_title()">${_('View Funding Source')}</%def>
-<%def name="block_content()">
-
-<script>
- var fundingSourceID = ${c.oils.acq.funding_source_id};
- function getFund(rowIndex) {
- data = fsAllocationGrid.model.getRow(rowIndex);
- if(data) {
- var fund = openils.acq.Fund.retrieve(data.fund);
- return '<a href="${c.oils.acq.prefix.value}/fund/view/'+fund.id()+'">'+fund.code()+'</a>';
- }
- }
-</script>
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/view_funding_source.js'> </script>
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('Funding Source Details')}</div>
-</div>
-
-<div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
-
- <!-- Dropdown menu for creating a new funding source credit -->
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Apply Credit')}</span>
- <div dojoType="dijit.TooltipDialog" execute="applyFSCredit(arguments[0]);">
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="amount">${_('Amount:')} </label></td>
- <td>
- <!-- XXX get currency from funding source ... -->
- <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
- </td>
- </tr>
- <tr>
- <td><label for="note">${_('Note:')} </label></td>
- <td>
- <input dojoType="dijit.form.TextBox" name="note"> </input>
- <!-- XXX textarea makes more sense, but it's buggy in the dropdown dialog .. perhaps a height issue?
- <textarea dojoType='dijit.form.Textarea' name="note" style='min-height:6em'>
- </textarea>
- -->
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Apply')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Allocate to Fund')}</span>
- <div dojoType="dijit.TooltipDialog" execute="applyFSAllocation(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- openils.acq.Fund.createStore(
- function(store) {
- fundingSourceFundSelector.store =
- new dojo.data.ItemFileReadStore({data:store});
- fundingSourceFundSelector.setValue(store.items[0].code);
- }, 'MANAGE_FUND'
- );
- </script>
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="amount">${_('Fund:')} </label></td>
- <td>
- <input jsId='fundingSourceFundSelector' name="fund"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </input>
- </td>
- </tr>
- <tr>
- <td><label for="amount">${_('Amount:')} </label></td>
- <td>
- <!-- XXX get currency from funding source ... -->
- <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
- </td>
- </tr>
- <tr>
- <td><label for="amount">${_('Percent:')} </label></td>
- <td>
- <input
- dojoType="dijit.form.NumberTextBox"
- constraints="{min:0,max:100}"
- promptMessage="${_('Please enter an amount between 0 and 100')}"
- name="percent">
- </input>
- </td>
- </tr>
- <tr>
- <td><label for="note">${_('Note:')} </label></td>
- <td>
- <input dojoType="dijit.form.TextBox" name="note"> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Apply')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
- <div dojoType="dijit.layout.TabContainer">
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Summary')}" selected='true'>
- <script type='dojo/connect' event='onShow'>loadFSGrid();</script>
- <script>
- /** Define the columns for the funding source grid ----- */
- var fundingSourceGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', field: "name", width:'auto'},
- {name: '${_("Code")}', field: "code"},
- {name: '${_("Balance")}', get:getSummaryInfo, field:'balance'},
- {name: '${_("Total Credits")}', get:getSummaryInfo, field:'credit_total'},
- {name: '${_("Total Debits")}', get:getSummaryInfo, field:'allocation_total'},
- {name: '${_("Currency Type")}', field: "currency_type"},
- {name: '${_("Owner")}', field: "owner", width:'auto', get:getOrgInfo},
- ]]
- }];
- </script>
- <div jsId='fundingSourceGrid' dojoType="dojox.Grid" structure='fundingSourceGridLayout'> </div>
- </div>
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Credits')}">
- <script type='dojo/connect' event='onShow'>loadCreditGrid();</script>
- <script>
- /** Define the columns for the funding source credits grid ----- */
- var fsCreditGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Amount")}', field: "amount"},
- {name: '${_("Note")}', field: "note", width:'auto'},
- ]]
- }];
- </script>
- <div jsId='fsCreditGrid' dojoType="dojox.Grid" structure='fsCreditGridLayout'> </div>
- </div>
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Allocations')}">
- <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
- <script>
- /** Define the columns for the funding source allocations grid ----- */
- var fsAllocationGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Fund")}', field: "fund", get:getFund},
- {name: '${_("Amount")}', field: "amount"},
- {name: '${_("Percent")}', field: "percent"},
- {name: '${_("Allocated By")}', field: "allocator"},
- {name: '${_("Note")}', field: "note", width:'auto'},
- ]]
- }];
- </script>
- <div jsId='fsAllocationGrid' dojoType="dojox.Grid" structure='fsAllocationGridLayout'> </div>
- </div>
- </div>
-</div>
-
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('View Provider')}</%def>
-<%def name="block_content()">
-
-<script>var providerId = ${c.oils.acq.provider_id};</script>
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/financial/view_provider.js'> </script>
-
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
- <div dojoType="dijit.layout.TabContainer">
- <!--
- Provider Summary
- -->
- <div dojoType="dijit.layout.ContentPane"
- class='oils-acq-detail-content-pane' title="${_('Summary')}" selected='true' style='height:400px;'>
- <script>
- var providerGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', field: "name", width:'auto'},
- {name: '${_("Code")}', field:'code'},
- {name: '${_("Owner")}', get:getOrgInfo},
- {name: '${_("Currency Type")}', field: "currency_type"},
- ]]
- }];
- </script>
- <div jsId='providerGrid' dojoType="dojox.Grid" structure='providerGridLayout'> </div>
- </div>
-
- <!--
- Provider order record data types
- -->
- <div dojoType="dijit.layout.ContentPane"
- class='oils-acq-detail-content-pane' title="${_('Order Record Format')}" style='height:400px;'>
-
- <div class='oils-acq-actions-div' style='margin:8px;'>
-
- <!--
- Dropdown menu for creating a new order record data type
- -->
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Create Order Record Field')}</span>
- <div dojoType="dijit.TooltipDialog" execute="createOrderRecordField(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>setORDesc();</script>
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="code">${_('Code:')} </label></td>
- <td>
- <select id='oils-acq-provider-or-code' name="code" dojoType="dijit.form.ComboBox">
- <script type='dojo/connect' event='onChange'>setORDesc();</script>
- <option value='fund_code'>Fund Code</option>
- <option value='shelving_location'>Shelving Location</option>
- <option value='quantity'>Quantity</option>
- <option value='order_date'>Order Date</option>
- <option value='volume_count'>Volume Count </option>
- <option value='currency_type'>Currency Type</option>
- <option value='internal_notes'>Internal Notes </option>
- <option value='vendor_notes'>Vendor Notes</option>
- <option value='estimated_price'>Estimated Price</option>
- </select>
- </td>
- </tr>
- <tr>
- <td><label for="description">${_('Description:')} </label></td>
- <td><input id='oils-acq-provider-or-desc' dojoType="dijit.form.TextBox" name="description"> </input></td>
- </tr>
- <tr>
- <td><label for="amount">${_('Tag:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="tag"></input></td>
- </tr>
- <tr>
- <td><label for="amount">${_('Subfield:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="subfield"></input></td>
- </tr>
- <tr>
- <td><label for="ident">${_('Identifer Field?:')} </label></td>
- <td>
- <select dojoType="dijit.form.FilteringSelect" name="ident">
- <option value='f' selected='selected'>${_('False')}</option>
- <option value='t'>${_('True')}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td><label for="amount">${_('XPath (advanced):')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="xpath"></input></td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Apply')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <!--
- Delete order record data types button
- -->
- <button dojoType="dijit.form.Button" onclick='deleteORDataFields();'>
- ${_('Delete Selected')}
- </button>
- </div>
-
- <script type='dojo/connect' event='onShow'>loadPADGrid();</script>
- <script>
- var padGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Code")}', field:'code', width:'auto'},
- {name: '${_("Description")}', field: "description", width:'auto'},
- {name: '${_("Tag")}', get:getTag},
- {name: '${_("Subfield")}', get:getSubfield},
- {name: '${_("Identifier")}', field:'ident'},
- {name: '${_("XPath")}', field:'xpath', width:'auto'}
- ]]
- }];
- </script>
- <div jsId='padGrid' dojoType="dojox.Grid" structure='padGridLayout'> </div>
- </div>
- </div>
-</div>
-
-</%def>
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-
-<%def name="page_title()">${_('Evergreen Acquisitions Home')}</%def>
-<%def name="block_content()">
- <div id='oils-acq-index-block'>
- ACQ HOME
- </div>
-</%def>
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
-<%def name='block_navigate()'>
- <!--
- <div id='oils-acq-picklist-nav-div'>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/picklist/list'>${_('My Picklists')}</a></div>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/picklist/listall'>${_('All Picklists')}</a></div>
- <div class='oils-acq-nav-link'><a href='javascript:alert("not yet...");'>${_('Picklist Search')}</a></div>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/picklist/bib_search'>${_('Title Search')}</a></div>
- </div>
- <script>setSelectedNavLink('oils-acq-picklist-nav-div');</script>
- -->
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
-<%def name="page_title()">${_('Title Search')}</%def>
-
-<%def name="block_content()">
- <script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/picklist/bib_search.js'> </script>
- <style>
- /* import the checkedmultiselect css */
- @import url(${c.oils.core.media_prefix.value}/js/dojo/dojox/form/resources/CheckedMultiSelect.css);
- </style>
-
- <script>
- var searchOffset = ${c.oils.acq.offset.value} || 0;
- </script>
-
- <div id='oils-acq-search-block' class='container'>
- <form dojoType='dijit.form.Form' action='' method=''>
- <script type="dojo/method" event="onSubmit">
- doSearch(this.getValues());
- return false; /* don't redirect */
- </script>
- <div id='oils-acq-search-sources-block'>
- <div id='oils-acq-search-sources-label'>${_('Search Sources')}</div>
- <select style='overflow-y:auto;' id='oils-acq-search-source-select'
- multiple='true' jsId="bibSourceSelect" dojoType="dojox.form.CheckedMultiSelect">
- <option value='native-evergreen-catalog'>${_('Evergreen Catalog')}</option>
- </select>
- <div id='oils-acq-search-progress'>
- <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
- </div>
- <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
- </div>
- <div id='oils-acq-search-form-block'>
- <div id='oils-acq-search-fields-label'>${_('Search Fields')}</div>
- <div id='oils-acq-search-fields'>
- </div>
- <table>
- <tbody id='oils-acq-search-fields-tbody'>
- <tr id='oils-acq-search-fields-template'>
- <td name='label'> </td>
- <td name='input'> </td>
- </tr>
- <tr id='oils-acq-seach-fields-count-row'>
- <td name='label'>Hits Per Source</td>
- <td><input name='limit'
- dojoType='dijit.form.NumberSpinner'
- constraints='{min:5,max:50}'
- value='10'></input>
- </td>
- </tr>
- </tbody>
- </table>
- <div id='oils-acq-search-fields-submit-block'>
- <div dojoType='dijit.form.Button' type='submit'>${_("Submit")}</div>
- </div>
- </div>
- </div>
- </form>
- <div id='oils-acq-pl-search-results' style='height:100%'>
- <script>
- dojo.require('dijit.form.FilteringSelect');
- dojo.require('dijit.Dialog');
- </script>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Save Results')}</span>
- <div dojoType="dijit.TooltipDialog" execute="saveResults(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- loadPLSelect();
- </script>
- <table class='dijitTooltipTable'>
- <tr>
- <td colspan='2'>
- <input dojoType="dijit.form.RadioButton" name="which" type='radio' checked='checked' value='selected'/>
- <label for="name">${_('Save selected')}</label>
- <input dojoType="dijit.form.RadioButton" name="which" type='radio' value='all'/>
- <label for="name">${_('Save all')}</label>
- </td>
- </tr>
- <tr><td colspan='2'><hr/></td></tr>
- <tr>
- <td><label for="new_name">${_('Save as picklist:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="new_name"/></td>
- </tr>
- <tr>
- <td><label for="existing_pl">${_('Add to picklist:')} </label></td>
- <td>
- <input jsId='plAddExistingSelect' dojoType="dijit.form.FilteringSelect"
- name="existing_pl" searchAttr='name' displayAttr='name'/>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Save')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- ${jubgrid.jubgrid('oils-acq-lineitem', 'plResultGrid', True)}
- </div>
- <script>dojo.style('oils-acq-pl-search-results', 'visibility', 'hidden');</script>
-</%def>
-
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<!--
- vim:ts=4:sw=4:et:ft=mako:
--->
-<%inherit file='base.html'/>
-<%namespace file='../../common/jubgrid.html' name='jubgrid'/>
-<%def name="block_js()">
- ${parent.block_js()}
- <script type='text/javascript'>
- dojo.require('dijit.layout.LayoutContainer');
- dojo.require('dijit.layout.ContentPane');
- dojo.require('openils.acq.Picklist');
- </script>
-</%def>
-<%def name="page_title()">${_('Picklist')}</%def>
-
-<%def name="block_content()">
-<div dojoType="dijit.layout.LayoutContainer" style="height:100%">
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" jsId="pl_header">
- <div id='oils-acq-picklist-header'>
- ${_('Picklist')}
- <span id='oils-acq-picklist-name'> </span>
- <div class='oils-acq-picklist-attributes'>
- <div>Create
- date: <span id="oils-acq-picklist-attr-cdate"></span></div>
- <div>Last updated: <span id="oils-acq-picklist-attr-edate"></span></div>
- <div>Selector: <span id="oils-acq-picklist-attr-owner"></span></div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- var plist = null;
- function loadPL() {
- plist = new openils.acq.Picklist(${c.oils.acq.picklist.value},
- function(model) {
- dojo.byId("oils-acq-picklist-name").innerHTML = plist.name();
- dojo.byId("oils-acq-picklist-attr-cdate").innerHTML = plist.create_time();
- dojo.byId("oils-acq-picklist-attr-edate").innerHTML = plist.edit_time();
- dojo.byId("oils-acq-picklist-attr-owner").innerHTML = plist.owner();
- JUBGrid.populate(pickListGrid,
- model,
- plist._items);
- /*
- dojo.connect(model.store,
- "onSet",
- function(griditem,
- attr,
- oldVal,
- newVal) {
- plist.onJUBSet(griditem,
- attr,
- oldVal,
- newVal);
- });
- */
- });
- }
- dojo.addOnLoad(loadPL);
- </script>
- ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid')}
-</div>
-</%def>
-<!-- Local Variables: -->
-<!-- mmm-classes: html-js -->
-<!-- End: -->
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('My Picklists')}</%def>
-<%def name="block_content()">
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-picklist-my-list-header'>
- <div id='oils-acq-list-header-label'>${_('My Picklists')}</div>
- <!--
- <div id='oils-acq-list-header-actions'>
- <a id='oils-acq-picklist-view-all' href="${c.oils.acq.prefix.value}/picklist/listall">${_('View All Picklists')}</a>
- </div>
- -->
- </div>
- <div id='oils-acq-picklist-all-list-header'>
- <div id='oils-acq-list-header-label'>${_('All Picklists')}</div>
- <!--
- <div id='oils-acq-list-header-actions'>
- <a id='oils-acq-picklist-view-mine' href="${c.oils.acq.prefix.value}/picklist/list">${_('View My Picklists')}</a>
- </div>
- -->
- </div>
-</div>
-
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/picklist/view_list.js'> </script>
-
-<script>
- if(location.href.match(/listall$/)) {
- listAll = true;
- dojo.style('oils-acq-picklist-my-list-header', 'visibility', 'hidden');
- dojo.style('oils-acq-picklist-my-list-header', 'display', 'none');
- } else {
- dojo.style('oils-acq-picklist-all-list-header', 'visibility', 'hidden');
- dojo.style('oils-acq-picklist-all-list-header', 'display', 'none');
- }
-</script>
-
-
-<div class='oils-acq-actions-div'>
- <div dojoType="dijit.form.DropDownButton">
- <span>${('New Picklist')}</span>
- <div dojoType="dijit.TooltipDialog" execute="createPL(arguments[0]);">
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="name">${_('Name:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="name"></td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Create')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <button dojoType="dijit.form.Button" onclick="deleteFromGrid();">
- ${_('Delete Selected')}
- </button>
-</div>
-
-
-<script>
- function getName(rowIndex) {
- data = plListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/picklist/view/'+data.id+'">'+data.name+'</a>';
- }
-
- var plListGridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Name")}', width:'auto', get:getName},
- {name: '${_("Selector")}', field:'owner'},
- {name: '${_("Create Time")}', field: 'create_time'},
- {name: '${_("Edit Time")}', field: 'edit_time'},
- {name: '${_("Entry Count")}', field: 'entry_count'},
- ]]
- }];
-</script>
-<div jsId='plListGrid' dojoType="dojox.Grid" structure='plListGridStructure'></div>
-
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
-<%def name='block_navigate()'>
- <!--
- <div id='oils-acq-picklist-nav-div'>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/po/search'>${_('PO Search')}</a></div>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/po/li_search'>${_('Lineitem Search')}</a></div>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/po/marc_upload'>${_('Load Order Record')}</a></div>
- </div>
- <script>setSelectedNavLink('oils-acq-picklist-nav-div');</script>
- -->
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('Lineitem Search')}</%def>
-<%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
-
-
-<%def name="block_content()">
- <script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/po/li_search.js'> </script>
- <script>
- var searchLimit = ${c.oils.acq.limit.value} || 10;
- var searchOffset = ${c.oils.acq.offset.value} || 0;
- </script>
-
- <div id='oils-acq-li-search-block' class='container'>
- <form dojoType='dijit.form.Form' action='' method=''>
- <script type="dojo/method" event="onSubmit">
- doSearch(this.getValues());
- return false; /* don't redirect */
- </script>
- <table class='oils-acq-basic-form-table'>
- <tr>
- <td><label for='state'>${_('State')}</label></td>
- <td>
- <select dojoType='dijit.form.FilteringSelect' name='state'>
- <option value='new'>${_("New")}</option>
- <option value='approved'>${_("Approved")}</option>
- <option value='in-process'>${_("In Process")}</option>
- <option value='received'>${_("Received")}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td><label for='provider'>${_('Provider')}</label></td>
- <td>
- <select dojoType='dijit.form.FilteringSelect' name='provider'
- labalAttr='code' searchAttr='code' jsId='providerSelector'>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan='2'><div dojoType='dijit.form.Button' type='submit'>${_("Search")}</div></td>
- </tr>
- </table>
- </form>
- </div>
-
- <div id='oils-acq-li-search-progress'>
- <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
- </div>
- <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
-
- <div dojoType="dijit.form.DropDownButton" id='oils-acq-li-search-po-create'>
- <span>${('Create PO')}</span>
- <div dojoType="dijit.TooltipDialog" execute="createPOFromLineitems(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- buildProviderSelect(newPOProviderSelector,
- function() {
- newPOProviderSelector.setValue(providerSelector.getValue());
- }
- );
- new openils.User().buildPermOrgSelector('CREATE_PURCHASE_ORDER', orderingAgencySelect);
- //new openils.User().buildPermOrgTreePicker('CREATE_PURCHAE_ORDER', 'treee');
- </script>
- <table class='dijitTooltipTable'>
- <tr>
- <td colspan='2'>
- <input dojoType="dijit.form.RadioButton" name="which" type='radio' checked='checked' value='selected'/>
- <label for="name">${_('For selected items')}</label>
- <input dojoType="dijit.form.RadioButton" name="which" type='radio' value='all'/>
- <label for="name">${_('For all items')}</label>
- </td>
- </tr>
- <tr>
- <td><label for="name">${_('Provider:')} </label></td>
- <td>
- <input jsId='newPOProviderSelector' name="provider"
- dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
- </td>
- </tr>
- <tr>
- <td><label for="name">${_('Ordering Agency:')}</label></td>
- <td>
- <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='orderingAgencySelect'
- searchAttr="shortname" name="ordering_agency" autocomplete="true" labelAttr='shortname'> </input>
- </td>
- </tr>
- <tr>
- <td><label for="create_assets">${_('Generate Bib/Copy Data')}</label></td>
- <td>
- <input name='create_assets' dojoType='dijit.form.CheckBox' checked='checked'> </input>
- </td>
- </tr>
- <tr>
- <td><label for="create_debits">${_('Encumber funds')}</label></td>
- <td>
- <input name='create_debits' dojoType='dijit.form.CheckBox' checked='checked'> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Create')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <script>dojo.style('oils-acq-li-search-po-create', 'visibility', 'hidden');</script>
- <div id='oils-acq-li-search-result-grid' style='height:100%'>
- ${jubgrid.jubgrid('oils-acq-li-search', 'liGrid')}
- </div>
- <script>dojo.style('oils-acq-li-search-result-grid', 'visibility', 'hidden');</script>
-</%def>
-
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('MARC File Upload')}</%def>
-<%def name="block_content()">
-
-<style>
- @import url(${c.oils.core.media_prefix.value}/js/dojo/dojox/widget/FileInput/FileInput.css);
-</style>
-
-<script>
- dojo.require('dijit.form.Form');
- dojo.require('dijit.form.Button');
- dojo.require('dijit.form.FilteringSelect');
- dojo.require('openils.acq.Provider');
- dojo.require('dojox.widget.FileInput');
- dojo.require('dojo.data.ItemFileReadStore');
- function load() {
- openils.acq.Provider.createStore(
- function(store) {
- providerSelector.store =
- new dojo.data.ItemFileReadStore({data:store});
- },
- 'MANAGE_PROVIDER'
- );
- }
- dojo.addOnLoad(load);
-</script>
-
-<form dojoType='dijit.form.Form' enctype="multipart/form-data" name='marc_upload_form'
- action='${c.oils.acq.prefix.value}/po/marc_upload' method='post'>
- <style>#oils-acq-po-marc-upload-table td {padding: 5px;}</style>
- <script type="dojo/method" event="onSubmit">
- document.forms.marc_upload_form.authtoken.value = openils.User.authtoken;
- return true;
- </script>
- <input name='authtoken' type='hidden'> </input>
- <table id='oils-acq-po-marc-upload-table' style='width:auto;'>
- <tbody>
- <tr>
- <td><label for='provider'>${_('Provider')}</label></td>
- <td>
- <select name='provider' style='overflow-y:auto;' labelAttr='code' searchAttr='code'
- jsId="providerSelector" dojoType="dijit.form.FilteringSelect"> </select>
- </td>
- </tr>
- <tr>
- <td><label for='marc_file'>MARC File</label></td>
- <td nowrap='nowrap'>
- <input dojoType="dojox.widget.FileInput" name="marc_file" id='marc_file'/> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2'>
- <div dojoType='dijit.form.Button' type='submit'>${_("Upload File")}</div>
- </td>
- </tr>
- </tbody>
- </table>
-</form>
-
-</%def>
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('PO Search')}</%def>
-<%def name="block_content()">
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('PO Search')}</div>
-</div>
-
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/po/search.js'> </script>
-
-<script>
- function getId(rowIndex) {
- data = poGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="${c.oils.acq.prefix.value}/po/view/' + data.id + '">'+data.id;
- }
-</script>
-
-
-<form dojoType='dijit.form.Form' action='' method=''>
- <script type="dojo/method" event="onSubmit">
- fields = this.getValues();
- if(fields.provider == '')
- delete fields.provider;
- if(isNaN(fields.id))
- delete fields.id;
- doSearch(fields);
- return false; /* don't redirect */
- </script>
- <table class='oils-acq-basic-form-table'>
- <tr>
- <td><label for='id'>${_('ID')}</label></td>
- <td><input dojoType='dijit.form.NumberTextBox' name='id'> </input></td>
- </tr>
- <tr>
- <td><label for='provider'>${_('Provider')}</label></td>
- <td><select labelAttr='code' searchAttr='code' name='provider'
- style='overflow-y:auto;' jsId="providerSelector" dojoType="dijit.form.FilteringSelect"> </select></td>
- </tr>
- <tr>
- <td><label for='state'>${_('State')}</label></td>
- <td>
- <select dojoType='dijit.form.FilteringSelect' name='state' value=''>
- <option value='new'>${_("New")}</option>
- <option value='in-process'>${_("In Process")}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td><label for='ordering_agency'>${_('Ordering Agency')}</label></td>
- <td><select jsId='poSearchOrderingAgencySelect' labelAttr='shortname' searchAttr='shortname'
- dojoType='openils.widget.OrgUnitFilteringSelect' name='ordering_agency'>
- </select>
- </td>
- </tr>
- <tr>
- <td style='text-align:center;'><div dojoType='dijit.form.Button' type='submit'>${_("Search")}</div></td>
- </tr>
- </table>
-</form>
-
-<script>
- var poGridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id', get:getId},
- {name: '${_("Owner")}', get:getPOOwner},
- {name: '${_("Ordering Agency")}', get:getOrgInfo},
- {name: '${_("Create Time")}', field:'create_time', get:getDateTimeField, width:'auto'},
- {name: '${_("Edit Time")}', field: "edit_time", get:getDateTimeField, width:'auto'},
- {name: '${_("Provider")}', get:getProvider, width:'auto'},
- {name: '${_("State")}', field:'state'}
- ]]
- }];
-</script>
-<div jsId='poGrid' id='po-grid' dojoType="dojox.Grid" structure='poGridStructure'></div>
-<script>dojo.style('po-grid', 'visibility', 'hidden');</script>
-
-</%def>
-
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html' />
-<%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
-
-<%def name='page_title()'>${_('View PO')}</%def>
-<%def name='block_content()'>
-
-<script>
- var poId = ${c.oils.acq.po_id.value};
-</script>
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/po/view_po.js'> </script>
-<script src='${c.oils.core.media_prefix.value}/js/dojo/openils/acq/Lineitem.js'> </script>
-
-<div id='oils-acq-list-header' class='container'>
- <div id='oils-acq-list-header-label'>${_('PO Details')}</div>
-</div>
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
- <div dojoType="dijit.layout.TabContainer">
-
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Summary')}" selected='true'>
- <script type='dojo/connect' event='onShow'>loadPOGrid();</script>
- <script>
- var poGridStructure = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Owner")}', get:getPOOwner},
- {name: '${_("Ordering Agency")}', get:getOrgInfo},
- {name: '${_("Create Time")}', field:'create_time', width:'auto', get:getDateTimeField},
- {name: '${_("Edit Time")}', field: "edit_time", width:'auto', get:getDateTimeField},
- {name: '${_("Provider")}', get:getProvider},
- {name: '${_("# Lineitems")}', field: 'lineitem_count'},
- {name: '${_("State")}', field:'state'}
- ]]
- }];
- </script>
- <div jsId='poGrid' dojoType="dojox.Grid" structure='poGridStructure'> </div>
- </div>
- <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Line Items')}">
- <script type='dojo/connect' event='onShow'>loadLIGrid();</script>
- ${jubgrid.jubgrid('oils-acq-lineitem', 'liGrid')}
- </div>
- </div>
-</div>
-
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
-<%def name='block_navigate()'>
- <!--
- <div id='oils-acq-picklist-nav-div'>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/po/search'>${_('PO Search')}</a></div>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/po/li_search'>${_('Lineitem Search')}</a></div>
- <div class='oils-acq-nav-link'><a href='${c.oils.acq.prefix.value}/po/marc_upload'>${_('Load Order Record')}</a></div>
- </div>
- <script>setSelectedNavLink('oils-acq-picklist-nav-div');</script>
- -->
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<!--
-- vim:ts=4:sw=4:et:ft=mako:
--->
-<%inherit file='base.html'/>
-<%def name="page_title()">${_('Receiving')}</%def>
-<%namespace file='../../common/jubgrid.html' name='jubgrid'/>
-
-<%def name="block_content()">
- <script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/receiving/process.js'> </script>
- <h1>Receiving Processing</h1><br/>
- <div id='oils-acq-recv-search-block' class='container'>
- <form dojoType='dijit.form.Form' action='' method=''>
- <script type="dojo/method" event="onSubmit">
- doSearch(this.getValues());
- return false; /* don't redirect */
- </script>
- <table class='oils-acq-basic-form-table'>
- <tr>
- <td><label for='identifier'>${_('Identifier')}</label></td>
- <td>
- <input dojoType='dijit.form.TextBox' name='identifier'/>
- </td>
- </tr>
- <tr>
- <td><label for="name">${_('Ordering Agency:')}</label></td>
- <td>
- <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='orderingAgencySelect'
- searchAttr="shortname" name="ordering_agency" autocomplete="true" labelAttr='shortname'> </input>
- </td>
- </tr>
- <tr>
- <td colspan='2'><div dojoType='dijit.form.Button' type='submit'>${_("Search")}</div></td>
- </tr>
- </table>
- </form>
- </div>
- <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
- <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
- <div id='oils-acq-recv-grid' style='height:100%'>
- ${jubgrid.jubgrid('oils-acq-recv', 'liGrid')}
- </div>
- <script>dojo.style('oils-acq-recv-grid', 'visibility', 'hidden');</script>
-</%def>
-<!-- Local Variables: -->
-<!-- mmm-classes: html-js -->
-<!-- End: -->
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
-<%def name="page_title()">${_('Lineitem Attribute Definitions')}</%def>
-<%def name="block_content()">
-<!-- load the page-specific JS -->
-<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/settings/li_attr.js'> </script>
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Lineitem Attribute Attribute')}</span>
- <div dojoType="dijit.TooltipDialog" execute="createOrderRecordField(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>//setORDesc();</script>
- <table class='dijitTooltipTable'>
- <tr>
- <td><label for="code">${_('Code:')}</label></td>
- <td><input dojoType='dijit.form.TextBox' name='code'/></td>
- </tr>
- <tr>
- <td><label for="description">${_('Description:')} </label></td>
- <td><input id='oils-acq-provider-or-desc' dojoType="dijit.form.TextBox" name="description"> </input></td>
- </tr>
- <tr>
- <td><label for="amount">${_('Tag:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="tag"></input></td>
- </tr>
- <tr>
- <td><label for="amount">${_('Subfield:')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="subfield"></input></td>
- </tr>
- <tr>
- <td><label for="ident">${_('Identifer Field?:')} </label></td>
- <td>
- <select dojoType="dijit.form.FilteringSelect" name="ident">
- <option value='f' selected='selected'>${_('False')}</option>
- <option value='t'>${_('True')}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td><label for="amount">${_('XPath (advanced):')} </label></td>
- <td><input dojoType="dijit.form.TextBox" name="xpath"></input></td>
- </tr>
- <tr>
- <td colspan='2' align='center'>
- <button dojoType=dijit.form.Button type="submit">${_('Apply')}</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <script>
- var liAttrGridLayout = [{
- cells : [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Code")}', field:'code', width:'auto'},
- {name: '${_("Description")}', field: "description", width:'auto'},
- {name: '${_("Tag")}', get:getTag},
- {name: '${_("Subfield")}', get:getSubfield},
- {name: '${_("Identifier")}', field:'ident'},
- {name: '${_("XPath")}', field:'xpath', width:'auto'}
- ]]
- }];
- </script>
- <div dojoType="dijit.layout.TabContainer">
- <div dojoType="dijit.layout.ContentPane"
- class='oils-acq-detail-content-pane' title="${_('MARC Attributes')}" style='height:600px;'>
- <script type='dojo/connect' event='onShow'>loadMarcAttrGrid();</script>
- <div jsId='liMarcAttrGrid' dojoType="dojox.Grid" structure='liAttrGridLayout'> </div>
- </div>
- <div dojoType="dijit.layout.ContentPane"
- class='oils-acq-detail-content-pane' title="${_('Generated Attributes')}" style='height:600px;'>
- <script type='dojo/connect' event='onShow'>loadGeneratedAttrGrid();</script>
- <div jsId='liGeneratedAttrGrid' dojoType="dojox.Grid" structure='liAttrGridLayout'> </div>
- </div>
- </div>
-</div>
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='../base.html'/>
-<%def name="body_css()">tundra</%def>
-
-<%def name="block_js()">
- ${parent.block_js()}
-
- <script type="text/javascript">
- dojo.require("dijit.layout.LayoutContainer");
- dojo.require("dijit.layout.ContentPane");
-
- // sets the -active css class on the selected link
- function setSelectedNavLink(divId) {
- refs = dojo.query('a', divId);
- for(var i = 0; i < refs.length; i++) {
- var ref = refs[i];
- if(ref.getAttribute('href') == location.href.replace(/http:\/\/.*?\//,'/'))
- ref.parentNode.className += ' oils-acq-nav-link-active';
- }
- }
- </script>
-</%def>
-
-<%def name='block_body_content()'>
- <div id="oils-base-body-block" class="tundra" dojoType="dijit.layout.LayoutContainer">
-
- <div id="oils-base-header-block" dojoType="dijit.layout.ContentPane" layoutAlign="top">
- <div id='oils-base-header-menu-block'>
- ${self.block_menu()}
- </div>
- <div id='oils-base-header-auto-login-block'>
- ${self.block_header()}
- </div>
- </div>
-
- <div id="oils-base-main-block"
- dojoType="dijit.layout.LayoutContainer" layoutAlign="client">
-
- <div id="oils-base-navigate-block" dojoType="dijit.layout.ContentPane" layoutAlign="left">
- ${self.block_navigate()}
- </div>
-
- <div id="oils-base-content-block" dojoType="dijit.layout.ContentPane" layoutAlign="client">
- ${self.block_global_content()}
- </div>
- </div>
-
- <div id="oils-base-footer-block"
- dojoType="dijit.layout.ContentPane" layoutAlign="bottom">
- ${self.block_footer()}
- </div>
- </div>
-</%def>
-
-<%def name='block_header()'>
- <%include file='header.html'/>
-</%def>
-<%def name='block_sidebar()'/>
-<%def name='block_global_content()'>
- ${self.block_content()}
-</%def>
-<%def name='block_content()'/>
-<%def name='block_menu()'>
- <%include file='menu.html'/>
-</%def>
-<%def name='block_navigate()'>
-</%def>
-<%def name='block_footer()'>
- <%include file='footer.html'/>
-</%def>
+++ /dev/null
-<%def name='jubgrid(domprefix, grid_jsid, hide_details=False)'>
-<%doc>
-This template creates a split screen Dojo layout. The top frame
-of the screen holds a list of of JUBs, or titles. Clicking on a
-title in the top frame will load the purchase details for all the
-copies on order for that title into the bottom frame.
-
-To create a display for a set of JUBs, create a Dojo store and
-model for the set of JUBs, then place the following lines in your
-HTML where you want the display to appear:
-
- <%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
- ${jubgrid.jubgrid('dom_prefix', 'grid_jsid')}
-
-where 'dom_prefix' is a string that will be used as the prefix
-for the DOM notes that are created by this template, and
-'grid_jsid' is a valid JavaScript identifier that will name the
-DOM node to which the list of JUBs will be attached. For example
-
- ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid', hideDetails)}
-
-will create a Dojo grid with the DOM id of
-
- 'oils-acq-picklist-JUB-grid'
-
-and a jsid of
-
- pickListGrid
-
-To fill the grid with data, call the javascript function
-
- JUBGrid.populate(grid_jsid, model)
-
-'grid_jsid' is the same javascript id that was used to
-instantiate the template, and model is a javascript variable
-pointing to the JUB model (and store) that you have created.
-
-</%doc>
-
-% if not hide_details:
-<div dojoType="dijit.layout.SplitContainer" style='height:100%'
- orientation="vertical" sizerWidth="5"
- activeSizing="1" layoutAlign="client">
-% endif
-
- <style type='text/css'>
- .grid_container {width: 100%; height: 100%;}
- </style>
-
- <script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/common/jubgrid.js'> </script>
- <script src='${c.oils.core.media_prefix.value}/js/dojo/openils/CopyLocation.js'> </script>
- <script type="text/javascript">
- JUBGrid.getPO = function(rowIndex) {
- var data = JUBGrid.jubGrid.model.getRow(rowIndex);
- if (!(data && data.purchase_order)) return '';
- return "<a href='${c.oils.core.prefix.value}/acq/po/view/" + data.purchase_order+"'>"+data.purchase_order+"</a>";
- }
- JUBGrid.jubGridLayout = [{
- cells: [[
- {name: '${_("ID")}', field: 'id', width:'auto'},
- {name: '${_("Title")}', width: "180px", get:JUBGrid.getJUBTitle},
- {name: '${_("Author")}', get:JUBGrid.getJUBAuthor, width:'auto'},
- {name: '${_("ISBN")}', get:JUBGrid.getJUBIsbn, width:'auto'},
- {name: '${_("Pubdate")}', get:JUBGrid.getJUBPubdate, width:'auto'},
- {name: '${_("Actual Price")}',
- field:'actual_price',
- get:JUBGrid.getJUBActualPrice,
- editor:dojox.grid.editors.Dijit, width:'auto',
- editorClass: "dijit.form.CurrencyTextBox"
- },
- {name: '${_("Estimated Price")}',
- field:'estimated_price',
- get:JUBGrid.getJUBEstimatedPrice, width:'auto',
- editor:dojox.grid.editors.Dijit,
- editorClass: "dijit.form.CurrencyTextBox"
- },
- {name: '${_("Vendor")}', width:'auto',
- field: 'provider', get:JUBGrid.getProvider,
- editor:openils.editors.ProviderSelectEditor,
- },
- {name: '${_("No. Copies")}', field: 'item_count', width:'auto'},
- {name: '${_("State")}', field: 'state', width:'auto'},
- {name: '${_("PO")}', get:JUBGrid.getPO, width:'auto'}
- ]]
- }];
-
- JUBGrid.jubDetailGridLayout = [{
- cells: [[
- {name:"ID", field:"id"},
- {name:"Fund", field:"fund",
- get:JUBGrid.getLIDFundCode,
- editor: openils.editors.FundSelectEditor,
- },
- {name:"Branch", field:"owning_lib",
- get:JUBGrid.getLIDLibName,
- editor: openils.editors.OrgUnitSelectEditor
- },
- {name:"Barcode", field:"barcode", width:'auto',
- editor:dojox.grid.editors.Dijit,
- editorClass: "dijit.form.TextBox"
- },
- {name:"Call Number", field:"cn_label", width:'auto',
- editor:dojox.grid.editors.Dijit,
- editorClass: "dijit.form.TextBox"
- },
- {name:"Shelving Location", field:"location", width:'auto',
- editor:openils.editors.CopyLocationSelectEditor,
- get:JUBGrid.getCopyLocation
- },
- {name:"Receive Time", width:'auto',
- get:JUBGrid.getRecvTime
- },
- ]]
- }];
-
- JUBGrid.jubDetailGridLayoutReadOnly = [{
- cells: [[
- {name:'${_("ID")}', field:"id"},
- {name:'${_("Fund")}', field:"fund",
- get:JUBGrid.getLIDFundCode,
- },
- {name:'${_("Branch")}', field:"owning_lib",
- get:JUBGrid.getLIDLibName,
- },
- {name:'${_("Barcode")}', field:"barcode", width:'auto'},
- {name:'${_("Call Number")}', field:"cn_label", width:'auto'},
- {name:'${_("Shelving Location")}', field:"location",
- width:'auto', get:JUBGrid.getCopyLocation},
- ]]
- }];
- </script>
-
-% if not hide_details:
- <script>JUBGrid.showDetails = true;</script>
- <div id="${domprefix + '-container'}"
- dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="50">
- <div dojoType="dijit.layout.ContentPane"
- id=${domprefix+"-jub-buttonbar"}>
- <button dojoType="dijit.form.Button" onclick="JUBGrid.approveJUB">
- ${_('Approve Selected Titles')}
- </button>
- <button dojoType="dijit.form.Button" onclick="JUBGrid.removeSelectedJUBs">
- ${_('Remove Selected Titles')}
- </button>
- </div>
-% endif
- <div dojoType="dijit.layout.ContentPane" class='grid_container'>
- <div structure='JUBGrid.jubGridLayout' jsid='${grid_jsid}'
- dojoType='dojox.Grid' id="${domprefix + '-JUB-grid'}">
- </div>
- </div>
-% if not hide_details:
- </div>
- <div dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="50">
- <div dojoType="dijit.layout.ContentPane"
- id=${domprefix+"-details-buttonbar"}>
- <div dojoType="dijit.form.DropDownButton">
- <span>${_('New Copy')}</span>
- <div dojoType="dijit.TooltipDialog"
- execute="JUBGrid.createLID(arguments[0]);">
- <script type='dojo/connect' event='onOpen'>
- new openils.User().buildPermOrgSelector('MANAGE_FUND', copyOwnerSelect);
- openils.acq.Fund.buildPermFundSelector('MANAGE_FUND', acqlidFund);
- </script>
- <table class="dijitTooltipTable">
- <tr>
- <td><label for="fund">${_('Fund:')} </label></td>
- <td>
- <input dojoType="openils.widget.FundSelector"
- jsId="acqlidFund"
- searchAttr="name" autocomplete="true"
- name="fund"></input>
- </td>
- </tr>
- <tr>
- <td><label for="owning_lib">${_('Location:')} </label></td>
- <td><input dojoType="openils.widget.OrgUnitFilteringSelect"
- jsId="copyOwnerSelect"
- searchAttr="shortname"
- name="owning_lib" autocomplete="true"
- labelAttr="shortname"></input>
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center">
- <button dojotype="dijit.form.Button" type="submit">
- ${_('Create')}
- </button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <button dojoType='dijit.form.Button' onclick='JUBGrid.deleteLID'>
- ${_('Delete Selected Copy')}
- </button>
- <button dojoType='dijit.form.Button' onclick='JUBGrid.receiveLID'>
- ${_('Mark Selected Copies Received')}
- </button>
- </div>
- <div dojoType="dijit.layout.ContentPane" class='grid_container'>
- <div structure='JUBGrid.jubDetailGridLayout' jsid="JUBGrid.jubDetailGrid" dojoType="dojox.Grid"
- id='${domprefix + "-details-grid"}'>
- </div>
- </div>
- </div>
-</div>
-% endif
-</%def>
-<!-- Local Variables: -->
-<!-- mmm-classes: html-js -->
-<!-- End: -->
+++ /dev/null
-<!--
- vim:ft=mako:
--->
-
-<!--
- Define some common widgets
--->
-
-
-<%def name='org_draw_node(node, indent=0, selected=None, disable_depth=-1)'>
- <% import oils.org %>
- <option value='${node.id()}'
- % if selected == node.id():
- selected='selected'
- % endif
- % if oils.org.OrgUtil.get_org_type(node).depth() < disable_depth:
- disabled='disabled'
- % endif
- >
- % for i in range(indent):
-   
- % endfor
- ${node.name()} (${node.shortname()})
- </option>
- <% indent += 1 %>
- % for child in node.children():
- ${org_draw_node(child, indent)}
- % endfor
-
-</%def>
-
-<%def name='org_select(select_name, tree=None, selected=None, disable_depth=-1)'>
- <!--
- Draws a select dropdown of the org tree provided with indentation based on org depth.
- @param select_name The form name for the select object
- @param tree The org tree to draw
- @param selected The ID of the org whose <option> to mark as selected
- @param disable_depth Any orgs in the tree whose depth is less than disable_depth
- will have their <options>'s disabled with disabled='disabled'
- -->
- <%
- if tree is None:
- tree = c.oils.core.org_tree.value
- %>
- <select name='${select_name}'>
- ${org_draw_node(tree, 0, selected, disable_depth)}
- </select>
-</%def>
-
-<%def name='paging(start, count, max)'>
- <!--
- Creating paging links to move from page to page in long
- list of results
- -->
-
- <%
- start = int(start)
- if (start + count > max):
- end = max
- else:
- end = start + count
- # set up the paging info
- paging = _('Entries %(offset)d - %(limit)d of %(max)d') % {
- 'offset': start + 1, 'limit': end, 'max': max }
- %>
-
- % if start > 0:
- <a href='?${c.oils.acq.offset.cgi_name}=${start - count}'>«</a>
- % endif
-
- ${paging}
-
- % if end < max:
- <a href='?${c.oils.acq.offset.cgi_name}=${end}'>»</a>
- % endif
-</%def>
-
-<%def name='build_selector(name, optionmap, chosen=None)'>
- <select name="${name}" dojoType="dijit.form.FilteringSelect">
-
- %if not chosen:
- <option value="" selected="selected" />
- %endif
-
- %for (id, name) in optionmap:
- <option value="${id}"
- %if id == chosen:
- selected='selected'
- %endif
- >${name}</option>
- %endfor
- </select>
-</%def>
+++ /dev/null
-# -*- coding: utf-8 -*-
-<%inherit file='base.html'/>
-
-<%def name="page_title()">${_('Evergreen Dashboard')}</%def>
-<%def name="block_content()">
- <div id='oils-dashboard-block'>
- DASHBOARD
- </div>
-</%def>
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-${_('Powered By')} <img src='${c.oils.core.media_prefix.value}/images/eg_tiny_logo.jpg'/>
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-<div id='oils-base-header-content-div'>
- <span id='oils-base-header-user-info'> </span>
- <script>
- dojo.addOnLoad(function(){
- dojo.byId('oils-base-header-user-info').appendChild(
- document.createTextNode(openils.User.user.usrname()));
- });
- </script>
-</div>
+++ /dev/null
-<div>
- <script>
- dojo.require('dijit.form.Button');
- dojo.require('dijit.Toolbar');
- dojo.require('dijit.Menu');
- </script>
-
- <div dojoType="dijit.Toolbar" class='menuBar'>
-
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Acquisitions')}</span>
- <div dojoType="dijit.Menu">
-
- <!-- ==========================================================================
- Picklist SubMenu
- ========================================================================== -->
- <div dojoType="dijit.PopupMenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy">
- <span>Selection Lists</span>
- <div dojoType="dijit.Menu">
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/picklist/list';">
- My Selection Lists
- </div>
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/picklist/bib_search';">
- Title Search
- </div>
- </div>
- </div>
-
- <!-- ==========================================================================
- Purchase Order SubMenu
- ========================================================================== -->
- <div dojoType="dijit.PopupMenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy">
- <span>Purchase Orders</span>
- <div dojoType="dijit.Menu">
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/po/search';">
- PO Search
- </div>
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/po/li_search';">
- Lineitem Search
- </div>
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/po/marc_upload';">
- Load Vendor Order Records
- </div>
- </div>
- </div>
- <!-- ==========================================================================
- Receiving SubMenu
- ========================================================================== -->
- <div dojoType="dijit.PopupMenuItem"
- iconClass="dijitEditorIcon dijitEditorIconCopy">
- <span>Receiving</span>
- <div dojoType="dijit.Menu">
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/receiving/process';">
- Receiving
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <!--
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Serials')}</span>
- <div dojoType="dijit.Menu">
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy" onClick="alert('not yet...');">Test</div>
- </div>
- </div>
- -->
-
-
- <div dojoType="dijit.form.DropDownButton">
- <span>${('Admin')}</span>
- <div dojoType="dijit.Menu">
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/fund/list';">Funds</div>
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/funding_source/list';">Funding Sources</div>
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/provider/list';">Providers</div>
- <!--
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy" onclick='alert("not yet...");'
- onClick="return false;location.href = '${c.oils.core.prefix.value}/acq/fund/list';">Distribution Patterns</div>
- -->
- <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
- onClick="location.href = '${c.oils.core.prefix.value}/acq/currency_type/list';">Currency Types</div>
- </div>
- </div>
- </div>
-</div>
-
+++ /dev/null
-<script>
- /* Create a simple data store to organize the menu options */
- dojo.require("dijit.Tree");
- dojo.require("dojo.data.ItemFileReadStore");
-
- var menuData = {
- data : {
- label: 'label',
- identifier: 'id',
- items: [
- <%include file='acq/navigate.js'/>,
- /** add navigation files as needed */
- ]
- }
- };
- var menuStore = new dojo.data.ItemFileReadStore(menuData);
- //dojo.addOnLoad(function(){oilsMenuTree.expand()});
-</script>
-
-<div dojoType="dijit.Tree" jsId='oilsMenuTree' store="menuStore" label="${_('Menu')}">
- <script type="dojo/method" event="onClick" args="item">
- if(item.dest)
- location.href = '${c.oils.core.prefix.value}/' + item.dest;
- </script>
-</div>
+++ /dev/null
-"""Pylons application test package
-
-When the test runner finds and executes tests within this directory,
-this file will be loaded to setup the test environment.
-
-It registers the root directory of the project in sys.path and
-pkg_resources, in case the project hasn't been installed with
-setuptools. It also initializes the application via websetup (paster
-setup-app) with the project's test.ini configuration file.
-"""
-import os
-import sys
-from unittest import TestCase
-
-import pkg_resources
-import paste.fixture
-import paste.script.appinstall
-from paste.deploy import loadapp
-from routes import url_for
-
-__all__ = ['url_for', 'TestController']
-
-here_dir = os.path.dirname(os.path.abspath(__file__))
-conf_dir = os.path.dirname(os.path.dirname(here_dir))
-
-sys.path.insert(0, conf_dir)
-pkg_resources.working_set.add_entry(conf_dir)
-pkg_resources.require('Paste')
-pkg_resources.require('PasteScript')
-
-test_file = os.path.join(conf_dir, 'test.ini')
-cmd = paste.script.appinstall.SetupCommand('setup-app')
-cmd.run([test_file])
-
-class TestController(TestCase):
-
- def __init__(self, *args, **kwargs):
- wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
- self.app = paste.fixture.TestApp(wsgiapp)
- TestCase.__init__(self, *args, **kwargs)
+++ /dev/null
-from oilsweb.tests import *
-
-class TestAcqController(TestController):
-
- def test_index(self):
- response = self.app.get(url_for(controller='acq'))
- # Test response...
+++ /dev/null
-from oilsweb.tests import *
-
-class TestAdminController(TestController):
-
- def test_index(self):
- response = self.app.get(url_for(controller='admin'))
- # Test response...
+++ /dev/null
-from oilsweb.tests import *
-
-class TestBaseController(TestController):
-
- def test_index(self):
- response = self.app.get(url_for(controller='base'))
- # Test response...
+++ /dev/null
-"""Setup the oilsweb application"""
-import logging
-
-from paste.deploy import appconfig
-from pylons import config
-
-from oilsweb.config.environment import load_environment
-
-log = logging.getLogger(__name__)
-
-def setup_config(command, filename, section, vars):
- """Place any commands to setup oilsweb here"""
- conf = appconfig('config:' + filename)
- load_environment(conf.global_conf, conf.local_conf)
+++ /dev/null
-[egg_info]
-tag_build = dev
-tag_svn_revision = true
-
-[easy_install]
-find_links = http://www.pylonshq.com/download/
-
-[pudge]
-theme = pythonpaste.org
-
-# Add extra doc files here with spaces between them
-docs = docs/index.txt
-
-# Doc Settings
-doc_base = docs/
-dest = docs/html
-
-# Add extra modules here separated with commas
-modules = oilsweb
-title = Oilsweb
-organization = Pylons
-
-# Highlight code-block sections with Pygments
-highlighter = pygments
-
-# Optionally add extra links
-#organization_url = http://pylonshq.com/
-#trac_url = http://pylonshq.com/project
-settings = no_about=true
-
-# Optionally add extra settings
-# link1=/community/ Community
-# link2=/download/ Download
-
-[publish]
-doc-dir=docs/html
-make-dirs=1
-
-# Babel configuration
-[compile_catalog]
-domain = oilsweb
-directory = oilsweb/i18n
-statistics = true
-
-[extract_messages]
-add_comments = TRANSLATORS:
-output_file = oilsweb/i18n/oilsweb.pot
-width = 80
-
-[init_catalog]
-domain = oilsweb
-input_file = oilsweb/i18n/oilsweb.pot
-output_dir = oilsweb/i18n
-
-[update_catalog]
-domain = oilsweb
-input_file = oilsweb/i18n/oilsweb.pot
-output_dir = oilsweb/i18n
-previous = true
+++ /dev/null
-try:
- from setuptools import setup, find_packages
-except ImportError:
- from ez_setup import use_setuptools
- use_setuptools()
- from setuptools import setup, find_packages
-
-setup(
- name='oilsweb',
- version="",
- #description='',
- #author='',
- #author_email='',
- #url='',
- install_requires=["Pylons>=0.9.6.1"],
- packages=find_packages(exclude=['ez_setup']),
- include_package_data=True,
- test_suite='nose.collector',
- package_data={'oilsweb': ['i18n/*/LC_MESSAGES/*.mo']},
- #message_extractors = {'oilsweb': [
- # ('**.py', 'python', None),
- # ('templates/**.mako', 'mako', None),
- # ('public/**', 'ignore', None)]},
- entry_points="""
- [paste.app_factory]
- main = oilsweb.config.middleware:make_app
-
- [paste.app_install]
- main = pylons.util:PylonsInstaller
- """,
-)
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns='http://www.w3.org/1999/xhtml' lang='${locale}' xml:lang='${locale}'>
+ <head>
+ <link rel='stylesheet' type='text/css'
+ href='[% ctx.media_prefix %]/css/skin/[% ctx.skin %].css'></link>
+ <link rel='stylesheet' type='text/css'
+ href='[% ctx.media_prefix %]/css/theme/[% ctx.skin %].css'></link>
+ <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js"
+ djConfig="parseOnLoad: true, isDebug:true"></script>
+ <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/md5.js"></script>
+ <script>
+ var oilsCookieBase = '[% ctx.base_uri %]';
+ </script>
+ <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/base.js"></script>
+ </head>
+ <body class='tundra'>
+
+ <!-- general purpose login dialog -->
+ <div style='display:none;' dojoType="dijit.Dialog" jsId='oilsLoginDialog' class='oils-login-dialog'>
+ <b>Please Login</b>
+ <form onsubmit='oilsDoLogin();'>
+ <table>
+ <tr>
+ <td>Username</td>
+ <td><input type='dijit.form.TextBox' id='oils-login-username'/></td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td><input type='dijit.form.TextBox' id='oils-login-password' type='password'/></td>
+ </tr>
+ <tr>
+ <td colspan='2'>
+ <button type='submit' dojoType='dijit.form.Button'>Login</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ [% content %]
+ </body>
+</html>
--- /dev/null
+[%#-
+This template creates a split screen Dojo layout. The top frame
+of the screen holds a list of of JUBs, or titles. Clicking on a
+title in the top frame will load the purchase details for all the
+copies on order for that title into the bottom frame.
+
+To create a display for a set of JUBs, create a Dojo store and
+model for the set of JUBs, then place the following lines in your
+HTML where you want the display to appear:
+
+ <%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
+ ${jubgrid.jubgrid('dom_prefix', 'grid_jsid')}
+
+where 'dom_prefix' is a string that will be used as the prefix
+for the DOM notes that are created by this template, and
+'grid_jsid' is a valid JavaScript identifier that will name the
+DOM node to which the list of JUBs will be attached. For example
+
+ ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid', hideDetails)}
+
+will create a Dojo grid with the DOM id of
+
+ 'oils-acq-picklist-JUB-grid'
+
+and a jsid of
+
+ pickListGrid
+
+To fill the grid with data, call the javascript function
+
+ JUBGrid.populate(grid_jsid, model)
+
+'grid_jsid' is the same javascript id that was used to
+instantiate the template, and model is a javascript variable
+pointing to the JUB model (and store) that you have created.
+-#%]
+
+[% UNLESS hide_details %]
+<div dojoType='dijit.layout.ContentPane' style='height:100%;'>
+[% END %]
+
+ <style type='text/css'>
+ .grid_container {width: 100%; height: 100%;}
+ </style>
+
+ <script src='[% ctx.media_prefix %]/js/ui/default/acq/common/jubgrid.js'> </script>
+ <script src='[% ctx.media_prefix %]/js/dojo/openils/CopyLocation.js'> </script>
+ <script type="text/javascript">
+ JUBGrid.getPO = function(rowIndex) {
+ var data = JUBGrid.jubGrid.model.getRow(rowIndex);
+ if (!(data && data.purchase_order)) return '';
+ return "<a href='[% ctx.base_uri %]/acq/po/view/" + data.purchase_order+"'>"+data.purchase_order+"</a>";
+ }
+ JUBGrid.jubGridLayout = [{
+ //noscroll: true,
+ cells: [[
+ {name: 'ID', field: 'id', width:'auto'},
+ {name: 'Title', width: "180px", get:JUBGrid.getJUBTitle},
+ {name: 'Author', get:JUBGrid.getJUBAuthor, width:'auto'},
+ {name: 'ISBN', get:JUBGrid.getJUBIsbn, width:'auto'},
+ {name: 'Pubdate', get:JUBGrid.getJUBPubdate, width:'auto'},
+ {name: 'Actual Price',
+ field:'actual_price',
+ get:JUBGrid.getJUBActualPrice,
+ editor:dojox.grid.editors.Dijit, width:'auto',
+ editorClass: "dijit.form.CurrencyTextBox"
+ },
+ {name: 'Estimated Price',
+ field:'estimated_price',
+ get:JUBGrid.getJUBEstimatedPrice, width:'auto',
+ editor:dojox.grid.editors.Dijit,
+ editorClass: "dijit.form.CurrencyTextBox"
+ },
+ {name: 'Vendor', width:'auto',
+ field: 'provider', get:JUBGrid.getProvider,
+ editor:openils.editors.ProviderSelectEditor,
+ },
+ {name: 'No. Copies', field: 'item_count', width:'auto'},
+ {name: 'State', field: 'state', width:'auto'},
+ {name: 'PO', get:JUBGrid.getPO, width:'auto'}
+ ]]
+ }];
+
+ JUBGrid.jubDetailGridLayout = [{
+ cells: [[
+ {name:"ID", field:"id"},
+ {name:"Fund", field:"fund",
+ get:JUBGrid.getLIDFundCode,
+ editor: openils.editors.FundSelectEditor,
+ },
+ {name:"Branch", field:"owning_lib",
+ get:JUBGrid.getLIDLibName,
+ editor: openils.editors.OrgUnitSelectEditor
+ },
+ {name:"Barcode", field:"barcode", width:'auto',
+ editor:dojox.grid.editors.Dijit,
+ editorClass: "dijit.form.TextBox"
+ },
+ {name:"Call Number", field:"cn_label", width:'auto',
+ editor:dojox.grid.editors.Dijit,
+ editorClass: "dijit.form.TextBox"
+ },
+ {name:"Shelving Location", field:"location", width:'auto',
+ editor:openils.editors.CopyLocationSelectEditor,
+ get:JUBGrid.getCopyLocation
+ },
+ {name:"Receive Time", width:'auto',
+ get:JUBGrid.getRecvTime
+ },
+ ]]
+ }];
+
+ JUBGrid.jubDetailGridLayoutReadOnly = [{
+ cells: [[
+ {name:'ID', field:"id"},
+ {name:'Fund', field:"fund",
+ get:JUBGrid.getLIDFundCode,
+ },
+ {name:'Branch', field:"owning_lib",
+ get:JUBGrid.getLIDLibName,
+ },
+ {name:'Barcode', field:"barcode", width:'auto'},
+ {name:'Call Number', field:"cn_label", width:'auto'},
+ {name:'Shelving Location', field:"location",
+ width:'auto', get:JUBGrid.getCopyLocation},
+ ]]
+ }];
+ </script>
+
+[% UNLESS hide_details %]
+ <!-- button bar for lineitems -->
+ <script>JUBGrid.showDetails = true;</script>
+ <div id="[% domprefix %]-container" class='container'
+ dojoType="dijit.layout.ContentPane" sizeMin="" sizeShare="">
+ <div dojoType="dijit.layout.ContentPane"
+ id='[% domprefix %]-jub-buttonbar'>
+ <button dojoType="dijit.form.Button" onclick="JUBGrid.approveJUB">
+ Approve Selected Titles
+ </button>
+ <button dojoType="dijit.form.Button" onclick="JUBGrid.removeSelectedJUBs">
+ Remove Selected Titles
+ </button>
+ </div>
+ </div>
+ <div style='height:40%;'>
+[% ELSE %]
+ <div style='height:100%;'>
+[% END %]
+ <div structure='JUBGrid.jubGridLayout' jsid='[% grid_jsid %]' class='grid_container'
+ dojoType='dojox.Grid' id="[% domprefix %]-JUB-grid">
+ </div>
+ </div>
+[% UNLESS hide_details %]
+ <!-- button bar for lineitem details -->
+ <div dojoType="dijit.layout.ContentPane" sizeMin="" sizeShare="" class='container'>
+ <div dojoType="dijit.layout.ContentPane" id='[% domprefix %]-details-buttonbar'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Copy</span>
+ <div dojoType="dijit.TooltipDialog" execute="JUBGrid.createLID(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ new openils.User().buildPermOrgSelector('MANAGE_FUND', copyOwnerSelect);
+ openils.acq.Fund.buildPermFundSelector('MANAGE_FUND', acqlidFund);
+ </script>
+ <table class="dijitTooltipTable">
+ <tr>
+ <td><label for="fund">Fund: </label></td>
+ <td>
+ <input dojoType="openils.widget.FundSelector"
+ jsId="acqlidFund" searchAttr="name" autocomplete="true" name="fund"></input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="owning_lib">Location: </label></td>
+ <td><input dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId="copyOwnerSelect"
+ searchAttr="shortname"
+ name="owning_lib" autocomplete="true"
+ labelAttr="shortname"></input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="center">
+ <button dojotype="dijit.form.Button" type="submit">
+ Create
+ </button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <button dojoType='dijit.form.Button' onclick='JUBGrid.deleteLID'>
+ Delete Selected Copy
+ </button>
+ <button dojoType='dijit.form.Button' onclick='JUBGrid.receiveLID'>
+ Mark Selected Copies Received
+ </button>
+ </div>
+ </div>
+ <!-- end button bar -->
+
+ <div style='height:40%;'>
+ <div class='grid_container'>
+ <div structure='JUBGrid.jubDetailGridLayout' jsid="JUBGrid.jubDetailGrid" dojoType="dojox.Grid"
+ id='[% domprefix %]-details-grid'>
+ </div>
+ </div>
+ </div>
+</div>
+[% END %]
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>Currency Types</div>
+</div>
+
+<!-- load the page-specific JS -->
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_currency_types.js'> </script>
+
+<script type="text/javascript">
+ function createCT(fields) {
+ alert('create: ' + fields.code);
+ }
+</script>
+
+<div class='oils-acq-actions-div'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Currency Type</span>
+
+ <div dojoType="dijit.TooltipDialog" execute="createCT(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ // XXX check perm and disable button if necessary ...
+ //globalUser.buildPermOrgSelector('ADMIN_CURRENCY_TYPE', currencyTypeOwnerSelect);
+ </script>
+
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="label">Label: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="label"></td>
+ </tr>
+ <tr>
+ <td><label for="name">Code: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="code"></td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Create</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <button dojoType="dijit.form.Button" onclick="deleteSelectedCT()">
+ Delete Selected
+ </button>
+</div>
+
+<!-- The main grid lives here -->
+<script>
+ var currencyTypeListGridStructure = [{
+ cells : [[
+ {name: 'Code', field:'code'},
+ {name: 'Label', field:'label', width:'auto'}
+ ]]
+ }];
+</script>
+<div jsId='currencyTypeListGrid' dojoType="dojox.Grid" structure='currencyTypeListGridStructure'></div>
+[% END %]
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>Funding Sources</div>
+</div>
+
+<!-- load the page-specific JS -->
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_funding_sources.js'> </script>
+
+<script type="text/javascript">
+ function createFS(fields) {
+ /** Creates a new funding source */
+ openils.acq.FundingSource.create(
+ fields,
+ function(fsId) {
+ var evt = openils.Event.parse(fsId);
+ if(evt) {
+ alert(evt); /* XXX */
+ return;
+ } else {
+ location.href = /* go to the details page for this fs */
+ '[% ctx.base_uri %]/acq/funding_source/view/'+fsId;
+ }
+ }
+ );
+ }
+</script>
+
+<div class='oils-acq-actions-div'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Funding Source</span>
+
+ <div dojoType="dijit.TooltipDialog" execute="createFS(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ openils.acq.CurrencyType.loadSelectWidget(fsCurrencySelector);
+ new openils.User().buildPermOrgSelector('ADMIN_FUNDING_SOURCE', fsOwnerSelect);
+ </script>
+
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="name">Name: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="name"></td>
+ </tr>
+ <tr>
+ <td><label for="name">Code: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="code"></td>
+ </tr>
+ <tr>
+ <td><label for="currency_type">Currency Type:</label></td>
+ <td>
+ <input jsId='fsCurrencySelector' name="currency_type"
+ dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td valign='top'><label for="owner">Owning Location:</label></td>
+ <td>
+ <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fsOwnerSelect'
+ searchAttr="shortname" name="owner" autocomplete="true" labelAttr='shortname'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Create</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <button dojoType="dijit.form.Button"
+ onclick="openils.acq.FundingSource.deleteFromGrid(
+ fundingSourceListGrid, function(){location.href = location.href})">
+ Delete Selected
+ </button>
+</div>
+
+<!-- The main grid lives here -->
+<script>
+ function getName(rowIndex) {
+ data = fundingSourceListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="[% ctx.base_uri %]/acq/funding_source/view/'+data.id+'">'+data.name+'</a>';
+ }
+
+ var fsGridStructure = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', width:'auto', get:getName},
+ {name: 'Code', field:'code'},
+ {name: 'Owner', width:'auto', get:getOrgInfo},
+ {name: 'Currency Type', field: "currency_type"},
+ {name: 'Balance', get:getBalanceInfo}
+ ]]
+ }];
+</script>
+<div id="oils-acq-funding-source-list-grid" jsId='fundingSourceListGrid' dojoType="dojox.Grid" structure='fsGridStructure'></div>
+[% END %]
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>Funds</div>
+</div>
+
+<!-- load the page-specific JS -->
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_funds.js'> </script>
+
+<script type="text/javascript">
+ function createFund(fields) {
+ /** Creates a new fund source */
+ openils.acq.Fund.create(
+ fields,
+ function(fundId) {
+ var evt = openils.Event.parse(fundId);
+ if(evt) {
+ alert(evt); /* XXX */
+ return;
+ } else {
+ location.href = /* go to the details page for this fund */
+ '[% ctx.base_uri %]/acq/fund/view/'+fundId;
+ }
+ }
+ );
+ }
+</script>
+
+<div class='oils-acq-actions-div'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Fund</span>
+
+ <div dojoType="dijit.TooltipDialog" execute="createFund(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ openils.acq.CurrencyType.loadSelectWidget(fundCurrencySelector);
+ new openils.User().buildPermOrgSelector('ADMIN_FUND', fundOwnerSelect);
+ </script>
+
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="name">Name: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="name"></td>
+ </tr>
+ <tr>
+ <td><label for="name">Code: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="code"></td>
+ </tr>
+ <tr>
+ <td><label for="year">Year: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="year"></td>
+ </tr>
+ <tr>
+ <td><label for="currency_type">Currency Type: </label></td>
+ <td>
+ <input jsId='fundCurrencySelector' name="currency_type"
+ dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td valign='top'><label for="org">Owning Location: </label></td>
+ <td>
+ <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fundOwnerSelect'
+ searchAttr="shortname" name="org" autocomplete="true" labelAttr='shortname'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Create</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <button dojoType="dijit.form.Button"
+ onclick="openils.acq.Fund.deleteFromGrid(
+ fundListGrid, function(){location.href = location.href})">
+ Delete Selected
+ </button>
+
+ <label>Year</label>
+ <select dojoType='dijit.form.FilteringSelect' onchange='filterGrid();' style='width:100px;'
+ jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
+</div>
+
+<!-- The main grid lives here -->
+<script>
+ function getName(rowIndex) {
+ data = fundListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="[% ctx.base_uri %]/acq/fund/view/'+data.id+'">'+data.name+'</a>';
+ }
+
+ var fundListGridStructure = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', width:'auto', get:getName},
+ {name: 'Code', field:'code'},
+ {name: 'Year', field: "year"},
+ {name: 'Location', get:getOrgInfo},
+ {name: 'Currency Type', field: "currency_type"},
+ {name: 'Combined Balance', get:getBalanceInfo}
+ ]]
+ }];
+</script>
+<div jsId='fundListGrid' dojoType="dojox.Grid" structure='fundListGridStructure'></div>
+[% END %]
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_providers.js'> </script>
+
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>Providers</div>
+</div>
+
+<div class='oils-acq-actions-div'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Provider</span>
+
+ <div dojoType="dijit.TooltipDialog" execute="createProvider(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ openils.acq.CurrencyType.loadSelectWidget(providerCurrencySelector);
+ new openils.User().buildPermOrgSelector('ADMIN_PROVIDER', providerOwnerSelect);
+ </script>
+
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="name">Name: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="name"></td>
+ </tr>
+ <tr>
+ <td><label for="code">Code: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="code"></td>
+ </tr>
+ <tr>
+ <td><label for="currency_type">Currency Type:</label></td>
+ <td>
+ <input jsId='providerCurrencySelector' name="currency_type"
+ dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td valign='top'><label for="owner">Owning Location:</label></td>
+ <td>
+ <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='providerOwnerSelect'
+ searchAttr="shortname" name="owner" autocomplete="true" labelAttr='shortname'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Create</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+
+
+
+
+<!-- The main grid lives here -->
+<script>
+ function getName(rowIndex) {
+ data = providerListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="[% ctx.base_uri %]/acq/provider/view/'+data.id+'">'+data.name+'</a>';
+ }
+
+ var providerGridStructure = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', get:getName, width:'auto'},
+ {name: 'Code', field:'code'},
+ {name: 'Owner', get:getOrgInfo},
+ {name: 'Currency Type', field: "currency_type"}
+ ]]
+ }];
+</script>
+<div jsId='providerListGrid' dojoType="dojox.Grid" structure='providerGridStructure'></div>
+[% END %]
+
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<script>
+ var fundID = [% ctx.page_args.0 %]
+ function getFundingSource(rowIndex) {
+ data = fundAllocationGrid.model.getRow(rowIndex);
+ if(data) {
+ var fs = openils.acq.FundingSource.retrieve(data.funding_source);
+ return '<a href="[% ctx.base_uri %]/acq/funding_source/view/'+fs.id()+'">'+fs.name()+'</a>';
+ }
+ }
+</script>
+
+<!-- load the page-specific JS -->
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_fund.js'> </script>
+
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>Fund Details</div>
+</div>
+
+<div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
+ <!-- Dropdown menu for creating a new funding source credit -->
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Create Allocation</span>
+ <div dojoType="dijit.TooltipDialog" execute="createAllocation(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ openils.acq.FundingSource.createStore(
+ function(store) {
+ fundingSourceSelector.store =
+ new dojo.data.ItemFileReadStore({data:store});
+ fundingSourceSelector.setValue(store.items[0].code);
+ }, 'MANAGE_FUNDING_SOURCE'
+ );
+ </script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="amount">Funding Source: </label></td>
+ <td>
+ <input jsId='fundingSourceSelector' name="funding_source"
+ dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">Amount: </label></td>
+ <td>
+ <!-- XXX get currency from funding source ... -->
+ <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">Percent: </label></td>
+ <td>
+ <input
+ dojoType="dijit.form.NumberTextBox"
+ constraints="{min:0,max:100}"
+ promptMessage="Please enter an amount between 0 and 100"
+ name="percent">
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="note">Note: </label></td>
+ <td>
+ <input dojoType="dijit.form.TextBox" name="note"> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Apply</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.layout.TabContainer">
+ <div dojoType="dijit.layout.ContentPane"
+ class='oils-acq-detail-content-pane' title="Summary" selected='true'>
+ <script>
+ /** Define the columns for the fund grid ----- */
+ var fundGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', field: "name", width:'auto'},
+ {name: 'Code', field: "code"},
+ {name: 'Currency Type', field: "currency_type"},
+ {name: 'Owner', get:getOrgInfo},
+ /*
+ {name: 'Balance (Total - (Spent + Encumbrances))")}', get:getSummaryInfo},
+ {name: 'Amount Allocated to this Fund")}', get:getSummaryInfo},
+ {name: 'Spent Balance (Total - Spent)")}', get:getSummaryInfo},
+ {name: 'Total Debits (Spent + Encumbered)")}', get:getSummaryInfo},
+ */
+ {name: 'Balance', get:getSummaryInfo, field:'combined_balance'},
+ {name: 'Total Allocated', get:getSummaryInfo, field:'allocation_total'},
+ {name: 'Spent Balance', get:getSummaryInfo, field:'spent_balance'},
+ {name: 'Total Debits', get:getSummaryInfo, field:'debit_total'},
+ {name: 'Total Spent', get:getSummaryInfo, field:'spent_total'},
+ {name: 'Total Encumbered', get:getSummaryInfo, field:'encumbrance_total'}
+ ]]
+ }];
+ </script>
+ <div jsId='fundGrid' dojoType="dojox.Grid" structure='fundGridLayout'> </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
+ <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
+ <script>
+ /** Define the columns for the funding source allocations grid ----- */
+ var fundAllocationGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Funding Source', field: "fund", get:getFundingSource},
+ {name: 'Amount', field: "amount"},
+ {name: 'Percent', field: "percent"},
+ {name: 'Allocated By', field: "allocator"},
+ {name: 'Note', field: "note", width:'auto'},
+ ]]
+ }];
+ </script>
+ <div jsId='fundAllocationGrid' dojoType="dojox.Grid" structure='fundAllocationGridLayout'> </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Debits">
+ <script type='dojo/connect' event='onShow'>loadDebitGrid();</script>
+ <script>
+ /** Define the columns for the funding source credits grid ----- */
+ var fundDebitGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Origin Amount', field: "origin_amount"},
+ {name: 'Origin Currency Type', field: "origin_currency_type"},
+ {name: 'Amount', field: "amount"},
+ {name: 'Encumbrance', field: "encumbrance"},
+ {name: 'Debit Type', field: "debit_type"},
+ {name: 'Transfer Destination', field: "xfer_destination", get:getXferDest},
+ ]]
+ }];
+ </script>
+ <div jsId='fundDebitGrid' dojoType="dojox.Grid" structure='fundDebitGridLayout'> </div>
+ </div>
+ </div>
+</div>
+[% END %]
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<script>
+ var fundingSourceID = [% ctx.page_args.0 %];
+ function getFund(rowIndex) {
+ data = fsAllocationGrid.model.getRow(rowIndex);
+ if(data) {
+ var fund = openils.acq.Fund.retrieve(data.fund);
+ return '<a href="[% ctx.base_uri %]/acq/fund/view/'+fund.id()+'">'+fund.code()+'</a>';
+ }
+ }
+</script>
+
+<!-- load the page-specific JS -->
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_funding_source.js'> </script>
+
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>Funding Source Details</div>
+</div>
+
+<div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
+
+ <!-- Dropdown menu for creating a new funding source credit -->
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Apply Credit</span>
+ <div dojoType="dijit.TooltipDialog" execute="applyFSCredit(arguments[0]);">
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="amount">Amount: </label></td>
+ <td>
+ <!-- XXX get currency from funding source ... -->
+ <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="note">Note: </label></td>
+ <td>
+ <input dojoType="dijit.form.TextBox" name="note"> </input>
+ <!-- XXX textarea makes more sense, but it's buggy in the dropdown dialog .. perhaps a height issue?
+ <textarea dojoType='dijit.form.Textarea' name="note" style='min-height:6em'>
+ </textarea>
+ -->
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Apply</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Allocate to Fund</span>
+ <div dojoType="dijit.TooltipDialog" execute="applyFSAllocation(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ openils.acq.Fund.createStore(
+ function(store) {
+ fundingSourceFundSelector.store =
+ new dojo.data.ItemFileReadStore({data:store});
+ fundingSourceFundSelector.setValue(store.items[0].code);
+ }, 'MANAGE_FUND'
+ );
+ </script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="amount">Fund: </label></td>
+ <td>
+ <input jsId='fundingSourceFundSelector' name="fund"
+ dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">Amount: </label></td>
+ <td>
+ <!-- XXX get currency from funding source ... -->
+ <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">Percent: </label></td>
+ <td>
+ <input
+ dojoType="dijit.form.NumberTextBox"
+ constraints="{min:0,max:100}"
+ promptMessage="Please enter an amount between 0 and 100"
+ name="percent">
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="note">Note: </label></td>
+ <td>
+ <input dojoType="dijit.form.TextBox" name="note"> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Apply</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.layout.TabContainer">
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Summary" selected='true'>
+ <script type='dojo/connect' event='onShow'>loadFSGrid();</script>
+ <script>
+ /** Define the columns for the funding source grid ----- */
+ var fundingSourceGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', field: "name", width:'auto'},
+ {name: 'Code', field: "code"},
+ {name: 'Balance', get:getSummaryInfo, field:'balance'},
+ {name: 'Total Credits', get:getSummaryInfo, field:'credit_total'},
+ {name: 'Total Debits', get:getSummaryInfo, field:'allocation_total'},
+ {name: 'Currency Type', field: "currency_type"},
+ {name: 'Owner', field: "owner", width:'auto', get:getOrgInfo},
+ ]]
+ }];
+ </script>
+ <div jsId='fundingSourceGrid' dojoType="dojox.Grid" structure='fundingSourceGridLayout'> </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Credits">
+ <script type='dojo/connect' event='onShow'>loadCreditGrid();</script>
+ <script>
+ /** Define the columns for the funding source credits grid ----- */
+ var fsCreditGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Amount', field: "amount"},
+ {name: 'Note', field: "note", width:'auto'},
+ ]]
+ }];
+ </script>
+ <div jsId='fsCreditGrid' dojoType="dojox.Grid" structure='fsCreditGridLayout'> </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
+ <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
+ <script>
+ /** Define the columns for the funding source allocations grid ----- */
+ var fsAllocationGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Fund', field: "fund", get:getFund},
+ {name: 'Amount', field: "amount"},
+ {name: 'Percent', field: "percent"},
+ {name: 'Allocated By', field: "allocator"},
+ {name: 'Note', field: "note", width:'auto'},
+ ]]
+ }];
+ </script>
+ <div jsId='fsAllocationGrid' dojoType="dojox.Grid" structure='fsAllocationGridLayout'> </div>
+ </div>
+ </div>
+</div>
+[% END %]
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+<script>var providerId = [% ctx.page_args.0 %]</script>
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_provider.js'> </script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.layout.TabContainer">
+ <div dojoType="dijit.layout.ContentPane"
+ class='oils-acq-detail-content-pane' title="Summary" selected='true' style='height:400px;'>
+ <script>
+ var providerGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', field: "name", width:'auto'},
+ {name: 'Code', field:'code'},
+ {name: 'Owner', get:getOrgInfo},
+ {name: 'Currency Type', field: "currency_type"},
+ ]]
+ }];
+ </script>
+ <div jsId='providerGrid' dojoType="dojox.Grid" structure='providerGridLayout'> </div>
+ </div>
+
+ <!--
+ Provider order record data types
+ -->
+ <div dojoType="dijit.layout.ContentPane"
+ class='oils-acq-detail-content-pane' title="Order Record Format" style='height:400px;'>
+
+ <div class='oils-acq-actions-div' style='margin:8px;'>
+
+ <!--
+ Dropdown menu for creating a new order record data type
+ -->
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Create Order Record Field</span>
+ <div dojoType="dijit.TooltipDialog" execute="createOrderRecordField(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>setORDesc();</script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="code">Code: </label></td>
+ <td>
+ <select id='oils-acq-provider-or-code' name="code" dojoType="dijit.form.ComboBox">
+ <script type='dojo/connect' event='onChange'>setORDesc();</script>
+ <option value='fund_code'>Fund Code</option>
+ <option value='shelving_location'>Shelving Location</option>
+ <option value='quantity'>Quantity</option>
+ <option value='order_date'>Order Date</option>
+ <option value='volume_count'>Volume Count </option>
+ <option value='currency_type'>Currency Type</option>
+ <option value='internal_notes'>Internal Notes </option>
+ <option value='vendor_notes'>Vendor Notes</option>
+ <option value='estimated_price'>Estimated Price</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="description">Description: </label></td>
+ <td><input id='oils-acq-provider-or-desc' dojoType="dijit.form.TextBox" name="description"> </input></td>
+ </tr>
+ <tr>
+ <td><label for="amount">Tag: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="tag"></input></td>
+ </tr>
+ <tr>
+ <td><label for="amount">Subfield: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="subfield"></input></td>
+ </tr>
+ <tr>
+ <td><label for="ident">Identifer Field?: </label></td>
+ <td>
+ <select dojoType="dijit.form.FilteringSelect" name="ident">
+ <option value='f' selected='selected'>False</option>
+ <option value='t'>True</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">XPath (advanced): </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="xpath"></input></td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Apply</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <!--
+ Delete order record data types button
+ -->
+ <button dojoType="dijit.form.Button" onclick='deleteORDataFields();'>
+ Delete Selected
+ </button>
+ </div>
+
+ <script type='dojo/connect' event='onShow'>loadPADGrid();</script>
+ <script>
+ var padGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Code', field:'code', width:'auto'},
+ {name: 'Description', field: "description", width:'auto'},
+ {name: 'Tag', get:getTag},
+ {name: 'Subfield', get:getSubfield},
+ {name: 'Identifier', field:'ident'},
+ {name: 'XPath', field:'xpath', width:'auto'}
+ ]]
+ }];
+ </script>
+ <div jsId='padGrid' dojoType="dojox.Grid" structure='padGridLayout'> </div>
+ </div>
+ </div>
+</div>
+[% END %]
+
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/bib_search.js'> </script>
+<style>
+ @import "[% ctx.media_prefix %]/js/dojo/dojox/form/resources/CheckedMultiSelect.css";
+</style>
+
+<script>
+ var searchOffset = 0;
+</script>
+
+<div id='oils-acq-search-block' class='container'>
+ <form dojoType='dijit.form.Form' action='' method=''>
+ <script type="dojo/method" event="onSubmit">
+ doSearch(this.getValues());
+ return false; /* don't redirect */
+ </script>
+ <div id='oils-acq-search-sources-block'>
+ <div id='oils-acq-search-sources-label'>Search Sources</div>
+ <select style='overflow-y:auto;' id='oils-acq-search-source-select'
+ multiple='true' jsId="bibSourceSelect" dojoType="dojox.form.CheckedMultiSelect">
+ <option value='native-evergreen-catalog'>Evergreen Catalog</option>
+ </select>
+ <div id='oils-acq-search-progress'>
+ <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
+ </div>
+ <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
+ </div>
+ <div id='oils-acq-search-form-block'>
+ <div id='oils-acq-search-fields-label'>Search Fields</div>
+ <div id='oils-acq-search-fields'>
+ </div>
+ <table>
+ <tbody id='oils-acq-search-fields-tbody'>
+ <tr id='oils-acq-search-fields-template'>
+ <td name='label'> </td>
+ <td name='input'> </td>
+ </tr>
+ <tr id='oils-acq-seach-fields-count-row'>
+ <td name='label'>Hits Per Source</td>
+ <td><input name='limit'
+ dojoType='dijit.form.NumberSpinner'
+ constraints='{min:5,max:50}'
+ value='10'></input>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div id='oils-acq-search-fields-submit-block'>
+ <div dojoType='dijit.form.Button' type='submit'>Submit</div>
+ </div>
+ </div>
+ </div>
+</form>
+<div id='oils-acq-pl-search-results' style='height:100%'>
+ <script>
+ dojo.require('dijit.form.FilteringSelect');
+ dojo.require('dijit.Dialog');
+ </script>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Save Results</span>
+ <div dojoType="dijit.TooltipDialog" execute="saveResults(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ loadPLSelect();
+ </script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td colspan='2'>
+ <input dojoType="dijit.form.RadioButton" name="which" type='radio' checked='checked' value='selected'/>
+ <label for="name">Save selected</label>
+ <input dojoType="dijit.form.RadioButton" name="which" type='radio' value='all'/>
+ <label for="name">Save all</label>
+ </td>
+ </tr>
+ <tr><td colspan='2'><hr/></td></tr>
+ <tr>
+ <td><label for="new_name">Save as picklist: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="new_name"/></td>
+ </tr>
+ <tr>
+ <td><label for="existing_pl">Add to picklist: </label></td>
+ <td>
+ <input jsId='plAddExistingSelect' dojoType="dijit.form.FilteringSelect"
+ name="existing_pl" searchAttr='name' displayAttr='name'/>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Save</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ [% grid_jsid = 'plResultGrid'; domprefix = 'oils-acq-lineitem'; hide_details = 1 %]
+ [% INCLUDE 'default/acq/common/jubgrid.tt2' %]
+</div>
+<script>dojo.style('oils-acq-pl-search-results', 'visibility', 'hidden');</script>
+[% END %]
+
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-picklist-my-list-header'>
+ <div id='oils-acq-list-header-label'>My Picklists</div>
+ </div>
+ <div id='oils-acq-picklist-all-list-header'>
+ <div id='oils-acq-list-header-label'>All Picklists</div>
+ </div>
+</div>
+
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/view_list.js'> </script>
+
+<script>
+ if(location.href.match(/listall$/)) {
+ listAll = true;
+ dojo.style('oils-acq-picklist-my-list-header', 'visibility', 'hidden');
+ dojo.style('oils-acq-picklist-my-list-header', 'display', 'none');
+ } else {
+ dojo.style('oils-acq-picklist-all-list-header', 'visibility', 'hidden');
+ dojo.style('oils-acq-picklist-all-list-header', 'display', 'none');
+ }
+</script>
+
+<div class='oils-acq-actions-div'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>New Picklist</span>
+ <div dojoType="dijit.TooltipDialog" execute="createPL(arguments[0]);">
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="name">Name:</label></td>
+ <td><input dojoType="dijit.form.TextBox" name="name"></td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Create</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <button dojoType="dijit.form.Button" onclick="deleteFromGrid();">
+ Delete Selected
+ </button>
+</div>
+
+
+<script>
+ function getName(rowIndex) {
+ data = plListGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="[% ctx.base_uri %]/acq/picklist/view/'+data.id+'">'+data.name+'</a>';
+ }
+
+ var plListGridStructure = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Name', width:'auto', get:getName},
+ {name: 'Selector', field:'owner'},
+ {name: 'Create Time', field: 'create_time'},
+ {name: 'Edit Time', field: 'edit_time'},
+ {name: 'Entry Count', field: 'entry_count'},
+ ]]
+ }];
+</script>
+<div jsId='plListGrid' dojoType="dojox.Grid" structure='plListGridStructure'></div>
+[% END %]
--- /dev/null
+[% WRAPPER 'default/base.tt2' %]
+<script type='text/javascript'>
+ dojo.require('dijit.layout.LayoutContainer');
+ dojo.require('dijit.layout.ContentPane');
+ dojo.require('openils.acq.Picklist');
+</script>
+
+<div dojoType="dijit.layout.LayoutContainer" style="height:100%">
+ <div class='container'>
+ <div id='oils-acq-picklist-header'>
+ Picklist
+ <span id='oils-acq-picklist-name'> </span>
+ <div class='oils-acq-picklist-attributes'>
+ <div>Create
+ date: <span id="oils-acq-picklist-attr-cdate"></span></div>
+ <div>Last updated: <span id="oils-acq-picklist-attr-edate"></span></div>
+ <div>Selector: <span id="oils-acq-picklist-attr-owner"></span></div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+ dojo.require('openils.Util');
+ var plist = null;
+ function loadPL() {
+ plist = new openils.acq.Picklist([% ctx.page_args.0 %],
+ function(model) {
+ dojo.byId("oils-acq-picklist-name").innerHTML = plist.name();
+ dojo.byId("oils-acq-picklist-attr-cdate").innerHTML = plist.create_time();
+ dojo.byId("oils-acq-picklist-attr-edate").innerHTML = plist.edit_time();
+ dojo.byId("oils-acq-picklist-attr-owner").innerHTML = plist.owner();
+ JUBGrid.populate(pickListGrid, model, plist._items);
+ }
+ );
+ }
+ openils.Util.addOnLoad(loadPL);
+ </script>
+ [% grid_jsid = 'pickListGrid'; domprefix = 'oils-acq-picklist' %]
+ [% INCLUDE 'default/acq/common/jubgrid.tt2' %]
+</div>
+[% END %]
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+ <script src='[% ctx.media_prefix %]/js/ui/default/acq/po/li_search.js'> </script>
+ <script>
+ var searchLimit = 20;
+ var searchOffset = 0;
+ </script>
+
+ <div id='oils-acq-li-search-block' class='container'>
+ <form dojoType='dijit.form.Form' action='' method=''>
+ <script type="dojo/method" event="onSubmit">
+ doSearch(this.getValues());
+ return false; /* don't redirect */
+ </script>
+ <table class='oils-acq-basic-form-table'>
+ <tr>
+ <td><label for='state'>State</label></td>
+ <td>
+ <select dojoType='dijit.form.FilteringSelect' name='state'>
+ <option value='new'>New</option>
+ <option value='approved'>Approved</option>
+ <option value='in-process'>In Process</option>
+ <option value='received'>Received</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for='provider'>Provider</label></td>
+ <td>
+ <select dojoType='dijit.form.FilteringSelect' name='provider'
+ labalAttr='code' searchAttr='code' jsId='providerSelector'>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'><div dojoType='dijit.form.Button' type='submit'>Search</div></td>
+ </tr>
+ </table>
+ </form>
+ </div>
+
+ <div id='oils-acq-li-search-progress'>
+ <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
+ </div>
+ <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
+
+ <div dojoType="dijit.form.DropDownButton" id='oils-acq-li-search-po-create'>
+ <span>reate PO</span>
+ <div dojoType="dijit.TooltipDialog" execute="createPOFromLineitems(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ buildProviderSelect(newPOProviderSelector,
+ function() {
+ newPOProviderSelector.setValue(providerSelector.getValue());
+ }
+ );
+ new openils.User().buildPermOrgSelector('CREATE_PURCHASE_ORDER', orderingAgencySelect);
+ //new openils.User().buildPermOrgTreePicker('CREATE_PURCHAE_ORDER', 'treee');
+ </script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td colspan='2'>
+ <input dojoType="dijit.form.RadioButton" name="which" type='radio' checked='checked' value='selected'/>
+ <label for="name">For selected items</label>
+ <input dojoType="dijit.form.RadioButton" name="which" type='radio' value='all'/>
+ <label for="name">For all items</label>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="name">Provider: </label></td>
+ <td>
+ <input jsId='newPOProviderSelector' name="provider"
+ dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="name">Ordering Agency:</label></td>
+ <td>
+ <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='orderingAgencySelect'
+ searchAttr="shortname" name="ordering_agency" autocomplete="true" labelAttr='shortname'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="create_assets">Generate Bib/Copy Data</label></td>
+ <td>
+ <input name='create_assets' dojoType='dijit.form.CheckBox' checked='checked'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="create_debits">Encumber funds</label></td>
+ <td>
+ <input name='create_debits' dojoType='dijit.form.CheckBox' checked='checked'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Create</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <script>dojo.style('oils-acq-li-search-po-create', 'visibility', 'hidden');</script>
+ <div id='oils-acq-li-search-result-grid' style='height:100%'>
+ [% grid_jsid = 'liGrid'; domprefix = 'oils-acq-li-search' %]
+ [% INCLUDE 'default/acq/common/jubgrid.tt2' %]
+ </div>
+ <script>dojo.style('oils-acq-li-search-result-grid', 'visibility', 'hidden');</script>
+[% END %]
+
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>PO Search</div>
+</div>
+
+<!-- load the page-specific JS -->
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/po/search.js'> </script>
+
+<script>
+ function getId(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="[% ctx.base_uri %]/acq/po/view/' + data.id + '">'+data.id;
+ }
+</script>
+
+
+<form dojoType='dijit.form.Form' action='' method=''>
+ <script type="dojo/method" event="onSubmit">
+ fields = this.getValues();
+ if(fields.provider == '')
+ delete fields.provider;
+ if(isNaN(fields.id))
+ delete fields.id;
+ doSearch(fields);
+ return false; /* don't redirect */
+ </script>
+ <table class='oils-acq-basic-form-table'>
+ <tr>
+ <td><label for='id'>ID</label></td>
+ <td><input dojoType='dijit.form.NumberTextBox' name='id'> </input></td>
+ </tr>
+ <tr>
+ <td><label for='provider'>Provider</label></td>
+ <td><select labelAttr='code' searchAttr='code' name='provider'
+ style='overflow-y:auto;' jsId="providerSelector" dojoType="dijit.form.FilteringSelect"> </select></td>
+ </tr>
+ <tr>
+ <td><label for='state'>State</label></td>
+ <td>
+ <select dojoType='dijit.form.FilteringSelect' name='state' value=''>
+ <option value='new'>New</option>
+ <option value='in-process'>In Process</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for='ordering_agency'>Ordering Agency</label></td>
+ <td><select jsId='poSearchOrderingAgencySelect' labelAttr='shortname' searchAttr='shortname'
+ dojoType='openils.widget.OrgUnitFilteringSelect' name='ordering_agency'>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td style='text-align:center;'><div dojoType='dijit.form.Button' type='submit'>Search</div></td>
+ </tr>
+ </table>
+</form>
+
+<script>
+ var poGridStructure = [{
+ cells : [[
+ {name: 'ID', field: 'id', get:getId},
+ {name: 'Owner', get:getPOOwner},
+ {name: 'Ordering Agency', get:getOrgInfo},
+ {name: 'Create Time', field:'create_time', get:getDateTimeField, width:'auto'},
+ {name: 'Edit Time', field: "edit_time", get:getDateTimeField, width:'auto'},
+ {name: 'Provider', get:getProvider, width:'auto'},
+ {name: 'State', field:'state'}
+ ]]
+ }];
+</script>
+<div jsId='poGrid' id='po-grid' dojoType="dojox.Grid" structure='poGridStructure'></div>
+<script>dojo.style('po-grid', 'visibility', 'hidden');</script>
+[% END %]
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+<script>
+ var poId = [% ctx.page_args.0 %];
+</script>
+
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/po/view_po.js'> </script>
+
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>PO Details</div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.layout.TabContainer">
+
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Summary" selected='true'>
+ <script type='dojo/connect' event='onShow'>loadPOGrid();</script>
+ <script>
+ var poGridStructure = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Owner', get:getPOOwner},
+ {name: 'Ordering Agency', get:getOrgInfo},
+ {name: 'Create Time', field:'create_time', width:'auto', get:getDateTimeField},
+ {name: 'Edit Time', field: "edit_time", width:'auto', get:getDateTimeField},
+ {name: 'Provider', get:getProvider},
+ {name: '# Lineitems', field: 'lineitem_count'},
+ {name: 'State', field:'state'}
+ ]]
+ }];
+ </script>
+ <div jsId='poGrid' dojoType="dojox.Grid" structure='poGridStructure'> </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Line Items">
+ <script type='dojo/connect' event='onShow'>loadLIGrid();</script>
+ [% grid_jsid = 'liGrid'; domprefix = 'oils-acq-lineitem' %]
+ [% INCLUDE 'default/acq/common/jubgrid.tt2' %]
+ </div>
+ </div>
+</div>
+[% END %]
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+ <script src='[% ctx.media_prefix %]/js/ui/default/acq/receiving/process.js'> </script>
+ <h1>Receiving Processing</h1><br/>
+ <div id='oils-acq-recv-search-block' class='container'>
+ <form dojoType='dijit.form.Form' action='' method=''>
+ <script type="dojo/method" event="onSubmit">
+ doSearch(this.getValues());
+ return false; /* don't redirect */
+ </script>
+ <table class='oils-acq-basic-form-table'>
+ <tr>
+ <td><label for='identifier'>Identifier</label></td>
+ <td>
+ <input dojoType='dijit.form.TextBox' name='identifier'/>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="name">Ordering Agency:</label></td>
+ <td>
+ <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='orderingAgencySelect'
+ searchAttr="shortname" name="ordering_agency" autocomplete="true" labelAttr='shortname'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'><div dojoType='dijit.form.Button' type='submit'>Search</div></td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
+ <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
+ <div id='oils-acq-recv-grid' style='height:100%'>
+ [% grid_jsid = 'liGrid'; domprefix = 'oils-acq-recv' %]
+ [% INCLUDE 'default/acq/common/jubgrid.tt2' %]
+ </div>
+ <script>dojo.style('oils-acq-recv-grid', 'visibility', 'hidden');</script>
+[% END %]
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/settings/li_attr.js'> </script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Lineitem Attribute Attribute</span>
+ <div dojoType="dijit.TooltipDialog" execute="createOrderRecordField(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>//setORDesc();</script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="code">Code:</label></td>
+ <td><input dojoType='dijit.form.TextBox' name='code'/></td>
+ </tr>
+ <tr>
+ <td><label for="description">Description: </label></td>
+ <td><input id='oils-acq-provider-or-desc' dojoType="dijit.form.TextBox" name="description"> </input></td>
+ </tr>
+ <tr>
+ <td><label for="amount">Tag: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="tag"></input></td>
+ </tr>
+ <tr>
+ <td><label for="amount">Subfield: </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="subfield"></input></td>
+ </tr>
+ <tr>
+ <td><label for="ident">Identifer Field?: </label></td>
+ <td>
+ <select dojoType="dijit.form.FilteringSelect" name="ident">
+ <option value='f' selected='selected'>False</option>
+ <option value='t'>True</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="amount">XPath (advanced): </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="xpath"></input></td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Apply</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <script>
+ var liAttrGridLayout = [{
+ cells : [[
+ {name: 'ID', field: 'id'},
+ {name: 'Code', field:'code', width:'auto'},
+ {name: 'Description', field: "description", width:'auto'},
+ {name: 'Tag', get:getTag},
+ {name: 'Subfield', get:getSubfield},
+ {name: 'Identifier', field:'ident'},
+ {name: 'XPath', field:'xpath', width:'auto'}
+ ]]
+ }];
+ </script>
+ <div dojoType="dijit.layout.TabContainer">
+ <div dojoType="dijit.layout.ContentPane"
+ class='oils-acq-detail-content-pane' title="MARC Attributes" style='height:600px;'>
+ <script type='dojo/connect' event='onShow'>loadMarcAttrGrid();</script>
+ <div jsId='liMarcAttrGrid' dojoType="dojox.Grid" structure='liAttrGridLayout'> </div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane"
+ class='oils-acq-detail-content-pane' title="Generated Attributes" style='height:600px;'>
+ <script type='dojo/connect' event='onShow'>loadGeneratedAttrGrid();</script>
+ <div jsId='liGeneratedAttrGrid' dojoType="dojox.Grid" structure='liAttrGridLayout'> </div>
+ </div>
+ </div>
+</div>
+[% END %]
--- /dev/null
+[% WRAPPER 'base.tt2' %]
+<script type="text/javascript">
+ dojo.require("dijit.layout.LayoutContainer");
+ dojo.require("dijit.layout.ContentPane");
+</script>
+
+<!-- define the basic page structure -->
+<div id="oils-base-body-block" class="tundra" dojoType="dijit.layout.LayoutContainer">
+ <div id="oils-base-header-block" dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div id='oils-base-header-menu-block'>
+ [% INCLUDE default/menu.tt2 %]
+ </div>
+ <div id='oils-base-header-auto-login-block'>
+ [% INCLUDE default/header.tt2 %]
+ </div>
+ </div>
+ <div id="oils-base-main-block" dojoType="dijit.layout.LayoutContainer" layoutAlign="client">
+ <div id="oils-base-navigate-block" dojoType="dijit.layout.ContentPane" layoutAlign="left">
+ </div>
+ <div id="oils-base-content-block" dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ [% content %]
+ </div>
+ </div>
+ <div id="oils-base-footer-block" dojoType="dijit.layout.ContentPane" layoutAlign="bottom">
+ [% INCLUDE default/footer.tt2 %]
+ </div>
+</div>
+[% END %]
--- /dev/null
+Powered By <img src='[% ctx.media_prefix %]/images/eg_tiny_logo.jpg'/>
+
--- /dev/null
+<div id='oils-base-header-content-div'>
+ <span id='oils-base-header-user-info'> </span>
+ <script>
+ /*
+ dojo.addOnLoad(function(){
+ dojo.byId('oils-base-header-user-info').appendChild(
+ document.createTextNode(openils.User.user.usrname()));
+ });
+ */
+ </script>
+</div>
--- /dev/null
+<div>
+ <script>
+ dojo.require('dijit.form.Button');
+ dojo.require('dijit.Toolbar');
+ dojo.require('dijit.Menu');
+ </script>
+
+ <div dojoType="dijit.Toolbar" class='menuBar'>
+
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Acquisitions</span>
+ <div dojoType="dijit.Menu">
+
+ <!-- ==========================================================================
+ Picklist SubMenu
+ ========================================================================== -->
+ <div dojoType="dijit.PopupMenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy">
+ <span>Selection Lists</span>
+ <div dojoType="dijit.Menu">
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/picklist/list';">
+ My Selection Lists
+ </div>
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/picklist/bib_search';">
+ Title Search
+ </div>
+ </div>
+ </div>
+
+ <!-- ==========================================================================
+ Purchase Order SubMenu
+ ========================================================================== -->
+ <div dojoType="dijit.PopupMenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy">
+ <span>Purchase Orders</span>
+ <div dojoType="dijit.Menu">
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/po/search';">
+ PO Search
+ </div>
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/po/li_search';">
+ Lineitem Search
+ </div>
+ <!-- XXX
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/po/marc_upload';">
+ Load Vendor Order Records
+ </div>
+ -->
+ </div>
+ </div>
+ <!-- ==========================================================================
+ Receiving SubMenu
+ ========================================================================== -->
+ <div dojoType="dijit.PopupMenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy">
+ <span>Receiving</span>
+ <div dojoType="dijit.Menu">
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/receiving/process';">
+ Receiving
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Admin</span>
+ <div dojoType="dijit.Menu">
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/fund/list';">Funds</div>
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/funding_source/list';">Funding Sources</div>
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/provider/list';">Providers</div>
+ <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick="location.href = '[% ctx.base_uri %]/acq/currency_type/list';">Currency Types</div>
+ </div>
+ </div>
+ </div>
+</div>
+