@@ -, +, @@ doesn't pass firefox's html validator - fixing some attributes - removing some attributes - and using a handy-dandy validation plug-in that Owen pointed me at the other day. --------- 1) Install HTML Validator Plugin (Html Validator 0.9.5.8 Firefox addon) 2) Log in to staff client 3) Koha administration 4) Authority types (on the right, 5 down from Catalog header) 5) Click 'MARC structure' of any auth type 6) Click 'subfields' (I believe for any Tag >= 010) 7) Click 'Edit subfields' 8) Right click and select 'View Page Source' -- Lots of HTML validation errors 9) View the 'Authorized value:' and 'Thesaurus:' drop down lists. -- Patch cleans up code, so lists should remain unchanged after applying patch -- It should be down to 10 errors / 11 warnings. NOTE: I think this means there is a code problem with actually editing authorities properly! --- admin/auth_subfields_structure.pl | 32 ++++------- .../en/modules/admin/auth_subfields_structure.tt | 62 ++++++++++++++-------- 2 files changed, 51 insertions(+), 43 deletions(-) --- a/admin/auth_subfields_structure.pl +++ a/admin/auth_subfields_structure.pl @@ -23,6 +23,7 @@ use C4::Output; use C4::Auth; use CGI; use C4::Context; +use C4::Koha; sub string_search { @@ -91,25 +92,14 @@ if ($op eq 'add_form') { push @kohafields, "auth_header.".$field; } - # build authorised value list - $sth2 = $dbh->prepare("select distinct category from authorised_values"); - $sth2->execute; - my @authorised_values; - push @authorised_values,""; - while ((my $category) = $sth2->fetchrow_array) { - push @authorised_values, $category; - } - push (@authorised_values,"branches"); - push (@authorised_values,"itemtypes"); - - # build thesaurus categories list - $sth2 = $dbh->prepare("select authtypecode from auth_types"); - $sth2->execute; - my @authtypes; - push @authtypes, ""; - while ( ( my $authtypecode ) = $sth2->fetchrow_array ) { - push @authtypes, $authtypecode; - } + # build authorised value list + my $authorised_values = C4::Koha::GetAuthorisedValueCategories; + unshift @$authorised_values, ''; + push @$authorised_values, 'branches'; + push @$authorised_values, 'itemtypes'; + + # build thesaurus categories list + my @authtypes = (sort keys getauthtypes); # build value_builder list my @value_builder=(''); @@ -160,7 +150,7 @@ if ($op eq 'add_form') { }; $row_data{authorised_value} = { id => "authorised_value$i", - values => \@authorised_values, + values => $authorised_values, default => $data->{'authorised_value'}, }; $row_data{frameworkcode} = { @@ -239,7 +229,7 @@ if ($op eq 'add_form') { }; $row_data{authorised_value} = { id => "authorised_value", - values => \@authorised_values, + values => $authorised_values, default => "", }; $row_data{frameworkcode} = { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt @@ -89,15 +89,17 @@ function displayMoreConstraint(numlayer){
  • - [%- IF ( loo.tab.default == -1 ) -%] [%- ELSE -%] [%- END -%] [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%] - [%- IF ( loo.tab.default == t ) -%] + [%- IF ( loo.tab.default == t && t.length>0 ) -%] + [%- ELSIF ( loo.tab.default == t ) -%] + [%- ELSE -%] [%- END -%] @@ -144,49 +146,65 @@ function displayMoreConstraint(numlayer){
  • --