[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Koha.pm [dev_week]
From: |
Joshua Ferraro |
Subject: |
[Koha-cvs] koha/C4 Koha.pm [dev_week] |
Date: |
Tue, 19 Sep 2006 04:45:16 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Joshua Ferraro <kados> 06/09/19 04:45:16
Modified files:
C4 : Koha.pm
Log message:
Adding new display* routines for showing advanced search elements, etc.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.2&r2=1.22.2.4.2.3
Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.2
retrieving revision 1.22.2.4.2.3
diff -u -b -r1.22.2.4.2.2 -r1.22.2.4.2.3
--- Koha.pm 7 Sep 2006 22:01:42 -0000 1.22.2.4.2.2
+++ Koha.pm 19 Sep 2006 04:45:13 -0000 1.22.2.4.2.3
@@ -63,6 +63,14 @@
&getauthtypes &getauthtype
&getallthemes &getalllanguages
&getallbranches
+ &getFacets
+ &displaySortby
+ &displayIndexes
+ &displayLanguagesLimit
+ &displaySubtypesLimit
+ &displayLimitTypes
+ &displayPrimaryServers
+ &displaySecondaryServers
&displayLanguages
$DEBUG);
@@ -654,13 +662,340 @@
return @themes;
}
+sub getFacets {
+ my $facets = [ {
+ link_value => 'su-to',
+ label_value => 'Topics',
+ tags => ['650'],
+ subfield => 'a',
+ },
+ {
+ link_value => 'su-na',
+ label_value => 'People and Organizations',
+ tags => ['600', '610', '611'],
+ subfield => 'a',
+ },
+ {
+ link_value => 'su-geo',
+ label_value => 'Places',
+ tags => ['651'],
+ subfield => 'a',
+ },
+ {
+ link_value => 'su-ut',
+ label_value => 'Titles',
+ tags => ['630'],
+ subfield => 'a',
+ },
+ {
+ link_value => 'au',
+ label_value => 'Authors',
+ tags => ['100','110','700',],
+ subfield => 'a',
+ },
+ {
+ link_value => 'se',
+ label_value => 'Series',
+ tags => ['440','490',],
+ subfield => 'a',
+ },
+ {
+ link_value => 'branch',
+ label_value => 'Branches',
+ tags => ['952',],
+ subfield => 'b',
+ expanded => '1',
+ },
+ ];
+ return $facets;
+}
+
+sub displaySortby {
+ my ($sort_by) = @_;
+ my $sort_by_loop = [
+ {value =>"1=9523 >i", label => "Popularity (Most to Least)"},
+ {value =>"1=9523 <i", label => "Popularity (Least to Most)"},
+ {value =>"1=1003 <i", label => "Author (A-Z)"},
+ {value =>"1=1003 >i", label => "Author (Z-A)"},
+ {value =>"1=20 <i", label => "Call Number (Non-fiction 0-9 to Fiction
A-Z)"},
+ {value =>"1=20 >i", label => "Call Number (Fiction Z-A to Non-fiction
9-0)"},
+ {value =>"1=31 >i", label => "Dates"},
+ {value =>"1=31 <i", label => " Publication/Copyright
Date: Newest to Oldest"},
+ {value =>"1=31 >i", label => " Publication/Copyright
Date: Oldest to Newest"},
+ {value =>"1=32 >i", label => " Acquisition Date: Newest
to Oldest"},
+ {value =>"1=32 >i", label => " Acquisition Date: Oldest
to Newest"},
+ {value =>"1=36 <i", label => "Title (A-Z)"},
+ {value =>"1=36 >i", label => "Title (Z-A)"},
+ ];
+ for my $hash (@$sort_by_loop) {
+ #warn "sort by: $sort_by ... hash:".$hash->{value};
+ if ($hash->{value} eq $sort_by) {
+ $hash->{selected} = "selected";
+ }
+ }
+ return $sort_by_loop;
+
+}
+sub displayIndexes {
+ my $indexes = [
+ { value => '', label => 'Keyword' },
+ { value => 'au', label => 'Author' },
+ { value => 'au,phr', label => ' Author Phrase' },
+# { value => 'cpn', label => ' Corporate Name' },
+# { value => 'cfn', label => ' Conference Name' },
+# { value => 'cpn,phr', label => ' Corporate Name
Phrase' },
+# { value => 'cfn,phr', label => ' Conference Name
Phrase' },
+# { value => 'pn', label => ' Personal Name' },
+# { value => 'pn,phr', label => ' Personal Name
Phrase' },
+# { value => 'ln', label => 'Language' },
+# { value => 'mt', label => 'Material Type' },
+# { value => 'mt,phr', label => 'Material Type Phrase' },
+# { value => 'mc', label => 'Musical Composition' },
+# { value => 'mc,phr', label => 'Musical Composition Phrase' },
+
+ { value => 'nt', label => 'Notes/Comments' },
+ { value => 'pb', label => 'Publisher' },
+ { value => 'pl', label => 'Publisher Location' },
+ { value => 'sn', label => 'Standard Number' },
+ { value => 'nb', label => ' ISBN' },
+ { value => 'ns', label => ' ISSN' },
+ { value => 'lcn', label => ' Call Number' },
+ { value => 'su', label => 'Subject' },
+ { value => 'su,phr', label => ' Subject Phrase' },
+# { value => 'de', label => ' Descriptor' },
+# { value => 'ge', label => ' Genre/Form' },
+# { value => 'gc', label => ' Geographic Coverage'
},
+
+# { value => 'nc', label => ' Named Corporation and
Conference' },
+# { value => 'na', label => ' Named Person' },
+
+ { value => 'ti', label => 'Title' },
+ { value => 'ti,phr', label => ' Title Phrase' },
+ { value => 'se', label => ' Series Title' },
+
+ ];
+ return $indexes;
+}
+sub displaySubtypesLimit {
+ my $outer_subtype_limits_loop = [
+
+ { # in MARC21, aud codes are stored in 008/22 (Target audience)
+ name => "limit",
+ inner_subtype_limits_loop => [
+ { value => '', label => 'Any Audience', selected =>
"selected" },
+ { value => 'aud:a', label => 'Easy', },
+ { value => 'aud:c', label => 'Juvenile', },
+ { value => 'aud:d', label => 'Young Adult', },
+ { value => 'aud:e', label => 'Adult', },
+
+ ],
+ },
+ { # in MARC21, fic is in 008/33, bio in 008/34, mus in LDR/06
+ name => "limit",
+ inner_subtype_limits_loop => [
+ { value => '', label => 'Any Content', selected =>
"selected" },
+ { value => 'fic:1', label => 'Fiction', },
+ { value => 'fic:0', label => 'Non Fiction', },
+ { value => 'bio:b', label => 'Biography', },
+ { value => 'mus:j', label => 'Musical recording', },
+ { value => 'mus:i', label => 'Non-musical recording', },
+
+ ],
+ },
+ { # MARC21, these are codes stored in 007/00-01
+ name => "limit",
+ inner_subtype_limits_loop => [
+ { value => '', label => 'Any Format', selected =>
"selected" },
+ { value => 'l-format:ta', label => 'Regular print', },
+ { value => 'l-format:tb', label => 'Large print', },
+ { value => 'l-format:fk', label => 'Braille', },
+ { value => '', label => '-----------', },
+ { value => 'l-format:sd', label => 'CD audio', },
+ { value => 'l-format:ss', label => 'Cassette recording',
},
+ { value => 'l-format:vf', label => 'VHS tape /
Videocassette', },
+ { value => 'l-format:vd', label => 'DVD video /
Videodisc', },
+ { value => 'l-format:co', label => 'CD Software', },
+ { value => 'l-format:cr', label => 'Website', },
+
+ ],
+ },
+ { # in MARC21, these are codes in 008/24-28
+ name => "limit",
+ inner_subtype_limits_loop => [
+ { value => '', label => 'Additional Content Types', },
+ { value => 'ctype:a', label => 'Abstracts/summaries', },
+ { value => 'ctype:b', label => 'Bibliographies', },
+ { value => 'ctype:c', label => 'Catalogs', },
+ { value => 'ctype:d', label => 'Dictionaries', },
+ { value => 'ctype:e', label => 'Encyclopedias ',},
+ { value => 'ctype:f', label => 'Handbooks', },
+ { value => 'ctype:g', label => 'Legal articles',},
+ { value => 'ctype:i', label => 'Indexes', },
+ { value => 'ctype:j', label => 'Patent document', },
+ { value => 'ctype:k', label => 'Discographies', },
+ { value => 'ctype:l', label => 'Legislation', },
+ { value => 'ctype:m', label => 'Theses',},
+ { value => 'ctype:n', label => 'Surveys', },
+ { value => 'ctype:o', label => 'Reviews',},
+ { value => 'ctype:p', label => 'Programmed texts', },
+ { value => 'ctype:q', label => 'Filmographies', },
+ { value => 'ctype:r', label => 'Directories', },
+ { value => 'ctype:s', label => 'Statistics', },
+ { value => 'ctype:t', label => 'Technical reports', },
+ { value => 'ctype:v', label => 'Legal cases and case notes',
},
+ { value => 'ctype:w', label => 'Law reports and digests', },
+ { value => 'ctype:z', label => 'Treaties ', },
+ ],
+ },
+ ];
+ return $outer_subtype_limits_loop;
+}
+
+sub displayLanguagesLimit {
+ my $languages_loop = [
+ {value => "", language_label => "No Limit", locale_label => "",selected =>
"selected",},
+ {value => "ln:ara", language_label =>
"العربية", locale_label =>
"Arabic",,},
+ {value => "ln:bul", language_label =>
"Български", locale_label
=> "Bulgarian",,},
+ {value => "ln:chi", language_label => "中文", locale_label =>
"Chinese",,},
+ {value => "ln:scr", language_label => "Hrvatski", locale_label =>
"Croatian",,},
+ {value => "ln:cze", language_label => "čeština", locale_label
=> "Czech",,},
+ {value => "ln:dan", language_label => "Dænsk", locale_label =>
"Danish",,},
+ {value => "ln:dut", language_label => "nedərlɑns", locale_label
=> "Dutch",,},
+ {value => "ln:eng", language_label => "English", locale_label => "",,},
+ {value => "ln:fre", language_label => "Français", locale_label =>
"French",,},
+ {value => "ln:ger", language_label => "Deutsch", locale_label =>
"German",,},
+ {value => "ln:gre", language_label =>
"ελληνικά", locale_label => "Greek,
Modern [1453- ]",,},
+ {value => "ln:heb", language_label =>
"עברית", locale_label => "Hebrew",,},
+ {value => "ln:hin", language_label =>
"हिन्दी", locale_label => "Hindi",,},
+ {value => "ln:hun", language_label => "Magyar", locale_label =>
"Hungarian",,},
+ {value => "ln:ind", language_label => "", locale_label => "Indonesian",,},
+ {value => "ln:ita", language_label => "Italiano", locale_label =>
"Italian",,},
+ {value => "ln:jpn", language_label => "日本語",
locale_label => "Japanese",,},
+ {value => "ln:kor", language_label => "한국어",
locale_label => "Korean",,},
+ {value => "ln:lat", language_label => "Latina", locale_label => "Latin",,},
+ {value => "ln:nor", language_label => "Norsk", locale_label =>
"Norwegian",,},
+ {value => "ln:per", language_label =>
"فارسى", locale_label => "Persian",,},
+ {value => "ln:pol", language_label => "Polski", locale_label =>
"Polish",,},
+ {value => "ln:por", language_label => "Português", locale_label =>
"Portuguese",,},
+ {value => "ln:rum", language_label => "Română", locale_label =>
"Romanian",,},
+ {value => "ln:rus", language_label =>
"Русский", locale_label =>
"Russian",,},
+ {value => "ln:spa", language_label => "Español", locale_label =>
"Spanish",,},
+ {value => "ln:swe", language_label => "Svenska", locale_label =>
"Swedish",,},
+ {value => "ln:tha", language_label =>
"ภาษาไทย", locale_label => "Thai",,},
+ {value => "ln:tur", language_label => "Türkçe", locale_label
=> "Turkish",,},
+ {value => "ln:ukr", language_label =>
"Українська",
locale_label => "Ukrainian",,},
+
+];
+ return $languages_loop;
+}
+
+sub displayLimitTypes {
+my $outer_limit_types_loop = [
+
+{ inner_limit_types_loop => [
+ {label => "Books",
+ id => "mc-bks",
+ name => "limit",
+ value => "mc:t",
+ icon => "AF.gif",
+ title => "Books, Pamphlets, Technical reports, Manuscripts, Legal papers,
Theses and dissertations",},
+
+ {label => "Visual Materials",
+ id => "mc-vis",
+ name => "limit",
+ value => "mc:v",
+ icon => "AV Aids.gif",
+ title => "Motion pictures, Videorecordings, Filmstrips, Slides,
Transparencies, Photos, Cards, Charts, Drawings",},
+
+ {label => "Books on Tape",
+ id => "mc-sr",
+ name => "limit",
+ value => "mc-rtype:i",
+ icon => "AF.gif",
+ title => "Spoken, Books on CD and Cassette",},
+ ],
+},
+{ inner_limit_types_loop => [
+ {label => "Computer Files",
+ id => "mc-cf",
+ name => "limit",
+ value => "mc:c",
+ icon => "CD-ROM software.gif",
+ title => "Computer files, Data, Software",},
+
+ {label => "Local History Materials",
+ id => "mc-lh",
+ name => "limit",
+ value => "mc-collection:LH",
+ icon => "Local history.gif",
+ title => "Local History Materials",},
+
+ {label => "Maps",
+ id => "mc-map",
+ name => "limit",
+ value => "mc:a",
+ icon => "PF.gif ",
+ title => "Maps, Globes",},
+ ],
+},
+{ inner_limit_types_loop => [
+ {label => "Music",
+ id => "mc-mus",
+ name => "limit",
+ value => "mc-rtype:j",
+ icon => "CDM.gif",
+ title => "Music",},
+
+ {label => "Kits",
+ id => "mc-kit",
+ name => "limit",
+ value => "mc-rtype:o",
+ icon => "KIT.gif",
+ title => "Kits",},
+
+ {label => "Reference",
+ id => "mc-ref",
+ name => "limit",
+ value => "mc-collection:REF",
+ icon => "REF.gif",
+ title => "Reference",},
+
+ ],
+},
+
+];
+return $outer_limit_types_loop;
+}
+sub displayPrimaryServers {
+ my $primary_servers_loop = [
+ { inner_servers_loop => [
+ {label => C4::Context->preference('LibraryName')." Catalog",
id=>"NPL", name=>"server",
value=>"localhost:9900/biblios",checked=>"checked",icon => "npl.png",zed =>
"1"},
+ {label => "OPLIN Databases", id=>"OPLIN", name=>"server",
value=>"",checked=>"",icon => "oplin.ico",zed => "1"},
+ ],
+ },
+ ];
+ return $primary_servers_loop;
+}
+
+sub displaySecondaryServers {
+ my $secondary_servers_loop = [
+ { inner_sup_servers_loop => [
+ {label => "Google", id=>"GOOG", value=>"google",icon =>
"google.ico",opensearch => "1"},
+ {label => "Yahoo", id=>"YAH", value=>"yahoo", icon
=>"yahoo.ico", zed => "1"},
+ {label => "Worldcat", id=>"WCT", value=>"worldcat", icon =>
"worldcat.gif", zed => "1"},
+ {label => "Library of Congress", id=>"LOC", name=> "server",
value=>"z3950.loc.gov:7090/Voyager", icon =>"loc.ico", zed => "1"},
+ ],
+ },
+ ];
+ return $secondary_servers_loop;
+}
sub displayLanguages {
my ($cgi) = @_;
my @languages_options;
- my $languages_hash = {de => 'Deutsch', en => 'English', es =>
'Español', fr => 'Français', pl => 'Polski', "zh-TW" =>
'中文', it => 'Italiano',};
+ my $languages_hash = {en => 'English', es => 'Español',}; #de =>
'Deutsch', en => 'English', es => 'Español', fr => 'Français', pl
=> 'Polski', "zh-TW" => '中文', it => 'Italiano',};
my $counter=0;
- foreach my $language (getalllanguages()) {
+ foreach my $language (getalllanguages("opac")) {
next if $language eq 'images';
next if $language eq 'itemtypeimg';
next if $language eq 'CVS';
@@ -672,7 +1007,7 @@
my ($current_theme,$current_language) =
themelanguage("opachtdocs", "default", "opac", $cgi);
my $current=1 if $current_language eq $language;
# next if
$currently_selected_languages->{$language};
- push @languages_options, { label => $label, language => $language,
counter => $counter, current => $current};
+ push @languages_options, { label => $label, language => $language,
counter => $counter, current => $current} if $label;
$counter++;
}
return @languages_options;