diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/auto-table.html | 161 | ||||
-rw-r--r-- | httemplate/elements/bill.html | 55 | ||||
-rw-r--r-- | httemplate/elements/communigate_pro-accessmodes.html | 3 | ||||
-rw-r--r-- | httemplate/elements/file-upload.html | 5 | ||||
-rw-r--r-- | httemplate/elements/freeside.css | 38 | ||||
-rw-r--r-- | httemplate/elements/header-popup.html | 18 | ||||
-rw-r--r-- | httemplate/elements/htmlarea.html | 3 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 16 | ||||
-rw-r--r-- | httemplate/elements/menubar.html | 6 | ||||
-rw-r--r-- | httemplate/elements/pickcolor.html | 60 | ||||
-rw-r--r-- | httemplate/elements/progress-init.html | 42 | ||||
-rw-r--r-- | httemplate/elements/progress-popup.html | 8 | ||||
-rw-r--r-- | httemplate/elements/select-cgp_rule_condition.html | 12 | ||||
-rw-r--r-- | httemplate/elements/select-cust_tag.html | 20 | ||||
-rw-r--r-- | httemplate/elements/tr-htmlarea.html | 25 | ||||
-rw-r--r-- | httemplate/elements/tr-pickcolor.html | 11 | ||||
-rw-r--r-- | httemplate/elements/tr-select-agent.html | 33 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust_tag.html | 46 |
18 files changed, 21 insertions, 541 deletions
diff --git a/httemplate/elements/auto-table.html b/httemplate/elements/auto-table.html deleted file mode 100644 index 9c7dfd0..0000000 --- a/httemplate/elements/auto-table.html +++ /dev/null @@ -1,161 +0,0 @@ -<%doc> - -Example: -<% include('/elements/auto-table.html', - - ### - # required - ### - - 'header' => [ '#', 'Item', 'Amount' ], - 'fields' => [ 'id', 'name', 'amount' ], - - ### - # highly recommended - ### - - 'size' => [ 4, 12, 8 ], - 'maxl' => [ 4, 12, 8 ], - 'align' => [ 'right', 'left', 'right' ], - - ### - # optional - ### - - 'data' => [ [ 1, 'Widget', 25 ], - [ 12, 'Super Widget, 7 ] ], - #or - 'records' => [ qsearch('item', { } ) ], - # or any other array of FS::Record objects - - 'select' => [ '', - [ 1 => 'option 1', - 2 => 'option 2', ... - ], # options for second field - '' ], - - 'prefix' => 'mytable_', -) %> - -Values will be passed through as "mytable_id1", etc. -</%doc> - -<TABLE ID="<% $prefix %>AutoTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0> - <TR> -% foreach (@header) { - <TH><% $_ %></TH> -% } - </TR> -% my $row = 0; -% for ( $row = 0; $row < scalar @data; $row++ ) { - <TR> -% my $col = 0; -% for ( $col = 0; $col < scalar @fields; $col++ ) { -% my $id = $prefix . $fields[$col] . $row; - <TD> -% my @o = @{ $select[$col] }; -% if( @o ) { - <SELECT NAME="<% $id %>" ID="<% $id %>"> -% while(@o) { -% my $val = shift @o; - <OPTION VALUE=<% $val %><% -$val eq $data[$row][$col] ? ' SELECTED' : ''%>><% shift @o %></OPTION> -% } - </SELECT> -% } -% else { - <INPUT TYPE = "text" - NAME = "<% $id %>" - ID = "<% $id %>" - SIZE = <% $size[$col] %> - MAXLENGTH = <% $maxl[$col] %> - STYLE = "text-align:<% $align[$col] %>" - VALUE = "<% $data[$row][$col] %>" -% if( $opt{'autoadd'} ) { - onchange = "possiblyAddRow(this);" -% } - > - </TD> -% } -% } - <TD> - <IMG SRC = "<% "${p}images/cross.png" %>" - ALT = "X" - onclick = "deleteRow(this);" - > - </TD> - </TR> -% } -</TABLE> -% if( !$opt{'autoadd'} ) { -<INPUT TYPE="button" VALUE="Add" onclick="<% $prefix %>addRow();"><BR> -% } - -<SCRIPT TYPE="text/javascript"> - var <% $prefix %>rownum = <% $row %>; - var <% $prefix %>table = document.getElementById('<% $prefix %>AutoTable'); - // last row is initially blank, clone it and remove it - var <% $prefix %>_blank = - <% $prefix %>table.rows[<% $prefix %>table.rows.length-1].cloneNode(true); -% if( !$opt{'autoadd'} ) { - <% $prefix %>table.deleteRow(<% $prefix %>table.rows.length-1); -% } - - - - function rownum_of(obj) { - return (obj.parentNode.parentNode.sectionRowIndex); - } - - function <% $prefix %>possiblyAddRow(obj) { - if ( <% $prefix %>rownum == rownum_of(obj) ) { - <% $prefix %>addRow(); - } - } - - function <% $prefix %>addRow() { - var row = <% $prefix %>table.insertRow(-1); - var cells = <% $prefix %>_blank.cells; - for (i=0; i<cells.length; i++) { - row.appendChild(cells[i].cloneNode(true)); - } - <% $prefix %>rownum++; - } - - function deleteRow(obj) { - if(<% $prefix %>rownum == rownum_of(obj)) { - <% $prefix %>addRow(); - } - <% $prefix %>table.deleteRow(rownum_of(obj)); - <% $prefix %>rownum--; - return(false); - } - -</SCRIPT> - -<%init> -my %opt = @_; - -my @header = @{ $opt{'header'} }; -my @fields = @{ $opt{'fields'} }; -my @data = (); -if($opt{'data'}) { - @data = @{ $opt{'data'} }; -} -elsif($opt{'records'}) { - foreach my $rec (@{ $opt{'records'} }) { - push @data, [ map { $rec->getfield($_) } @fields ]; - } -} -# else @data = (); -push @data, [ map {''} @fields ]; # make a blank row - -my $prefix = $opt{'prefix'}; -my @size = $opt{'size'} ? @{ $opt{'size'} } : (map {16} @fields); -my @maxl = $opt{'maxl'} ? @{ $opt{'maxl'} } : @size; -my @align = $opt{'align'} ? @{ $opt{'align'} } : (map {'right'} @fields); -my @select = @{ $opt{'select'} || [] }; -foreach (0..scalar(@fields)-1) { - $select[$_] ||= []; -} -</%init> diff --git a/httemplate/elements/bill.html b/httemplate/elements/bill.html deleted file mode 100644 index 64a1a6d..0000000 --- a/httemplate/elements/bill.html +++ /dev/null @@ -1,55 +0,0 @@ -<%doc> - -Clickable link to bill a customer. - -Example: -<% include( '/elements/bill.html', - ### - # required - ### - custnum => $custnum, - label => 'Bill Now!', - - ### - # recommended - ### - url => $p.'view/cust_main.cgi?'.$custnum, - - ### - # optional, can contain any FS::cust_main::bill_and_collect options - ### - bill_opts => { 'batch_card' => 'yes' }, - formname => 'MyBillNowLink', # if for some reason you want this -) %> - -</%doc> -<FORM NAME="<%$formname%>" STYLE="display:inline"> -<% include('/elements/progress-init.html', - $formname, - [ 'custnum', @opt_keys ], - $p.'misc/bill.cgi', - $url ? { url => $url } : { message => $message }, - $formname, # use it as 'key' -) %> -<A HREF="javascript:void(0);" onclick="javascript:<%$formname%>process();"><%$label%></A> -<INPUT TYPE="hidden" NAME="custnum" VALUE="<%$custnum%>"> -% foreach(@opt_keys) { -<INPUT TYPE="hidden" NAME="<%$_%>" VALUE="<%$bill_opts->{$_}%>"> -% } -</FORM> -<%init> - -my %opt = @_; -my $custnum = $opt{'custnum'}; -my $label = $opt{'label'}; -# formname no longer needs to be passed from outside, but we still -# need one and it needs to be unique -my $formname = $opt{'formname'} || - 'bill'.sprintf('%04d',int(rand(10000))).$custnum; -my $url = $opt{'url'} || ''; -my $message = $opt{'message'} || 'Finished!'; -my $bill_opts = $opt{'bill_opts'} || {}; -my @opt_keys = keys(%$bill_opts); -my @opt_vals = values(%$bill_opts); - -</%init> diff --git a/httemplate/elements/communigate_pro-accessmodes.html b/httemplate/elements/communigate_pro-accessmodes.html index b5fa53c..6ce9ca5 100644 --- a/httemplate/elements/communigate_pro-accessmodes.html +++ b/httemplate/elements/communigate_pro-accessmodes.html @@ -11,11 +11,8 @@ my @names = (qw( Mail Relay Signal Mobile TLS POP IMAP MAPI AirSync SIP XMPP WebMail XIMSS FTP ACAP PWD LDAP RADIUS S/MIME WebCAL WebSite PBX HTTP - MobilePBX YMedia )); -#GIPS Media? - </%once> <%init> diff --git a/httemplate/elements/file-upload.html b/httemplate/elements/file-upload.html index 034eaec..7e2eeef 100644 --- a/httemplate/elements/file-upload.html +++ b/httemplate/elements/file-upload.html @@ -54,15 +54,10 @@ <INPUT TYPE="hidden" NAME="upload_fields" VALUE="<% join(',', @field) %>" /> % foreach (@field) { -% if($param{'no_table'}) { - <% shift @label %> <INPUT TYPE="file" NAME="<% $_ %>" /> -% } -% else { <TR> <TH ALIGN="<% $param{'label_align'} || 'right' %>"><% shift @label %></TH> <TD><INPUT TYPE="file" NAME="<% $_ %>" /></TD> </TR> -% } % } <DIV STYLE="display:<% $param{debug} ? 'visible' : 'none' %>"> diff --git a/httemplate/elements/freeside.css b/httemplate/elements/freeside.css index dfb56e9..3816f98 100644 --- a/httemplate/elements/freeside.css +++ b/httemplate/elements/freeside.css @@ -109,8 +109,6 @@ a.fstab { font-weight:bold; text-decoration:none; overflow:visible; - margin-left:6px; - margin-right:6px; } a.fstab:hover { text-decoration:none; @@ -121,12 +119,13 @@ a.fstab:hover { a:visited:hover.fsblackbutton */ a.fstabselected { - background-color:#ffffff; + background-color:#f8f8f8; color: #000000; - border-top:1px solid #7e0079; - border-left:1px solid #7e0079; - border-right:1px solid #7e0079; - border-bottom:1px solid #ffffff; + border:1px solid; + border-top-color:#7e0079; + border-left-color:#7e0079; + border-right-color:#7e0079; + border-bottom-color:#ffffff; -moz-border-radius-topleft:8px; -moz-border-radius-topright:8px; -webkit-border-radius-topleft:8px; @@ -142,37 +141,12 @@ a.fstabselected { font-weight:bold; text-decoration:none; overflow:visible; - margin-left:6px; - margin-right:6px; } a.fstabselected:hover { text-decoration:none; color: #000000; } -div.fstabs { - padding-left:8px; - border-bottom:1px solid #7e0079; -} - -div.fstabcontainer { - background-color:#ffffff; - padding:8px; - border-left:1px solid #7e0079; - border-right:1px solid #7e0079; - border-bottom:1px solid #7e0079; - -moz-border-radius-bottomleft:8px; - -moz-border-radius-bottomright:8px; - -webkit-border-radius-bottomleft:8px; - -webkit-border-radius-bottomright:8px; - border-radius-bottomleft:8px; - border-radius-bottomright:8px; - -moz-box-shadow: #666666 1px 1px 2px; - -webkit-box-shadow: #666666 1px 1px 2px; - box-shadow: #666666 1px 1px 2px; - filter: progid:DXImageTransform.Microsoft.Shadow(color='#666666', Direction=135, Strength=2); -} - .background { background-color:#f8f8f8; } diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html index 2bd4a96..cd8da56 100644 --- a/httemplate/elements/header-popup.html +++ b/httemplate/elements/header-popup.html @@ -1,21 +1,3 @@ -<%doc> - -Example: - - include( '/elements/header-popup.html', - { - 'title' => 'Title', - 'menubar' => \@menubar, - 'etc' => '', #included in <BODY> tag, for things like onLoad= - 'head' => '', #included before closing </HEAD> tag - 'nobr' => 0, #1 for no <BR><BR> after the title - } - ); - - #old-style - include( '/elements/header.html', 'Title', $menubar, $etc, $head); - -</%doc> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> diff --git a/httemplate/elements/htmlarea.html b/httemplate/elements/htmlarea.html index f00c773..dca4328 100644 --- a/httemplate/elements/htmlarea.html +++ b/httemplate/elements/htmlarea.html @@ -22,9 +22,6 @@ Example: oFCKeditor.BasePath = '<% $p %>elements/fckeditor/'; oFCKeditor.Config['SkinPath'] = '<% $p %>elements/fckeditor/editor/skins/silver/'; -% if ( $opt{'width'} ) { - oFCKeditor.Width = '<% $opt{'width'} %>'; -% } oFCKeditor.Height = '<% $opt{'height'} || 420 %>'; oFCKeditor.Config['StartupFocus'] = true; oFCKeditor.Config['EnterMode'] = 'br'; diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index a5bcdeb..2d28e49 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -215,7 +215,7 @@ $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg tie my %report_inventory, 'Tie::IxHash', 'Inventory by agent' => [ $fsurl.'search/report_agent_inventory.html', '' ], - 'Inventory activity' => [ $fsurl.'search/report_h_inventory_item.html', '' ], + #'Inventory activity' => [ $fsurl.'search/report_h_inventory_item.html', '' ], ; tie my %report_rating, 'Tie::IxHash', @@ -357,8 +357,6 @@ $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Ente $tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_date;open=1;intransit=1', 'Process credit card and electronic check batches' ] if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') ) && $curuser->access_right('Process batches'); -$tools_menu{'Process invoice batches'} = [ $fsurl.'search/bill_batch.cgi' ] - if ( $conf->exists('invoice_print_pdf') ); $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] if $curuser->access_right('Job queue'); $tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ] @@ -421,7 +419,6 @@ tie my %config_billing_rates, 'Tie::IxHash', 'Rate plans' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans' ], 'Regions and prefixes' => [ $fsurl.'browse/rate_region.html', 'Manage regions and prefixes' ], 'Usage classes' => [ $fsurl.'browse/usage_class.html', 'Usage classes define groups of usage for taxation.' ], - 'Time periods' => [ $fsurl.'browse/rate_time.html', 'Time periods define days and hours for rate plans' ], 'Edit rates with Excel' => [ $fsurl.'misc/rate_edit_excel.html', 'Download and edit rates with Excel, then upload changes.' ], #"Edit with Excel" ? ; @@ -473,18 +470,12 @@ tie my %config_phone, 'Tie::IxHash', ; tie my %config_misc, 'Tie::IxHash'; -$config_misc{'Message templates'} = [ $fsurl.'browse/msg_template.html', 'Templates for customer notices' ] - if $curuser->access_right('Edit templates') - || $curuser->access_right('Edit global templates') - || $curuser->access_right('Configuration'); -$config_misc{'Tags'} = [ $fsurl.'browse/part_tag.html', '' ] - if $curuser->access_right('Configuration'); $config_misc{'Advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service.' ] if $curuser->access_right('Edit advertising sources') || $curuser->access_right('Edit global advertising sources'); if ( $curuser->access_right('Configuration') ) { $config_misc{'Virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ]; - $config_misc{'Error catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; + $config_misc{'Message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; } $config_misc{'Inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ] if $curuser->access_right('Edit inventory') @@ -522,8 +513,7 @@ $config_menu{'Broadband'} = [ \%config_broadband, '' ] $config_menu{'Phone'} = [ \%config_phone, '' ] if ( $curuser->access_right('Configuration') ); $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] - if $curuser->access_right('Configuration' ) - || $curuser->access_right('Edit advertising sources') + if $curuser->access_right('Edit advertising sources') || $curuser->access_right('Edit global advertising sources'); diff --git a/httemplate/elements/menubar.html b/httemplate/elements/menubar.html index c149043..fe49f7b 100644 --- a/httemplate/elements/menubar.html +++ b/httemplate/elements/menubar.html @@ -19,10 +19,10 @@ Example: </%doc> %if ( $opt->{'newstyle'} ) { +% my $s = '<FONT STYLE="border-bottom:1px solid #7e0079">'; - <DIV CLASS="fstabs"> - <% join('', @html ) %> - </DIV> + <% join("$s </FONT>", ( '', @html, '' ) ) %> + <BR> %} else { diff --git a/httemplate/elements/pickcolor.html b/httemplate/elements/pickcolor.html deleted file mode 100644 index d410ebf..0000000 --- a/httemplate/elements/pickcolor.html +++ /dev/null @@ -1,60 +0,0 @@ -<INPUT TYPE="hidden" NAME="<% $opt{'field'} %>" ID="<%$id%>" VALUE="<%$value%>"> -<TABLE BGCOLOR="#FFFFFF" ID="showcolor<%$unum%>"> -<TR> - <TD STYLE="border:1px solid blue;background-color:#<%$value%>" WIDTH=16 HEIGHT=16 ID="currcolor<%$unum%>"></TD> - <TD> <A HREF="javascript:void(0);" onClick="change_clicked<%$unum%>()">change</A></TD> -</TR> -</TABLE> -<TABLE BGCOLOR="#FFFFFF" ID="pickcolor<%$unum%>" STYLE="display:none"> -% for (1..$rows) { - <TR> -% for (1..$cols) { -% last unless @colors; -% my $color = shift(@colors); - <TD STYLE="border:1px solid blue;cursor:pointer;cursor:hand" BGCOLOR="#<% $color %>" WIDTH=16 HEIGHT=16 onClick="color_clicked<%$unum%>('<%$color%>')"></TD> -% } - </TR> -% } -</TABLE> -<SCRIPT TYPE="text/javascript"> - - function change_clicked<%$unum%>() { - document.getElementById('showcolor<%$unum%>').style.display = 'none'; - document.getElementById('pickcolor<%$unum%>').style.display = ''; - } - - function color_clicked<%$unum%>(color) { - document.getElementById('<%$id%>').value = color; //update hidden - if ( color == '' ) { color = 'ffffff'; } - document.getElementById('currcolor<%$unum%>').style.backgroundColor = '#' + color; - document.getElementById('showcolor<%$unum%>').style.display = ''; - document.getElementById('pickcolor<%$unum%>').style.display = 'none'; - } - -</SCRIPT> -<%init> - -my %opt = @_; - -my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value}; - -my $unum = int(rand(100000)); - -my $id = $opt{'id'} || $opt{'field'}.$unum; - -my @colors = ( - '', #none/white - 'FF6666', #red - 'FF9966', #orange - 'FFFF66', #yellow - '66FF66', #green - '66FFFF', #cyan? - '6666FF', #blue - 'CC66FF', #purple? FF66FF looks more like pink. -); - -my $rows = 2; - -my $cols = int(.5+scalar(@colors)/$rows); - -</%init> diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 8b8da66..194fc74 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -1,45 +1,3 @@ -<%doc> -Example: -In misc/something.html: - - <FORM NAME="MyForm"> - <INPUT TYPE="hidden" NAME="recordnum" VALUE="42"> - <INPUT TYPE="hidden" NAME="what_to_do" VALUE="delete"> - <% include( '/elements/progress-init.html', - 'MyForm', - [ 'recordnum', 'what_to_do' ], - $p.'misc/process_something.html', - { url => $p.'where_to_go_next.html' }, - #or { message => 'Finished!' }, - ) %> - </FORM> - <SCRIPT TYPE="text/javascript>process();</SCRIPT> - -In misc/process_something.html: - -<%init> -my $server = FS::UI::Web::JSRPC->new('FS::something::process_whatever', $cgi); -</%init> -<% $server->process %> - -In FS/something.pm: - -sub process_whatever { #class method - my $job = shift; - my $param = thaw(base64_decode(shift)); - # param = { 'recordnum' => 42, 'what_to_do' => delete } - # make use of this as you like - do_phase1; - $job->update_statustext(20); - do_phase2; - $job->update_statustext(40); - do_phase3; - $job->update_statustext(60); - # etc. - return 'this value will be ignored'; -} - -</%doc> <% include('/elements/xmlhttp.html', 'method' => 'POST', 'url' => $action, diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html index a292102..8a55efb 100644 --- a/httemplate/elements/progress-popup.html +++ b/httemplate/elements/progress-popup.html @@ -69,14 +69,6 @@ function updateStatus( status_statustext ) { alert('job done but no url or message specified'); % } - } else if ( status.indexOf('done') > -1 ) { - - document.getElementById("progress_message").innerHTML = "Loading report"; - document.getElementById("progress_bar").innerHTML = ''; - document.getElementById("progress_percent").innerHTML = ''; - document.getElementById("progress_jobnum").innerHTML = ''; - window.top.location.href = statustext.substr(8, statustext.length-18); - } else if ( status.indexOf('error') > -1 ) { document.getElementById("progress_message").innerHTML = '<FONT SIZE="+1" COLOR="#FF0000">Error: ' + statustext + '</FONT>'; document.getElementById("progress_bar").innerHTML = ''; diff --git a/httemplate/elements/select-cgp_rule_condition.html b/httemplate/elements/select-cgp_rule_condition.html index bc96ab4..622cbe8 100644 --- a/httemplate/elements/select-cgp_rule_condition.html +++ b/httemplate/elements/select-cgp_rule_condition.html @@ -3,10 +3,10 @@ <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>"> <% include( 'select.html', - 'field' => $name.'_conditionname', - 'id' => $id.'_conditionname', + 'field' => $name.'_condition', + 'id' => $id.'_condition', 'options' => \@conditions, - 'curr_value' => $conditionname, + 'curr_value' => $condition, 'labels' => { '' => 'Select Condition' }, 'onchange' => $name.'_changed', ) @@ -189,10 +189,10 @@ if ( $curr_value ) { $cgp_rule_condition = new FS::cgp_rule_condition {}; } -my $conditionname = scalar($cgi->param($name.'_conditionname')) - || $cgp_rule_condition->conditionname; +my $condition = scalar($cgi->param($name.'_condition')) + || $cgp_rule_condition->condition; -my @op = &$cond2op($conditionname); +my @op = &$cond2op($condition); my $disabled = scalar(@op) ? '' : 1; my $style = $disabled ? 'visibility:hidden' : ''; diff --git a/httemplate/elements/select-cust_tag.html b/httemplate/elements/select-cust_tag.html deleted file mode 100644 index 61d4dca..0000000 --- a/httemplate/elements/select-cust_tag.html +++ /dev/null @@ -1,20 +0,0 @@ -<% include( '/elements/select-table.html', - 'table' => 'part_tag', - 'name_col' => 'tagname', #tagname - tagdesc?? - 'multiple' => 1, - #'value' => $agentnum || '', - #'agent_virt' => 1, - 'hashref' => { 'disabled' => '' }, - 'order_by' => ' ORDER BY tagname', - %opt, - ) -%> -<%init> - -my %opt = @_; -#my $agentnum = $opt{'curr_value'} || $opt{'value'}; - -$opt{'records'} = delete $opt{'part_tag'} - if $opt{'part_tag'}; - -</%init> diff --git a/httemplate/elements/tr-htmlarea.html b/httemplate/elements/tr-htmlarea.html deleted file mode 100644 index 1a4e250..0000000 --- a/httemplate/elements/tr-htmlarea.html +++ /dev/null @@ -1,25 +0,0 @@ -<% include('tr-td-label.html', @_ ) %> - - <TD <% $cell_style %>> - - <% include('htmlarea.html', @_ ) %> - - </TD> - -</TR> - -<%init> - -my %opt = @_; - -my $onchange = $opt{'onchange'} - ? 'onChange="'. $opt{'onchange'}. '(this)"' - : ''; - -#my $rows = $opt{'rows'} ? 'ROWS="'.$opt{'rows'}.'"' : ''; -#my $cols = $opt{'cols'} ? 'COLS="'.$opt{'cols'}.'"' : ''; - -my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; -#my $curr_value = $opt{'curr_value'}; - -</%init> diff --git a/httemplate/elements/tr-pickcolor.html b/httemplate/elements/tr-pickcolor.html deleted file mode 100644 index 2b6cc23..0000000 --- a/httemplate/elements/tr-pickcolor.html +++ /dev/null @@ -1,11 +0,0 @@ -<% include('tr-td-label.html', @_ ) %> - <TD <% $colspan %> <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><% include('pickcolor.html', @_ ) %></TD> -<%init> - -my %opt = @_; - -my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; - -my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : ''; - -</%init> diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index 9f2f76a..fcfa9f3 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -1,27 +1,3 @@ -<%doc> - -Example: - - include( '/elements/tr-select-agent.html', - - #recommended to keep things "sticky" on errors - 'curr_value' => $curr_value, - - ## - # optional - ## - - 'label' => 'Agent for this thing', - 'empty_label' => 'Select agent', #override default - 'disable_empty' => 1, - - #set to 'None' or something to override default of showing all agents - #for employees w/ 'View customers of all agents' right - viewall_right => 'None', - - ); - -</%doc> % if ( scalar(@agents) == 1 ) { <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'agentnum' %>" VALUE="<% $agents[0]->agentnum %>"> @@ -50,11 +26,8 @@ Example: my %opt = @_; my $agentnum = $opt{'curr_value'} || $opt{'value'}; -my @agents = - $opt{'agents'} - ? @{ $opt{'agents'} } - : $FS::CurrentUser::CurrentUser->agents( - 'viewall_right' => $opt{'viewall_right'}, - ); +my @agents = $opt{'agents'} + ? @{ $opt{'agents'} } + : $FS::CurrentUser::CurrentUser->agents; </%init> diff --git a/httemplate/elements/tr-select-cust_tag.html b/httemplate/elements/tr-select-cust_tag.html deleted file mode 100644 index d88f3a8..0000000 --- a/httemplate/elements/tr-select-cust_tag.html +++ /dev/null @@ -1,46 +0,0 @@ -% if ( $curuser->access_right('Edit customer tags') && @part_tag ) { - - <TR> - <TD ALIGN="right"><% $opt{'label'} || 'Tags' %></TD> - <TD> - <% include( '/elements/select-cust_tag.html', - 'curr_value' => \@curr_tagnum, - 'part_tag' => \@part_tag, - %opt, - ) - %> - </TD> - </TR> - -% } else { - -% foreach my $tagnum (@curr_tagnum) { - <INPUT TYPE="hidden" NAME="tagnum" VALUE="<% $tagnum %>"> -% } - -% } -<%init> - -my $curuser = $FS::CurrentUser::CurrentUser; - -my %opt = @_; -my $cgi = $opt{'cgi'}; - -my @curr_tagnum = (); -if ( $cgi->param('error') ) { - @curr_tagnum = $cgi->param('tagnum'); -} elsif ( $opt{'custnum'} ) { - @curr_tagnum = map $_->tagnum, - qsearch('cust_tag', { 'custnum' => $opt{'custnum'} } ); -} - -my $extra_sql = "WHERE disabled IS NULL OR disabled = '' "; -$extra_sql .= ' OR tagnum IN ('. join(',', @curr_tagnum). ')' if @curr_tagnum; - -my @part_tag = qsearch({ - 'table' => 'part_tag', - 'hashref' => {}, - 'extra_sql' => $extra_sql, -}); - -</%init> |