X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fpopup_link-cust_main.html;fp=httemplate%2Felements%2Fpopup_link-cust_main.html;h=cbb48c00828b86ee779648c5a0439b91041354ff;hb=a2649b652a3db877b105b4bea5b34727dbcb914f;hp=a927f39f2e8d8fe700d8ff0c07261402044b7674;hpb=f9b6a37aaee52d875ea9393cda79d46f8916e593;p=freeside.git diff --git a/httemplate/elements/popup_link-cust_main.html b/httemplate/elements/popup_link-cust_main.html index a927f39f2..cbb48c008 100644 --- a/httemplate/elements/popup_link-cust_main.html +++ b/httemplate/elements/popup_link-cust_main.html @@ -5,7 +5,7 @@ Example: - include( '/elements/cust_popup_link.html', { + include( '/elements/cust_popup_link.html', { #hashref or a list, either way #required 'action' => 'content.html', # uri for content of popup which should @@ -23,35 +23,21 @@ Example: ) +% if ( $params->{'cust_main'} ) { +<% include('/elements/popup_link.html', $params ) %>\ +% } <%init> -my($params, $action, $label, $actionlabel, $color, $cust_main, $width); -my $closetext = ''; -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_main = $params->{'cust_main'} if exists $params->{'cust_main'}; - } -}else{ # deprecated - ($action, $label, $actionlabel, $color, $cust_main) = @_; -} -$action .= ( $action =~ /\?/ ) ? ';' : '?'; -$action .= 'custnum='. $cust_main->custnum; +my $params = { 'closetext' => 'Close' }; + +if (ref($_[0]) eq 'HASH') { + $params = { %$params, %{ $_[0] } }; +} else { + $params = { %$params, @_ }; +} + +$params->{'action'} .= + ( $params->{'action'} =~ /\?/ ? ';' : '?' ). + 'custnum='. $params->{'cust_main'}->custnum; -<% $cust_main - ? include('/elements/popup_link.html', { 'action' => $action, - 'label' => $label, - 'actionlabel' => $actionlabel, - 'color' => $color, - 'closetext' => $closetext, - } - ) - : '' -%>