]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Users/User.js
Release 6.5.0
[Github/sugarcrm.git] / modules / Users / User.js
1 /*********************************************************************************
2  * SugarCRM Community Edition is a customer relationship management program developed by
3  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Affero General Public License version 3 as published by the
7  * Free Software Foundation with the addition of the following permission added
8  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
9  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
10  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU Affero General Public License along with
18  * this program; if not, see http://www.gnu.org/licenses or write to the Free
19  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301 USA.
21  *
22  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
23  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
24  *
25  * The interactive user interfaces in modified source and object code versions
26  * of this program must display Appropriate Legal Notices, as required under
27  * Section 5 of the GNU Affero General Public License version 3.
28  *
29  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
30  * these Appropriate Legal Notices must retain the display of the "Powered by
31  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
32  * technical reasons, the Appropriate Legal Notices must display the words
33  * "Powered by SugarCRM".
34  ********************************************************************************/
35 function clearInboundSettings(){var url=document.getElementById('server_url');var user=document.getElementById('email_user');var prot=document.getElementById('protocol');var pass=document.getElementById('email_password');var port=document.getElementById('port');var inbox=document.getElementById('mailbox');url.value='';user.value='';pass.value='';port.value='';inbox.value='';for(i=0;i<prot.options.length;i++){if(prot.options[i].value==''){prot.options[i].selected=true;}}}
36 function checkInboundEmailSettings(){var url=document.getElementById('server_url');var user=document.getElementById('email_user');var prot=document.getElementById('protocol');var pass=document.getElementById('email_password');var port=document.getElementById('port');var inbox=document.getElementById('mailbox');var doCheck=false;var IEAlert=SUGAR.language.get('Users','ERR_IE_MISSING_REQUIRED');if(url.value!=''){doCheck=true;}else if(user.value!=''){doCheck=true;}else if(prot.value!=''){doCheck=true;}else if(pass.value!=''){doCheck=true;}else if(port.value!=''){doCheck=true;}
37 if(doCheck==true){if(url.value==''||url.value=='undefined'){alert(IEAlert);return false;}else if(user.value==''||user.value=='undefined'){alert(IEAlert);return false;}else if(prot.value==''||prot.value=='undefined'){alert(IEAlert);return false;}else if(pass.value==''||pass.value=='undefined'){alert(IEAlert);return false;}else if(port.value==''||port.value=='undefined'){alert(IEAlert);return false;}else if(inbox.value==''||inbox.value=='undefined'){alert(IEAlert);return false;}}
38 return true;}
39 function show_main(){var basic=document.getElementById('basic');basic.style.display="";var settings=document.getElementById('settings');settings.style.display="";var info=document.getElementById('information');info.style.display="";var address=document.getElementById('address');address.style.display="";var calendar_options=document.getElementById('calendar_options');calendar_options.style.display="";var edit_tabs=document.getElementById('edit_tabs');edit_tabs.style.display="";var email_options=document.getElementById('email_options');email_options.style.display='none';var email_inbound=document.getElementById('email_inbound');email_inbound.style.display='none';}
40 function show_email(){var basic=document.getElementById('basic');basic.style.display="none";var settings=document.getElementById('settings');settings.style.display="none";var info=document.getElementById('information');info.style.display="none";var address=document.getElementById('address');address.style.display="none";var calendar_options=document.getElementById('calendar_options');calendar_options.style.display="none";var edit_tabs=document.getElementById('edit_tabs');edit_tabs.style.display="none";var email_options=document.getElementById('email_options');email_options.style.display="";var email_inbound=document.getElementById('email_inbound');email_inbound.style.display="";}
41 function enable_change_password_button(){var butt=document.getElementById('change_password_button');if(document.EditView.record.value!=""&&document.EditView.record.value!='undefined'){butt.style.display='';}}
42 function refresh_signature_list(signature_id,signature_name){var field=document.getElementById('signature_id');var bfound=0;for(var i=0;i<field.options.length;i++){if(field.options[i].value==signature_id){if(field.options[i].selected==false){field.options[i].selected=true;}
43 bfound=1;}}
44 if(bfound==0){var newElement=document.createElement('option');newElement.text=signature_name;newElement.value=signature_id;field.options.add(newElement);newElement.selected=true;}
45 var field1=document.getElementById('edit_sig');field1.style.visibility="visible";}
46 function setSigEditButtonVisibility(){var field=document.getElementById('signature_id');var editButt=document.getElementById('edit_sig');if(field.value!=''){editButt.style.visibility="visible";}else{editButt.style.visibility="hidden";}}
47 function open_email_signature_form(record,the_user_id){URL="index.php?module=Users&action=Popup";if(record!=""){URL+="&record="+record;}
48 if(the_user_id!=""){URL+="&the_user_id="+the_user_id;}
49 windowName='email_signature';windowFeatures='width=800'+',height=600'+',resizable=1,scrollbars=1';win=window.open(URL,windowName,windowFeatures);if(window.focus){win.focus();}}
50 function setDefaultSigId(id){var checkbox=document.getElementById("signature_default");var default_sig=document.getElementById("signatureDefault");if(checkbox.checked){default_sig.value=id;}else{default_sig.value="";}}