[interchange-cvs] [SCM] Interchange branch, master, updated. 432924ade348d37a97732326b6a2532de789069d

Gert van der Spoel interchange-cvs at icdevgroup.org
Fri Jul 10 13:56:15 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange".

The branch, master has been updated
       via  432924ade348d37a97732326b6a2532de789069d (commit)
      from  1a6c18d8daf8bbf45c22101e5f71721fa978a991 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 432924ade348d37a97732326b6a2532de789069d
Author: Gert van der Spoel <ic at 3edge.com>
Date:   Fri Jul 10 15:53:53 2009 +0200

    Check/uncheck all in UI for customers/items
    
    http://rt.icdevgroup.org/Ticket/Display.html?id=16

-----------------------------------------------------------------------

Summary of changes and diff:
 dist/lib/UI/pages/admin/customer.html |   82 +++++++++++++++++++++++++++++++-
 dist/lib/UI/pages/admin/item.html     |   84 ++++++++++++++++++++++++++++++++-
 2 files changed, 164 insertions(+), 2 deletions(-)

diff --git a/dist/lib/UI/pages/admin/customer.html b/dist/lib/UI/pages/admin/customer.html
index efb929d..67e5242 100644
--- a/dist/lib/UI/pages/admin/customer.html
+++ b/dist/lib/UI/pages/admin/customer.html
@@ -277,7 +277,20 @@
 [search-list]
 <TR [item-alternate 2]class=rownorm[else]class=rowalt[/else][/item-alternate]>
 
-	<TD><INPUT TYPE=checkbox NAME=customer VALUE="[item-code]">
+	<TD><INPUT TYPE=checkbox NAME=customer VALUE="[item-code]"
+[item-calc]
+  my $string = '';
+  if(! $Scratch->{old_browser}) {
+    my $nm = 'checker[item-increment]';
+    push @els, qq{push_el('$nm', '[item-param status]');};
+    $string .= "id=$nm ";
+  }
+  return $string if $Scratch->{archive_nm} eq 'unarchive';
+  $string .= 'CHECKED' if q{[item-param status]} eq $Values->{checked_status};
+  return $string;
+[/item-calc]
+>
+
 [page href="@@MV_PAGE@@"
 	extra="title=[scratch active_nm]"
 	form="
@@ -378,6 +391,73 @@ so there's a full line across the page even if table cells are blank.
 
 [/search-region]
 
+[output name=""]
+
+[if !scratch old_browser]
+<script>
+	var stat_array = new Array;
+	function push_el (el, status) {
+		if(stat_array[status] == undefined) {
+			stat_array[status] = new Array;
+// alert('created ' + status + ' array');
+		}
+		var els = stat_array[status];
+		els[els.length] = el;
+	}
+
+	function checkType (type, cond) {
+		var other = false;
+		if(cond == undefined) 
+			cond = true;
+		if(cond != true) 
+			other = true;
+		if(stat_array == undefined) {
+			return;
+		}
+		var i;
+		var alerted;
+		for(i in stat_array) {
+// alert("checking status of " + i);
+			var els = stat_array[i];
+			for (var j = 0; j < els.length; j++) {
+				var el = document.getElementById(els[j]);
+				if(el != undefined) {
+					if( type == 'none' ) {
+						el.checked = false;
+					}
+					else {
+						if( type == 'all' ) {
+							el.checked = true;
+						}
+						else {
+							if(i == type)
+								el.checked = cond;
+							else
+								el.checked = other;
+						}
+					}
+				}
+			}
+			var image_dir = '[image dir-only=1 ui=1 secure="__UI_SECURE__"]';
+			var types = ['all', 'none'];
+			for(var i = 0; i < types.length; i++) {
+				var img = document.getElementById('img_check_' + types[i]);
+				if(img != undefined) 
+					img.src= image_dir + 'box_empty.gif';
+			}
+			var img = document.getElementById('img_check_' + type);
+			img.src= image_dir + 'box_checked.gif';
+		}
+	}
+	[calc]
+		return join "\n", @els, '';
+	[/calc]
+</script>
+			<A HREF="javascript:checkType('all')"><img id="img_check_all" src="__UI_IMG__box_empty.gif" border=0>[L]Check all[/L]</A>
+			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+			<A HREF="javascript:checkType('none')"><img id="img_check_none" src="__UI_IMG__box_empty.gif" border=0>[L]Uncheck all[/L]</A>
+[/if]
+
 [output name=bottom_of_form]
 </FORM>
 [output name=""]
diff --git a/dist/lib/UI/pages/admin/item.html b/dist/lib/UI/pages/admin/item.html
index c41d9fc..d123562 100644
--- a/dist/lib/UI/pages/admin/item.html
+++ b/dist/lib/UI/pages/admin/item.html
@@ -401,7 +401,19 @@ EOF
 [search-list]
 <tr class=[item-alternate 2]rowalt[else]rownorm[/else][/item-alternate]>
 
-<TD><INPUT TYPE=checkbox NAME=item_id VALUE="[item-code]"></TD><TD>[page href=__UI_BASE__/item_edit form="item_id=[item-code]"][item-code]</A></TD>
+<TD><INPUT TYPE=checkbox NAME=item_id VALUE="[item-code]"
+[item-calc]
+  my $string = '';
+  if(! $Scratch->{old_browser}) {
+    my $nm = 'checker[item-increment]';
+    push @els, qq{push_el('$nm', '[item-param status]');};
+    $string .= "id=$nm ";
+  }
+  return $string if $Scratch->{archive_nm} eq 'unarchive';
+  $string .= 'CHECKED' if q{[item-param status]} eq $Values->{checked_status};
+  return $string;
+[/item-calc]
+></TD><TD>[page href=__UI_BASE__/item_edit form="item_id=[item-code]"][item-code]</A></TD>
 [item-sub show_line]
 sub {
 	my $extra = shift;
@@ -540,6 +552,76 @@ mv_nextpage=@@MV_PAGE@@
 [/button]
 <INPUT TYPE=hidden NAME=mv_data_table VALUE="[cgi mv_data_table]">
 
+
+[output name=""]
+
+[if !scratch old_browser]
+<script>
+	var stat_array = new Array;
+	function push_el (el, status) {
+		if(stat_array[status] == undefined) {
+			stat_array[status] = new Array;
+// alert('created ' + status + ' array');
+		}
+		var els = stat_array[status];
+		els[els.length] = el;
+	}
+
+	function checkType (type, cond) {
+		var other = false;
+		if(cond == undefined) 
+			cond = true;
+		if(cond != true) 
+			other = true;
+		if(stat_array == undefined) {
+			return;
+		}
+		var i;
+		var alerted;
+		for(i in stat_array) {
+// alert("checking status of " + i);
+			var els = stat_array[i];
+			for (var j = 0; j < els.length; j++) {
+				var el = document.getElementById(els[j]);
+				if(el != undefined) {
+					if( type == 'none' ) {
+						el.checked = false;
+					}
+					else {
+						if( type == 'all' ) {
+							el.checked = true;
+						}
+						else {
+							if(i == type)
+								el.checked = cond;
+							else
+								el.checked = other;
+						}
+					}
+				}
+			}
+			var image_dir = '[image dir-only=1 ui=1 secure="__UI_SECURE__"]';
+			var types = ['all', 'none'];
+			for(var i = 0; i < types.length; i++) {
+				var img = document.getElementById('img_check_' + types[i]);
+				if(img != undefined) 
+					img.src= image_dir + 'box_empty.gif';
+			}
+			var img = document.getElementById('img_check_' + type);
+			img.src= image_dir + 'box_checked.gif';
+		}
+	}
+	[calc]
+		return join "\n", @els, '';
+	[/calc]
+</script>
+<br/>
+			<A HREF="javascript:checkType('all')"><img id="img_check_all" src="__UI_IMG__box_empty.gif" border=0>[L]Check all[/L]</A>
+			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+			<A HREF="javascript:checkType('none')"><img id="img_check_none" src="__UI_IMG__box_empty.gif" border=0>[L]Uncheck all[/L]</A>
+[/if]
+
+
 [output name="bottom_of_form"]
 </FORM>
 [output name=""]


hooks/post-receive
-- 
Interchange



More information about the interchange-cvs mailing list