X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=reports%2Fdictionary.pl;h=163e978522d17848bdd4163d2f05213c5e135203;hb=89cda847a1852a0b42b79f245af57ec4ae429bd3;hp=7edd1d42954e56fd75901fcd5f765861711d4402;hpb=35b3df2e9558677f832f52bdb5b11aac6ef8e53c;p=srvgit diff --git a/reports/dictionary.pl b/reports/dictionary.pl index 7edd1d4295..163e978522 100755 --- a/reports/dictionary.pl +++ b/reports/dictionary.pl @@ -13,16 +13,17 @@ # 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; -use C4::Reports; -use C4::Dates qw( DHTMLcalendar ); +use C4::Reports::Guided; +use C4::Dates; =head1 NAME @@ -38,7 +39,8 @@ Script to control the guided report creation 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,15 +48,18 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { editcatalogue => 1 }, + flagsrequired => { reports => '*' }, debug => 1, } ); 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 = C4::Reports::get_report_areas(); - my $definitions = get_from_dictionary(); + my $areas = get_report_areas(); + 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, @@ -68,7 +73,7 @@ elsif ($phase eq 'Add New Definition'){ elsif ($phase eq 'New Term step 2'){ # Choosing the area - my $areas = C4::Reports::get_report_areas(); + my $areas = C4::Reports::Guided::get_report_areas(); my $definition_name=$input->param('definition_name'); my $definition_description=$input->param('definition_description'); $template->param( 'step_2' => 1, @@ -134,7 +139,7 @@ elsif ($phase eq 'New Term step 4'){ elsif ($phase eq 'New Term step 5'){ # Confirmation screen - my $areas = C4::Reports::get_report_areas(); + my $areas = C4::Reports::Guided::get_report_areas(); my $area = $input->param('area'); my $areaname = $areas->[$area - 1]->{'name'}; my $columnstring = $input->param('columnstring');