From cdc681c880db3c046f51b8d6c60162ac7ac9ee8e Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 19 Oct 2016 04:19:58 +0000 Subject: [PATCH] Bug 14957: Key fixes to patch - Fixing merge conflicts - adding String::Similariry to list of dependencies - font-awesome icons and adding consistency to formatting - removing original use of onclick - moving help text out of main page and into a new help file When testing, follow above test plan but: 1) Remember to install String::Similarity before testing (apt-get install libstring-similarity-perl) 2) Instead of doing step 7, click Help in top-right corner instead. Confirm this works and shows as expected Sponsored-by: Catalyst IT --- C4/Installer/PerlDependencies.pm | 5 + help.pl | 5 + .../intranet-tmpl/prog/en/includes/admin-menu.inc | 1 + .../prog/en/modules/admin/marc-permissions.tt | 227 +++------------------ .../prog/en/modules/help/admin/marc-permissions.tt | 148 ++++++++++++++ 5 files changed, 187 insertions(+), 199 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc-permissions.tt diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index de00fd7..0c9aa62 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -847,6 +847,11 @@ our $PERL_DEPS = { required => 1, min_ver => '0.058', }, + 'String::Similarity' => { + usage => 'cataloguing', + required => 1, + min_version => '1.04', + }, }; 1; diff --git a/help.pl b/help.pl index ad86a2d..86855d0 100755 --- a/help.pl +++ b/help.pl @@ -24,6 +24,7 @@ use C4::Output; # use C4::Auth; use C4::Context; use CGI qw ( -utf8 ); +use C4::Biblio; sub _help_template_file_of_url { my $url = shift; @@ -75,4 +76,8 @@ if ( $help_version =~ m|^(\d+)\.(\d{2}).*$| ) { } $template->param( helpVersion => $help_version ); +my $rules = GetMarcPermissionsRules(); +my $modules = GetMarcPermissionsModules(); +$template->param( rules => $rules, modules => $modules ); + output_html_with_http_headers $query, "", $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc index e736272..5c4d637 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc @@ -47,6 +47,7 @@
  • Record matching rules
  • OAI sets configuration
  • Item search fields
  • +
  • MARC field permissions
  • Acquisition parameters
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-permissions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-permissions.tt index 964d517..b15bdf7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-permissions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-permissions.tt @@ -13,7 +13,6 @@ @@ -135,192 +143,13 @@ $(document).ready(function(){
    -

    Manage MARC field permissions

    +

    Manage MARC field permissions

    + [% UNLESS Koha.Preference( 'MARCPermissions' ) %] -
    -The MARCPermissions preference is not set, don't forget to enable it for rules to take effect. -
    +
    + The MARCPermissions preference is not set, don't forget to enable it for rules to take effect. +
    [% END %] - [% IF removeConfirm %]
    @@ -330,7 +159,7 @@ The MARCPermissions preference is not set, don't forget to enable it for
    - +
    [% END %] @@ -345,7 +174,7 @@ The MARCPermissions preference is not set, don't forget to enable it for On Existing On New On Removed -   + Actions   [% UNLESS edit %] @@ -383,8 +212,8 @@ The MARCPermissions preference is not set, don't forget to enable it for [% END %] - - + + [% END %] @@ -440,9 +269,9 @@ The MARCPermissions preference is not set, don't forget to enable it for [% END %] - - - + + + [% ELSE %] @@ -454,9 +283,9 @@ The MARCPermissions preference is not set, don't forget to enable it for [% rule.on_existing %] [% rule.on_new %] [% rule.on_removed %] - - - + + Delete + Edit [% IF rule.remove %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc-permissions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc-permissions.tt new file mode 100644 index 0000000..9f657e6 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc-permissions.tt @@ -0,0 +1,148 @@ +[% INCLUDE 'help-top.inc' %] + +

    Manage MARC field permissions

    + +

    Rule evaluation

    +

    Rules are evaluated from least specific to most specific. This means that a more specific rule will override a less specific rule. * is less specific than a regular expression. A regular expression is less specific than a normal field name (e.g. 245). A Subfield tag is more specific than a Tag.

    +

    To add a field-specific rule (i.e. not a subfield), leave the Subfield tag field blank.

    + +

    Defaults

    +

    Default action when no rules exist is to replace the old record with the new record. Same as if MARCPermissions is disabled.

    +

    Default action when no matching rule is found is to leave a field unchanged (skip). If you wish to changed the default actions for fields and subfields, please add wildcard rules.

    + +

    Wildcards

    +

    * can be used as a wildcard for Tag, Subfield tag and Filter. * is considered less specific than a non wildcard value, and thus will be overridden by a non wildcard value (e.g. "100", "a", etc).

    + +

    Regular expressions

    +

    Regular expressions can be used in both the Tag and Subfield tag fields. Beware though, using regular expressions may create overlapping matches, in which case they will be applied in a sorted order.

    + +

    Example rules

    +

    Following is an example rule set in order of specificity.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TagSubfield tagModuleFilterDescription
    *[% modules.0.name %]*Match any field regardless of [% modules.0.name %]
    **[% modules.0.name %]*Match any subfield regardless of [% modules.0.name %]
    245*[% modules.0.name %]z39.50Match any subfield under 245 when [% modules.0.name %] is z39.50
    *b[% modules.0.name %]z39.50Match subfield b regardless of field when [% modules.0.name %] is z39.50
    500[a-d][% modules.0.name %]z39.50Match subfields a, b, c, d when field is 500 and [% modules.0.name %] is z39.50
    5..a[% modules.0.name %]z39.50Match subfield a when field matches the regular expression 5.. (500-599) and [% modules.0.name %] is z39.50
    245a[% modules.0.name %]z39.50Match subfield a when field is 500 and [% modules.0.name %] is z39.50
    + +
    + +

    Available filter modules

    +

    Filters cannot be regular expressions. Please use a single * as a wildcard if need.

    + + + + + + + + + [% FOREACH module IN modules %] + + + + + + [% END %] + +
    SpecificityModuleDescription
    [% module.specificity %][% module.name %][% module.description %]
    + +
    + +

    Available sources

    +

    The following sources currently implement MARCPermissions.

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    bulkmarcimportbin/migration_tools/bulkmarcimport.pl
    import_lexilebin/migration_tools/import_lexile.pl
    z39.50Import from Z39.50 search in browser
    intranetModifications from intranet in browser
    batchmodBatch record modification in browser
    + +
    + +

    Indicators

    +

    Indicators can be addressed as i1 and i2 in the Subfield tag field. Some actions might not be available for indicators, in which case they will be disabled.

    + +
    + +

    Logging

    +

    If MARCPermissionsLog is enabled, log entries for each record modification will be available in the Modification log in the Catalog module under the Modify action. This can be very helpful when debugging rule sets.

    +

    The administration area is where you set all of your preferences for the system. Preference are broken down into several categories, detailed below.

    + +

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

    + +[% INCLUDE 'help-bottom.inc' %] -- 2.1.4