<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_profile_confirm_delete.jsp    1.3    03/08/11     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.forms.StorageProfileForm" %>
<!-- 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.profile.summary.crumb"/>
    </title>
</head>
<%@include file="/layout/bodytag.jsp"%>
<%@include file="/layout/top.jsp"%>
<%@include file="/layout/breadcrumb.jsp"%>

<html:form action="root.menu.item0.item3deleteconfirm.do">
<% try { %>
<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">
<% 
   StorageProfileForm form = (StorageProfileForm)session.getAttribute("storageProfile");
   List cantDelete = form.getCantDeleteInUse(); 
   List shouldDelete = form.getProfilesToDelete();
   boolean hasInUse = cantDelete != null && cantDelete.size() > 0;
   boolean allInUse = shouldDelete == null || shouldDelete.size() == 0; 
%>
<div class="content-layout">
<%@ include file="/layout/spacer.jsp"%>
<%@ include file="/layout/user_messages.jsp"%>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr width="100%">
       <td nowrap ><img alt border="0" src="images/general/dot.gif" width="1" height="7"></td>
    </tr>
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.profile.deleteconfirm.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 width="100%">
       <td nowrap ><img alt border="0" src="images/general/dot.gif" width="1" height="7"></td>
    </tr>
</table>
<table>

  <tr><td>
    <table border="0" cellspacing="0" cellpadding="2" align="left" bgcolor="#9999CC">
      <tr><td>
        <table cellspacing="0" cellpadding="5" border="0"  bgcolor="#FFFFFF">
          <tr>
            <td valign="top"><img src="./images/icons/warning_24.gif" width="24" height="24" alt="Warning" border="0"></td>
            <td><div class="error-message-header-text">
                  <bean:message key="storage.mgmt.profile.deleteconfirm.msg1"/>  
		</div>
            </td>
          </tr>
          <tr>
            <td ></td>
            <td><div class="error-message-header-text">
                  <bean:message key="storage.mgmt.profile.deleteconfirm.msg2"/> 
		</div>
            </td>
          </tr>
        </table>
      </td></tr>
    </table>
  </td></tr>
  <tr><td>
    <img src="/nsm/images/general/dot.gif" width="1" height="10" border="0">

  </td></tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td>
    <table>
    <tr>
    <td align="center" valign="middle">
       <table border="0" cellpadding="0" cellspacing="0" align="center">
          <tr>
             <td>
                <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                  <tr>
                     <td>
                        <table>
                          <tr>
                            <td align="center" valign="middle" nowrap>
                              <component:button text="storage.mgmt.profile.deleteconfirm.button" href="javascript:submitForm('deleteprofile')" title="storage.mgmt.profile.deleteconfirm.button" isEnabled="<%= !allInUse %>" />
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                 </table>
              </td>                 
           </tr>
        </table>
      </td>

      <td align="left" valign="middle">
         <table border="0" cellpadding="0" cellspacing="0">
           <tr>
             <td>
               <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                 <tr>
                    <td>
                      <table>
                        <tr>
                           <td align="center" valign="middle" nowrap>
                              <component:button text="button.cancel" href="javascript:submitForm('cancel');" title="button.cancel" isEnabled="true" />
                           </td>
                         </tr>
                       </table>
                    </td>
                 </tr>
               </table>
             </td>                 
           </tr>
         </table>
       </td>
     </tr>     
     </table>
     </td>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr width="100%">
       <td nowrap ><img alt border="0" src="images/general/dot.gif" width="1" height="7"></td>
    </tr>
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.profile.deleteconfirm.firsttableheader"/> 
              </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>
</table>


  <!-- Affected Profiles table -->
  <table cellpadding="20">
    <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" width="100%">
                   <tr class="header-row">
                     <td nowrap>
                       <div class="table-header-text">
                          <bean:message key="storage.mgmt.profile.duplicateconfirm.table.title" />
                       </div>
                     </td>
                     <td nowrap>
                       <div class="table-header-text">
                          <bean:message key="storage.mgmt.profile.duplicateconfirm.table.description" /> 
                       </div>
                     </td>
                  </tr>

                  <!-- end column header row -->
                  <!-- Begin affected profile listing-->
                  <% if (allInUse) { %>
                  <tr> 
                      <td colspan="2" align="left"> 
                        <div class="table-normal-text">
                          <bean:message key="storage.mgmt.profile.deleteconfirm.table.noaffectedprofiles"/>
         		</div>
                      </td>
                  </tr>
                  <% } else { %>
		  <logic:iterate id="profile" name="storageProfile" property="profilesToDelete" type="StorageProfile" indexId="index" >
                     <tr>
                        <td nowrap align="left">
                           <div class="table-normal-text">
                                <html:link href="root.menu.item0.item3profiledetails.do" paramId="profileName" paramName="profile" paramProperty="name">

                                  <bean:write name="profile" property="name"/>
                              </html:link>

                           </div>
                        </td>
                        <td nowrap>
                          <div class="table-normal-text">
                              <bean:write name="profile" property="description"/>
                          </div>
                        </td>
                     </tr>
                  </logic:iterate> 
                <% } %>
               </table>
             </td>
           </tr>
         </table>
       </td>
     </tr>
 </table>
  <!-- End of Affected Profile table -->

 <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr width="100%">
       <td nowrap ><img alt border="0" src="images/general/dot.gif" width="1" height="7"></td>
    </tr>
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.profile.deleteconfirm.secondtableheader"/> 
              </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>
</table>


  <!-- In Use Profiles table -->
  <table cellpadding="20">
    <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" width="100%">
                   <tr class="header-row">
                     <td nowrap>
                       <div class="table-header-text">
                          <bean:message key="storage.mgmt.profile.duplicateconfirm.table.title" />
                       </div>
                     </td>
                     <td nowrap>
                       <div class="table-header-text">
                          <bean:message key="storage.mgmt.profile.duplicateconfirm.table.description" /> 
                       </div>
                     </td>
                  </tr>

                  <!-- end column header row -->

                  <!-- Begin in use profile listing-->
		  <% if (!hasInUse) { %>
                  <tr> 
                      <td colspan="2" align="left" nowrap> 
                        <div class="table-normal-text">
                          <bean:message key="storage.mgmt.profile.deleteconfirm.table.noprofilesinuse"/>
                        </div>
                      </td>
                  </tr>
                  <% } else {%>
                  <logic:iterate id="profile" name="storageProfile" property="cantDeleteInUse" type="StorageProfile" indexId="index" >
                     <tr>
                        <td nowrap align="left">
                           <div class="table-normal-text">
                                <html:link href="root.menu.item0.item3profiledetails.do" paramId="profileName" paramName="profile" paramProperty="name">

                                  <bean:write name="profile" property="name"/>
                              </html:link>

                           </div>
                        </td>
                        <td nowrap>
                          <div class="table-normal-text">
                            <bean:write name="profile" property="description"/>
                          </div>
                        </td>
                     </tr>
                   </logic:iterate> 
                <% } %>
               </table>
             </td>
           </tr>
         </table>
       </td>
     </tr>
 </table>

</div>

<% } catch (Exception e) {Trace.verbose(this, "JSP Page", e);} %>
</html:form>

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