Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Fri, 5 Oct 2012 03:25:37 +0000 (20:25 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 5 Oct 2012 03:25:37 +0000 (20:25 -0700)
httemplate/edit/process/quick-cust_pkg.cgi
httemplate/elements/table-tickets.html
httemplate/view/elements/svc_Common.html
httemplate/view/svc_acct.cgi
httemplate/view/svc_domain.cgi
httemplate/view/svc_external.cgi
httemplate/view/svc_forward.cgi
httemplate/view/svc_www.cgi

index c5eee0c..2dadbcc 100644 (file)
@@ -64,9 +64,9 @@ die 'no custnum or prospectnum' unless $cust_main || $prospect_main;
 $cgi->param('pkgpart') =~ /^(\d+)$/
   or die 'illegal pkgpart '. $cgi->param('pkgpart');
 my $pkgpart = $1;
-$cgi->param('quantity') =~ /^(\d+)$/
+$cgi->param('quantity') =~ /^(\d*)$/
   or die 'illegal quantity '. $cgi->param('quantity');
-my $quantity = $1;
+my $quantity = $1 || 1;
 $cgi->param('refnum') =~ /^(\d*)$/
   or die 'illegal refnum '. $cgi->param('refnum');
 my $refnum = $1;
index 6d1a45a..ffcaf06 100644 (file)
@@ -94,12 +94,12 @@ View
 </TABLE>
 
 <%init>
-use Date::Parse qw(str2time);
-use Date::Format qw(time2str);
 
 my %opt = @_;
 my $conf = new FS::Conf;
 
+return '' unless $conf->config('ticket_system');
+
 my $object = $opt{'object'};
 $object = $object->cust_svc if $object->isa('FS::svc_Common');
 my( @tickets )  = $object->tickets;
@@ -116,8 +116,10 @@ if ( $object->isa('FS::cust_main') ) {
                     $object->custnum,
                     { 'statuses' => [ 'resolved' ] }
                   );
-}
-elsif ( $object->isa('FS::cust_svc') ) {
+} elsif ( $object->isa('FS::cust_svc') ) {
+
+  return '' unless $object->pkgnum;
+
   $thing = 'service';
   $open_link = FS::TicketSystem->href_service_tickets($object->svcnum);
 
index 04d2b29..f7c685c 100644 (file)
@@ -114,9 +114,7 @@ function areyousure(href) {
 
 % }
 
-% if ( $conf->config('ticket_system') ) {
 <& /elements/table-tickets.html, object => $cust_svc &>
-% }
 
 <% joblisting({'svcnum'=>$svcnum}, 1) %>
 
index 3ad21bb..1995913 100755 (executable)
@@ -76,9 +76,7 @@
 
 <& elements/svc_export_settings.html, $svc_acct &>
 
-% if ( $conf->config('ticket_system') ) {
 <& /elements/table-tickets.html, object => $cust_svc &>
-% }
 
 <BR>
 <% joblisting({'svcnum'=>$svcnum}, 1) %>
index fcccd74..c9592a5 100755 (executable)
@@ -36,9 +36,7 @@
 
 <% include('elements/svc_export_settings.html', $svc_domain) %>
 
-% if ( $conf->config('ticket_system') ) {
 <& /elements/table-tickets.html, object => $cust_svc &>
-% }
 
 <% joblisting({'svcnum'=>$svcnum}, 1) %>
 
index 72e5535..077dc77 100644 (file)
@@ -24,9 +24,7 @@
 
 </TABLE></TD></TR></TABLE>
 
-% if ( $conf->config('ticket_system') ) {
 <& /elements/table-tickets.html, object => $cust_svc &>
-% }
 
 <BR><% joblisting({'svcnum'=>$svcnum}, 1) %>
 
index 2cb78eb..75c8f5c 100755 (executable)
@@ -53,9 +53,7 @@
 
 <% include('elements/svc_export_settings.html', $svc_forward) %>
 
-% if ( $conf->config('ticket_system') ) {
 <& /elements/table-tickets.html, object => $cust_svc &>
-% }
 
 <% joblisting({'svcnum'=>$svcnum}, 1) %>
 
index fbb02a0..f51c760 100644 (file)
@@ -49,9 +49,7 @@
 </TABLE>
 
 <BR>
-% if ( $conf->config('ticket_system') ) {
 <& /elements/table-tickets.html, object => $cust_svc &>
-% }
 
 <% joblisting({'svcnum'=>$svcnum}, 1) %>