# 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.
=head1 admin/aqbudgetperiods.pl
## modules
use strict;
+#use warnings; FIXME - Bug 2505
use Number::Format qw(format_price);
use CGI;
use List::Util qw/min/;
my $searchfield = $input->param('searchfield');
my $budget_period_id = $input->param('budget_period_id');
my $op = $input->param('op')||"else";
-my $check_duplicate = $input->param('confirm_not_duplicate')||0;
my $budget_period_hashref= $input->Vars;
#my $sort1_authcat = $input->param('sort1_authcat');
);
} # IF-MOD
$template->param( DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),);
- $template->param( confirm_not_duplicate => $check_duplicate );
}
elsif ( $op eq 'add_validate' ) {
my $status=ModBudgetPeriod($budget_period_hashref);
}
else { # ELSE ITS AN ADD
- unless ($check_duplicate){
- my $candidates=GetBudgetPeriods({
- budget_period_startdate => $$budget_period_hashref{budget_period_startdate}
- , budget_period_enddate => $$budget_period_hashref{budget_period_enddate}
- });
- if (@$candidates){
- my @duplicates=map{
- { dupid => $$_{budget_period_id}
- , duplicateinformation =>
- $$_{budget_period_description}." ".$$_{budget_period_startdate}." ".$$_{budget_period_enddate}
- }
- } @$candidates;
- $template->param(url => "aqbudgetperiods.pl",
- field_name => "budget_period_id",
- action_dup_yes_url=> "aqbudgets.pl",
- action_dup_no_url => "aqbudgetperiods.pl?op=add_validate",
- confirm_not_duplicate => 0
- );
- delete $$budget_period_hashref{budget_period_id};
- $template->param(duplicates=>\@duplicates,%$budget_period_hashref);
- $template->param("add_form"=>1);
- output_html_with_http_headers $input, $cookie, $template->output;
- exit;
- }
- }
my $budget_period_id=AddBudgetPeriod($budget_period_hashref);
}
$op='else';