Bugzilla – Attachment 39095 Details for
Bug 13437
Convert marc21 framework plugins to new style
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13437: Preliminary changes for marc21 plugins field 008
Bug-13437-Preliminary-changes-for-marc21-plugins-f.patch (text/plain), 3.93 KB, created by
Marcel de Rooy
on 2015-05-12 15:57:23 UTC
(
hide
)
Description:
Bug 13437: Preliminary changes for marc21 plugins field 008
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-05-12 15:57:23 UTC
Size:
3.93 KB
patch
obsolete
>From 451c89cc7dbb34dd42c2713ebbb9a96f02dacecb Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 12 May 2015 17:49:04 +0200 >Subject: [PATCH] Bug 13437: Preliminary changes for marc21 plugins field 008 >Content-Type: text/plain; charset=utf-8 > >Preliminary work on marc21_field_008.pl and 008_authorities.pl. >Moving $dateentered en $defaultval to lower scope level. > >Test plan: >Use both plugins in the marc21 editor (biblios/authorities). >--- > cataloguing/value_builder/marc21_field_008.pl | 15 +++++++++------ > .../value_builder/marc21_field_008_authorities.pl | 19 ++++++++++++------- > 2 files changed, 21 insertions(+), 13 deletions(-) > >diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl >index cc2d28d..e3de19c 100755 >--- a/cataloguing/value_builder/marc21_field_008.pl >+++ b/cataloguing/value_builder/marc21_field_008.pl >@@ -34,12 +34,13 @@ plugin_parameters : other parameters added when the plugin is called by the dopo > > =cut > >-# find today's date >-my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); >- >-$year += 1900; >-$mon += 1; >-my $dateentered = substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday); >+sub date_entered { >+ # find today's date >+ my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); >+ $year += 1900; >+ $mon += 1; >+ return substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday); >+} > > sub plugin_javascript { > my $lang = C4::Context->preference('DefaultLanguageField008' ); >@@ -48,6 +49,7 @@ sub plugin_javascript { > > my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; > my $function_name = $field_number; >+ my $dateentered = date_entered(); > my $res = " > <script type=\"text/javascript\"> > //<![CDATA[ >@@ -149,6 +151,7 @@ sub plugin { > } > ); > >+ my $dateentered = date_entered(); > $result = "$dateentered" . "b xxu||||| |||| 00| 0 $lang d" unless $result; > my $errorXml = ''; > # Check if the xml, xsd exists and is validated >diff --git a/cataloguing/value_builder/marc21_field_008_authorities.pl b/cataloguing/value_builder/marc21_field_008_authorities.pl >index be15ced..319972d 100755 >--- a/cataloguing/value_builder/marc21_field_008_authorities.pl >+++ b/cataloguing/value_builder/marc21_field_008_authorities.pl >@@ -1,6 +1,5 @@ > #!/usr/bin/perl > >- > # Copyright 2000-2002 Katipo Communications > # > # This file is part of Koha. >@@ -36,16 +35,19 @@ plugin_parameters : other parameters added when the plugin is called by the dopo > > =cut > >-# find today's date >-my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); >- >-$year +=1900; $mon +=1; >-my $dateentered = substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday); >-my $defaultval = Field008(); >+sub date_entered { >+ # find today's date >+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); >+ $year +=1900; >+ $mon +=1; >+ return substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday); >+} > > sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; > my $function_name= $field_number; >+ my $dateentered = date_entered(); >+ my $defaultval = Field008(); > my $res=" > <script type=\"text/javascript\"> > //<![CDATA[ >@@ -79,6 +81,8 @@ sub plugin { > my $index= $input->param('index'); > my $result= $input->param('result'); > my $authtype= $input->param('authtypecode')||''; >+ >+ my $defaultval = Field008(); > substr($defaultval,14-6,1)='b' if $authtype=~ /TOPIC_TERM|GENRE.FORM|CHRON_TERM/; > > my $dbh = C4::Context->dbh; >@@ -91,6 +95,7 @@ sub plugin { > flagsrequired => {editcatalogue => '*'}, > debug => 1, > }); >+ my $dateentered = date_entered(); > $result = "$dateentered$defaultval" unless $result; > my @f; > for(0,6..17,28,29,31..33,38,39) { >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13437
:
39093
|
39095
|
39140
|
39141
|
39142
|
39177
|
39184
|
39193
|
39194
|
39195
|
39196
|
39371
|
39372
|
39373
|
39374
|
39375
|
39949
|
39950
|
39951
|
39952
|
39953