Commit graph

20 commits

Author SHA1 Message Date
Chris Nighswonger
ae48ebbcaa Bug 5379 - import_borrowers.pl fails with db insert/update errors
Some spreadsheet programs use smart quotes which causes the db to throw
an error when an insert/update is attempted due to improper processing
of the CSV file. This patch adds code to check for smart quotes and change
them to "dumb" quotes.

This patch also adds more logging of errors and a notice to the user to check
the logs for errors when they occur.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-07-05 11:15:00 +12:00
Matthias Meusburger
ff7affdf43 Bug 5996 : MT2926: Fix default values for patron import
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-01 13:13:47 +13:00
Paul Poulain
ddbedbfc2f Bug 4330 : Adding some copyright BibLibre statements 2011-03-21 10:57:20 +13:00
Lars Wirzenius
49e0a8fc78 Fix FSF address in directory tools/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:51 -04:00
Henri-Damien LAURENT
4271bbb738 Modifying Members : Add Mod and GetMember
This update the way Member is added and editing so that import and Edition
 could be best automatized
GetMember evolves and allow ppl to serach on a hash of data

Adding SQLHelper A new package to deal with INSERT UPDATE and SELECT

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:29:23 +02:00
Sébastien Hinderer
f1f833c965 bug 3464: Takes columns country and B_country of table borrowers into account in related operations.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 18:19:20 -04:00
Joe Atzberger
82f362673c Allow option to preserve Extended Attributes on patron import update.
Essentially, this patch provides the option to overwrite only matching
Extended Attributes, instead of all of them, treating the ext. fields more
like normal fields.

Several functions added to Members::Attributes with corresponding tests.

[ LL ref. 342 ]

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-28 06:50:39 -05:00
Galen Charlton
8e5eea5c4e bug 3222: set messaging preferences during patron import
If the EnhancedMessagingPreferences option is ON, when
creating a new patron record via the patron import, set
the default messaging preferences to the applicable values
the default preferences for the patron category.

Messaging preferences are currently changed only when
*adding* a patron record via the import; if the import
updates an existing record, the patron's existing
preferences are not changed.

API changes:

SetMessagingPreferencesFromDefaults() is a new function
in C4::Members::Messaging to unconditionally replace
the current messaging preferences of a patron with the
default preferences from a specified patron category.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-22 13:20:53 -05:00
MJ Ray
5c7ac4047c bug 2287: use defaults when needed even if CSV has correct number of columns
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-21 10:56:28 -05:00
Galen Charlton
80eecc3f19 bug 2287: handle case where autoMemberNum is off
When importing a patron file where new records
do not have a card number *and* autoMemberNum is
off, make sure that bororwers.cardnumber is set to NULL
for those new patrons rather than '' - otherwise, only
one patron with an empty barcode can be created, as there is
a uniqueness constraint on borrowers.cardnumber

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-08 08:46:43 -05:00
MJ Ray
9fb2d09ffc Allow autogenerated cardnumbers again to solve http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2287
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-08 08:26:28 -05:00
Joe Atzberger
c9fd091c14 Bug 2627: Allow Unicode data in import_borrowers, expand feedback on errors.
Date fields are now checked against syspref and iso regexps before attempting
to convert or insert them.  The problem characters were non-ASCII diacriticals.
Note: this may rely on improvements in the current 0.54 version of Text::CSV and
Text::CSV_XS, rather than the Koha minimum of 0.01 and 0.32, respectively.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-10-16 16:18:39 -05:00
Ryan Higgins
e3fa9f2d5f Prevent borrower import from overwriting data that it shouldn't, and polish off a couple error conditions.
When an imported patron matches an existing one, keep data in the original record unless our import file
includes that column.  Also, check for branch & categorycodes, and produce error if invalid.  Finally,
auto-calculate expiry date if not given.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 19:07:07 -05:00
Joe Atzberger
49e4e7020d Patron import reform - bug 2287 - expanded error catching and feedback
This incorporates and extends the patch from MJ Ray attached to bug 2287.
Added feedback of up to 25 lines, including for errors at the Text::CSV
parsing level.  This allows feedback for problems than involve encoding.
Added link to download "starter" CSV file (with all the columns).

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 09:37:03 -05:00
Galen Charlton
5cafd551be patron attributes - batch import
When ExtendedPatronAttributes is ON, the batch
patron import tool's behavior changes as follows:

[1] A new (required) column is added to the input CSV
    format.  This column should contain a list of
    attributes to set for the record, each value
    preceded by its type code.  For example, if
    the superlibrarian has defined two types,
    a unique identifier INSTID and a repeatable
    BASEBALL, this field could contain:

    "INSTID:12345,BASEBALL:Cubs"

    This field must be wrapped in quotes if multiple
    values are defined.  Since values can contain
    spaces, additional doubled-quotes may be required:

    "INSTID:12345,BASEBALL:Cubs,""BASEBALL:White Sox"""

    When replacing a patron record, any attributes specified
    in the input file replace all of the attribute values
    of any type that were previously assigned to the patron
    record.

[2] It is possible to specify a field other than the
    cardnumber to use for looking for matching patrons.
    Specifically, any attribute marked as a unique ID
    can be used.  The operator is asked to specify
    which ID type to use; if an input record has an
    attribute value of that type, and exactly one patron
    record in the database has that value, then the
    record will be overlaid or ignored according to the
    overlay setting.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:03:10 -05:00
Galen Charlton
fc6ccb1a61 granular permissions - updated Tools
Updated all scripts appearing on the tools page
to respect a granular permission defined for
each of them.

The tools menu and home page have been changed so
that only the specific tools that a user has
access are displayed.  This is simple, but depending on
the module and circumstance, it may be better to
display functions that the user has does not have
access to, but disable the links and do some sort
of visual styling to indicate that a function exists
but requires additional privileges to access.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-10 15:53:30 -05:00
Joe Atzberger
9f1d798bfe import_borrowers.pl - convert dates BEFORE AddMember or ModMember
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-20 20:51:28 -06:00
Joe Atzberger
2e0e56a016 tools subdir - Dates.pm integration and warnings fixes.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 18:01:30 -06:00
Chris Cormack
fc2c1f88b2 Uploading borrowers works now
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-28 22:31:05 -05:00
Chris Cormack
3e42b7777a New tool to import borrowers
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-28 22:30:59 -05:00