-sub pkg_change_link {
- my $pkg = shift or return '';
- return qq!<a href="${p}misc/change_pkg.cgi?$pkg->{pkgnum}">!.
- qq!Change package</a>!;
-}
-
-sub pkg_suspend_link {
- my $pkg = shift or return '';
- return qq!<a href="${p}misc/susp_pkg.cgi?$pkg->{pkgnum}">Suspend</a>!;
-}
-
-sub pkg_unsuspend_link {
- my $pkg = shift or return '';
- return qq!<a href="${p}misc/unsusp_pkg.cgi?$pkg->{pkgnum}">Unsuspend</a>!;
-}
-
-sub pkg_cancel_link {
- my $pkg = shift or return '';
- qq!<A HREF="javascript:areyousure('${p}misc/cancel_pkg.cgi?$pkg->{pkgnum}', !.
- qq!'Permanently delete included services and cancel this package?')">!.
- qq!Cancel now</A>!;
-}
-
-sub pkg_expire_link {
- my $pkg = shift or return '';
- qq!<A HREF="${p}misc/expire_pkg.cgi?$pkg->{pkgnum}">Cancel later</A>!;
+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_unsuspend_link { pkg_link('misc/unsusp_pkg', 'Unsuspend', @_ ); }
+sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }
+
+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>';