|
Lines 31-36
use Koha::Patrons;
Link Here
|
| 31 |
use Koha::Patron::Categories; |
31 |
use Koha::Patron::Categories; |
| 32 |
use Koha::ItemTypes; |
32 |
use Koha::ItemTypes; |
| 33 |
use Koha::IssuingRules; |
33 |
use Koha::IssuingRules; |
|
|
34 |
use Locale::Country; |
| 34 |
|
35 |
|
| 35 |
#Setting variables |
36 |
#Setting variables |
| 36 |
my $input = new CGI; |
37 |
my $input = new CGI; |
|
Lines 271-284
if ( $step == 5 ) {
Link Here
|
| 271 |
} |
272 |
} |
| 272 |
|
273 |
|
| 273 |
$step++ if Koha::IssuingRules->count; |
274 |
$step++ if Koha::IssuingRules->count; |
|
|
275 |
|
| 276 |
} if ($step == 6) { |
| 277 |
if ( $op eq 'add_usage_data_sysprefs') { |
| 278 |
my $usagestats = $input->param('usagestats'); |
| 279 |
my $usagestatscountry = $input->param('usagestatscountry'); |
| 280 |
my $usagestatslibraryname = $input->param('usagestatslibraryname'); |
| 281 |
my $usagestatscountrytype = $input->param('usagestatscountrytype'); |
| 282 |
my $usagestatslibraryurl = $input->param('usagestatslibraryurl'); |
| 283 |
|
| 284 |
my %statsprefvalues = ( |
| 285 |
"UsageStats" => $usagestats, |
| 286 |
"UsageStatsCountry" => $usagestatscountry, |
| 287 |
"UsageStatsLibraryName" => $usagestatslibraryname, |
| 288 |
"UsageStatsCountryType" => $usagestatscountrytype, |
| 289 |
"UsageStatsLibraryURL" => $usagestatslibraryurl, |
| 290 |
); |
| 291 |
|
| 292 |
#Loop through the HEA syspref key value pairs |
| 293 |
while(my($pref, $value) = each %statsprefvalues ) { |
| 294 |
C4::Context->set_preference( $pref, $value ); |
| 295 |
} |
| 296 |
unless ($@) { |
| 297 |
push @messages, { code => 'success_on_insert_circ_rule'}; |
| 298 |
} |
| 299 |
else { |
| 300 |
push @messages, { code => 'error_on_insert_circ_rule' }; |
| 301 |
} |
| 302 |
$step++; |
| 303 |
warn $op; |
| 304 |
} |
| 274 |
} |
305 |
} |
| 275 |
|
306 |
|
| 276 |
my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); |
307 |
my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); |
| 277 |
$template_params->{libraries} = $libraries; |
308 |
$template_params->{libraries} = $libraries; |
| 278 |
|
309 |
|
| 279 |
if ( $step > 5 ) { |
310 |
if ( $step > 6 ) { |
| 280 |
$template_params->{all_done} = 1; # If step 5 is complete, we are done! |
311 |
$template_params->{all_done} = 1; # If step 6 is complete, we are done! |
| 281 |
$step = 5; |
312 |
$step = 6; |
| 282 |
} |
313 |
} |
| 283 |
|
314 |
|
| 284 |
#Getting the appropriate template to display to the user |
315 |
#Getting the appropriate template to display to the user |