From 3e764c663f663efb0de76cab0ed7e7925aaf71fb Mon Sep 17 00:00:00 2001 From: toins Date: Mon, 19 Mar 2007 18:35:12 +0000 Subject: [PATCH] - adding default value in marc_subfield_structure. - now marc_subfields_structure displays subfields in tab view. --- admin/marc_subfields_structure.pl | 23 ++-- .../en/admin/marc_subfields_structure.tmpl | 118 ++++++++++++++---- updater/updatedatabase | 13 ++ 3 files changed, 119 insertions(+), 35 deletions(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 137a609e35..a9045bf5a8 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -175,6 +175,7 @@ if ( $op eq 'add_form' ) { else { $toggle = 1; } + $row_data{defaultvalue} = $data->{defaultvalue}; $row_data{tab} = CGI::scrolling_list( -name => 'tab', -id => "tab$i", @@ -204,6 +205,7 @@ if ( $op eq 'add_form' ) { . "{'tagsubfield'} . "\" id=\"tagsubfield\">"; + $row_data{subfieldcode} = $data->{'tagsubfield'}; $row_data{liblibrarian} = CGI::escapeHTML( $data->{'liblibrarian'} ); $row_data{libopac} = CGI::escapeHTML( $data->{'libopac'} ); $row_data{seealso} = CGI::escapeHTML( $data->{'seealso'} ); @@ -270,7 +272,7 @@ if ( $op eq 'add_form' ) { ); $row_data{row} = $i; $row_data{toggle} = $toggle; - $row_data{link} = CGI::escapeHTML( $data->{'link'} ); + $row_data{link} = CGI::escapeHTML( $data->{'link'} ); push( @loop_data, \%row_data ); $i++; } @@ -392,8 +394,8 @@ elsif ( $op eq 'add_validate' ) { my $dbh = C4::Context->dbh; $template->param( tagfield => "$input->param('tagfield')" ); my $sth = $dbh->prepare( -"replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link) - values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" +"replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue) + values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" ); my @tagsubfield = $input->param('tagsubfield'); my @liblibrarian = $input->param('liblibrarian'); @@ -406,7 +408,8 @@ elsif ( $op eq 'add_validate' ) { my @authtypecodes = $input->param('authtypecode'); my @value_builder = $input->param('value_builder'); my @link = $input->param('link'); - + my @defaultvalue = $input->param('defaultvalue'); + for ( my $i = 0 ; $i <= $#tagsubfield ; $i++ ) { my $tagfield = $input->param('tagfield'); my $tagsubfield = $tagsubfield[$i]; @@ -424,7 +427,8 @@ elsif ( $op eq 'add_validate' ) { my $hidden = $hidden[$i]; #input->param("hidden$i"); my $isurl = $input->param("isurl$i") ? 1 : 0; my $link = $link[$i]; - + my $defaultvalue = $defaultvalue[$i]; + if ($liblibrarian) { unless ( C4::Context->config('demo') eq 1 ) { $sth->execute( @@ -443,8 +447,8 @@ elsif ( $op eq 'add_validate' ) { $hidden, $isurl, $frameworkcode, - $link, + $defaultvalue, ); } } @@ -561,10 +565,5 @@ else { # DEFAULT next => "" ); } } #---- END $OP eq DEFAULT -$template->param( - intranetcolorstylesheet => - C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), -); + output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl index 87117977ca..dca65b7097 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl @@ -18,30 +18,60 @@
" name="Aform" method="post"> " /> - -
"> -
- Tag , Subfield -

MARC constraints

-

 

-

 

-

" name="seealso" value="" size="20" /> (example for 200a: '200c','200d','200e'...)

-

-

Editor constaints

-

" type="text" name="liblibrarian" value="" size="40" maxlength="80" />

-

" name="libopac" value="" size="40" maxlength="80" />

-

(ignore means that the subfield is NOT managed by Koha)

-

" name="hidden" value="" size="2" /> (see online help)

-

(if checked, it means that the subfield is an URL and can be clicked

-

" size="10" maxlength="5" /> (exemple:200b)

-

(choose one)

-

-

-

-

-
- + +

Tag

+ Edit subfields : +
+ +
+ + +
" class="content_hidden"> + +

Basic constaints

+

" type="text" name="liblibrarian" value="" size="40" maxlength="80" />

+

" name="libopac" value="" size="40" maxlength="80" />

+

 

+

 

+

(ignore means that the subfield is NOT managed by Koha)

+ + ')">display more constraints + + " class="content_hidden"> +

Advanced constraint

+

+ + " /> +

+

" name="hidden" value="" size="2" /> (see online help)

+

(if checked, it means that the subfield is an URL and can be clicked

+

" size="10" maxlength="5" /> (exemple:200b)

+

(choose one)

+

+

+

+

+

+
+
+ + +
@@ -134,5 +164,47 @@ + diff --git a/updater/updatedatabase b/updater/updatedatabase index b196860750..4273f7c11e 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -949,6 +949,15 @@ my %fielddefinitions = ( extra => '', }, ], + marc_subfield_structure => [ + { + field => 'defaultvalue', + type => 'TEXT', + null => 'NULL', + key => '', + extra => '', + } + ], opac_news => [ { field => 'expirationdate', @@ -1968,6 +1977,10 @@ $sth->finish; exit; # $Log$ +# Revision 1.160 2007/03/19 18:35:13 toins +# - adding default value in marc_subfield_structure. +# - now marc_subfields_structure displays subfields in tab view. +# # Revision 1.159 2007/03/16 01:25:09 kados # Using my precrash CVS copy I did the following: # -- 2.20.1