X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=reports%2Fdictionary.pl;h=4f94d6944a8b520b89644f8868905f3b280a8781;hb=0d4acbba5c5db238eb42ed37dc9ba3dc2f36974b;hp=3e101a7b084ed993a40ad1fb821fb99a7c2aae77;hpb=b8d8a0ec5a10ab7dcb2529e8ca4a815822d43cbb;p=koha_fer diff --git a/reports/dictionary.pl b/reports/dictionary.pl index 3e101a7b08..4f94d6944a 100755 --- a/reports/dictionary.pl +++ b/reports/dictionary.pl @@ -13,11 +13,12 @@ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use strict; +use warnings; use C4::Auth; use CGI; use C4::Output; @@ -30,15 +31,13 @@ Script to control the guided report creation =head1 DESCRIPTION - -=over2 - =cut my $input = new CGI; my $referer = $input->referer(); -my $phase = $input->param('phase'); +my $phase = $input->param('phase') || 'View Dictionary'; +my $area = $input->param('areas') || ''; my $no_html = 0; # this will be set if we dont want to print out an html::template my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { @@ -46,7 +45,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { editcatalogue => 1 }, + flagsrequired => { reports => '*' }, debug => 1, } ); @@ -54,7 +53,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( if ($phase eq 'View Dictionary'){ # view the dictionary we use to set up abstract variables such as all borrowers over fifty who live in a certain town my $areas = get_report_areas(); - my $definitions = get_from_dictionary(); + foreach (@{ $areas }) { + $_->{selected} = 1 if $_->{id} eq $area; # mark active area + } + my $definitions = get_from_dictionary($area); $template->param( 'areas' => $areas , 'start_dictionary' => 1, 'definitions' => $definitions, @@ -113,7 +115,7 @@ elsif ($phase eq 'New Term step 4'){ if ($type eq 'DATE' || $type eq 'DATETIME'){ $tmp_hash{'date'}=1; } - if ($type eq 'TEXT'){ + if ($type eq 'TEXT' || $type eq 'MEDIUMTEXT'){ $tmp_hash{'text'}=1; } # else {