Adding default hardcoded authorised values list + some comment on them
authorPaul POULAIN <paul@koha-fr.org>
Tue, 11 Dec 2007 10:52:19 +0000 (11:52 +0100)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 14 Dec 2007 15:10:08 +0000 (09:10 -0600)
Even on an empty setup, the user will know which auth values he can filled

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
admin/authorised_values.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tmpl

index 4d6eb17..396af1f 100755 (executable)
@@ -171,11 +171,24 @@ sub default_form {
        # build categories list
        my $sth = $dbh->prepare("select distinct category from authorised_values");
        $sth->execute;
+       # the list
        my @category_list;
+       # a hash, to check that some hardcoded categories exist.
+       my %categories;
        while ( my ($category) = $sth->fetchrow_array) {
                push(@category_list,$category);
+               $categories{$category} = 1;
        }
        # push koha system categories
+       push @category_list, 'Asort1' unless $categories{'Asort1'};
+       push @category_list, 'Asort2' unless $categories{'Asort2'};
+       push @category_list, 'Bsort1' unless $categories{'Bsort1'};
+       push @category_list, 'Bsort2' unless $categories{'Bsort2'};
+       push @category_list, 'SUGGEST' unless $categories{'SUGGEST'};
+       push @category_list, 'DAMAGED' unless $categories{'DAMAGED'};
+       push @category_list, 'LOST' unless $categories{'LOST'};
+       #reorder the list
+       @category_list = sort {$a cmp $b} @category_list;
        my $tab_list = CGI::scrolling_list(-name=>'searchfield',
                -id=>'searchfield',
                        -values=> \@category_list,
index 1ffb5f6..df157ad 100644 (file)
@@ -111,6 +111,27 @@ the subfield is not entered through a free field, but though a list of authorize
 </div>
 <!-- /TMPL_IF -->
 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post"><label for="searchfield">Show Category: </label><!-- TMPL_VAR name="tab_list" --> <input type="submit" value="Submit" /></form>
+<!-- TMPL_IF EXPR="category eq 'Bsort1'" -->
+    <p>Bsort1 is an authorised value attached to patrons, that can be used for stats purposes</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'Bsort2'" -->
+    <p>Bsort2 is an authorised value attached to patrons, that can be used for stats purposes</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'Asort1'" -->
+    <p>Asort1 is an authorised value attached to acquisitions, that can be used for stats purposes</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'Asort2'" -->
+    <p>Asort2 is an authorised value attached to acquisitions, that can be used for stats purposes</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'SUGGEST'" -->
+    <p>The list of patron suggestion reject or accept reasons</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'DAMAGED'" -->
+    <p>The list of status to describe a damaged item</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'LOST'" -->
+    <p>The list of status to describe a lost item</p>
+<!-- /TMPL_IF -->
 <table>
 <tr>
        <th>Category</th>