3 # $Id: usmarc_field_952v.pl,v 1.1.2.2 2006/09/20 02:59:53 kados Exp $
5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
24 plugin_parameters : useless here
27 sub plugin_parameters {
28 # my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
34 plugin_javascript : the javascript function called when the user enters the subfield.
35 contain 3 javascript functions :
36 * one called when the field is entered (OnFocus) named FocusXXX
37 * one called when the field is left (onBlur ) named BlurXXX
38 * one called when the ... link is clicked (onClick) named ClicXXX
42 * a variable containing the 3 scripts.
43 the 3 scripts are inserted after the <input> in the html code
46 sub plugin_javascript {
47 # my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
48 my $function_name = "dateaccessioned".(int(rand(100000))+1);
51 my $date = C4::Dates->today('iso');
53 # find the tag/subfield mapped to items.dateaccessioned
54 my ($tag,$subfield) = GetMarcFromKohaField("items.dateaccessioned","");
55 my $res = <<END_OF_JS;
56 <script type="text/javascript">
59 // from: cataloguing/value_builder/dateaccessioned.pl
61 function Blur$function_name(index) {
62 //date validation could go here
65 function Focus$function_name(subfield_managed, id, force) {
67 //for (i=0 ; i<document.f.field_value.length ; i++) {
68 // summary += i + ": " + document.f.tag[i].value + " " + document.f.subfield[i].value + ": " + document.f.field_value[i].value + "\\n";
70 //alert("Got focus, subfieldmanaged: " + subfield_managed + "\\n" + summary);
71 set_to_today(id); // defined in additem.pl HEAD
75 function Clic$function_name(id) {
76 set_to_today(id, 1); // defined in additem.pl HEAD
82 return ($function_name, $res);