From srdjan at catalyst.net.nz Mon Dec 2 22:15:51 2013 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 3 Dec 2013 10:15:51 +1300 Subject: [Koha-patches] [PATCH] Bug 11077 - Correct silent warnings in C4/Auth.pm Message-ID: <1386018951-12100-1-git-send-email-srdjan@catalyst.net.nz> This gets rid of some more warnings. It also corrects a noisy ne condition. $userid = $retuserid if ( $retuserid ne ''); became $userid = $retuserid if ( $retuserid ); It also integrates Srdjan Jankovic's patch with Petter Goksoyrsen's patch, while correcting the problems found. This includes: my $q_userid = $query->param('userid') // ''; along with: my $s_userid = ''; and: my $s_userid = $session->param('id') // ''; Indentation does not reflect actual scoping. A missing system preference would have triggered a ubiquitous undef compare check failure message. This makes the flooding message more useful, so as to help correct it. The change to accomplish this was: my $pki_field = C4::Context->preference('AllowPKIAuth'); if (!defined($pki_field)) { print STDERR "Error: Missing AllowPKIAuth System Preference!\n"; $pki_field = 'None'; } Signed-off-by: Srdjan --- C4/Auth.pm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index c6475bb..00eeeef 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -650,6 +650,7 @@ sub checkauth { # This parameter is the name of the CAS server we want to authenticate against, # when using authentication against multiple CAS servers, as configured in Auth_cas_servers.yaml my $casparam = $query->param('cas'); + my $q_userid = $query->param('userid') // ''; if ( $userid = $ENV{'REMOTE_USER'} ) { # Using Basic Authentication, no cookies required @@ -669,9 +670,11 @@ sub checkauth { my $session = get_session($sessionID); C4::Context->_new_userenv($sessionID); my ($ip, $lasttime, $sessiontype); + my $s_userid = ''; if ($session){ + $s_userid = $session->param('id') // ''; C4::Context::set_userenv( - $session->param('number'), $session->param('id'), + $session->param('number'), $s_userid, $session->param('cardnumber'), $session->param('firstname'), $session->param('surname'), $session->param('branch'), $session->param('branchname'), $session->param('flags'), @@ -684,14 +687,14 @@ sub checkauth { $debug and printf STDERR "AUTH_SESSION: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ; $ip = $session->param('ip'); $lasttime = $session->param('lasttime'); - $userid = $session->param('id'); + $userid = $s_userid; $sessiontype = $session->param('sessiontype') || ''; } - if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne ($session->param('id') // '')) ) + if ( ( $query->param('koha_login_context') && ($q_userid ne $s_userid) ) || ( $cas && $query->param('ticket') ) ) { #if a user enters an id ne to the id in the current session, we need to log them in... #first we need to clear the anonymous session... - $debug and warn "query id = " . $query->param('userid') . " but session id = " . $session->param('id'); + $debug and warn "query id = $q_userid but session id = $s_userid"; $session->flush; $session->delete(); C4::Context->_unset_userenv($sessionID); @@ -711,7 +714,7 @@ sub checkauth { logout_cas($query); } } - elsif ( $lasttime < time() - $timeout ) { + elsif ( !$lasttime || ($lasttime < time() - $timeout) ) { # timed logout $info{'timed_out'} = 1; $session->delete() if $session; @@ -759,8 +762,12 @@ sub checkauth { -value => $session->id, -HttpOnly => 1 ); - $userid = $query->param('userid'); - my $pki_field = C4::Context->preference('AllowPKIAuth') // 'None'; + $userid = $q_userid; + my $pki_field = C4::Context->preference('AllowPKIAuth'); + if (! defined($pki_field) ) { + print STDERR "ERROR: Missing system preference AllowPKIAuth.\n"; + $pki_field = 'None'; + } if ( ( $cas && $query->param('ticket') ) || $userid || $pki_field ne 'None' @@ -835,7 +842,7 @@ sub checkauth { my $retuserid; ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query ); - $userid = $retuserid if ( $retuserid ne '' ); + $userid = $retuserid if ( $retuserid ); } if ($return) { #_session_log(sprintf "%20s from %16s logged in at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime)); -- 1.8.3.2 From tomascohen at gmail.com Thu Dec 12 16:45:28 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 12 Dec 2013 12:45:28 -0300 Subject: [Koha-patches] [PATCH 2/2] Bug 8018: (followup) make the default more explicit In-Reply-To: <1386863128-28025-1-git-send-email-tomascohen@gmail.com> References: <1386863128-28025-1-git-send-email-tomascohen@gmail.com> Message-ID: <1386863128-28025-2-git-send-email-tomascohen@gmail.com> This patch: - Makes the new subfield tab show maxlength=9999 as default (instead of empty-then-zero). - Updates the help to make exlpicit that 0 or empty defaults to 9999. - Assumes all the subfields created with maxlength=0 inadvertedly are meant to mean "no limit" and hence update the database to reflect that. To test (this patch and Pablo's): - Edit a MARC framework, edit some field's subfields. - Use the 'New' tab to create a new subfield (choose an unused letter). - See in "More constrains" that the "Max length" field is empty. Leave it as-is. - Save the changes (the new subfield). - Edit the field again, verify that "Max length" is 0. - Try tu use the framework and the the field/subfield just created > FAIL - Apply the patches, upgrade - Try to use the framework/field/subfield > SUCCESS (0 was converted to 9999) - Repeat from the beggining, "Max length" should show 9999 on the new subfield tab. - Leave it empty, it is saved as 9999. Regards To+ Edit: small typo Sponsored-by: Universidad Nacionald de Cordoba --- admin/marc_subfields_structure.pl | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../prog/en/modules/help/admin/marc_subfields_structure.tt | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index d347012..0589968 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -276,6 +276,7 @@ if ( $op eq 'add_form' ) { my %row_data; # get a fresh hash for the row data $row_data{'new_subfield'} = 1; $row_data{'subfieldcode'} = ''; + $row_data{'maxlength'} = 9999; $row_data{tab} = CGI::scrolling_list( -name => 'tab', diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 19893b4..11feae3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7824,6 +7824,12 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do("UPDATE marc_subfield_structure SET maxlength=9999 WHERE maxlength IS NULL OR maxlength=0;"); + print "Upgrade to $DBversion done (Bug 8018: new subfields have a default max length of zero)\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt index 9308e98..c949400 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt @@ -69,7 +69,7 @@ To edit the subfields associated with the tag, click 'Subfields' to the right of -- 1.8.3.2 From tomascohen at gmail.com Thu Dec 12 16:45:27 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 12 Dec 2013 12:45:27 -0300 Subject: [Koha-patches] [PATCH 1/2] Bug 8018: maxlenght should default to 9999 for subfields Message-ID: <1386863128-28025-1-git-send-email-tomascohen@gmail.com> From: Pablo Bianchi The default value for the marc_subfield_structure.maxlenght is 9999 in the DB. Currently the template passes an empty value which is casted to 0 by the CGI. This simple patch validates the input and converts to the default (9999) if not defined or 0. Another approach could be changing the 9999 default and/or treating 0 as 'no-limit'. PabloAB Signed-off-by: Tomas Cohen Arazi Works by defaulting 0 or "" to 9999. --- admin/marc_subfields_structure.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 615fbcf..d347012 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -425,7 +425,7 @@ elsif ( $op eq 'add_validate' ) { my $isurl = $input->param("isurl$i") ? 1 : 0; my $link = $link[$i]; my $defaultvalue = $defaultvalue[$i]; - my $maxlength = $maxlength[$i]; + my $maxlength = $maxlength[$i] ? $maxlength[$i] : 9999; if (defined($liblibrarian) && $liblibrarian ne "") { unless ( C4::Context->config('demo') eq 1 ) { -- 1.8.3.2 From tomascohen at gmail.com Fri Dec 13 18:55:14 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 13 Dec 2013 14:55:14 -0300 Subject: [Koha-patches] [PATCH 1/3] Bug 10691: 5xx not properly linked by authid in authority search result list [Staff] Message-ID: <1386957316-10850-1-git-send-email-tomascohen@gmail.com> This patch changes the URL and data used to show the 'see also' links on the Staff's authority search results page. Bonus points: makes some strings translatable. To test: - On your dev setup (master) create some authority records (i created personal name authorities). - Pick one of them and link 400$a to another one, do the same with 500$a - Add some other 400$a and 500$a entries with plain text (i.e. no linking) - Make sure zebra is running and changes got indexed. - In the staff interface search for the authority that is linked to the others. - Check the 'see also:' link points to an authority search - Apply the patch - Reload/re-do the search - Check the 'see also:' link points to the authority id for linked authorities, and to an authority search result in the case of plain text entries. - Check that the authority search from the cataloguing interface still works as usual. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No errors Signed-off-by: Jonathan Druart --- .../en/includes/authorities-search-results.inc | 96 ++++++++++++++-------- .../en/modules/authorities/searchresultlist.tt | 2 +- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc index 2ee4571..bb8e3f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,4 +1,7 @@ [% BLOCK showreference %] + [% SET authidurl = '/cgi-bin/koha/authorities/detail.pl?authid=' %] + [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=' %] + [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] @@ -11,30 +14,48 @@ RT: [% heading | html %] [% END %] [% ELSE %] - [% IF ( label ) %][% label | html %][% END %] + + [% IF ( type=='seefrom' ) %] + used for/see from: + [% ELSIF ( type=='seealso' ) %] + see also: + [% END %] + - [% IF ( linkpath && search ) %][% heading | html %] - [% ELSE %][% heading | html %][% END %] + [% IF ( type=='seealso' ) %] + [% IF ( authid ) %] + [% heading | html %] + [% ELSE %] + [% heading | html %] + [% END %] + [% ELSE %] + [% heading | html %] + [% END %] - [% UNLESS ( type=='seefrom' || type=='seealso' ) %][% SWITCH type %] - [% CASE 'earlier' %](Earlier heading) - [% CASE 'later' %](Later heading) - [% CASE 'acronym' %](Acronym) - [% CASE 'musical' %](Musical composition) - [% CASE 'broader' %](Broader heading) - [% CASE 'narrower' %](Narrower heading) - [% CASE 'parent' %](Immediate parent body) - [% CASE %][% IF type %]([% type | html %])[% END %] - [% END %][% END %] + [% UNLESS ( type=='seefrom' || type=='seealso' ) %] + + [% SWITCH type %] + [% CASE 'earlier' %](Earlier heading) + [% CASE 'later' %](Later heading) + [% CASE 'acronym' %](Acronym) + [% CASE 'musical' %](Musical composition) + [% CASE 'broader' %](Broader heading) + [% CASE 'narrower' %](Narrower heading) + [% CASE 'parent' %](Immediate parent body) + [% CASE %][% IF type %]([% type | html %]) + [% END %] + [% END %] + + [% END %] [% END %] [% END %] [% BLOCK authresult %] [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %] [% UNLESS ( summary.summaryonly ) %]
- [% FOREACH authorize IN summary.authorized %] - [% authorize.heading | html %] - [% END %] + [% FOREACH authorize IN summary.authorized %] + [% authorize.heading | html %] + [% END %]
[% IF ( marcflavour == 'UNIMARC' ) %] [% IF summary.notes %] @@ -52,36 +73,43 @@ [% END %] [% END %] - [% IF summary.seealso %] -
- [% FOREACH see IN summary.seealso %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] - [% IF ! loop.last %] ; [% END %] + [% IF summary.seealso %] +
+ [% FOREACH see IN summary.seealso %] + [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% IF ! loop.last %] ; [% END %] + [% END %] +
[% END %] -
- [% END %] - [% IF summary.otherscript %] -
- [% FOREACH other IN summary.otherscript %] - [% PROCESS language lang=other.lang | trim %]: - [% other.term %] - [% IF ! loop.last %] ; [% END %] + [% IF summary.otherscript %] +
+ [% FOREACH other IN summary.otherscript %] + [% PROCESS language lang=other.lang | trim %]: + [% other.term %] + [% IF ! loop.last %] ; [% END %] + [% END %] +
[% END %] -
- [% END %] - [% ELSE %] [% IF ( summary.seefrom ) %] [% FOREACH seefro IN summary.seefrom %]
- [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %] + [% PROCESS showreference + heading=seefro.heading + type=seefro.type + authid=seefro.authid + %]
[% END %] [% END %] [% IF ( summary.seealso ) %] [% FOREACH seeals IN summary.seealso %]
- [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %] + [% PROCESS showreference + heading=seeals.heading + type=seeals.type + authid=seeals.authid + %]
[% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt index f73b819..49ba49f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -80,7 +80,7 @@ function searchauthority() { [% ELSE %] [% END %] - [% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=" %] + [% PROCESS authresult summary=resul.summary %] Details [% UNLESS ( resul.isEDITORS ) %] -- 1.8.3.2 From tomascohen at gmail.com Fri Dec 13 18:55:15 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 13 Dec 2013 14:55:15 -0300 Subject: [Koha-patches] [PATCH 2/3] Bug 10691: 5xx not properly linked by authid in authority search result list In-Reply-To: <1386957316-10850-1-git-send-email-tomascohen@gmail.com> References: <1386957316-10850-1-git-send-email-tomascohen@gmail.com> Message-ID: <1386957316-10850-2-git-send-email-tomascohen@gmail.com> This patch changes the URL and data used to show the 'see also' links on the OPAC's authority search results page. Bonus points: makes some strings translatable. To test: - On your dev setup (master) create some authority records (i created personal name authorities). - Pick one of them and link 400$a to another one, do the same with 500$a - Add some other 400$a and 500$a without linking (i.e. plain text) - Make sure zebra is running and changes got indexed. - In the OPAC search for the authority that is linked to the others. - Check the 'see also:' link points to an authority search - Apply the patch - Reload/re-do the search - Check the 'see also:' link points to the authority id in the case of linked authorities, and to an authority search in the case of plain text names. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No errors Signed-off-by: Jonathan Druart --- .../en/includes/authorities-search-results.inc | 60 +++++++++++++++------- .../en/modules/opac-authoritiessearchresultlist.tt | 58 ++++++++++----------- 2 files changed, 71 insertions(+), 47 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc index ea2aa16..b3371aa 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,4 +1,6 @@ [% BLOCK showreference %] + [% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %] + [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=' %] [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] @@ -11,24 +13,39 @@ RT: [% heading | html %] [% END %] [% ELSE %] - [% IF ( label ) %][% SWITCH label %] - [% CASE 'see also:' %]see also: - [% CASE 'used for/see from:' %]used for/see from: - [% END %][% END %] + + [% IF ( type=='seefrom' ) %] + used for/see from: + [% ELSIF ( type=='seealso' ) %] + see also: + [% END %] + - [% IF ( linkpath && search ) %][% heading | html %] - [% ELSE %][% heading | html %][% END %] + [% IF ( type=='seealso' ) %] + [% IF ( authid ) %] + [% heading | html %] + [% ELSE %] + [% heading | html %] + [% END %] + [% ELSE %] + [% heading | html %] + [% END %] - [% UNLESS ( type=='seefrom' || type=='seealso' ) %][% SWITCH type %] - [% CASE 'earlier' %](Earlier heading) - [% CASE 'later' %](Later heading) - [% CASE 'acronym' %](Acronym) - [% CASE 'musical' %](Musical composition) - [% CASE 'broader' %](Broader heading) - [% CASE 'narrower' %](Narrower heading) - [% CASE 'parent' %](Immediate parent body) - [% CASE %][% IF type %]([% type | html %])[% END %] - [% END %][% END %] + [% UNLESS ( type=='seefrom' || type=='seealso' ) %] + + [% SWITCH type %] + [% CASE 'earlier' %](Earlier heading) + [% CASE 'later' %](Later heading) + [% CASE 'acronym' %](Acronym) + [% CASE 'musical' %](Musical composition) + [% CASE 'broader' %](Broader heading) + [% CASE 'narrower' %](Narrower heading) + [% CASE 'parent' %](Immediate parent body) + [% CASE %][% IF type %]([% type | html %]) + [% END %] + [% END %] + + [% END %] [% END %] [% END %] [% BLOCK authresult %] @@ -76,14 +93,21 @@ [% IF ( summary.seefrom ) %] [% FOREACH seefro IN summary.seefrom %]
- [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %] + [% PROCESS showreference + heading=seefro.heading + type=seefro.type + %]
[% END %] [% END %] [% IF ( summary.seealso ) %] [% FOREACH seeals IN summary.seealso %]
- [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %] + [% PROCESS showreference + heading=seeals.heading + type=seeals.type + authid=seeals.authid + %]
[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt index 6f889b0..7f80fe0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt @@ -44,35 +44,35 @@ [% IF ( total ) %]
- - - - - [% UNLESS ( isEDITORS ) %] - - [% END %] - - - [% FOREACH resul IN result %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - - [% END %] - - - [% UNLESS ( resul.isEDITORS ) %] - - [% END %] - - - [% END %] -
Authorized headingsType of headingBiblio recordsFull heading
[% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=" %][% resul.authtype %] - [% resul.used %] biblios - - View full heading -
-
+ + + + + [% UNLESS ( isEDITORS ) %] + + [% END %] + + +[% FOREACH resul IN result %] + [% UNLESS ( loop.odd ) %] + + [% ELSE %] + + [% END %] + + + [% UNLESS ( resul.isEDITORS ) %] + + [% END %] + + +[% END %] +
Authorized headingsType of headingBiblio recordsFull heading
[% PROCESS authresult summary=resul.summary %][% resul.authtype %] + [% resul.used %] biblios + + View full heading +
+
[% IF ( displayprev ) %] << -- 1.8.3.2 From tomascohen at gmail.com Fri Dec 13 18:55:16 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 13 Dec 2013 14:55:16 -0300 Subject: [Koha-patches] [PATCH 3/3] Bug 10691: (follow-up) restore behaviour for control field ($w) In-Reply-To: <1386957316-10850-1-git-send-email-tomascohen@gmail.com> References: <1386957316-10850-1-git-send-email-tomascohen@gmail.com> Message-ID: <1386957316-10850-3-git-send-email-tomascohen@gmail.com> As noted by Jared, on the presence of 4XX$w or 5XX$w the display got broken by this refactoring. This patch restores de previous behaviour in that front. The OPAC themes get fixed too, and the Bootstrap one gets this fix too. Applied the fix that Galen proposed on comment #30 regarding Zeno's fix in bug 11174. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- .../en/includes/authorities-search-results.inc | 19 +++++++--- .../en/includes/authorities-search-results.inc | 42 ++++++++++++++++++---- .../en/modules/opac-authoritiessearchresultlist.tt | 4 +-- .../en/includes/authorities-search-results.inc | 22 ++++++++---- 4 files changed, 68 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc index bb8e3f6..7d96264 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,4 +1,11 @@ [% BLOCK showreference %] + [% SET authidurl = '/cgi-bin/koha/authorities/detail.pl?authid=' %] [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=' %] @@ -15,14 +22,14 @@ [% END %] [% ELSE %] - [% IF ( type=='seefrom' ) %] + [% IF ( linkType=='seefrom' ) %] used for/see from: - [% ELSIF ( type=='seealso' ) %] + [% ELSIF ( linkType=='seealso' ) %] see also: [% END %] - [% IF ( type=='seealso' ) %] + [% IF ( linkType=='seealso' ) %] [% IF ( authid ) %] [% heading | html %] [% ELSE %] @@ -68,7 +75,7 @@ [% IF summary.seefrom %]
[% FOREACH see IN summary.seefrom %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %] [% IF ! loop.last %] ; [% END %] [% END %]
@@ -76,7 +83,7 @@ [% IF summary.seealso %]
[% FOREACH see IN summary.seealso %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %] [% IF ! loop.last %] ; [% END %] [% END %]
@@ -96,6 +103,7 @@
[% PROCESS showreference heading=seefro.heading + linkType='seefrom' type=seefro.type authid=seefro.authid %] @@ -107,6 +115,7 @@
[% PROCESS showreference heading=seeals.heading + linkType='seealso' type=seeals.type authid=seeals.authid %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc index 61bd900..6a9f9d0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc @@ -1,4 +1,13 @@ [% BLOCK showreference %] + + [% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %] + [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=' %] [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] @@ -11,10 +20,22 @@ RT: [% heading | html %] [% END %] [% ELSE %] - [% IF ( label ) %][% label | html %][% END %] + + [% IF ( linkType=='seefrom' ) %] + used for/see from: + [% ELSIF ( linkType=='seealso' ) %] + see also: + [% END %] - [% IF ( linkpath && search ) %][% heading | html %] - [% ELSE %][% heading | html %][% END %] + [% IF ( linkType=='seealso' ) %] + [% IF ( authid ) %] + [% heading | html %] + [% ELSE %] + [% heading | html %] + [% END %] + [% ELSE %] + [% heading | html %] + [% END %] [% UNLESS ( type=='seefrom' || type=='seealso' ) %] @@ -53,7 +74,7 @@ [% IF summary.seealso %]
[% FOREACH see IN summary.seealso %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %] [% IF ! loop.last %] ; [% END %] [% END %]
@@ -71,14 +92,23 @@ [% IF ( summary.seefrom ) %] [% FOREACH seefro IN summary.seefrom %]
- [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %] + [% PROCESS showreference + heading=seefro.heading + linkType='seefrom' + type=seefro.type + %]
[% END %] [% END %] [% IF ( summary.seealso ) %] [% FOREACH seeals IN summary.seealso %]
- [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %] + [% PROCESS showreference + heading=seeals.heading + linkType='seealso' + type=seeals.type + authid=seeals.authid + %]
[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt index 6256f18..262d7f0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt @@ -85,7 +85,7 @@ [% FOREACH resul IN result %] - [% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=" %] + [% PROCESS authresult summary=resul.summary %] [% resul.authtype %] [% UNLESS ( resul.isEDITORS ) %] @@ -111,4 +111,4 @@
[% INCLUDE 'opac-bottom.inc' %] -[% BLOCK jsinclude %][% END %] \ No newline at end of file +[% BLOCK jsinclude %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc index b3371aa..dcd2efc 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,6 +1,13 @@ [% BLOCK showreference %] + [% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %] - [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=' %] + [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=' %] [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] @@ -14,14 +21,14 @@ [% END %] [% ELSE %] - [% IF ( type=='seefrom' ) %] + [% IF ( linkType=='seefrom' ) %] used for/see from: - [% ELSIF ( type=='seealso' ) %] + [% ELSIF ( linkType=='seealso' ) %] see also: [% END %] - [% IF ( type=='seealso' ) %] + [% IF ( linkType=='seealso' ) %] [% IF ( authid ) %] [% heading | html %] [% ELSE %] @@ -67,7 +74,7 @@ [% IF summary.seefrom %]
[% FOREACH see IN summary.seefrom %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %] [% IF ! loop.last %] ; [% END %] [% END %]
@@ -75,7 +82,7 @@ [% IF summary.seealso %]
[% FOREACH see IN summary.seealso %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %] [% IF ! loop.last %] ; [% END %] [% END %]
@@ -95,7 +102,9 @@
[% PROCESS showreference heading=seefro.heading + linkType='seefrom' type=seefro.type + authid=seefro.authid %]
[% END %] @@ -105,6 +114,7 @@
[% PROCESS showreference heading=seeals.heading + linkType='seealso' type=seeals.type authid=seeals.authid %] -- 1.8.3.2 From nengard at bywatersolutions.com Sat Dec 14 19:35:32 2013 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sat, 14 Dec 2013 12:35:32 -0600 Subject: [Koha-patches] [PATCH] Bug 11383: Add help file for Marc modification templates Message-ID: <1387046132-1660-1-git-send-email-nengard@bywatersolutions.com> This patch adds the missing help files to the Marc modification templates tool. To test: * Visit Tools > Marc modification templates * Click 'Help' in the top right * Confirm that help is there and right --- .../help/tools/marc_modification_templates.tt | 63 ++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt new file mode 100644 index 0000000..c63a946 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt @@ -0,0 +1,63 @@ +[% INCLUDE 'help-top.inc' %] + +

MARC Modification Templates

+ +

The MARC Modification Templates system gives Koha users the power to make alterations to MARC records automatically while staging MARC records for import.

+ +

This tool is useful for altering MARC records from various venders/sources work with your MARC framework. The system essentially allows one to create a basic script using actions to Copy, Move, Add, Update and Delete fields.

+ +

Start by adding a new template (a template can be made up of one or more actions) by entering a name and clicking 'Create template'.

+ +

Next you can add actions to the template by filling in the Action box. For example if you're loading in a batch of files from your EBook vendor you might want to add the biblio item type of EBOOK to the 942$c.

+ +
    +
  • Choose 'Add/Update'
  • +
  • Enter the field 942 and subfield c
  • +
  • Enter the value of 'EBOOK' (or whatever your ebook item type code is)
  • +
  • Provide a description so you can identify this action later
  • +
  • Click 'Add action'
  • +
+ +

Each action can also have an optional condition to check the value or existance of another field. For example you might want to add the call number to the item record if it's not already there.

+ +
    +
  • Choose 'Copy'
  • +
  • Decide if you want to copy the first occurance or all occurances of the field
  • +
  • Enter the field 090 (or other biblio call number field) and subfield a to copy
  • +
  • Enter the 952 field and o subfield to copy to
  • +
  • Choose 'if'
  • +
  • Enter the 952 field and o subfield
  • +
  • Choose "doesn't exist"
  • +
  • Provide a description so you can identify this action later
  • +
  • Click 'Add action'
  • +
+ +

The Copy & Move actions also support Regular Expressions, which can be used to automatically modify field values during the copy/move. An example would be to strip out the '$' character in field 020$c.

+ +
    +
  • Choose 'Copy'
  • +
  • Decide if you want to copy the first occurance or all occurances of the field
  • +
  • Enter the field 020 and subfield c to copy
  • +
  • Enter the 020 field and c subfield to copy to
  • +
  • Check the 'RegEx' box and enter your regular expression ( in this case s/\$// )
  • +
  • Choose 'if'
  • +
  • Enter the 020 field and c subfield
  • +
  • Choose "matches"
  • +
  • Check the 'RegEx' box and enter your regular expression ( in this case m/^\$/ )
  • +
  • Provide a description so you can identify this action later
  • +
  • Click 'Add action'
  • +
+ +

Tip: The value for an update can include variables that change each time the template is used. Currently, the system supports two variables, __BRANCHCODE__ which is replaced with the branchcode of the library currently using the template, and __CURRENTDATE__ which is replaced with the current date in ISO format ( YYYY-MM-DD ).

+ +

Once your actions are saved you can view them at the top of the screen. Actions can be moved around using the arrows to the left of them.

+ +

Depending on your actions the order may be very important. For example you don't want to delete a field before you copy it to another field.

+ +

To add another template you can either start fresh or click the 'Duplicate current template' checkbox to create a copy of an existing template to start with.

+ +

Once your template is saved you will be able to pick it when using the Stage MARC Records for Import tool.

+ +

See the full documentation for MARC Modification Templates in the manual (online).

+ +[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file -- 1.7.2.3 From tomascohen at gmail.com Mon Dec 16 14:49:32 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Mon, 16 Dec 2013 10:49:32 -0300 Subject: [Koha-patches] [PATCH] Bug 11400: Show "Login as a different user" instead of "Logout" if not enough premissions Message-ID: <1387201772-16877-1-git-send-email-tomascohen@gmail.com> Bug 11146 introduced a way to go back, and have a logout link for the "Not enough permissions" message page. I belive this string change is worth. Simple and disputable string change. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index 5f97758..fc73ffe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -22,7 +22,7 @@
[% END %] -- 1.8.5 From nengard at bywatersolutions.com Mon Dec 16 16:53:57 2013 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 16 Dec 2013 09:53:57 -0600 Subject: [Koha-patches] [PATCH] Bug 11403: Add missing help file to new Renew page Message-ID: <1387209237-1746-1-git-send-email-nengard@bywatersolutions.com> This patch adds a help file to the Renew page found under Circulation. To test: * Go to Circulation > Renew * Click the help link * Confirm text and manual link are correct. --- .../prog/en/modules/help/circ/renew.tt | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/renew.tt diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/renew.tt new file mode 100644 index 0000000..95cdf7d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/renew.tt @@ -0,0 +1,13 @@ +[% INCLUDE 'help-top.inc' %] + +

Renew

+ +

Checked out items can be renewed (checked out for another period of time) based on your circulation rules and renewal preferences.

+ +

To renew an item from this page you can the barcodes of the items you would like to renew.

+ +

If the barcode is not found or the item is not actually checked out you will be presented with an error. Otherwise the item is renewed and you will receive a confirmation message.

+ +

See the full documentation for Renewing in the manual (online).

+ +[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file -- 1.7.2.3 From tomascohen at gmail.com Mon Dec 16 19:09:22 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Mon, 16 Dec 2013 15:09:22 -0300 Subject: [Koha-patches] [PATCH] Bug 11404: Apache 2.4 expects the sites definition files use the sufix '.conf' Message-ID: <1387217362-22346-1-git-send-email-tomascohen@gmail.com> To reproduce: - Install the 'koha-common' package on Debian 7 or Ubuntu 13.10 (both known to include Apache 2.4). - Create an instance (for example testlibrary) using the supplied commands: $ koha-create --create-db testlibrary > FAIL: apache reports an error like this: "ERROR: Site testlibrary does not exist!" This patch adds a test on the Apache version and appends the needed ".conf" sufix if needed. To test: 1st step: koha-create gets fixed: -- The hard way -- - Apply the patch, and build the koha-common package on top of this commit. - Install the built package on an Apache 2.4 Debian-based distro (Debian 7 or Ubuntu 13.10 will work) - Create a test instance: $ koha-create --create-db testlibrary > SUCCESS: no more apache sites related error. -- The easy way -- - Apply the patch, and copy the koha-create into an Apache 2.4 Debian-based distro - Create a test instance using the koha-create script you just copied: $ ./koha-create --create-db testlibrary > SUCCESS: no more apache sites related error. 2nd step: the rest of the touched scripts keep working as usual koha-disable koha-dump koha-enable koha-list koha-remove koha-restart-zebra koha-stop-zebra oha-start-zebra They should all keep working. Can be tested "the easy way" too. Then sign on the patch. Note: there might be another issues regarding Apache 2.4 deployments like the need for $ a2enmod access_compat and perhaps some directory permissions tweak, which I think should be properly documented on the install instructions. Regards To+ Edit: some old indentation error fixed. Sponsored-by: Universidad Nacional de Cordoba --- debian/scripts/koha-create | 15 ++++++++++----- debian/scripts/koha-disable | 14 ++++++++++++-- debian/scripts/koha-dump | 9 +++++++-- debian/scripts/koha-enable | 14 ++++++++++++-- debian/scripts/koha-list | 7 ++++++- debian/scripts/koha-remove | 10 ++++++++-- debian/scripts/koha-restart-zebra | 7 ++++++- debian/scripts/koha-start-zebra | 7 ++++++- debian/scripts/koha-stop-zebra | 7 ++++++- 9 files changed, 73 insertions(+), 17 deletions(-) diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index 7f05eb0..cead3fd 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -257,11 +257,11 @@ while true ; do CLO_MEMCACHED_PREFIX="$2" ; shift 2;; -m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; - -l|--zebralang) + -l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; - --auth-idx) + --auth-idx) CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;; - --biblio-idx) + --biblio-idx) CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;; -d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; @@ -437,8 +437,13 @@ eof fi #` # Generate and install Apache site-available file and log dir. - generate_config_file apache-site.conf.in \ - "/etc/apache2/sites-available/$name" + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + generate_config_file apache-site.conf.in \ + "/etc/apache2/sites-available/$name.conf" + else + generate_config_file apache-site.conf.in \ + "/etc/apache2/sites-available/$name" + fi mkdir "/var/log/koha/$name" chown "$username:$username" "/var/log/koha/$name" diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable index 75e3997..4eb0fbc 100755 --- a/debian/scripts/koha-disable +++ b/debian/scripts/koha-disable @@ -34,13 +34,18 @@ warn() is_enabled() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if ! is_instance $instancename; then return 1 fi if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \ - "/etc/apache2/sites-available/$instancename" ; then + "$instancefile" ; then return 1 else return 0 @@ -63,10 +68,15 @@ is_instance() disable_instance() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if is_enabled $instancename; then sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \ - "/etc/apache2/sites-available/$instancename" + "$instancefile" return 0 else return 1 diff --git a/debian/scripts/koha-dump b/debian/scripts/koha-dump index 2fe9edd..6bba350 100755 --- a/debian/scripts/koha-dump +++ b/debian/scripts/koha-dump @@ -54,14 +54,19 @@ mysqldump --databases --host="$mysqlhost" \ chown "root:$name-koha" "$dbdump" chmod g+r "$dbdump" +instancefile="$name" +if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + # Apache 2.4 needs the file have the sufix .conf + instancefile="$instancefile.conf" +fi # Dump configs, logs, etc. metadump="$backupdir/$name-$date.tar.gz" echo "* configs, logs to $metadump" tar -C / -czf "$metadump" \ "etc/koha/sites/$name" \ - "etc/apache2/sites-available/$name" \ - "etc/apache2/sites-enabled/$name" \ + "etc/apache2/sites-available/$instancefile" \ + "etc/apache2/sites-enabled/$instancefile" \ "var/lib/koha/$name" \ "var/log/koha/$name" diff --git a/debian/scripts/koha-enable b/debian/scripts/koha-enable index c0bbfa2..43bedf2 100755 --- a/debian/scripts/koha-enable +++ b/debian/scripts/koha-enable @@ -34,13 +34,18 @@ warn() is_enabled() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if ! is_instance $instancename; then return 1 fi if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \ - "/etc/apache2/sites-available/$instancename" ; then + "$instancefile" ; then return 1 else return 0 @@ -63,10 +68,15 @@ is_instance() enable_instance() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if ! is_enabled $instancename; then sed -i 's:^\(\s*Include /etc/koha/apache-shared-disable.conf\)$:#\1:' \ - "/etc/apache2/sites-available/$instancename" + "$instancefile" return 0 else return 1 diff --git a/debian/scripts/koha-list b/debian/scripts/koha-list index 445a22a..b4d016f 100755 --- a/debian/scripts/koha-list +++ b/debian/scripts/koha-list @@ -28,9 +28,14 @@ die() is_enabled() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if grep '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \ - "/etc/apache2/sites-available/$instancename" > /dev/null + "$instancefile" > /dev/null then return 1 else diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove index 3fa5ef1..1de3232 100755 --- a/debian/scripts/koha-remove +++ b/debian/scripts/koha-remove @@ -68,8 +68,14 @@ eof # If the daemon is not running already, we don't want to fail this loop. So bin the result code if this fails. koha-stop-zebra $name || /bin/true - [ -f "/etc/apache2/sites-available/$name" ] && \ - rm "/etc/apache2/sites-available/$name" + + instancefile="$name" + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi + + [ -f "/etc/apache2/sites-available/$instancefile" ] && \ + rm "/etc/apache2/sites-available/$instancefile" [ -f "/etc/koha/sites/$name/koha-conf.xml" ] && \ rm "/etc/koha/sites/$name/koha-conf.xml" [ -f "/etc/koha/sites/$name/zebra-biblios.cfg" ] && \ diff --git a/debian/scripts/koha-restart-zebra b/debian/scripts/koha-restart-zebra index 024251e..0ea9cfc 100755 --- a/debian/scripts/koha-restart-zebra +++ b/debian/scripts/koha-restart-zebra @@ -32,13 +32,18 @@ warn() is_enabled() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if ! is_instance $instancename; then return 1 fi if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \ - "/etc/apache2/sites-available/$instancename" ; then + "$instancefile" ; then return 1 else return 0 diff --git a/debian/scripts/koha-start-zebra b/debian/scripts/koha-start-zebra index f63ab42..dc771a0 100755 --- a/debian/scripts/koha-start-zebra +++ b/debian/scripts/koha-start-zebra @@ -32,13 +32,18 @@ warn() is_enabled() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if ! is_instance $instancename; then return 1 fi if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \ - "/etc/apache2/sites-available/$instancename" ; then + "$instancefile" ; then return 1 else return 0 diff --git a/debian/scripts/koha-stop-zebra b/debian/scripts/koha-stop-zebra index e60f2b3..8fff226 100755 --- a/debian/scripts/koha-stop-zebra +++ b/debian/scripts/koha-stop-zebra @@ -32,13 +32,18 @@ warn() is_enabled() { local instancename=$1 + local instancefile="/etc/apache2/sites-available/$instancename" + + if apache2ctl -v | grep -q "Server version: Apache/2.4"; then + instancefile="$instancefile.conf" + fi if ! is_instance $instancename; then return 1 fi if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \ - "/etc/apache2/sites-available/$instancename" ; then + "$instancefile" ; then return 1 else return 0 -- 1.8.5