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

47
modules/InboundEmail/Delete.php Executable file
View File

@@ -0,0 +1,47 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
global $mod_strings;
if(empty($_REQUEST['record'])) {
sugar_die($mod_strings['LBL_DELETE_ERROR']);
} else {
$focus = new InboundEmail();
$focus->mark_deleted($_REQUEST['record']);
header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']);
}
?>

View File

@@ -0,0 +1,248 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
* Created On: Oct 17, 2005
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): Chris Nojima
********************************************************************************/
-->
<!-- BEGIN: main -->
{MODULE_TITLE}
{ERROR}
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<form action="index.php" method="post" name="DetailView" id="form">
<input type="hidden" name="module" value="InboundEmail">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id">
<input title="{APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='InboundEmail'; this.form.return_action.value='EditView'; this.form.return_id.value='{ID}'; this.form.action.value='EditView'" type="submit" name="Edit" value=" {APP.LBL_EDIT_BUTTON_LABEL} ">
<input title="{APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='InboundEmail'; this.form.return_action.value='index'; this.form.isDuplicate.value=true; this.form.action.value='EditView'" type="submit" name="Duplicate" value=" {APP.LBL_DUPLICATE_BUTTON_LABEL} ">
<input title="{APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='InboundEmail'; this.form.return_action.value='ListView'; this.form.action.value='Delete'; return confirm('{APP.NTC_DELETE_CONFIRMATION}')" type="submit" name="Delete" value=" {APP.LBL_DELETE_BUTTON_LABEL} ">
</form>
</td>
</tr>
</table>
<div class="detail view">
<table width="100%" border=0 cellspacing="{GRIDLINE}" cellpadding="0">
<tr>
<th align="left" colspan="4"><h4>{MOD.LBL_BASIC}</h4></th>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_NAME}:</slot></td>
<td valign="top" width='30%'>
<slot>{NAME}&nbsp;</slot></td>
<td valign="top" scope='row'>
<slot>{MOD.LBL_STATUS}:</slot></td>
<td valign="top">
<slot>{STATUS}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope='row'>
<slot>{MOD.LBL_SERVER_URL}:</slot></td>
<td valign="top">
<slot>{SERVER_URL}&nbsp;</slot></td>
<td valign="top" scope='row'>
<slot>{MOD.LBL_LOGIN}:</slot></td>
<td valign="top">
<slot>{USER}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_SERVER_TYPE}:</slot></td>
<td valign="top" width='30%'>
<slot>{SERVER_TYPE}&nbsp;</slot></td>
<td valign="top" width='20%' scope='row'>
<slot>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>&nbsp;</slot>&nbsp;
</td>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_PORT}:</slot</td>
<td valign="top" width='30%'>
<slot>{PORT}&nbsp;</slot>&nbsp;
</td>
<td valign="top" scope='row'>
<slot>{MOD.LBL_MAILBOX}:</slot></td>
<td valign="top">
<slot>{MAILBOX}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_MAILBOX_SSL}:</slot></td>
<td valign="top" width='30%'>
<slot>{SSL}&nbsp;</slot></td>
<td valign="top" width='20%' scope='row'>
<slot><span style="{TRASH_SENT_FOLDER_STYLE}">{MOD.LBL_TRASH_FOLDER}:</span></slot></td>
<td valign="top" width='30%'>
<slot><span style="{TRASH_SENT_FOLDER_STYLE}">{TRASHFOLDER}&nbsp;</span></slot></td>
</tr>
<tr style="{TRASH_SENT_FOLDER_STYLE}">
<td valign="top" width='20%' scope='row'>
<slot>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>&nbsp;</slot>&nbsp;
</td>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_SENT_FOLDER}:</slot></td>
<td valign="top" width='30%'>
<slot>{SENTFOLDER}&nbsp;</slot>&nbsp;</td>
</tr>
</table>
<br>
<table width="100%" border=0 cellspacing="{GRIDLINE}" cellpadding="0">
<tr>
<th align="left" colspan="4"><h4>{MOD.LBL_SERVER_OPTIONS}</h4></th>
</tr>
<tr>
<td valign="top" scope='row'>
</td>
<td valign="top">
&nbsp;
</td>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_FROM_NAME}:&nbsp;</slot></td>
<td valign="top" width='30%'>
<slot>{FROM_NAME}&nbsp;</slot>&nbsp;
</td>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot><div style="{EDIT_GROUP_FOLDER_STYLE}">{MOD.LBL_ENABLE_AUTO_IMPORT}:</div>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot><div style="{EDIT_GROUP_FOLDER_STYLE}">{IS_AUTO_IMPORT_ENABLED}</div>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_FROM_ADDR}:&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>{FROM_ADDR}&nbsp;</slot>&nbsp;
</td>
</tr>
<tr>
<td valign="top" scope='row'>
<slot>{MOD.LBL_CREATE_CASE}:</slot></td>
<td valign="top">
<slot>{IS_CREATE_CASE}&nbsp;</slot></td>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_REPLY_TO_NAME}:&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>{REPLY_TO_NAME}</slot>&nbsp;
</td>
</tr>
<tr style="{CREATE_CASE_ROW_STYLE}">
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_DISTRIBUTION_METHOD}:&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>{DISTRIBUTION_METHOD}</slot>&nbsp;
</td>
<td valign="top" width='20%' scope='row'>
<slot>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>&nbsp;</slot>&nbsp;
</td>
</tr>
<tr style="{CREATE_CASE_ROW_STYLE}">
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE}:&nbsp;</slot>&nbsp;</td>
<td colspan="3" valign="top" width='30%'>
<slot>{CREATE_CASE_EMAIL_TEMPLATE}</slot>&nbsp;
</td>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>&nbsp;</slot>&nbsp;
</td>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_REPLY_TO_ADDR}:&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>{REPLY_TO_ADDR}</slot>&nbsp;
</td>
</tr>
<tr>
<td valign="top" scope='row'>
<slot>{MOD.LBL_AUTOREPLY}:</slot></td>
<td valign="top">
<slot>{EMAIL_TEMPLATE}&nbsp;</slot></td>
<td valign="top" width='20%' scope='row'>
<slot>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>&nbsp;</slot>&nbsp;
</td>
</tr>
<tr>
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_FILTER_DOMAIN}:</slot></td>
<td valign="top" width='30%'>
<slot>{FILTER_DOMAIN}&nbsp;</slot></td>
<td valign="top" width='20%' scope='row'>
<slot><div style="{EDIT_GROUP_FOLDER_STYLE}">{MOD.LBL_MAX_AUTO_REPLIES}:</div></slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot><div style="{EDIT_GROUP_FOLDER_STYLE}">{EMAIL_NUM_AUTOREPLIES_24_HOURS}</div></slot>&nbsp;
</td>
</tr>
<tr style="{LEAVEMESSAGESONMAILSERVER_STYLE}">
<td valign="top" width='20%' scope='row'>
<slot>{MOD.LBL_MARK_READ}:</slot></td>
<td valign="top" width='30%'>
<slot>{LEAVEMESSAGESONMAILSERVER}&nbsp;</slot></td>
<td valign="top" width='20%' scope='row'>
<slot>&nbsp;</slot>&nbsp;</td>
<td valign="top" width='30%'>
<slot>&nbsp;</slot>&nbsp;
</td>
</tr>
</table>
</div>
<!-- END: main -->

View File

@@ -0,0 +1,296 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
require_once('include/DetailView/DetailView.php');
require_once('include/SugarFolders/SugarFolders.php');
global $mod_strings;
global $app_strings;
global $sugar_config;
global $timedate;
global $theme;
/* start standard DetailView layout process */
$GLOBALS['log']->info("InboundEmails DetailView");
$focus = new InboundEmail();
$focus->retrieve($_REQUEST['record']);
if (empty($focus->id)) {
sugar_die($app_strings['ERROR_NO_RECORD']);
} // if
$focus->checkImap();
$detailView = new DetailView();
$offset=0;
/* end standard DetailView layout process */
$exServ = explode('::',$focus->service);
if($focus->delete_seen == 1) {
$delete_seen = $mod_strings['LBL_MARK_READ_NO'];
} else {
$delete_seen = $mod_strings['LBL_MARK_READ_YES'];
}
// deferred
//$r = $focus->db->query("SELECT id, name FROM queues WHERE owner_id = '".$focus->id."'");
//$a = $focus->db->fetchByAssoc($r);
//$queue = '<a href="index.php?module=Queues&action=EditView&record='.$a['id'].'">'.$a['name'].'</a>';
$groupName = '';
if($focus->group_id) {
//$group = new Group();
//$group->retrieve($focus->group_id);
//$groupName = $group->user_name;
}
if($focus->template_id) {
$et = new EmailTemplate();
$et->retrieve($focus->template_id);
$emailTemplate = $et->name;
} else {
$emailTemplate = $mod_strings['LBL_NONE'];
}
$ssl = $app_list_strings['dom_email_bool']['bool_false'];
$tls = $app_list_strings['dom_email_bool']['bool_false'];
$ca = $app_list_strings['dom_email_bool']['bool_false'];
if(!empty($focus->service)) {
// will always have 2 values: /tls || /notls and /validate-cert || /novalidate-cert
$exServ = explode('::', $focus->service);
if($exServ[0] == 'tls') {
$tls = $app_list_strings['dom_email_bool']['bool_true'];
}
if($exServ[1] == 'validate-cert') {
$cert = $app_list_strings['dom_email_bool']['bool_true'];
}
if(isset($exServ[2]) && !empty($exServ[2]) && $exServ[2] == 'ssl') {
$ssl = $app_list_strings['dom_email_bool']['bool_true'];
}
}
// FROM NAME FROM ADDRESS STRINGS
$email = new Email();
$from = $email->getSystemDefaultEmail();
$default_from_name = $from['name'];
$default_from_addr = $from['email'];
$from_name = '';
$from_addr = '';
$reply_to_name = '';
$reply_to_addr = '';
$distrib_method ='';
$filterDomain = '';
$trashFolder = '';
$sentFolder = '';
$distributionMethod = '';
$create_case_email_template='';
$create_case_email_template_name = $mod_strings['LBL_NONE'];
$leaveMessagesOnMailServer = $app_strings['LBL_EMAIL_NO'];
//$fromNameAddr = $fromName.' &lt;'.$from['email'].'&gt; <br><em>('.$mod_strings['LBL_SYSTEM_DEFAULT'].')</em>';
//$replyNameAddr = $mod_strings['LBL_SAME_AS_ABOVE'];
$onlySince = $mod_strings['LBL_ONLY_SINCE_NO'];
if(!empty($focus->stored_options)) {
// FROM NAME and Address
$storedOptions = unserialize(base64_decode($focus->stored_options));
$from_name = (isset($storedOptions['from_name']) ? $storedOptions['from_name'] : "");
$from_addr = (isset($storedOptions['from_addr']) ? $storedOptions['from_addr'] : "");
$reply_to_name = (isset($storedOptions['reply_to_name'])) ? $storedOptions['reply_to_name'] : "";
$reply_to_addr = (isset($storedOptions['reply_to_addr'])) ? $storedOptions['reply_to_addr'] : "";
// only-since option
if($storedOptions['only_since']) {
$onlySince = $mod_strings['LBL_ONLY_SINCE_YES'];
} else {
$onlySince = $mod_strings['LBL_ONLY_SINCE_NO'];
}
// filter-domain
if(isset($storedOptions['filter_domain']) && !empty($storedOptions['filter_domain'])) {
$filterDomain = $storedOptions['filter_domain'];
} else {
$filterDomain = $app_strings['NTC_NO_ITEMS_DISPLAY'];
}
// Trash Folder
if(isset($storedOptions['trashFolder']) && !empty($storedOptions['trashFolder'])) {
$trashFolder = $storedOptions['trashFolder'];
} else {
$trashFolder = $mod_strings['LBL_NONE'];
}
// Sent Folder
if(isset($storedOptions['sentFolder']) && !empty($storedOptions['sentFolder'])) {
$sentFolder = $storedOptions['sentFolder'];
} else {
$sentFolder = $mod_strings['LBL_NONE'];
}
if(!isset($storedOptions['leaveMessagesOnMailServer']) || $storedOptions['leaveMessagesOnMailServer'] == 1) {
$leaveMessagesOnMailServer = $app_strings['LBL_EMAIL_YES'];
} else {
$leaveMessagesOnMailServer = $app_strings['LBL_EMAIL_NO'];
} // else
if(!isset($storedOptions['leaveMessagesOnMailServer']) || $storedOptions['leaveMessagesOnMailServer'] == 1) {
$leaveMessagesOnMailServer = $app_strings['LBL_EMAIL_YES'];
} else {
$leaveMessagesOnMailServer = $app_strings['LBL_EMAIL_NO'];
} // else
$distrib_method = (isset($storedOptions['distrib_method'])) ? $storedOptions['distrib_method'] : "";
$create_case_email_template = (isset($storedOptions['create_case_email_template'])) ? $storedOptions['create_case_email_template'] : "";
$email_num_autoreplies_24_hours = (isset($storedOptions['email_num_autoreplies_24_hours'])) ? $storedOptions['email_num_autoreplies_24_hours'] : $focus->defaultEmailNumAutoreplies24Hours;
}
if(!empty($create_case_email_template)) {
$et = new EmailTemplate();
$et->retrieve($create_case_email_template);
$create_case_email_template_name = $et->name;
}
if (!empty($distrib_method)) {
$distributionMethod = $app_list_strings['dom_email_distribution_for_auto_create'][$distrib_method];
} // if
$xtpl = new XTemplate('modules/InboundEmail/DetailView.html');
//// ERRORS from Save
if(isset($_REQUEST['error'])) {
$xtpl->assign('ERROR', "<div class='error'>".$mod_strings['ERR_NO_OPTS_SAVED']."</div>");
}
//cma, June 24,2008 - Fix bug 21670. User status and group/personal statements are not localized.
$userStatus = $mod_strings['LBL_STATUS_ACTIVE'];
if('Inactive' == $focus->status) {
$userStatus = $mod_strings['LBL_STATUS_INACTIVE'];
}
$xtpl->assign('MODULE_TITLE', get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true));
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('CREATED_BY', $focus->created_by_name);
$xtpl->assign('MODIFIED_BY', $focus->modified_by_name);
$xtpl->assign('GRIDLINE', $gridline);
$xtpl->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
$xtpl->assign('ID', $focus->id);
$xtpl->assign('STATUS', $userStatus);
$xtpl->assign('SERVER_URL', $focus->server_url);
$xtpl->assign('USER', $focus->email_user);
$xtpl->assign('NAME', $focus->name);
$xtpl->assign('MAILBOX', $focus->mailbox);
$xtpl->assign('TRASHFOLDER', $trashFolder);
$xtpl->assign('SENTFOLDER', $sentFolder);
$protocol = filterInboundEmailPopSelection($app_list_strings['dom_email_server_type']);
$xtpl->assign('SERVER_TYPE', $protocol[$focus->protocol]);
$xtpl->assign('SSL', $ssl);
$xtpl->assign('TLS', $tls);
$xtpl->assign('CERT', $ca);
$xtpl->assign('MARK_READ', $delete_seen);
// deferred
//$xtpl->assign('QUEUE', $queue);
$createCaseRowStyle = "display:none";
$leaveMessagesOnMailServerStyle = "display:none";
if ($focus->is_personal) {
$xtpl->assign('EDIT_GROUP_FOLDER_STYLE', "display:none");
} else {
$is_auto_import = $app_list_strings['checkbox_dom']['2'];
if (!empty($focus->groupfolder_id)) {
$is_auto_import = $app_list_strings['checkbox_dom']['1'];
$leaveMessagesOnMailServerStyle = "display:''";
} // if
$xtpl->assign('IS_AUTO_IMPORT_ENABLED', $is_auto_import);
$xtpl->assign('EDIT_GROUP_FOLDER_STYLE', "display:''");
if ($focus->isMailBoxTypeCreateCase()) {
$createCaseRowStyle = "display:''";
}
}
$xtpl->assign('LEAVEMESSAGESONMAILSERVER_STYLE', $leaveMessagesOnMailServerStyle);
$xtpl->assign('LEAVEMESSAGESONMAILSERVER', $leaveMessagesOnMailServer);
$xtpl->assign('CREATE_CASE_ROW_STYLE', $createCaseRowStyle);
$xtpl->assign('DISTRIBUTION_METHOD', $distributionMethod);
$xtpl->assign('CREATE_CASE_EMAIL_TEMPLATE', $create_case_email_template_name);
if ($focus->isPop3Protocol()) {
$xtpl->assign('TRASH_SENT_FOLDER_STYLE', "display:none");
} else {
$xtpl->assign('TRASH_SENT_FOLDER_STYLE', "display:''");
} // else
$possibleAction = "pick";
if (!isset($app_list_strings['dom_mailbox_type'][$focus->mailbox_type])) {
$possibleAction = $app_list_strings['dom_mailbox_type']['pick'];
} else {
$possibleAction = $app_list_strings['dom_mailbox_type'][$focus->mailbox_type];
}
if($focus->mailbox_type == 'createcase')
$is_create_case = $app_list_strings['checkbox_dom']['1'];
else
$is_create_case = $app_list_strings['checkbox_dom']['2'];
$xtpl->assign('GROUP_NAME', $groupName);
$xtpl->assign('IS_CREATE_CASE', $is_create_case);
$xtpl->assign('EMAIL_TEMPLATE', $emailTemplate);
$xtpl->assign('FROM_NAME', $from_name);
$xtpl->assign('FROM_ADDR', $from_addr);
$xtpl->assign('DEFAULT_FROM_NAME', $default_from_name);
$xtpl->assign('DEFAULT_FROM_ADDR', $default_from_addr);
$xtpl->assign('REPLY_TO_NAME', $reply_to_name);
$xtpl->assign('REPLY_TO_ADDR', $reply_to_addr);
$xtpl->assign('ONLY_SINCE', $onlySince);
$xtpl->assign('FILTER_DOMAIN', $filterDomain);
$xtpl->assign('EMAIL_NUM_AUTOREPLIES_24_HOURS', $email_num_autoreplies_24_hours);
if(!empty($focus->port)) {
$xtpl->assign('PORT', $focus->port);
}
if($focus->handleIsPersonal()) {
$xtpl->assign('LBL_GROUP_QUEUE', $mod_strings['LBL_ASSIGN_TO_USER']);
} else {
$xtpl->assign('LBL_GROUP_QUEUE', $mod_strings['LBL_GROUP_QUEUE']);
}
//Overrides for bounce mailbox accounts
if ($focus->mailbox_type == 'bounce')
{
$xtpl->assign('MODULE_TITLE', get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_BOUNCE_MODULE_NAME'].": ".$focus->name, true));
}
else if( $focus->is_personal == '1')
$xtpl->assign('MODULE_TITLE', get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_PERSONAL_MODULE_NAME'].": ".$focus->name, true));
$xtpl->parse('main');
$xtpl->out('main');
?>

View File

@@ -0,0 +1,122 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
$_REQUEST['edit']='true';
require_once('include/SugarFolders/SugarFolders.php');
// GLOBALS
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $current_user;
global $sugar_config;
$ie = new InboundEmail();
$focus = new SugarFolder();
$javascript = new Javascript();
/* Start standard EditView setup logic */
if(isset($_REQUEST['record'])) {
$GLOBALS['log']->debug("In EditGroupFolder view, about to retrieve record: ".$_REQUEST['record']);
$result = $focus->retrieve($_REQUEST['record']);
if($result == null)
{
sugar_die($app_strings['ERROR_NO_RECORD']);
}
}
$GLOBALS['log']->info("SugarFolder Edit View");
/* End standard EditView setup logic */
// TEMPLATE ASSIGNMENTS
$smarty = new Sugar_Smarty();
// standard assigns
$smarty->assign('mod_strings', $mod_strings);
$smarty->assign('app_strings', $app_strings);
$smarty->assign('theme', $theme);
$smarty->assign('jsCustomVersion', $sugar_config['js_custom_version']);
$smarty->assign('sugar_version', $sugar_version);
$smarty->assign('GRIDLINE', $gridline);
$smarty->assign('MODULE', 'InboundEmail');
$smarty->assign('RETURN_MODULE', 'InboundEmail');
$smarty->assign('RETURN_ID', $focus->id);
$smarty->assign('RETURN_ACTION', "");
$smarty->assign('ID', $focus->id);
// module specific
$ret = $focus->getFoldersForSettings($current_user);
$groupFolders = Array();
$groupFoldersOrig = array();
foreach($ret['groupFolders'] as $key => $value) {
if(!empty($focus->id)) {
if ($value['id'] == $focus->id) {
continue;
}
} // if
$groupFolders[$value['id']] = $value['name'];
$groupFoldersOrig[] = $value['origName'];
} // foreach
$groupFolderName = "";
$addToGroupFolder = "";
$createGroupFolderStyle = "display:''";
$editGroupFolderStyle = "display:''";
if(!empty($focus->id)) {
$groupFolderName = $focus->name;
}
if(!empty($focus->id)) {
$addToGroupFolder = $focus->parent_folder;
}
if(!empty($focus->id)) {
$createGroupFolderStyle = "display:none;";
} else {
$editGroupFolderStyle = "display:none;";
} // else
$smarty->assign('createGroupFolderStyle', $createGroupFolderStyle);
$smarty->assign('editGroupFolderStyle', $editGroupFolderStyle);
$smarty->assign('groupFolderName', $groupFolderName);
$json = getJSONobj();
$smarty->assign('group_folder_array', $json->encode($groupFoldersOrig));
$smarty->assign('group_folder_options', get_select_options_with_id($groupFolders, $addToGroupFolder));
$smarty->assign('CSS',SugarThemeRegistry::current()->getCSS());
$smarty->assign('languageStrings', '<script type="text/javascript" src="' . $GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $GLOBALS['current_language'] . '.js?s=' . $GLOBALS['js_version_key'] . '&c=' . $GLOBALS['sugar_config']['js_custom_version'] . '&j=' . $GLOBALS['sugar_config']['js_lang_version'] . '"></script>');
echo $smarty->fetch("modules/Emails/templates/_createGroupFolder.tpl");
?>

View File

@@ -0,0 +1,559 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
* Created On: Oct 17, 2005
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): Chris Nojima
********************************************************************************/
-->
<div id="testSettingsDiv"></div>
<div id="selectFoldersDiv"></div>
<!-- BEGIN: main -->
{MODULE_TITLE}
{ERROR_STRING}
<script type='text/javascript' src='include/javascript/sugar_grp_overlib.js'></script>
<form action="index.php" method="post" name="EditView" id="EditView">
<input type="hidden" name="module" value="{MODULE}">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="group_id" value="{GROUP_ID}">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id">
<input type="hidden" name="personal" value="{PERSONAL}">
<input type="hidden" name="searchField" value="">
<input type="hidden" id="mailbox_type" name="mailbox_type" value="{MAILBOX_TYPE}">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save'; {CHOOSER_SCRIPT} this.form.return_id.value='{RETURN_ID}'; return checkformdata()" type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " {IE_DISABLED}>
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
<input title="{MOD.LBL_TEST_BUTTON_TITLE}"
type='button'
accessKey="{MOD.LBL_TEST_BUTTON_KEY}"
class="button"
onClick='ie_test_open_popup_with_submit("InboundEmail", "Popup", "Popup", 400, 300, trim(this.form.server_url.value), this.form.protocol.value, trim(this.form.port.value), trim(this.form.email_user.value), Rot13.write(this.form.email_password.value), trim(this.form.mailbox.value), this.form.ssl.checked, this.form.personal.value, "EditView");'
name="button" value=" {MOD.LBL_TEST_SETTINGS} " {IE_DISABLED}>
</td>
<td align="right" width="20%" NOWRAP><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
<div class="edit view">
<table width="100%" border=0 cellspacing="{GRIDLINE}" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="1"><h4>{MOD.LBL_BASIC}</h4></th>
</tr>
<tr>
<td>&nbsp;</td>
<td style="vertical-align:bottom;"><a href="javascript:void(0);" onclick="javascript:prefillGmailDefaults();">{APP.LBL_EMAIL_ACCOUNTS_GMAIL_DEFAULTS}</a>&nbsp;</td>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_NAME}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input name='name' tabindex='10' size='30' maxlength='255' type="text" value="{NAME}" {IE_DISABLED}></slot></td>
<td valign="top" scope="row">
<slot>{MOD.LBL_STATUS}:&nbsp;</slot></td>
<td valign="top" width="35%"><slot>
<select name='status' tabindex='60' {IE_DISABLED}>{STATUS}</select></slot></td>
</tr>
<tr>
<td valign="top" scope="row">
<slot>{MOD.LBL_SERVER_URL}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input id='server_url' name='server_url' tabindex='20' size='30' maxlength='100' type="text" value="{SERVER_URL}" {IE_DISABLED}></slot></td>
<td valign="top" scope="row">
<slot>{MOD.LBL_LOGIN}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input name='email_user' tabindex='70' size='30' maxlength='100' type="text" value="{USER}" autocomplete="off" {IE_DISABLED}></slot></td>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_SERVER_TYPE}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot>
<select name='protocol' id="protocol" tabindex='30' onchange="toggle_monitored_folder(this); setPortDefault();" {IE_DISABLED}>{PROTOCOL}</select></slot></td>
<td valign="top" scope="row">
<slot>{MOD.LBL_PASSWORD}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input name='email_password' tabindex='80' size='30' maxlength='100' type="password" value="{PASSWORD}" autocomplete="off" {IE_DISABLED}></slot></td>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_PORT}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot>
<input name='port' id='port' tabindex="40" value="{PORT}" size='10' {IE_DISABLED}>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot><span id="label_inbox" >{MOD.LBL_MAILBOX}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input id="mailbox" name='mailbox' tabindex='90' size='30' maxlength='500' type="text" value="{MAILBOX}">
<input type="button" id="subscribeFolderButton" style="display:none;" class="button" onclick='javascript:getFoldersListForInboundAccount("InboundEmail", "ShowInboundFoldersList", "Popup", 400, 300, this.form.server_url.value, this.form.protocol.value, this.form.port.value, this.form.email_user.value, Rot13.write(this.form.email_password.value), this.form.mailbox.value, this.form.ssl.checked, this.form.personal.value, this.form.searchField.value, "EditView");' value="{MOD.LBL_SELECT}">
</slot></td>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot><span>{MOD.LBL_SSL}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_SSL_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot>
</td>
<td valign="top" width="35%">
<slot>
<input name='ssl' id='ssl' tabindex='45' {CERT} value='1' type='checkbox' {SSL} onClick="setPortDefault();" {IE_DISABLED}>
</slot>
</td>
<td id="trashFolderRow" valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_TRASH_FOLDER}:
<span name="trashRequiredSpan" id="trashRequiredSpan" class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td id="trashFolderRow1" valign="top" width="35%">
<slot>
<input name='trashFolder' id='trashFolder' tabindex="92" value="{TRASHFOLDER}" size='30' maxlength='100' type="text">
<input type="button" id="trashFolderButton" class="button" onclick='javascript:getFoldersListForInboundAccount("InboundEmail", "ShowInboundFoldersList", "Popup", 400, 300, this.form.server_url.value, this.form.protocol.value, this.form.port.value, this.form.email_user.value, Rot13.write(this.form.email_password.value), this.form.trashFolder.value, this.form.ssl.checked, this.form.personal.value, "trash", "EditView");' value="{MOD.LBL_SELECT}">
</tr>
<tr id="sentFolderRow">
<td valign="top" scope="row">
<slot>&nbsp;</slot></td>
<td valign="top" width="35%"><slot>
&nbsp;</slot></td>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_SENT_FOLDER}:</slot></td>
<td valign="top" width="35%">
<slot><input id="sentFolder" name='sentFolder' tabindex='95' size='30' maxlength='100' type="text" value="{SENTFOLDER}">
<input type="button" id="sentFolderButton" class="button" onclick='javascript:getFoldersListForInboundAccount("InboundEmail", "ShowInboundFoldersList", "Popup", 400, 300, this.form.server_url.value, this.form.protocol.value, this.form.port.value, this.form.email_user.value, Rot13.write(this.form.email_password.value), this.form.sentFolder.value, this.form.ssl.checked, this.form.personal.value, "sent", "EditView");' value="{MOD.LBL_SELECT}">
</slot>
</td>
</tr>
</table>
</div>
<div class="edit view">
<table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4"><h4>{EMAIL_OPTIONS}</h4></th>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>
&nbsp;</slot></td>
<td valign="top" width="35%">
<slot>
&nbsp;</slot></td>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_FROM_NAME}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input tabindex="300" name="from_name" id="from_name" value="{FROM_NAME}" {IE_DISABLED}>&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot><span style="{AUTO_IMPORT_STYLE}">{MOD.LBL_ENABLE_AUTO_IMPORT}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_ASSIGN_TO_GROUP_FOLDER_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot>&nbsp;
</td>
<td valign="top" width="15%" NOWRAP>
<input name='is_auto_import' style="{AUTO_IMPORT_STYLE}" id='is_auto_import' onclick="showWarningsIfChaningAutoImport();"tabindex='45' type='checkbox' {IS_AUTO_IMPORT}>
</td>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot>{MOD.LBL_FROM_ADDR}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
<td valign="top" width="35%">
<slot><input tabindex="310" name="from_addr" id="from_addr" value="{FROM_ADDR}" {IE_DISABLED}></slot></td>
</tr>
<tr>
<td valign="top" scope="row">
<slot style="{MAILBOX_TYPE_STYLE}">{MOD.LBL_CREATE_CASE}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_CREATE_CASE_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
<td valign="top" width="35%"><slot style="{MAILBOX_TYPE_STYLE}">
<input name='is_create_case' id='is_create_case' onclick="showCreateCaseRow();"tabindex='45' type='checkbox' {IS_CREATE_CASE} {IE_DISABLED}></slot></td>
<td valign="top" scope="row" width="15%" NOWRAP>
{MOD.LBL_REPLY_TO_NAME}:&nbsp;
</td>
<td valign="top" width="35%">
<input tabindex="320" name="reply_to_name" value="{REPLY_TO_NAME}" {IE_DISABLED}>
</td>
</tr>
<tr id="createCaseRow" style="{CREATE_CASE_ROW_STYLE}">
<td valign="top" scope="row">
<slot>{MOD.LBL_DISTRIBUTION_METHOD}:&nbsp;</slot></td>
<td valign="top" width="35%"><slot>
<select name='distrib_method' tabindex='241'>{DISTRIBUTION_METHOD}</select></slot></td>
<td valign="top" scope="row">
<slot>&nbsp;</slot></td>
<td valign="top" width="35%"><slot>
&nbsp;</slot></td>
</tr>
<tr id="createCaseRow1" style="{CREATE_CASE_ROW_STYLE}">
<td valign="top" scope="row" width="15%" NOWRAP >
<slot>{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
<td colspan="3" valign="top" width="35%">
<slot>
<select tabindex='330' id="create_case_template_id" name='create_case_template_id' onchange="show_edit_template_link(this, 'create_case_edit_template');" {IE_DISABLED}>{CREATE_CASE_EMAIL_TEMPLATE_OPTIONS}</select>
<input type="button" class="button" onclick="javascript:open_email_template_form('create_case_template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
<input type="button" class="button" name='create_case_edit_template' id='create_case_edit_template' style="{CREATE_CASE_EDIT_TEMPLATE}" onclick="javascript:edit_email_template_form('create_case_template_id')" value="{MOD.LBL_EDIT_TEMPLATE}">
</slot>
</td>
</tr>
<tr>
<td valign="top" scope="row">
<slot>&nbsp;</slot></td>
<td valign="top" width="35%"><slot>
&nbsp;</slot></td>
<td valign="top" scope="row" width="15%" NOWRAP>
{MOD.LBL_REPLY_TO_ADDR}:&nbsp;
</td>
<td valign="top" width="35%">
<input tabindex="340" name="reply_to_addr" value="{REPLY_TO_ADDR}" {IE_DISABLED}>&nbsp;
</td>
</tr>
<tr>
<td valign="top" scope="row" width="15%" NOWRAP>
<slot style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_AUTOREPLY}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_AUTOREPLY_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
<td colspan="3" valign="top" width="35%">
<slot style="{CREATE_GROUP_FOLDER_STYLE}">
<select tabindex='251' id="template_id" name='template_id' onchange="show_edit_template_link(this, 'edit_template');" {IE_DISABLED}>{EMAIL_TEMPLATE_OPTIONS}</select>
<input type="button" class="button" onclick="javascript:open_email_template_form('template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
<input type="button" value="{MOD.LBL_EDIT_TEMPLATE}" class="button" onclick="javascript:edit_email_template_form('template_id')" name='edit_template' id='edit_template' style="{EDIT_TEMPLATE}">
</slot>
</td>
</tr>
<tr>
<td valign="top" scope="row" width="18%" NOWRAP>
<slot style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_FILTER_DOMAIN}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_FILTER_DOMAIN_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
<td valign="top" width="35%">
<slot style="{CREATE_GROUP_FOLDER_STYLE}"><input tabindex="270" name="filter_domain" value="{FILTER_DOMAIN}" {IE_DISABLED}></slot></td>
<td valign="top" scope="row">
<slot><span style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_MAX_AUTO_REPLIES}:&nbsp;<span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_MAX_AUTO_REPLIES_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot></td>
<td valign="top" width="35%">
<slot><input tabindex="271" style="{CREATE_GROUP_FOLDER_STYLE}" name="email_num_autoreplies_24_hours" value="{EMAIL_NUM_AUTOREPLIES_24_HOURS}"></slot></td>
</tr>
<tr id = "leaveMessagesOnMailServerRow" style="{LEAVEMESSAGESONMAILSERVER_STYLE}">
<td valign="top" scope="row" width='20%'>
<slot>{MOD.LBL_MARK_READ}:</slot></td>
<td valign="top" width='30%'>
<select name='leaveMessagesOnMailServer' tabindex='253'>{LEAVEMESSAGESONMAILSERVER}</select></td>
<td valign="top" scope="row">
<slot>&nbsp;</slot></td>
<td valign="top" width="35%"><slot>
&nbsp;</slot></td>
</tr>
</table>
</div>
</form>
<script type="text/javascript" lang="Javascript" src="modules/InboundEmail/InboundEmail.js"></script>
<script type="text/javascript">
var fieldToSetValue = '';
function checkformdata() {
return (check_form('EditView') && checkOtherFields() && checkTrashFolder() );
}
function prefillGmailDefaults(){
document.getElementById('server_url').value = "imap.gmail.com";
document.getElementById('ssl').checked = true;
document.getElementById('protocol').value = "imap";
toggle_monitored_folder(document.getElementById('protocol'));
setPortDefault();
}
function checkOtherFields() {
var from_name = document.getElementById('from_name').value;
var from_addr = document.getElementById('from_addr').value;
if (trim(from_name) == '' || trim(from_addr) == '') {
requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
if (trim(from_name) == '') {
add_error_style('EditView', 'from_name', requiredTxt + " From Name");
} // if
if (trim(from_addr) == '') {
add_error_style('EditView', 'from_addr', requiredTxt + " From Address");
} // if
return false;
} else {
return true;
} // else
} // fn
function checkTrashFolder() {
var field1=document.getElementById('protocol');
if (field1.value == 'imap') {
var trashFolderValue = document.getElementById("trashFolder").value;
if (trim(trashFolderValue).length <= 0) {
requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
add_error_style('EditView', 'trashFolder', requiredTxt + " Trash Folder");
return false;
} else {
return true;
}
} else {
return true;
} // else
} // fn
function showCreateCaseRow() {
var createCaseRow = document.getElementById('createCaseRow');
var createCaseRow1 = document.getElementById('createCaseRow1');
var isCreateCase = document.getElementById('is_create_case').checked;
var autoImportEl = document.getElementById('is_auto_import');
if (isCreateCase) {
createCaseRow.style.display = '';
createCaseRow1.style.display = '';
autoImportEl.checked = true;
} else {
createCaseRow.style.display = 'none';
createCaseRow1.style.display = 'none';
possibleActionChange();
} // else
} // fn
function possibleActionChange() {
var maliBoxType = document.getElementById('mailbox_type');
var trashRequiredSpan = document.getElementById('trashRequiredSpan');
if(maliBoxType.value == 'bounce') {
trashRequiredSpan.style.display = 'none';
trashRequiredSpan.style.display = 'none';
} else {
trashRequiredSpan.style.display = '';
trashRequiredSpan.style.display = '';
} // else
}
function show_edit_template_link(field, editTemplate) {
var field1=document.getElementById(editTemplate);
if (field.selectedIndex == 0) {
field1.style.visibility="hidden";
}
else {
field1.style.visibility="visible";
}
}
function refresh_email_template_list(template_id, template_name) {
var field=document.getElementById(fieldToSetValue);
var bfound=0;
for (var i=0; i < field.options.length; i++) {
if (field.options[i].value == template_id) {
if (field.options[i].selected==false) {
field.options[i].selected=true;
}
field.options[i].text = template_name;
bfound=1;
}
}
//add item to selection list.
if (bfound == 0) {
var newElement=document.createElement('option');
newElement.text=template_name;
newElement.value=template_id;
field.options.add(newElement);
newElement.selected=true;
}
//enable the edit button.
var editButtonName = 'edit_template';
if (fieldToSetValue == 'create_case_template_id') {
editButtonName = 'create_case_edit_template';
} // if
var field1=document.getElementById(editButtonName);
field1.style.visibility="visible";
var applyListToTemplateField = 'template_id';
if (fieldToSetValue == 'template_id') {
applyListToTemplateField = 'create_case_template_id';
} // if
var field=document.getElementById(applyListToTemplateField);
if (bfound == 1) {
for (var i=0; i < field.options.length; i++) {
if (field.options[i].value == template_id) {
field.options[i].text = template_name;
} // if
} // for
} else {
var newElement=document.createElement('option');
newElement.text=template_name;
newElement.value=template_id;
field.options.add(newElement);
} // else
}
function open_email_template_form(fieldToSet) {
fieldToSetValue = fieldToSet;
URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
windowName = 'email_template';
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 edit_email_template_form(templateField) {
fieldToSetValue = templateField;
var field=document.getElementById(templateField);
URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
if (field.options[field.selectedIndex].value != 'undefined') {
URL+="&record="+field.options[field.selectedIndex].value;
}
windowName = 'email_template';
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 open_group_folder_form() {
URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
windowName = 'group_folder_popup_window';
windowFeatures = 'width=400' + ',height=300' + ',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 edit_group_folder_form() {
URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
var field=document.getElementById('group_folder_id');
if (field.options[field.selectedIndex].value != 'undefined') {
URL+="&record="+field.options[field.selectedIndex].value;
}
windowName = 'edit_group_folder_popup_window';
windowFeatures = 'width=400' + ',height=300' + ',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 refresh_group_folder_list(groupFolder_id, groupFolder_name) {
var field=document.getElementById('group_folder_id');
var bfound=0;
for (var i=0; i < field.options.length; i++) {
if (field.options[i].value == groupFolder_id) {
if (field.options[i].selected==false) {
field.options[i].selected=true;
}
field.options[i].text = groupFolder_name;
bfound=1;
}
}
//add item to selection list.
if (bfound == 0) {
var newElement=document.createElement('option');
newElement.text=groupFolder_name;
newElement.value=groupFolder_id;
field.options.add(newElement);
newElement.selected=true;
}
//enable the edit button.
var field1=document.getElementById('edit_group');
field1.style.visibility="visible";
showCreateCaseRow();
showHideLeaveMessagesOnMailServer();
}
function show_edit_group_folder_link(field) {
var field1=document.getElementById('edit_group');
if (field.selectedIndex == 0) {
}
else {
field1.style.visibility="visible";
}
showCreateCaseRow();
showHideLeaveMessagesOnMailServer();
}
function showHideLeaveMessagesOnMailServer() {
var field=document.getElementById('group_folder_id');
var leaveMessagesOnMailServerRow = document.getElementById('leaveMessagesOnMailServerRow');
if (field.selectedIndex == 0) {
leaveMessagesOnMailServerRow.style.display="none";
}
else {
leaveMessagesOnMailServerRow.style.display='';
}
} // fn
function showWarningsIfChaningAutoImport() {
var isAutoImportOn = document.getElementById('is_auto_import').checked;
var isCreateCase = document.getElementById('is_create_case').checked
var record = document.forms['EditView'].record.value;
//Alert if changing for an existing record only.
if(record != '')
alert(warningForAutoChange);
//If the user has create case enabled then auto import must be on.
if( !isAutoImportOn && isCreateCase)
{
document.getElementById('is_auto_import').checked = true;
alert(warningForAutoChangeWithCreateCase);
}
}
toggle_monitored_folder(document.getElementById('protocol'));
setPortDefault();
possibleActionChange();
var warningForAutoChange = '{MOD.LBL_WARNING_CHANGING_AUTO_IMPORT}';
var warningForAutoChangeWithCreateCase = '{MOD.LBL_WARNING_CHANGING_AUTO_IMPORT_WITH_CREATE_CASE}';
</script>
{JAVASCRIPT}
<!-- END: main -->

363
modules/InboundEmail/EditView.php Executable file
View File

@@ -0,0 +1,363 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
$_REQUEST['edit']='true';
require_once('include/SugarFolders/SugarFolders.php');
require_once('include/templates/TemplateGroupChooser.php');
// GLOBALS
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $current_user;
$focus = new InboundEmail();
$focus->checkImap();
$javascript = new Javascript();
$email = new Email();
/* Start standard EditView setup logic */
$domMailBoxType = $app_list_strings['dom_mailbox_type'];
if(isset($_REQUEST['record'])) {
$GLOBALS['log']->debug("In InboundEmail edit view, about to retrieve record: ".$_REQUEST['record']);
$result = $focus->retrieve($_REQUEST['record']);
if($result == null)
{
sugar_die($app_strings['ERROR_NO_RECORD']);
}
}
else
{
if(!empty($_REQUEST['mailbox_type']))
$focus->mailbox_type = $_REQUEST['mailbox_type'];
//Default to imap protocol for new accounts.
$focus->protocol = 'imap';
}
if($focus->mailbox_type == 'bounce')
{
unset($domMailBoxType['pick']);
unset($domMailBoxType['createcase']);
}
else
unset($domMailBoxType['bounce']);
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$GLOBALS['log']->debug("isDuplicate found - duplicating record of id: ".$focus->id);
$focus->id = "";
}
$GLOBALS['log']->info("InboundEmail Edit View");
/* End standard EditView setup logic */
/* Start custom setup logic */
// status drop down
$status = get_select_options_with_id_separate_key($app_list_strings['user_status_dom'],$app_list_strings['user_status_dom'], $focus->status);
// default MAILBOX value
if(empty($focus->mailbox)) {
$mailbox = 'INBOX';
} else {
$mailbox = $focus->mailbox;
}
// service options breakdown
$tls = '';
$notls = '';
$cert = '';
$novalidate_cert = '';
$ssl = '';
if(!empty($focus->service)) {
// will always have 2 values: /tls || /notls and /validate-cert || /novalidate-cert
$exServ = explode('::', $focus->service);
if($exServ[0] == 'tls') {
$tls = "CHECKED";
} elseif($exServ[5] == 'notls') {
$notls = "CHECKED";
}
if($exServ[1] == 'validate-cert') {
$cert = "CHECKED";
} elseif($exServ[4] == 'novalidate-cert') {
$novalidate_cert = 'CHECKED';
}
if(isset($exServ[2]) && !empty($exServ[2]) && $exServ[2] == 'ssl') {
$ssl = "CHECKED";
}
}
$mark_read = '';
if($focus->delete_seen == 0 || empty($focus->delete_seen)) {
$mark_read = 'CHECKED';
}
// mailbox type
if ($focus->is_personal) {
array_splice($domMailBoxType, 1, 1);
} // if
$mailbox_type = get_select_options_with_id($domMailBoxType, $focus->mailbox_type);
// auto-reply email template
$email_templates_arr = get_bean_select_array(true, 'EmailTemplate','name', '','name',true);
if(!empty($focus->stored_options)) {
$storedOptions = unserialize(base64_decode($focus->stored_options));
$from_name = $storedOptions['from_name'];
$from_addr = $storedOptions['from_addr'];
$reply_to_name = (isset($storedOptions['reply_to_name'])) ? $storedOptions['reply_to_name'] : "";
$reply_to_addr = (isset($storedOptions['reply_to_addr'])) ? $storedOptions['reply_to_addr'] : "";
$trashFolder = (isset($storedOptions['trashFolder'])) ? $storedOptions['trashFolder'] : "";
$sentFolder = (isset($storedOptions['sentFolder'])) ? $storedOptions['sentFolder'] : "";
$distrib_method = (isset($storedOptions['distrib_method'])) ? $storedOptions['distrib_method'] : "";
$create_case_email_template = (isset($storedOptions['create_case_email_template'])) ? $storedOptions['create_case_email_template'] : "";
$email_num_autoreplies_24_hours = (isset($storedOptions['email_num_autoreplies_24_hours'])) ? $storedOptions['email_num_autoreplies_24_hours'] : $focus->defaultEmailNumAutoreplies24Hours;
if($storedOptions['only_since']) {
$only_since = 'CHECKED';
} else {
$only_since = '';
}
if(isset($storedOptions['filter_domain']) && !empty($storedOptions['filter_domain'])) {
$filterDomain = $storedOptions['filter_domain'];
} else {
$filterDomain = '';
}
if(!isset($storedOptions['leaveMessagesOnMailServer']) || $storedOptions['leaveMessagesOnMailServer'] == 1) {
$leaveMessagesOnMailServer = 1;
} else {
$leaveMessagesOnMailServer = 0;
} // else
} else { // initialize empty vars for template
$from_name = $current_user->name;
$from_addr = $current_user->email1;
$reply_to_name = '';
$reply_to_addr = '';
$only_since = '';
$filterDomain = '';
$trashFolder = '';
$sentFolder = '';
$distrib_method ='';
$create_case_email_template='';
$leaveMessagesOnMailServer = 1;
$email_num_autoreplies_24_hours = $focus->defaultEmailNumAutoreplies24Hours;
} // else
// return action
if(isset($focus->id)) {
$return_action = 'DetailView';
} else {
$return_action = 'ListView';
}
// javascript
$javascript->setSugarBean($focus);
$javascript->setFormName('EditView');
$javascript->addRequiredFields();
$javascript->addFieldGeneric('email_user', 'alpha', $mod_strings['LBL_LOGIN'], true);
$javascript->addFieldGeneric('email_password', 'alpha', $mod_strings['LBL_PASSWORD'], true);
$javascript->addFieldRange('email_num_autoreplies_24_hours', 'int', $mod_strings['LBL_MAX_AUTO_REPLIES'], true, "", 1, $focus->maxEmailNumAutoreplies24Hours);
$r = $focus->db->query('SELECT value FROM config WHERE name = \'fromname\'');
$a = $focus->db->fetchByAssoc($r);
$default_from_name = $a['value'];
$r = $focus->db->query('SELECT value FROM config WHERE name = \'fromaddress\'');
$a = $focus->db->fetchByAssoc($r);
$default_from_addr = $a['value'];
/* End custom setup logic */
// TEMPLATE ASSIGNMENTS
if ($focus->mailbox_type == 'template') {
$xtpl = new XTemplate('modules/InboundEmail/EmailAccountTemplateEditView.html');
} else {
$xtpl = new XTemplate('modules/InboundEmail/EditView.html');
}
// if no IMAP libraries available, disable Save/Test Settings
if(!function_exists('imap_open')) {
$xtpl->assign('IE_DISABLED', 'DISABLED');
}
// standard assigns
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('THEME', SugarThemeRegistry::current()->__toString());
$xtpl->assign('GRIDLINE', $gridline);
$xtpl->assign('MODULE', 'InboundEmail');
$xtpl->assign('RETURN_MODULE', 'InboundEmail');
$xtpl->assign('RETURN_ID', $focus->id);
$xtpl->assign('RETURN_ACTION', $return_action);
// module specific
//$xtpl->assign('ROLLOVER', $email->rolloverStyle);
$xtpl->assign("EMAIL_OPTIONS", $mod_strings['LBL_EMAIL_OPTIONS']);
$xtpl->assign('MODULE_TITLE', get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true));
$xtpl->assign('ID', $focus->id);
$xtpl->assign('NAME', $focus->name);
$xtpl->assign('STATUS', $status);
$xtpl->assign('SERVER_URL', $focus->server_url);
$xtpl->assign('USER', $focus->email_user);
$xtpl->assign('PASSWORD', $focus->email_password);
$xtpl->assign('TRASHFOLDER', $trashFolder);
$xtpl->assign('SENTFOLDER', $sentFolder);
$xtpl->assign('MAILBOX', $mailbox);
$xtpl->assign('TLS', $tls);
$xtpl->assign('NOTLS', $notls);
$xtpl->assign('CERT', $cert);
$xtpl->assign('NOVALIDATE_CERT', $novalidate_cert);
$xtpl->assign('SSL', $ssl);
$protocol = filterInboundEmailPopSelection($app_list_strings['dom_email_server_type']);
$xtpl->assign('PROTOCOL', get_select_options_with_id($protocol, $focus->protocol));
$xtpl->assign('MARK_READ', $mark_read);
$xtpl->assign('MAILBOX_TYPE', $focus->mailbox_type);
$xtpl->assign('TEMPLATE_ID', $focus->template_id);
$xtpl->assign('EMAIL_TEMPLATE_OPTIONS', get_select_options_with_id($email_templates_arr, $focus->template_id));
$xtpl->assign('ONLY_SINCE', $only_since);
$xtpl->assign('FILTER_DOMAIN', $filterDomain);
$xtpl->assign('EMAIL_NUM_AUTOREPLIES_24_HOURS', $email_num_autoreplies_24_hours);
if(!empty($focus->port)) {
$xtpl->assign('PORT', $focus->port);
}
// groups
$groupId = "";
$is_auto_import = "";
if(isset($focus->id))
$groupId = $focus->group_id;
else
{
$groupId = create_guid();
//When creating a new record, set auto import to on by default.
$is_auto_import = 'checked';
}
$xtpl->assign('GROUP_ID', $groupId);
// auto-reply stuff
$xtpl->assign('FROM_NAME', $from_name);
$xtpl->assign('FROM_ADDR', $from_addr);
$xtpl->assign('DEFAULT_FROM_NAME', $default_from_name);
$xtpl->assign('DEFAULT_FROM_ADDR', $default_from_addr);
$xtpl->assign('REPLY_TO_NAME', $reply_to_name);
$xtpl->assign('REPLY_TO_ADDR', $reply_to_addr);
$createCaseRowStyle = "display:none";
if($focus->template_id) {
$xtpl->assign("EDIT_TEMPLATE","visibility:inline");
} else {
$xtpl->assign("EDIT_TEMPLATE","visibility:hidden");
}
if($focus->port == 110 || $focus->port == 995) {
$xtpl->assign('DISPLAY', "display:''");
} else {
$xtpl->assign('DISPLAY', "display:none");
}
$leaveMessagesOnMailServerStyle = "display:none";
if($focus->is_personal) {
$xtpl->assign('DISABLE_GROUP', 'DISABLED');
$xtpl->assign('EDIT_GROUP_FOLDER_STYLE', "display:none");
$xtpl->assign('CREATE_GROUP_FOLDER_STYLE', "display:none");
$xtpl->assign('MAILBOX_TYPE_STYLE', "display:none");
$xtpl->assign('AUTO_IMPORT_STYLE', "display:none");
} else {
$folder = new SugarFolder();
$xtpl->assign('CREATE_GROUP_FOLDER_STYLE', "display:''");
$xtpl->assign('MAILBOX_TYPE_STYLE', "display:''");
$xtpl->assign('AUTO_IMPORT_STYLE', "display:''");
$ret = $folder->getFoldersForSettings($current_user);
//For existing records, do not allow
$is_auto_import_disabled = "";
if (!empty($focus->groupfolder_id))
{
$is_auto_import = "checked";
$xtpl->assign('EDIT_GROUP_FOLDER_STYLE', "visibility:inline");
$leaveMessagesOnMailServerStyle = "display:''";
}
else
{
$xtpl->assign('EDIT_GROUP_FOLDER_STYLE', "visibility:hidden");
}
$xtpl->assign('IS_AUTO_IMPORT', $is_auto_import);
if ($focus->isMailBoxTypeCreateCase())
$createCaseRowStyle = "display:''";
}
$xtpl->assign('hasGrpFld',$focus->groupfolder_id == null ? '' : 'checked="1"');
$xtpl->assign('LEAVEMESSAGESONMAILSERVER_STYLE', $leaveMessagesOnMailServerStyle);
$xtpl->assign('LEAVEMESSAGESONMAILSERVER', get_select_options_with_id($app_list_strings['dom_int_bool'], $leaveMessagesOnMailServer));
$distributionMethod = get_select_options_with_id($app_list_strings['dom_email_distribution_for_auto_create'], $distrib_method);
$xtpl->assign('DISTRIBUTION_METHOD', $distributionMethod);
$xtpl->assign('CREATE_CASE_ROW_STYLE', $createCaseRowStyle);
$xtpl->assign('CREATE_CASE_EMAIL_TEMPLATE_OPTIONS', get_select_options_with_id($email_templates_arr, $create_case_email_template));
if(!empty($create_case_email_template)) {
$xtpl->assign("CREATE_CASE_EDIT_TEMPLATE","visibility:inline");
} else {
$xtpl->assign("CREATE_CASE_EDIT_TEMPLATE","visibility:hidden");
}
$quicksearch_js = "";
//$javascript = get_set_focus_js(). $javascript->getScript() . $quicksearch_js;
$xtpl->assign('JAVASCRIPT', get_set_focus_js(). $javascript->getScript() . $quicksearch_js);
// WINDOWS work arounds
//if(is_windows()) {
// $xtpl->assign('MAYBE', '<style> div.maybe { display:none; }</style>');
//}
// PARSE AND PRINT
//Overrides for bounce mailbox accounts
if ($focus->mailbox_type == 'bounce')
{
$xtpl->assign('MODULE_TITLE', get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_BOUNCE_MODULE_NAME'].": ".$focus->name, true));
$xtpl->assign("EMAIL_OPTIONS", $mod_strings['LBL_EMAIL_BOUNCE_OPTIONS']);
$xtpl->assign('MAILBOX_TYPE_STYLE', "display:none");
$xtpl->assign('AUTO_IMPORT_STYLE', "display:none");
}
elseif ($focus->mailbox_type == 'createcase')
$xtpl->assign("IS_CREATE_CASE", 'checked');
else if( $focus->is_personal == '1')
$xtpl->assign('MODULE_TITLE', get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_PERSONAL_MODULE_NAME'].": ".$focus->name, true));
//else
$xtpl->parse("main");
$xtpl->out("main");
?>

View File

@@ -0,0 +1,93 @@
/*********************************************************************************
* 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".
********************************************************************************/
SUGAR.inboundEmail={};Rot13={map:null,convert:function(a){Rot13.init();var s="";for(i=0;i<a.length;i++){var b=a.charAt(i);s+=((b>='A'&&b<='Z')||(b>='a'&&b<='z')?Rot13.map[b]:b);}
return s;},init:function(){if(Rot13.map!=null)
return;var map=new Array();var s="abcdefghijklmnopqrstuvwxyz";for(i=0;i<s.length;i++)
map[s.charAt(i)]=s.charAt((i+13)%26);for(i=0;i<s.length;i++)
map[s.charAt(i).toUpperCase()]=s.charAt((i+13)%26).toUpperCase();Rot13.map=map;},write:function(a){return Rot13.convert(a);}}
function getEncryptedPassword(login,password,mailbox){var words=new Array(login,password,mailbox);for(i=0;i<3;i++){word=words[i];if(word.indexOf('&')>0){fragment1=word.substr(0,word.indexOf('&'));fragment2=word.substr(word.indexOf('&')+1,word.length);newWord=fragment1+'::amp::'+fragment2;words[i]=newWord;word=newWord;fragment1='';fragment2='';}
if(word.indexOf('+')>0){fragment1=word.substr(0,word.indexOf('+'));fragment2=word.substr(word.indexOf('+')+1,word.length);newWord=fragment1+'::plus::'+fragment2;words[i]=newWord;word=newWord;fragment1='';fragment2='';}
if(word.indexOf('%')>0){fragment1=word.substr(0,word.indexOf('%'));fragment2=word.substr(word.indexOf('%')+1,word.length);newWord=fragment1+'::percent::'+fragment2;words[i]=newWord;word=newWord;fragment1='';fragment2='';}}
return words;}
function ie_test_open_popup_with_submit(module_name,action,pageTarget,width,height,mail_server,protocol,port,login,password,mailbox,ssl,personal,formName)
{if(!formName)formName="testSettingsView";var words=getEncryptedPassword(login,password,mailbox);var isPersonal=(personal)?'true':'false';if(!isDataValid(formName,true)){return;}
URL='index.php?'
+'module='+module_name
+'&to_pdf=1'
+'&action='+action
+'&target='+pageTarget
+'&target1='+pageTarget
+'&server_url='+mail_server
+'&email_user='+words[0]
+'&protocol='+protocol
+'&port='+port
+'&email_password='+words[1]
+'&mailbox='+words[2]
+'&ssl='+ssl
+'&personal='+isPersonal;var SI=SUGAR.inboundEmail;if(!SI.testDlg){SI.testDlg=new YAHOO.widget.SimpleDialog("testSettingsDiv",{width:width+"px",draggable:true,dragOnly:true,close:true,constraintoviewport:true,modal:true,loadingText:SUGAR.language.get("app_strings","LBL_EMAIL_LOADING")});SI.testDlg._updateContent=function(o){var w=this.cfg.config.width.value+"px";this.setBody(o.responseText);if(this.evalJS)
SUGAR.util.evalScript(o.responseText);if(!SUGAR.isIE)
this.body.style.width=w}}
var title=SUGAR.language.get('Emails','LBL_TEST_SETTINGS');if(typeof(title)=="undefined"||title=="undefined")
title=SUGAR.language.get('InboundEmail','LBL_TEST_SETTINGS');SI.testDlg.setHeader(title);SI.testDlg.setBody(SUGAR.language.get("app_strings","LBL_EMAIL_LOADING"));SI.testDlg.render(document.body);var Connect=YAHOO.util.Connect;if(Connect.url)URL=Connect.url+"&"+url;Connect.asyncRequest("GET",URL,{success:SI.testDlg._updateContent,failure:SI.testDlg.hide,scope:SI.testDlg});SI.testDlg.show();}
function isDataValid(formName,validateMonitoredFolder){var formObject=document.getElementById(formName);var errors=new Array();var out=new String();if(trim(formObject.server_url.value)==""){errors.push(SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_SERVER'));}
if(trim(formObject.email_user.value)==""){errors.push(SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_USER'));}
if(trim(formObject.email_password.value)==""){errors.push(SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_PASSWORD'));}
if(formObject.protocol.protocol==""){errors.push(SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_PROTOCOL'));}
if(formObject.protocol.value=='imap'&&validateMonitoredFolder){if(trim(formObject.mailbox.value)==""){errors.push(SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_MONITORED_FOLDER'));}}
if(formObject.port.value==""){errors.push(SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_PORT'));}
if(errors.length>0){out=SUGAR.language.get('app_strings','LBL_EMAIL_ERROR_DESC');for(i=0;i<errors.length;i++){if(out!=""){out+="\n";}
out+=errors[i];}
alert(out);return false;}else{return true;}}
function getFoldersListForInboundAccount(module_name,action,pageTarget,width,height,mail_server,protocol,port,login,password,mailbox,ssl,personal,searchFieldValue,formName){if(!formName)formName="testSettingsView";var words=getEncryptedPassword(login,password,mailbox);var isPersonal=(personal)?'true':'false';URL='index.php?'
+'module='+module_name
+'&to_pdf=1'
+'&action='+action
+'&target='+pageTarget
+'&target1='+pageTarget
+'&server_url='+mail_server
+'&email_user='+words[0]
+'&protocol='+protocol
+'&port='+port
+'&email_password='+words[1]
+'&mailbox='+words[2]
+'&ssl='+ssl
+'&personal='+isPersonal
+'&searchField='+searchFieldValue;var SI=SUGAR.inboundEmail;if(!SI.listDlg){SI.listDlg=new YAHOO.widget.SimpleDialog("selectFoldersDiv",{width:width+"px",draggable:true,dragOnly:true,close:true,constraintoviewport:true,modal:true,loadingText:SUGAR.language.get("app_strings","LBL_EMAIL_LOADING")});SI.listDlg._updateContent=function(o){var w=this.cfg.config.width.value+"px";this.setBody(o.responseText);SUGAR.util.evalScript(o.responseText);if(!SUGAR.isIE)
this.body.style.width=w}}
SI.listDlg.setHeader(SUGAR.language.get("app_strings","LBL_EMAIL_LOADING"));SI.listDlg.setBody('');SI.listDlg.render(document.body);var Connect=YAHOO.util.Connect;if(Connect.url)URL=Connect.url+"&"+url;Connect.asyncRequest("GET",URL,{success:SI.listDlg._updateContent,failure:SI.listDlg.hide,scope:SI.listDlg});SI.listDlg.show();}
function setPortDefault(){var prot=document.getElementById('protocol');var ssl=document.getElementById('ssl');var port=document.getElementById('port');var stdPorts=new Array("110","143","993","995");var stdBool=new Boolean(false);if(port.value==''){stdBool.value=true;}else{for(i=0;i<stdPorts.length;i++){if(stdPorts[i]==port.value){stdBool.value=true;}}}
if(stdBool.value==true){if(prot.value=='imap'&&ssl.checked==false){port.value="143";}else if(prot.value=='imap'&&ssl.checked==true){port.value='993';}else if(prot.value=='pop3'&&ssl.checked==false){port.value='110';}else if(prot.value=='pop3'&&ssl.checked==true){port.value='995';}}}
function toggle_monitored_folder(field){var field1=document.getElementById('protocol');var mailbox=document.getElementById('mailbox');var label_inbox=document.getElementById('label_inbox');var subscribeFolderButton=document.getElementById('subscribeFolderButton');var trashFolderRow=document.getElementById('trashFolderRow');var trashFolderRow1=document.getElementById('trashFolderRow1');var sentFolderRow=document.getElementById('sentFolderRow');if(field1.value=='imap'){mailbox.disabled=false;try{mailbox.style.display='';trashFolderRow.style.display='';sentFolderRow.style.display='';trashFolderRow1.style.display='';subscribeFolderButton.style.display='';}catch(e){};label_inbox.style.display='';}
else{mailbox.value="INBOX";mailbox.disabled=false;try{mailbox.style.display="none";trashFolderRow.style.display="none";sentFolderRow.style.display="none";trashFolderRow1.style.display="none";subscribeFolderButton.style.display="none";}catch(e){};label_inbox.style.display="none";}}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
********************************************************************************/
?>

View File

@@ -0,0 +1,84 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
* Created On: Sep 28, 2005
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): Chris Nojima
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope='col' nowrap width='2%'>
<input type='checkbox' class='checkbox' id='massall' name='massall' value='' onclick='sListView.check_all(document.MassUpdate, "mass[]", this.checked);' />
</td>
<td scope="col" width="5%" ><slot>&nbsp;</slot></td>
<td scope="col" width="50%" ><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">
{MOD.LBL_LIST_NAME}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="11%" ><slot><a href="{ORDER_BY}is_personal" class="listViewThLinkS1">
{MOD.LBL_LIST_GLOBAL_PERSONAL}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="11%" ><slot><a href="{ORDER_BY}mailbox_type" class="listViewThLinkS1">
{MOD.LBL_LIST_MAILBOX_TYPE}{arrow_start}{mailbox_type_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="11%" ><slot><a href="{ORDER_BY}server_url" class="listViewThLinkS1">
{MOD.LBL_LIST_SERVER_URL}{arrow_start}{server_url_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="11%" ><slot><a href="{ORDER_BY}status" class="listViewThLinkS1">
{MOD.LBL_LIST_STATUS}{arrow_start}{status_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td scope='row' valign=TOP><slot>{PREROW}</slot></td>
<td valign=TOP>
<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=InboundEmail&record={InboundEmail.ID}">{EDIT_INLINE_IMG}</a></td>
<td scope='row' valign=TOP>
<slot><a href="{URL_PREFIX}index.php?action=DetailView&module=InboundEmail&record={InboundEmail.ID}" >
{InboundEmail.NAME}</a></slot></td>
<td valign=TOP><slot>{InboundEmail.GLOBAL_PERSONAL_STRING}</slot></td>
<td valign=TOP><slot>{InboundEmail.MAILBOX_TYPE_NAME}</slot></td>
<td valign=TOP><slot>{InboundEmail.SERVER_URL}</slot></td>
<td valign=TOP><slot>{InboundEmail.STATUS}</slot></td>
</tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

View File

@@ -0,0 +1,82 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
global $theme;
global $mod_strings;
global $app_list_strings;
global $current_user;
$focus = new InboundEmail();
$focus->checkImap();
///////////////////////////////////////////////////////////////////////////////
//// I-E SYSTEM SETTINGS
//// handle saving settings
if(isset($_REQUEST['save']) && $_REQUEST['save'] == 'true') {
$focus->saveInboundEmailSystemSettings('Case', $_REQUEST['inbound_email_case_macro']);
}
//// END I-E SYSTEM SETTINGS
///////////////////////////////////////////////////////////////////////////////
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$ListView->setHeaderText("<a href='index.php?action=index&module=DynamicLayout&from_action=ListView&from_module=".$_REQUEST['module'] ."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>" );
}
$where = '';
$limit = '0';
$orderBy = 'date_entered';
$varName = $focus->object_name;
$allowByOverride = true;
$listView = new ListView();
$listView->initNewXTemplate('modules/InboundEmail/ListView.html', $mod_strings);
$listView->setHeaderTitle($mod_strings['LBL_MODULE_TITLE']);
echo $focus->getSystemSettingsForm();
$listView->show_export_button = false;
$listView->setQuery($where, $limit, $orderBy, 'InboundEmail', $allowByOverride);
$listView->xTemplateAssign("EDIT_INLINE_IMG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
$listView->processListView($focus, "main", "InboundEmail");

52
modules/InboundEmail/Menu.php Executable file
View File

@@ -0,0 +1,52 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings;
$module_menu = Array();
$module_menu[]= array("index.php?module=InboundEmail&action=EditView", $mod_strings['LNK_LIST_CREATE_NEW_GROUP'],"CreateMailboxes");
$module_menu[]= array("index.php?module=InboundEmail&action=EditView&mailbox_type=bounce", $mod_strings['LNK_LIST_CREATE_NEW_BOUNCE'],"CreateMailboxes");
$module_menu[]= array("index.php?module=InboundEmail&action=index", $mod_strings['LNK_LIST_MAILBOXES'],"InboundEmail");
if(is_admin($GLOBALS['current_user']))$module_menu[]= array("index.php?module=Schedulers&action=index", $mod_strings['LNK_LIST_SCHEDULER'],"Schedulers");
//array("index.php?module=Queues&action=Seed", $mod_strings['LNK_SEED_QUEUES'],"CustomQueries"),
?>

174
modules/InboundEmail/Popup.php Executable file
View File

@@ -0,0 +1,174 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
********************************************************************************/
// cn: bug 6078: zlib breaks test-settings
$iniError = '';
if(ini_get('zlib.output_compression') == 1) { // ini_get() returns 1/0, not value
if(!ini_set('zlib.output_compression', 'Off')) { // returns False on failure
$iniError = $mod_strings['ERR_INI_ZLIB'];
}
}
// hack to allow "&", "%" and "+" through a $_GET var
// set by ie_test_open_popup() javascript call
foreach($_REQUEST as $k => $v) {
$v = str_replace('::amp::', '&', $v);
$v = str_replace('::plus::', '+', $v);
$v = str_replace('::percent::', '%', $v);
$_REQUEST[$k] = $v;
}
if(ob_get_level() > 0) {
ob_end_clean();
}
if(ob_get_level() < 1) {
ob_start();
}
require_once('modules/InboundEmail/language/'.$current_language.'.lang.php');
global $theme;
$title = '';
$msg = '';
$tls = '';
$cert = '';
$ssl = '';
$notls = '';
$novalidate_cert = '';
$useSsl = false;
///////////////////////////////////////////////////////////////////////////////
//// TITLES
$popupBoolean = false;
if (isset($_REQUEST['target']) && $_REQUEST['target'] == 'Popup') {
$popupBoolean = true;
}
if (isset($_REQUEST['target1']) && $_REQUEST['target1'] == 'Popup') {
$popupBoolean = true;
}
if($popupBoolean) {
$title = '';
$msg = $mod_strings['LBL_TEST_WAIT_MESSAGE'];
}
if(isset($_REQUEST['ssl']) && ($_REQUEST['ssl'] == "true" || $_REQUEST['ssl'] == 1)) {
$msg .= $mod_strings['LBL_FIND_SSL_WARN'];
$useSsl = true;
}
$ie = new InboundEmail();
$ie->email_user = $_REQUEST['email_user'];
$ie->server_url = $_REQUEST['server_url'];
$ie->port = $_REQUEST['port'];
$ie->protocol = $_REQUEST['protocol'];
//Bug 23083.Special characters in email password results in IMAP authentication failure
$ie->email_password = html_entity_decode($_REQUEST['email_password'], ENT_QUOTES);
$ie->email_password = str_rot13($ie->email_password);
$ie->mailbox = 'INBOX';
if($popupBoolean) {
$msg = $ie->connectMailserver(true);
}
//// END TITLES
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// COMMON CODE
echo /*'
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SugarCRM - Commercial Open Source CRM</title>
'.SugarThemeRegistry::current()->getCSS().'
<script type="text/javascript">
function setMailbox(box) {
var mb = opener.document.getElementById("mailbox");
mb.value = box;
}
</script>
</HEAD>
<body style="margin: 10px">*/'
<p>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<img src="'.SugarThemeRegistry::current()->getImageURL('h3Arrow.gif').'" width="11" height="11" border="0" alt="'.$mod_strings['LBL_POPUP_TITLE'].'">
</td>
<td>
<h3>&nbsp;'.$title.'</h3>
</td>
</tr>
<tr>
<td></td>
<td valign="top">
<div id="testSettingsMsg">
'.$msg.'
</div>
<div id="testSettingsTic"></div>
<div id="testSettingsErr">'.$iniError.'</div>
</td>
</tr>';
if($popupBoolean) {
/* echo ' <tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr>
<td></td>
<td>
<form name="form">
<input name="close" type="button" title="'.$mod_strings['LBL_CLOSE_POPUP'].'" value=" '.$mod_strings['LBL_CLOSE_POPUP'].' " onClick="window.close()">
</form>
</td>
</tr>';*/
}
echo ' </table>';
//// END COMMON CODE
///////////////////////////////////////////////////////////////////////////////
?>

271
modules/InboundEmail/Save.php Executable file
View File

@@ -0,0 +1,271 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
require_once('include/SugarFolders/SugarFolders.php');
global $current_user;
$focus = new InboundEmail();
$focus->retrieve($_REQUEST['record']);
foreach($focus->column_fields as $field) {
if(isset($_REQUEST[$field])) {
if ($field != "group_id") {
$focus->$field = trim($_REQUEST[$field]);
}
}
}
foreach($focus->additional_column_fields as $field) {
if(isset($_REQUEST[$field])) {
$value = trim($_REQUEST[$field]);
$focus->$field = $value;
}
}
foreach($focus->required_fields as $field) {
if(isset($_REQUEST[$field])) {
$value = trim($_REQUEST[$field]);
$focus->$field = $value;
}
}
$focus->email_password = $_REQUEST['email_password'];
$focus->protocol = $_REQUEST['protocol'];
if( isset($_REQUEST['is_create_case']) && $_REQUEST['is_create_case'] == 'on' )
$focus->mailbox_type = 'createcase';
else
{
if( empty($focus->mailbox_type) || $focus->mailbox_type == 'createcase' )
$focus->mailbox_type = 'pick';
}
/////////////////////////////////////////////////////////
//// SERVICE STRING CONCATENATION
$useSsl = (isset($_REQUEST['ssl']) && $_REQUEST['ssl'] == 1) ? true : false;
$optimum = $focus->getSessionConnectionString($focus->server_url, $focus->email_user, $focus->port, $focus->protocol);
if (empty($optimum)) {
$optimum = $focus->findOptimumSettings($useSsl, $focus->email_user, $focus->email_password, $focus->server_url, $focus->port, $focus->protocol, $focus->mailbox);
} // if
$delimiter = $focus->getSessionInboundDelimiterString($focus->server_url, $focus->email_user, $focus->port, $focus->protocol);
//added check to ensure the $optimum['serial']) is not empty.
if(is_array($optimum) && (count($optimum) > 0) && !empty( $optimum['serial'])) {
$focus->service = $optimum['serial'];
} else {
// no save
// allowing bad save to allow Email Campaigns configuration to continue even without IMAP
$focus->service = "::::::".$focus->protocol."::::"; // save bogus info.
$error = "&error=true";
}
//// END SERVICE STRING CONCAT
/////////////////////////////////////////////////////////
if(isset($_REQUEST['mark_read']) && $_REQUEST['mark_read'] == 1) {
$focus->delete_seen = 0;
} else {
$focus->delete_seen = 0;
}
// handle stored_options serialization
if(isset($_REQUEST['only_since']) && $_REQUEST['only_since'] == 1) {
$onlySince = true;
} else {
$onlySince = false;
}
$stored_options = array();
$stored_options['from_name'] = trim($_REQUEST['from_name']);
$stored_options['from_addr'] = trim($_REQUEST['from_addr']);
$stored_options['reply_to_name'] = trim($_REQUEST['reply_to_name']);
$stored_options['reply_to_addr'] = trim($_REQUEST['reply_to_addr']);
$stored_options['only_since'] = $onlySince;
$stored_options['filter_domain'] = $_REQUEST['filter_domain'];
$stored_options['email_num_autoreplies_24_hours'] = $_REQUEST['email_num_autoreplies_24_hours'];
if (!$focus->isPop3Protocol()) {
$stored_options['trashFolder'] = (isset($_REQUEST['trashFolder']) ? trim($_REQUEST['trashFolder']) : "");
$stored_options['sentFolder'] = (isset($_REQUEST['sentFolder']) ? trim($_REQUEST['sentFolder']) : "");
} // if
if ( $focus->isMailBoxTypeCreateCase() || ($focus->mailbox_type == 'createcase' && empty($_REQUEST['id']) ) )
{
$stored_options['distrib_method'] = (isset($_REQUEST['distrib_method'])) ? $_REQUEST['distrib_method'] : "";
$stored_options['create_case_email_template'] = (isset($_REQUEST['create_case_template_id'])) ? $_REQUEST['create_case_template_id'] : "";
} // if
$storedOptions['folderDelimiter'] = $delimiter;
////////////////////////////////////////////////////////////////////////////////
//// CREATE MAILBOX QUEUE
////////////////////////////////////////////////////////////////////////////////
if (!isset($focus->id)) {
$groupId = "";
if (isset($_REQUEST['group_id']) && empty($_REQUEST['group_id'])) {
$groupId = $_REQUEST['group_id'];
} else {
$groupId = create_guid();
}
$focus->group_id = $groupId;
}
if( isset($_REQUEST['is_auto_import']) && $_REQUEST['is_auto_import'] == 'on' )
{
if( empty($focus->groupfolder_id) )
{
$groupFolderId = $focus->createAutoImportSugarFolder();
$focus->groupfolder_id = $groupFolderId;
}
}
else
{
$focus->groupfolder_id = "";
//If the user is turning the auto-import feature off then remove all previous subscriptions.
if( !empty($focus->fetched_row['groupfolder_id'] ) )
{
$GLOBALS['log']->debug("Clearining all subscriptions to folder id: {$focus->fetched_row['groupfolder_id']}");
$f = new SugarFolder();
$f->clearSubscriptionsForFolder($focus->fetched_row['groupfolder_id']);
//Now delete the old group folder.
$f->retrieve($focus->fetched_row['groupfolder_id']);
$f->delete();
}
}
if (!empty($focus->groupfolder_id))
{
if ($_REQUEST['leaveMessagesOnMailServer'] == "1")
$stored_options['leaveMessagesOnMailServer'] = 1;
else
$stored_options['leaveMessagesOnMailServer'] = 0;
}
$focus->stored_options = base64_encode(serialize($stored_options));
$GLOBALS['log']->info('----->InboundEmail now saving self');
////////////////////////////////////////////////////////////////////////////////
//// SEND US TO SAVE DESTINATION
////////////////////////////////////////////////////////////////////////////////
//When an admin is creating an IE account we do not want their private team to be added
//or they may be included in a round robin assignment.
$previousTeamAccessCheck = isset($GLOBALS['sugar_config']['disable_team_access_check']) ? $GLOBALS['sugar_config']['disable_team_access_check'] : null;
$GLOBALS['sugar_config']['disable_team_access_check'] = TRUE;
$focus->save();
//Reset the value so no other saves are affected.
$GLOBALS['sugar_config']['disable_team_access_check'] = $previousTeamAccessCheck;
//Sync any changes within the IE account that need to be synced with the Sugar Folder.
//Need to do this post save so the correct team/teamset id is generated correctly.
$monitor_fields = array('name', 'status',
);
//Only sync IE accounts with a group folder. Need to sync new records as team set assignment is processed
//after save.
if( !empty($focus->groupfolder_id) )
{
foreach ($monitor_fields as $singleField)
{
//Check if the value is being changed during save.
if($focus->fetched_row[$singleField] != $focus->$singleField)
syncSugarFoldersWithBeanChanges($singleField, $focus);
}
}
$_REQUEST['return_id'] = $focus->id;
$edit='';
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") {
$return_module = $_REQUEST['return_module'];
} else {
$return_module = "InboundEmail";
}
if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") {
$return_action = $_REQUEST['return_action'];
} else {
$return_action = "DetailView";
}
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") {
$return_id = $_REQUEST['return_id'];
}
if(!empty($_REQUEST['edit'])) {
$return_id='';
$edit='&edit=true';
}
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
header("Location: index.php?module=$return_module&action=$return_action&record=$return_id$edit$error");
/**
* Certain updates to the IE account need to be reflected in the related SugarFolder since they are
* created automatically. Only valid for IE accounts with auto import turned on.
*
* @param string $fieldName The field name that changed
* @param SugarBean $focus The InboundEmail bean being saved.
*/
function syncSugarFoldersWithBeanChanges($fieldName, $focus)
{
$f = new SugarFolder();
$f->retrieve($focus->groupfolder_id);
switch ($fieldName)
{
case 'name':
case 'team_id':
case 'team_set_id':
$f->$fieldName = $focus->$fieldName;
$f->save();
break;
case 'status':
if($focus->status == 'Inactive')
$f->clearSubscriptionsForFolder($focus->groupfolder_id);
else if($focus->mailbox_type != 'bounce' )
$f->addSubscriptionsToGroupFolder();
break;
}
}

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description: Saves an Account record and then redirects the browser to the
* defined return URL.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/SugarFolders/SugarFolders.php');
$folder = new SugarFolder();
$_REQUEST['name'] = $_REQUEST['groupFolderAddName'];
$_REQUEST['parent_folder'] = $_REQUEST['groupFoldersAdd'];
$_REQUEST['group_id'] = $_REQUEST['groupFoldersUser'];
if (empty($_REQUEST['record'])) {
$folder->setFolder($_REQUEST);
} else {
$folder->updateFolder($_REQUEST);
}
$body1 = "
<script type='text/javascript'>
function refreshOpener() {
window.opener.refresh_group_folder_list('$folder->id','$folder->name')
window.close();
} // fn
refreshOpener();
</script>";
echo $body1;
?>

View File

@@ -0,0 +1,317 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
********************************************************************************/
// hack to allow "&", "%" and "+" through a $_GET var
// set by ie_test_open_popup() javascript call
foreach($_REQUEST as $k => $v) {
$v = str_replace('::amp::', '&', $v);
$v = str_replace('::plus::', '+', $v);
$v = str_replace('::percent::', '%', $v);
$_REQUEST[$k] = $v;
}
require_once('modules/InboundEmail/language/en_us.lang.php');
global $theme;
// GLOBALS
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $current_user;
global $sugar_config;
$jsCustomVersion = $sugar_config['js_custom_version'];
$sugar_version = $sugar_version;
$title = '';
$msg = '';
$tls = '';
$cert = '';
$ssl = '';
$notls = '';
$novalidate_cert = '';
$useSsl = false;
$deletedFoldersList = "";
///////////////////////////////////////////////////////////////////////////////
//// TITLES
$popupBoolean = false;
if (isset($_REQUEST['target']) && $_REQUEST['target'] == 'Popup') {
$popupBoolean = true;
}
if (isset($_REQUEST['target1']) && $_REQUEST['target1'] == 'Popup') {
$popupBoolean = true;
}
if($popupBoolean) {
$title = $mod_strings['LBL_SELECT_SUBSCRIBED_FOLDERS'];
$msg = $mod_strings['LBL_TEST_WAIT_MESSAGE'];
}
$subdcriptionFolderHelp = $app_strings['LBL_EMAIL_SUBSCRIPTION_FOLDER_HELP'];
if(isset($_REQUEST['ssl']) && ($_REQUEST['ssl'] == "true" || $_REQUEST['ssl'] == 1)) {
$useSsl = true;
}
$searchField = !empty($_REQUEST['searchField']) ? $_REQUEST['searchField'] : "";
$multipleString = "multiple=\"true\"";
if (!empty($searchField)) {
$subdcriptionFolderHelp = "";
$multipleString = "";
if ($searchField == 'trash') {
$title = $mod_strings['LBL_SELECT_TRASH_FOLDERS'];
} else {
$title = $mod_strings['LBL_SELECT_SENT_FOLDERS'];
} // else
} // else
$ie = new InboundEmail();
$ie->email_user = $_REQUEST['email_user'];
$ie->server_url = $_REQUEST['server_url'];
$ie->port = $_REQUEST['port'];
$ie->protocol = $_REQUEST['protocol'];
//Bug 23083.Special characters in email password results in IMAP authentication failure
$ie->email_password = html_entity_decode($_REQUEST['email_password'], ENT_QUOTES);
$ie->email_password = str_rot13($ie->email_password);
//$ie->mailbox = $_REQUEST['mailbox'];
$ie->mailbox = 'INBOX';
if($popupBoolean) {
$returnArray = $ie->getFoldersListForMailBox();
$foldersList = $returnArray['foldersList'];
if ($returnArray['status']) {
$msg = $returnArray['statusMessage'];
$requestMailBox = explode(",", $_REQUEST['mailbox']);
$foldersListArray = explode(",", $foldersList);
$deletedFoldersString = "";
$count = 0;
if (!empty($requestMailBox) && !empty($foldersListArray)) {
foreach($requestMailBox as $mailbox) {
if (!in_array($mailbox, $foldersListArray)) {
if ($count != 0) {
$deletedFoldersString = $deletedFoldersString . " ,";
}
$deletedFoldersString = $deletedFoldersString . $mailbox;
$count++;
}
} // foreach
} // if
if (!empty($deletedFoldersString)) {
$deletedFoldersList = $mod_strings['LBL_DELETED_FOLDERS_LIST'];
$deletedFoldersList = sprintf($deletedFoldersList, $deletedFoldersString);
}
} else {
$msg = $returnArray['statusMessage'];
}
}
//// END TITLES
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// COMMON CODE
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>&nbsp;
</td>
<td valign="top">
<div id="sf_msg">
'.$msg.'
</div>
</td>
</tr>';
if (!empty($subdcriptionFolderHelp)) {
echo '<tr>
<td>&nbsp;
</td>
<td>&nbsp;
</td>
</tr>
<tr align="center">
<td>&nbsp;
</td>
<td>'.$subdcriptionFolderHelp.'
</td>
</tr>';
} // if
echo '<tr>
<td>&nbsp;
</td>
<td valign="top">
<div id="sf_deletedFoldersList" style="display:none;">
'.$deletedFoldersList.'
</div>
</td>
</tr>
<tr align="center">
<td>&nbsp;
</td>
<td valign="top">
<select '.$multipleString.' size="12" name="inboundmailboxes" id="sf_inboundmailboxes">
</select>
</td>
</tr>
<tr>
<td>&nbsp;
</td>
<td>&nbsp;
</td>
</tr>
<tr align="center">
<td>&nbsp;
</td>
<td>
<input type="button" style="" class="button" value="'.$app_strings['LBL_DONE_BUTTON_LABEL'].'" onclick="setMailbox();">
<input type="button" class="button" value="'.$app_strings['LBL_EMAIL_CANCEL'].'" onclick="SUGAR.inboundEmail.listDlg.hide()">
</td>
</tr>
<tr>
<td>&nbsp;
</td>
<td>&nbsp;
</td>
</tr>';
echo ' </table>';
//// END COMMON CODE
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// COMPLETE RENDERING OF THE POPUP
echo '<input type="hidden" id="sf_returnstatus" name="returnstatus" value="'. $returnArray['status'] .'">';
echo '<input type="hidden" id="sf_foldersList" name="foldersList" value="'. $foldersList .'">';
echo '<input type="hidden" id="sf_selectedfoldersList" name="selectedfoldersList" value="'. implode(",", $requestMailBox) .'">';
echo '<input type="hidden" id="sf_searchField" name="searchField" value="'. $searchField .'">';
echo '
<script type="text/javascript">
SUGAR.inboundEmail.listDlg.setHeader("'.$title.'");
function setMailbox(box) {
var inboundmailboxes = document.getElementById("sf_inboundmailboxes");
var selectedmbox = "";
var j = 0;
for (var i = 0 ; i < inboundmailboxes.options.length ; i++) {
if (inboundmailboxes.options[i].selected) {
if (j != 0) {
selectedmbox = selectedmbox + ",";
} // if
selectedmbox = selectedmbox + inboundmailboxes.options[i].value;
j++;
} // if
} // for
var searchFieldValue = document.getElementById("sf_searchField").value;
if (searchFieldValue.length > 0) {
if (searchFieldValue == "trash") {
var tf = document.getElementById("trashFolder");
tf.value = selectedmbox;
} else if(searchFieldValue == "sent") {
var sf = document.getElementById("sentFolder");
sf.value = selectedmbox;
} // else
} else {
var mb = document.getElementById("mailbox");
mb.value = selectedmbox;
}
SUGAR.inboundEmail.listDlg.hide();
}
function switchMsg() {
if(typeof(document.getElementById("sf_msg")) != "undefined") {
document.getElementById("sf_msg").innerHTML = "'.$msg.'";
var deletedFoldersList = document.getElementById("sf_deletedFoldersList");
deletedFoldersList.innerHTML = "'. $deletedFoldersList .'";
if (deletedFoldersList.innerHTML.length > 0) {
deletedFoldersList.style.display = "";
} // if
var selectedFoldersListObject = new Object();
var selectedFoldersListArray = document.getElementById("sf_selectedfoldersList").value.split(",");
for (var j = 0 ; j < selectedFoldersListArray.length ; j++) {
selectedFoldersListObject[selectedFoldersListArray[j]] = selectedFoldersListArray[j];
} // for
if (document.getElementById("sf_returnstatus").value == "1") {
var foldersList = document.getElementById("sf_foldersList").value;
var foldersArray = foldersList.split(",");
var inboundmailboxes = document.getElementById("sf_inboundmailboxes");
for (var i = 0 ; i < foldersArray.length ; i++) {
var opt = new Option(foldersArray[i], foldersArray[i]);
if (selectedFoldersListObject[foldersArray[i]] != null) {
opt.selected = true;
}
inboundmailboxes.options.add(opt);
} // for
} // if
var selectdFoldersValue = document.getElementById("sf_selectedfoldersList").value;
var searchFieldValue = document.getElementById("sf_searchField").value;
if (selectdFoldersValue.length <= 0) {
if (searchFieldValue.length > 0) {
if (searchFieldValue == "trash") {
var inboundmailboxes = document.getElementById("sf_inboundmailboxes");
for (var i = 0 ; i < inboundmailboxes.options.length ; i++) {
if ((inboundmailboxes.options[i].text.search(/trash/i) != -1) ||
(inboundmailboxes.options[i].text.search(/delete/i) != -1)) {
inboundmailboxes.options[i].selected = true;
break;
}
} // for
} // if
if (searchFieldValue == "sent") {
var inboundmailboxes = document.getElementById("sf_inboundmailboxes");
for (var i = 0 ; i < inboundmailboxes.options.length ; i++) {
if (inboundmailboxes.options[i].text.search(/sent/i) != -1) {
inboundmailboxes.options[i].selected = true;
break;
}
} // for
} // if
} // if
} // if
}
}
switchMsg();
</script>'
?>

83
modules/InboundEmail/View.html Executable file
View File

@@ -0,0 +1,83 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!-- BEGIN: main -->
<p>
{MODULE_TITLE}
</p>
{ERROR_STRING}
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<form name="View" method="POST" action="index.php">
<input type="hidden" name="module" value="InboundEmail">
<input type="hidden" name="action">
<input type="hidden" name="return_module" value="{RETURN_MODULE}">
<input type="hidden" name="return_action" value="{RETURN_ACTION}">
<td>
<input title="{APP.LBL_SAVE_BUTTON_TITLE}"
accessKey="{APP.LBL_SAVE_BUTTON_KEY}"
class="button"
onclick="this.form.action.value='Save'; {CHOOSER_SCRIPT} return verify_data(View)"
type="submit"
name="button"
value="{APP.LBL_SAVE_BUTTON_LABEL}">
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}"
accessKey="{APP.LBL_CANCEL_BUTTON_KEY}"
class="button"
onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}';"
type="submit"
name="button"
value="{APP.LBL_CANCEL_BUTTON_LABEL}">
</td>
<td align="right" nowrap>
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}
</td>
</tr>
</table>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td>
{CONTENT}
</td>
</tr>
</table>
</p>
<!-- END: main -->

View File

@@ -0,0 +1,69 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
$fields_array['InboundEmail'] = array (
'column_fields' => array (
'id',
'deleted',
'date_entered',
'date_modified',
'modified_user_id',
'created_by',
'name',
'status',
'server_url',
'email_user',
'email_password',
'port',
'service',
'mailbox',
'delete_seen',
'mailbox_type',
'template_id',
),
'list_fields' => array (
'id',
'name',
'server_url',
'status',
'mailbox_type_name',
),
'required_fields' => array (
'server_url' => 1,
'service' => 1,
),
);
?>

48
modules/InboundEmail/index.php Executable file
View File

@@ -0,0 +1,48 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings;
echo get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_MODULE_TITLE']. ": " .$mod_strings['LBL_HOME'], true);
require_once('modules/InboundEmail/ListView.php');
?>

View File

@@ -0,0 +1,196 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array(
'LBL_RE' => 'RE:',
'ERR_BAD_LOGIN_PASSWORD'=> 'Login or Password Incorrect',
'ERR_BODY_TOO_LONG' => '\rBody text too long to capture FULL email. Trimmed.',
'ERR_INI_ZLIB' => 'Could not turn off Zlib compression temporarily. "Test Settings" may fail.',
'ERR_MAILBOX_FAIL' => 'Could not retrieve any mail accounts.',
'ERR_NO_IMAP' => 'No IMAP libraries found. Please resolve this before continuing with Inbound Email',
'ERR_NO_OPTS_SAVED' => 'No optimums were saved with your Inbound Email account. Please review the settings',
'ERR_TEST_MAILBOX' => 'Please check your settings and try again.',
'LBL_APPLY_OPTIMUMS' => 'Apply Optimums',
'LBL_ASSIGN_TO_USER' => 'Assign To User',
'LBL_AUTOREPLY_OPTIONS' => 'Auto-Reply Options',
'LBL_AUTOREPLY' => 'Auto-Reply Template',
'LBL_AUTOREPLY_HELP' => 'Select an automated response to notify email senders that their response has been received.',
'LBL_BASIC' => 'Mail Account Information',
'LBL_CASE_MACRO' => 'Case Macro',
'LBL_CASE_MACRO_DESC' => 'Set the macro which will be parsed and used to link imported email to a Case.',
'LBL_CASE_MACRO_DESC2' => 'Set this to any value, but preserve the <b>"%1"</b>.',
'LBL_CERT_DESC' => 'Force validation of the mail server\'s Security Certificate - do not use if self-signing.',
'LBL_CERT' => 'Validate Certificate',
'LBL_CLOSE_POPUP' => 'Close Window',
'LBL_CREATE_NEW_GROUP' => '--Create Group On Save--',
'LBL_CREATE_TEMPLATE' => 'Create',
'LBL_SUBSCRIBE_FOLDERS' => 'Subscribe Folders',
'LBL_DEFAULT_FROM_ADDR' => 'Default: ',
'LBL_DEFAULT_FROM_NAME' => 'Default: ',
'LBL_DELETE_SEEN' => 'Delete Read Emails After Import',
'LBL_EDIT_TEMPLATE' => 'Edit',
'LBL_EMAIL_OPTIONS' => 'Email Handling Options',
'LBL_EMAIL_BOUNCE_OPTIONS' => 'Bounce Handling Options',
'LBL_FILTER_DOMAIN_DESC'=> 'Specify a domain to which no auto-replies will be sent.',
'LBL_ASSIGN_TO_GROUP_FOLDER_DESC'=> 'Select to automatically create email records in Sugar for all incoming emails.',
'LBL_POSSIBLE_ACTION_DESC' => 'For the Create Case option, a Group Folder must be selected',
'LBL_FILTER_DOMAIN' => 'No Auto-Reply to this Domain',
'LBL_FIND_OPTIMUM_KEY' => 'f',
'LBL_FIND_OPTIMUM_MSG' => '<br>Finding optimum connection variables.',
'LBL_FIND_OPTIMUM_TITLE'=> 'Find Optimum Configuration',
'LBL_FIND_SSL_WARN' => '<br>Testing SSL may take a long time. Please be patient.<br>',
'LBL_FORCE_DESC' => 'Some IMAP/POP3 servers require special switches. Check to force a negative switch when connecting (i.e., /notls)',
'LBL_FORCE' => 'Force Negative',
'LBL_FOUND_MAILBOXES' => 'Found the following usable folders.<br>Click one to choose it:',
'LBL_FOUND_OPTIMUM_MSG' => '<br>Found optimum settings. Press the button below to apply them to your mail account.',
'LBL_FROM_ADDR' => '"From" Address',
'LBL_FROM_NAME_ADDR' => 'From Name/Email',
'LBL_FROM_NAME' => '"From" Name',
'LBL_GROUP_QUEUE' => 'Assign To Group',
'LBL_HOME' => 'Home',
'LBL_LIST_MAILBOX_TYPE' => 'Mail Account Usage',
'LBL_LIST_NAME' => 'Name:',
'LBL_LIST_GLOBAL_PERSONAL' => 'Type',
'LBL_LIST_SERVER_URL' => 'Mail Server',
'LBL_LIST_STATUS' => 'Status',
'LBL_LOGIN' => 'User Name',
'LBL_MAILBOX_DEFAULT' => 'INBOX',
'LBL_MAILBOX_SSL_DESC' => 'Use SSL when connecting. If this does not work, check that your PHP installation included "--with-imap-ssl" in the configuration.',
'LBL_MAILBOX_SSL' => 'Use SSL',
'LBL_MAILBOX_TYPE' => 'Possible Actions',
'LBL_DISTRIBUTION_METHOD' => 'Distribution Method',
'LBL_CREATE_CASE_REPLY_TEMPLATE' => 'New Case Auto-Reply Template',
'LBL_CREATE_CASE_REPLY_TEMPLATE_HELP' => 'Select an automated response to notify email senders that a case has been created. The email contains the case number in the Subject line which adheres to the Case Macro setting. This response is only sent when the first email is received from the recipient.',
'LBL_MAILBOX' => 'Monitored Folders',
'LBL_TRASH_FOLDER' => 'Trash Folder',
'LBL_GET_TRASH_FOLDER' => 'Get Trash Folder',
'LBL_SENT_FOLDER' => 'Sent Folder',
'LBL_GET_SENT_FOLDER' => 'Get Sent Folder',
'LBL_SELECT' => 'Select',
'LBL_MARK_READ_DESC' => 'Mark messages read on mail server on import; do not delete.',
'LBL_MARK_READ_NO' => 'Email marked deleted after import',
'LBL_MARK_READ_YES' => 'Email left on server after import',
'LBL_MARK_READ' => 'Leave Messages On Server',
'LBL_MAX_AUTO_REPLIES' => 'Number of Auto-responses',
'LBL_MAX_AUTO_REPLIES_DESC' => 'Set the maximum number of auto-responses to send to a unique email address during a period of 24 hours.',
'LBL_PERSONAL_MODULE_NAME' => 'Personal Mail Account',
'LBL_CREATE_CASE' => 'Create Case from Email',
'LBL_CREATE_CASE_HELP' => 'Select to automatically create case records in Sugar from incoming emails.',
'LBL_MODULE_NAME' => 'Group Mail Account',
'LBL_BOUNCE_MODULE_NAME' => 'Bounce Handling Mailbox',
'LBL_MODULE_TITLE' => 'Inbound Email',
'LBL_NAME' => 'Name',
'LBL_NONE' => 'None',
'LBL_NO_OPTIMUMS' => 'Could not find optimums. Please check your settings and try again.',
'LBL_ONLY_SINCE_DESC' => 'When using POP3, PHP cannot filter for New/Unread messages. This flag allows the request to check for messages since the last time the mail account was polled. This will significantly improve performance if your mail server does not support IMAP.',
'LBL_ONLY_SINCE_NO' => 'No. Check against all emails on mail server.',
'LBL_ONLY_SINCE_YES' => 'Yes.',
'LBL_ONLY_SINCE' => 'Import Only Since Last Check:',
'LBL_OUTBOUND_SERVER' => 'Outgoing Mail Server',
'LBL_PASSWORD_CHECK' => 'Password Check',
'LBL_PASSWORD' => 'Password',
'LBL_POP3_SUCCESS' => 'Your POP3 test connection was successful.',
'LBL_POPUP_FAILURE' => 'Test connection failed. The error is shown below.',
'LBL_POPUP_SUCCESS' => 'Test connection successful. Your settings are working.',
'LBL_POPUP_TITLE' => 'Test Settings',
'LBL_GETTING_FOLDERS_LIST' => 'Getting Folders List',
'LBL_SELECT_SUBSCRIBED_FOLDERS' => 'Select Subscribed Folder(s)',
'LBL_SELECT_TRASH_FOLDERS' => 'Select Trash Folder',
'LBL_SELECT_SENT_FOLDERS' => 'Select Sent Folder',
'LBL_DELETED_FOLDERS_LIST' => 'The following folder(s) %s either does not exist or has been deleted from server',
'LBL_PORT' => 'Mail Server Port',
'LBL_QUEUE' => 'Mail Account Queue',
'LBL_REPLY_NAME_ADDR' => 'Reply Name/Email',
'LBL_REPLY_TO_NAME' => '"Reply-to" Name',
'LBL_REPLY_TO_ADDR' => '"Reply-to" Address',
'LBL_SAME_AS_ABOVE' => 'Using From Name/Address',
'LBL_SAVE_RAW' => 'Save Raw Source',
'LBL_SAVE_RAW_DESC_1' => 'Select "Yes" if you would like to preserve the raw source for each imported email.',
'LBL_SAVE_RAW_DESC_2' => 'Large attachments can cause failures with conservatively or incorrectly configured databases.',
'LBL_SERVER_OPTIONS' => 'Advanced Setup',
'LBL_SERVER_TYPE' => 'Mail Server Protocol',
'LBL_SERVER_URL' => 'Mail Server Address',
'LBL_SSL_DESC' => 'If your mail server supports secure socket connections, enabling this will force SSL connections when importing email.',
'LBL_ASSIGN_TO_TEAM_DESC' => 'The selected team has access to the mail account.',
'LBL_SSL' => 'Use SSL',
'LBL_STATUS' => 'Status',
'LBL_SYSTEM_DEFAULT' => 'System Default',
'LBL_TEST_BUTTON_KEY' => 't',
'LBL_TEST_BUTTON_TITLE' => 'Test [Alt+T]',
'LBL_TEST_SETTINGS' => 'Test Settings',
'LBL_TEST_SUCCESSFUL' => 'Connection completed successfully.',
'LBL_TEST_WAIT_MESSAGE' => 'One moment please...',
'LBL_TLS_DESC' => 'Use Transport Layer Security when connecting to the mail server - use this only if your mail server supports this protocol.',
'LBL_TLS' => 'Use TLS',
'LBL_WARN_IMAP_TITLE' => 'Inbound Email Disabled',
'LBL_WARN_IMAP' => 'Warnings:',
'LBL_WARN_NO_IMAP' => 'Inbound Email <b>cannot</b> function without the IMAP c-client libraries enabled/compiled with the PHP module. Please contact your administrator to resolve this issue.',
'LNK_CREATE_GROUP' => 'Create New Group',
'LNK_LIST_CREATE_NEW_GROUP' => 'New Group Mail Account',
'LNK_LIST_CREATE_NEW_BOUNCE' => 'New Bounce Handling Account',
'LNK_LIST_MAILBOXES' => 'All Mail Accounts',
'LNK_LIST_QUEUES' => 'All Queues',
'LNK_LIST_SCHEDULER' => 'Schedulers',
'LNK_LIST_TEST_IMPORT' => 'Test Email Import',
'LNK_NEW_QUEUES' => 'Create New Queue',
'LNK_SEED_QUEUES' => 'Seed Queues From Teams',
'LBL_IS_PERSONAL' => 'Personal Mail Account',
'LBL_GROUPFOLDER_ID' => 'Group Folder Id',
'LBL_ASSIGN_TO_GROUP_FOLDER' => 'Assign To Group Folder',
'LBL_STATUS_ACTIVE' => 'Active',
'LBL_STATUS_INACTIVE' => 'Inactive',
'LBL_IS_PERSONAL' => 'personal',
'LBL_IS_GROUP' => 'group',
'LBL_ENABLE_AUTO_IMPORT' => 'Import Emails Automatically',
'LBL_WARNING_CHANGING_AUTO_IMPORT' => 'Warning: You are modifying your automatic import setting which may result in loss of data.',
'LBL_WARNING_CHANGING_AUTO_IMPORT_WITH_CREATE_CASE' => 'Warning: Auto import must be enabled when automatically creating cases.'
);
?>

View File

@@ -0,0 +1,197 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.php,v for SugarCRM 4.5.1-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array(
'LBL_ASSIGN_TEAM' => 'Przydziel do zespołu',
'LBL_RE' => 'Odpowiedz:',
'ERR_BAD_LOGIN_PASSWORD'=> 'Niewłaściwe hasło lub login',
'ERR_BODY_TOO_LONG'=> '\rTekst wiadomości jest za długi, aby ściągnąć CAŁĄ wiadomość. Przycięto.',
'ERR_INI_ZLIB' => 'Nie można czasowo wyłączyć kompresji Zlib. Testowanie ustawień może się nie powieść.',
'ERR_MAILBOX_FAIL' => 'Nie mogę sprawdzić żadnych skrzynek pocztowych.',
'ERR_NO_IMAP' => 'Nie znaleziono bibliotek IMAP. Należy rozwiązać ten problem przez kontynuowaniem konfiguracji poczty przychodzącej',
'ERR_NO_OPTS_SAVED' => 'Nie zapisano właściwych ustawień dla Twojej skrzynki pocztowej. Sprawdź te ustawienia jeszcze raz.',
'ERR_TEST_MAILBOX' => 'Sprawdź ustawienia i spróbuj jeszcze raz.',
'LBL_APPLY_OPTIMUMS' => 'Zatwierdź ustawienia',
'LBL_ASSIGN_TO_USER' => 'Przydziel do użytkownika',
'LBL_AUTOREPLY_OPTIONS' => 'Opcje autoodpowiedzi',
'LBL_AUTOREPLY'=> 'Wzór autoodpowiedzi',
'LBL_AUTOREPLY_HELP' => 'Select an automated response to notify email senders that their response has been received.',
'LBL_BASIC'=> 'Podstawowe ustawienia',
'LBL_CASE_MACRO' => 'Makro spraw',
'LBL_CASE_MACRO_DESC'=> 'Ustaw macro, które będzie używane jako mechanizm importu wiadomości przychodzących do spraw.',
'LBL_CASE_MACRO_DESC2' => 'Ustaw dowolną wartość, ale nie używaj <b>"%1"</b>.',
'LBL_CERT_DESC' => 'Sprawdź ważność certyfikatu servera\'s Security Certificate - nie używaj, gdy jest samodzielnie podpisany.',
'LBL_CERT' => 'Ważność certyfikatu',
'LBL_CLOSE_POPUP' => 'Zamknij to okno',
'LBL_CREATE_NEW_GROUP' => '--Utwórz użytkownika grupowego Poczty przy zapisaniu--',
'LBL_CREATE_TEMPLATE' => 'Utwórz',
'LBL_SUBSCRIBE_FOLDERS' => 'Subskrybuj foldery',
'LBL_DEFAULT_FROM_ADDR'=> 'Domyślny adres: ',
'LBL_DEFAULT_FROM_NAME'=> 'Domyślna nazwa: ',
'LBL_DELETE_SEEN' => 'Usuń przeczytane wiadomości po imporcie',
'LBL_EDIT_TEMPLATE' => 'Edytuj',
'LBL_EMAIL_OPTIONS' => 'Opcje transportu poczty',
'LBL_EMAIL_BOUNCE_OPTIONS' => 'Bounce Handling Options',
'LBL_FILTER_DOMAIN_DESC'=> 'Nie wysyłaj auto-odpowiedzi dla tej domeny.',
'LBL_ASSIGN_TO_GROUP_FOLDER_DESC'=> 'Przydzielanie kont pocztowych do folderów grupowych włącza automatyczny import wiadomości.',
'LBL_POSSIBLE_ACTION_DESC' => 'Musi zostać wybrany folder grupowy, aby skorzystać z funkcji Utwórz Sprawę',
'LBL_FILTER_DOMAIN' => 'Brak auto-odpowiedzi dla domeny:',
'LBL_FIND_OPTIMUM_KEY' => 'f',
'LBL_FIND_OPTIMUM_MSG' => '<br>Znajdź optymalne zmienne połączenia.',
'LBL_FIND_OPTIMUM_TITLE'=> 'Znajdź optymalną konfigurację',
'LBL_FIND_SSL_WARN' => '<br>Testowanie SSL może zająć trochę czasu. Poczekaj chwilę.<br>',
'LBL_FORCE_DESC' => 'Niektóre serweryIMAP/POP3 wymagają specjalnych ustawień. Sprawdź ustawienie "negatywne" podczas połączenia (np.., /notls)',
'LBL_FORCE' => 'Sprawdź ustawienie "negatywne"',
'LBL_FOUND_MAILBOXES' => 'Znaleziono następujące skrzynki:',
'LBL_FOUND_OPTIMUM_MSG' => '<br>Znaleziono optymalne ustawienia. Naciśnij przycisk poniżej, aby zatwierdzić je jako ustawienia Twojej skrzynki.',
'LBL_FROM_ADDR' => '"Pole Od" - Adres',
'LBL_FROM_NAME_ADDR' => 'Odopwiedź Nazwa/Email:',
'LBL_FROM_NAME' => '"Pole Od" - Nazwa',
'LBL_GROUP_QUEUE' => 'Przydziel do użytkownika grupowego',
'LBL_HOME' => 'Strona główna',
'LBL_LIST_MAILBOX_TYPE' => 'Wykorzystanie skrzynki',
'LBL_LIST_NAME' => 'Nazwa:',
'LBL_LIST_GLOBAL_PERSONAL'=> 'Grupowe/Osobiste',
'LBL_LIST_SERVER_URL' => 'Serwer poczty:',
'LBL_LIST_STATUS' => 'Status:',
'LBL_LOGIN' => 'Login nazwa użytkownika',
'LBL_MAILBOX_DEFAULT' => 'Skrzynka odbiorcza',
'LBL_MAILBOX_SSL_DESC' => 'Używaj SSL gdy połączony. Jeżeli nie działa, to sprawdź parametr "--with-imap-ssl" w Konfiguracji PHP.',
'LBL_MAILBOX_SSL' => 'Używaj SSL',
'LBL_MAILBOX_TYPE' => 'Możliwe działania',
'LBL_DISTRIBUTION_METHOD' => 'Metoda dystrybucji',
'LBL_CREATE_CASE_REPLY_TEMPLATE' => 'Utwórz wzorzec odopowiedzi dla spraw',
'LBL_CREATE_CASE_REPLY_TEMPLATE_HELP' => 'Select an automated response to notify email senders that a case has been created. The email contains the case number in the Subject line which adheres to the Case Macro setting. This response is only sent when the first email is received from the recipient.',
'LBL_MAILBOX' => 'Monitorowane foldery',
'LBL_TRASH_FOLDER' => 'Folder kosza',
'LBL_GET_TRASH_FOLDER' => 'Pobierz folder kosza',
'LBL_SENT_FOLDER' => 'Folder wysłane',
'LBL_GET_SENT_FOLDER' => 'Pobierz folder wysłane',
'LBL_SELECT' => 'Wybierz',
'LBL_MARK_READ_DESC' => 'Zaznacz wiadomości przeczytane podczas importu. Nie usuwaj.',
'LBL_MARK_READ_NO' => 'Poczta zaznaczona do usunięcia po imporcie',
'LBL_MARK_READ_YES' => 'Poczta pozostawiona na serwerze po imporcie',
'LBL_MARK_READ' => 'Pozostaw kopie wiadomości na serwerze.',
'LBL_MAX_AUTO_REPLIES' => 'Liczba autoodpowiedzi',
'LBL_MAX_AUTO_REPLIES_DESC' => 'Ustaw maksymalną liczbę autoodpowiedzi do wysłania na ten sam adres w przedziale 24 godzin.',
'LBL_PERSONAL_MODULE_NAME' => 'Personal Mail Account',
'LBL_CREATE_CASE' => 'Create Case from Email',
'LBL_CREATE_CASE_HELP' => 'Select to automatically create case records in Sugar from incoming emails.',
'LBL_MODULE_NAME' => 'Ustawienia poczty przychodzącej',
'LBL_BOUNCE_MODULE_NAME' => 'Bounce Handling Mailbox',
'LBL_MODULE_TITLE' => 'Poczta przychodząca',
'LBL_NAME' => 'Nazwa',
'LBL_NONE' => 'Nic',
'LBL_NO_OPTIMUMS' => 'Nie można znaleźć ustawień optymalnych. Sprawdź swoje ustawienia i spróbuj ponownie.',
'LBL_ONLY_SINCE_DESC' => 'Kiedy używasz POP3, PHP nie możesz filtrować Nowych/Nieprzeczytanych wiadomości. Ta flaga pozwala zapytać o wiadomości OD CZASU ostatniego sprawdzania poczty. To znacząco wpływa na poprawę wydajnośći jezeli Twój serwer nie wspiera IMAP.',
'LBL_ONLY_SINCE' => 'Importuj tylko zmiany od odstaniego importu:',
'LBL_ONLY_SINCE_YES' => 'Tak.',
'LBL_ONLY_SINCE_NO' => 'Nie. Sprawdź wszystkie wiadomości na serwerze.',
'LBL_OUTBOUND_SERVER' => 'Serwer poczty wychodzącej',
'LBL_PASSWORD_CHECK' => 'Weryfikacja hasła',
'LBL_PASSWORD' => 'Hasło',
'LBL_POP3_SUCCESS' => 'Twoje połączenie POP3 zostało nawiązane pomyślnie.',
'LBL_POPUP_FAILURE' => 'Połączenie nie powiodło się. Informacja o błędzie poniżej',
'LBL_POPUP_SUCCESS' => 'Połączenie zakończone powodzeniem. Twoje ustawienia działają.',
'LBL_POPUP_TITLE' => 'Testuj ustawienia',
'LBL_GETTING_FOLDERS_LIST' => 'Pobieranie listy folderów',
'LBL_SELECT_SUBSCRIBED_FOLDERS' => 'Zaznacz foldery do subskrybcji',
'LBL_SELECT_TRASH_FOLDERS' => 'Wybierz folder kosza',
'LBL_SELECT_SENT_FOLDERS' => 'Wybierz folder wysłane',
'LBL_DELETED_FOLDERS_LIST' => 'Żaden z folderów %s nie istnieje, lub został usunięty z serwera',
'LBL_PORT' => 'Port serwera poczty',
'LBL_QUEUE' => 'Kolejkowanie skrzynek pocztowych',
'LBL_REPLY_NAME_ADDR' => 'Odpowiedz Nazwa/Adres',
'LBL_REPLY_TO_NAME' => 'Nazwa"Odpowiedź do"',
'LBL_REPLY_TO_ADDR' => 'Adres "Odpowiedz do"',
'LBL_SAME_AS_ABOVE' => 'Uzyj z Nazwa/Adres',
'LBL_SAVE_RAW' => 'Zapisz źródło strony',
'LBL_SAVE_RAW_DESC_1' => 'Wybierz "Tak", jeśli chcesz zabezpieczyć źródło wiadomości dla każdej importowanej wiadomości.',
'LBL_SAVE_RAW_DESC_2' => 'Duże załączniki mogą spowodować problemy tradycyjnie lub nieprawidłowo skonfigurowanych baz danych.',
'LBL_SERVER_OPTIONS' => 'Zaawansowane opcje serwera poczty',
'LBL_SERVER_TYPE' => 'Protokół serwera pocztowego',
'LBL_SERVER_URL' => 'Serwer poczty przychodzącej',
'LBL_SSL_DESC' => 'Jeżeli Twój serwer poczty wspiera bezpieczne połączenie, włączenie tej funkcji spowoduje użycie SSL podczas importowania poczty.',
'LBL_ASSIGN_TO_TEAM_DESC' => 'Zaznaczony zespół ma dostęp do konta pocztowego. Jeśli jest wybrany Folder Grupowy, zespół przydzielony do niego, jest nadrzędny wobec zaznaczonego.',
'LBL_SSL' => 'Używaj SSL',
'LBL_STATUS' => 'Status',
'LBL_SYSTEM_DEFAULT' => 'Domyślne ustawienia',
'LBL_TEST_BUTTON_KEY' => 't',
'LBL_TEST_BUTTON_TITLE'=> 'Test [Alt+T]',
'LBL_TEST_SETTINGS' => 'Testuj ustawienia',
'LBL_TEST_SUCCESSFUL' => 'Połączenie zakończone pomyślnie.',
'LBL_TEST_WAIT_MESSAGE'=> 'Poczekaj chwilę...',
'LBL_TLS_DESC' => 'Użyj TLS gdy połączony z serwerem - używaj tylko, gdy Twój serwer akceptuje ten protokół.',
'LBL_TLS' => 'Używaj TLS',
'LBL_WARN_IMAP_TITLE' => 'Ostrzeżenie IMAP',
'LBL_WARN_IMAP' => 'Ostrzeżenia:',
'LBL_WARN_NO_IMAP' => 'Ten klient nie posiada bibliotek c-client wkompilowanych do PHP (--with-imap=/path/to/imap_c-client_library). Skontatkuj się z administratorem, aby usunąć ten problem.',
'LNK_CREATE_GROUP' => 'Utwórz nową grupę',
'LNK_LIST_CREATE_NEW_BOUNCE' => 'Monitoruj nowe skrzynki',
'LNK_LIST_CREATE_NEW_GROUP' => 'Monitoruj nowe grupowe skrzynki',
'LNK_LIST_MAILBOXES' => 'Wszystkie skrzynki',
'LNK_LIST_QUEUES' => 'Wszystkie oczekujące',
'LNK_LIST_SCHEDULER' => 'Harmonogramy',
'LNK_LIST_TEST_IMPORT' => 'Testuj importowanie wiadomości',
'LNK_NEW_QUEUES' => 'Utwórz nową kolejkę',
'LNK_SEED_QUEUES' => 'Wyślij oczekujące wiadomości zespołów',
'LBL_IS_PERSONAL' => 'Osobiste konto pocztowe',
'LBL_GROUPFOLDER_ID' => 'Id grupowego folderu',
'LBL_ASSIGN_TO_GROUP_FOLDER' => 'Przydziel do grupowego folderu',
'LBL_STATUS_ACTIVE' => 'Aktywny',
'LBL_STATUS_INACTIVE' => 'Nieaktywny',
'LBL_IS_PERSONAL' => 'osobisty',
'LBL_IS_GROUP' => 'grupowy',
'LBL_ENABLE_AUTO_IMPORT' => 'Import Emails Automatically',
'LBL_WARNING_CHANGING_AUTO_IMPORT' => 'Warning: You are modifying your automatic import setting which may result in loss of data.',
'LBL_WARNING_CHANGING_AUTO_IMPORT_WITH_CREATE_CASE' => 'Warning: Auto import must be enabled when automatically creating cases.'
);
?>

View File

@@ -0,0 +1,222 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
// takes a file as an argument and parses the stuff as text;
function write_array_to_file( $the_name, $the_array, $the_file ) {
$the_string = "<?php\n" .
'\n
if(empty(\$GLOBALS["sugarEntry"])) die("Not A Valid Entry Point");
/*********************************************************************************
* 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".
********************************************************************************/' .
"\n \$$the_name = " .
var_export_helper( $the_array ) .
";\n?>\n";
if( $fh = @sugar_fopen( $the_file, "w" ) ){
fputs( $fh, $the_string);
fclose( $fh );
return( true );
}
else{
return( false );
}
}
function var_export_helper($tempArray) {
if(!is_array($tempArray)){
return var_export($tempArray, true);
}
$addNone = 0;
foreach($tempArray as $key=>$val)
{
if($key == '' && $val == '')
$addNone = 1;
}
$newArray = var_export($tempArray, true);
if($addNone)
{
$newArray = str_replace("array (", "array ( '' => '',", $newArray);
}
return $newArray;
}
function grabFiles($url) {
$dh = fsockopen($url, 80);
while($fileName = readdir($dh)) {
if(is_dir($url.$fileName)) {
grabFiles($url.$fileName);
}
$fh = sugar_fopen($url.$fileName, "r");
$fileContent = fread($fh, filesize($url.$fileName));
$writeFile = "./{$fileName}";
$fhLocal = sugar_fopen($writeFile, "w");
fwrite($writeFile, $fileContent);
}
}
///////////////////////////////////////////////////////////////////////////////
//// START CODE
while($file = readdir($dhUnicode)) {
if(is_dir($file)) {
$dhUniDeep = opendir("http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/{$file}");
}
}
$dh = opendir("./");
$search = array(" ", " ", " ", " ");
$replace = array("\t","\t","\t","\t");
if(is_resource($dh)) {
while($inputFile = readdir($dh)) {
if(strpos($inputFile, "php")) {
continue;
}
$inputFileVarSafe = str_replace("-","_",$inputFile);
$outputFile = $inputFileVarSafe.".php";
$fh = sugar_fopen($inputFile, "r");
if(is_resource($fh)) {
$charset = array();
while($line = fgets($fh)) {
$commentPos = strpos($line, "#");
if($commentPos == 0) {
continue; // skip comment strings
}
$exLine = str_replace($search, $replace, $line);
$exLine = explode("\t", $line);
$count = count($exLine);
if($count < 2) {
echo "count was {$count} :: file is {$inputFile} :: Error parsing line: {$line}\r";
continue; // unexpected explode
}
// we know 0 is charset encoding
// we know 1 is unicode in hex
$countExLine = count($exLine);
for($i=1; $i<$countExLine; $i++) {
$exLine[$i] = trim($exLine[$i]);
if($exLine[$i] != "") {
$unicode = $exLine[$i];
break 1;
}
}
$charset[$exLine[0]] = $unicode;
}
if(count($charset) > 0) {
write_array_to_file($inputFileVarSafe, $charset, $outputFile);
}
} else {
echo "Error occured reading line from file!\r";
}
}
} else {
die("no directory handle");
}
echo "DONE\r";
?>

283
modules/InboundEmail/vardefs.php Executable file
View File

@@ -0,0 +1,283 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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".
********************************************************************************/
$dictionary['InboundEmail'] = array('table' => 'inbound_email', 'comment' => 'Inbound email parameters',
'fields' => array (
'id' => array (
'name' => 'id',
'vname' => 'LBL_ID',
'type' => 'id',
'dbType' => 'varchar',
'len' => 36,
'required' => true,
'reportable'=>false,
'comment' => 'Unique identifier'
),
'deleted' => array (
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'required' => false,
'default' => '0',
'reportable'=>false,
'comment' => 'Record deltion indicator'
),
'date_entered' => array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
'required' => true,
'comment' => 'Date record created'
),
'date_modified' => array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'required' => true,
'comment' => 'Date record last modified'
),
'modified_user_id' => array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED_BY',
'type' => 'modified_user_name',
'table' => 'users',
'isnull' => false,
'dbType' => 'id',
'reportable'=>true,
'comment' => 'User who last modified record'
),
'modified_user_id_link' => array (
'name' => 'modified_user_id_link',
'type' => 'link',
'relationship' => 'inbound_email_modified_user_id',
'vname' => 'LBL_MODIFIED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
),
'created_by' => array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_ASSIGNED_TO',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => false,
'dbType' => 'id',
'comment' => 'User who created record'
),
'created_by_link' => array (
'name' => 'created_by_link',
'type' => 'link',
'relationship' => 'inbound_email_created_by',
'vname' => 'LBL_CREATED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
),
'name' => array (
'name' => 'name',
'vname' => 'LBL_NAME',
'type' => 'varchar',
'len' => '255',
'required' => false,
'reportable' => false,
'comment' => 'Name given to the inbound email mailbox'
),
'status' => array (
'name' => 'status',
'vname' => 'LBL_STATUS',
'type' => 'varchar',
'len' => '25',
'default' => 'Active',
'required' => true,
'reportable' => false,
'comment' => 'Status of the inbound email mailbox (ex: Active or Inactive)'
),
'server_url' => array (
'name' => 'server_url',
'vname' => 'LBL_SERVER_URL',
'type' => 'varchar',
'len' => '100',
'required' => true,
'reportable' => false,
'comment' => 'Mail server URL',
'importable' => 'required',
),
'email_user' => array (
'name' => 'email_user',
'vname' => 'LBL_LOGIN',
'type' => 'varchar',
'len' => '100',
'required' => true,
'reportable' => false,
'comment' => 'User name allowed access to mail server'
),
'email_password' => array (
'name' => 'email_password',
'vname' => 'LBL_PASSWORD',
'type' => 'varchar',
'len' => '100',
'required' => true,
'reportable' => false,
'comment' => 'Password of user identified by email_user'
),
'port' => array (
'name' => 'port',
'vname' => 'LBL_SERVER_TYPE',
'type' => 'int',
'len' => '5',
'required' => true,
'reportable' => false,
'validation' => array ('type' => 'range', 'min' => '110', 'max' => '65535'),
'comment' => 'Port used to access mail server'
),
'service' => array (
'name' => 'service',
'vname' => 'LBL_SERVICE',
'type' => 'varchar',
'len' => '50',
'required' => true,
'reportable' => false,
'comment' => '',
'importable' => 'required',
),
'mailbox' => array (
'name' => 'mailbox',
'vname' => 'LBL_MAILBOX',
'type' => 'text',
'required' => true,
'reportable' => false,
'comment' => ''
),
'delete_seen' => array (
'name' => 'delete_seen',
'vname' => 'LBL_DELETE_SEEN',
'type' => 'bool',
'default' => '0',
'reportable' => false,
'massupdate' => '',
'comment' => 'Delete email from server once read (seen)'
),
'mailbox_type' => array (
'name' => 'mailbox_type',
'vname' => 'LBL_MAILBOX_TYPE',
'type' => 'varchar',
'len' => '10',
'reportable' => false,
'comment' => ''
),
'template_id' => array (
'name' => 'template_id',
'vname' => 'LBL_AUTOREPLY',
'type' => 'id',
'len' => '36',
'reportable' => false,
'comment' => 'Template used for auto-reply'
),
'stored_options' => array (
'name' => 'stored_options',
'vname' => 'LBL_STORED_OPTIONS',
'type' => 'text',
'reportable' => false,
'comment' => ''
),
'group_id' => array (
'name' => 'group_id',
'vname' => 'LBL_GROUP_ID',
'type' => 'id',
'reportable' => false,
'comment' => 'Group ID (unused)'
),
'is_personal' => array (
'name' => 'is_personal',
'vname' => 'LBL_IS_PERSONAL',
'type' => 'bool',
'required' => true,
'default' => '0',
'reportable'=>false,
'massupdate' => '',
'comment' => 'Personal account flag'
),
'groupfolder_id' => array (
'name' => 'groupfolder_id',
'vname' => 'LBL_GROUPFOLDER_ID',
'type' => 'id',
'required' => false,
'reportable'=>false,
'comment' => 'Unique identifier'
),
), /* end fields() */
'indices' => array (
array(
'name' =>'inbound_emailpk',
'type' =>'primary',
'fields' => array(
'id'
)
),
), /* end indices */
'relationships' => array (
'inbound_email_created_by' => array(
'lhs_module'=> 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module'=> 'InboundEmail',
'rhs_table'=> 'inbound_email',
'rhs_key' => 'created_by',
'relationship_type' => 'one-to-one'
),
'inbound_email_modified_user_id' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module'=> 'InboundEmail',
'rhs_table'=> 'inbound_email',
'rhs_key' => 'modified_user_id',
'relationship_type' => 'one-to-one'
),
), /* end relationships */
);
VardefManager::createVardef('InboundEmail','InboundEmail', array(
));
?>