summaryrefslogtreecommitdiff
path: root/httemplate/elements/checkboxes-table.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-08-25 15:06:45 -0700
committerIvan Kohler <ivan@freeside.biz>2016-08-25 15:06:45 -0700
commit64aec88c35418b8c630811cdf5afb19b2a1c4299 (patch)
tree2ebcc93b3ab5d0ab4cd3a9f583d7d727e07f3d07 /httemplate/elements/checkboxes-table.html
parent3fc0a546caf38b444b63744726c5080ce5d9bbbb (diff)
usability: customer tags with checkboxes instead of a select-multiple
Diffstat (limited to 'httemplate/elements/checkboxes-table.html')
-rw-r--r--httemplate/elements/checkboxes-table.html18
1 files changed, 9 insertions, 9 deletions
diff --git a/httemplate/elements/checkboxes-table.html b/httemplate/elements/checkboxes-table.html
index 671cd1f..d3bbab4 100644
--- a/httemplate/elements/checkboxes-table.html
+++ b/httemplate/elements/checkboxes-table.html
@@ -69,6 +69,7 @@
% 'select' => $opt{'target_table'}. '.*',
% 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )",
% 'extra_sql' => $extra_sql,
+% 'order_by' => $opt{'order_by'},
% })
% ) {
%
@@ -83,7 +84,11 @@
%
% } elsif ( !$sourcenum ) { # newly created object, has no links yet
%
-% $checked = $opt{'default'} ? 'CHECKED' : ''
+% if ( ref($opt{'default'}) ) {
+% $checked = $opt{'default'}->{$targetnum} ? 'CHECKED' : '';
+% } else {
+% $checked = $opt{'default'} ? 'CHECKED' : ''
+% }
%
% } else {
%
@@ -98,17 +103,12 @@
%
%
-
- <INPUT TYPE="checkbox" NAME="<% $target_pkey. $targetnum %>" <% $checked %> VALUE="ON">
+% my $color_col = $opt{'color_col'};
+ <INPUT TYPE="checkbox" NAME="<% $target_pkey. $targetnum %>" <% $checked %> VALUE="ON"><DIV STYLE="display:inline; background-color: #<% $color_col ? $target_obj->$color_col : '' %>">
% if ( $opt{'target_link'} ) {
-
-
<A HREF="<% $opt{'target_link'} %><% $targetnum %>">
-%
-%
% }
%
-<% $targetnum %>:
% if ( $opt{'name_callback'} ) {
@@ -118,7 +118,7 @@
%
- <% $target_obj->$name_col() %><% $opt{'target_link'} ? '</A>' : '' %>
+ <% $target_obj->$name_col() %></DIV><% $opt{'target_link'} ? '</A>' : '' %>
% }
% if ( $opt{'disable-able'} ) {