|
From: <bri...@us...> - 2008-12-05 15:21:22
|
Revision: 903
http://equanda.svn.sourceforge.net/equanda/?rev=903&view=rev
Author: brian_reynolds
Date: 2008-12-05 15:21:00 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Add page level list, summary and print boxes.
Improve checkbox javascript.
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-05 14:01:32 UTC (rev 902)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-05 15:21:00 UTC (rev 903)
@@ -4,17 +4,20 @@
<legend>
- $!{page.Name}
+ $!{page.Name} |
#set ($readBox="${page.Name}_pageReadCheck")
#set ($writeBox="${page.Name}_pageWriteCheck")
+#set ($listBox="${page.Name}_pageListCheck")
+#set ($sumBox="${page.Name}_pageSumCheck")
+#set ($printBox="${page.Name}_pagePrintCheck")
<input t:id="${readBox}" name="${readBox}" value="${readBox}"
- onclick="eqHandlePageReadBox( ${readBox}, '$!{page.Name}', '_readCheck')" t:type="CheckBox"/>
+ onclick="eqHandlePageBox( ${readBox}, '$!{page.Name}', '_readCheck', '${writeBox}', ${listBox}, ${sumBox}, ${printBox} )" t:type="CheckBox"/>
<t:if test="roleName">
- <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Read} </t:label>
+ <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Read} | </t:label>
<t:parameter name="else">
- <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Visible} </t:label>
+ <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Visible} | </t:label>
</t:parameter>
</t:if>
@@ -24,6 +27,18 @@
<t:label for="${writeBox}"> ${dollar}{equanda-message:authAndConfig.label.Write} </t:label>
</t:if>
-->
+
+ <input t:id="${listBox}" name="${listBox}" value="${listBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_listCheck')" t:type="CheckBox"/>
+ <t:label for="${listBox}"> ${dollar}{equanda-message:authAndConfig.label.List} | </t:label>
+
+ <input t:id="${sumBox}" name="${sumBox}" value="${sumBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_sumCheck')" t:type="CheckBox"/>
+ <t:label for="${sumBox}"> ${dollar}{equanda-message:authAndConfig.label.Summary} | </t:label>
+
+ <input t:id="${printBox}" name="${printBox}" value="${printBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_printCheck')" t:type="CheckBox"/>
+ <t:label for="${printBox}"> ${dollar}{equanda-message:authAndConfig.label.Print} | </t:label>
</legend>
@@ -73,17 +88,20 @@
<div class="listCol">
<input t:id="${listBox}" name="${listBox}" value="${listBox}"
- onclick="eqEnableBoxes( ${readBox}, ${listBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${page.Name}_pageListCheck, ${readBox}, this, '$!{page.Name}', '_listCheck' )"
+ t:type="CheckBox"/>
</div>
<div class="summaryCol">
<input t:id="${summaryBox}" name="${summaryBox}" value="${summaryBox}"
- onclick="eqEnableBoxes( ${readBox}, ${summaryBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${page.Name}_pageSumCheck, ${readBox}, this, '$!{page.Name}', '_sumCheck' )"
+ t:type="CheckBox"/>
</div>
<div class="printCol">
<input t:id="${printBox}" name="${printBox}" value="${printBox}"
- onclick="eqEnableBoxes( ${readBox}, ${printBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${page.Name}_pagePrintCheck, ${readBox}, this, '$!{page.Name}', '_printCheck' )"
+ t:type="CheckBox"/>
</div>
</div>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-05 14:01:32 UTC (rev 902)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-05 15:21:00 UTC (rev 903)
@@ -116,10 +116,13 @@
return getIsGuiAdmin() && (getRoleName() != null);
}
- ## R/W checkboxes for every group Pages
+ ## RWLSP checkboxes for every page
#foreach( $page in $table.Pages )
#set ($readBox="${page.Name}_pageReadCheck")
#set ($writeBox="${page.Name}_pageWriteCheck")
+#set ($listBox="${page.Name}_pageListCheck")
+#set ($sumBox="${page.Name}_pageSumCheck")
+#set ($printBox="${page.Name}_pagePrintCheck")
@Persist
private boolean $readBox;
public boolean get$readBox(){ return $readBox; }
@@ -129,10 +132,25 @@
private boolean $writeBox;
public boolean get$writeBox(){ return $writeBox; }
public void set$writeBox( boolean val ){ this.$writeBox = val; }
+
+ @Persist
+ private boolean $listBox;
+ public boolean get$listBox(){ return $listBox; }
+ public void set$listBox( boolean val ){ this.$listBox = val; }
+
+ @Persist
+ private boolean $sumBox;
+ public boolean get$sumBox(){ return $sumBox; }
+ public void set$sumBox( boolean val ){ this.$sumBox = val; }
+
+ @Persist
+ private boolean $printBox;
+ public boolean get$printBox(){ return $printBox; }
+ public void set$printBox( boolean val ){ this.$printBox = val; }
#end
-## R/W checkboxes for every group Groups
+## R+W+L checkboxes for every group Groups
#foreach( $page in $table.Pages )
#foreach( $group in $page.Groups)
#set ($readBox="${group.Name}_groupReadCheck")
@@ -312,7 +330,8 @@
throws EquandaPersistenceException
{
AuthAndConfigProvider aacProvider = getAuthsForSelection();
-#foreach( $field in $table.Fields)
+#foreach( $page in $table.Pages)
+#foreach( $field in $page.Fields)
#set ($readBox="${field.Name}_readCheck")
#set ($writeBox="${field.Name}_writeCheck")
#set ($listBox="${field.Name}_listCheck")
@@ -323,7 +342,23 @@
set${listBox}( aacProvider.isDisplayList( "field.${table.Name}.${field.Name}" ) );
set${summaryBox}( aacProvider.isDisplaySummary( "field.${table.Name}.${field.Name}" ) );
set${printBox}( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) );
+#set ($pageReadBox="${page.Name}_pageReadCheck")
+#set ($pageWriteBox="${page.Name}_pageWriteCheck")
+#set ($pageListBox="${page.Name}_pageListCheck")
+#set ($pageSumBox="${page.Name}_pageSumCheck")
+#set ($pagePrintBox="${page.Name}_pagePrintCheck")
+ if( aacProvider.isReadable( "field.${table.Name}.${field.Name}" ) )
+ set${pageReadBox}( true );
+ if( aacProvider.isWritable( "field.${table.Name}.${field.Name}" ) )
+ set${pageWriteBox}( true );
+ if( aacProvider.isDisplayList( "field.${table.Name}.${field.Name}" ) )
+ set${pageListBox}( true );
+ if( aacProvider.isDisplaySummary( "field.${table.Name}.${field.Name}" ) )
+ set${pageSumBox}( true );
+ if( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) )
+ set${pagePrintBox}( true );
#end
+#end
#foreach( $select in $table.SelectsNotHidden)
#set ($selectBox="${select.Name}_selectCheck")
set${selectBox}( aacProvider.isReadable( "select.${table.Name}.${select.Name}" ) );
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js 2008-12-05 14:01:32 UTC (rev 902)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js 2008-12-05 15:21:00 UTC (rev 903)
@@ -60,11 +60,21 @@
{
var writeInput = $$( "input#" + writeBoxName );
if( writeInput.length != 0 )
- writeInput[ 0 ].checked = false;
+ {
+ if( writeInput[ 0 ].checked == true )
+ {
+ writeInput[ 0 ].click();
+ }
+ }
var deleteInput = $$( "input#" + deleteBoxName );
if( deleteInput.length != 0 )
- deleteInput[ 0 ].checked = false;
+ {
+ if( deleteInput[ 0 ].checked == true )
+ {
+ deleteInput[ 0 ].click();
+ }
+ }
}
if( trName != null )
@@ -81,7 +91,7 @@
/**
*
*/
-function eqHandlePageReadBox( pageReadBox, fieldSetId, inputId )
+function eqHandlePageBox( pageReadBox, fieldSetId, inputId, pageWriteCheckStr, pageListCheck, pageSummaryCheck, pagePrintCheck )
{
if( pageReadBox.checked == false )
{
@@ -89,17 +99,27 @@
{
// if pageCheck=true and is clicked again (thus firing this event),
// it enables all field boxes, and stay enabled.
+ pageReadBox.click();
setFieldChecks( true, fieldSetId, inputId );
- pageReadBox.checked = true;
}
else
{
// if any field boxes are already enabled, it should uncheck all field boxes
setFieldChecks( false, fieldSetId, inputId );
}
+
+ // set all page checks off
+ var pageWriteCheck = $$( 'fieldSet#' + fieldSetId + " input#" + pageWriteCheckStr );
+ if( pageWriteCheck.length != 0 )
+ {
+ pageWriteCheck[ 0 ].checked = false;
+ }
+
+ pageListCheck.checked = false;
+ pageSummaryCheck.checked = false;
+ pagePrintCheck.checked = false;
}
-
- if( pageReadBox.checked == true )
+ else if( pageReadBox.checked == true )
{
if( anyFieldsChecked( fieldSetId, inputId ) == false )
{
@@ -118,28 +138,53 @@
{
pageReadCheck.click();
}
-
- if( fieldReadCheck.checked == false )
+ else if( fieldReadCheck.checked == false )
{
var fieldWriteCheck = $$( 'fieldSet#' + fieldSetId + " input#" + fieldWriteCheckStr );
if( fieldWriteCheck.length != 0 )
{
- fieldWriteCheck[0].checked = false;
+ fieldWriteCheck[ 0 ].checked = false;
}
- fieldListCheck.checked=false;
- fieldSummaryCheck.checked=false;
- fieldPrintCheck.checked=false;
+ fieldListCheck.checked = false;
+ fieldSummaryCheck.checked = false;
+ fieldPrintCheck.checked = false;
if( anyFieldsChecked( fieldSetId, inputId ) == false )
- {
+ {
// all fields are off
if( pageReadCheck.checked == true )
{
pageReadCheck.click();
}
}
+ }
+}
+
+/**
+ *
+ */
+function eqHandleFieldBox( pageCheck, fieldReadCheck, fieldCheck, fieldSetId, inputId )
+{
+ // list implies read
+ if( fieldReadCheck.checked == false && fieldCheck.checked == true )
+ {
+ fieldReadCheck.click();
+ }
+
+ // if any fields are checked, the page needs to be checked
+ if( fieldCheck.checked == true && pageCheck.checked == false )
+ {
+ pageCheck.click();
+ }
+ // if all field checks are unchecked, then the page check should be off too.
+ if( fieldCheck.checked == false )
+ {
+ if( anyFieldsChecked( fieldSetId, inputId ) == false && pageCheck.checked == true)
+ {
+ pageCheck.click();
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|