Changeset 2116

Show
Ignore:
Timestamp:
04/26/08 16:19:02 (3 months ago)
Author:
bchoate
Message:

Fixed confirm dialog so that cancel prevents saving the role changes. BugId:79237

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-36/tmpl/cms/edit_role.tmpl

    r1309 r2116  
    119119        f.submit(); 
    120120    } 
     121    return false; 
    121122} 
    122123 
    123124function checkChanged() { 
    124  
    125 var orig_roleName = "<mt:var name="name" escape="html">"; 
    126 var roleName = getByID('name').value; 
    127 if(permsChanged == "yes") { 
    128     if(roleName == orig_roleName) { 
    129         doSubmitFormConfirm(document.role, 'save_role', '<__trans phrase="You have changed the privileges for this role. This will alter what it is that the users associated with this role will be able to do. If you prefer, you can save this role with a different name.  Otherwise, be aware of any changes to users with this role.">');  
     125    var orig_roleName = "<mt:var name="name" escape="html">"; 
     126    var roleName = getByID('name').value; 
     127    if(permsChanged == "yes") { 
     128        if(roleName == orig_roleName) { 
     129            return doSubmitFormConfirm(document.role, 'save_role', '<__trans phrase="You have changed the privileges for this role. This will alter what it is that the users associated with this role will be able to do. If you prefer, you can save this role with a different name.  Otherwise, be aware of any changes to users with this role.">');  
     130        } else { 
     131            doSubmitForm(document.role, 'save_role'); 
     132        } 
    130133    } else { 
    131134        doSubmitForm(document.role, 'save_role'); 
    132135    } 
    133 } else { 
    134     doSubmitForm(document.role, 'save_role'); 
    135 
     136    return false; 
    136137} 
    137138 
     
    353354    <button 
    354355    <mt:if name="id"> 
    355         onclick="checkChanged();" 
     356        onclick="return checkChanged();" 
    356357    </mt:if> 
    357358        type="submit"