From 04894ee3ea2768e34c1086b0012a095c32225dcb Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Sat, 15 Jan 2011 01:17:15 +0000 Subject: added cancel --- groups.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'groups.pl') diff --git a/groups.pl b/groups.pl index cf5a029..359419b 100755 --- a/groups.pl +++ b/groups.pl @@ -5,6 +5,8 @@ use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; use local::nzbget; use local::db; +use local::user; +my $user = new local::user($ENV{REMOTE_USER}); use CGI::Ajax; @@ -26,6 +28,7 @@ sub get_download_table my $html; my $cli = new local::nzbget; my $row = $cli->send_request('listgroups') or die "Can't connect to nubget"; + $html.= CGI::start_table(); foreach my $value ( @$row) { my ($download) = local::db::download->retrieve($value->{NZBNicename}->value) or die ' Error in groups'; @@ -34,12 +37,15 @@ sub get_download_table my $percent = int(100-100*$remaining/$total); $download->size($total); $download->update(); - $html.= Tr(td([$download->category->name,$download->name,$download->owner->name,$percent.'%'])); + my $cancel; + $cancel=a({href=>'/cgi-bin/nzbget/cancel.pl?id='.$value->{NZBNicename}->value},'Abbrechen') if ($download->owner->owner_id() eq $user->get_id()); + $html.= Tr(td([$download->category->name,$download->name,$download->owner->name,$percent.'%',$cancel])); #foreach my $key (keys %$value) #{ # $html.= Tr(td([$key,$value->{$key}->value])); #} } + $html.= CGI::end_table(); return $html; } @@ -51,8 +57,7 @@ sub Show_HTML $html.= < LALALA ; @@ -62,9 +67,7 @@ LALALA $html.= CGI::end_table(); $html.= hr(); - $html.= CGI::start_table(id=>'dltable'); - $html.= get_download_table(); - $html.= CGI::end_table(); + $html.= div({id=>'dls'},get_download_table()); $html.= $menu->end_html(); return $html -- cgit v1.2.3