[Koha-bugs] [Bug 17015] New Koha Calendar

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 14 20:27:09 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17015

--- Comment #128 from David Bourgault <david.bourgault at inlibro.com> ---
I recreated and rebased the patch to keep the git history clean. I 
also added a patch that removes files used by the old calendar code.

Because this new patch changes database column names (as requested by
Jonathan in his quick feedback), if you've tested this patch before
make sure to drop the table and recreate it.

Test plan and functionality is same as before. This change is only a
code cleanup to match QA standards.


== Changes from last patch ==

* Fixed many SQL queries, removing useless code and changing much of
the "where" clauses to a DBIx:: syntax. Not all queries can be written
using DBIx syntax, so some SQL is still present.

* Change most functions to snake_case (from camelCase). Some functions
have the same name as in Koha::Calendar to minify changes other Koha
files; they were left unchanged.

* Added underscores to database columns, and their matching variables.
THIS WILL CAUSE ERRORS if you still have the table in your database. If
that is the case, drop and recreate the discrete_calendar table before
testing.

* edit_holidays now uses a hashref for parameters. Default parameters
have been made explicit. Calls to the function have been simplified
taking default parameters into account.

* Holiday types ({E, F, N, R, W}) are now called through a global hash
in perl files. (e.g.: $HOLIDAYS->{EXCEPTION})

* add_days_discrete_calendar.pl use txn_begin txn_do for transactions.

* discrete_calendar.pl uses C4::Context::only_my_library


== Unresolved/Unchanged ==

> Isn't DAYOFWEEK an MySQLism?
It is. I was however unable to find a cross-implementation way of
obtaining that information. If anyone has an idea I'm open to
suggestions

> add_days_discrete_calendar.pl is using SQL statements, use your new
> module instead.
Koha::DiscreteCalendar does not have any functions to insert new days
in the database, as this is only done by the cronjob.

>* At first glance DateTime::Format::Strptime->new should be replaced
with my $dtf = $schema->storage->datetime_parser
At first try it cannot.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list