<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_addvolume_tovolgrp.jsp    1.9    03/05/29     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<!-- locale stuff -->
<html:html locale="true">
<!-- end locale -->

<!-- Place Java Script Here -->

<!-- HTML -->
<head>
<%@include file="/layout/page_head_section.jsp"%>
    <title>
        <bean:message  key="storage.mgmt.volumes.addtogroup.header"/>
    </title>
</head>

<%@include file="/layout/bodytag.jsp"%>
<%@include file="/layout/top.jsp"%>
<%@include file="/layout/breadcrumb.jsp"%>
<%@include file="/layout/spacer.jsp"%>

<html:form action="/root.menu.item0.item4addvoltovg.do">

<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">
<input type="hidden" name="grouppath" value="volumeGroup">
<div class="content-layout">
<%@ include file="/layout/user_messages.jsp"%>
<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.volumes.addtogroup.header"/>             
              </div>
            </td>
            
            <td valign="bottom" width="99%">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td class="property-separator" valign="bottom"><img alt border="0" height="2" src="/images/general/dot.gif" width="1"></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>   
    <tr>
    <td colspan="2">
    <%
    VolumeForm form = (VolumeForm)session.getAttribute("volume");
    %>
    	<bean:message key="storage.mgmt.volumes.addtogroup.help" arg0="<%=form.getName()%>" />
    </td>
    </tr>
  </table> 

<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="5" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="middle">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                
                  <td><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>
                  <td>
                    <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                      <tr>
                        <td>
                          <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td align="center" valign="middle" nowrap>         
                                 <component:button text="button.addnowiz" href="javascript:submitForm('addtogroups');" title="button.addnowiz" isEnabled="true" />                                 
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>
                  <td>&nbsp;</td>
                  <td>
                    <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                      <tr>
                        <td>
                          <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td align="center" valign="middle" nowrap>         
                                 <component:button text="button.cancel" href="javascript:document.forms[0].action='root.menu.item0.item4edit.do';document.forms[0].submit();" title="button.cancel" isEnabled="true" />                                 
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>                
                </tr>
              </table>
             </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

      <table>          
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="100%">
                <tr>
                  <td>                                                                                          
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0">
                      <tr class="header-row">
                        <td align="center" valign="middle" nowrap>
			</td>                        
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.access.volume.groups.table.name"/>
                          </div>
                        </td>     
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.access.initiator.groups"/>
                          </div>
                        </td>                                                                                        
                      </tr>
                      <!-- Begin Volume groups row listing -->           
                      <logic:present name="volume" property="vgWrappers">         
 				 	    <logic:iterate id="vgW" name="volume" property="vgWrappers" type="VolumeGroupWrapper" indexId="index">

                          <tr>
                            <td >   
                              <div class="table-normal-text">      
                                <input type="radio" name="volumeGrpsToAdd" value="<bean:write name="vgW" property="volumeGroup.name"/>">
                              </div>
                            </td>   
                            <td>                                                         
				<%
                                  String encodedName =
                                    URLEncoder.encode(vgW.getVolumeGroup().getName());
				%>
                              <div class="table-normal-text">      
                                <a href="root.menu.item1.item0edit.do?name=<%=encodedName%>">
                                  <bean:write name="vgW" property="volumeGroup.name"/>
                                </a>
                              </div>
                            </td> 
                            <td>                         
                              <div class="table-normal-text">      
                                <logic:present name="vgW" property="assocInitiatorGroups">
                                  <% if(vgW.getAssocInitiatorGroups().size() > 0) {
                                  %>
                                  <a href="root.menu.item1.item0inigrpsforvg.do?grouppath=volumeGroup&name=<%=encodedName%>">
                                    <bean:message key="storage.access.volume.groups.show"/>
                                  </a>
                                  <% } else { %>
                                   --
                                  <% } %>
                                </logic:present>
                                <logic:notPresent name="vgW" property="assocInitiatorGroups">
                                  --
                                </logic:notPresent>
                              </div>                                                                      
                            </td>                                                                           
                         </tr>
                        </logic:iterate>
                      </logic:present>                                                         
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>      
</div>


</html:form>


</body>
</div>
</html:html> 
