Commit graph

69 commits

Author SHA1 Message Date
658f603511 Bug 17189: Replace occurrences of 'use Koha::Cache'
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 10:24:47 +00:00
f753220701 Bug 17189: Add the ability to define several memcached namespaces - replace existing occurrences
s/Koha::Cache->get_instance/Koha::Caches->get_instance

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 10:24:46 +00:00
739eaa82e8 Bug 17009: Speed up the framework duplication
To duplicate frameworks, the code retrieve all the subfields, then
execute 1 insert per subfield.
It's unnecessary slow, we can use the DBMS to do it.

Test plan:
Create a new framework and duplicate the structure of another framework.

Signed-off-by: Marc <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-18 16:01:53 +00:00
84812129c9 Bug 16955: Do not clear from cache when adding a new framework
There are several issues with these lines:
1/ $cache is not defined correctly and it not visible inside
duplicate_framework
2/ $frameworkcode is a wrong c/p, it should be $newframeworkcode
3/ these calls are not needed. As we are creating a new framework, the cache
should be empty...

This patch will simply remove these calls

Test plan:
Duplicate a framework and confirm that you do not get any error in your
logs.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-18 15:48:52 +00:00
172ebfe520 Bug 16431: Use Koha::Cache to cache marc subfield structure
The marc subfield structure is currently cached using a global variable
of C4::Context. The infos are retrieved every time a new context is
created.
This patch suggests to use Koha::Cache instead.

To achieve this goal, a new subroutine is created
C4::Biblio::GetMarcSubfieldStructure, it will be called from code which
needs to get the marc subfield structure. GetMarcFromKohaField,
GetMarcSubfieldStructureFromKohaField, TransformKohaToMarc and
_get_inverted_marc_field_map are modified accordingly and the cache is cleared
when the table is updated (from the 3 pl scripts modified by this patch).

The caching done in C4::Context (marcfromkohafield) is removed.

Test plan:
Play with the marc subfield structure (in the administration module),
then add and edit records and make sure everything went fine.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Everything works as expected on my functional tests. I'm really happy to see the
patch introduces relevant tests for previously untested functions.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-08 12:44:58 +00:00
8c14c25521 Bug 13074: Use Koha::Cache to cache the defaults values of a MARC record
With the global %default_values_for_mod_from_marc variable, the changes
made to the marc_subfield_structure table and especially the links
between MARC and DB fields are not safe and might be outdated (if a
field is linked/unlinked)

Test plan:
Under Plack:
- Link the barcode field, edit a record and set a barcode.
- Remove the mapping for the barcode field and then update again the
  barcode of the record.
The items.barcode DB field must not have been updated.

Without this patch, the field should have been updated.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:29:59 +00:00
Jonathan Druart
7bf6987327 Bug 1487: Store the "display only used tags/subf" value in a cookie
On the marc framework page, the checkbox to display only used
tags/subfields is always unchecked.
It should be stored into a cookie to always display the same view.

Test plan:
1/ Go on the marc framework page
2/ Check the checkbox
3/ Go somewhere else on the staff interface
4/ Back to the marc framework page, the checkbox should be checked

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Works as advertised, getting datatables error when using feature
but the error exists pre-patch
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:23:01 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=9987

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Jonathan Druart
e20270fec4 Bug 11944: use CGI( -utf8 ) everywhere
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:21 -03:00
Jonathan Druart
75f0cc5771 Bug 11944: Some refresh don't indicate the charset to use
This patch replaces occurrences of META HTTP-EQUIV=Refresh with a
redirection.

Note:
 The list of modified files has been got with the following grep:
  git grep Content-Type | grep -v -i utf | grep Refresh | grep -v translator | grep -v \.js

Test plan:
1) admin/auth_tag_structure.pl
- Go on an authority MARC framework for an authority type
(admin/auth_tag_structure.pl?authtypecode=CO for instance)
- Click on the "Add a new tag" button
- Fill fields
- Save
- You should be redirected on the auth_tag_structure.pl page
- Try to modify an existing tag
- The redirection should be done

2) admin/auth_subfields_structure.pl
- From the previous page, click on a "subfields" link
- Edit/Add a new subfields
- Save
- You should be redirected to the subfield list
- Delete a subfield
- You should be redirected to the subfield list

3) admin/authorised_values.pl
- Add/Edit an authorised value
- Save
- You should be redirected to the authorised value list (with the
  right category selected)

4) admin/categorie.pl
- Add/Edit a patron category
- Save
- You should be redirected to the category list
- Delete a patron category
- You should be redirected to the category list

5) admin/koha2marclinks.pl
- Go on the Koha to MARC mapping configuration page
- Edit a field
- Map a field and click on "OK"
- You should be redirected to the list

6) admin/marc_subfields_structure.pl
- Go on the MARC frameworks page
- Click on "MARC structure" for one on the list
- Click on "Subfields" for one on the list
- Add/Edit a subfield
- Save
- You should be redirected to the subfield list

7) admin/systempreferences.pl
- Go on the system preferences admin page
- Click on the "Local use" tab
- Add/Edit a pref
- Save
- You shold be redirected to the Local use preference list

8) serials/subscription-detail.pl
- Go on a subscription detail page
- Delete the subscription (using Edit > Delete subscription)
- You should be redirected on the serials home page

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:09 -03:00
Robin Sheat
71ba269136 Bug 11842 - fix framework caching with memcache/plack
This changes the existing framework caching, which was using memoisation
if memcached was available, and memory in all cases, to use the
Koha::Cache system. This uses memcache if possible, and in-memory
otherwise. However it also clears the cache when the framework updates,
making sure that the changed version will be picked up.

Note that the in-memory cache clears itself after 10 seconds, so that if
memcached isn't available, this is the longest that old versions will
hang around.

Test plan:
* work through
  http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0
  and make sure that the erronious result doesn't occur.

Note:
* The patch on bug 12041 is required for this to work.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-08-19 12:53:44 -03:00
Bernardo Gonzalez Kriegel
de7dd39583 Bug 766: Remove CGI::scrollinglist from marctagstructure.pl
This patch removes the only instance in this file.

Don't know if the feature is of some utility, seems
that does not work (no use of auth values as indicators
on MARC editor)

To test:
1. Apply the patch
2. Go to Administration > MARC frameworks
3. Clic on MARC structure of any fw
4. Clic Edit on any tag
5. On tag editor check the pulldown 'Authorised value', that was replaced
6. Check for regressions: select a value, save, verify the value, change
again, etc.

Note: removed a SELECT, using now C4::Koha::GetAuthorisedValueCategories
Do not we need an AuthorisedValues.pm? (on C4 or Koha)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-08-13 10:11:19 -03:00
afd2418d73 Bug 11349: Change .tmpl -> .tt in scripts using templates
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:05:49 -03:00
d90b4b6a08 Bug 11771 - Use validation plugin when creating new MARC framework tag
The page for adding a new tag to a MARC framework includes some
custom form validation JavaScript which can be removed in favor of HTML5
validation attributes and Koha's built-in validation plugin. This patch
does so.

The patch also moves some tag markup creation out of the script and into
the template where it belongs.

To test, apply the patch and go to Administration -> MARC bibliographic
framework -> MARC structure -> New tag. Try submitting the form without
entering a tag number. This should trigger a validation warning.

Submission of the form with valid data should work correctly. Editing an
existing tag should also work correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Great improvement! Before this patch, I got a JS alert but the form was
submitted anyway.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-02-19 00:03:24 +00:00
Mark Tompsett
b570a76064 Bug 8849 - Error log generated when not a demo system
Changed two lines similar to:
   unless (C4::Context->config('demo') == 1) {
into lines similar to:
   unless (C4::Context->config('demo')) {
By removing the == 1, undefined = false without an error. The
value of demo is supposedly set by a koha-conf.xml variable,
but there is very little documentation on this "demo mode"
beyond the set it to 1 in koha conf for demo mode.  Also, demo
doesn't exist in the default koha-conf.xml file generated.
So anyone who knows to create it, will likely create it the
proper way and with the proper value.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-24 18:07:59 +02:00
Mark Tompsett
b20c00ee2d Bug 8714 - Poorly ordered and triggers warning in marctagstructure.pl
An array boundary check was after a comparison using the array.
By changing the logic which had " and ( $j < $cnt)" to be at the
beginning "( $j < $cnt ) and ", the warning is no longer shown
in the error log.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-17 18:25:28 +02:00
Srdjan
c1e5462db1 bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-07-23 10:43:59 +02:00
Dobrica Pavlinusic
d4233cf1dd Bug 7799 - admin/marctagstructure.pl plack scoping
duplicate_framework needs $dbh so we get it from C4::Context

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 18:15:56 +02:00
Christopher Hall
f03000f50f Bug 5462: modified intranet scripts to match templates
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2011-02-03 09:57:24 +00:00
Stéphane Delaune
f1762530d1 (MT #1654) followup : Adding jquery.tablesorter and jquery.tablesorter.pager support for marctagstructure.pl 2010-12-21 21:18:12 +13:00
Lars Wirzenius
2c67656108 Fix FSF address in directory admin/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:50 -04:00
Colin Campbell
eee07ae861 Enable warnings in marctagstructure.pl
Fix a couple of comparisons generating warnings

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-08 21:25:45 -05:00
Joe Atzberger
f226b02dd4 Cleanup: biblio_framework and marctagstructure
Removed unused javascript.  Enabled warnings.  Use common $dbh.
Removed sth->finish calls.  Removed toggle code.  Added row highlight where
none had been implemented.  Repaired validation error w/ mislocated input tag.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-12 09:58:53 -05:00
b43c829027 More markup corrections for better validation.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-09-02 17:36:05 -05:00
Jesse Weaver
da3b0a48e9 fix "Add Tag" button in MARC framework editor
This is part of bug 2282. This patch also improves the "Delete Tag" button so it brings you back to where you were.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-14 20:10:09 -05:00
0f8c4b1bd8 Fix a bug preventing existing tag modification in MARC Framework
It wasn't possible to edit an existing tag. The program was idenfifying
tag modification as a tag creation.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-08 11:19:04 -06:00
Henri-Damien LAURENT
1391105a7c Bug Fixing : Could not add new undefined tag if searchfield>0
For instance, search for tag 290
cannot find.
Click on addTag
Save
Then wouldnot add tag 290 because used UPDATE.
Now, if tag is not found then Add tag is done.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-03 07:24:19 -06:00
Chris Cormack
4c34e354df Shifting other variables, no need to have the same code twice just more chance for a typo :)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-11 18:43:29 -06:00
Chris Cormack
6515251152 Fix for variable scoping problem
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-11 18:43:08 -06:00
Paul POULAIN
5b4d5b6a0e #1546 REPLACE statements (continued)
- biblio framework
- marc tag
- auth tag

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-08 17:50:12 -06:00
Paul POULAIN
8b7085a8ab removing useless code
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>
2007-10-24 17:03:38 -05:00
Paul POULAIN
1450fd180e FIX for #1375
marc_subfield_structure.hidden lost on create new framework

Signed-off-by: Chris Cormack <crc@liblime.com>
2007-09-18 15:05:51 -05:00
a453c16632 Finishing cleanup of Admin templates: - Corrected markup generated by scripts. - Added standard or custom resident search form on all pages. - Add breadcrumb navigation to all pages
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-09-14 17:47:17 -05:00
hdl
100e6a9808 functions that were in C4::Interface::CGI::Output are now in C4::Output.
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.
2007-04-24 13:54:28 +00:00
tipaul
7bd99ef365 removing all useless %env / $env 2007-04-18 17:00:14 +00:00
tipaul
f8e9fb6445 rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
tgarip1957
fe59c6c516 New framework handling. New koha_attr table for mapping MARC to koha 2006-09-01 22:03:00 +00:00
toins
cc9524a875 Head & rel_2_2 merged 2006-07-04 14:36:51 +00:00
hdl
b810e2d71e changing parameters template directory to admin 2006-02-24 11:15:01 +00:00
tipaul
d5938493d7 synch'ing head and rel_2_2 (from 2.2.5, including npl templates)
Seems not to break too many things, but i'm probably wrong here.
at least, new features/bugfixes from 2.2.5 are here (tested on some features on my head local copy)

- removing useless directories (koha-html and koha-plucene)
2006-01-06 16:39:37 +00:00
tipaul
5e44e797eb synch'ing 2.2 and head 2005-06-20 13:15:46 +00:00
tipaul
93ff09d081 merging 2.2 branch with head. Sorry for not making it before, many many commits done here 2005-03-01 13:40:35 +00:00
oleonard
2bc14941ff Adding id attributes to CGI-generated form inputs so that HTML labels can transfer focus to the appropriate field. 2005-02-11 19:59:41 +00:00
oleonard
7f377d39ac Moving HTML markup to the template 2005-01-10 21:33:54 +00:00
tipaul
56d54d3d28 bugfix : returning to tag after modifying the tag. 2004-10-04 20:37:14 +00:00
doxulting
cb6e87e420 debugged framework interface. Frameworks for ensmp are ready too 2004-06-25 09:17:49 +00:00
tipaul
6ffc27d72f bugfixes 2004-06-17 08:18:42 +00:00
tipaul
af996a21e8 * frameworks and itemtypes are independant
* bugfixes in authority types & framework management (mainly deletion)
2004-06-03 10:01:28 +00:00
tipaul
88e67b8d3e framework management : 1 MARC framework for each itemtype 2004-05-18 15:22:10 +00:00
acli
fc4a43fcd0 Make the page headings translatable while trying not to break old templates 2004-03-11 05:42:55 +00:00