-sub svc_provision_link {
- my ($cust_pkg, $part_svc, $conf, $curuser) = @_;
- ( my $svc_nbsp = $part_svc->svc ) =~ s/\s+/ /g;
- my $num_avail = $part_svc->num_avail;
- my $pkgnum_svcpart = "pkgnum=". $cust_pkg->pkgnum. ';'.
- "svcpart=". $part_svc->svcpart;
- my $url;
- if ( $part_svc->svcdb eq 'svc_external' #could be generalized
- && $conf->exists('svc_external-skip_manual')
- ) {
- $url = "${p}edit/process/". $part_svc->svcdb. ".cgi?$pkgnum_svcpart";
- } else {
- $url = svc_url(
- 'm' => $m,
- 'action' => 'edit',
- 'part_svc' => $part_svc,
- 'query' => $pkgnum_svcpart,
- );
- #$url = "${p}edit/$svcpart->{svcdb}.cgi?$pkgnum_svcpart";
- }
-
- my $link = qq!<A CLASS="provision" HREF="$url">!.
- "Provision $svc_nbsp ($num_avail)</A>";
- if ( $conf->exists('legacy_link')
- && $curuser->access_right('View/link unlinked services')
- )
- {
- $link .= '<BR>'.
- qq!<A CLASS="provision" HREF="${p}misc/link.cgi?!.
- qq!$pkgnum_svcpart">!.
- "Link to legacy $svc_nbsp ($num_avail)</A>";
- }
- $link;
-}
-
-sub svc_unprovision_link {
- my $cust_svc = shift or return '';
- qq!<A HREF="javascript:areyousure('${p}misc/unprovision.cgi?!. $cust_svc->svcnum.
- qq!', 'Permanently unprovision and delete this service?')">Unprovision</A>!;
-}
-
-sub pkg_datestr {
- my($cust_pkg, $field, $conf) = @_ or return '';
- return ' ' unless $cust_pkg->get($field);
- my $format = '<TD align="left"><B>%b</B></TD>'.
- '<TD align="right"><B> %o,</B></TD>'.
- '<TD align="right"><B> %Y</B></TD>';
- #$format .= ' <FONT SIZE=-3>%l:%M:%S%P %z</FONT>'
- $format .= '<TD ALIGN="right"><B> %l</TD>'.
- '<TD ALIGN="center"><B>:</B></TD>'.
- '<TD ALIGN="left"><B>%M</B></TD>'.
- '<TD ALIGN="left"><B> %P</B></TD>'
- if $conf->exists('cust_pkg-display_times');
- my $strip = time2str($format, $cust_pkg->get($field) );
- $strip =~ s/ (\d)/$1/g;
- $strip;
-}
-
-sub pkg_change_link { include( '/elements/popup_link-cust_pkg.html',
- { 'action' => $p. 'misc/change_pkg.cgi?dummy=value',
- 'label' => 'Change package',
- 'actionlabel' => 'Change',
- 'cust_pkg' => shift,
- }
- )
- }
-
-sub pkg_suspend_link { include( '/elements/popup_link-cust_pkg.html',
- { 'action' => $p. 'misc/cancel_pkg.html?method=suspend',
- 'label' => 'Suspend now',
- 'actionlabel' => 'Suspend',
- 'color' => '#FF9900',
- 'cust_pkg' => shift,
- }
- )
- }
-
-
-sub pkg_adjourn_link { include( '/elements/popup_link-cust_pkg.html',
- { 'action' => $p. 'misc/cancel_pkg.html?method=adjourn',
- 'label' => 'Suspend later',
- 'actionlabel' => 'Adjourn',
- 'color' => '#CC6600',
- 'cust_pkg' => shift,
- }
- )
- }
-
-sub pkg_delay_link { include( '/elements/popup_link-cust_pkg.html',
- { 'action' => $p. 'misc/delay_susp_pkg.html',
- 'label' => 'Delay suspend',
- 'actionlabel' => 'Delay suspend for',
- 'cust_pkg' => shift,
- }
- )
- }
-
-sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg', 'Unsuspend', @_ ); }
-sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }
-sub pkg_unadjourn_link { pkg_link('misc/unadjourn_pkg', 'Abort', @_ ); }
-sub pkg_unexpire_link { pkg_link('misc/unexpire_pkg', 'Abort', @_ ); }
-
-sub pkg_cancel_link { include( '/elements/popup_link-cust_pkg.html',
- { 'action' => $p. 'misc/cancel_pkg.html?method=cancel',
- 'label' => 'Cancel now',
- 'actionlabel' => 'Cancel',
- 'color' => '#ff0000',
- 'cust_pkg' => shift,
- }
- )
- }
-
-sub pkg_expire_link { include( '/elements/popup_link-cust_pkg.html',
- { 'action' => $p. 'misc/cancel_pkg.html?method=expire',
- 'label' => 'Cancel later',
- 'actionlabel' => 'Expire', #"Cancel package $num later"
- 'color' => '#CC0000',
- 'cust_pkg' => shift,
- }
- )
- }
-
-sub svc_recharge_link { include( '/elements/popup_link-cust_svc.html',
- { 'action' => $p. 'misc/recharge_svc.html',
- 'label' => 'Recharge',
- 'actionlabel' => 'Recharge',
- 'color' => '#333399',
- 'cust_svc' => shift,
- }
- )
- }
-
-sub order_pkg_link { include( '/elements/popup_link-cust_main.html',
- { 'action' => $p. 'misc/order_pkg.html',
- 'label' => 'Order new package',
- 'actionlabel' => 'Order new package',
- 'color' => '#333399',
- 'cust_main' => shift,
- 'closetext' => 'Close',
- }
- )
- }
-
-sub pkg_event_link {
- my($cust_pkg) = @_;
- qq!<a href="${p}search/cust_event.html?pkgnum=!. $cust_pkg->pkgnum. qq!">!.
- 'View package events'.
- '</a>';
-}
-
-sub pkg_link {
- my($action, $label, $cust_pkg) = @_;
- return '' unless $cust_pkg;
- qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;