X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fpopup_link-cust_main.html;h=454fcc4c89a3cc189d3ba8570134bbb0c501a8c5;hb=b042235d094f39118023c3af8995967ee4fb738f;hp=3b1363f49d93acc406c01127308e687036700eef;hpb=5ea49c83c4a5b71a1e7baf2b6a75fe50816fdce5;p=freeside.git diff --git a/httemplate/elements/popup_link-cust_main.html b/httemplate/elements/popup_link-cust_main.html index 3b1363f49..454fcc4c8 100644 --- a/httemplate/elements/popup_link-cust_main.html +++ b/httemplate/elements/popup_link-cust_main.html @@ -2,10 +2,9 @@ Example: - - + include('/elements/init_overlib.html') - include( '/elements/cust_popup_link.html', { + include( '/elements/popup_link-cust_main.html', { #hashref or a list, either way #required 'action' => 'content.html', # uri for content of popup which should @@ -23,34 +22,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 .= '?'. $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, - } - ) - : '' -%>