X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=admin%2Faqcontract.pl;h=ab513e7fe6afcfe6e36eb6ef1278f668867c98d4;hb=5d6c092921919526ade501facb1220f8a108a08f;hp=9476f0646497751b00a5fd0f0aed0d7f57bb7f9f;hpb=0ed6bcdabbfc82d603b8c15da0f699887c5c2f45;p=koha_fer diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index 9476f06464..ab513e7fe6 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -16,9 +16,9 @@ # 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 strict; use warnings; @@ -35,7 +35,7 @@ my $contractnumber = $input->param('contractnumber'); my $booksellerid = $input->param('booksellerid'); my $op = $input->param('op') || ''; -my @bookseller = GetBookSellerFromId($booksellerid); +my $bookseller = GetBookSellerFromId($booksellerid); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "admin/aqcontract.tmpl", @@ -50,25 +50,36 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( $template->param( contractnumber => $contractnumber, booksellerid => $booksellerid, - booksellername => $bookseller[0]->{name}, - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), + booksellername => $bookseller->{name}, + basketcount => $bookseller->{'basketcount'}, + subscriptioncount => $bookseller->{'subscriptioncount'}, ); #ADD_FORM: called if $op is 'add_form'. Used to create form to add or modify a record if ( $op eq 'add_form' ) { $template->param( add_form => 1 ); - # if contractnumber exists, it's a modify action, so read values to modify... - my $contract = @{GetContract( { contractnumber => $contractnumber } )}[0] if $contractnumber; - - $template->param( - contractnumber => $$contract{contractnumber}, - contractname => $$contract{contractname}, - contractdescription => $$contract{contractdescription}, - contractstartdate => format_date( $$contract{contractstartdate} ), - contractenddate => format_date( $$contract{contractenddate} ), - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, - ); + # if contractnumber exists, it's a modify action, so read values to modify... + if ($contractnumber) { + my $contract = + @{ GetContract( { contractnumber => $contractnumber } ) }[0]; + + $template->param( + contractnumber => $contract->{contractnumber}, + contractname => $contract->{contractname}, + contractdescription => $contract->{contractdescription}, + contractstartdate => format_date( $contract->{contractstartdate} ), + contractenddate => format_date( $contract->{contractenddate} ), + ); + } else { + $template->param( + contractnumber => undef, + contractname => undef, + contractdescription => undef, + contractstartdate => undef, + contractenddate => undef, + ); + } # END $OP eq ADD_FORM } @@ -98,7 +109,7 @@ elsif ( $op eq 'add_validate' ) { }); } - print $input->redirect("aqcontract.pl?booksellerid=$booksellerid"); + print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid"); exit; # END $OP eq ADD_VALIDATE @@ -125,7 +136,7 @@ elsif ( $op eq 'delete_confirmed' ) { DelContract( { contractnumber => $contractnumber } ); - print $input->redirect("aqcontract.pl?booksellerid=$booksellerid"); + print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid"); exit; # END $OP eq DELETE_CONFIRMED