View | Details | Raw Unified | Return to bug 13437
Collapse All | Expand All

(-)a/cataloguing/value_builder/marc21_field_008.pl (-6 / +9 lines)
Lines 34-45 plugin_parameters : other parameters added when the plugin is called by the dopo Link Here
34
34
35
=cut
35
=cut
36
36
37
# find today's date
37
sub date_entered {
38
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
38
    # find today's date
39
39
    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
40
$year += 1900;
40
    $year += 1900;
41
$mon  += 1;
41
    $mon  += 1;
42
my $dateentered = substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday);
42
    return substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday);
43
}
43
44
44
sub plugin_javascript {
45
sub plugin_javascript {
45
    my $lang = C4::Context->preference('DefaultLanguageField008' );
46
    my $lang = C4::Context->preference('DefaultLanguageField008' );
Lines 48-53 sub plugin_javascript { Link Here
48
49
49
    my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
50
    my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
50
    my $function_name = $field_number;
51
    my $function_name = $field_number;
52
    my $dateentered = date_entered();
51
    my $res           = "
53
    my $res           = "
52
<script type=\"text/javascript\">
54
<script type=\"text/javascript\">
53
//<![CDATA[
55
//<![CDATA[
Lines 149-154 sub plugin { Link Here
149
        }
151
        }
150
    );
152
    );
151
153
154
    my $dateentered = date_entered();
152
    $result = "$dateentered" . "b        xxu||||| |||| 00| 0 $lang d" unless $result;
155
    $result = "$dateentered" . "b        xxu||||| |||| 00| 0 $lang d" unless $result;
153
    my $errorXml = '';
156
    my $errorXml = '';
154
    # Check if the xml, xsd exists and is validated
157
    # Check if the xml, xsd exists and is validated
(-)a/cataloguing/value_builder/marc21_field_008_authorities.pl (-8 / +12 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 36-51 plugin_parameters : other parameters added when the plugin is called by the dopo Link Here
36
35
37
=cut
36
=cut
38
37
39
# find today's date
38
sub date_entered {
40
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
39
    # find today's date
41
40
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
42
$year +=1900; $mon +=1;
41
    $year +=1900;
43
my $dateentered = substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday);
42
    $mon +=1;
44
my $defaultval = Field008();
43
    return substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday);
44
}
45
45
46
sub plugin_javascript {
46
sub plugin_javascript {
47
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
47
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
48
    my $function_name= $field_number;
48
    my $function_name= $field_number;
49
    my $dateentered = date_entered();
50
    my $defaultval = Field008();
49
    my $res="
51
    my $res="
50
<script type=\"text/javascript\">
52
<script type=\"text/javascript\">
51
//<![CDATA[
53
//<![CDATA[
Lines 79-84 sub plugin { Link Here
79
    my $index= $input->param('index');
81
    my $index= $input->param('index');
80
    my $result= $input->param('result');
82
    my $result= $input->param('result');
81
    my $authtype= $input->param('authtypecode')||'';
83
    my $authtype= $input->param('authtypecode')||'';
84
85
    my $defaultval = Field008();
82
    substr($defaultval,14-6,1)='b' if $authtype=~ /TOPIC_TERM|GENRE.FORM|CHRON_TERM/;
86
    substr($defaultval,14-6,1)='b' if $authtype=~ /TOPIC_TERM|GENRE.FORM|CHRON_TERM/;
83
87
84
    my $dbh = C4::Context->dbh;
88
    my $dbh = C4::Context->dbh;
Lines 91-96 sub plugin { Link Here
91
                 flagsrequired => {editcatalogue => '*'},
95
                 flagsrequired => {editcatalogue => '*'},
92
                 debug => 1,
96
                 debug => 1,
93
                 });
97
                 });
98
    my $dateentered = date_entered();
94
    $result = "$dateentered$defaultval" unless $result;
99
    $result = "$dateentered$defaultval" unless $result;
95
    my @f;
100
    my @f;
96
    for(0,6..17,28,29,31..33,38,39) {
101
    for(0,6..17,28,29,31..33,38,39) {
97
- 

Return to bug 13437