[OPEN-ILS-DEV] actor.card creator and create_time

Bill Erickson erickson at esilibrary.com
Mon Dec 6 11:03:29 EST 2010


On Wed, Dec 1, 2010 at 10:03 AM, Bill Ott <bott at grpl.org> wrote:

> We sometimes encounter disputes over when exactly a new library card was
> issued.  Particularly when it comes to lost cards and checkouts on
> reportedly lost cards.  While we can gleen much of the information from the
> auditor tables, it's still not an exact science.
>
> Long ago I mentioned the possibility of adding a timestamp to the card.
>  While it involves a dreaded schema change, the code to store the data is
> very basic.  I also added a creator, as it's another piece of information
> that is sometimes hard to track down.
>
> For your review.  The attached, is against trunk.
>


Hi Bill.  Thanks for the patch!  I have a couple of comments:

1. For the date display in the registration UI, you can use something like
this to get a nice locale-friendly date:

   getByName(row, 'create_date').innerHTML =

    openils.Util.timeStamp( card.create_date(), {"formatLength": "short"} );

In en-US, this would be dd/mm/yyyy

2. "create_date" should also be added to CDBI/actor.pm.

3. As of 2.0, there is a user purging database function that scrubs away the
existence of a user.  The staff version of this call requires that any
object linked to a staff user be handed over to another staff account during
purge.  As such, any new fields added to the DB that link to (what in
practice would have to be) a staff account, need to be accounted for in the
purge routine.  The code lives in 999.functions.global.sql and it's
called actor.usr_purge_data.  In here, there are a series of update commands
grouped by schema for convenience.  Something like this should do it:

UPDATE actor.card SET creator = dest_usr WHERE creator = src_usr;

-b

-- 
Bill Erickson
| VP, Software Development & Integration
| Equinox Software, Inc. / Your Library's Guide to Open Source
| phone: 877-OPEN-ILS (673-6457)
| email: erickson at esilibrary.com
| web: http://esilibrary.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20101206/dc8f37a9/attachment.htm 


More information about the Open-ils-dev mailing list