X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fpopup_link-cust_pkg.html;h=cd8d5c06977378ef7242416b11d4216331016080;hb=0d75dc389fccdb680237aa1e244e13d254d12f02;hp=cd4aa4c2e2142153c267abbdea9cb97d49bb40a2;hpb=5ea49c83c4a5b71a1e7baf2b6a75fe50816fdce5;p=freeside.git
diff --git a/httemplate/elements/popup_link-cust_pkg.html b/httemplate/elements/popup_link-cust_pkg.html
index cd4aa4c2e..cd8d5c069 100644
--- a/httemplate/elements/popup_link-cust_pkg.html
+++ b/httemplate/elements/popup_link-cust_pkg.html
@@ -2,10 +2,9 @@
Example:
-
-
+ include('/elements/init_overlib.html')
- include( '/elements/pkg_popup_link.html', {
+ include( '/elements/pkg_popup_link.html', { #hashref or a list, either way
#required
'action' => 'content.html', # uri for content of popup which should
@@ -23,37 +22,26 @@ Example:
)
%doc>
+% if ( $params->{'cust_pkg'} ) {
+<% include('/elements/popup_link.html', $params ) %>\
+% }
<%init>
-my($params, $action, $label, $actionlabel, $color, $cust_pkg, $width);
-my $closetext = 'Close';
-if (ref(@_[0]) eq 'HASH') {
- $params = shift;
- foreach (qw(action label actionlabel width color)) {
- $action = $params->{'action'} if exists $params->{'action'};
- $label = $params->{'label'} if exists $params->{'label'};
- $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'};
- $width = $params->{'width'} if exists $params->{'width'};
- $color = $params->{'color'} if exists $params->{'color'};
- $closetext = $params->{'closetext'} if exists $params->{'closetext'};
- $cust_pkg = $params->{'cust_pkg'} if exists $params->{'cust_pkg'};
- }
-}else{ # deprecated
- ($action, $label, $actionlabel, $color, $cust_pkg) = @_;
+
+my $params = { 'closetext' => 'Close',
+ 'width' => 768,
+ };
+
+if (ref($_[0]) eq 'HASH') {
+ $params = { %$params, %{ $_[0] } };
+} else {
+ $params = { %$params, @_ };
}
-$action .= '&pkgnum='. $cust_pkg->pkgnum;
-$actionlabel .= ' package '. $cust_pkg->pkgnum;
-$width ||= 768;
+$params->{'action'} .=
+ ( $params->{'action'} =~ /\?/ ? ';' : '?' ).
+ 'pkgnum='. $params->{'cust_pkg'}->pkgnum;
+
+$params->{'actionlabel'} .=
+ ' package '. $params->{'cust_pkg'}->pkgnum; #XXX pkgnum? really?
%init>
-<% $cust_pkg
- ? include('/elements/popup_link.html', { 'action' => $action,
- 'label' => $label,
- 'actionlabel' => $actionlabel,
- 'color' => $color,
- 'width' => $width,
- 'closetext' => $closetext,
- }
- )
- : ''
-%>