This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
var appel;
function generatepwd(id)
{
callback = {
success: function(o)
{
checkok=o.responseText;
if (checkok.charAt(0) != '1')
YAHOO.SUGAR.MessageBox.show({title: SUGAR.language.get("Users", "LBL_CANNOT_SEND_PASSWORD"), msg: checkok});
else
YAHOO.SUGAR.MessageBox.show({title: SUGAR.language.get("Users", "LBL_PASSWORD_SENT"), msg: SUGAR.language.get("Users", "LBL_NEW_USER_PASSWORD_2")} );
},
failure: function(o)
{
YAHOO.SUGAR.MessageBox.show({title: SUGAR.language.get("Users", "LBL_CANNOT_SEND_PASSWORD"), msg: SUGAR.language.get("app_strings", "LBL_AJAX_FAILURE")});
}
}
PostData = '&to_pdf=1&module=Users&action=GeneratePassword&userId='+id;
YAHOO.util.Connect.asyncRequest('POST', 'index.php', callback, PostData);
}
function set_return_user_and_save(popup_reply_data)
{
var form_name = popup_reply_data.form_name;
var name_to_value_array;
if(popup_reply_data.selection_list)
{
name_to_value_array = popup_reply_data.selection_list;
}else if(popup_reply_data.teams){
name_to_value_array = new Array();
for (var the_key in popup_reply_data.teams){
name_to_value_array.push(popup_reply_data.teams[the_key].team_id);
}
}else
{
name_to_value_array = popup_reply_data.name_to_value_array;
}
var query_array = new Array();
for (var the_key in name_to_value_array)
{
if(the_key == 'toJSON')
{
/* just ignore */
}
else
{
query_array.push("record[]="+name_to_value_array[the_key]);
}
}
query_array.push('user_id='+get_user_id(form_name));
query_array.push('action=AddUserToTeam');
query_array.push('module=Teams');
var query_string = query_array.join('&');
var returnstuff = http_fetch_sync('index.php',query_string);
document.location.reload(true);
}
function get_user_id(form_name)
{
return window.document.forms[form_name].elements['user_id'].value;
}
function user_status_display(field){
switch (field){
case 'RegularUser':
document.getElementById("calendar_options").style.display="";
document.getElementById("edit_tabs").style.display="";
document.getElementById("locale").style.display="";
document.getElementById("settings").style.display="";
document.getElementById("information").style.display="";
break;
case 'GroupUser':
document.getElementById("calendar_options").style.display="none";
document.getElementById("edit_tabs").style.display="none";
document.getElementById("locale").style.display="none";
document.getElementById("settings").style.display="none";
document.getElementById("information").style.display="none";
document.getElementById("email_options_link_type").style.display="none";
break;
case 'PortalUser':
document.getElementById("calendar_options").style.display="none";
document.getElementById("edit_tabs").style.display="none";
document.getElementById("locale").style.display="none";
document.getElementById("settings").style.display="none";
document.getElementById("information").style.display="none";
document.getElementById("email_options_link_type").style.display="none";
break;
}
}

View File

@@ -0,0 +1,187 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function password_confirmation() {
var new_pwd=document.getElementById('new_password').value;
var old_pwd=document.getElementById('old_password').value;
var confirm_pwd=document.getElementById('confirm_pwd');
if (confirm_pwd.value != new_pwd)
confirm_pwd.style.borderColor= 'red';
else
confirm_pwd.style.borderColor='';
if (confirm_pwd.value != (new_pwd.substring(0,confirm_pwd.value.length)))
document.getElementById('comfirm_pwd_match').style.display = 'inline';
else
document.getElementById('comfirm_pwd_match').style.display = 'none';
if (new_pwd != "" || confirm_pwd.value != "" || old_pwd !="" || (document.getElementById('page') && document.getElementById('page').value=="Change"))
document.getElementById('password_change').value = 'true';
else
document.getElementById('password_change').value = 'false';
}
function set_password(form,rules) {
if(form.password_change.value == 'true'){
if( rules=='1'){
alert(ERR_RULES_NOT_MET);
return false;
}
if (form.is_admin.value != 1 && (form.is_current_admin && form.is_current_admin.value != '1')&& form.old_password.value == "" ){
alert(ERR_ENTER_OLD_PASSWORD);
return false;
}
if (form.new_password.value == "" ) {
alert(ERR_ENTER_NEW_PASSWORD);
return false;
}
if (form.confirm_pwd.value == ""){
alert(ERR_ENTER_CONFIRMATION_PASSWORD);
return false;
}
if (form.new_password.value == form.confirm_pwd.value)
return true;
else{
alert(ERR_REENTER_PASSWORDS);
return false;
}
}
else
return true;
}
function newrules(minpwdlength,maxpwdlength,customregex){
var good_rules=0;
var passwd = document.getElementById('new_password').value;
// length
if(document.getElementById('lengths')){
var length =document.getElementById('new_password').value.length;
if((length < parseInt(minpwdlength) && parseInt(minpwdlength)>0) || (length > parseInt(maxpwdlength) && parseInt(maxpwdlength)>0 )){
document.getElementById('lengths').className='bad';
good_rules=1;
}
else{document.getElementById('lengths').className='good';}
}
// One lower case
if(document.getElementById('1lowcase')){
if(!passwd.match('[abcdefghijklmnopqrstuvwxyz]')){
document.getElementById('1lowcase').className='bad';
good_rules=1;
}
else{document.getElementById('1lowcase').className='good';}
}
// One upper case
if(document.getElementById('1upcase')){
if(!passwd.match('[ABCDEFGHIJKLMNOPQRSTUVWXYZ]')){
document.getElementById('1upcase').className='bad';
good_rules=1;
}
else{document.getElementById('1upcase').className='good';}
}
// One number
if(document.getElementById('1number')){
if(!passwd.match('[0123456789]')){
document.getElementById('1number').className='bad';
good_rules=1;
}
else{document.getElementById('1number').className='good';}
}
// One special character
if(document.getElementById('1special')){
var custom_regex= new RegExp('[|}{~!@#$%^&*()_+=-]');
if(!custom_regex.test(passwd)){
document.getElementById('1special').className='bad';
good_rules=1;
}
else{document.getElementById('1special').className='good';}
}
// Custom regex
if(document.getElementById('regex')){
var regex = new RegExp(customregex);
if(regex.test(passwd)){
document.getElementById('regex').className='bad';
good_rules=1;
}
else{document.getElementById('regex').className='good';}
}
return good_rules;
}
function set_focus() {
if (document.getElementById('error_pwd')){
if (document.forms.length > 0) {
for (i = 0; i < document.forms.length; i++) {
for (j = 0; j < document.forms[i].elements.length; j++) {
var field = document.forms[i].elements[j];
if ((field.type == "password") && (field.name == "old_password" )) {
field.focus();
if (field.type == "text") {
field.select();
}
break;
}
}
}
}
}
else{
if (document.forms.length > 0) {
for (i = 0; i < document.forms.length; i++) {
for (j = 0; j < document.forms[i].elements.length; j++) {
var field = document.forms[i].elements[j];
if ((field.type == "text" || field.type == "textarea" || field.type == "password") &&
!field.disabled && (field.name == "first_name" || field.name == "name" || field.name == "user_name" || field.name=="document_name")) {
field.focus();
if (field.type == "text") {
field.select();
}
break;
}
}
}
}
}
}

View File

@@ -0,0 +1,215 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
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;
}
}
}
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;
}
/* else if(inbox.value != '') {
doCheck = true;
}*/
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;
}
}
return true;
}
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';
}
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 = "";
}
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 = '';
}
}
function toggleAdv() {
var adv = document.getElementById("ie_adv");
if(adv.style.display == 'none') {
adv.style.display = "";
} else {
adv.style.display = 'none';
}
}
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;
}
bfound=1;
}
}
//add item to selection list.
if (bfound == 0) {
var newElement=document.createElement('option');
newElement.text=signature_name;
newElement.value=signature_id;
field.options.add(newElement);
newElement.selected=true;
}
//enable the edit button.
var field1=document.getElementById('edit_sig');
field1.style.visibility="visible";
}
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";
}
}
function open_email_signature_form(record, the_user_id) {
URL="index.php?module=Users&action=Popup";
if(record != "") {
URL += "&record="+record;
}
if(the_user_id != "") {
URL += "&the_user_id="+the_user_id;
}
windowName = 'email_signature';
windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
win = window.open(URL, windowName, windowFeatures);
if(window.focus) {
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
}
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 = "";
}
}

View File

@@ -0,0 +1,87 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function set_focus() {
if (document.DetailView.user_name.value != '') {
document.DetailView.user_password.focus();
document.DetailView.user_password.select();
}
else document.DetailView.user_name.focus();
}
function toggleDisplay(id){
if(this.document.getElementById(id).style.display=='none'){
this.document.getElementById(id).style.display='inline'
if(this.document.getElementById(id+"link") != undefined){
this.document.getElementById(id+"link").style.display='none';
}
document.getElementById(id+"_options").src = 'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=basic_search.gif';
}else{
this.document.getElementById(id).style.display='none'
if(this.document.getElementById(id+"link") != undefined){
this.document.getElementById(id+"link").style.display='inline';
}
document.getElementById(id+"_options").src = 'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=advanced_search.gif';
}
}
function generatepwd(){
document.getElementById('generate_pwd_button').value='Please Wait';
document.getElementById('generate_pwd_button').disabled =1;
document.getElementById('wait_pwd_generation').innerHTML = '<img src="themes/default/images/img_loading.gif" >';
var callback;
callback = {
success: function(o){
document.getElementById('generate_pwd_button').value=LBL_LOGIN_SUBMIT;
document.getElementById('generate_pwd_button').disabled =0;
document.getElementById('wait_pwd_generation').innerHTML = '';
checkok=o.responseText;
if (checkok.charAt(0) != '1')
document.getElementById('generate_success').innerHTML =checkok;
if (checkok.charAt((checkok.length)-1) == '1')
document.getElementById('generate_success').innerHTML =LBL_REQUEST_SUBMIT;
},
failure: function(o){
document.getElementById('generate_pwd_button').value= LBL_LOGIN_SUBMIT;
document.getElementById('generate_pwd_button').disabled =0;
document.getElementById('wait_pwd_generation').innerHTML = '';
alert(SUGAR.language.get('app_strings','LBL_AJAX_FAILURE'));
}
}
postData = '&to_pdf=1&module=Home&action=index&entryPoint=GeneratePassword&username='+document.getElementById("fp_user_name").value+'&user_email='+document.getElementById("fp_user_mail").value+'&link=1';
YAHOO.util.Connect.asyncRequest('POST', 'index.php', callback, postData);
}