Make building & installing the core components of Evergreen optional.
For now, this will be of most interest to those interested in building only
the staff client, say, on platforms where many of the dependencies of the
other components of Evergreen are not readily available. If you disable the
core components using configure, then dependency checking for those core
components is skipped and the staff client will be build and installed to
the desired location.
For example:
./autogen.sh
./configure --prefix=/openils --disable-core --disable-apache-modules
sudo make install
... will result in the Evergreen Web files, reporter, and staff client
being built and their respective server components installed in
/openils/var/web/...
moving the the upgrade SQL scripts to an unversioned "upgrade" directory instead of one labeled for 1.6; adding the min-version insert for config.upgrade_log; adding views and an index for hold loop calculation
Initial stab at modeling database changes as atomic mini-scripts for ease of development and eventual automatic upgrades
Created new upgrade directory for the 1.6 to trunk upgrade path.
fire a command event on checkboxes if persist_helper makes them checked. This handles checkboxes like Stack Subfields and Fast Item Add in the marc editor
Patch from Warren Layton for asciibetical ordering of services in z39.50 client. Native Catalog always goes to the top. Thanks!
---
The attached patch presents the Z39.50 targets in the Staff Client in
alphabetical order - a problem for us because we're starting to have
quite a few configured.
I'm not sure if this is the most elegant solution so feedback is
definitely welcome.
Catch a few more common problems in settings-tester.pl:
* Check for <database> elements to ensure that Evergreen version of opensrf.xml is in place
* Check for oils_web.xml (required as of Evergreen 1.6)
Also, a bit of clean-up:
* Ensure all output is available to be gathered
* Short-circuit pointless database tests if the database connection fails
there's no valid reason to call ingest from within the bib create/overlay code before the changes have been committed. removed embedded ingest logic and the no-ingest flags passed by everyone that uses them
tighter control over displaying mark-recived and update-barcodes links in lineitem table. showing lineitem and PO state in the UI. Added PO activate routine which effectively marks a PO as 'ready to send to vendor'
Loosened constraint on group penalty thresholds. You can now define threholds for the same group as long as they have a different context org unit
To Update:
ALTER TABLE permission.grp_penalty_threshold DROP CONSTRAINT penalty_grp_once;
ALTER TABLE permission.grp_penalty_threshold ADD CONSTRAINT penalty_grp_once UNIQUE (grp,penalty,org_unit);
This is a work in process and I expect a lot of churn; I promise to I18N-ize it before it leaves trunk. Some stuff like Rolling Counter is more mock-up than anything; I have no idea what a Rolling Counter is. :D
The main notion here is that we want a quick toggle in Item Status for a denser view of information for a single item. Something less like the current Actions -> Show Item Details and more like the MARC View button in the Z39.50
interface. Note, you can scan in new barcodes while remaining in this view. In general, I want to move away from pop-up dialogs and interfaces in any case, and this sort of deck swapping is probably the future.
This changeset isn't as scary as it looks, I promise. :-)
In XUL you can say, <element attribute1="foo" attribute2="bar" persist="attribute1 attribute2" />
and whenever those specified attributes change, the new values will be remembered the next time that element is loaded.
Problems with persist:
* No longer works with remote XUL in Xulrunner 1.9 series, only chrome. Mozilla did this for security reasons.
* Persist was tied to the window.location of each interface, so:
1) Settings would be lost on any "upgrade" that effectively changed the URL. For example, /xul/rel_1_2/server/ versus /xul/rel_1_4/server/
2) Some interfaces still make use of URL params, which effectively breaks persistance (because the URL changes constantly), and allows localstore.rdf to grow without limit (thanks to Jeff for noticing that last bit)
The solution:
* We renamed all occurances of @persist to @oils_persist, in case Mozilla changes the behavior again.
* We created a persist_helper() function and call it alongside font_helper() in the @onload for most windows (all that currently have elements using @oils_persist, at least)
persist_helper grabs all elements that have an @oils_persist, and constructs look-up keys based on the location.hostname, location.path, and element.id, and uses the Mozilla preference system to look for preferences with those
keys. These keys don't include URL parameters. For <checkbox> elements, an event listener is added that will set the preference whenever the element fires a command event (is checked or unchecked).
TODO:
* Tweak the keys further so that they're BUILD_ID (version) agnostic
* Add more event listeners to accomodate @oils_persist on other elements like window, splitter, and grippy.
* Possibly remove persist_helper (and font_helper) from the inline @onload, and load it through a window.addEventListener('load',function(){ persist_helper(); },false); in the global util overlay instead.
Simple in-client "activity log" interface (Admin -> Local Administration -> Work Log), and an example of such logging in the Checkout interface.
The log function itself is part of util/error.js. Example:
JSAN.use('util.error'); var logger = new util.error();
logger.work_log(
"Staff member Foo circulated item Bar to patron Baz", // The log message
// Additional Row data to pass to a util.list construct in the work log interface, which can be used in rendering columns, and accessed by actions acting on the list
{
au_id : 1, // Id for patron Baz; needed if you want the Retrieve Patron action to work with this log entry
acp_barcode : 'Bar', // Barcode of the item; needed if you want the Retrieve Item action to work with this log entry
}
);
TODO:
* Add logging statements to the Check In interface (complication there is that we don't have patron data, which would be useful) and Patron Registration
* Possibly add explicit columns for the type of action, the item involved, the patron involved, and the staff involved (to compliment Operator Change), rather than just Message and When.
* Add filtering support for action types
use a separate pcrud instance for each object deletion so that a single instances isn't trying to create transactions while it's already in the middle of transactions, pending async responses. added some docs
calling widget.attr on readonly objects occaisonally results in errors from (as yet unexplained) dojo race condition. however, basewidgetvalue is not needed for readOnly widgets, since displaystring is used, so bypasss for now; use dojo.create
scottmk [Thu, 27 Aug 2009 12:51:09 +0000 (12:51 +0000)]
Create tables acq.fiscal_calendar and acq.fiscal_year.
Create function acq.find_bad_fy to perform sanity checks
on acq.fiscal_year.
To add to an existing database:
CREATE TABLE acq.fiscal_calendar (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL
);
CREATE TABLE acq.fiscal_year (
id SERIAL PRIMARY KEY,
calendar INT NOT NULL
REFERENCES acq.fiscal_calendar
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
year INT NOT NULL,
year_begin TIMESTAMPTZ NOT NULL,
year_end TIMESTAMPTZ NOT NULL,
CONSTRAINT acq_fy_logical_key UNIQUE ( calendar, year ),
CONSTRAINT acq_fy_physical_key UNIQUE ( calendar, year_begin )
);
CREATE OR REPLACE FUNCTION acq.find_bad_fy()
/*
Examine the acq.fiscal_year table, comparing successive years.
Report any inconsistencies, i.e. years that overlap or have
gaps between them.
*/
RETURNS SETOF RECORD AS $$
DECLARE
first_row BOOLEAN;
curr_year RECORD;
prev_year RECORD;
return_rec RECORD;
BEGIN
first_row := true;
FOR curr_year in
SELECT
id,
calendar,
year,
year_begin,
year_end
FROM
acq.fiscal_year
ORDER BY
calendar,
year_begin
LOOP
--
IF first_row THEN
first_row := FALSE;
ELSIF curr_year.calendar = prev_year.calendar THEN
IF curr_year.year_begin > prev_year.year_end THEN
-- This ugly kludge works around the fact that older
-- versions of PostgreSQL don't support RETURN QUERY SELECT
FOR return_rec IN SELECT
prev_year.id,
prev_year.year,
'Gap between fiscal years'::TEXT
LOOP
RETURN NEXT return_rec;
END LOOP;
ELSIF curr_year.year_begin < prev_year.year_end THEN
FOR return_rec IN SELECT
prev_year.id,
prev_year.year,
'Overlapping fiscal years'::TEXT
LOOP
RETURN NEXT return_rec;
END LOOP;
ELSIF curr_year.year < prev_year.year THEN
FOR return_rec IN SELECT
prev_year.id,
prev_year.year,
'Fiscal years out of order'::TEXT
LOOP
RETURN NEXT return_rec;
END LOOP;
END IF;
END IF;
--
prev_year := curr_year;
END LOOP;
--
RETURN;
END;
$$ LANGUAGE plpgsql;
scottmk [Mon, 24 Aug 2009 16:14:36 +0000 (16:14 +0000)]
Add columns to acq.purchase_order: order_date and name.
Name defaults to the id, as text.
Name should be unique for a given ordering_agency and order
date (truncated to midnight), but only where order_date
is not null.
To change an existing table, run the following
through psql:
-- Add new columns; populate name
ALTER TABLE acq.purchase_order
ADD COLUMN order_date TIMESTAMP WITH TIME ZONE;
ALTER TABLE acq.purchase_order
ADD COLUMN name TEXT;
UPDATE acq.purchase_order
SET name = id::TEXT;
ALTER TABLE acq.purchase_order
ALTER COLUMN name SET NOT NULL;
-- Name should default to the id. We can't do that with a DEFAULT
-- clause but we can do it with a trigger.
CREATE OR REPLACE FUNCTION acq.purchase_order_name_default () RETURNS TRIGGER
AS $$
BEGIN
IF NEW.name IS NULL THEN
NEW.name := NEW.id::TEXT;
END IF;
RETURN NEW;
END;
$$ LANGUAGE PLPGSQL;
CREATE TRIGGER po_name_default_trg
BEFORE INSERT OR UPDATE ON acq.purchase_order
FOR EACH ROW EXECUTE PROCEDURE acq.purchase_order_name_default ();
-- Name should be unique for a given ordering_agency and day, where
-- order_date is not null. We can't do that with a check constraint
-- because it would require a subquery, so we use a trigger.
CREATE INDEX acq_po_org_name_order_date_idx
ON acq.purchase_order( ordering_agency, name, order_date );
CREATE OR REPLACE FUNCTION acq.po_org_name_date_unique () RETURNS TRIGGER
AS $$
DECLARE
collision INT;
BEGIN
--
-- If order_date is not null, then make sure we don't have a collision
-- on order_date (truncated to day), org, and name
--
IF NEW.order_date IS NULL THEN
RETURN NEW;
END IF;
--
-- In the WHERE clause, we compare the order_dates without regard to time of day.
-- We use a pair of inequalities instead of comparing truncated dates so that the
-- query can do an indexed range scan.
--
SELECT 1 INTO collision
FROM acq.purchase_order
WHERE
ordering_agency = NEW.ordering_agency
AND name = NEW.name
AND order_date >= date_trunc( 'day', NEW.order_date )
AND order_date < date_trunc( 'day', NEW.order_date ) + '1 day'::INTERVAL
AND id <> NEW.id;
--
IF collision IS NULL THEN
-- okay, no collision
RETURN NEW;
ELSE
-- collision; nip it in the bud
RAISE EXCEPTION 'Colliding purchase orders: ordering_agency %, date %, name ''%''',
NEW.ordering_agency, NEW.order_date, NEW.name;
END IF;
END;
$$ LANGUAGE PLPGSQL;
CREATE TRIGGER po_org_name_date_unique_trg
BEFORE INSERT OR UPDATE ON acq.purchase_order
FOR EACH ROW EXECUTE PROCEDURE acq.po_org_name_date_unique ();
erickson [Fri, 21 Aug 2009 15:33:02 +0000 (15:33 +0000)]
more work on pcrud filter dialog. added filter option to autogrid. repaired faulty linked object caching in autogrid. with caching repaired, made linked grid cell data fetching synchronous to prevent excessive network requests (1st instance of an object is cached)
erickson [Thu, 20 Aug 2009 16:04:35 +0000 (16:04 +0000)]
beginning of a filter dialog for pcrud requests. users select columns and values from autofieldwidgets. the eventual goal is to provide filter options for autogrid
miker [Thu, 20 Aug 2009 15:00:46 +0000 (15:00 +0000)]
moving the simple-rec synchronization out of the DB for insert/update, and as a new trigger for "delete". This should finally address the ingest issues seen at some sites through the 1.4 series
In our case, our generated function accidentally referenced a value dependent on the loop variable instead of the corresponding argument of the function generator.
So we had multiple async renewal calls that depending on the timing, could try to renew the same item. To further add insult to injury, this could potentially put the database in an inconsistent
state wtih duplicate circulations.
phasefx [Wed, 19 Aug 2009 03:07:41 +0000 (03:07 +0000)]
Have the Place Hold function in the Patron Holds interface update said interface upon successful hold placement.
Also, rework how the Patron Holds interface encourages the summary sidebar (and the label under the Holds button) to refresh itself with regard to holds.
phasefx [Tue, 18 Aug 2009 05:32:37 +0000 (05:32 +0000)]
fixed regression with default search field not being refocused after using the Clear Form button. Also have the default field come into focus when the whole tab leaves focus and is later revisited.
erickson [Mon, 17 Aug 2009 20:09:47 +0000 (20:09 +0000)]
turned on paging for po list. set up the state filter differently so that the browser won't choose a default value. no longer showing and fleshing the owner column since it was causing the render flickering... will reassess later.