@@ -, +, @@ --- C4/Reports/Guided.pm | 39 ++-- koha-tmpl/intranet-tmpl/prog/en/columns.def | 280 +++++++++++++-------------- misc/translator/tmpl_process3.pl | 2 +- 3 files changed, 163 insertions(+), 158 deletions(-) --- a/C4/Reports/Guided.pm +++ a/C4/Reports/Guided.pm @@ -835,23 +835,28 @@ sub get_sql { } sub _get_column_defs { - my ($cgi) = @_; - my %columns; - my $columns_def_file = "columns.def"; - my $htdocs = C4::Context->config('intrahtdocs'); - my $section='intranet'; - my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage($htdocs, $columns_def_file, $section,$cgi); - - my $full_path_to_columns_def_file="$htdocs/$theme/$lang/$columns_def_file"; - open (COLUMNS,$full_path_to_columns_def_file); - while (my $input = ){ - chomp $input; - my @row =split(/\t/,$input); - $columns{$row[0]}= $row[1]; - } - - close COLUMNS; - return \%columns; + my ($cgi) = @_; + my %columns; + my $columns_def_file = "columns.def"; + my $htdocs = C4::Context->config('intrahtdocs'); + my $section = 'intranet'; + + # We need the theme and the lang + # Since columns.def is not in the modules directory, we cannot sent it for the $tmpl var + my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage($htdocs, 'about.tt', $section, $cgi); + + my $full_path_to_columns_def_file="$htdocs/$theme/$lang/$columns_def_file"; + open (my $fh, $full_path_to_columns_def_file); + while ( my $input = <$fh> ){ + chomp $input; + $input =~ s|(.*)|$1|; + if ( $input =~ m|([^:]*):(.*)| ) { + my ( $field, $translation ) = ( $1, $2 ); + $columns{$field} = $translation; + } + } + close $fh; + return \%columns; } =head2 build_authorised_value_list($authorised_value) --- a/koha-tmpl/intranet-tmpl/prog/en/columns.def +++ a/koha-tmpl/intranet-tmpl/prog/en/columns.def @@ -1,140 +1,140 @@ -borrowers.borrowernumber Borrower number -borrowers.title Salutation -borrowers.surname Surname -borrowers.firstname First name -borrowers.dateofbirth Date of birth -borrowers.initials Initials -borrowers.othernames Other name -borrowers.sex Gender -borrowers.relationship Relationship -borrowers.guarantorid Guarantor borrower number -borrowers.streetnumber Street number -borrowers.streettype Street type -borrowers.address Address -borrowers.address2 Address 2 -borrowers.city City -borrowers.state State -borrowers.zipcode Zip/postal code -borrowers.country Country -borrowers.phone Primary phone -borrowers.phonepro Secondary phone -borrowers.mobile Other phone -borrowers.email Primary email -borrowers.emailpro Secondary email -borrowers.fax Fax -borrowers.B_streetnumber Alternate address: Street number -borrowers.B_streettype Alternate address: Street type -borrowers.B_address Alternate address: Address -borrowers.B_address2 Alternate address: Address 2 -borrowers.B_city Alternate address: City -borrowers.B_state Alternate address: State -borrowers.B_zipcode Alternate address: Zip/postal code -borrowers.B_country Alternate address: Country -borrowers.B_phone Alternate address: Phone -borrowers.B_email Alternate address: Email -borrowers.contactnote Alternate contact: Note -borrowers.altcontactfirstname Alternate contact: Last name -borrowers.altcontactsurname Alternate contact: First name -borrowers.altcontactaddress1 Alternate contact: Address -borrowers.altcontactaddress2 Alternate contact: Address 2 -borrowers.altcontactaddress3 Alternate contact: City -borrowers.contactname Alternate contact: Surname -borrowers.contactfirstname Alternate contact: First name -borrowers.contacttitle Alternate contact: Title -borrowers.altcontactstate Alternate contact: State -borrowers.altcontactzipcode Alternate contact: Zip/postal code -borrowers.altcontactcountry Alternate contact: Country -borrowers.altcontactphone Alternate contact: Phone -borrowers.cardnumber Card number -borrowers.branchcode Home library -borrowers.categorycode Category -borrowers.sort1 Sort 1 -borrowers.sort2 Sort 2 -borrowers.dateenrolled Registration date -borrowers.dateexpiry Expiry date -borrowers.opacnote OPAC note -borrowers.borrowernotes Circulation note -borrowers.userid Username -borrowers.password Password -borrowers.flags System permissions -borrowers.gonenoaddress Gone no address flag -borrowers.lost Lost card flag -borrowers.debarred Restricted [until] flag -borrowers.debarredcomment Comment -borrowers.smsalertnumber Mobile phone number -borrowers.privacy Privacy settings -items.itemnumber Item number (internal) -items.biblionumber Biblio number (internal) -items.biblioitemnumber Biblioitem number (internal) -items.barcode Barcode -items.dateaccessioned Date acquired -items.booksellerid Source of acquisition -items.homebranch Permanent library -items.price Price -items.replacementprice Replacement price -items.replacementpricedate Price effective from -items.datelastborrowed Date last checked out -items.datelastseen Date last seen -items.stack Shelving control number -items.onloan Due date -items.cn_source Source of classification / shelving scheme -items.cn_sort Koha normalized classification for sorting -items.notforloan Not for loan -items.itemlost Lost status -items.withdrawn Withdrawn status -items.itemcallnumber Call number -items.issues Total checkouts -items.renewals Total renewals -items.reserves Total holds -items.restricted Use restrictions -items.itemnotes Public note -items.holdingbranch Current library -items.paidfor -items.timestamp Timestamp -items.location Shelving location -items.ccode Collection code -items.itype Koha itemtype -items.stocknumber Inventory number -items.damaged Damaged status -items.materials Materials specified -items.uri Uniform Resource Identifier -items.more_subfields_xml Additional subfields (XML) -items.enumchron Serial enumeraton/chronology -items.copynumber Copy number -statistics.datetime Statistics date and time -statistics.branch Library -statistics.proccode Type of procedure -statistics.value Value -statistics.type Type -statistics.other -statistics.usercode User code -statistics.itemnumber Item number -statistics.itemtype Itemtype -statistics.borrowernumber Borrower number -biblio.frameworkcode Framework code -biblio.author Author -biblio.datecreated Creation date -biblio.timestamp Modification date -biblioitems.biblioitemnumber Biblioitem number -biblioitems.biblionumber Biblio number -biblioitems.volume Volume number -biblioitems.number Number -biblioitems.classification Classification -biblioitems.itemtype Biblio-level item type -biblioitems.isbn ISBN -biblioitems.issn ISSN -biblioitems.dewey Dewey/classification -biblioitems.subclass Sub classification -biblioitems.publicationyear Publication date -biblioitems.publishercode Publisher -biblioitems.volumedate Volume date -biblioitems.volumedesc Volume information -biblioitems.timestamp Timestamp -biblioitems.illus Illustrator -biblioitems.pages Number of pages -biblioitems.notes Notes -biblioitems.size Size -biblioitems.place Place of publication -biblioitems.lccn LCCN -biblioitems.marcxml MARC blob -biblioitems.url URL +borrowers.borrowernumber: Borrower number +borrowers.title: Salutation +borrowers.surname: Surname +borrowers.firstname: First name +borrowers.dateofbirth: Date of birth +borrowers.initials: Initials +borrowers.othernames: Other name +borrowers.sex: Gender +borrowers.relationship: Relationship +borrowers.guarantorid: Guarantor borrower number +borrowers.streetnumber: Street number +borrowers.streettype: Street type +borrowers.address: Address +borrowers.address2: Address 2 +borrowers.city: City +borrowers.state: State +borrowers.zipcode: Zip/postal code +borrowers.country: Country +borrowers.phone: Primary phone +borrowers.phonepro: Secondary phone +borrowers.mobile: Other phone +borrowers.email: Primary email +borrowers.emailpro: Secondary email +borrowers.fax: Fax +borrowers.B_streetnumber: Alternate address: Street number +borrowers.B_streettype: Alternate address: Street type +borrowers.B_address: Alternate address: Address +borrowers.B_address2: Alternate address: Address 2 +borrowers.B_city: Alternate address: City +borrowers.B_state: Alternate address: State +borrowers.B_zipcode: Alternate address: Zip/postal code +borrowers.B_country: Alternate address: Country +borrowers.B_phone: Alternate address: Phone +borrowers.B_email: Alternate address: Email +borrowers.contactnote: Alternate contact: Note +borrowers.altcontactfirstname: Alternate contact: Last name +borrowers.altcontactsurname: Alternate contact: First name +borrowers.altcontactaddress1: Alternate contact: Address +borrowers.altcontactaddress2: Alternate contact: Address 2 +borrowers.altcontactaddress3: Alternate contact: City +borrowers.contactname: Alternate contact: Surname +borrowers.contactfirstname: Alternate contact: First name +borrowers.contacttitle: Alternate contact: Title +borrowers.altcontactstate: Alternate contact: State +borrowers.altcontactzipcode: Alternate contact: Zip/postal code +borrowers.altcontactcountry: Alternate contact: Country +borrowers.altcontactphone: Alternate contact: Phone +borrowers.cardnumber: Card number +borrowers.branchcode: Home library +borrowers.categorycode: Category +borrowers.sort1: Sort 1 +borrowers.sort2: Sort 2 +borrowers.dateenrolled: Registration date +borrowers.dateexpiry: Expiry date +borrowers.opacnote: OPAC note +borrowers.borrowernotes: Circulation note +borrowers.userid: Username +borrowers.password: Password +borrowers.flags: System permissions +borrowers.gonenoaddress: Gone no address flag +borrowers.lost: Lost card flag +borrowers.debarred: Restricted [until] flag +borrowers.debarredcomment: Comment +borrowers.smsalertnumber: Mobile phone number +borrowers.privacy: Privacy settings +items.itemnumber: Item number (internal) +items.biblionumber: Biblio number (internal) +items.biblioitemnumber: Biblioitem number (internal) +items.barcode: Barcode +items.dateaccessioned: Date acquired +items.booksellerid: Source of acquisition +items.homebranch: Permanent library +items.price: Price +items.replacementprice: Replacement price +items.replacementpricedate: Price effective from +items.datelastborrowed: Date last checked out +items.datelastseen: Date last seen +items.stack: Shelving control number +items.onloan: Due date +items.cn_source: Source of classification / shelving scheme +items.cn_sort: Koha normalized classification for sorting +items.notforloan: Not for loan +items.itemlost: Lost status +items.withdrawn: Withdrawn status +items.itemcallnumber: Call number +items.issues: Total checkouts +items.renewals: Total renewals +items.reserves: Total holds +items.restricted: Use restrictions +items.itemnotes: Public note +items.holdingbranch: Current library +items.paidfor +items.timestamp: Timestamp +items.location: Shelving location +items.ccode: Collection code +items.itype: Koha itemtype +items.stocknumber: Inventory number +items.damaged: Damaged status +items.materials: Materials specified +items.uri: Uniform Resource Identifier +items.more_subfields_xml: Additional subfields (XML) +items.enumchron: Serial enumeraton/chronology +items.copynumber: Copy number +statistics.datetime: Statistics date and time +statistics.branch: Library +statistics.proccode: Type of procedure +statistics.value: Value +statistics.type: Type +statistics.other +statistics.usercode: User code +statistics.itemnumber: Item number +statistics.itemtype: Itemtype +statistics.borrowernumber: Borrower number +biblio.frameworkcode: Framework code +biblio.author: Author +biblio.datecreated: Creation date +biblio.timestamp: Modification date +biblioitems.biblioitemnumber: Biblioitem number +biblioitems.biblionumber: Biblio number +biblioitems.volume: Volume number +biblioitems.number: Number +biblioitems.classification: Classification +biblioitems.itemtype: Biblio-level item type +biblioitems.isbn: ISBN +biblioitems.issn: ISSN +biblioitems.dewey: Dewey/classification +biblioitems.subclass: Sub classification +biblioitems.publicationyear: Publication date +biblioitems.publishercode: Publisher +biblioitems.volumedate: Volume date +biblioitems.volumedesc: Volume information +biblioitems.timestamp: Timestamp +biblioitems.illus: Illustrator +biblioitems.pages: Number of pages +biblioitems.notes: Notes +biblioitems.size: Size +biblioitems.place: Place of publication +biblioitems.lccn: LCCN +biblioitems.marcxml: MARC blob +biblioitems.url: URL --- a/misc/translator/tmpl_process3.pl +++ a/misc/translator/tmpl_process3.pl @@ -242,7 +242,7 @@ usage_error('You must at least specify input and string list filenames.') if !$in_dir || !defined $str_file; # Type match defaults to *.tt plus *.inc if not specified -$type = "tt|inc|xsl|xml" if !defined($type); +$type = "tt|inc|xsl|xml|def" if !defined($type); # Check the inputs for being directories usage_error("$in_dir: Input must be a directory.\n" --