projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git]
/
httemplate
/
search
/
elements
/
checkbox-foot.html
diff --git
a/httemplate/search/elements/checkbox-foot.html
b/httemplate/search/elements/checkbox-foot.html
index
cc4bac6
..
f33a874
100644
(file)
--- a/
httemplate/search/elements/checkbox-foot.html
+++ b/
httemplate/search/elements/checkbox-foot.html
@@
-4,13
+4,14
@@
html_foot => include('elements/checkbox-foot.html',
actions => [
{ label => 'Edit selected packages',
html_foot => include('elements/checkbox-foot.html',
actions => [
{ label => 'Edit selected packages',
-
action
=> 'popup_package_edit()',
+
onclick
=> 'popup_package_edit()',
},
{ submit => 'Delete selected packages',
confirm => 'Really delete these packages?'
},
],
filter => '.name = "pkgpart"', # see below
},
{ submit => 'Delete selected packages',
confirm => 'Really delete these packages?'
},
],
filter => '.name = "pkgpart"', # see below
+ minboxes => 2, #will remove checkboxes if there aren't at least this many
),
&>
),
&>
@@
-49,7
+50,7
@@
false.
<BR>
% foreach my $action (@$actions) {
% if ( $action->{onclick} ) {
<BR>
% foreach my $action (@$actions) {
% if ( $action->{onclick} ) {
-<INPUT TYPE="button" <% $action->{name} %> onclick="<% $
opt
{onclick} %>"\
+<INPUT TYPE="button" <% $action->{name} %> onclick="<% $
action->
{onclick} %>"\
VALUE="<% $action->{label} |h%>">
% } elsif ( $action->{submit} ) {
<INPUT TYPE="submit" <% $action->{name} %> <% $action->{confirm} %>\
VALUE="<% $action->{label} |h%>">
% } elsif ( $action->{submit} ) {
<INPUT TYPE="submit" <% $action->{name} %> <% $action->{confirm} %>\
@@
-67,6
+68,14
@@
for (var i = 0; i < inputs.length; i++) {
}
}
%# avoid the need for "$areboxes" late-evaluation hackery
}
}
%# avoid the need for "$areboxes" late-evaluation hackery
+% if ($opt{'minboxes'}) {
+if ( checkboxes.length < <% $opt{'minboxes'} %> ) {
+ for (i = 0; i < checkboxes.length; i++) {
+ checkboxes[i].parentNode.removeChild(checkboxes[i]);
+ }
+ checkboxes = [];
+}
+% }
if ( checkboxes.length == 0 ) {
document.getElementById('checkbox_footer').style.display = 'none';
}
if ( checkboxes.length == 0 ) {
document.getElementById('checkbox_footer').style.display = 'none';
}
@@
-75,6
+84,15
@@
function setAll(setTo) {
checkboxes[i].checked = setTo;
}
}
checkboxes[i].checked = setTo;
}
}
+function toCGIString() {
+ var out = '';
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked) {
+ out += '&' + checkboxes[i].name + '=' + checkboxes[i].value;
+ }
+ }
+ return out;
+}
</SCRIPT>
<%init>
my %opt = @_;
</SCRIPT>
<%init>
my %opt = @_;