need for non-SQL in updater : got it !!!
Kados & slef, Slef asked me "could you give me an example of something that can't be ruled only by SQL during update". I answered I had found one, but could not remember it. I have got it now ! When dealing with something that depends on language and/or MARC flavour. For example, I want to add a systempref for Reserve behaviour (to fix http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1416) If langage is french, i'll add something, otherwise i'll add something else. I add it now, but i'm afraid I won't have time to commit before the end of the day (need to merge to official branch, fix errors and send patch) -- Paul POULAIN et Henri Damien LAURENT Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) Tel : 04 91 31 45 19
Paul POULAIN <paul.poulain@free.fr> wrote:
Slef asked me "could you give me an example of something that can't be ruled only by SQL during update". [...] When dealing with something that depends on language and/or MARC flavour.
For example, I want to add a systempref for Reserve behaviour (to fix http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1416)
If langage is french, i'll add something, otherwise i'll add something else.
Why can't that be done with SQL like INSERT INTO `systempreferences` (`variable`,`value`,`explanation`,`options`,`type`) SELECT 'ReservesNeedReturns', '0', CASE WHEN STRCMP(`value`,'fr') THEN 'Si ce paramètre est mis à 1, une réservation posée sur un exemplaire présent sur le site devra être passée en retour pour être disponible. Sinon, elle sera automatiquement disponible, Koha considère que le bibliothécaire place la réservation en ayant le document en mains' ELSE 'If set, a reserve done on an item available in this branch need a check-in, otherwise, a reserve on a specific item, that is on the branch & available is considered as available' END, '', 'YesNo' FROM `systempreferences` WHERE `variable` = 'opaclanguages' LIMIT 1; ? (By the way, I don't understand why the fix to bug 1416 in commit 1a4fc157bfa17dee2a2122b9f86d1c598e063794 appears to depend on opac languages being exactly 'fr' rather than merely containing 'fr' and why we don't note librarian/intranet language.) In the longer-term, we probably should split explanation out into another database table, to allow multi-lingual intranet use. Hope that helps, -- MJ Ray http://mjr.towers.org.uk/email.html tel:+44-844-4437-237 - Webmaster-developer, statistician, sysadmin, online shop builder, consumer and workers co-operative member http://www.ttllp.co.uk/ - Writing on koha, debian, sat TV, Kewstoke http://mjr.towers.org.uk/
participants (2)
-
MJ Ray -
Paul POULAIN