This patch adds default blank values for a couple of params the script might receive which were producing warns in the error log. Also wraps GetMarcBiblio in an eval.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch starts improving export.pl by adding warnings, skipping invalid records, and not trying to access fields which don't exist.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
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>
Reworked ViewLog.pl and the template. Eliminated html errors, cleaned up
the template, change mime type to text/csv and other minor changes.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
execute_query now refactored, returns reliable results, does
zero presentation-layer crap. Arguments reduced, client scripts
adapted to new API and performance improved. Text::CSV now used
to generate CSV output, ensuring portability, encoding and accuracy.
Replaced tools/runreport.pl with misc/cronjobs/runreport.pl:
~ security fixed
~ documentation improved
~ TODO: finish sendmail option.
Bug 3077 also fixed.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch is writted by Paul Poulain.
It auto-select the marcflavour from syspref in the stage marc import.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
A REPLACE statement in tools/letter.pl was indirectly corrupting data
in the message_transports table. It has been replaced with code that
does an UPDATE or INSERT depending on whether the row existed or not.
Also, to protect data in the message_transports table further, letters
which have entries in the message_transports table are no longer
deletable.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This adds an option to the inventory tool causing it to ignore copies
currently on loan. This is good if you want to do inventory, but don't
want to update the date-last-seen on items currently on loan.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This changes the setting if default values in the inventory tool where
the min and max call number are concerned. Also changes how the query
is formed in C4/Items so that these two are not required.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This adds notification code to Reserves.pm to send notifications through email
or SMS to patrons when their hold is filled. It does not send the letter
directly, but instead uses EnqueueLetter. Also, it relies on
EnhancedPatronMessaging being on and the hold notification being turned on for
the specific patron through the 'Messaging' tab.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Apparently my git skills are lacking, since I intended this one-liner
to be amended into the patch I resent.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
* I added some code to detect the rows which were blank,
and I deleted them upon saving the form.
* Updated to get the categories from the database
instead of hardcoding them.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This repurposes the Reports module for general reports, and moves its functionality to a different module, Reports::Guided. It also updates all of the reports that can export to correctly treat the 'tabulation' value of the 'delimiter' syspref.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
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>
Most Perl scripts (as opposed to modules) do
not need to require Exporter.
No user-visible or documentation changes.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Added the zipcode to display along with the patron address when you are viewing a Patron from the intranet.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
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>
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>
This patch removes Image::Magick as a dependency and replaces it with
the (much) lighter GD. Functionality of patronimage code has not changed with
this conversion.
Adding errorhandling for corrupted image file and link to return to moremember.pl when called from there
Added notes about supported image mime types.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Due to the logic of the underlying picture-upload.pl depending upon the "value" of the
form input controls and this value being translated, the script then failed to function.
This patch changes the input controls so that this should not be an issue.
This issue should be kept in mind, though, so that it can be avoided in the future.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Changed date popups in scheduler.tmpl to a date picker element
Made corresponding changes to scheduler.pl
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
If a rule should not be saved because a delay is
given but no letter or debar action is specified
for that delay, an error message is now reported.
Also:
* use "dialog alert" CSS class for confirmation
that form was saved
* if form input is saved, retrieve the settings from the
database again when displaying the form - this will
help turn up any bugs where the script is not
saving the overdue rules correctly.
* fix display of patron category in error messages
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
The drop-down lists of branches and letter templates
in the overdue notice/status triggers tool are now
sorted in ascending alphabetical order.
No documentation change.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
[1] Removed hardcoded path to original developer's
Koha configuration file; now checks KOHA_CONF.
[2] Now attempts to figure out if a task was successfully
added to the task queue; if it wasn't, the failure
is now reported in the task scheduler page.
[3] When traveling to the task scheduler page from a
saved report, the report in question is now
selected by default.
[4] Removed the button to edit a queued task; this is
not supported.
This patch is essentially a bandage; I've added a BUGS
section and some FIXMEs to the POD for C4::Scheduler
detailing some issues - a refactoring of the task
scheduler is in order at some point.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
[1] Display the "No records have been staged" message only
if no import batches exist.
[2] When displaying a batch that has no bibs in it, display
a "There are no records in this batch to import". Also,
do not display the "import record into catalogue" button
for an empty batch.
[3] Add CSS class "problem" to both messages.
Documentation changes: minor; only required if screenshots
exist of the manage staged MARC records page that has no
import batches on it.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
When both the patron delete and patron anonymize checkboxes
were selected, the patron cleaning tool would not
properly register the number of patrons to delete. Fixed
by correcting form input handling.
Also, count of patrons to delete or anonymous now correct
when running with IndependentBranches = ON.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
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>
Enhanced the ability of catalogers to specify how
bib and item records should be added, replaced, or
ignored during a staging import.
When an import batch of bib records is staged and commit,
the user can now explicitly specify what should occur
when an incoming bib record has, or does not have, a match
with a record already in the database. The options are:
if match found (overlay_action):
create_new (just add the incoming record)
replace (replace the matched record with the incoming one)
use_template (option not implemented)
ignore (do nothing with the incoming bib; however, the
items attached to it may still be processed
based on the item action)
if no match is found (nomatch_action):
create_new (just add the incoming record)
ignore (do nothing with the incoming bib; in this
case, any items attached to it will be
ignored since there will be nothing to
attach them to)
The following options for handling items embedded in the
bib record are now available:
always_add (add the items to the new or replaced bib)
add_only_if_match (add the items only if the incoming bib
matches an existing bib)
add_only_if_add (add the items only if the incoming bib
does *not* match an existing bib)
ignore (ignore the items entirely)
With these changes, it is now possible to support the following use cases:
[1] A library joining an existing Koha database wishes to add their
items to existing bib records if they match, but does not want
to overlay the bib records themselves.
[2] A library wants to load a file of records, but only handle
the new ones, not ones that are already in the database.
[3] A library wants to load a file of records, but only
handle the ones that match existing records (e.g., if
the records are coming back from an authority control vendor).
Documentation changes:
* See description above; also, screenshots of the 'stage MARC records
for import' and 'manage staged MARC records' should be updated.
Test cases:
* Added test cases to exercise staging and committing import batches.
UI changes:
* The pages for staging and managing import batches now have
controls for setting the overlay action, action if no match,
and item action separately.
* in the manage import batch tool, user is notified when they
change overlay action, no-match action, and item action
* HTML for manage import batch tool now uses fieldsets
Database changes (DB rev 076):
* added import_batches.item_action
* added import_batches.nomatch_action
* added 'ignore' as a valid value for import_batches.overlay_action
* added 'ignored' as a valid value for import_records.status
* added 'status' as a valid value for import_items.status
API changes:
* new accessor routines for C4::ImportBatch
GetImportBatchNoMatchAction
SetImportBatchNoMatchAction
GetImportBatchItemAction
SetImportBatchItemAction
* new internal functions for C4::ImportBatch to
determine how a given bib and item are to be
processed, based on overlay_action, nomatch_action,
and item_action:
_get_commit_action
_get_revert_action
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
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>
This patch should reduce the occurrence of the following
message in the error log:
Illegal Date '2008-3-14' does not match 'iso' format: yyyy-mm-dd
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
The new tables have the same structure and constraints
as the tables they archive with the following exceptions:
* borrowernumber and biblionumber in old_reserves can be
NULL
* the FK constraints (e.g., for itemnumber) on old_reserves
set the child column to NULL if the parent row is deleted
instead of deleting the child row.
* there is no FK constraint on old_issues.branchcode, allowing
a branch to be deleted without changing archived requests.
Some miscellaneous cleanup was done as part of this patch:
* GetMemberIssuesAndFines (C4::Members) now uses bind variables
* fixed POD for GetMemberIssuesAndFines
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
+ let the superlibrarians choose their branch even if IndepBranches is ON
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
If viewlog.pl is called from the circulation menu, then the circulation menu is displayed.
If viewlog.pl is called otherwise, the tools menu is displayed.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This corrects the major template issues once files are uploaded.
The changes need dressing up a bit still.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
* Replaced direct "update items" with ModItem call
* fixed problem in template that prevent barcode file upload
from working
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Introduced C4::Items module to separate items API
from biblio API. Details on changes will be
put in later commit messages.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Staging job now gets moved to background so that
it does not get killed if it takes longer
than the Apache timeout.
Added AJAX monitoring of job status.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
* Added C4::BackgroundJob to monitor tracking of
background jobs
* start modifying stage-marc-import to use it
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
* Introduced C4::UploadedFile to handle management and
progress tracking of uploaded files.
* Modified stage-marc-import.pl to handle new upload
mechanism
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Refactoring to provide single place to get CGI::Session ojbject;
fixes bug for DB storage method other than 'mysql'.
This refactoring is also part of the patch series for
handling large input files for staging and processing
MARC records.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Enhancement to store the matching rule associated with an
import batch and to allow the current matching rule in
effect to be changed and the duplicate detection redone.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Revamps the import options on the tools menu to have two parts:
[1] Staging (load file into reservoir)
[2] Managing (review the list of staged batches, then
choose to commit or undo a given batch.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
* Completely removed old marc_breeding table
* Started updated Tools import function to stage records
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
per 2006-02-24 comment, breeding.pl had been renamed to import.pl, but
not all of the affected files were changed accordingly.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
the 3 parameters :
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
intranetstylesheet => C4::Context->preference("intranetstylesheet"),
IntranetNav => C4::Context->preference("IntranetNav"),
are filled by Auth.pm automatically, removing them in templates
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
+ minor change in Languages in order not to have problems with eq
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
- reindenting
- upcasing SQL
- the script at least compiles...
... but it does seem not work yet
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Rule :
- always format_date() before sending date to template
- always format_date_in_iso immediatly after reading a date coming from a parameter
- deal internally only with dates in iso
Note that :
- I could not test things related to issues stats due to the my DB -issues.issuedate not filled, see commit about 3.00.00.006
- acquisitions_stats does not work when you filter on date
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
So this implies quite a change for files.
Sorry about conflicts which will be caused.
directory Interface::CGI should now be dropped.
I noticed that many scripts (reports ones, but also some circ/stats.pl or opac-topissues) still use Date::Manip.
- checkaccount and getborraccountno => GetBorrowerAcctRecord
Many changes in names,
some changes in function signature.
Will be detailed in a mail to kohadevel.
== Biblio.pm cleaning (useless) ==
* some sub declaration dropped
* removed modbiblio sub
* removed moditem sub
* removed newitems. It was used only in finishrecieve. Replaced by a Koha2Marc+AddItem, that is better.
* removed MARCkoha2marcItem
* removed MARCdelsubfield declaration
* removed MARCkoha2marcBiblio
== Biblio.pm cleaning (naming conventions) ==
* MARCgettagslib renamed to GetMarcStructure
* MARCgetitems renamed to GetMarcItem
* MARCfind_frameworkcode renamed to GetFrameworkCode
* MARCmarc2koha renamed to TransformMarcToKoha
* MARChtml2marc renamed to TransformHtmlToMarc
* MARChtml2xml renamed to TranformeHtmlToXml
* zebraop renamed to ModZebra
== MARC=OFF ==
* removing MARC=OFF related scripts (in cataloguing directory)
* removed checkitems (function related to MARC=off feature, that is completly broken in head. If someone want to reintroduce it, hard work coming...)
* removed getitemsbybiblioitem (used only by MARC=OFF scripts, that is removed as well)
Contrib from Tümer Garip (from Turkey) :
* holiday :
in /tools/ the holiday.pl script let you define holidays (days where the library is closed), branch by branch. You can define 3 types of holidays :
- single day : only this day is closed
- repet weekly (like "sunday") : the day is holiday every week
- repet yearly (like "July, 4") : this day is closed every year.
You can also put exception :
- sunday is holiday, but "2006 March, 5th" the library will be open
The holidays are used for return date calculation : the return date is set to the next date where the library is open. A systempreference (useDaysMode) set ON (Calendar) or OFF (Normal) the calendar calculation.
allow to get a list of letters for a module.
overduerules is a tool relying on letter.pl
It will allow ppl to manage three levels of overdue thanks to a brand new overduenotice script to come out soon.
Changing barcodes, export and import and letters directory.
Changing export script name (marc.pl) to export.pl
Changing import script name (breeding.pl) to import.pl