[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-06-08 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #28480|0   |1
is obsolete||

--- Comment #44 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 28724
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28724action=edit
Bug 11592 - MARC Visibility settings not respected

The advanced constraints section while editing subfield
structure for a particular MARC bibliographic framework allow
the user to set visibility settings for OPAC and Intranet.

These settings are not fully respected. This was first
discovered while comparing the information displayed on
the opac-MARCdetail and opac-detail pages. To this end,
this patch will provide the ability to correct this problem
across the board as desired, but will focus primarily on the
OPAC interface.

This was accomplished by adding 3 functions to C4/Biblio.pm:
- ShouldDisplayOnInterface
- ShouldHideMARC
- GetFilteredBiblio
And also by modifying GetMarcBiblio to filter or not based on
parameter style and parameter values passed.

ShouldDisplayOnInterface is a wrapper routine which just
returns a hash of hashes which let us know if something is
visible (1) or not (0 or undef) for a given interface (opac
or intranet). This allows us to add/remove to the advance
constraints section and then not have to update multiple
routines to keep the filtering working properly, though if it
is a drastic refactoring that would be necessary.

ShouldHideMARC takes a field from marc_subfield_structure,
and determines if it should be hidden. It does this for
all the fields for a given framework code on a particular
interface. If no framework code is given, the framework
code used is the default one. If not interface is specified,
OPAC is assumed. This routine returns a hash reference to the
corresponding hash that was built.

GetFilteredBiblio takes a MARC::Record, clones it, and then
strips all the fields that should not be visible for a given
framework code and interface. If no framework code is specied,
it assumes the default one. If no interface is given, OPAC is
assumed. The routine then returns the filtered record.

GetMarcBiblio was modified to accept a hash style
parameter. This allowed for filtering if the new convention
was used, and no apparent change if the old convention is used.

These functions allowed for filtering, but frequently there were
problems with titles, subjects, etc. This required other tweaks.
In C4/Biblio.pm, GetMarcSubjects was returning the subject,
even it was supposed to be hidden. C4/XSLT.pm tried to replace
a field with no field, rather than properly delete it.

With the filtering being implemented based on the parameter
style, it just required a minor tweak in opac-ISDBdetail to
filter. The title needed to be purposefully not set if it was
supposed to be hidden in opac-MARCdetail.

However, opac-detail was interesting challenge. First, changing
the parameter style did filtering, but the output still was
leaking things which should be hidden. This is the main reason
ShouldHideMARC was written, because there is an insidious
little loop that runs through a set of keys and sets template
parameters to values.

Second, By skipping to the next key based on the hash ref
returned by ShouldHideMARC, the template parameter is not set,
and thus the value is properly hidden.

Third, the subtitle was grabbed by GetRecordValue. This was
refactored so filtering worked properly.

Then opac-MARCdetail's 'view plain' was still showing details.
This required converting the XML record to a MARC::Record,
filtering it, and then converting it back.

By tweaking opac-export and opac-showmarc to use the new
parameter calling convention, records were filtered properly.

And of course, with modifications and additions to C4/Biblio.pm,
tests were required.

t/Biblio.t has been modified to check the new function
ShouldDisplayOnInterface.

t/db_dependent/Biblio.t has also been modified. It confirms
that both old and new calling conventions work. It also tests
hiding the title field (200$a UNIMARC, 245$a MARC). It includes
tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio.

TEST PLAN
-
 1) Back up your DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC 

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-06-06 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #41 from David Cook dc...@prosentient.com.au ---
Comment on attachment 28480
  -- http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28480
Bug 11592 - MARC Visibility settings not respected

Review of attachment 28480:
 -- 
(http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.htmlbug=11592attachment=28480)
-

Overall, I really want to see this patch get into Koha. However, I think there
is some unnecessary code, some potentially incorrect code, and some code that
probably belongs in a different bug/patch.

::: C4/Biblio.pm
@@ +1322,5 @@
 +my $display   = ShouldDisplayOnInterface();
 +
 +my $dbh = C4::Context-dbh;
 +my $sth = $dbh-prepare(SELECT kohafield AS field, tagfield AS tag, 
 hidden FROM marc_subfield_structure WHERE kohafield'' AND frameworkcode=? 
 ORDER BY field, tagfield;);
 +my $rv = $sth-execute($frameworkcode);

Why is there a my $rv here? It shouldn't be needed.

@@ +1331,5 @@
 +my @tmpsplit = split(/\./,$fullfield);
 +my $field = $tmpsplit[-1];
 +foreach my $tag (keys %{$data-{$fullfield}}) {
 +my $show = $display-{$interface}-{ 
 $data-{$fullfield}-{$tag}-{'hidden'} };
 +if (!$show || $show==0) {

$show should always be 1 or undefined, so I wouldn't think $show==0 would be
necessary

@@ +1334,5 @@
 +my $show = $display-{$interface}-{ 
 $data-{$fullfield}-{$tag}-{'hidden'} };
 +if (!$show || $show==0) {
 +$shouldhidemarc{ $field } = 1;
 +}
 +elsif ( !exists($shouldhidemarc{ $field }) ) {

It shouldn't be necessary to add fields that aren't hidden to this hash. Plus,
since the value is 0, you'll most likely get the same end result you would if
you didn't have this block of code.

@@ +1493,5 @@
 +# LDR field is excluded from $record-fields().
 +# if we hide it here, the MARCXML-MARC::Record-MARCXML
 +# transformation blows up.
 +#}
 +foreach my $fields ($record-fields()) {

Should probably use $field rather than $fields, as this incorrect pluralization
gets confusing lower down.

@@ +1495,5 @@
 +# transformation blows up.
 +#}
 +foreach my $fields ($record-fields()) {
 +my $tag = $fields-tag();
 +my $hidden;

This $hidden variable isn't really necessary. If it should be hidden, you
should just hide/delete it upon detection. The code looks like it would work
either way, but it would be easier to read with less needless code.

@@ +1500,5 @@
 +if ($tag=10) {
 +foreach my $subpairs ($fields-subfields()) {
 +my ($subtag,$value) = @$subpairs;
 +my $visibility = 
 $marcsubfieldstructure-{$tag}-{$subtag}-{hidden};
 +$visibility //= 0;

Is there are a reason to have this extra line instead of my $visibility =
$marcsubfieldstructure-{$tag}-{$subtag}-{hidden} // 0?

@@ +1670,4 @@
  $oauthors .= amp;rft.au=$au;
  }
  }
 +$title = $record-subfield( '245', 'a' ) // '';

Why is this in this patch?

@@ +2122,4 @@
  push @marcsubjects, {
  MARCSUBJECT_SUBFIELDS_LOOP = \@subfields_loop,
  authoritylink = $authoritylink,
 +} if $authoritylink || @subfields_loop;

Why is this in this patch?

::: C4/XSLT.pm
@@ +93,5 @@
 +@new_subfields
 +) );
 +}
 +else {
 +$record-delete_fields($field);

What is this doing here, and why is it in this patch?

::: opac/opac-detail.pl
@@ +683,4 @@
  my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
  my $marcurlsarray= GetMarcUrls($record,$marcflavour);
  my $marchostsarray  = GetMarcHosts($record,$marcflavour);
 +my ($st_tag,$st_subtag) = 
 GetMarcFromKohaField('bibliosubtitle.subtitle',$dat-{'frameworkcode'});

I think that this section is a mistake.

What is bibliosubtitle.subtitle? Also, why would this be in this patch?

::: opac/opac-showmarc.pl
@@ +55,4 @@
  
  if ($view eq 'card' || $view eq 'html') {
  my $xmlrecord= $importid? $record-as_xml(): GetXmlBiblio($biblionumber);
 +if (!$importid  $view eq 'html') {

I haven't looked at the context, but why not filter for all cases here?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-06-06 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #42 from M. Tompsett mtomp...@hotmail.com ---
(In reply to David Cook from comment #41)
 ::: C4/Biblio.pm
  +my $rv = $sth-execute($frameworkcode);
 
 Why is there a my $rv here? It shouldn't be needed.

It was debugging code that I forgot to strip. :)


  +if (!$show || $show==0) {
 
 $show should always be 1 or undefined, so I wouldn't think $show==0
 would be necessary.

Actually, 1, 0, or undefined. Someone could put = 0 into the hash checked.
I'll confirm if I can simplify the logic.


 @@ +1334,5 @@
  +my $show = $display-{$interface}-{ 
  $data-{$fullfield}-{$tag}-{'hidden'} };
  +if (!$show || $show==0) {
  +$shouldhidemarc{ $field } = 1;
  +}
  +elsif ( !exists($shouldhidemarc{ $field }) ) {
 
 It shouldn't be necessary to add fields that aren't hidden to this hash.
 Plus, since the value is 0, you'll most likely get the same end result you
 would if you didn't have this block of code.

I don't like having undefined values. Those tend to generate annoying floody
errors when some comparison works but was expecting a number, for example.


 @@ +1493,5 @@
  +# LDR field is excluded from $record-fields().
  +# if we hide it here, the MARCXML-MARC::Record-MARCXML
  +# transformation blows up.
  +#}
  +foreach my $fields ($record-fields()) {
 
 Should probably use $field rather than $fields, as this incorrect
 pluralization gets confusing lower down.

Okay, that makes sense.


 @@ +1495,5 @@
  +# transformation blows up.
  +#}
  +foreach my $fields ($record-fields()) {
  +my $tag = $fields-tag();
  +my $hidden;
 
 This $hidden variable isn't really necessary. If it should be hidden, you
 should just hide/delete it upon detection. The code looks like it would work
 either way, but it would be easier to read with less needless code.

If you look at the hidden value setting that would be inside an if/else. I
scoped it wider, so there was no need to have two lines of code. Fine, two
lines of code it is.


  +my $visibility = 
  $marcsubfieldstructure-{$tag}-{$subtag}-{hidden};
  +$visibility //= 0;
 
 Is there are a reason to have this extra line instead of my $visibility =
 $marcsubfieldstructure-{$tag}-{$subtag}-{hidden} // 0?

Yes, because otherwise visibility is undef. It should be a valid number (-7 to
+7) reflecting valid values set in the Advanced Constraints screen.


 @@ +1670,4 @@
   $oauthors .= amp;rft.au=$au;
   }
   }
  +$title = $record-subfield( '245', 'a' ) // '';
 
 Why is this in this patch?

This fixes a floody error I had during testing. I suppose it could be another
patch. I'll confirm.


 @@ +2122,4 @@
   push @marcsubjects, {
   MARCSUBJECT_SUBFIELDS_LOOP = \@subfields_loop,
   authoritylink = $authoritylink,
  +} if $authoritylink || @subfields_loop;
 
 Why is this in this patch?

This properly hides the subjects.


 ::: C4/XSLT.pm
 @@ +93,5 @@
  +@new_subfields
  +) );
  +}
  +else {
  +$record-delete_fields($field);
 
 What is this doing here, and why is it in this patch?

If you try to delete the last subfield of a field, you need to delete the
field. If I recall, deleting the last subfield fails. Fields/subfields are
deleted (from memory) to hide them from being displayed.


 ::: opac/opac-detail.pl
 @@ +683,4 @@
   my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
   my $marcurlsarray= GetMarcUrls($record,$marcflavour);
   my $marchostsarray  = GetMarcHosts($record,$marcflavour);
  +my ($st_tag,$st_subtag) = 
  GetMarcFromKohaField('bibliosubtitle.subtitle',$dat-{'frameworkcode'});
 
 I think that this section is a mistake.

GetRecordValue, which is what was there initially, does not grab values from
marc_subfield_structure, but rather fieldmapping. This means the subtitle is
not properly hidden.


 What is bibliosubtitle.subtitle? Also, why would this be in this patch?

The value in the marc_subfield_structure table. Subtitles are a mess in Koha.


 ::: opac/opac-showmarc.pl
 @@ +55,4 @@
   
   if ($view eq 'card' || $view eq 'html') {
   my $xmlrecord= $importid? $record-as_xml(): 
  GetXmlBiblio($biblionumber);
  +if (!$importid  $view eq 'html') {
 
 I haven't looked at the context, but why not filter for all cases here?

I think this is related to the save as exports. This is what worked for me.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs 

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-06-06 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #43 from M. Tompsett mtomp...@hotmail.com ---
(In reply to David Cook from comment #41)
 @@ +1334,5 @@
  +my $show = $display-{$interface}-{ 
  $data-{$fullfield}-{$tag}-{'hidden'} };
  +if (!$show || $show==0) {
  +$shouldhidemarc{ $field } = 1;
  +}
  +elsif ( !exists($shouldhidemarc{ $field }) ) {
 
 It shouldn't be necessary to add fields that aren't hidden to this hash.
 Plus, since the value is 0, you'll most likely get the same end result you
 would if you didn't have this block of code.
 

SELECT tagfield,tagsubfield,kohafield FROM marc_subfield_structure WHERE
frameworkcode='' AND tagfield IN ('541','952') ORDER BY kohafield;

items.stocknumber is a pain. This is why this code exists. If the first one is
hidden (I didn't sort the keys, so it is random) or visible, the other value
doesn't affect it.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-06-03 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Fridolin SOMERS fridolyn.som...@biblibre.com changed:

   What|Removed |Added

 CC||fridolyn.som...@biblibre.co
   ||m

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #28003|0   |1
is obsolete||

--- Comment #36 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 28477
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28477action=edit
Bug 11592 - MARC Visibility settings not respected

The advanced constraints section while editing subfield
structure for a particular MARC bibliographic framework allow
the user to set visibility settings for OPAC and Intranet.

These settings are not fully respected. This was first
discovered while comparing the information displayed on
the opac-MARCdetail and opac-detail pages. To this end,
this patch will provide the ability to correct this problem
across the board as desired, but will focus primarily on the
OPAC interface.

This was accomplished by adding 3 functions to C4/Biblio.pm:
- ShouldDisplayOnInterface
- ShouldHideMARC
- GetFilteredBiblio
And also by modifying GetMarcBiblio to filter or not based on
parameter style and parameter values passed.

ShouldDisplayOnInterface is a wrapper routine which just
returns a hash of hashes which let us know if something is
visible (1) or not (0 or undef) for a given interface (opac
or intranet). This allows us to add/remove to the advance
constraints section and then not have to update multiple
routines to keep the filtering working properly, though if it
is a drastic refactoring that would be necessary.

ShouldHideMARC takes a field from marc_subfield_structure,
and determines if it should be hidden. It does this for
all the fields for a given framework code on a particular
interface. If no framework code is given, the framework
code used is the default one. If not interface is specified,
OPAC is assumed. This routine returns a hash reference to the
corresponding hash that was built.

GetFilteredBiblio takes a MARC::Record, clones it, and then
strips all the fields that should not be visible for a given
framework code and interface. If no framework code is specied,
it assumes the default one. If no interface is given, OPAC is
assumed. The routine then returns the filtered record.

GetMarcBiblio was modified to accept a hash style
parameter. This allowed for filtering if the new convention
was used, and no apparent change if the old convention is used.

These functions allowed for filtering, but frequently there were
problems with titles, subjects, etc. This required other tweaks.
In C4/Biblio.pm, GetMarcSubjects was returning the subject,
even it was supposed to be hidden. C4/XSLT.pm tried to replace
a field with no field, rather than properly delete it.

With the filtering being implemented based on the parameter
style, it just required a minor tweak in opac-ISDBdetail to
filter. The title needed to be purposefully not set if it was
supposed to be hidden in opac-MARCdetail. However, opac-detail
was interesting challenge.

First, changing the parameter style did filtering, but the
output still was leaking things which should be hidden. This
is the main reason ShouldHideMARC was written, because there
is an insidious little loop that runs through a set of keys
and sets template parameters to values.

Second, By skipping to the next key based on the hash ref
returned by ShouldHideMARC, the template parameter is not set,
and thus the value is properly hidden.

Third, the subtitle was grabbed by GetRecordValue. This was
refactored so filtering worked properly.

Next, opac-export and opac-showmarc were tweaked to use the new
parameter calling convention to filter properly.

And of course, with modifications and additions to C4/Biblio.pm,
tests were required.

t/Biblio.t has been modified to check the new function
ShouldDisplayOnInterface.

t/db_dependent/Biblio.t has also been modified. It confirms
that both old and new calling conventions work. It also tests
hiding the title field (200$a UNIMARC, 245$a MARC). It includes
tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio.

TEST PLAN
-

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #28477|0   |1
is obsolete||

--- Comment #37 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 28478
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28478action=edit
Bug 11592 - MARC Visibility settings not respected

The advanced constraints section while editing subfield
structure for a particular MARC bibliographic framework allow
the user to set visibility settings for OPAC and Intranet.

These settings are not fully respected. This was first
discovered while comparing the information displayed on
the opac-MARCdetail and opac-detail pages. To this end,
this patch will provide the ability to correct this problem
across the board as desired, but will focus primarily on the
OPAC interface.

This was accomplished by adding 3 functions to C4/Biblio.pm:
- ShouldDisplayOnInterface
- ShouldHideMARC
- GetFilteredBiblio
And also by modifying GetMarcBiblio to filter or not based on
parameter style and parameter values passed.

ShouldDisplayOnInterface is a wrapper routine which just
returns a hash of hashes which let us know if something is
visible (1) or not (0 or undef) for a given interface (opac
or intranet). This allows us to add/remove to the advance
constraints section and then not have to update multiple
routines to keep the filtering working properly, though if it
is a drastic refactoring that would be necessary.

ShouldHideMARC takes a field from marc_subfield_structure,
and determines if it should be hidden. It does this for
all the fields for a given framework code on a particular
interface. If no framework code is given, the framework
code used is the default one. If not interface is specified,
OPAC is assumed. This routine returns a hash reference to the
corresponding hash that was built.

GetFilteredBiblio takes a MARC::Record, clones it, and then
strips all the fields that should not be visible for a given
framework code and interface. If no framework code is specied,
it assumes the default one. If no interface is given, OPAC is
assumed. The routine then returns the filtered record.

GetMarcBiblio was modified to accept a hash style
parameter. This allowed for filtering if the new convention
was used, and no apparent change if the old convention is used.

These functions allowed for filtering, but frequently there were
problems with titles, subjects, etc. This required other tweaks.
In C4/Biblio.pm, GetMarcSubjects was returning the subject,
even it was supposed to be hidden. C4/XSLT.pm tried to replace
a field with no field, rather than properly delete it.

With the filtering being implemented based on the parameter
style, it just required a minor tweak in opac-ISDBdetail to
filter. The title needed to be purposefully not set if it was
supposed to be hidden in opac-MARCdetail. However, opac-detail
was interesting challenge.

First, changing the parameter style did filtering, but the
output still was leaking things which should be hidden. This
is the main reason ShouldHideMARC was written, because there
is an insidious little loop that runs through a set of keys
and sets template parameters to values.

Second, By skipping to the next key based on the hash ref
returned by ShouldHideMARC, the template parameter is not set,
and thus the value is properly hidden.

Third, the subtitle was grabbed by GetRecordValue. This was
refactored so filtering worked properly.

Next, opac-export and opac-showmarc were tweaked to use the new
parameter calling convention to filter properly.

And of course, with modifications and additions to C4/Biblio.pm,
tests were required.

t/Biblio.t has been modified to check the new function
ShouldDisplayOnInterface.

t/db_dependent/Biblio.t has also been modified. It confirms
that both old and new calling conventions work. It also tests
hiding the title field (200$a UNIMARC, 245$a MARC). It includes
tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio.

TEST PLAN
-
 1) Back up your DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #28478|0   |1
is obsolete||

--- Comment #39 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 28480
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28480action=edit
Bug 11592 - MARC Visibility settings not respected

The advanced constraints section while editing subfield
structure for a particular MARC bibliographic framework allow
the user to set visibility settings for OPAC and Intranet.

These settings are not fully respected. This was first
discovered while comparing the information displayed on
the opac-MARCdetail and opac-detail pages. To this end,
this patch will provide the ability to correct this problem
across the board as desired, but will focus primarily on the
OPAC interface.

This was accomplished by adding 3 functions to C4/Biblio.pm:
- ShouldDisplayOnInterface
- ShouldHideMARC
- GetFilteredBiblio
And also by modifying GetMarcBiblio to filter or not based on
parameter style and parameter values passed.

ShouldDisplayOnInterface is a wrapper routine which just
returns a hash of hashes which let us know if something is
visible (1) or not (0 or undef) for a given interface (opac
or intranet). This allows us to add/remove to the advance
constraints section and then not have to update multiple
routines to keep the filtering working properly, though if it
is a drastic refactoring that would be necessary.

ShouldHideMARC takes a field from marc_subfield_structure,
and determines if it should be hidden. It does this for
all the fields for a given framework code on a particular
interface. If no framework code is given, the framework
code used is the default one. If not interface is specified,
OPAC is assumed. This routine returns a hash reference to the
corresponding hash that was built.

GetFilteredBiblio takes a MARC::Record, clones it, and then
strips all the fields that should not be visible for a given
framework code and interface. If no framework code is specied,
it assumes the default one. If no interface is given, OPAC is
assumed. The routine then returns the filtered record.

GetMarcBiblio was modified to accept a hash style
parameter. This allowed for filtering if the new convention
was used, and no apparent change if the old convention is used.

These functions allowed for filtering, but frequently there were
problems with titles, subjects, etc. This required other tweaks.
In C4/Biblio.pm, GetMarcSubjects was returning the subject,
even it was supposed to be hidden. C4/XSLT.pm tried to replace
a field with no field, rather than properly delete it.

With the filtering being implemented based on the parameter
style, it just required a minor tweak in opac-ISDBdetail to
filter. The title needed to be purposefully not set if it was
supposed to be hidden in opac-MARCdetail.

However, opac-detail was interesting challenge. First, changing
the parameter style did filtering, but the output still was
leaking things which should be hidden. This is the main reason
ShouldHideMARC was written, because there is an insidious
little loop that runs through a set of keys and sets template
parameters to values.

Second, By skipping to the next key based on the hash ref
returned by ShouldHideMARC, the template parameter is not set,
and thus the value is properly hidden.

Third, the subtitle was grabbed by GetRecordValue. This was
refactored so filtering worked properly.

Then opac-MARCdetail's 'view plain' was still showing details.
This required converting the XML record to a MARC::Record,
filtering it, and then converting it back.

By tweaking opac-export and opac-showmarc to use the new
parameter calling convention, records were filtered properly.

And of course, with modifications and additions to C4/Biblio.pm,
tests were required.

t/Biblio.t has been modified to check the new function
ShouldDisplayOnInterface.

t/db_dependent/Biblio.t has also been modified. It confirms
that both old and new calling conventions work. It also tests
hiding the title field (200$a UNIMARC, 245$a MARC). It includes
tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio.

TEST PLAN
-
 1) Back up your DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC 

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #28002|0   |1
is obsolete||

--- Comment #38 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 28479
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28479action=edit
Bug 11592 - Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

Signed-off-by: Robin Sheat ro...@catalyst.net.nz
Signed-off-by: Kyle M Hall k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|Needs Signoff

--- Comment #40 from M. Tompsett mtomp...@hotmail.com ---
I think this is it.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-15 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

 Status|Needs Signoff   |ASSIGNED

--- Comment #35 from M. Tompsett mtomp...@hotmail.com ---
Moving back to assigned, while I think and work on this a little more.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-14 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #34 from M. Tompsett mtomp...@hotmail.com ---
And this is where converting the parameters of GetMarcBiblio to a hash
reference would be useful, because optional parameters are a pain otherwise.
*sigh*

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-13 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #33 from M. Tompsett mtomp...@hotmail.com ---
(In reply to David Cook from comment #26)
 A few additional thoughts...
 
 1)
 A follow-up should probably be added for a few other OPAC scripts like
 opac-basket.pl, opac-sendbasket.pl, opac-sendshelf.pl, etc., since these
 will all show the unfiltered MARC record.

Ah, right. GetMarcBiblio.


 2)
 It would be nice to see a future version of this that filters for both the
 OPAC and the staff client. 
 
 Passing a context in and checking the 'hidden' values against a hashref of
 hashrefs might be a quick way of doing that...

I am reconsidering these suggestions, since tweaking a lot of file is as much
of a pain as testing the far reaching effects of modifying GetMarcBiblio.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-06 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24953|0   |1
is obsolete||

--- Comment #31 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 28003
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28003action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

Signed-off-by: Robin Sheat ro...@catalyst.net.nz
Signed-off-by: Kyle M Hall k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-05 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Galen Charlton gmcha...@gmail.com changed:

   What|Removed |Added

   Keywords|rel_3_16_candidate  |
 Status|Passed QA   |Patch doesn't apply
 CC||gmcha...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-05-05 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #29 from M. Tompsett mtomp...@hotmail.com ---
I think I have something working, but I need to get my unimarc VM updated and
do a test on it first.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-04-29 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Galen Charlton gmcha...@gmail.com changed:

   What|Removed |Added

   Keywords||rel_3_16_candidate

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-04-21 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #27 from M. Tompsett mtomp...@hotmail.com ---
ARG! This no longer applies. And because the t/db_dependent/Biblio.t file has
gotten more complicated that a straight list of tests, I'm not sure how to
rebase.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-04-21 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #28 from M. Tompsett mtomp...@hotmail.com ---
Rebase need caused by bug 11912.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-03-27 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #26 from David Cook dc...@prosentient.com.au ---
A few additional thoughts...

1)
A follow-up should probably be added for a few other OPAC scripts like
opac-basket.pl, opac-sendbasket.pl, opac-sendshelf.pl, etc., since these will
all show the unfiltered MARC record.


2)
It would be nice to see a future version of this that filters for both the OPAC
and the staff client. 

Passing a context in and checking the 'hidden' values against a hashref of
hashrefs might be a quick way of doing that:

my $display = {
opac = {
0 = 1,
-1 = 1,
-2 = 1,
-3 = 1,
-4 = 1,
-5 = 1,
-6 = 1,
-7 = 1, 
},
intranet = {
-6 = 1,
-5 = 1,
-1 = 1,
0 = 1,
1 = 1,
4 = 1,
6 = 1,
7 = 1,  
},
};

3) I've added a few notes in Splinter Review for ways I think that the filter
sub could be improved. Since this has already passed QA, I'll just leave them
as notes.

If it's too late to make changes, I'll probably send a patch with some of them
after it's pushed in any case.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-03-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #25 from David Cook dc...@prosentient.com.au ---
Looking forward to this one going in. It would be a great help...

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-03-26 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

David Cook dc...@prosentient.com.au changed:

   What|Removed |Added

 CC||dc...@prosentient.com.au

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-31 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Kyle M Hall k...@bywatersolutions.com changed:

   What|Removed |Added

  Attachment #24875|0   |1
is obsolete||

--- Comment #23 from Kyle M Hall k...@bywatersolutions.com ---
Created attachment 24952
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24952action=edit
Bug 11592 - Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

Signed-off-by: Robin Sheat ro...@catalyst.net.nz
Signed-off-by: Kyle M Hall k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-31 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Kyle M Hall k...@bywatersolutions.com changed:

   What|Removed |Added

  Attachment #24876|0   |1
is obsolete||

--- Comment #24 from Kyle M Hall k...@bywatersolutions.com ---
Created attachment 24953
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24953action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

Signed-off-by: Robin Sheat ro...@catalyst.net.nz
Signed-off-by: Kyle M Hall k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : 

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-31 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Kyle M Hall k...@bywatersolutions.com changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA
 CC||k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-29 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Robin Sheat ro...@catalyst.net.nz changed:

   What|Removed |Added

 Status|Needs Signoff   |Signed Off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-29 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Robin Sheat ro...@catalyst.net.nz changed:

   What|Removed |Added

  Attachment #24663|0   |1
is obsolete||
  Attachment #24664|0   |1
is obsolete||

--- Comment #20 from Robin Sheat ro...@catalyst.net.nz ---
Created attachment 24875
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24875action=edit
Bug 11592 - Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

Signed-off-by: Robin Sheat ro...@catalyst.net.nz

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-29 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #21 from Robin Sheat ro...@catalyst.net.nz ---
Created attachment 24876
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24876action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

Signed-off-by: Robin Sheat ro...@catalyst.net.nz

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-29 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #22 from Robin Sheat ro...@catalyst.net.nz ---
(sorry, attached them the wrong way around due to expecting git bz to work like
most git commands.)

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24629|0   |1
is obsolete||

--- Comment #6 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24654
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24654action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

   Patch complexity|Small patch |Medium patch

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

 Status|NEW |Needs Signoff

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24654|0   |1
is obsolete||

--- Comment #7 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24655
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24655action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #8 from Robin Sheat ro...@catalyst.net.nz ---
Comment on attachment 24655
  -- http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24655
Bug 11592 - opac scripts do not respect marc tag visibility

Review of attachment 24655:
 -- 
(http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.htmlbug=11592attachment=24655)
-

Will this also hide appropriate fields in opac-ISBDdetail that should be
hidden?

::: C4/Biblio.pm
@@ +1222,5 @@
 +
 +C$OpacHideMARC is a ref to a hash which contains a series
 +of key value pairs indicating if that field (key) is
 +hidden (value == 1) or not (value == 0).
 +

How can this be used to get information about something that doesn't have a
kohafield attached? e.g. I want to hide marc field 505 from the OPAC, but it
doesn't have a corresponding Koha field. Would this still work?

@@ +1230,5 @@
 +
 +sub GetOpacHideMARC {
 +my ( $frameworkcode ) = shift || '';
 +my $dbh = C4::Context-dbh;
 +my $sth = $dbh-prepare(SELECT kohafield AS field,tagfield AS 
 tag,hidden FROM marc_subfield_structure WHERE LENGTH(kohafield)0 AND 
 frameworkcode=? ORDER BY field,tagfield;);

I would suspect that doing WHERE kohafield  '' might be a tiny bit faster
than asking it to do a length calculation. Probably negligible though. I'd
probably also fix the spacing as right now it looks like it groups wrongly in
the columns that it's selecting, even though it doesn't.

@@ +1238,5 @@
 +foreach my $fullfield (keys %{$data}) {
 +my @tmpsplit = split(/\./,$fullfield);
 +my $field = $tmpsplit[-1];
 +foreach my $tag (keys %{$data-{$fullfield}}) {
 +if ($data-{$fullfield}-{$tag}-{'hidden'}0) {

!=0 is likely to be marginally faster (unless negatives are a thing you care
about.)

@@ +1270,5 @@
 +my $filtered_record = $record-clone;
 +
 +my ( $frameworkcode ) = shift || '';
 +
 +my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode);

Maybe allow the marcsubfieldstructure to be passed in instead of the framework
code. This becomes important if this happens over and over, as it'll do a big
bunch of database work each time, this makes things very slow when it could be
cached outside and passed in.

It should be easy enough to see if you have a scalar or a ref, and so whether
you have a code or the structure.

@@ +1274,5 @@
 +my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode);
 +if ($marcsubfieldstructure-{'000'}-{'@'}-{hidden}0) {
 +# LDR field is excluded from $record-fields().
 +# if we hide it here, the MARCXML-MARC::Record-MARCXML 
 transformation blows up.
 +}

This if doesn't actually do anything.

@@ +1977,4 @@
  push @marcsubjects, {
  MARCSUBJECT_SUBFIELDS_LOOP = \@subfields_loop,
  authoritylink = $authoritylink,
 +} if $authoritylink || $#subfields_loop=0;

$#subfields_loop=0 is a bit of an ugly construction. Best to use just
@subfields_loop, it does the same thing and is easier to read.

::: opac/opac-detail.pl
@@ +489,4 @@
  }
  
  my $dat = GetBiblioData($biblionumber);
 +my $OpacHideMARC  = GetOpacHideMARC($dat-{'frameworkcode'});

 is a perl4-ism, not required.

@@ +654,5 @@
 +my ($st_tag,$st_subtag) = 
 GetMarcFromKohaField('bibliosubtitle.subtitle',$dat-{'frameworkcode'});
 +my $subtitle;
 +if ($st_tag  $st_subtag) {
 +my @subtitles = $record-subfield($st_tag,$st_subtag);
 +$subtitle = \@subtitles if scalar @subtitles;

you don't need to say 'scalar' here.

@@ +656,5 @@
 +if ($st_tag  $st_subtag) {
 +my @subtitles = $record-subfield($st_tag,$st_subtag);
 +$subtitle = \@subtitles if scalar @subtitles;
 +}
 +if ($subtitle  scalar @$subtitle) {

nor here

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

 Status|Needs Signoff   |ASSIGNED

--- Comment #9 from M. Tompsett mtomp...@hotmail.com ---
 Will this also hide appropriate fields in opac-ISBDdetail that should be
 hidden?

I didn't even look at opac-ISBDdetail -- we don't use it. I suppose I should.
Though, it has that syspref related to the output for it. I'll add a filter
call.


  +C$OpacHideMARC is a ref to a hash which contains a series
  +of key value pairs indicating if that field (key) is
  +hidden (value == 1) or not (value == 0).
  +
 
 How can this be used to get information about something that doesn't have a
 kohafield attached? e.g. I want to hide marc field 505 from the OPAC, but it
 doesn't have a corresponding Koha field. Would this still work?

OpacHideMARC is intended as a hack for the loop in opac-detail that creates
template parameters based on koha field names. It was around like 699 in the
master, 713 in the patch. This is how [% title %] and other parameters are
created. This covers the half of the problem that doesn't use the MARC record
directly.

If you are trying to hide something that doesn't have a kohafield, you are
looking at the other function: GetFilteredOpacBiblio. This takes the MARC
record and strips out things marked to be hidden.


  +my $sth = $dbh-prepare(SELECT kohafield AS field,tagfield AS 
  tag,hidden FROM marc_subfield_structure WHERE LENGTH(kohafield)0 AND 
  frameworkcode=? ORDER BY field,tagfield;);
 
 I would suspect that doing WHERE kohafield  '' might be a tiny bit faster
 than asking it to do a length calculation.

I didn't do testing, but LENGTH(NULL) = 0, right? Which way handles the NULL
case better? -- Just checked '' is used elsewhere and returns the same number
on my data.


 Probably negligible though. I'd
 probably also fix the spacing as right now it looks like it groups wrongly
 in the columns that it's selecting, even though it doesn't.

I don't understand what you are trying to say. OH! field,tagfield lacks
spacing. Will fix that to improve readability.


  +if ($data-{$fullfield}-{$tag}-{'hidden'}0) {
 
 !=0 is likely to be marginally faster (unless negatives are a thing you care
 about.)

valid values for hidden range from -15 to +... anyways... =0 OPAC visibility
is checked. 0 OPAC visibility is unchecked. So, yes, care about negatives.


 
 @@ +1270,5 @@
  +my $filtered_record = $record-clone;
  +
  +my ( $frameworkcode ) = shift || '';
  +
  +my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode);
 
 Maybe allow the marcsubfieldstructure to be passed in instead of the
 framework code. This becomes important if this happens over and over, as
 it'll do a big bunch of database work each time, this makes things very slow
 when it could be cached outside and passed in.
 
 It should be easy enough to see if you have a scalar or a ref, and so
 whether you have a code or the structure.

Hmm... GetMarcStructure is cached. Look in C4/Biblio.pm for sub
GetMarcStructure. You will see the $marc_structure_cache line just above that,
and it being used at the top of the function.


 @@ +1274,5 @@
  +my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode);
  +if ($marcsubfieldstructure-{'000'}-{'@'}-{hidden}0) {
  +# LDR field is excluded from $record-fields().
  +# if we hide it here, the MARCXML-MARC::Record-MARCXML 
  transformation blows up.
  +}
 
 This if doesn't actually do anything.

It explains why I didn't hide the LDR record. As this function is called only
once, I don't think it is a big deal, but I will comment it out so people don't
get the idea to fix the remaining LDR field problem this way.


 
 @@ +1977,4 @@
   push @marcsubjects, {
   MARCSUBJECT_SUBFIELDS_LOOP = \@subfields_loop,
   authoritylink = $authoritylink,
  +} if $authoritylink || $#subfields_loop=0;
 
 $#subfields_loop=0 is a bit of an ugly construction. Best to use just
 @subfields_loop, it does the same thing and is easier to read.

Okay, I suppose I can try that.


   my $dat = GetBiblioData($biblionumber);
  +my $OpacHideMARC  = GetOpacHideMARC($dat-{'frameworkcode'});
 
  is a perl4-ism, not required.

Okay, I was confused a little by it used in some places and not in others. I'll
remove my .


  +$subtitle = \@subtitles if scalar @subtitles;
 
 you don't need to say 'scalar' here.

  +if ($subtitle  scalar @$subtitle) {
 
 nor here

I'll test and remove, once confirmed.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : 

[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #10 from Robin Sheat ro...@catalyst.net.nz ---
(In reply to M. Tompsett from comment #9)
 Hmm... GetMarcStructure is cached. Look in C4/Biblio.pm for sub
 GetMarcStructure. You will see the $marc_structure_cache line just above
 that, and it being used at the top of the function.

Ah, interesting. It's also cached in memcache which actually slows things down.
This explains why.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24655|0   |1
is obsolete||

--- Comment #11 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24657
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24657action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24657|0   |1
is obsolete||

--- Comment #12 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24658
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24658action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|Needs Signoff

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24658|0   |1
is obsolete||

--- Comment #13 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24659
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24659action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #14 from M. Tompsett mtomp...@hotmail.com ---
opac-search.pl is out of scope for now.
opac-ISDBdetail.pl could be cleaned up more, but the focus of this was more
consistency between opac-MARCdetail and opac-detail pages.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #16 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24661
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24661action=edit
Bug 11592 - Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24659|0   |1
is obsolete||

--- Comment #15 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24660
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24660action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24661|0   |1
is obsolete||

--- Comment #17 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24662
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24662action=edit
Bug 11592 - Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24660|0   |1
is obsolete||

--- Comment #18 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24663
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24663action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
-
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
 that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
 set to blank.
 5) Home - Koha administration - MARC bibliographic framework
 - MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
 - Subfields - click the first link
 Then running through all the tabs, click Advanced constraints
  and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
-- what you hid should be mostly hidden
   TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
 mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
 hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
-- LDR and 999$c and 999$d were displaying for me.
   I realized that I hadn't hidden 999, because the
   opac-MARCdetail page doesn't display it.
   LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
 the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
 a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
 including the view plain link, and everything should
 hidden similarly.
-- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
  could be hidden in the table using the MARC visibility.
  The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
 using the dropdown and clicking Go.
-- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
are not useful across an entire framework.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-23 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24662|0   |1
is obsolete||

--- Comment #19 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24664
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24664action=edit
Bug 11592 - Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-22 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24601|0   |1
is obsolete||

--- Comment #4 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24611
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24611action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

Lastly, opac-showmarc now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-22 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24611|0   |1
is obsolete||

--- Comment #5 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24629
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24629action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

Lastly, opac-showmarc now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-22 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

Robin Sheat ro...@catalyst.net.nz changed:

   What|Removed |Added

 CC||ro...@catalyst.net.nz

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-21 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

Summary|opac-detail.pl and  |opac scripts do not respect
   |opac-MARCdetail.pl do not   |MARC tag visibility
   |respect marc tag visibility |

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-21 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett mtomp...@hotmail.com changed:

   What|Removed |Added

  Attachment #24600|0   |1
is obsolete||

--- Comment #2 from M. Tompsett mtomp...@hotmail.com ---
Created attachment 24601
  --
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24601action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

Lastly, opac-showmarc now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

2014-01-21 Thread bugzilla-daemon
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

--- Comment #3 from M. Tompsett mtomp...@hotmail.com ---
Still to do: Add tests for new functions to C4/Biblio. :)

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/