X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fpopup_link-cust_pkg.html;h=39146c35ad9e71f8067199077d43bccd3a57def9;hp=cd4aa4c2e2142153c267abbdea9cb97d49bb40a2;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=5ea49c83c4a5b71a1e7baf2b6a75fe50816fdce5 diff --git a/httemplate/elements/popup_link-cust_pkg.html b/httemplate/elements/popup_link-cust_pkg.html index cd4aa4c2e..39146c35a 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: ) +% 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' => emt('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? -<% $cust_pkg - ? include('/elements/popup_link.html', { 'action' => $action, - 'label' => $label, - 'actionlabel' => $actionlabel, - 'color' => $color, - 'width' => $width, - 'closetext' => $closetext, - } - ) - : '' -%>