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

110
modules/Emails/Check.php Executable file
View File

@@ -0,0 +1,110 @@
<?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 $current_user;
if(isset($_REQUEST['type']) && $_REQUEST['type'] == 'personal') {
if($current_user->hasPersonalEmail()) {
$ie = new InboundEmail();
$beans = $ie->retrieveByGroupId($current_user->id);
if(!empty($beans)) {
foreach($beans as $bean) {
$bean->connectMailserver();
$newMsgs = array();
if ($bean->isPop3Protocol()) {
$newMsgs = $bean->getPop3NewMessagesToDownload();
} else {
$newMsgs = $bean->getNewMessageIds();
}
//$newMsgs = $bean->getNewMessageIds();
if(is_array($newMsgs)) {
foreach($newMsgs as $k => $msgNo) {
$uid = $msgNo;
if ($bean->isPop3Protocol()) {
$uid = $bean->getUIDLForMessage($msgNo);
} else {
$uid = imap_uid($bean->conn, $msgNo);
} // else
$bean->importOneEmail($msgNo, $uid);
}
}
imap_expunge($bean->conn);
imap_close($bean->conn);
}
}
}
header('Location: index.php?module=Emails&action=ListView&type=inbound&assigned_user_id='.$current_user->id);
} elseif(isset($_REQUEST['type']) && $_REQUEST['type'] == 'group') {
$ie = new InboundEmail();
// this query only polls Group Inboxes
$r = $ie->db->query('SELECT inbound_email.id FROM inbound_email JOIN users ON inbound_email.group_id = users.id WHERE inbound_email.deleted=0 AND inbound_email.status = \'Active\' AND mailbox_type != \'bounce\' AND users.deleted = 0 AND users.is_group = 1');
while($a = $ie->db->fetchByAssoc($r)) {
$ieX = new InboundEmail();
$ieX->retrieve($a['id']);
$ieX->connectMailserver();
//$newMsgs = $ieX->getNewMessageIds();
$newMsgs = array();
if ($ieX->isPop3Protocol()) {
$newMsgs = $ieX->getPop3NewMessagesToDownload();
} else {
$newMsgs = $ieX->getNewMessageIds();
}
if(is_array($newMsgs)) {
foreach($newMsgs as $k => $msgNo) {
$uid = $msgNo;
if ($ieX->isPop3Protocol()) {
$uid = $ieX->getUIDLForMessage($msgNo);
} else {
$uid = imap_uid($ieX->conn, $msgNo);
} // else
$ieX->importOneEmail($msgNo, $uid);
}
}
imap_expunge($ieX->conn);
imap_close($ieX->conn);
}
header('Location: index.php?module=Emails&action=ListViewGroup');
} else { // fail gracefully
header('Location: index.php?module=Emails&action=index');
}
?>

261
modules/Emails/Compose.php Executable file
View File

@@ -0,0 +1,261 @@
<?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): ______________________________________..
********************************************************************************/
//Shorten name.
$data = $_REQUEST;
//For the full compose/email screen, the compose package is generated and script execution
//continues to the Emails/index.php page.
if(!isset($data['forQuickCreate']))
$ret = generateComposeDataPackage($data);
/**
* Initialize the full compose window by creating the compose package
* and then including Emails index.php file.
*
* @param Array $ret
*/
function initFullCompose($ret)
{
global $current_user;
$json = getJSONobj();
$composeOut = $json->encode($ret);
//For listview 'Email' call initiated by subpanels, just returned the composePackage data, do not
//include the entire Emails page
if ( isset($_REQUEST['ajaxCall']) && $_REQUEST['ajaxCall'])
{
echo $composeOut;
}
else
{
//For normal full compose screen
include('modules/Emails/index.php');
echo "<script type='text/javascript' language='javascript'>\ncomposePackage = {$composeOut};\n</script>";
}
}
/**
* Generate the compose data package consumed by the full and quick compose screens.
*
* @param Array $data
* @param Bool $forFullCompose If full compose is set to TRUE, then continue execution and include the full Emails UI. Otherwise
* the data generated is returned.
*/
function generateComposeDataPackage($data,$forFullCompose = TRUE)
{
// we will need the following:
if( isset($data['parent_type']) && !empty($data['parent_type']) &&
isset($data['parent_id']) && !empty($data['parent_id']) &&
!isset($data['ListView']) && !isset($data['replyForward'])) {
global $beanList;
global $beanFiles;
global $mod_strings;
$parentName = '';
$class = $beanList[$data['parent_type']];
require_once($beanFiles[$class]);
$bean = new $class();
$bean->retrieve($data['parent_id']);
if (isset($bean->full_name)) {
$parentName = $bean->full_name;
} elseif(isset($bean->name)) {
$parentName = $bean->name;
}else{
$parentName = '';
}
$parentName = from_html($parentName);
$namePlusEmail = '';
if (isset($data['to_email_addrs'])) {
$namePlusEmail = $data['to_email_addrs'];
$namePlusEmail = from_html(str_replace("&nbsp;", " ", $namePlusEmail));
} else {
if (isset($bean->full_name)) {
$namePlusEmail = from_html($bean->full_name) . " <". from_html($bean->emailAddress->getPrimaryAddress($bean)).">";
} else if(isset($bean->emailAddress)){
$namePlusEmail = "<".from_html($bean->emailAddress->getPrimaryAddress($bean)).">";
}
}
$subject = "";
$body = "";
$email_id = "";
$attachments = array();
if ($bean->module_dir == 'Cases') {
$subject = str_replace('%1', $bean->case_number, $bean->getEmailSubjectMacro() . " ". $bean->name) ;
$bean->load_relationship("contacts");
$contact_ids = $bean->contacts->get();
$contact = new Contact();
foreach($contact_ids as $cid)
{
$contact->retrieve($cid);
$namePlusEmail .= empty($namePlusEmail) ? "" : ", ";
$namePlusEmail .= from_html($contact->full_name) . " <".from_html($contact->emailAddress->getPrimaryAddress($contact)).">";
}
}
if ($bean->module_dir == 'KBDocuments') {
require_once("modules/Emails/EmailUI.php");
$subject = $bean->kbdocument_name;
$article_body = str_replace('/'.$GLOBALS['sugar_config']['cache_dir'].'images/',$GLOBALS['sugar_config']['site_url'].'/'.$GLOBALS['sugar_config']['cache_dir'].'images/',KBDocument::get_kbdoc_body_without_incrementing_count($bean->id));
$body = from_html($article_body);
$attachments = KBDocument::get_kbdoc_attachments_for_newemail($bean->id);
$attachments = $attachments['attachments'];
} // if
if ($bean->module_dir == 'Quotes' && isset($data['recordId'])) {
$quotesData = getQuotesRelatedData($bean,$data);
global $current_language;
$namePlusEmail = $quotesData['toAddress'];
$subject = $quotesData['subject'];
$body = $quotesData['body'];
$attachments = $quotesData['attachments'];
$email_id = $quotesData['email_id'];
} // if
$ret = array(
'to_email_addrs' => $namePlusEmail,
'parent_type' => $data['parent_type'],
'parent_id' => $data['parent_id'],
'parent_name' => $parentName,
'subject' => $subject,
'body' => $body,
'attachments' => $attachments,
'email_id' => $email_id,
);
} else if(isset($_REQUEST['ListView'])) {
$email = new Email();
$namePlusEmail = $email->getNamePlusEmailAddressesForCompose($_REQUEST['action_module'], (explode(",", $_REQUEST['uid'])));
$ret = array(
'to_email_addrs' => $namePlusEmail,
);
} else if (isset($data['replyForward'])) {
require_once("modules/Emails/EmailUI.php");
$ret = array();
$ie = new InboundEmail();
$ie->email = new Email();
$ie->email->email2init();
$replyType = $data['reply'];
$email_id = $data['record'];
$ie->email->retrieve($email_id);
$emailType = "";
if ($ie->email->type == 'draft') {
$emailType = $ie->email->type;
}
$ie->email->from_addr = $ie->email->from_addr_name;
$ie->email->to_addrs = to_html($ie->email->to_addrs_names);
$ie->email->cc_addrs = to_html($ie->email->cc_addrs_names);
$ie->email->bcc_addrs = $ie->email->bcc_addrs_names;
$ie->email->from_name = $ie->email->from_addr;
$preBodyHTML = "&nbsp;<div><hr></div>";
if ($ie->email->type != 'draft') {
$email = $ie->email->et->handleReplyType($ie->email, $replyType);
} else {
$email = $ie->email;
$preBodyHTML = "";
} // else
if ($ie->email->type != 'draft') {
$emailHeader = $email->description;
}
$ret = $ie->email->et->displayComposeEmail($email);
if ($ie->email->type != 'draft') {
$ret['description'] = $emailHeader;
}
if ($replyType == 'forward' || $emailType == 'draft') {
$ret = $ie->email->et->getDraftAttachments($ret);
}
$return = $ie->email->et->getFromAllAccountsArray($ie, $ret);
if ($replyType == "forward") {
$return['to'] = '';
} else {
if ($email->type != 'draft') {
$return['to'] = from_html($ie->email->from_addr);
}
} // else
$ret = array(
'to_email_addrs' => $return['to'],
'parent_type' => $return['parent_type'],
'parent_id' => $return['parent_id'],
'parent_name' => $return['parent_name'],
'subject' => $return['name'],
'body' => $preBodyHTML . $return['description'],
'attachments' => (isset($return['attachments']) ? $return['attachments'] : array()),
'email_id' => $email_id,
'fromAccounts' => $return['fromAccounts'],
);
} else {
$ret = array(
'to_email_addrs' => '',
);
}
if($forFullCompose)
initFullCompose($ret);
else
return $ret;
}
function getQuotesRelatedData($bean,$data) {
$return = array();
$emailId = $data['recordId'];
require_once("modules/Emails/EmailUI.php");
$email = new Email();
$email->retrieve($emailId);
$return['subject'] = $email->name;
$return['body'] = from_html($email->description_html);
$return['toAddress'] = $email->to_addrs;
$ret = array();
$ret['uid'] = $emailId;
$ret = EmailUI::getDraftAttachments($ret);
$return['attachments'] = $ret['attachments'];
$return['email_id'] = $emailId;
return $return;
} // fn

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 $current_user, $app_strings;
$dashletData['MyEmailsDashlet']['searchFields'] = array(
'date_sent' => array('default' => ''),
'name' => array('default' => ''),
//'from_addr_name' => array('default' => ''),
'assigned_user_id' => array('default' => ''),
);
$dashletData['MyEmailsDashlet']['columns'] = array(
'from_addr' => array('width' => '15',
'label' => 'LBL_FROM',
'default' => true),
'name' => array('width' => '40',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'to_addrs' => array('width' => '15',
'label' => 'LBL_TO_ADDRS',
'default' => false),
'assigned_user_name' => array('width' => '15',
'label' => 'LBL_LIST_ASSIGNED',
'default' => false),
'date_sent' => array('width' => '15',
'label' => 'LBL_DATE_SENT',
'default' => true,
'defaultOrderColumn' => array('sortOrder' => 'ASC')
),
'date_entered' => array('width' => '15',
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array('width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'quick_reply' => array('width' => '15',
'label' => '',
'sortable' => false,
'default' => true),
'create_related' => array('width' => '25',
'label' => '',
'sortable' => false,
'default' => true),
);
?>

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 $app_strings;
$dashletMeta['MyEmailsDashlet'] = array('module' => 'Emails',
'title' => translate('LBL_MY_EMAILS', 'Emails'),
'description' => translate('A customizable view into Emails'),
'category' => 'Module Views',
'hidden' => true);
?>

View File

@@ -0,0 +1,123 @@
<?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/Dashlets/DashletGeneric.php');
class MyEmailsDashlet extends DashletGeneric {
function MyEmailsDashlet($id, $def = null) {
global $current_user, $app_strings, $dashletData;
require('modules/Emails/Dashlets/MyEmailsDashlet/MyEmailsDashlet.data.php');
parent::DashletGeneric($id, $def);
if(empty($def['title']))
$this->title = translate('LBL_MY_EMAILS', 'Emails');
$this->searchFields = $dashletData['MyEmailsDashlet']['searchFields'];
$this->hasScript = true; // dashlet has javascript attached to it
$this->columns = $dashletData['MyEmailsDashlet']['columns'];
$this->seedBean = new Email();
}
function process() {
global $current_language, $app_list_strings, $image_path, $current_user;
//$where = 'emails.deleted = 0 AND emails.assigned_user_id = \''.$current_user->id.'\' AND emails.type = \'inbound\' AND emails.status = \'unread\'';
$mod_strings = return_module_language($current_language, 'Emails');
if ($this->myItemsOnly) {
$this->filters['assigned_user_id'] = $current_user->id;
}
$this->filters['type'] = array("inbound");
$this->filters['status'] = array("unread");
$lvsParams = array();
$lvsParams['custom_select'] = " ,emails_text.from_addr as from_addr ";
$lvsParams['custom_from'] = " join emails_text on emails.id = emails_text.email_id ";
parent::process($lvsParams);
}
function displayScript() {
global $current_language;
$mod_strings = return_module_language($current_language, 'Emails');
$casesImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Cases.gif') . "\"";
$leadsImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Leads.gif') . "\"";
$contactsImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Contacts.gif') . "\"";
$bugsImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Bugs.gif') . "\"";
$tasksURL = "\"" . SugarThemeRegistry::current()->getImageURL('Tasks.gif') . "\"";
$script = <<<EOQ
<script>
function quick_create_overlib(id, theme) {
return overlib('<a style=\'width: 150px\' class=\'menuItem\' onmouseover=\'hiliteItem(this,"yes");\' onmouseout=\'unhiliteItem(this);\' href=\'index.php?module=Cases&action=EditView&inbound_email_id=' + id + '\'>' +
"<img border='0' src='" + {$casesImageURL} + "' style='margin-right:5px'>" + '{$mod_strings['LBL_LIST_CASE']}' + '</a>' +
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=Leads&action=EditView&inbound_email_id=" + id + "'>" +
"<img border='0' src='" + {$leadsImageURL} + "' style='margin-right:5px'>"
+ '{$mod_strings['LBL_LIST_LEAD']}' + "</a>" +
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=Contacts&action=EditView&inbound_email_id=" + id + "'>" +
"<img border='0' src='" + {$contactsImageURL} + "' style='margin-right:5px'>"
+ '{$mod_strings['LBL_LIST_CONTACT']}' + "</a>" +
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=Bugs&action=EditView&inbound_email_id=" + id + "'>"+
"<img border='0' src='" + {$bugsImageURL} + "' style='margin-right:5px'>"
+ '{$mod_strings['LBL_LIST_BUG']}' + "</a>" +
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=Tasks&action=EditView&inbound_email_id=" + id + "'>" +
"<img border='0' src='" + {$tasksURL} + "' style='margin-right:5px'>"
+ '{$mod_strings['LBL_LIST_TASK']}' + "</a>"
, CAPTION, '{$mod_strings['LBL_QUICK_CREATE']}'
, STICKY, MOUSEOFF, 3000, CLOSETEXT, '<div style="float:right"><img border=0 src="themes/default/images/close_inline.gif"></div>', WIDTH, 150, CLOSETITLE, SUGAR.language.get('app_strings', 'LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'), CLOSECLICK, FGCLASS, 'olOptionsFgClass',
CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');
}
</script>
EOQ;
return $script;
}
}
?>

71
modules/Emails/Delete.php Executable file
View File

@@ -0,0 +1,71 @@
<?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): ______________________________________..
********************************************************************************/
$focus = new Email();
if(!isset($_REQUEST['record']))
sugar_die("A record number must be specified to delete the email.");
$focus->retrieve($_REQUEST['record']);
$email_type = $focus->type;
if(!$focus->ACLAccess('Delete')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$focus->mark_deleted($_REQUEST['record']);
// make sure assigned_user_id is set - during testing this isn't always set
if (!isset($_REQUEST['assigned_user_id'])) {
$_REQUEST['assigned_user_id'] = '';
}
if ($email_type == 'archived') {
global $current_user;
$loc = 'Location: index.php?module=Emails&action=ListView&all=true';
} else {
$loc = 'Location: index.php?module='.$_REQUEST['return_module'].'&action='.$_REQUEST['return_action'].'&record='.$_REQUEST['return_id'].'&type='.$_REQUEST['type'].'&assigned_user_id='.$_REQUEST['assigned_user_id'];
}
header($loc);
?>

164
modules/Emails/DetailView.html Executable file
View File

@@ -0,0 +1,164 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" language="Javascript">
{JS_VARS}
</script>
<form action="index.php" method="POST" name="DetailView" id="form">
<input type="hidden" name="module" value="Emails">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="contact_id" value="{CONTACT_ID}">
<input type="hidden" name="user_id" value="{USER_ID}">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id">
<input type="hidden" name="assigned_user_id">
<input type="hidden" name="type" value="{TYPE}">
<table width="10%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input title="{APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{APP.LBL_EDIT_BUTTON_KEY}" class="button"
onclick=" this.form.return_module.value='Emails';
this.form.return_action.value='DetailView';
this.form.return_id.value='{ID}';
this.form.action.value='EditView'"
type="submit" name="Edit" value=" {APP.LBL_EDIT_BUTTON} ">
</td>
<td>&nbsp;</td>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input title="{APP.LBL_DELETE_BUTTON_TITLE}"
accessKey="{APP.LBL_DELETE_BUTTON_KEY}"
class="button" onclick="this.form.return_module.value='{DELETE_RETURN_MODULE}';
this.form.return_action.value='{DELETE_RETURN_ACTION}';
this.form.return_id.value='{DELETE_RETURN_ID}';
this.form.type.value='{DELETE_RETURN_TYPE}';
this.form.assigned_user_id.value='{DELETE_RETURN_ASSIGNED_USER_ID}';
this.form.action.value='Delete';
return confirm('{APP.NTC_DELETE_CONFIRMATION}')"
type="submit" name="button"
value=" {APP.LBL_DELETE_BUTTON} "
>
</td>
<td>&nbsp;</td>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input type="button" name="button" class="button"
style="display:{DISABLE_RAW_BUTTON};"
id="rawButton"
title="{MOD.LBL_BUTTON_RAW_TITLE}"
accesskey="{MOD.LBL_BUTTON_RAW_KEY}"
value=" {MOD.LBL_BUTTON_RAW_LABEL} "
onclick="open_popup('Emails', 800, 600, '', true, true, '', 'show_raw', '', '{RAW_METADATA}');"
/>
</td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
</form>
<div class="detail view">
<table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0">
{PAGINATION}
<tr>
<td width="15%" scope="row"><slot>{MOD.LBL_DATE_SENT}</slot></td>
<td width="35%"><slot>{DATE_START} {TIME_START}&nbsp;</slot></td>
<td scope="row"><slot>{APP.LBL_DATE_ENTERED}</slot></td>
<td><slot>{DATE_ENTERED} {APP.LBL_BY} {CREATED_BY}&nbsp;</slot></td>
</tr>
<tr>
<!-- BEGIN: open_source -->
<td scope="row"><slot>&nbsp;</slot></td>
<td><slot>&nbsp;</slot></td>
<!-- END: open_source -->
<td scope="row"><slot>{APP.LBL_DATE_MODIFIED}</slot></td>
<td><slot>{DATE_MODIFIED} {APP.LBL_BY} {MODIFIED_BY}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>{APP.LBL_ASSIGNED_TO}</slot></td>
<td valign="top"><slot>{ASSIGNED_TO}&nbsp;</slot></td>
<td scope="row"><slot>{PARENT_TYPE}</slot></td>
<td><slot>{PARENT_NAME}</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_FROM}</slot></td>
<td colspan=3><slot>{FROM}&nbsp;</slot></td>
</tr>
{REPLY_TO}
<tr>
<td scope="row"><slot>{MOD.LBL_TO}</slot></td>
<td colspan='3'><slot>{TO}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_CC}</slot></td>
<td colspan='3'><slot>{CC}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_BCC}</slot></td>
<td colspan='3'><slot>{BCC}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_SUBJECT}</slot></td>
<td colspan='3'><slot>{NAME}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{MOD.LBL_BODY}</slot></td>
<td colspan="3" style="background-color: #ffffff; color: #000000" ><slot>
<div id="html_div" style="background-color: #ffffff;padding: 5px">{DESCRIPTION_HTML}</div>
<input id='toggle_textarea_elem' onclick="toggle_textarea();" type="checkbox" name="toggle_html"/> <label for='toggle_textarea_elem'>{MOD.LBL_SHOW_ALT_TEXT}</label><br>
<div id="text_div" style="display: none;background-color: #ffffff;padding: 5px">{DESCRIPTION}</div>
<script type="text/javascript" language="Javascript">
var plainOnly = {SHOW_PLAINTEXT};
if(plainOnly == true) {
document.getElementById("toggle_textarea_elem").checked = true;
toggle_textarea();
}
</script>
</td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{MOD.LBL_ATTACHMENTS}</slot></td>
<td colspan="3"><slot>{ATTACHMENTS}</slot></td>
</tr>
</table>
</div>
<!-- END: main -->

344
modules/Emails/DetailView.php Executable file
View File

@@ -0,0 +1,344 @@
<?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): ______________________________________..
********************************************************************************/
///////////////////////////////////////////////////////////////////////////////
//// CANCEL HANDLING
if(!isset($_REQUEST['record']) || empty($_REQUEST['record'])) {
header("Location: index.php?module=Emails&action=index");
}
//// CANCEL HANDLING
///////////////////////////////////////////////////////////////////////////////
require_once('include/DetailView/DetailView.php');
global $gridline;
global $app_strings;
// SETTING DEFAULTS
$focus = new Email();
$detailView = new DetailView();
$offset = 0;
$email_type = 'archived';
///////////////////////////////////////////////////////////////////////////////
//// TO HANDLE 'NEXT FREE'
if(!empty($_REQUEST['next_free']) && $_REQUEST['next_free'] == true) {
$_REQUEST['record'] = $focus->getNextFree();
}
//// END 'NEXT FREE'
///////////////////////////////////////////////////////////////////////////////
if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
$result = $detailView->processSugarBean("EMAIL", $focus, $offset);
if($result == null) {
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$focus=$result;
} else {
header("Location: index.php?module=Emails&action=index");
die();
}
/* if the Email status is draft, say as a saved draft to a Lead/Case/etc.,
* don't show detail view. go directly to EditView */
if($focus->status == 'draft') {
//header('Location: index.php?module=Emails&action=EditView&record='.$_REQUEST['record']);
//die();
}
//needed when creating a new email with default values passed in
if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
$focus->contact_name = $_REQUEST['contact_name'];
}
if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
$focus->contact_id = $_REQUEST['contact_id'];
}
if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) {
$focus->parent_name = $_REQUEST['opportunity_name'];
}
if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) {
$focus->parent_id = $_REQUEST['opportunity_id'];
}
if (isset($_REQUEST['account_name']) && is_null($focus->parent_name)) {
$focus->parent_name = $_REQUEST['account_name'];
}
if (isset($_REQUEST['account_id']) && is_null($focus->parent_id)) {
$focus->parent_id = $_REQUEST['account_id'];
}
// un/READ flags
if (!empty($focus->status)) {
// "Read" flag for InboundEmail
if($focus->status == 'unread') {
// creating a new instance here to avoid data corruption below
$e = new Email();
$e->retrieve($focus->id);
$e->status = 'read';
$e->save();
$email_type = $e->status;
} else {
$email_type = $focus->status;
}
} elseif (!empty($_REQUEST['type'])) {
$email_type = $_REQUEST['type'];
}
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
///////////////////////////////////////////////////////////////////////////////
echo "\n<p>\n";
$GLOBALS['log']->info("Email detail view");
if ($email_type == 'archived') {
echo get_module_title('Emails', $mod_strings['LBL_ARCHIVED_EMAIL'].": ".$focus->name, true);
$xtpl=new XTemplate ('modules/Emails/DetailView.html');
} else {
$xtpl=new XTemplate ('modules/Emails/DetailViewSent.html');
if($focus->type == 'out') {
echo get_module_title('Emails', $mod_strings['LBL_SENT_MODULE_NAME'].": ".$focus->name, true);
//$xtpl->assign('DISABLE_REPLY_BUTTON', 'NONE');
} elseif ($focus->type == 'draft') {
$xtpl->assign('DISABLE_FORWARD_BUTTON', 'NONE');
echo get_module_title('Emails', $mod_strings['LBL_LIST_FORM_DRAFTS_TITLE'].": ".$focus->name, true);
} elseif($focus->type == 'inbound') {
echo get_module_title('Emails', $mod_strings['LBL_INBOUND_TITLE'].": ".$focus->name, true);
}
}
echo "\n</p>\n";
///////////////////////////////////////////////////////////////////////////////
//// RETURN NAVIGATION
$uri = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'index.php';
$start = $focus->getStartPage($uri);
if (isset($_REQUEST['return_id'])) { // coming from a subpanel, return_module|action is not set
$xtpl->assign('RETURN_ID', $_REQUEST['return_id']);
if (isset($_REQUEST['return_module'])) $xtpl->assign('RETURN_MODULE', $_REQUEST['return_module']);
else $xtpl->assign('RETURN_MODULE', 'Emails');
if (isset($_REQUEST['return_action'])) $xtpl->assign('RETURN_ACTION', $_REQUEST['return_action']);
else $xtpl->assign('RETURN_ACTION', 'DetailView');
}
if(isset($start['action']) && !empty($start['action'])) {
$xtpl->assign('DELETE_RETURN_ACTION', $start['action']);
}
if(isset($start['module']) && !empty($start['module'])) {
$xtpl->assign('DELETE_RETURN_MODULE', $start['module']);
}
if(isset($start['record']) && !empty($start['record'])) {
$xtpl->assign('DELETE_RETURN_ID', $start['record']);
}
// this is to support returning to My Inbox
if(isset($start['type']) && !empty($start['type'])) {
$xtpl->assign('DELETE_RETURN_TYPE', $start['type']);
}
if(isset($start['assigned_user_id']) && !empty($start['assigned_user_id'])) {
$xtpl->assign('DELETE_RETURN_ASSIGNED_USER_ID', $start['assigned_user_id']);
}
//// END RETURN NAVIGATION
///////////////////////////////////////////////////////////////////////////////
// DEFAULT TO TEXT IF NO HTML CONTENT:
$html = trim(from_html($focus->description_html));
if(empty($html)) {
$xtpl->assign('SHOW_PLAINTEXT', 'true');
$description = nl2br($focus->description);
} else {
$xtpl->assign('SHOW_PLAINTEXT', 'false');
$description = from_html($focus->description_html);
}
$show_subpanels=true;
//if the email is of type campaign, process the macros...using the values stored in the relationship table.
//this is is part of the feature that adds support for one email per campaign.
if ($focus->type=='campaign' and !empty($_REQUEST['parent_id']) and !empty($_REQUEST['parent_module'])) {
$show_subpanels=false;
$parent_id=$_REQUEST['parent_id'];
// cn: bug 14300 - emails_beans schema refactor - fixing query
$query="SELECT * FROM emails_beans WHERE email_id='{$focus->id}' AND bean_id='{$parent_id}' AND bean_module = '{$_REQUEST['parent_module']}' " ;
$res=$focus->db->query($query);
$row=$focus->db->fetchByAssoc($res);
if (!empty($row)) {
$campaign_data=$row['campaign_data'];
$macro_values=array();
if (!empty($campaign_data)) {
$macro_values=unserialize(from_html($campaign_data));
}
if (count($macro_values) > 0) {
$m_keys=array_keys($macro_values);
$m_values=array_values($macro_values);
$focus->name = str_replace($m_keys,$m_values,$focus->name);
$focus->description = str_replace($m_keys,$m_values,$focus->description);
$focus->description_html = str_replace($m_keys,$m_values,$focus->description_html);
if (!empty($macro_values['sugar_to_email_address'])) {
$focus->to_addrs=$macro_values['sugar_to_email_address'];
}
}
}
}
//if not empty or set to test (from test campaigns)
if (!empty($focus->parent_type) && $focus->parent_type !='test') {
$xtpl->assign('PARENT_MODULE', $focus->parent_type);
$xtpl->assign('PARENT_TYPE_UNTRANSLATE', $focus->parent_type);
$xtpl->assign('PARENT_TYPE', $app_list_strings['record_type_display'][$focus->parent_type] . ':');
}
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('GRIDLINE', $gridline);
$xtpl->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
$xtpl->assign('ID', $focus->id);
$xtpl->assign('TYPE', $email_type);
$xtpl->assign('PARENT_NAME', $focus->parent_name);
$xtpl->assign('PARENT_ID', $focus->parent_id);
$xtpl->assign('NAME', $focus->name);
$xtpl->assign('ASSIGNED_TO', $focus->assigned_user_name);
$xtpl->assign('DATE_MODIFIED', $focus->date_modified);
$xtpl->assign('DATE_ENTERED', $focus->date_entered);
$xtpl->assign('DATE_START', $focus->date_start);
$xtpl->assign('TIME_START', $focus->time_start);
$xtpl->assign('FROM', $focus->from_addr);
$xtpl->assign('TO', nl2br($focus->to_addrs));
$xtpl->assign('CC', nl2br($focus->cc_addrs));
$xtpl->assign('BCC', nl2br($focus->bcc_addrs));
$xtpl->assign('CREATED_BY', $focus->created_by_name);
$xtpl->assign('MODIFIED_BY', $focus->modified_by_name);
$xtpl->assign('DESCRIPTION', nl2br($focus->description));
$xtpl->assign('DESCRIPTION_HTML', from_html($focus->description_html));
$xtpl->assign('DATE_SENT', $focus->date_entered);
$xtpl->assign('EMAIL_NAME', 'RE: '.$focus->name);
$xtpl->assign("TAG", $focus->listviewACLHelper());
if(!empty($focus->raw_source)) {
$xtpl->assign("RAW_METADATA", $focus->id);
} else {
$xtpl->assign("DISABLE_RAW_BUTTON", 'none');
}
if(!empty($focus->reply_to_email)) {
$replyTo = "
<tr>
<td class=\"tabDetailViewDL\"><slot>".$mod_strings['LBL_REPLY_TO_NAME']."</slot></td>
<td colspan=3 class=\"tabDetailViewDF\"><slot>".$focus->reply_to_email."</slot></td>
</tr>";
$xtpl->assign("REPLY_TO", $replyTo);
}
///////////////////////////////////////////////////////////////////////////////
//// JAVASCRIPT VARS
$jsVars = '';
$jsVars .= "var showRaw = '{$mod_strings['LBL_BUTTON_RAW_LABEL']}';";
$jsVars .= "var hideRaw = '{$mod_strings['LBL_BUTTON_RAW_LABEL_HIDE']}';";
$xtpl->assign("JS_VARS", $jsVars);
// ADMIN EDIT
if(is_admin($GLOBALS['current_user']) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
if(isset($_REQUEST['offset']) && !empty($_REQUEST['offset'])) { $offset = $_REQUEST['offset']; }
else $offset = 1;
$detailView->processListNavigation($xtpl, "EMAIL", $offset, false);
// adding custom fields:
require_once('modules/DynamicFields/templates/Files/DetailView.php');
$do_open = true;
if ($do_open) {
$xtpl->parse("main.open_source");
}
///////////////////////////////////////////////////////////////////////////////
//// NOTES (attachements, etc.)
///////////////////////////////////////////////////////////////////////////////
$note = new Note();
$where = "notes.parent_id='{$focus->id}'";
//take in account if this is from campaign and the template id is stored in the macros.
if(isset($macro_values) && isset($macro_values['email_template_id'])){
$where = "notes.parent_id='{$macro_values['email_template_id']}'";
}
$notes_list = $note->get_full_list("notes.name", $where, true);
if(! isset($notes_list)) {
$notes_list = array();
}
$attachments = '';
for($i=0; $i<count($notes_list); $i++) {
$the_note = $notes_list[$i];
if(!empty($the_note->filename))
$attachments .= "<a href=\"index.php?entryPoint=download&id=".$the_note->id."&type=Notes\">".$the_note->name."</a><br />";
}
$xtpl->assign("ATTACHMENTS", $attachments);
$xtpl->parse("main");
$xtpl->out("main");
$sub_xtpl = $xtpl;
$old_contents = ob_get_contents();
ob_end_clean();
ob_start();
echo $old_contents;
///////////////////////////////////////////////////////////////////////////////
//// SUBPANELS
///////////////////////////////////////////////////////////////////////////////
if ($show_subpanels) {
require_once('include/SubPanel/SubPanelTiles.php');
$subpanel = new SubPanelTiles($focus, 'Emails');
echo $subpanel->display();
}
?>

View File

@@ -0,0 +1,181 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" language="Javascript">
{JS_VARS}
</script>
<form action="index.php" method="POST" name="DetailView" id="form">
<input type="hidden" name="module" value="Emails">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="contact_id" value="{CONTACT_ID}">
<input type="hidden" name="user_id" value="{USER_ID}">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id">
<input type="hidden" name="type" value="out">
<input type="hidden" name="assigned_user_id">
<input type="hidden" name="parent_id" value="{PARENT_ID}">
<input type="hidden" name="parent_type" value="{PARENT_TYPE_UNTRANSLATE}">
<input type="hidden" name="parent_name" value="{PARENT_NAME}">
<input type="hidden" name="inbound_email_id" value="{ID}">
<input type="hidden" name="email_name" value="{EMAIL_NAME}">
<input type="hidden" name="to_email_addrs" value="{FROM}">
<table width="10%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input title="{MOD.LBL_BUTTON_FORWARD}"
accessKey="{MOD.LBL_BUTTON_FORWARD_KEY}"
class="button" onclick="this.form.return_module.value='{RETURN_MODULE}';
this.form.return_action.value='{RETURN_ACTION}';
this.form.return_id.value='{ID}';
this.form.action.value='EditView';
this.form.type.value='forward'"
type="submit" name="button"
value=" {MOD.LBL_BUTTON_FORWARD} "
style="display:{DISABLE_FORWARD_BUTTON};"
>
</td>
<td>&nbsp;</td>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input title="{MOD.LBL_BUTTON_REPLY_TITLE}"
accessKey="{MOD.LBL_BUTTON_REPLY_KEY}"
class="button" onclick="this.form.return_module.value='{RETURN_MODULE}';
this.form.return_action.value='{RETURN_ACTION}';
this.form.return_id.value='{ID}';
this.form.action.value='EditView'"
type="submit" name="button"
value=" {MOD.LBL_BUTTON_REPLY} "
style="display:{DISABLE_REPLY_BUTTON};"
>
</td>
<td>&nbsp;</td>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input title="{APP.LBL_DELETE_BUTTON_TITLE}"
accessKey="{APP.LBL_DELETE_BUTTON_KEY}"
class="button" onclick="this.form.return_module.value='{DELETE_RETURN_MODULE}';
this.form.return_action.value='{DELETE_RETURN_ACTION}';
this.form.return_id.value='{DELETE_RETURN_ID}';
this.form.type.value='{DELETE_RETURN_TYPE}';
this.form.assigned_user_id.value='{DELETE_RETURN_ASSIGNED_USER_ID}';
this.form.action.value='Delete';
return confirm('{APP.NTC_DELETE_CONFIRMATION}')"
type="submit" name="button"
value=" {APP.LBL_DELETE_BUTTON} "
>
</td>
<td>&nbsp;</td>
<td style="padding-bottom: 2px;" align="left" width="5%">
<input type="button" name="button" class="button"
style="display:{DISABLE_RAW_BUTTON};"
id="rawButton"
title="{MOD.LBL_BUTTON_RAW_TITLE}"
accesskey="{MOD.LBL_BUTTON_RAW_KEY}"
value=" {MOD.LBL_BUTTON_RAW_LABEL} "
onclick="open_popup('Emails', 800, 600, '', true, true, '', 'show_raw', '', '{RAW_METADATA}');"
/>
</td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
</form>
<div class="detail view">
<table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0">
{PAGINATION}
<tr>
<td width="15%" scope="row"><slot>{APP.LBL_ASSIGNED_TO}</slot></td>
<td width="35%" valign="top"><slot>{ASSIGNED_TO}</slot></td>
<td width="15%" scope="row"><slot>{MOD.LBL_DATE_SENT}</slot></td>
<td width="35%" colspan="3"><slot>{DATE_START} {TIME_START}</slot></td>
</tr>
<tr>
<!-- BEGIN: open_source -->
<td scope="row"><slot>&nbsp;</slot></td>
<td><slot>&nbsp;</slot></td>
<!-- END: open_source -->
<td scope="row"><slot>{PARENT_TYPE}</slot></td>
<td><slot>{PARENT_NAME}</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_FROM}</slot></td>
<td colspan=3><slot>{FROM}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_TO}</slot></td>
<td colspan='3'><slot>{TO}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_CC}</slot></td>
<td colspan='3'><slot>{CC}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_BCC}</slot></td>
<td colspan='3'><slot>{BCC}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_SUBJECT}</slot></td>
<td colspan='3'><slot>{NAME}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{MOD.LBL_BODY}</slot></td>
<td colspan="3" style="background-color: #ffffff; color: #000000" ><slot>
<div id="html_div" style="background-color: #ffffff;padding: 5px">{DESCRIPTION_HTML}</div>
<input id='toggle_textarea_elem' onclick="toggle_textarea();" type="checkbox" name="toggle_html"/> <label for='toggle_textarea_elem'>{MOD.LBL_SHOW_ALT_TEXT}</label><br>
<div id="text_div" style="display: none;background-color: #ffffff;padding: 5px">{DESCRIPTION}</div>
<script type="text/javascript" language="Javascript">
var plainOnly = {SHOW_PLAINTEXT};
if(plainOnly == true) {
document.getElementById("toggle_textarea_elem").checked = true;
toggle_textarea();
}
</script>
</td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{MOD.LBL_ATTACHMENTS}</slot></td>
<td colspan="3"><slot>{ATTACHMENTS}</slot></td>
</tr>
</table>
</div>
<!-- END: main -->

113
modules/Emails/Distribute.php Executable file
View File

@@ -0,0 +1,113 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
if(!empty($_SESSION['distribute_where']) && !empty($_REQUEST['distribute_method']) && !empty($_REQUEST['users']) && !empty($_REQUEST['use'])) {
require_once('modules/Emails/Email.php');
$focus = new Email();
$emailIds = array();
// CHECKED ONLY:
if($_REQUEST['use'] == 'checked') {
// clean up passed array
$grabEx = explode('::',$_REQUEST['grabbed']);
foreach($grabEx as $k => $emailId) {
if($emailId != "undefined") {
$emailIds[] = $emailId;
}
}
// we have users and the items to distribute
if($_REQUEST['distribute_method'] == 'roundRobin') {
if($focus->distRoundRobin($_REQUEST['users'], $emailIds)) {
header('Location: index.php?module=Emails&action=ListViewGroup');
}
} elseif($_REQUEST['distribute_method'] == 'leastBusy') {
if($focus->distLeastBusy($_REQUEST['users'], $emailIds)) {
header('Location: index.php?module=Emails&action=ListViewGroup');
}
} elseif($_REQUEST['distribute_method'] == 'direct') {
// direct assignment
// _ppd('count:'.count($_REQUEST['users']));
if(count($_REQUEST['users']) > 1) {
// only 1 user allowed in direct assignment
$error = 1;
} else {
$user = $_REQUEST['users'][0];
if($focus->distDirect($user, $emailIds)) {
header('Location: index.php?module=Emails&action=ListViewGroup');
}
}
header('Location: index.php?module=Emails&action=ListViewGroup&error='.$error);
}
} elseif($_REQUEST['use'] == 'all') {
if($_REQUEST['distribute_method'] == 'direct') {
// no ALL assignments to 1 user
header('Location: index.php?module=Emails&action=ListViewGroup&error=2');
}
// we have the where clause that generated the view above, so use it
$q = 'SELECT emails.id FROM emails WHERE '.$_SESSION['distribute_where'];
$q = str_replace('&#039;', '"', $q);
$r = $focus->db->query($q);
$count = 0;
while($a = $focus->db->fetchByAssoc($r)) {
$emailIds[] = $a['id'];
$count++;
}
// we have users and the items to distribute
if($_REQUEST['distribute_method'] == 'roundRobin') {
if($focus->distRoundRobin($_REQUEST['users'], $emailIds)) {
header('Location: index.php?module=Emails&action=ListViewGroup');
}
} elseif($_REQUEST['distribute_method'] == 'leastBusy') {
if($focus->distLeastBusy($_REQUEST['users'], $emailIds)) {
header('Location: index.php?module=Emails&action=ListViewGroup');
}
}
if($count < 1) {
$GLOBALS['log']->info('Emails distribute failed: query returned no results ('.$q.')');
header('Location: index.php?module=Emails&action=ListViewGroup&error='.$error);
}
}
} else {
// error
header('Location: index.php?module=Emails&action=index');
}
?>

433
modules/Emails/EditView.html Executable file
View File

@@ -0,0 +1,433 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" language="Javascript">
{JS_VARS}
</script>
<script type="text/javascript" src="include/jsolait/init.js?s={SUGAR_VERSION}&amp;c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/jsclass_base.js?s={SUGAR_VERSION}&amp;c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/jsclass_async.js?s={SUGAR_VERSION}&amp;c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&amp;c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="modules/Documents/documents.js?s={SUGAR_VERSION}&amp;c={JS_CUSTOM_VERSION}"></script>
{MESSAGE}
<form action="index.php" method="post" id="EditView" name="EditView" enctype="multipart/form-data">
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="action" value="Save" />
<input type="hidden" name="contact_id" value="{CONTACT_ID}" />
<input type="hidden" name="user_id" value="{USER_ID}" />
<input type="hidden" name="return_module" value="{RETURN_MODULE}" />
<input type="hidden" name="return_id" value="{RETURN_ID}" />
<input type="hidden" name="send" value="" />
<input type="hidden" name="type" value="out" />
<input type="hidden" name="record" value="{ID}" />
<input type="hidden" name="return_action" value="{RETURN_ACTION}" />
<input type="hidden" name="inbound_email_id" value="{INBOUND_EMAIL_ID}" />
<input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}" />
<input type="hidden" name="object_type" value="{OBJECT_TYPE}" />
<input type="hidden" name="object_id" value="{OBJECT_ID}" />
<input type="hidden" name="group" value="{GROUP}" />
<input type="hidden" name="origType" value="{TYPE}" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input type="submit" name="button" class="button" {disable_send} title="{MOD.LBL_SEND_BUTTON_TITLE}" accesskey="{MOD.LBL_SEND_BUTTON_KEY}" value=" {MOD.LBL_SEND_BUTTON_LABEL} " onclick="prepSave();this.form.action.value='Save';this.form.send.value='1';this.form.type.value='out';return fill_form('out', '{MOD.ERR_NOT_ADDRESSED}');" />
<input type="submit" name="button" class="button" title="{MOD.LBL_SAVE_AS_DRAFT_BUTTON_TITLE}" accesskey="{MOD.LBL_SAVE_AS_DRAFT_BUTTON_KEY}" value=" {MOD.LBL_SAVE_AS_DRAFT_BUTTON_LABEL} " onclick="this.form.action.value='Save';this.form.send.value='0';this.form.type.value='draft';fill_form('draft', '{MOD.ERR_NOT_ADDRESSED}');" />
<input type="submit" name="button" class="button" title="{APP.LBL_CANCEL_BUTTON_TITLE}" accesskey="{APP.LBL_CANCEL_BUTTON_KEY}" value=" {APP.LBL_CANCEL_BUTTON_LABEL} " onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'; {MYINBOX}" />
</td>
<td align="right" nowrap>
</td>
<td align='right'>
{ADMIN_EDIT}
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- BEGIN: open_source_1 -->
<td nowrap>
<slot>
</slot>
</td>
<td nowrap>
<slot>
</slot>
</td>
<!-- END: open_source_1 -->
<td nowrap>
<slot>
</slot>
</td>
<td scope="row" valign="top" align="right">
<slot>
<select tabindex='2' name='parent_type' onchange=" document.EditView.parent_name.value='';
changeQS();
checkParentType(document.EditView.parent_type.value, document.EditView.change_parent);">
{TYPE_OPTIONS}</select>&nbsp;
</slot>
</td>
<td nowrap>
<slot>
<input id='parent_id' name='parent_id' type="hidden" value='{PARENT_ID}'>
<input class="sqsEnabled" id='parent_name' name='parent_name' tabindex='2' type='text' value="{PARENT_NAME}">
&nbsp;{CHANGE_PARENT_BUTTON}
</slot>
</td>
</tr>
<tr>
<td scope="row">
<slot>
{APP.LBL_ASSIGNED_TO}&nbsp;
</slot>
</td>
<td >
<slot>
<input class="sqsEnabled" tabindex='1' id="assigned_user_name" name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accesskey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" tabindex='1' class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn1" onclick='open_popup("Users", 600, 400, "", true, false, {encoded_users_popup_request_data});' />
</slot>
</td>
<td nowrap>
<slot>
</slot>
</td>
<td nowrap>
<slot>
</slot>
</td>
<td nowrap>
<slot>
</slot>
</td>
</tr>
<tr>
<td colspan="5">
&nbsp;
</td>
</tr>
<tr>
<td colspan="1">
&nbsp;
</td>
<td colspan="4">
{MOD.LBL_NOTE_SEMICOLON}
</td>
<td colspan="2">
&nbsp;
</td>
</tr>
<tr valign="top">
<td scope="row">
<slot>
{MOD.LBL_TO}
</slot>
</td>
<td colspan="4" nowrap="NOWRAP">
<slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="to_addrs_field" name='to_addrs' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{TO_ADDRS}">{TO_ADDRS}</textarea>
<input type="hidden" id="to_addrs_ids" name="to_addrs_ids" value="{TO_ADDRS_IDS}" />
<input type="hidden" id="to_addrs_emails" name="to_addrs_emails" value="{TO_ADDRS_EMAILS}" />
<input type="hidden" id="to_addrs_names" name="to_addrs_names" value="{TO_ADDRS_NAMES}" />
</td>
<td style="padding-left: 4px;">
{CHANGE_TO_ADDRS_BUTTON}
</td>
</tr>
</table>
</slot>
</td>
</tr>
<tr>
<td scope="row">
<slot>
{MOD.LBL_CC}
</slot>
</td>
<td colspan="4" nowrap="NOWRAP">
<slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="cc_addrs_field" name='cc_addrs' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{CC_ADDRS}">{CC_ADDRS}</textarea>
<input type="hidden" id="cc_addrs_ids" name="cc_addrs_ids" value="{CC_ADDRS_IDS}" />
<input type="hidden" id="cc_addrs_emails" name="cc_addrs_emails" value="{CC_ADDRS_EMAILS}" />
<input type="hidden" id="cc_addrs_names" name="cc_addrs_names" value="{CC_ADDRS_NAMES}" />
</td>
<td style="padding-left: 4px;">
{CHANGE_CC_ADDRS_BUTTON}
</td>
</tr>
</table>
</slot>
</td>
</tr>
<tr valign="top">
<td scope="row">
<slot>
{MOD.LBL_BCC}
</slot>
</td>
<td colspan="4" nowrap="NOWRAP">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="bcc_addrs_field" name='bcc_addrs' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{BCC_ADDRS}">{BCC_ADDRS}</textarea>
<input type="hidden" id="bcc_addrs_ids" name="bcc_addrs_ids" value="{BCC_ADDRS_IDS}" />
<input type="hidden" id="bcc_addrs_emails" name="bcc_addrs_emails" value="{BCC_ADDRS_EMAILS}" />
<input type="hidden" id="bcc_addrs_names" name="bcc_addrs_names" value="{BCC_ADDRS_NAMES}" />
</td>
<td style="padding-left: 4px;">
{CHANGE_BCC_ADDRS_BUTTON}
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td scope="row">
<slot>
{MOD.LBL_FROM}
</slot>
</td>
<td colspan="4" nowrap="NOWRAP">
<slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="from_addr_field" name='from_addr' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{FROM_ADDR}">{FROM_ADDR}</textarea> {FROM_ADDR_GROUP}
<input type="hidden" id="from_addr_email" name="from_addr_email" />
<input type="hidden" id="from_addr_name" name="from_addr_name" />
</td>
</tr>
</table>
</slot>
</td>
</tr>
<tr>
<td colspan="5">
&nbsp;
</td>
</tr>
<tr>
<td scope="row">
<slot>
{MOD.LBL_SUBJECT}
</slot>
</td>
<td colspan='4' >
<slot>
<textarea name='name' tabindex='4' cols="100" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="subjectfield">{NAME}</textarea>
</slot>
</td>
</tr>
<tr>
<td valign="top" scope="row">
{MOD.LBL_BODY}
</td>
<!-- BEGIN: htmlarea -->
<td colspan="2" >
<slot>
<div id="editor_select">
<input id="setEditor" name="setEditor" value="1" {EMAIL_EDITOR_OPTION} type="checkbox" onclick="toggle_textonly();">
{MOD.LBL_EMAIL_EDITOR_OPTION}
</div>
</slot>
</td>
<td scope="row" valign="top">
<slot>
{MOD.LBL_USE_TEMPLATE}&nbsp;
</slot>
</td>
<td nowrap width="1">
<slot>
<select tabindex='2' name='email_template' onchange="fill_email(this.options[this.selectedIndex].value);">
{EMAIL_TEMPLATE_OPTIONS}
</select>
</slot>
</td>
</tr>
<tr>
<td valign="top" scope="row">
&nbsp;
</td>
<td colspan="4" >
{TINY}
<slot>
<div id="html_div">
<textarea id="description_html" onblur="">{DESCRIPTION_HTML}</textarea>
</div>
<div id="alt_text_div">
<input id="toggle_textarea_elem" onclick="toggle_textarea();" type="checkbox" name="toggle_html">
{MOD.LBL_EDIT_ALT_TEXT}
</div>
<div id="text_div" style="display: none;">
<textarea tabindex='5' id="description" name='description' cols="100" rows="20">{DESCRIPTION}</textarea>
</div>
</slot>
</td>
<!-- END: htmlarea -->
</tr>
<tr>
<td valign="top" scope="row">
{MOD.LBL_ATTACHMENTS}
</td>
<td colspan="4">
{ATTACHMENTS_JAVASCRIPT} {ATTACHMENTS}
<div id="template_attachments">
</div>
<div id="uploads_div">
<div style="display: none" id="file0">
<input id='email_attachment0' name='email_attachment0' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('0');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file1">
<input id='email_attachment1' name='email_attachment1' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('1');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file2">
<input id='email_attachment2' name='email_attachment2' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('2');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file3">
<input id='email_attachment3' name='email_attachment3' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('3');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file4">
<input id='email_attachment4' name='email_attachment4' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('4');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file5">
<input id='email_attachment5' name='email_attachment5' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('5');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file6">
<input id='email_attachment6' name='email_attachment6' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('6');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file7">
<input id='email_attachment7' name='email_attachment7' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('7');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file8">
<input id='email_attachment8' name='email_attachment8' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('8');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="file9">
<input id='email_attachment9' name='email_attachment9' tabindex='0' size='40' type='file' />
&nbsp;<input type="button" onclick="deleteFile('9');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document0">
<input name='documentId0' id='documentId0' tabindex='0' type='hidden' />
<input name='documentName0' id='documentName0' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('0');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('0');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document1">
<input name='documentId1' id='documentId1' tabindex='1' type='hidden' />
<input name='documentName1' id='documentName1' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('1');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('1');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document2">
<input name='documentId2' id='documentId2' tabindex='2' type='hidden' />
<input name='documentName2' id='documentName2' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('2');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('2');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document3">
<input name='documentId3' id='documentId3' tabindex='3' type='hidden' />
<input name='documentName3' id='documentName3' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('3');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('3');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document4">
<input name='documentId4' id='documentId4' tabindex='4' type='hidden' />
<input name='documentName4' id='documentName4' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('4');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('4');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document5">
<input name='documentId5' id='documentId5' tabindex='5' type='hidden' />
<input name='documentName5' id='documentName5' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('5');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('5');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document6">
<input name='documentId6' id='documentId6' tabindex='6' type='hidden' />
<input name='documentName6' id='documentName6' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('6');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('6');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document7">
<input name='documentId7' id='documentId7' tabindex='7' type='hidden' />
<input name='documentName7' id='documentName7' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('7');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('7');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document8">
<input name='documentId8' id='documentId8' tabindex='8' type='hidden' />
<input name='documentName8' id='documentName8' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('8');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('8');" class="button" value="{APP.LBL_REMOVE}" />
</div>
<div style="display: none" id="document9">
<input name='documentId9' id='documentId9' tabindex='9' type='hidden' />
<input name='documentName9' id='documentName9' disabled size='40' type='text' />
&nbsp;<input type="button" onclick="selectDocument('9');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('9');" class="button" value="{APP.LBL_REMOVE}" />
</div>
</div>
<input type="button" name="add_file_button" onclick="addFile();" value="{MOD.LBL_ADD_FILE}" class="button" />
<input type="button" name="add_document_button" onclick="addDocument();" value="{MOD.LBL_ADD_DOCUMENT}" class="button" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{JAVASCRIPT}
<script type="text/javascript" language="Javascript">
var old_load=window.onload; window.onload = function() {
old_load();
setEditor();
// cn: bug 5845 - use Group Inbox From info
if(window.switchEmail) {
switchEmail();
}
}
</script>
<!-- END: main -->

779
modules/Emails/EditView.php Executable file
View File

@@ -0,0 +1,779 @@
<?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".
********************************************************************************/
$GLOBALS['log']->info("Email edit view");
require_once('include/SugarTinyMCE.php');
global $theme;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $current_user;
global $sugar_version, $sugar_config;
global $timedate;
///////////////////////////////////////////////////////////////////////////////
//// PREPROCESS BEAN DATA FOR DISPLAY
$focus = new Email();
$email_type = 'archived';
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
}
if(!empty($_REQUEST['type'])) {
$email_type = $_REQUEST['type'];
} elseif(!empty($focus->id)) {
$email_type = $focus->type;
}
$focus->type = $email_type;
//needed when creating a new email with default values passed in
if(isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
$focus->contact_name = $_REQUEST['contact_name'];
}
if(!empty($_REQUEST['load_id']) && !empty($beanList[$_REQUEST['load_module']])) {
$class_name = $beanList[$_REQUEST['load_module']];
require_once($beanFiles[$class_name]);
$contact = new $class_name();
if($contact->retrieve($_REQUEST['load_id'])) {
$link_id = $class_name . '_id';
$focus->$link_id = $_REQUEST['load_id'];
$focus->contact_name = (isset($contact->full_name)) ? $contact->full_name : $contact->name;
$focus->to_addrs_names = $focus->contact_name;
$focus->to_addrs_ids = $_REQUEST['load_id'];
//Retrieve the email address.
//If Opportunity or Case then Oppurtinity/Case->Accounts->(email_addr_bean_rel->email_addresses)
//If Contacts, Leads etc.. then Contact->(email_addr_bean_rel->email_addresses)
$sugarEmailAddress = new SugarEmailAddress();
if($class_name == 'Opportunity' || $class_name == 'aCase'){
$account = new Account();
if($contact->account_id != null && $account->retrieve($contact->account_id)){
$sugarEmailAddress->handleLegacyRetrieve($account);
if(isset($account->email1)){
$focus->to_addrs_emails = $account->email1;
$focus->to_addrs = "$focus->contact_name <$account->email1>";
}
}
}
else{
$sugarEmailAddress->handleLegacyRetrieve($contact);
if(isset($contact->email1)){
$focus->to_addrs_emails = $contact->email1;
$focus->to_addrs = "$focus->contact_name <$contact->email1>";
}
}
if(!empty($_REQUEST['parent_type']) && empty($app_list_strings['record_type_display'][$_REQUEST['parent_type']])){
if(!empty($app_list_strings['record_type_display'][$_REQUEST['load_module']])){
$_REQUEST['parent_type'] = $_REQUEST['load_module'];
$_REQUEST['parent_id'] = $focus->contact_id;
$_REQUEST['parent_name'] = $focus->to_addrs_names;
} else {
unset($_REQUEST['parent_type']);
unset($_REQUEST['parent_id']);
unset($_REQUEST['parent_name']);
}
}
}
}
if(isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
$focus->contact_id = $_REQUEST['contact_id'];
}
if(isset($_REQUEST['parent_name'])) {
$focus->parent_name = $_REQUEST['parent_name'];
}
if(isset($_REQUEST['parent_id'])) {
$focus->parent_id = $_REQUEST['parent_id'];
}
if(isset($_REQUEST['parent_type'])) {
$focus->parent_type = $_REQUEST['parent_type'];
}
elseif(is_null($focus->parent_type)) {
$focus->parent_type = $app_list_strings['record_type_default_key'];
}
if(isset($_REQUEST['to_email_addrs'])) {
$focus->to_addrs = $_REQUEST['to_email_addrs'];
}
// needed when clicking through a Contacts detail view:
if(isset($_REQUEST['to_addrs_ids'])) {
$focus->to_addrs_ids = $_REQUEST['to_addrs_ids'];
}
if(isset($_REQUEST['to_addrs_emails'])) {
$focus->to_addrs_emails = $_REQUEST['to_addrs_emails'];
}
if(isset($_REQUEST['to_addrs_names'])) {
$focus->to_addrs_names = $_REQUEST['to_addrs_names'];
}
// user's email, go through 3 levels of precedence:
$from = $current_user->getEmailInfo();
//// END PREPROCESSING
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// XTEMPLATE ASSIGNMENT
if($email_type == 'archived') {
echo get_module_title('Emails', $mod_strings['LBL_ARCHIVED_MODULE_NAME'].":", true);
$xtpl=new XTemplate('modules/Emails/EditViewArchive.html');
} else {
if(empty($_REQUEST['parent_module'])) {
$parent_module = "Emails";
} else {
$parent_module = $_REQUEST['parent_module'];
}
if(empty($_REQUEST['parent_id'])) {
$parent_id = "";
} else {
$parent_id = $_REQUEST['parent_id'];
}
if(empty($_REQUEST['return_module'])) {
$return_module = "Emails";
} else {
$return_module = $_REQUEST['return_module'];
}
if(empty($_REQUEST['return_module'])) {
$return_id = "";
} else {
$return_id = $_REQUEST['return_module'];
}
$replyType = "reply";
if ($_REQUEST['type'] == 'forward') {
$replyType = 'forward';
} // if
header("Location: index.php?module=Emails&action=Compose&record=$focus->id&replyForward=true&reply=$replyType");
return;
echo get_module_title('Emails', $mod_strings['LBL_COMPOSE_MODULE_NAME'].":", true);
$xtpl=new XTemplate('modules/Emails/EditView.html');
}
echo "\n</p>\n";
// CHECK USER'S EMAIL SETTINGS TO ENABLE/DISABLE 'SEND' BUTTON
if(!$focus->check_email_settings() &&($email_type == 'out' || $email_type == 'draft')) {
print "<font color='red'>".$mod_strings['WARNING_SETTINGS_NOT_CONF']." <a href='index.php?module=Users&action=EditView&record=".$current_user->id."&return_module=Emails&type=out&return_action=EditView'>".$mod_strings['LBL_EDIT_MY_SETTINGS']."</a></font>";
$xtpl->assign("DISABLE_SEND", 'DISABLED');
}
// CHECK THAT SERVER HAS A PLACE TO PUT UPLOADED TEMP FILES SO THAT ATTACHMENTS WILL WORK
// cn: Bug 5995
$tmpUploadDir = ini_get('upload_tmp_dir');
if(!empty($tmpUploadDir)) {
if(!is_writable($tmpUploadDir)) {
echo "<font color='red'>{$mod_strings['WARNING_UPLOAD_DIR_NOT_WRITABLE']}</font>";
}
} else {
//echo "<font color='red'>{$mod_strings['WARNING_NO_UPLOAD_DIR']}</font>";
}
///////////////////////////////////////////////////////////////////////////////
//// INBOUND EMAIL HANDLING
if(isset($_REQUEST['email_name'])) {
$name = str_replace('_',' ',$_REQUEST['email_name']);
}
if(isset($_REQUEST['inbound_email_id'])) {
$ieMail = new Email();
$ieMail->retrieve($_REQUEST['inbound_email_id']);
$quoted = '';
// cn: bug 9725: replies/forwards lose real content
$quotedHtml = $ieMail->quoteHtmlEmail($ieMail->description_html);
// plain-text
$desc = nl2br(trim($ieMail->description));
$exDesc = explode('<br />', $desc);
foreach($exDesc as $k => $line) {
$quoted .= '> '.trim($line)."\r";
}
// prefill empties with the other's contents
if(empty($quotedHtml) && !empty($quoted)) {
$quotedHtml = nl2br($quoted);
}
if(empty($quoted) && !empty($quotedHtml)) {
$quoted = strip_tags(br2nl($quotedHtml));
}
// forwards have special text
if($_REQUEST['type'] == 'forward') {
$header = $ieMail->getForwardHeader();
// subject is handled in Subject line handling below
} else {
// we have a reply in focus
$header = $ieMail->getReplyHeader();
}
$quoted = br2nl($header.$quoted);
$quotedHtml = $header.$quotedHtml;
// if not a forward: it's a reply
if($_REQUEST['type'] != 'forward') {
$ieMailName = 'RE: '.$ieMail->name;
} else {
$ieMailName = $ieMail->name;
}
$focus->id = null; // nulling this to prevent overwriting a replied email(we're basically doing a "Duplicate" function)
$focus->to_addrs = $ieMail->from_addr;
$focus->description = $quoted; // don't know what i was thinking: ''; // this will be filled on save/send
$focus->description_html = $quotedHtml; // cn: bug 7357 - htmlentities() breaks FCKEditor
$focus->parent_type = $ieMail->parent_type;
$focus->parent_id = $ieMail->parent_id;
$focus->parent_name = $ieMail->parent_name;
$focus->name = $ieMailName;
$xtpl->assign('INBOUND_EMAIL_ID',$_REQUEST['inbound_email_id']);
// un/READ flags
if(!empty($ieMail->status)) {
// "Read" flag for InboundEmail
if($ieMail->status == 'unread') {
// creating a new instance here to avoid data corruption below
$e = new Email();
$e->retrieve($ieMail->id);
$e->status = 'read';
$e->save();
$email_type = $e->status;
}
}
///////////////////////////////////////////////////////////////////////////
//// PRIMARY PARENT LINKING
if(empty($focus->parent_type) && empty($focus->parent_id)) {
$focus->fillPrimaryParentFields();
}
//// END PRIMARY PARENT LINKING
///////////////////////////////////////////////////////////////////////////
// setup for my/mailbox email switcher
$mbox = $ieMail->getMailboxDefaultEmail();
$user = $current_user->getPreferredEmail();
$useGroup = '&nbsp;<input id="use_mbox" name="use_mbox" type="checkbox" CHECKED onClick="switchEmail()" >
<script type="text/javascript">
function switchEmail() {
var mboxName = "'.$mbox['name'].'";
var mboxAddr = "'.$mbox['email'].'";
var userName = "'.$user['name'].'";
var userAddr = "'.$user['email'].'";
if(document.getElementById("use_mbox").checked) {
document.getElementById("from_addr_field").value = mboxName + " <" + mboxAddr + ">";
document.getElementById("from_addr_name").value = mboxName;
document.getElementById("from_addr_email").value = mboxAddr;
} else {
document.getElementById("from_addr_field").value = userName + " <" + userAddr + ">";
document.getElementById("from_addr_name").value = userName;
document.getElementById("from_addr_email").value = userAddr;
}
}
</script>';
$useGroup .= $mod_strings['LBL_USE_MAILBOX_INFO'];
$xtpl->assign('FROM_ADDR_GROUP', $useGroup);
}
//// END INBOUND EMAIL HANDLING
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// SUBJECT FIELD MANIPULATION
$name = '';
if(!empty($_REQUEST['parent_id']) && !empty($_REQUEST['parent_type'])) {
$focus->parent_id = $_REQUEST['parent_id'];
$focus->parent_type = $_REQUEST['parent_type'];
}
if(!empty($focus->parent_id) && !empty($focus->parent_type)) {
if($focus->parent_type == 'Cases') {
$myCase = new aCase();
$myCase->retrieve($focus->parent_id);
$myCaseMacro = $myCase->getEmailSubjectMacro();
if(isset($ieMail->name) && !empty($ieMail->name)) { // if replying directly to an InboundEmail
$oldEmailSubj = $ieMail->name;
} elseif(isset($_REQUEST['parent_name']) && !empty($_REQUEST['parent_name'])) {
$oldEmailSubj = $_REQUEST['parent_name'];
} else {
$oldEmailSubj = $focus->name; // replying to an email using old subject
}
if(!preg_match('/^re:/i', $oldEmailSubj)) {
$oldEmailSubj = 'RE: '.$oldEmailSubj;
}
$focus->name = $oldEmailSubj;
if(strpos($focus->name, str_replace('%1',$myCase->case_number,$myCaseMacro))) {
$name = $focus->name;
} else {
$name = $focus->name.' '.str_replace('%1',$myCase->case_number,$myCaseMacro);
}
} else {
$name = $focus->name;
}
} else {
if(empty($focus->name)) {
$name = '';
} else {
$name = $focus->name;
}
}
if($email_type == 'forward') {
$name = 'FW: '.$name;
}
//// END SUBJECT FIELD MANIPULATION
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// GENERAL TEMPLATE ASSIGNMENTS
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('THEME', SugarThemeRegistry::current()->__toString());
if(!isset($focus->id)) $xtpl->assign('USER_ID', $current_user->id);
if(!isset($focus->id) && isset($_REQUEST['contact_id'])) $xtpl->assign('CONTACT_ID', $_REQUEST['contact_id']);
if(isset($_REQUEST['return_module']) && !empty($_REQUEST['return_module'])) {
$xtpl->assign('RETURN_MODULE', $_REQUEST['return_module']);
} else {
$xtpl->assign('RETURN_MODULE', 'Emails');
}
if(isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action']) && ($_REQUEST['return_action'] != 'SubPanelViewer')) {
$xtpl->assign('RETURN_ACTION', $_REQUEST['return_action']);
} else {
$xtpl->assign('RETURN_ACTION', 'DetailView');
}
if(isset($_REQUEST['return_id']) && !empty($_REQUEST['return_id'])) {
$xtpl->assign('RETURN_ID', $_REQUEST['return_id']);
}
// handle Create $module then Cancel
if(empty($_REQUEST['return_id']) && !isset($_REQUEST['type'])) {
$xtpl->assign('RETURN_ACTION', 'index');
}
$xtpl->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
///////////////////////////////////////////////////////////////////////////////
//// QUICKSEARCH CODE
require_once('include/QuickSearchDefaults.php');
$qsd = new QuickSearchDefaults();
$sqs_objects = array('EditView_parent_name' => $qsd->getQSParent(),
'EditView_assigned_user_name' => $qsd->getQSUser(),
);
$json = getJSONobj();
$sqs_objects_encoded = $json->encode($sqs_objects);
$quicksearch_js = <<<EOQ
<script type="text/javascript" language="javascript">sqs_objects = $sqs_objects_encoded; var dialog_loaded;
function parent_typechangeQS() {
//new_module = document.getElementById('parent_type').value;
new_module = document.EditView.parent_type.value;
if(new_module == 'Contacts' || new_module == 'Leads' || typeof(disabledModules[new_module]) != 'undefined') {
sqs_objects['EditView_parent_name']['disable'] = true;
document.getElementById('parent_name').readOnly = true;
}
else {
sqs_objects['EditView_parent_name']['disable'] = false;
document.getElementById('parent_name').readOnly = false;
}
sqs_objects['EditView_parent_name']['modules'] = new Array(new_module);
enableQS(false);
}
parent_typechangeQS();
</script>
EOQ;
$xtpl->assign('JAVASCRIPT', get_set_focus_js().$quicksearch_js);
//// END QUICKSEARCH CODE
///////////////////////////////////////////////////////////////////////////////
// cn: bug 14191 - duping archive emails overwrites the original
if(!isset($_REQUEST['isDuplicate']) || $_REQUEST['isDuplicate'] != 'true') {
$xtpl->assign('ID', $focus->id);
}
if(isset($_REQUEST['parent_type']) && !empty($_REQUEST['parent_type']) && isset($_REQUEST['parent_id']) && !empty($_REQUEST['parent_id'])) {
$xtpl->assign('OBJECT_ID', $_REQUEST['parent_id']);
$xtpl->assign('OBJECT_TYPE', $_REQUEST['parent_type']);
}
$xtpl->assign('FROM_ADDR', $focus->from_addr);
//// prevent TO: prefill when type is 'forward'
if($email_type != 'forward') {
$xtpl->assign('TO_ADDRS', $focus->to_addrs);
$xtpl->assign('TO_ADDRS_IDS', $focus->to_addrs_ids);
$xtpl->assign('TO_ADDRS_NAMES', $focus->to_addrs_names);
$xtpl->assign('TO_ADDRS_EMAILS', $focus->to_addrs_emails);
$xtpl->assign('CC_ADDRS', $focus->cc_addrs);
$xtpl->assign('CC_ADDRS_IDS', $focus->cc_addrs_ids);
$xtpl->assign('CC_ADDRS_NAMES', $focus->cc_addrs_names);
$xtpl->assign('CC_ADDRS_EMAILS', $focus->cc_addrs_emails);
$xtpl->assign('BCC_ADDRS', $focus->bcc_addrs);
$xtpl->assign('BCC_ADDRS_IDS', $focus->bcc_addrs_ids);
$xtpl->assign('BCC_ADDRS_NAMES', $focus->bcc_addrs_names);
$xtpl->assign('BCC_ADDRS_EMAILS', $focus->bcc_addrs_emails);
}
//$xtpl->assign('FROM_ADDR', $from['name'].' <'.$from['email'].'>');
$xtpl->assign('FROM_ADDR_NAME', $from['name']);
$xtpl->assign('FROM_ADDR_EMAIL', $from['email']);
$xtpl->assign('NAME', from_html($name));
//$xtpl->assign('DESCRIPTION_HTML', from_html($focus->description_html));
$xtpl->assign('DESCRIPTION', $focus->description);
$xtpl->assign('TYPE',$email_type);
// Unimplemented until jscalendar language files are fixed
// $xtpl->assign('CALENDAR_LANG',((empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language]));
$xtpl->assign('CALENDAR_LANG', 'en');
$xtpl->assign('CALENDAR_DATEFORMAT', $timedate->get_cal_date_format());
$xtpl->assign('DATE_START', $focus->date_start);
$xtpl->assign('TIME_FORMAT', '('. $timedate->get_user_time_format().')');
$xtpl->assign('TIME_START', substr($focus->time_start,0,5));
$xtpl->assign('TIME_MERIDIEM', $timedate->AMPMMenu('',$focus->time_start));
$parent_types = $app_list_strings['record_type_display'];
$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
foreach($disabled_parent_types as $disabled_parent_type){
if($disabled_parent_type != $focus->parent_type){
unset($parent_types[$disabled_parent_type]);
}
}
$xtpl->assign('TYPE_OPTIONS', get_select_options_with_id($parent_types, $focus->parent_type));
$xtpl->assign('USER_DATEFORMAT', '('. $timedate->get_user_date_format().')');
$xtpl->assign('PARENT_NAME', $focus->parent_name);
$xtpl->assign('PARENT_ID', $focus->parent_id);
if(empty($focus->parent_type)) {
$xtpl->assign('PARENT_RECORD_TYPE', '');
} else {
$xtpl->assign('PARENT_RECORD_TYPE', $focus->parent_type);
}
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$record = '';
if(!empty($_REQUEST['record'])){
$record = $_REQUEST['record'];
}
$xtpl->assign('ADMIN_EDIT',"<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$record. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
//// END GENERAL TEMPLATE ASSIGNMENTS
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////
///
/// SETUP PARENT POPUP
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'parent_id',
'name' => 'parent_name',
),
);
$encoded_popup_request_data = $json->encode($popup_request_data);
/// Users Popup
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'assigned_user_id',
'user_name' => 'assigned_user_name',
),
);
$xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
//
///////////////////////////////////////
$change_parent_button = '<input type="button" name="button" tabindex="2" class="button" '
. 'title="' . $app_strings['LBL_SELECT_BUTTON_TITLE'] . '" '
. 'accesskey="' . $app_strings['LBL_SELECT_BUTTON_KEY'] . '" '
. 'value="' . $app_strings['LBL_SELECT_BUTTON_LABEL'] . '" '
. "onclick='ValidateParentType();' />\n"
.'<script>function ValidateParentType() {
var parentTypeValue = document.getElementById("parent_type").value;
if (trim(parentTypeValue) == ""){
alert("' . $mod_strings['LBL_ERROR_SELECT_MODULE'] .'");
return false;
}
open_popup(document.EditView.parent_type.value,600,400,"&tree=ProductsProd",true,false,' .$encoded_popup_request_data.');
}</script>';
$xtpl->assign("CHANGE_PARENT_BUTTON", $change_parent_button);
$button_attr = '';
if(!ACLController::checkAccess('Contacts', 'list', true)){
$button_attr = 'disabled="disabled"';
}
$change_to_addrs_button = '<input type="button" name="to_button" tabindex="3" class="button" '
. 'title="' . $app_strings['LBL_SELECT_BUTTON_TITLE'] . '" '
. 'accesskey="' . $app_strings['LBL_SELECT_BUTTON_KEY'] . '" '
. 'value="' . $mod_strings['LBL_EMAIL_SELECTOR'] . '" '
. "onclick='button_change_onclick(this);' $button_attr />\n";
$xtpl->assign("CHANGE_TO_ADDRS_BUTTON", $change_to_addrs_button);
$change_cc_addrs_button = '<input type="button" name="cc_button" tabindex="3" class="button" '
. 'title="' . $app_strings['LBL_SELECT_BUTTON_TITLE'] . '" '
. 'accesskey="' . $app_strings['LBL_SELECT_BUTTON_KEY'] . '" '
. 'value="' . $mod_strings['LBL_EMAIL_SELECTOR'] . '" '
. "onclick='button_change_onclick(this);' $button_attr />\n";
$xtpl->assign("CHANGE_CC_ADDRS_BUTTON", $change_cc_addrs_button);
$change_bcc_addrs_button = '<input type="button" name="bcc_button" tabindex="3" class="button" '
. 'title="' . $app_strings['LBL_SELECT_BUTTON_TITLE'] . '" '
. 'accesskey="' . $app_strings['LBL_SELECT_BUTTON_KEY'] . '" '
. 'value="' . $mod_strings['LBL_EMAIL_SELECTOR'] . '" '
. "onclick='button_change_onclick(this);' $button_attr />\n";
$xtpl->assign("CHANGE_BCC_ADDRS_BUTTON", $change_bcc_addrs_button);
///////////////////////////////////////
//// USER ASSIGNMENT
global $current_user;
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
$record = '';
if(!empty($_REQUEST['record'])) {
$record = $_REQUEST['record'];
}
$xtpl->assign('ADMIN_EDIT',"<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$record. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
if(empty($focus->assigned_user_id) && empty($focus->id))
$focus->assigned_user_id = $current_user->id;
if(empty($focus->assigned_name) && empty($focus->id))
$focus->assigned_user_name = $current_user->user_name;
$xtpl->assign('ASSIGNED_USER_OPTIONS', get_select_options_with_id(get_user_array(TRUE, 'Active', $focus->assigned_user_id), $focus->assigned_user_id));
$xtpl->assign('ASSIGNED_USER_NAME', $focus->assigned_user_name);
$xtpl->assign('ASSIGNED_USER_ID', $focus->assigned_user_id);
$xtpl->assign('DURATION_HOURS', $focus->duration_hours);
$xtpl->assign('TYPE_OPTIONS', get_select_options_with_id($parent_types, $focus->parent_type));
if(isset($focus->duration_minutes)) {
$xtpl->assign('DURATION_MINUTES_OPTIONS', get_select_options_with_id($focus->minutes_values,$focus->duration_minutes));
}
//// END USER ASSIGNMENT
///////////////////////////////////////
//Add Custom Fields
require_once('modules/DynamicFields/templates/Files/EditView.php');
///////////////////////////////////////
//// ATTACHMENTS
$attachments = '';
if(!empty($focus->id) || (!empty($_REQUEST['record']) && $_REQUEST['type'] == 'forward')) {
$attachments = "<input type='hidden' name='removeAttachment' id='removeAttachment' value=''>\n";
$ids = '';
$focusId = empty($focus->id) ? $_REQUEST['record'] : $focus->id;
$note = new Note();
$where = "notes.parent_id='{$focusId}' AND notes.filename IS NOT NULL";
$notes_list = $note->get_full_list("", $where,true);
if(!isset($notes_list)) {
$notes_list = array();
}
for($i = 0;$i < count($notes_list);$i++) {
$the_note = $notes_list[$i];
if(empty($the_note->filename)) {
continue;
}
// cn: bug 8034 - attachments from forwards/replies lost when saving drafts
if(!empty($ids)) {
$ids .= ",";
}
$ids .= $the_note->id;
$attachments .= "
<div id='noteDiv{$the_note->id}'>
<img onclick='deletePriorAttachment(\"{$the_note->id}\");' src='".SugarThemeRegistry::current()->getImageURL('delete_inline.gif')." value='{$the_note->id}'>&nbsp;";
$attachments .= "<a href=\"index.php?entryPoint=download&id=".$the_note->id."&type=Notes\">".$the_note->name."</a><div />";
//$attachments .= '<a href="'.UploadFile::get_url($the_note->filename,$the_note->id).'&entryPoint=download&type=Notes' . '" target="_blank">'. $the_note->filename .'</a></div>';
}
// cn: bug 8034 - attachments from forwards/replies lost when saving drafts
$attachments .= "<input type='hidden' name='prior_attachments' value='{$ids}'>";
// workaround $mod_strings being overriden by Note object instantiation above.
global $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'Emails');
}
$attJs = '<script type="text/javascript">';
$attJs .= 'var file_path = "'.$sugar_config['site_url'].'/'.$sugar_config['upload_dir'].'";';
$attJs .= 'var lnk_remove = "'.$app_strings['LNK_REMOVE'].'";';
$attJs .= '</script>';
$xtpl->assign('ATTACHMENTS', $attachments);
$xtpl->assign('ATTACHMENTS_JAVASCRIPT', $attJs);
//// END ATTACHMENTS
///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// DOCUMENTS
$popup_request_data = array(
'call_back_function' => 'document_set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'related_doc_id',
'document_name' => 'related_document_name',
),
);
$json = getJSONobj();
$xtpl->assign('encoded_document_popup_request_data', $json->encode($popup_request_data));
//// END DOCUMENTS
///////////////////////////////////////////////////////////////////////////////
$parse_open = true;
if($parse_open) {
$xtpl->parse('main.open_source_1');
}
///////////////////////////////////////////////////////////////////////////////
//// EMAIL TEMPLATES
if(ACLController::checkAccess('EmailTemplates', 'list', true) && ACLController::checkAccess('EmailTemplates', 'view', true)) {
$et = new EmailTemplate();
$etResult = $focus->db->query($et->create_new_list_query('','',array(),array(),''));
$email_templates_arr[] = '';
while($etA = $focus->db->fetchByAssoc($etResult)) {
$email_templates_arr[$etA['id']] = $etA['name'];
}
} else {
$email_templates_arr = array('' => $app_strings['LBL_NONE']);
}
$xtpl->assign('EMAIL_TEMPLATE_OPTIONS', get_select_options_with_id($email_templates_arr, ''));
//// END EMAIL TEMPLATES
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////
//// TEXT EDITOR
// cascade from User to Sys Default
$editor = $focus->getUserEditorPreference();
if($editor != 'plain') {
// this box is checked by Javascript on-load.
$xtpl->assign('EMAIL_EDITOR_OPTION', 'CHECKED');
}
$description_html = from_html($focus->description_html);
$description = $focus->description;
/////////////////////////////////////////////////
// signatures
if($sig = $current_user->getDefaultSignature()) {
if(!$focus->hasSignatureInBody($sig) && $focus->type != 'draft') {
if($current_user->getPreference('signature_prepend')) {
$description_html = '<br />'.from_html($sig['signature_html']).'<br /><br />'.$description_html;
$description = "\n".$sig['signature']."\n\n".$description;
} else {
$description_html .= '<br /><br />'.from_html($sig['signature_html']);
$description = $description."\n\n".$sig['signature'];
}
}
}
$xtpl->assign('DESCRIPTION', $description);
// sigs
/////////////////////////////////////////////////
$tiny = new SugarTinyMCE();
$ed = $tiny->getInstance("description_html");
$xtpl->assign("TINY", $ed);
$xtpl->assign("DESCRIPTION_HTML", $description_html);
$xtpl->parse('main.htmlarea');
//// END TEXT EDITOR
///////////////////////////////////////
///////////////////////////////////////
//// SPECIAL INBOUND LANDING SCREEN ASSIGNS
if(!empty($_REQUEST['inbound_email_id'])) {
if(!empty($_REQUEST['start'])) {
$parts = $focus->getStartPage(base64_decode($_REQUEST['start']));
$xtpl->assign('RETURN_ACTION', $parts['action']);
$xtpl->assign('RETURN_MODULE', $parts['module']);
$xtpl->assign('GROUP', $parts['group']);
}
$xtpl->assign('ASSIGNED_USER_ID', $current_user->id);
$xtpl->assign('MYINBOX', 'this.form.type.value=\'inbound\';');
}
//// END SPECIAL INBOUND LANDING SCREEN ASSIGNS
///////////////////////////////////////
echo '<script>var disabledModules='. $json->encode($disabled_parent_types) . ';</script>';
$jsVars = 'var lbl_send_anyways = "'.$mod_strings['LBL_SEND_ANYWAYS'].'";';
$xtpl->assign('JS_VARS', $jsVars);
$xtpl->parse("main");
$xtpl->out("main");
echo '<script>checkParentType(document.EditView.parent_type.value, document.EditView.change_parent);</script>';
//// END XTEMPLATE ASSIGNMENT
///////////////////////////////////////////////////////////////////////////////
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$skip_fields = array();
if($email_type == 'out') {
$skip_fields['name'] = 1;
$skip_fields['date_start'] = 1;
}
$javascript->addAllFields('',$skip_fields);
$javascript->addToValidateBinaryDependency('parent_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_MEMBER_OF'], 'false', '', 'parent_id');
$javascript->addToValidateBinaryDependency('parent_type', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_MEMBER_OF'], 'false', '', 'parent_id');
$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
if($email_type == 'archived') {
$javascript->addFieldIsValidDate('date_start', 'date', $mod_strings['LBL_DATE'], $mod_strings['ERR_DATE_START'], true);
$javascript->addFieldIsValidTime('time_start', 'time', $mod_strings['LBL_TIME'], $mod_strings['ERR_TIME_SENT'], true);
}
echo $javascript->getScript();

View File

@@ -0,0 +1,318 @@
<!--
/*********************************************************************************
* 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 -->
<style>
#to_addrs_field { height: 1.6em; }
#cc_addrs_field { height: 1.6em; }
#bcc_addrs_field { height: 1.6em; }
#subjectfield { height: 1.6em; }
#from_addr_field { height: 1.6em; }
</style>
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
{MESSAGE}
<form action="index.php" method="post" name="EditView" id="EditView" enctype="multipart/form-data">
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="action" value="Save" />
<input type="hidden" name="contact_id" value="{CONTACT_ID}" />
<input type="hidden" name="user_id" value="{USER_ID}" />
<input type="hidden" name="return_module" value="{RETURN_MODULE}" />
<input type="hidden" name="return_id" value="{RETURN_ID}" />
<input type="hidden" name="send" value="" />
<input type="hidden" name="type" value="archived" />
<input type="hidden" name="record" value="{ID}" />
<input type="hidden" name="return_action" value="{RETURN_ACTION}" />
<input type="hidden" name="object_type" value="{OBJECT_TYPE}" />
<input type="hidden" name="object_id" value="{OBJECT_ID}" />
<input type="hidden" name="group" value="{GROUP}" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input type="submit" name="button" class="button"
title="{APP.LBL_SAVE_BUTTON_TITLE}"
accesskey="{APP.LBL_SAVE_BUTTON_KEY}"
value=" {APP.LBL_SAVE_BUTTON_LABEL} "
onclick="this.form.action.value='Save'; return check_form('EditView');" />
<input type="submit" name="button" class="button"
title="{APP.LBL_CANCEL_BUTTON_TITLE}"
accesskey="{APP.LBL_CANCEL_BUTTON_KEY}"
value=" {APP.LBL_CANCEL_BUTTON_LABEL} "
onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" /> </td>
<td align="right" nowrap></td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" scope="row">
<slot>{MOD.LBL_DATE_AND_TIME}&nbsp;<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot>
</td>
<td width="25%" nowrap colspan="4">
<slot>
<table cellpadding="0" cellspacing="0">
<tr>
<td nowrap>
<slot><input name='date_start' onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');" id='jscal_field' tabindex='1' maxlength='10' size='11' type="text" value="{DATE_START}"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_trigger" align="absmiddle">&nbsp;</slot>
</td>
<td nowrap>
<slot><input name='time_start' size='5' maxlength='5' tabindex='1' type="text" value='{TIME_START}'>{TIME_MERIDIEM}</slot>
</td>
</tr>
<tr>
<td nowrap>
<slot><span class="dateFormat">{USER_DATEFORMAT}</span></slot>
</td>
<td nowrap>
<slot><span class="dateFormat">{TIME_FORMAT}</span></slot>
</td>
</tr>
</table>
</slot>
</td>
</tr>
<tr>
<!-- BEGIN: open_source_1 -->
<td colspan="2"><slot></slot></td>
<!-- END: open_source_1 -->
<td width="25%" scope="row" valign="top" align="left"><slot>
<select tabindex='2' id='parent_type' name='parent_type' onchange="document.EditView.parent_name.value=''; changeQS(); checkParentType(document.EditView.parent_type.value, document.EditView.change_parent);">{TYPE_OPTIONS}</select>&nbsp;
<input id='parent_id' name='parent_id' type="hidden" value='{PARENT_ID}'>
<input class="sqsEnabled" id='parent_name' name='parent_name' tabindex='2' type='text' value="{PARENT_NAME}">&nbsp;{CHANGE_PARENT_BUTTON}
</slot></td>
</tr>
<tr>
<td scope="row" width="15%">
<slot>{APP.LBL_ASSIGNED_TO}</slot>
</td>
<td >
<slot>
<input class="sqsEnabled" tabindex='1' id="assigned_user_name" name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accessKey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" tabindex='1' class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name=btn1
onclick='open_popup("Users", 600, 400, "", true, false, {encoded_users_popup_request_data});' />
</slot>
</td>
<!-- BEGIN: pro -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<td scope="row" valign="top" align="right"><slot>
{MOD.LBL_USE_TEMPLATE}&nbsp;
</slot></td>
<td nowrap colspan="2">
<slot>
<select tabindex='2' name='email_template' onchange="fill_email(this.options[this.selectedIndex].value);">{EMAIL_TEMPLATE_OPTIONS}</select>
</slot>
</td>
<!-- END: pro -->
<!-- BEGIN: open_source -->
<td colspan="3"><slot></slot></td>
<!-- END: open_source -->
</tr>
<tr>
<td colspan="5">&nbsp;
</td>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="4">{MOD.LBL_NOTE_SEMICOLON}</td>
</tr>
<tr valign="top">
<td scope="row"><slot>{MOD.LBL_TO}</slot></td>
<td colspan="4" nowrap="nowrap"><slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="to_addrs_field" name='to_addrs' tabindex='3' cols="80" rows="1"
style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{TO_ADDRS}">{TO_ADDRS}</textarea>
<input type="hidden" id="to_addrs_ids" name="to_addrs_ids" value="{TO_ADDRS_IDS}" />
<input type="hidden" id="to_addrs_emails" name="to_addrs_emails" value="{TO_ADDRS_EMAILS}" />
<input type="hidden" id="to_addrs_names" name="to_addrs_names" value="{TO_ADDRS_NAMES}" />
</td>
<td style="padding-left: 4px;">{CHANGE_TO_ADDRS_BUTTON}</td>
</tr>
</table>
</slot></td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_CC}</slot></td>
<td colspan="4" nowrap="nowrap"><slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="cc_addrs_field" name='cc_addrs' tabindex='3' cols="80" rows="1"
style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{CC_ADDRS}">{CC_ADDRS}</textarea>
<input type="hidden" id="cc_addrs_ids" name="cc_addrs_ids" value="{CC_ADDRS_IDS}" />
<input type="hidden" id="cc_addrs_emails" name="cc_addrs_emails" value="{CC_ADDRS_EMAILS}" />
<input type="hidden" id="cc_addrs_names" name="cc_addrs_names" value="{CC_ADDRS_NAMES}" />
</td>
<td style="padding-left: 4px;">{CHANGE_CC_ADDRS_BUTTON}</td>
</tr>
</table>
</slot></td>
</tr>
<tr valign="top">
<td scope="row"><slot>{MOD.LBL_BCC}</slot></td>
<td colspan="4" nowrap="nowrap"><slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="bcc_addrs_field" name='bcc_addrs' tabindex='3' cols="80" rows="1"
style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{BCC_ADDRS}">{BCC_ADDRS}</textarea>
<input type="hidden" id="bcc_addrs_ids" name="bcc_addrs_ids" value="{BCC_ADDRS_IDS}" />
<input type="hidden" id="bcc_addrs_emails" name="bcc_addrs_emails" value="{BCC_ADDRS_EMAILS}" />
<input type="hidden" id="bcc_addrs_names" name="bcc_addrs_names" value="{BCC_ADDRS_NAMES}" />
</td>
<td style="padding-left: 4px;">{CHANGE_BCC_ADDRS_BUTTON}</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td scope="row"><slot>
{MOD.LBL_FROM}
</slot></td>
<td colspan="4" nowrap="nowrap"><slot>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<textarea id="from_addr_field" name='from_addr' tabindex='3' cols="80" rows="1"
style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{FROM_ADDR}">{FROM_ADDR}</textarea>
{FROM_ADDR_GROUP}
<input type="hidden" id="from_addr_email" name="from_addr_email" />
<input type="hidden" id="from_addr_name" name="from_addr_name" />
</td>
</tr>
</table>
</slot></td>
</tr>
<tr>
<td colspan=5>&nbsp;</td>
</tr>
<tr>
<td scope="row"><slot>{MOD.LBL_SUBJECT}</slot></td>
<td colspan='4' ><slot>
<textarea name='name' tabindex='4' cols="100" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="subjectfield">{NAME}</textarea>
</slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>{MOD.LBL_BODY}</td>
<!-- BEGIN: textarea -->
<td colspan="4" ><slot>
<div id="html_div"><textarea tabindex='4' name='description_html' cols="100" rows="20">{DESCRIPTION_HTML}</textarea></div>
<input onclick="toggle_textarea(this);" type="checkbox" name="toggle_html"> {MOD.LBL_EDIT_ALT_TEXT}<br>
<div id="text_div" style="display: none"><textarea tabindex='4' name='description' cols="100" rows="20">{DESCRIPTION}</textarea></div>
</slot></td>
<!-- END: textarea -->
<!-- BEGIN: htmlarea -->
<td colspan="4" ><slot>
<textarea name="description_html" id="description_html">{DESCRIPTION_HTML}</textarea>
<div id="alt_text_div">
<input id="toggle_textarea_elem" onclick="toggle_textarea();" type="checkbox" name="toggle_html"> {MOD.LBL_EDIT_ALT_TEXT}
</div>
<div id="text_div" style="display: none;">
<textarea tabindex='5' name='description' cols="100" rows="20">
{DESCRIPTION}
</textarea>
</div>
</slot></td>
<!-- END: htmlarea -->
</tr>
<tr>
<td valign="top" scope="row"><slot>{MOD.LBL_ATTACHMENTS}</td>
<td colspan="4">
{ATTACHMENTS}
<div id="uploads_div">
<div style="display: none" id="file0"><input id = 'email_attachment0' name='email_attachment0' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('0');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file1"><input id = 'email_attachment1' name='email_attachment1' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('1');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file2"><input id = 'email_attachment2' name='email_attachment2' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('2');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file3"><input id = 'email_attachment3' name='email_attachment3' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('3');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file4"><input id = 'email_attachment4' name='email_attachment4' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('4');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file5"><input id = 'email_attachment5' name='email_attachment5' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('5');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file6"><input id = 'email_attachment6' name='email_attachment6' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('6');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file7"><input id = 'email_attachment7' name='email_attachment7' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('7');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file8"><input id = 'email_attachment8' name='email_attachment8' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('8');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="file9"><input id = 'email_attachment9' name='email_attachment9' tabindex='0' size='40' type='file'/>&nbsp;<input type="button" onclick="deleteFile('9');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document0"><input name='documentId0' id='documentId0' tabindex='0' type='hidden'/><input name='documentName0' id='documentName0' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('0');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('0');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document1"><input name='documentId1' id='documentId1' tabindex='1' type='hidden'/><input name='documentName1' id='documentName1' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('1');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('1');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document2"><input name='documentId2' id='documentId2' tabindex='2' type='hidden'/><input name='documentName2' id='documentName2' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('2');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('2');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document3"><input name='documentId3' id='documentId3' tabindex='3' type='hidden'/><input name='documentName3' id='documentName3' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('3');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('3');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document4"><input name='documentId4' id='documentId4' tabindex='4' type='hidden'/><input name='documentName4' id='documentName4' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('4');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('4');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document5"><input name='documentId5' id='documentId5' tabindex='5' type='hidden'/><input name='documentName5' id='documentName5' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('5');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('5');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document6"><input name='documentId6' id='documentId6' tabindex='6' type='hidden'/><input name='documentName6' id='documentName6' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('6');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('6');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document7"><input name='documentId7' id='documentId7' tabindex='7' type='hidden'/><input name='documentName7' id='documentName7' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('7');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('7');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document8"><input name='documentId8' id='documentId8' tabindex='8' type='hidden'/><input name='documentName8' id='documentName8' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('8');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('8');" class="button" value="{APP.LBL_REMOVE}"/></div>
<div style="display: none" id="document9"><input name='documentId9' id='documentId9' tabindex='9' type='hidden'/><input name='documentName9' id='documentName9' DISABLED size='40' type='text'/>&nbsp;<input type="button" onclick="selectDocument('9');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}"/><input type="button" onclick="deleteDocument('9');" class="button" value="{APP.LBL_REMOVE}"/></div>
</div>
<input type="button" name="add_file_button" onclick="addFile();" value="{MOD.LBL_ADD_FILE}" class="button" />
<input type="button" name="add_document_button" onclick="addDocument();" value="{MOD.LBL_ADD_DOCUMENT}" class="button" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
Calendar.setup ({
inputField : "jscal_field", ifFormat : "{CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
});
</script>
{TINY}
{JAVASCRIPT}
{INITIALIZE_IE_RESPONSE}
<!-- END: main -->

3156
modules/Emails/Email.php Executable file

File diff suppressed because it is too large Load Diff

3318
modules/Emails/Email1.php Executable file

File diff suppressed because it is too large Load Diff

2936
modules/Emails/EmailUI.php Executable file

File diff suppressed because it is too large Load Diff

1598
modules/Emails/EmailUIAjax.php Executable file

File diff suppressed because it is too large Load Diff

42
modules/Emails/Forms.php Executable file
View File

@@ -0,0 +1,42 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/

View File

@@ -0,0 +1,49 @@
<?php
/*********************************************************************************
* 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".
********************************************************************************/
/**
* Render the quick compose frame needed by the UI. The data is returned as a JSOn
* object and consumed by the client in an ajax call.
*/
require_once('modules/Emails/EmailUI.php');
$em = new EmailUI();
$out = $em->displayQuickComposeEmailFrame();
@ob_end_clean();
ob_start();
echo $out;
ob_end_flush();

72
modules/Emails/Grab.php Executable file
View File

@@ -0,0 +1,72 @@
<?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 $current_user;
$focus = new Email();
// Get Group User IDs
$groupUserQuery = 'SELECT name, group_id FROM inbound_email ie INNER JOIN users u ON (ie.group_id = u.id AND u.is_group = 1)';
_pp($groupUserQuery);
$r = $focus->db->query($groupUserQuery);
$groupIds = '';
while($a = $focus->db->fetchByAssoc($r)) {
$groupIds .= "'".$a['group_id']."', ";
}
$groupIds = substr($groupIds, 0, (strlen($groupIds) - 2));
$query = 'SELECT emails.id AS id FROM emails';
$query .= " WHERE emails.deleted = 0 AND emails.status = 'unread' AND emails.assigned_user_id IN ({$groupIds})";
//$query .= ' LIMIT 1';
//_ppd($query);
$r2 = $focus->db->query($query);
$count = 0;
$a2 = $focus->db->fetchByAssoc($r2);
$focus->retrieve($a2['id']);
$focus->assigned_user_id = $current_user->id;
$focus->save();
if(!empty($a2['id'])) {
header('Location: index.php?module=Emails&action=ListView&type=inbound&assigned_user_id='.$current_user->id);
} else {
header('Location: index.php?module=Emails&action=ListView&show_error=true&type=inbound&assigned_user_id='.$current_user->id);
}
?>

78
modules/Emails/ListView.html Executable file
View File

@@ -0,0 +1,78 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script language="javascript">if(typeof sqs_objects == 'undefined'){var sqs_objects = new Array;} </script>
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope="col" width="1%" class="listViewThS1" NOWRAP>{CHECKALL}</td>
<td scope="col" width="1%" class="listViewThS1" NOWRAP><slot>{ATTACHMENT_HEADER}</slot></td>
<td scope="col" width="31%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="18%" class="listViewThS1" NOWRAP>{MOD.LBL_LIST_CONTACT}</td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}assigned_user_name" class="listViewThLinkS1">{MOD.LBL_LIST_ASSIGNED}{arrow_start}{assigned_user_name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}type" class="listViewThLinkS1">{MOD.LBL_LIST_TYPE}{arrow_start}{type_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}status" class="listViewThLinkS1">{MOD.LBL_LIST_STATUS}{arrow_start}{status_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}date_entered" class="listViewThLinkS1">{MOD.LBL_LIST_CREATED}{arrow_start}{date_entered_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" onmouseover="setPointer(this, '{EMAIL.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');" onmouseout="setPointer(this, '{EMAIL.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');" onmousedown="setPointer(this, '{EMAIL.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.ATTACHMENT_IMAGE}</slot></td>
<td scope='row' valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><slot>
<div id="rollover"><a href="#" class="rollover">{EMAIL.PREVIEW_IMAGE}<span>{EMAIL.ROLLOVER}</span></a></div>&nbsp;
<{TAG.MAIN} href="{URL_PREFIX}index.php?action={EMAIL.LINK_ACTION}&module=Emails&record={EMAIL.ID}&offset={EMAIL.OFFSET}&stamp={EMAIL.STAMP}" class="listViewTdLinkS1">{EMAIL.NAME}</{TAG.MAIN}></slot></td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><slot>{EMAIL.CONTACT_NAME}</slot></td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.ASSIGNED_USER_NAME}</slot></td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.TYPE_NAME}</slot></td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.STATUS}</slot></td>
<td nowrap valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><slot>{EMAIL.DATE_ENTERED}</slot></td>
</tr>
<tr><td colspan="20" class="listViewHRS1"></td></tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

284
modules/Emails/ListView.php Executable file
View File

@@ -0,0 +1,284 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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): ______________________________________..
********************************************************************************/
// to prevent StoreQuery() from hijacking all values.
$_REQUEST = $_REQUEST;
/* default to Inbox view: this does belong in the OUTPUT section, but we need these set for StoreQuery */
if(!empty($_REQUEST['action']) && $_REQUEST['action'] == 'index') {
global $current_user;
$_REQUEST['type'] = 'inbound';
$_REQUEST['assigned_user_id'] = $current_user->id;
}
///////////////////////////////////////////////////////////////////////////////
//// NAV FROM MASS UPDATE
if(isset($_REQUEST['ie_assigned_user_id']) && !empty($_REQUEST['ie_assigned_user_id'])) {
// cn: bug 9103 - hooked from MassUpdate->getMassUpdateFormHeader();
$_REQUEST['assigned_user_id'] = $_REQUEST['ie_assigned_user_id'];
$_REQUEST['status'] = ''; // "Archiving" MyInbox emails presets the search criteria below
}
//// END NAV FROM MASS UPDATE
///////////////////////////////////////////////////////////////////////////////
require_once('XTemplate/xtpl.php');
require_once('modules/Emails/Email.php');
global $current_user;
if($current_user->id!='be5b7acb-cb35-186b-7229-523818723665' && $current_user->id!='1' && $current_user->id!='2e72f487-d92b-954e-f50c-528b10ce81c9')die('Brak odstępu');
require_once('include/ListView/ListView.php');
require_once('include/utils.php');
require_once('modules/MySettings/StoreQuery.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
global $image_path;
global $theme;
global $focus_list; // focus_list is the means of passing data to a ListView.
$focus = new Email();
$header_text = '';
$where = '';
$type = '';
$assigned_user_id = '';
$group = '';
$search_adv = '';
$whereClauses = array();
$error = '';
///////////////////////////////////////////////////////////////////////////////
////
//// SEARCH FORM FUNCTIONALITY
//// SEARCH QUERY GENERATION
$storeQuery = new StoreQuery();
// this allows My Inbox, Group Inbox, etc. to have separate stored queries
// for the same ListView.php
if(isset($_REQUEST['type'])) $Qtype = $_REQUEST['type'];
else $Qtype = '';
if(isset($_REQUEST['assigned_user_id']) && $_REQUEST['assigned_user_id'] == $current_user->id) {
$Qassigned_user_id = $_REQUEST['assigned_user_id'];
} else {
$Qassigned_user_id = '';
}
if(!isset($_REQUEST['query'])){
//_pp('loading: '.$currentModule.$Qtype.$Qgroup);
//_pp($current_user->user_preferences[$currentModule.$Qtype.'Q']);
$storeQuery->loadQuery($currentModule.$Qtype);
$storeQuery->populateRequest();
} else {
//_pp($current_user->user_preferences[$currentModule.$Qtype.'Q']);
//_pp('saving: '.$currentModule.$Qtype);
$storeQuery->saveFromGet($currentModule.$Qtype);
}
if(isset($_REQUEST['query'])) {
// we have a query
if (isset($_REQUEST['type'])) $email_type = $_REQUEST['type'];
if (isset($_REQUEST['assigned_to'])) $assigned_to = $_REQUEST['assigned_to'];
if (isset($_REQUEST['status'])) $status = $_REQUEST['status'];
if (isset($_REQUEST['name'])) $name = $_REQUEST['name'];
if (isset($_REQUEST['contact_name'])) $contact_name = $_REQUEST['contact_name'];
if(isset($email_type) && $email_type != "") $whereClauses['emails.type'] = "emails.type = '".$GLOBALS['db']->quote($email_type)."'";
if(isset($assigned_to) && $assigned_to != "") $whereClauses['emails.assigned_user_id'] = "emails.assigned_user_id = '".$GLOBALS['db']->quote($assigned_to)."'";
if(isset($status) && $status != "") $whereClauses['emails.status'] = "emails.status = '".$GLOBALS['db']->quote($status)."'";
if(isset($name) && $name != "") $whereClauses['emails.name'] = "emails.name like '".$GLOBALS['db']->quote($name)."%'";
if(isset($contact_name) && $contact_name != '') {
$contact_names = explode(" ", $contact_name);
foreach ($contact_names as $name) {
$whereClauses['contacts.name'] = "parent_id in (select contacts.id from contacts where contacts.last_name like '".$GLOBALS['db']->quote($name)."%')";
}
}
$focus->custom_fields->setWhereClauses($whereClauses);
$GLOBALS['log']->info("Here is the where clause for the list view: $where");
} // end isset($_REQUEST['query'])
//// OUTPUT GENERATION
if (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
// ASSIGNMENTS pre-processing
$email_type_sel = '';
$assigned_to_sel = '';
$status_sel = '';
if(isset($_REQUEST['email_type'])) $email_type_sel = $_REQUEST['email_type'];
if(isset($_REQUEST['assigned_to'])) $assigned_to_sel = $_REQUEST['assigned_to'];
if(isset($_REQUEST['status'])) $status_sel = $_REQUEST['status'];
if(isset($_REQUEST['search'])) $search_adv = $_REQUEST['search'];
// drop-downs values
$r = $focus->db->query("SELECT id, first_name, last_name FROM users WHERE deleted = 0 AND status = 'Active' OR users.is_group = 1 ORDER BY status");
$users[] = '';
while($a = $focus->db->fetchByAssoc($r)) {
$users[$a['id']] = $a['first_name'].' '.$a['last_name'];
}
$email_types[] = '';
$email_types = array_merge($email_types, $app_list_strings['dom_email_types']);
$email_status[] = '';
$email_status = array_merge($email_status, $app_list_strings['dom_email_status']);
$types = get_select_options_with_id($email_types, $email_type_sel);
$assigned_to = get_select_options_with_id($users, $assigned_to_sel);
$email_status = get_select_options_with_id($email_status, $status_sel);
// ASSIGNMENTS AND OUTPUT
if(isset($_REQUEST['type']) && $_REQUEST['type'] != '') $emailType = $_REQUEST['type'];
else $emailType = '';
$search_form = new XTemplate ('modules/Emails/SearchFormMyInbox.html');
$search_form->assign('MOD', $mod_strings);
$search_form->assign('APP', $app_strings);
$search_form->assign('IMAGE_PATH', $image_path);
$search_form->assign('ADVANCED_SEARCH_PNG', get_image($image_path.'advanced_search','alt="'.$app_strings['LNK_ADVANCED_SEARCH'].'" border="0"'));
$search_form->assign('BASIC_SEARCH_PNG', get_image($image_path.'basic_search','alt="'.$app_strings['LNK_BASIC_SEARCH'].'" border="0"'));
$search_form->assign('TYPE_OPTIONS', $types);
$search_form->assign('ASSIGNED_TO_OPTIONS', $assigned_to);
$search_form->assign('STATUS_OPTIONS', $email_status);
$search_form->assign('ADV_URL', $_SERVER['REQUEST_URI']);
$search_form->assign('SEARCH_ADV', $search_adv);
if(isset($_REQUEST['name'])) $search_form->assign('NAME', $_REQUEST['name']);
if(isset($_REQUEST['contact_name'])) $search_form->assign('CONTACT_NAME', $_REQUEST['contact_name']);
if(isset($current_user_only)) $search_form->assign('CURRENT_USER_ONLY', "checked");
// adding custom fields:
$focus->custom_fields->populateXTPL($search_form, 'search' );
$search_form->assign('SEARCH_ACTION', 'ListView');
$search_form->assign('TYPE', $Qtype);
if(!empty($_REQUEST['assigned_user_id'])) {
$search_form->assign('ASSIGNED_USER_ID', $_REQUEST['assigned_user_id']);
}
$search_form->assign('JAVASCRIPT', $focus->js_set_archived().$focus->u_get_clear_form_js($Qtype, '', $Qassigned_user_id));
}
//// END SEARCH FORM FUNCTIONALITY
////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// NAVIGATION HACK
$_SESSION['emailStartAction'] = ''; // empty this value to allow new writes
//// END NAVIGATION HACK
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
////
//// INBOX FUNCTIONALITY
// for Inbox
//// END INBOX FUNCTIONALITY
////
///////////////////////////////////////////////////////////////////////////////
$ListView = new ListView();
$ListView->initNewXTemplate('modules/Emails/ListView.html',$mod_strings);
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
///////////////////////////////////////////////////////////////////////////////
// make sure $display_title is set prior to display
if (!isset($display_title)) {
$display_title = '';
}
echo "\n<p>\n";
echo get_module_title("Emails", $mod_strings['LBL_MODULE_TITLE'].$display_title, true);
echo "\n</p>\n";
// admin-edit
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=".$_REQUEST['module'] ."'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
}
// search form
//echo get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE']. $header_text, "", false);
// ADVANCED SEARCH
if(isset($_REQUEST['search']) && $_REQUEST['search'] == 'advanced') {
$search_form->parse('adv');
$search_form->out('adv');
} else {
$search_form->parse('main');
$search_form->out('main');
}
// CONSTRUCT WHERE STRING FROM WHERECLAUSE ARRAY
foreach($whereClauses as $clause) {
if($where != "")
$where .= " AND ";
$where .= $clause;
}
//echo $where;
if( (isset($_REQUEST['assigned_user_id']) && $_REQUEST['assigned_user_id'] != '') && $_REQUEST['type'] == 'inbound') {
$ListView->xTemplateAssign('TAKE',$focus->pickOneButton());
if($current_user->hasPersonalEmail()) {
$ListView->xTemplateAssign('CHECK_MAIL',$focus->checkInbox('personal'));
}
}
if( (isset($_REQUEST['show_error']) && $_REQUEST['show_error'] == 'true') && $_REQUEST['type'] == 'inbound') {
$ListView->xTemplateAssign('TAKE_ERROR', $focus->takeError());
}
//echo $focus->quickCreateJS();
$ListView->setAdditionalDetails();
$ListView->xTemplateAssign('ATTACHMENT_HEADER', get_image('themes/'.$theme.'/images/attachment',"","",""));
$ListView->xTemplateAssign('ERROR', $error);
//$ListView->setHeaderTitle($display_title . $header_text );
$ListView->setQuery($where, "", "date_sent, date_entered DESC", "EMAIL");
$ListView->processListView($focus, "main", "EMAIL");
$queryToStore = $focus->create_list_query($ListView->query_orderby, $ListView->query_where);
SugarVCR::store($focus->module_dir, $queryToStore);
?>

97
modules/Emails/ListViewAll.html Executable file
View File

@@ -0,0 +1,97 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script language="javascript">if(typeof sqs_objects == 'undefined'){var sqs_objects = new Array;} </script>
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope="col" class="listViewThS1" NOWRAP>{CHECKALL}</td>
<td scope="col" width="1%" class="listViewThS1" NOWRAP><slot>{ATTACHMENT_HEADER}</slot></td>
<td scope="col" width="31%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="18%" class="listViewThS1" NOWRAP>{MOD.LBL_LIST_CONTACT}</td>
<!--td scope="col" width="20%" class="listViewThS1" NOWRAP><slot>{MOD.LBL_LIST_RELATED_TO}</slot></td-->
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}assigned_user_name" class="listViewThLinkS1">{MOD.LBL_LIST_ASSIGNED}{arrow_start}{assigned_user_name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}type" class="listViewThLinkS1">{MOD.LBL_LIST_TYPE}{arrow_start}{type_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}status" class="listViewThLinkS1">{MOD.LBL_LIST_STATUS}{arrow_start}{status_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}date_entered" class="listViewThLinkS1">{MOD.LBL_LIST_CREATED}{arrow_start}{date_entered_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" onmouseover="setPointer(this, '{EMAIL.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');" onmouseout="setPointer(this, '{EMAIL.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');" onmousedown="setPointer(this, '{EMAIL.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.ATTACHMENT_IMAGE}</slot></td>
<td scope='row' valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<div id="rollover"><a href="#" class="rollover">{EMAIL.PREVIEW_IMAGE}<span>{EMAIL.ROLLOVER}</span></a></div>&nbsp;
<{TAG.MAIN} href="{URL_PREFIX}index.php?
action={EMAIL.LINK_ACTION}&
module=Emails&
record={EMAIL.ID}&
offset={EMAIL.OFFSET}&
stamp={EMAIL.STAMP}" class="listViewTdLinkS1">
{EMAIL.NAME}
</{TAG.MAIN}>
</td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<{TAG.CONTACT} href="{URL_PREFIX}index.php?
action=DetailView&
module=Contacts&
record={EMAIL.CONTACT_ID}" class="listViewTdLinkS1">
{EMAIL.CONTACT_NAME}
</{TAG.CONTACT}>
</td>
<!--td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><slot><{TAG.PARENT} href="{URL_PREFIX}index.php?action=DetailView&module={EMAIL.PARENT_MODULE}&record={EMAIL.PARENT_ID}" class="listViewTdLinkS1">{EMAIL.PARENT_NAME}</{TAG.PARENT}></slot></td-->
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.ASSIGNED_USER_NAME}</slot></td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.TYPE_NAME}</slot></td>
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{EMAIL.STATUS}</slot></td>
<td nowrap valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><slot>{EMAIL.DATE_ENTERED}</slot></td>
</tr>
<tr><td colspan="20" class="listViewHRS1"></td></tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

248
modules/Emails/ListViewAll.php Executable file
View File

@@ -0,0 +1,248 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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): ______________________________________..
********************************************************************************/
require_once('XTemplate/xtpl.php');
require_once('modules/Emails/Email.php');
require_once('include/ListView/ListView.php');
require_once('include/utils.php');
require_once('modules/MySettings/StoreQuery.php');
$focus = new Email();
$header_text = '';
$where = '';
$type = '';
$assigned_user_id = '';
$group = '';
$search_adv = '';
$whereClauses = array();
$error = '';
///////////////////////////////////////////////////////////////////////////////
////
//// SEARCH FORM FUNCTIONALITY
//// SEARCH QUERY GENERATION
$storeQuery = new StoreQuery();
// this allows My Inbox, Group Inbox, etc. to have separate stored queries
// for the same ListView.php
if(isset($_REQUEST['type'])) $Qtype = $_REQUEST['type'];
else $Qtype = '';
if(isset($_REQUEST['assigned_user_id']) && $_REQUEST['assigned_user_id'] == $current_user->id) {
$Qassigned_user_id = $_REQUEST['assigned_user_id'];
} else {
$Qassigned_user_id = '';
}
if(!isset($_REQUEST['query'])){
//_pp('loading: '.$currentModule.$Qtype.$Qgroup);
//_pp($current_user->user_preferences[$currentModule.$Qtype.'Q']);
$storeQuery->loadQuery($currentModule.$Qtype);
$storeQuery->populateRequest();
} else {
//_pp($current_user->user_preferences[$currentModule.$Qtype.'Q']);
//_pp('saving: '.$currentModule.$Qtype);
$storeQuery->saveFromGet($currentModule.$Qtype);
}
if(isset($_REQUEST['query'])) {
// we have a query
if (isset($_REQUEST['email_type'])) $email_type = $_REQUEST['email_type'];
if (isset($_REQUEST['assigned_to'])) $assigned_to = $_REQUEST['assigned_to'];
if (isset($_REQUEST['status'])) $status = $_REQUEST['status'];
if (isset($_REQUEST['name'])) $name = $_REQUEST['name'];
if (isset($_REQUEST['contact_name'])) $contact_name = $_REQUEST['contact_name'];
if(isset($email_type) && $email_type != "") $whereClauses['emails.type'] = "emails.type = '".$GLOBALS['db']->quote($email_type)."'";
if(isset($assigned_to) && $assigned_to != "") $whereClauses['emails.assigned_user_id'] = "emails.assigned_user_id = '".$GLOBALS['db']->quote($assigned_to)."'";
if(isset($status) && $status != "") $whereClauses['emails.status'] = "emails.status = '".$GLOBALS['db']->quote($status)."'";
if(isset($name) && $name != "") $whereClauses['emails.name'] = "emails.name like '".$GLOBALS['db']->quote($name)."%'";
if(isset($contact_name) && $contact_name != '') {
$contact_names = explode(" ", $contact_name);
foreach ($contact_names as $name) {
$whereClauses['contacts.name'] = "(contacts.first_name like '".$GLOBALS['db']->quote($name)."%' OR contacts.last_name like '".$GLOBALS['db']->quote($name)."%')";
}
}
$focus->custom_fields->setWhereClauses($whereClauses);
$GLOBALS['log']->info("Here is the where clause for the list view: $where");
} // end isset($_REQUEST['query'])
//// OUTPUT GENERATION
if (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
// ASSIGNMENTS pre-processing
$email_type_sel = '';
$assigned_to_sel = '';
$status_sel = '';
if(isset($_REQUEST['email_type'])) $email_type_sel = $_REQUEST['email_type'];
if(isset($_REQUEST['assigned_to'])) $assigned_to_sel = $_REQUEST['assigned_to'];
if(isset($_REQUEST['status'])) $status_sel = $_REQUEST['status'];
if(isset($_REQUEST['search'])) $search_adv = $_REQUEST['search'];
// drop-downs values
$r = $focus->db->query("SELECT id, user_name FROM users WHERE deleted = 0 AND status = 'Active' OR users.is_group = 1 ORDER BY status");
$users[] = '';
while($a = $focus->db->fetchByAssoc($r)) {
$users[$a['id']] = $a['user_name'];
}
$email_types[] = '';
$email_types = array_merge($email_types, $app_list_strings['dom_email_types']);
$email_status[] = '';
$email_status = array_merge($email_status, $app_list_strings['dom_email_status']);
$types = get_select_options_with_id($email_types, $email_type_sel);
$assigned_to = get_select_options_with_id($users, $assigned_to_sel);
$email_status = get_select_options_with_id($email_status, $status_sel);
// ASSIGNMENTS AND OUTPUT
if(isset($_REQUEST['type']) && $_REQUEST['type'] != '') $emailType = $_REQUEST['type'];
else $emailType = '';
switch($emailType) {
case 'out':
$search_form = new XTemplate ('modules/Emails/SearchFormSent.html');
break;
case 'draft':
$search_form = new XTemplate ('modules/Emails/SearchFormSent.html');
break;
case 'archived':
case 'inbound':
$search_form = new XTemplate ('modules/Emails/SearchFormMyInbox.html');
break;
default:
$search_form = new XTemplate ('modules/Emails/SearchFormMyInbox.html');
break;
}
$search_form->assign('MOD', $mod_strings);
$search_form->assign('APP', $app_strings);
$search_form->assign('IMAGE_PATH', $image_path);
$search_form->assign('ADVANCED_SEARCH_PNG', get_image($image_path.'advanced_search','alt="'.$app_strings['LNK_ADVANCED_SEARCH'].'" border="0"'));
$search_form->assign('BASIC_SEARCH_PNG', get_image($image_path.'basic_search','alt="'.$app_strings['LNK_BASIC_SEARCH'].'" border="0"'));
$search_form->assign('TYPE_OPTIONS', $types);
$search_form->assign('ASSIGNED_TO_OPTIONS', $assigned_to);
$search_form->assign('STATUS_OPTIONS', $email_status);
$search_form->assign('ADV_URL', $_SERVER['REQUEST_URI']);
$search_form->assign('SEARCH_ADV', $search_adv);
if(isset($_REQUEST['name'])) $search_form->assign('NAME', $_REQUEST['name']);
if(isset($_REQUEST['contact_name'])) $search_form->assign('CONTACT_NAME', $_REQUEST['contact_name']);
if(isset($current_user_only)) $search_form->assign('CURRENT_USER_ONLY', "checked");
// adding custom fields:
$focus->custom_fields->populateXTPL($search_form, 'search' );
$search_form->assign('SEARCH_ACTION', 'ListView');
$search_form->assign('TYPE', $Qtype);
if(!empty($_REQUEST['assigned_user_id'])) {
$search_form->assign('ASSIGNED_USER_ID', $_REQUEST['assigned_user_id']);
}
$search_form->assign('JAVASCRIPT', $focus->js_set_archived().$focus->u_get_clear_form_js($Qtype, '', $Qassigned_user_id));
}
//// END SEARCH FORM FUNCTIONALITY
////
///////////////////////////////////////////////////////////////////////////////
// STANDARD EMAIL BOX FUNCTIONS
global $email_title;
$display_title = $mod_strings['LBL_LIST_FORM_TITLE'];
if($email_title)$display_title = $email_title;
$ListView = new ListView();
$ListView->initNewXTemplate('modules/Emails/ListViewAll.html', $mod_strings);
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
///////////////////////////////////////////////////////////////////////////////
echo "\n<p>\n";
echo get_module_title("Emails", $mod_strings['LBL_MODULE_TITLE'].$display_title, true);
echo "\n</p>\n";
// admin-edit
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=".$_REQUEST['module'] ."'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
}
// search form
echo get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE']. $header_text, "", false);
// ADVANCED SEARCH
if(isset($_REQUEST['search']) && $_REQUEST['search'] == 'advanced') {
$search_form->parse('adv');
$search_form->out('adv');
} else {
$search_form->parse('main');
$search_form->out('main');
}
// CONSTRUCT WHERE STRING FROM WHERECLAUSE ARRAY
foreach($whereClauses as $clause) {
if($where != "")
$where .= " AND ";
$where .= $clause;
}
//echo $where;
//echo $focus->quickCreateJS();
$ListView->setAdditionalDetails();
$ListView->xTemplateAssign('ATTACHMENT_HEADER', get_image('themes/'.$theme.'/images/attachment',"","",""));
$ListView->xTemplateAssign('ERROR', $error);
$ListView->setHeaderTitle($display_title . $header_text );
$ListView->setQuery($where, "", "date_sent, date_entered DESC", "EMAIL");
$ListView->processListView($focus, "main", "EMAIL");
?>

View File

@@ -0,0 +1,71 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<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" width="1%" NOWRAP>{CHECKALL}</td>
<td scope="col" width="40%" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="18%" NOWRAP>{MOD.LBL_LIST_CONTACT}</td>
<td scope="col" width="30%" NOWRAP><slot>{MOD.LBL_LIST_RELATED_TO}</slot></td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}date_entered" class="listViewThLinkS1">{MOD.LBL_LIST_CREATED}{arrow_start}{date_entered_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">{PREROW}</td>
<td valign=TOP><slot>
<div id="rollover"><a href="#" class="rollover">{EMAIL.PREVIEW_IMAGE}<span>{EMAIL.ROLLOVER}</span></a></div>&nbsp;
<{TAG.MAIN} href="{URL_PREFIX}index.php?action=EditView&type=out&module=Emails&record={DRAFTEMAIL.ID}" >{DRAFTEMAIL.NAME}</{TAG.MAIN}></slot></td>
<td valign=TOP><slot><{TAG.CONTACT} href="{URL_PREFIX}index.php?action=DetailView&module=Contacts&record={DRAFTEMAIL.CONTACT_ID}" >{DRAFTEMAIL.CONTACT_NAME}</{TAG.CONTACT}></slot></td>
<td valign=TOP><slot><{TAG.PARENT} href="{URL_PREFIX}index.php?action=DetailView&module={DRAFTEMAIL.PARENT_MODULE}&record={DRAFTEMAIL.PARENT_ID}" >{DRAFTEMAIL.PARENT_NAME}</{TAG.PARENT}></slot></td>
<td nowrap valign=TOP><slot>{DRAFTEMAIL.DATE_ENTERED}</slot></td>
</tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

263
modules/Emails/ListViewGroup.php Executable file
View File

@@ -0,0 +1,263 @@
<?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): ______________________________________..
********************************************************************************/
require_once('modules/MySettings/StoreQuery.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
global $theme;
global $focus_list; // focus_list is the means of passing data to a ListView.
$focus = new Email();
$header_text = '';
$where = '';
$type = '';
$assigned_user_id = '';
$group = '';
$search_adv = '';
$whereClauses = array();
$error = '';
///////////////////////////////////////////////////////////////////////////////
////
//// SEARCH FORM FUNCTIONALITY
//// SEARCH QUERY GENERATION
$storeQuery = new StoreQuery();
if(!isset($_REQUEST['query'])){
//_pp('loading: '.$currentModule.'Group');
//_pp($current_user->user_preferences[$currentModule.'GroupQ']);
$storeQuery->loadQuery($currentModule.'Group');
$storeQuery->populateRequest();
} else {
//_pp($current_user->user_preferences[$currentModule.'GroupQ']);
//_pp('saving: '.$currentModule.'Group');
$storeQuery->saveFromGet($currentModule.'Group');
}
if(isset($_REQUEST['query'])) {
// we have a query
if(isset($_REQUEST['email_type'])) $email_type = $_REQUEST['email_type'];
if(isset($_REQUEST['assigned_to'])) $assigned_to = $_REQUEST['assigned_to'];
if(isset($_REQUEST['status'])) $status = $_REQUEST['status'];
if(isset($_REQUEST['name'])) $name = $_REQUEST['name'];
if(isset($_REQUEST['contact_name'])) $contact_name = $_REQUEST['contact_name'];
if(isset($email_type) && $email_type != "") $whereClauses['emails.type'] = "emails.type = '".$GLOBALS['db']->quote($email_type)."'";
if(isset($assigned_to) && $assigned_to != "") $whereClauses['emails.assigned_user_id'] = "emails.assigned_user_id = '".$GLOBALS['db']->quote($assigned_to)."'";
if(isset($status) && $status != "") $whereClauses['emails.status'] = "emails.status = '".$GLOBALS['db']->quote($status)."'";
if(isset($name) && $name != "") $whereClauses['emails.name'] = "emails.name like '".$GLOBALS['db']->quote($name)."%'";
if(isset($contact_name) && $contact_name != '') {
$contact_names = explode(" ", $contact_name);
foreach ($contact_names as $name) {
$whereClauses['contacts.name'] = "(contacts.first_name like '".$GLOBALS['db']->quote($name)."%' OR contacts.last_name like '".$GLOBALS['db']->quote($name)."%')";
}
}
$focus->custom_fields->setWhereClauses($whereClauses);
$GLOBALS['log']->info("Here is the where clause for the list view: $where");
} // end isset($_REQUEST['query'])
//// OUTPUT GENERATION
if (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
// ASSIGNMENTS pre-processing
$email_type_sel = '';
$assigned_to_sel = '';
$status_sel = '';
if(isset($_REQUEST['email_type'])) $email_type_sel = $_REQUEST['email_type'];
if(isset($_REQUEST['assigned_to'])) $assigned_to_sel = $_REQUEST['assigned_to'];
if(isset($_REQUEST['status'])) $status_sel = $_REQUEST['status'];
if(isset($_REQUEST['search'])) $search_adv = $_REQUEST['search'];
// drop-downs values
$r = $focus->db->query("SELECT id, user_name FROM users WHERE deleted = 0 AND status = 'Active' OR users.is_group = 1 ORDER BY status");
$users[] = '';
while($a = $focus->db->fetchByAssoc($r)) {
$users[$a['id']] = $a['user_name'];
}
$email_types[] = '';
$email_types = array_merge($email_types, $app_list_strings['dom_email_types']);
$email_status[] = '';
$email_status = array_merge($email_status, $app_list_strings['dom_email_status']);
$types = get_select_options_with_id($email_types, $email_type_sel);
$assigned_to = get_select_options_with_id($users, $assigned_to_sel);
$email_status = get_select_options_with_id($email_status, $status_sel);
// ASSIGNMENTS AND OUTPUT
$search_form = new XTemplate ('modules/Emails/SearchFormGroupInbox.html');
$search_form->assign('MOD', $mod_strings);
$search_form->assign('APP', $app_strings);
$search_form->assign('ADVANCED_SEARCH_PNG', SugarThemeRegistry::current()->getImage('advanced_search','alt="'.$app_strings['LNK_ADVANCED_SEARCH'].'" border="0"'));
$search_form->assign('BASIC_SEARCH_PNG', SugarThemeRegistry::current()->getImage('basic_search','alt="'.$app_strings['LNK_BASIC_SEARCH'].'" border="0"'));
$search_form->assign('TYPE_OPTIONS', $types);
$search_form->assign('ASSIGNED_TO_OPTIONS', $assigned_to);
$search_form->assign('STATUS_OPTIONS', $email_status);
$search_form->assign('ADV_URL', $_SERVER['REQUEST_URI']);
$search_form->assign('SEARCH_ADV', $search_adv);
$search_form->assign('SEARCH_ACTION', 'ListViewGroup');
if(isset($_REQUEST['name'])) $search_form->assign('NAME', $_REQUEST['name']);
if(isset($_REQUEST['contact_name'])) $search_form->assign('CONTACT_NAME', $_REQUEST['contact_name']);
if(isset($current_user_only)) $search_form->assign('CURRENT_USER_ONLY', "checked");
// adding custom fields:
$focus->custom_fields->populateXTPL($search_form, 'search' );
if(!empty($get['assigned_user_id'])) {
$search_form->assign('ASSIGNED_USER_ID', $get['assigned_user_id']);
}
$search_form->assign('JAVASCRIPT', $focus->u_get_clear_form_js());
}
//// END SEARCH FORM FUNCTIONALITY
////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// NAVIGATION HACK
$_SESSION['emailStartAction'] = ''; // empty this value to allow new writes
//// END NAVIGATION HACK
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
////
//// INBOX FUNCTIONALITY
// for Inbox
$r = $focus->db->query('SELECT count(id) AS c FROM users WHERE users.is_group = 1 AND deleted = 0');
$a = $focus->db->fetchByAssoc($r);
$or = 'emails.assigned_user_id IN (\'abc\''; // must have a dummy entry to force group inboxes to not show personal emails
if($a['c'] > 0) {
$r = $focus->db->query('SELECT id FROM users WHERE users.is_group = 1 AND deleted = 0');
while($a = $focus->db->fetchByAssoc($r)) {
$or .= ',\''.$a['id'].'\'';
}
}
$or .= ') ';
$whereClauses['emails.assigned_user_id'] = $or;
$whereClauses['emails.type'] = 'emails.type = \'inbound\'';
$display_title = $mod_strings['LBL_LIST_TITLE_GROUP_INBOX'];
//// END INBOX FUNCTIONALITY
////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
///////////////////////////////////////////////////////////////////////////////
echo get_module_title("Emails", $mod_strings['LBL_MODULE_TITLE'].$display_title, true);
// admin-edit
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=".$_REQUEST['module'] ."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
}
// search form
echo get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE']. $header_text, "", false);
// ADVANCED SEARCH
if(isset($_REQUEST['search']) && $_REQUEST['search'] == 'advanced') {
$search_form->parse('adv');
$search_form->out('adv');
} else {
$search_form->parse('main');
$search_form->out('main');
}
echo $focus->rolloverStyle; // for email previews
if(!empty($_REQUEST['error'])) {
$error = $app_list_strings['dom_email_errors'][$_REQUEST['error']];
}
//_pp($where);
if(!empty($assigned_to_sel)) {
$whereClauses['emails.assigned_user_id'] = 'emails.assigned_user_id = \''.$assigned_to_sel.'\'';
}
//_pp($whereClauses);
// CONSTRUCT WHERE STRING FROM WHERECLAUSE ARRAY
foreach($whereClauses as $clause) {
if($where != '') {
$where .= ' AND ';
}
$where .= $clause;
}
//echo $focus->quickCreateJS();
$ListView = new ListView();
// group distributionforms
echo $focus->distributionForm($where);
$ListView->shouldProcess = true;
$ListView->show_mass_update = true;
$ListView->show_mass_update_form = false;
$ListView->initNewXTemplate( 'modules/Emails/ListViewGroupInbox.html',$mod_strings);
$ListView->xTemplateAssign('ATTACHMENT_HEADER', SugarThemeRegistry::current()->getImage('attachment',"","",""));
$ListView->xTemplateAssign('ERROR', $error);
$ListView->xTemplateAssign('CHECK_MAIL',$focus->checkInbox('group'));
$ListView->setHeaderTitle($display_title . $header_text );
$ListView->setQuery($where, '', 'date_sent, date_entered DESC', 'EMAIL');
$ListView->setAdditionalDetails();
$ListView->processListView($focus, 'main', 'EMAIL');
?>

View File

@@ -0,0 +1,82 @@
<!--
/*********************************************************************************
* 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 -->
{CHECK_MAIL}
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<span class="error"><b>{ERROR}</b></span>
<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>{CHECKALL}</td>
<td scope="col" width="1%" NOWRAP><slot>{ATTACHMENT_HEADER}</slot></td>
<td scope="col" width="41%" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="18%" NOWRAP>{MOD.LBL_LIST_CONTACT}</td>
<td scope="col" width="20%" NOWRAP><slot>{MOD.LBL_LIST_RELATED_TO}</slot></td>
<td scope="col" width="10%" NOWRAP><slot>{MOD.LBL_QUICK_REPLY}</slot></td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}assigned_user_name" class="listViewThLinkS1">{MOD.LBL_LIST_ASSIGNED}{arrow_start}{assigned_user_name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}date_sent" class="listViewThLinkS1">{MOD.LBL_LIST_DATE_SENT}{arrow_start}{date_sent_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">{PREROW}</td>
<td valign=TOP nowrap><slot>{EMAIL.ATTACHMENT_IMAGE}</slot></td>
<td scope='row' valign=TOP><slot>
<div id="rollover"><a href="#" class="rollover">{EMAIL.PREVIEW_IMAGE}<span>{EMAIL.ROLLOVER}</span></a></div>&nbsp;
<{TAG.MAIN} href="{URL_PREFIX}index.php?action={EMAIL.LINK_ACTION}&module=Emails&record={EMAIL.ID}&offset={EMAIL.OFFSET}&stamp={EMAIL.STAMP}" >{EMAIL.NAME}</{TAG.MAIN}></slot></td>
<td valign=TOP><slot><{TAG.CONTACT} href="{URL_PREFIX}index.php?action=DetailView&module=Contacts&record={EMAIL.CONTACT_ID}" >{EMAIL.CONTACT_NAME}</{TAG.CONTACT}></slot></td>
<td valign=TOP><slot>{EMAIL.CREATE_RELATED}<{TAG.PARENT} href="{URL_PREFIX}index.php?action=DetailView&module={EMAIL.PARENT_MODULE}&record={EMAIL.PARENT_ID}" >{EMAIL.PARENT_NAME}</{TAG.PARENT}></slot></td>
<td valign=TOP nowrap><slot>{EMAIL.QUICK_REPLY}</slot></td>
<td valign=TOP nowrap><slot>{EMAIL.ASSIGNED_USER_NAME}</slot></td>
<td nowrap valign=TOP><slot>{EMAIL.DATE_SENT}</slot></td>
</tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

View File

@@ -0,0 +1,67 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<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" width="50%" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="20%" NOWRAP>{MOD.LBL_LIST_CONTACT}</td>
<td scope="col" width="20%" NOWRAP><slot>{MOD.LBL_LIST_RELATED_TO}</slot></td>
<td scope="col" width="10%" NOWRAP><slot>{MOD.LBL_QUICK_REPLY}</slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td scope='row' valign=TOP><slot>
<div id="rollover"><a href="#" class="rollover">{EMAIL.PREVIEW_IMAGE}<span>{EMAIL.ROLLOVER}</span></a></div>&nbsp;
<{TAG.MAIN} href="{URL_PREFIX}index.php?action={EMAIL.LINK_ACTION}&module=Emails&record={EMAIL.ID}&offset={EMAIL.OFFSET}&stamp={EMAIL.STAMP}" >{EMAIL.NAME}</{TAG.MAIN}></slot></td>
<td nowrap="nowrap" valign="top"><slot><{TAG.CONTACT} href="{URL_PREFIX}index.php?action=DetailView&module=Contacts&record={EMAIL.CONTACT_ID}" >{EMAIL.CONTACT_NAME}</{TAG.CONTACT}></slot></td>
<td nowrap="nowrap" valign="top"><slot>{EMAIL.CREATE_RELATED}<{TAG.PARENT} href="{URL_PREFIX}index.php?action=DetailView&module={EMAIL.PARENT_MODULE}&record={EMAIL.PARENT_ID}" >{EMAIL.PARENT_NAME}</{TAG.PARENT}></slot></td>
<td nowrap="nowrap" valign="top"><slot>{EMAIL.QUICK_REPLY}</slot></td>
</tr>
<!-- END: row -->
</table>
<!-- END: main -->

76
modules/Emails/ListViewHome.php Executable file
View File

@@ -0,0 +1,76 @@
<?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 $theme;
global $sugar_config;
global $current_language;
$currentMax = $sugar_config['list_max_entries_per_page'];
$sugar_config['list_max_entries_per_page'] = 10;
$current_mod_strings = return_module_language($current_language, 'Emails');
$focus = new Email();
$ListView = new ListView();
$display_title = $current_mod_strings['LBL_LIST_TITLE_MY_INBOX'].': '.$current_mod_strings['LBL_UNREAD_HOME'];
$where = 'emails.deleted = 0 AND emails.assigned_user_id = \''.$current_user->id.'\' AND emails.type = \'inbound\' AND emails.status = \'unread\'';
$limit = 10;
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
///////////////////////////////////////////////////////////////////////////////
echo $focus->rolloverStyle;
$ListView->initNewXTemplate('modules/Emails/ListViewHome.html',$current_mod_strings);
$ListView->xTemplateAssign('ATTACHMENT_HEADER', SugarThemeRegistry::current()->getImage('attachment',"","",""));
$ListView->setHeaderTitle($display_title);
$ListView->setQuery($where, '', 'date_sent, date_entered DESC', "EMAIL");
$ListView->setAdditionalDetails();
$ListView->processListView($focus, 'main', 'EMAIL');
//echo $focus->quickCreateJS();
$sugar_config['list_max_entries_per_page'] = $currentMax;
?>

View File

@@ -0,0 +1,80 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script language="javascript">if(typeof sqs_objects == 'undefined'){var sqs_objects = new Array;}</script>
{TAKE}&nbsp;{CHECK_MAIL}
{TAKE_ERROR}
<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>{CHECKALL}</td>
<td scope="col" width="1%" NOWRAP><slot>{ATTACHMENT_HEADER}</slot></td>
<td scope="col" width="31%" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="18%" NOWRAP>{MOD.LBL_LIST_CONTACT}</td>
<td scope="col" width="20%" NOWRAP><slot>{MOD.LBL_LIST_RELATED_TO}</slot></td>
<td scope="col" width="20%" NOWRAP><slot>{MOD.LBL_QUICK_REPLY}</slot></td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}status" class="listViewThLinkS1">{MOD.LBL_LIST_STATUS}{arrow_start}{status_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}date_sent" class="listViewThLinkS1">{MOD.LBL_LIST_DATE_SENT}{arrow_start}{date_sent_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">{PREROW}</td>
<td valign=TOP nowrap><slot>{EMAIL.ATTACHMENT_IMAGE}</slot></td>
<td scope='row' valign=TOP><slot>
<div id="rollover"><a href="#" class="rollover">{EMAIL.PREVIEW_IMAGE}<span>{EMAIL.ROLLOVER}</span></a></div>&nbsp;
<{TAG.MAIN} href="{URL_PREFIX}index.php?action={EMAIL.LINK_ACTION}&module=Emails&record={EMAIL.ID}&offset={EMAIL.OFFSET}&stamp={EMAIL.STAMP}" >{EMAIL.NAME}</{TAG.MAIN}></slot></td>
<td valign=TOP><slot><{TAG.CONTACT} href="{URL_PREFIX}index.php?action=DetailView&module=Contacts&record={EMAIL.CONTACT_ID}" >{EMAIL.CONTACT_NAME}</{TAG.CONTACT}></slot></td>
<td valign=TOP><slot>{EMAIL.CREATE_RELATED}<{TAG.PARENT} href="{URL_PREFIX}index.php?action=DetailView&module={EMAIL.PARENT_MODULE}&record={EMAIL.PARENT_ID}" >{EMAIL.PARENT_NAME}</{TAG.PARENT}></slot></td>
<td valign=TOP nowrap><slot>{EMAIL.QUICK_REPLY}</slot></td>
<td valign=TOP nowrap><slot>{EMAIL.STATUS}</slot></td>
<td nowrap valign=TOP><slot>{EMAIL.DATE_SENT}</slot></td>
</tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

View File

@@ -0,0 +1,69 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<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" width="1%" NOWRAP>{CHECKALL}</td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}to_addrs" class="listViewThLinkS1">{MOD.LBL_LIST_TO_ADDR}{arrow_start}{to_addr_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="40%" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="30%" NOWRAP><slot>{MOD.LBL_LIST_RELATED_TO}</slot></td>
<td scope="col" width="10%" NOWRAP><slot><a href="{ORDER_BY}date_sent" class="listViewThLinkS1">{MOD.LBL_LIST_DATE}{arrow_start}{date_sent_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">{PREROW}</td>
<td scope='row' valign=TOP><slot>{SENTEMAIL.TO_ADDRS}</slot></td>
<td valign=TOP><slot><{TAG.MAIN} href="{URL_PREFIX}index.php?action=DetailViewSent&module=Emails&record={SENTEMAIL.ID}" >{SENTEMAIL.NAME}</{TAG.MAIN}></slot></td>
<td valign=TOP><slot><{TAG.PARENT} href="{URL_PREFIX}index.php?action=DetailView&module={SENTEMAIL.PARENT_MODULE}&record={SENTEMAIL.PARENT_ID}" >{SENTEMAIL.PARENT_NAME}</{TAG.PARENT}></slot></td>
<td nowrap valign=TOP><slot>{SENTEMAIL.DATE_SENT}</slot></td>
</tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

60
modules/Emails/MassDelete.php Executable file
View File

@@ -0,0 +1,60 @@
<?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".
********************************************************************************/
if(!empty($_REQUEST['grabbed'])) {
$focus = new Email();
$emailIds = array();
// CHECKED ONLY:
$grabEx = explode('::',$_REQUEST['grabbed']);
foreach($grabEx as $k => $emailId) {
if($emailId != "undefined") {
$focus->mark_deleted($emailId);
}
}
header('Location: index.php?module=Emails&action=ListViewGroup');
} else {
global $mod_strings;
// error
$error = $mod_strings['LBL_MASS_DELETE_ERROR'];
header('Location: index.php?module=Emails&action=ListViewGroup&error='.$error);
}
?>

56
modules/Emails/Menu.php Executable file
View File

@@ -0,0 +1,56 @@
<?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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/
global $mod_strings;
global $current_user;
$default = 'index.php?module=Emails&action=ListView&assigned_user_id='.$current_user->id;
$e = new Email();
// my inbox
if(ACLController::checkAccess('Emails', 'edit', true)) {
$module_menu[] = array('index.php?module=Emails&action=ListView', $mod_strings['LNK_VIEW_MY_INBOX'],"EmailFolder","Emails");
}
?>

View File

@@ -0,0 +1,110 @@
<?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;
global $locale;
$userName = $mod_strings['LBL_UNKNOWN'];
if(isset($_REQUEST['user'])) {
$user = new User();
$user->retrieve($_REQUEST['user']);
$userName = $locale->getLocaleFormattedName($user->first_name, $user->last_name);
}
// NEXT FREE
if(isset($_REQUEST['next_free']) && $_REQUEST['next_free'] == true) {
$next = new Email();
$rG = $next->db->query('SELECT count(id) AS c FROM users WHERE deleted = 0 AND users.is_group = 1');
$aG = $next->db->fetchByAssoc($rG);
if($rG['c'] > 0) {
$rG = $next->db->query('SELECT id FROM users WHERE deleted = 0 AND users.is_group = 1');
$aG = $next->db->fetchByAssoc($rG);
while($aG = $next->db->fetchByAssoc($rG)) {
$ids[] = $aG['id'];
}
$in = ' IN (';
foreach($ids as $k => $id) {
$in .= '"'.$id.'", ';
}
$in = substr($in, 0, (strlen($in) - 2));
$in .= ') ';
$team = '';
$qE = 'SELECT count(id) AS c FROM emails WHERE deleted = 0 AND assigned_user_id'.$in.$team.'LIMIT 1';
$rE = $next->db->query($qE);
$aE = $next->db->fetchByAssoc($rE);
if($aE['c'] > 0) {
$qE = 'SELECT id FROM emails WHERE deleted = 0 AND assigned_user_id'.$in.$team.'LIMIT 1';
$rE = $next->db->query($qE);
$aE = $next->db->fetchByAssoc($rE);
$next->retrieve($aE['id']);
$next->assigned_user_id = $current_user->id;
$next->save();
header('Location: index.php?module=Emails&action=DetailView&record='.$next->id);
} else {
// no free items
header('Location: index.php?module=Emails&action=ListView&type=inbound&group=true');
}
} else {
// no groups
header('Location: index.php?module=Emails&action=ListView&type=inbound&group=true');
}
}
?>
<table width="100%" cellpadding="12" cellspacing="0" border="0">
<tr>
<td valign="middle" align="center" colspan="2">
<?php echo $mod_strings['LBL_LOCK_FAIL_DESC']; ?>
<br>
<?php echo $userName.$mod_strings['LBL_LOCK_FAIL_USER']; ?>
</td>
</tr>
<tr>
<td valign="middle" align="right" width="50%">
<a href="index.php?module=Emails&action=ListView&type=inbound&group=true"><?php echo $mod_strings['LBL_BACK_TO_GROUP']; ?></a>
</td>
<td valign="middle" align="left">
<a href="index.php?module=Emails&action=PessimisticLock&next_free=true"><?php echo $mod_strings['LBL_NEXT_EMAIL']; ?></a>
</td>
</tr>
</table>

53
modules/Emails/Popup.php Executable file
View File

@@ -0,0 +1,53 @@
<?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".
********************************************************************************/
if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'show_raw') {
if(!class_exists("Email")) {
}
$email = new Email();
$email->retrieve($_REQUEST['metadata']);
echo nl2br($email->safeText($email->raw_source));
} else {
require_once('include/Popups/Popup_picker.php');
$popup = new Popup_Picker();
echo $popup->process_page();
}
?>

View File

@@ -0,0 +1,110 @@
<!--
/*********************************************************************************
* 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 -->
<script type="text/javascript" src="include/javascript/sugar_3.js"></script>
<script type="text/javascript" src="modules/Emails/javascript/Email.js"></script>
<!-- BEGIN: SearchHeader -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<form action="index.php" method="post" name="popup_query_form" id="popup_query_form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_DOC_NAME}</td>
<td nowrap="nowrap"><input type="text" name="document_name" size="10" value="{DOCUMENT_NAME}"/></td>
<td scope="row" nowrap="nowrap">{MOD.LBL_DET_IS_TEMPLATE}</td>
<td nowrap="nowrap"><select name="is_template" >{IS_TEMPLATE_OPTIONS}</select></td>
</tr>
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_DET_TEMPLATE_TYPE}</td>
<td nowrap="nowrap"><select name="template_type" >{TEMPLATE_TYPE_OPTIONS}</select></td>
<td scope="row" nowrap="nowrap">{MOD.LBL_CATEGORY_VALUE}</td>
<td nowrap="nowrap"><select name="category_id" >{CATEGORY_OPTIONS}</select></td>
</tr>
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_SUBCATEGORY_VALUE}</td>
<td nowrap="nowrap"><select name="subcategory_id" >{SUB_CATEGORY_OPTIONS}</select></td>
<td align="right" colspan=2>
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="action" value="PopupDocuments" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="to_pdf" value="true" />
<input type="hidden" name="record_id" value="" />
<input type="hidden" name="target" value="{DOCUMENT_TARGET}" />
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<!-- END: SearchHeader -->
<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" width="33%" nowrap="nowrap"><a href="{ORDER_BY}document_name" class="listViewThLinkS1">{MOD.LBL_LIST_DOCUMENT}{arrow_start}{name_arrow}{arrow_end}</a></td>
<td scope="col" width="33%" nowrap="nowrap">{MOD.LBL_LIST_REVISION}</td>
<td scope="col" width="34%" nowrap="nowrap">{MOD.LBL_LIST_STATUS}</td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td scope="row" valign="top">
<a href="javascript:void(0);" onclick="setDocument('{DOCUMENT_TARGET}','{DOCUMENT.ID}', '{DOCUMENT.DOCUMENT_NAME_JAVASCRIPT}','{DOCUMENT.DOCUMENT_REVISION_ID}');" >{DOCUMENT.DOCUMENT_NAME}</a>
</td>
<td valign="top">{DOCUMENT.LATEST_REVISION}</td>
<td valign="top">{DOCUMENT.STATUS_ID}</td>
</tr>
<tr>
<td colspan="20" class="listViewHRS1"></td>
</tr>
<!-- END: row -->
</table>

149
modules/Emails/PopupDocuments.php Executable file
View File

@@ -0,0 +1,149 @@
<?php
//_pp($_REQUEST);
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): ______________________________________..
********************************************************************************/
require_once('modules/Documents/Popup_picker.php');
$popup = new Popup_Picker();
global $theme;
global $current_mod_strings;
global $app_strings;
global $currentModule;
global $sugar_version, $sugar_config;
global $app_list_strings;
$current_mod_strings = return_module_language($current_language, 'Documents');
$output_html = '';
$where = '';
$where = $popup->_get_where_clause();
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
$document_name = empty($_REQUEST['document_name']) ? '' : $_REQUEST['document_name'];
$category_id = empty($_REQUEST['category_id']) ? '' : $_REQUEST['category_id'];
$subcategory_id = empty($_REQUEST['subcategory_id']) ? '' : $_REQUEST['subcategory_id'];
$template_type = empty($_REQUEST['template_type']) ? '' : $_REQUEST['template_type'];
$is_template = empty($_REQUEST['is_template']) ? '' : $_REQUEST['is_template'];
$document_revision_id = empty($_REQUEST['document_revision_id']) ? '' : $_REQUEST['document_revision_id'];
//$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
if(!$hide_clear_button)
{
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CLEAR_BUTTON_KEY']."' value=' "
.$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' "
.$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/Emails/PopupDocuments.html');
$form->assign('MOD', $current_mod_strings);
$form->assign('APP', $app_strings);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('NAME', $name);
$form->assign('DOCUMENT_NAME', $document_name);
$form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
$form->assign('DOCUMENT_REVISION_ID', $document_revision_id);
//$form->assign('request_data', $request_data);
$form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_category_dom'], $category_id));
$form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_subcategory_dom'], $subcategory_id));
$form->assign("IS_TEMPLATE_OPTIONS", get_select_options_with_id($app_list_strings['checkbox_dom'], $is_template));
$form->assign("TEMPLATE_TYPE_OPTIONS", get_select_options_with_id($app_list_strings['document_template_type_dom'], $template_type));
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($current_mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
// create the listview
$seed_bean = new Document();
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($current_mod_strings['LBL_LIST_FORM_TITLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', 'document_name', 'DOCUMENT');
$ListView->setModStrings($current_mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', 'DOCUMENT');
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= insert_popup_footer();
echo $output_html;
?>

128
modules/Emails/Popup_picker.html Executable file
View File

@@ -0,0 +1,128 @@
<!--
/*********************************************************************************
* 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 -->
<!-- BEGIN: SearchHeader -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&amp;c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<form action="index.php" method="post" name="popup_query_form" id="popup_query_form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" width="40%" nowrap="nowrap">
{MOD.LBL_SUBJECT}&nbsp;&nbsp;<input type="text" size="20" name="name" value="{NAME}" />
</td>
<td scope="row" width="40%" nowrap="nowrap">
{MOD.LBL_CONTACT_NAME}&nbsp;&nbsp;
<input type="text" size="20" name="contact_name" value="{CONTACT_NAME}" />
</td>
<td width="20%" align="right">
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="func_name" value="" />
<input type="hidden" name="request_data" value="{request_data}" />
<input type="hidden" name="populate_parent" value="false" />
<input type="hidden" name="record_id" value="" />
<input type="submit" name="button" class="button" title="{APP.LBL_SEARCH_BUTTON_TITLE}" accesskey="{APP.LBL_SEARCH_BUTTON_KEY}" value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
if(window.document.forms['popup_query_form'].request_data.value == "") {
window.document.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
</script>
<!-- END: SearchHeader -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope="col" nowrap>
{CHECKALL}
</td>
<td scope="col" width="35%" nowrap="nowrap" ">
<a href="{ORDER_BY}name" class="listViewThLinkS1">
{MOD.LBL_LIST_SUBJECT}{arrow_start}{number_arrow}{arrow_end}</a>
</td>
<td scope="col" width="30%" nowrap="nowrap" ">
<a href="{ORDER_BY}last_name" class="listViewThLinkS1">
{MOD.LBL_LIST_CONTACT_NAME}{arrow_start}{last_name_arrow}{arrow_end}</a>
</td>
<td scope="col" width="30%" nowrap="nowrap" ">
<a href="{ORDER_BY}date_start" class="listViewThLinkS1">
{MOD.LBL_LIST_DATE_SENT}{arrow_start}{date_start_arrow}{arrow_end}</a>
</td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">
{PREROW}
</td>
<td scope='row' valign="top">
<a href="#" onclick="send_back('Emails','{EMAIL.ID}');" >
{EMAIL.NAME}</a>
</td>
<td valign="top" bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1">
{EMAIL.CONTACT_NAME}
</td>
<td valign="top" bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1">
{EMAIL.DATE_SENT}
</td>
</tr>
<tr>
<td colspan="20" class="listViewHRS1">
</td>
</tr>
<!-- END: row -->
</table>
{ASSOCIATED_JAVASCRIPT_DATA}
<!-- END: main -->

150
modules/Emails/Popup_picker.php Executable file
View File

@@ -0,0 +1,150 @@
<?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;
class Popup_Picker {
/*
*
*/
function Popup_Picker() {
}
/*
*
*/
function _get_where_clause() {
$where = '';
if(isset($_REQUEST['query'])) {
$where_clauses = array();
append_where_clause($where_clauses, "name", "emails.name");
append_where_clause($where_clauses, "contact_name", "contacts.last_name");
$where = generate_where_statement($where_clauses);
}
return $where;
}
/**
*
*/
function process_page() {
global $theme;
global $mod_strings;
global $app_strings;
global $currentModule;
$output_html = '';
$where = '';
$where = $this->_get_where_clause();
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
$contact_name = empty($_REQUEST['contact_name']) ? '' : $_REQUEST['contact_name'];
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
if(!$hide_clear_button) {
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CLEAR_BUTTON_KEY']."' value=' "
.$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' "
.$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/Emails/Popup_picker.html');
$form->assign('MOD', $mod_strings);
$form->assign('APP', $app_strings);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('NAME', $name);
$form->assign('CONTACT_NAME', $contact_name);
$form->assign('request_data', $request_data);
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
// create the listview
$seed_bean = new Email();
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', 'name', 'EMAIL');
$ListView->setModStrings($mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', 'EMAIL');
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= insert_popup_footer();
return $output_html;
}
} // end of class Popup_Picker
?>

302
modules/Emails/Save.php Executable file
View File

@@ -0,0 +1,302 @@
<?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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/
///////////////////////////////////////////////////////////////////////////////
//// EMAIL SEND/SAVE SETUP
$focus = new Email();
if(!isset($prefix)) {
$prefix = '';
}
if(isset($_POST[$prefix.'meridiem']) && !empty($_POST[$prefix.'meridiem'])) {
$_POST[$prefix.'time_start'] = $timedate->merge_time_meridiem($_POST[$prefix.'time_start'], $timedate->get_time_format(true), $_POST[$prefix.'meridiem']);
}
//retrieve the record
if(isset($_POST['record']) && !empty($_POST['record'])) {
$focus->retrieve($_POST['record']);
}
if(isset($_REQUEST['user_id'])) {
$focus->assigned_user_id = $_REQUEST['user_id'];
}
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if(!empty($_POST['assigned_user_id']) && ($focus->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
$check_notify = TRUE;
}
//populate the fields of this Email
$allfields = array_merge($focus->column_fields, $focus->additional_column_fields);
foreach($allfields as $field) {
if(isset($_POST[$field])) {
$value = $_POST[$field];
$focus->$field = $value;
}
}
$focus->description = $_REQUEST['description_html'];
$focus->description_html = $_REQUEST['description_html'];
if (!isset($_REQUEST['to_addrs'])) {
$_REQUEST['to_addrs'] = "";
}
if (!isset($_REQUEST['to_addrs_ids'])) {
$_REQUEST['to_addrs_ids'] = "";
}
if (!isset($_REQUEST['to_addrs_names'])) {
$_REQUEST['to_addrs_names'] = "";
}
if (!isset($_REQUEST['to_addrs_emails'])) {
$_REQUEST['to_addrs_emails'] = "";
}
//compare the 3 fields and return list of contact_ids to link:
$focus->to_addrs_arr = $focus->parse_addrs($_REQUEST['to_addrs'], $_REQUEST['to_addrs_ids'], $_REQUEST['to_addrs_names'], $_REQUEST['to_addrs_emails']);
// make sure the cc_* and bcc_* fields are at least empty if not set
$fields_to_check = array(
'cc_addrs',
'cc_addrs_ids',
'bcc_addrs',
'bcc_addrs_ids',
'cc_addrs_names',
'cc_addrs_emails',
'bcc_addrs_emails',
);
foreach ($fields_to_check as $field_to_check) {
if (!isset($_REQUEST[$field_to_check])) {
$_REQUEST[$field_to_check] = '';
}
}
$focus->cc_addrs_arr = $focus->parse_addrs($_REQUEST['cc_addrs'], $_REQUEST['cc_addrs_ids'], $_REQUEST['cc_addrs_names'], $_REQUEST['cc_addrs_emails']);
$focus->bcc_addrs_arr = $focus->parse_addrs($_REQUEST['bcc_addrs'], $_REQUEST['bcc_addrs_ids'], $_REQUEST['to_addrs_names'], $_REQUEST['bcc_addrs_emails']);
if(!empty($_REQUEST['type'])) {
$focus->type = $_REQUEST['type'];
} elseif(empty($focus->type)) { // cn: from drafts/quotes
$focus->type = 'archived';
}
///////////////////////////////////////////////////////////////////////////////
//// TEMPLATE PARSING
// cn: bug 7244 - need to pass an empty bean to parse email templates
$object_arr = array();
if(!empty($focus->parent_id)) {
$object_arr[$focus->parent_type] = $focus->parent_id;
}
if(isset($focus->to_addrs_arr[0]['contact_id'])) {
$object_arr['Contacts'] = $focus->to_addrs_arr[0]['contact_id'];
}
if(empty($object_arr)) {
$object_arr = array('Contacts' => '123');
}
// do not parse email templates if the email is being saved as draft....
if($focus->type != 'draft' && count($object_arr) > 0) {
require_once($beanFiles['EmailTemplate']);
$focus->name = EmailTemplate::parse_template($focus->name, $object_arr);
$focus->description = EmailTemplate::parse_template($focus->description, $object_arr);
$focus->description_html = EmailTemplate::parse_template($focus->description_html, $object_arr);
}
//// END TEMPLATE PARSING
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// PREP FOR ATTACHMENTS
if(empty($focus->id)){
$focus->id = create_guid();
$focus->new_with_id = true;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// ATTACHMENT HANDLING
$focus->handleAttachments();
//// END ATTACHMENT HANDLING
///////////////////////////////////////////////////////////////////////////////
$focus->status = 'draft';
if($focus->type == 'archived' ) {
$focus->status= 'archived';
$focus->date_start = $_REQUEST['date_start'];
$focus->time_start = $_REQUEST['time_start'] . $_REQUEST['meridiem'];
} elseif(($focus->type == 'out' || $focus->type == 'forward') && isset($_REQUEST['send']) && $_REQUEST['send'] == '1') {
///////////////////////////////////////////////////////////////////////////
//// REPLY PROCESSING
$old = array('&lt;','&gt;');
$new = array('<','>');
if($_REQUEST['from_addr'] != $_REQUEST['from_addr_name'].' &lt;'.$_REQUEST['from_addr_email'].'&gt;') {
if(false === strpos($_REQUEST['from_addr'], '&lt;')) { // we have an email only?
$focus->from_addr = $_REQUEST['from_addr'];
$focus->from_name = '';
} else { // we have a compound string
$newFromAddr = str_replace($old, $new, $_REQUEST['from_addr']);
$focus->from_addr = substr($newFromAddr, (1 + strpos($newFromAddr, '<')), (strpos($newFromAddr, '>') - strpos($newFromAddr, '<')) -1 );
$focus->from_name = substr($newFromAddr, 0, (strpos($newFromAddr, '<') -1));
}
} elseif(!empty($_REQUEST['from_addr_email']) && isset($_REQUEST['from_addr_email'])) {
$focus->from_addr = $_REQUEST['from_addr_email'];
$focus->from_name = $_REQUEST['from_addr_name'];
} else {
$focus->from_addr = $focus->getSystemDefaultEmail();
}
//// REPLY PROCESSING
///////////////////////////////////////////////////////////////////////////
if($focus->send()) {
$focus->status = 'sent';
} else {
$focus->status = 'send_error';
}
}
$focus->to_addrs = $_REQUEST['to_addrs'];
$focus->cc_addrs = $_REQUEST['cc_addrs'];
$focus->bcc_addrs = $_REQUEST['bcc_addrs'];
$focus->from_addr = $_REQUEST['from_addr'];
// delete the existing relationship of all the email addresses with this email
$query = "update emails_email_addr_rel set deleted = 1 WHERE email_id = '{$focus->id}'";
$focus->db->query($query);
// delete al the relationship of this email with all the beans
//$query = "update emails_beans set deleted = 1, bean_id = '', bean_module = '' WHERE email_id = '{$focus->id}'";
//$focus->db->query($query);
if(isset($_REQUEST['object_type']) && !empty($_REQUEST['object_type']) && isset($_REQUEST['object_id']) && !empty($_REQUEST['object_id'])) {
//run linking code only if the object_id has not been linked as part of the contacts above and it is an OOB relationship
$GLOBALS['log']->debug("CESELY".$_REQUEST['object_type']);
if(!in_array($_REQUEST['object_id'],$exContactIds)){
$rel = strtolower($_REQUEST['object_type']);
if ($focus->load_relationship($rel)) {
$focus->$rel->add($_REQUEST['object_id']);
$GLOBALS['log']->debug("CESELY LOADED".$_REQUEST['object_type']);
}
}
}
//// handle legacy parent_id/parent_type relationship calls
elseif(isset($_REQUEST['parent_type']) && !empty($_REQUEST['parent_type'])
&& isset($_REQUEST['parent_id']) && !empty($_REQUEST['parent_id'])) {
//run linking code only if the object_id has not been linked as part of the contacts above
if(!isset($exContactIds) || !in_array($_REQUEST['parent_id'],$exContactIds)){
$rel = strtolower($_REQUEST['parent_type']);
if ($focus->load_relationship($rel)) {
$focus->$rel->add($_REQUEST['parent_id']);
}
}
}
//// END RELATIONSHIP LINKING
///////////////////////////////////////////////////////////////////////////////
// If came from email archiving edit view, this would have been set from form input.
if (!isset($focus->date_start))
{
$today = gmdate($GLOBALS['timedate']->get_db_date_time_format());
$focus->date_start = $timedate->to_display_date($today);
$focus->time_start = $timedate->to_display_time($today, true);
}
$focus->date_sent = "";
require_once('include/formbase.php');
$focus = populateFromPost('', $focus);
$focus->save(false);
//// END EMAIL SAVE/SEND SETUP
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// RELATIONSHIP LINKING
$focus->load_relationship('users');
$focus->users->add($current_user->id);
if(!empty($_REQUEST['to_addrs_ids'])) {
$focus->load_relationship('contacts');
$exContactIds = explode(';', $_REQUEST['to_addrs_ids']);
foreach($exContactIds as $contactId) {
$contactId = trim($contactId);
$focus->contacts->add($contactId);
}
}
///////////////////////////////////////////////////////////////////////////////
//// PAGE REDIRECTION
///////////////////////////////////////////////////////////////////////////////
$return_id = $focus->id;
if(empty($_POST['return_module'])) {
$return_module = "Emails";
} else {
$return_module = $_POST['return_module'];
}
if(empty($_POST['return_action'])) {
$return_action = "DetailView";
} else {
$return_action = $_POST['return_action'];
}
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
if($focus->type == 'draft') {
if($return_module == 'Emails') {
header("Location: index.php?module=$return_module&action=ListViewDrafts");
} else {
handleRedirect($return_id, 'Emails');
}
} elseif($focus->type == 'out') {
if($return_module == 'Home') {
header('Location: index.php?module='.$return_module.'&action=index');
}
if(!empty($_REQUEST['return_id'])) {
$return_id = $_REQUEST['return_id'];
}
header('Location: index.php?action='.$return_action.'&module='.$return_module.'&record='.$return_id.'&assigned_user_id='.$current_user->id.'&type=inbound');
} elseif(isset($_POST['return_id']) && $_POST['return_id'] != "") {
$return_id = $_POST['return_id'];
}
header("Location: index.php?action=$return_action&module=$return_module&record=$return_id");
?>

116
modules/Emails/SearchForm.html Executable file
View File

@@ -0,0 +1,116 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Emails/SearchForm.html,v 1.3 2004/07/09 08:12:02 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: main -->
<form name="search" id="search">
<input type="hidden" name="action" value="{SEARCH_ACTION}">
<input type="hidden" name="query" value="true"/>
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="type" value="{TYPE}">
<input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}">
<input type="hidden" name="group" value="{GROUP}">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_TYPE}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select {TYPE_DISABLED} name="email_type">{TYPE_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_ASSIGNED_TO}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select {ASSIGN_TO_DISABLED} name="assigned_to">{ASSIGNED_TO_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_STATUS}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="status">{STATUS_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap align="right">
<a href="{ADV_URL}&search=advanced" class="tabFormAdvLink">{ADVANCED_SEARCH_PNG}&nbsp;{APP.LNK_ADVANCED_SEARCH}</a>
<input type="submit" name="button" class="button" value="{APP.LBL_SEARCH_BUTTON_LABEL}"/>
<input title="{APP.LBL_CLEAR_BUTTON_TITLE}" accessKey="{APP.LBL_CLEAR_BUTTON_KEY}" onclick="clear_form(this.form);" class="button" type="button" name="clear" value=" {APP.LBL_CLEAR_BUTTON_LABEL} "/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{JAVASCRIPT}
<!-- END: main -->
<!-- BEGIN: adv -->
<form name="search" id="search">
<input type="hidden" name="action" value="{SEARCH_ACTION}">
<input type="hidden" name="query" value="true">
<input type="hidden" name="module" value="Emails">
<input type="hidden" name="type" value="{TYPE}">
<input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}">
<input type="hidden" name="group" value="{GROUP}">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_TYPE}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="email_type">{TYPE_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_ASSIGNED_TO}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="assigned_to">{ASSIGNED_TO_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_STATUS}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="status">{STATUS_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap align="right">
<a href="{ADV_URL}&search=basic" class="tabFormAdvLink">{BASIC_SEARCH_PNG}&nbsp;{APP.LNK_BASIC_SEARCH}</a>
<input type="submit" name="button" class="button" value="{APP.LBL_SEARCH_BUTTON_LABEL}"/>
<input title="{APP.LBL_CLEAR_BUTTON_TITLE}" accessKey="{APP.LBL_CLEAR_BUTTON_KEY}" onclick="clear_form(this.form);" class="button" type="button" name="clear" value=" {APP.LBL_CLEAR_BUTTON_LABEL} "/>
</td>
</tr>
<tr>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_SUBJECT}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="name" class=dataField value="{NAME}" /></slot></td>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_CONTACT_NAME}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="contact_name" class=dataField value='{CONTACT_NAME}' /></slot></td>
<td></td>
<td></td>
<td scope="row" valign="middle" nowrap align="right"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{JAVASCRIPT}
<!-- END: adv -->

View File

@@ -0,0 +1,72 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Emails/SearchForm.html,v 1.3 2004/07/09 08:12:02 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<form name="search">
<input type="hidden" name="action" value="{SEARCH_ACTION}">
<input type="hidden" name="query" value="true"/>
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="type" value="{TYPE}">
<input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}">
<input type="hidden" name="group" value="{GROUP}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_STATUS}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="status">{STATUS_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_SUBJECT}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="name" class=dataField value="{NAME}" /></slot></td>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_CONTACT_NAME}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="contact_name" class=dataField value='{CONTACT_NAME}' /></slot></td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_ASSIGNED_TO}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="assigned_to">{ASSIGNED_TO_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap align="right">
<input type="submit" name="button" class="button" value="{APP.LBL_SEARCH_BUTTON_LABEL}"/>
<input title="{APP.LBL_CLEAR_BUTTON_TITLE}" accessKey="{APP.LBL_CLEAR_BUTTON_KEY}" onclick="clear_form(this.form);" class="button" type="button" name="clear" value=" {APP.LBL_CLEAR_BUTTON_LABEL} "/>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
{JAVASCRIPT}
<!-- END: main -->

View File

@@ -0,0 +1,81 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Emails/SearchForm.html,v 1.3 2004/07/09 08:12:02 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<form name="SearchFormListNewSales">
<input type="hidden" name="action" value="{SEARCH_ACTION}">
<input type="hidden" name="query" value="true"/>
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="type" value="{TYPE}">
<input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}">
<input type="hidden" name="group" value="{GROUP}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_STATUS}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="status">{STATUS_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_SUBJECT}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="name" class=dataField value="{NAME}" /></slot></td>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_CONTACT_NAME}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot>
<td valign="top" class="tabEditViewDF" nowrap="">
<input type="text" title="" value="" size="" id="contact_name" tabindex="" name="contact_name">
<input type="hidden" value="" id="contact_id" name="contact_id">
<button type="button" onclick="open_popup(&quot;Contacts&quot;, 600, 400, &quot;&quot;, true, false, {&quot;call_back_function&quot;:&quot;set_return&quot;,&quot;form_name&quot;:&quot;SearchFormListNewSales&quot;,&quot;field_to_name_array&quot;:{&quot;id&quot;:&quot;contact_id&quot;,&quot;name&quot;:&quot;contact_name&quot;}}, &quot;single&quot;, true);"
value="Wybierz" class="button" accesskey="T" title="Wybierz [Alt+T]" tabindex="" name="btn_contact_name"><img src="themes/default/images/id-ff-select.png?s=bed8cd35065048ceebdc639ebe305e2c&amp;c=1"></button>
<button value="Wyczyść" onclick="this.form.contact_name.value = ''; this.form.contact_id.value = '';" class="button lastChild" accesskey="C" title="Wyczyść[Alt+C]" tabindex="" name="btn_clr_parent_name_basic" type="button"><img src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&amp;c=1"></button>
</td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_ASSIGNED_TO}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="assigned_to">{ASSIGNED_TO_OPTIONS}</select></slot></td>
<td scope="row" valign="middle" nowrap><slot>{MOD.LBL_TYPE}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><select name="type">{TYPE_OPTIONS}</select></slot></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="submit" name="button" class="button" value="{APP.LBL_SEARCH_BUTTON_LABEL}"/>
<input title="{APP.LBL_CLEAR_BUTTON_TITLE}" accessKey="{APP.LBL_CLEAR_BUTTON_KEY}" onclick="clear_form(this.form);" class="button" type="button" name="clear" value=" {APP.LBL_CLEAR_BUTTON_LABEL} "/>
</form>
{JAVASCRIPT}
<!-- END: main -->

View File

@@ -0,0 +1,69 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Emails/SearchForm.html,v 1.3 2004/07/09 08:12:02 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<form name="search">
<input type="hidden" name="action" value="{SEARCH_ACTION}">
<input type="hidden" name="query" value="true"/>
<input type="hidden" name="module" value="Emails" />
<input type="hidden" name="type" value="{TYPE}">
<input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}">
<input type="hidden" name="group" value="{GROUP}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_SUBJECT}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="name" class=dataField value="{NAME}" /></slot></td>
<td scope="row" valign="middle" noWrap><slot>{MOD.LBL_CONTACT_NAME}</slot>&nbsp;&nbsp;</td>
<td scope="row" valign="middle"><slot><input type=text size="20" name="contact_name" class=dataField value='{CONTACT_NAME}' /></slot></td>
<td scope="row" valign="middle" nowrap align="right">
<input type="submit" name="button" class="button" value="{APP.LBL_SEARCH_BUTTON_LABEL}"/>
<input title="{APP.LBL_CLEAR_BUTTON_TITLE}" accessKey="{APP.LBL_CLEAR_BUTTON_KEY}" onclick="clear_form(this.form);" class="button" type="button" name="clear" value=" {APP.LBL_CLEAR_BUTTON_LABEL} "/>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
{JAVASCRIPT}
<!-- END: main -->

42
modules/Emails/Status.html Executable file
View File

@@ -0,0 +1,42 @@
<!--
/*********************************************************************************
* 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 -->
{STATUS}
<!-- END: main -->

111
modules/Emails/Status.php Executable file
View File

@@ -0,0 +1,111 @@
<?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;
global $app_strings;
$focus = new Email();
if(!empty($_REQUEST['record'])) {
$result = $focus->retrieve($_REQUEST['record']);
if($result == null)
{
sugar_die($app_strings['ERROR_NO_RECORD']);
}
}
else {
header("Location: index.php?module=Emails&action=index");
}
//needed when creating a new email with default values passed in
if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
$focus->contact_name = $_REQUEST['contact_name'];
}
if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
$focus->contact_id = $_REQUEST['contact_id'];
}
echo get_module_title($mod_strings['LBL_SEND'], $mod_strings['LBL_SEND'], true);
$GLOBALS['log']->info("Email detail view");
$xtpl=new XTemplate ('modules/Emails/Status.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("GRIDLINE", $gridline);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("PARENT_NAME", $focus->parent_name);
if (isset($focus->parent_type))
{
$xtpl->assign("PARENT_MODULE", $focus->parent_type);
$xtpl->assign("PARENT_TYPE", $app_list_strings['record_type_display'][$focus->parent_type]);
}
$xtpl->assign("PARENT_ID", $focus->parent_id);
$xtpl->assign("NAME", $focus->name);
//$xtpl->assign("SENT_BY_USER_NAME", $focus->sent_by_user_name);
$xtpl->assign("DATE_SENT", $focus->date_start." ".$focus->time_start);
if ($focus->status == 'sent')
{
$xtpl->assign("STATUS", $mod_strings['LBL_MESSAGE_SENT']);
}
else
{
$xtpl->assign("STATUS", "<font color=red>".$mod_strings['LBL_ERROR_SENDING_EMAIL']."</font>");
}
global $current_user;
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
// adding custom fields:
require_once('modules/DynamicFields/templates/Files/DetailView.php');
$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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Emails/SubPanelViewRecipients.html,v 1.2 2004/06/29 07:22:26 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: users -->
<h3>{APP.LBL_USER_LIST}</h3>
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<tr height="20" >
<td scope="col" width="25%" ><slot>{APP.LBL_LIST_NAME}</slot></td>
<td scope="col" width="20%" ><slot>{APP.LBL_LIST_USER_NAME}</slot></td>
<td scope="col" width="30%" ><slot>{APP.LBL_LIST_EMAIL}</slot></td>
<td scope="col" width="15%" ><slot>{APP.LBL_LIST_PHONE}</slot></td>
<td scope="col" width="10%" ><slot><img src="include/images/blank.gif" widht="1" height="1" alt=""></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td scope='row' valign=TOP><slot><a href="{URL_PREFIX}index.php?action=DetailView&module=Users&record={USER.ID}">{USER.FIRST_NAME}&nbsp;{USER.LAST_NAME}</a></slot></td>
<td valign=TOP><slot>{USER.USER_NAME}</slot></td>
<td valign=TOP><slot><A HREF="mailto:{USER.EMAIL1}" >{USER.EMAIL1}</A></slot></td>
<td valign=TOP nowrap><slot>{USER.PHONE_WORK}</slot></td>
<td nowrap align="center" valign=TOP><slot><a class="listViewTdToolsS1" onclick="return confirm('{MOD.NTC_REMOVE_INVITEE}')" href="{URL_PREFIX}index.php?action=DeleteEmailUserRelationship&module=Emails&user_id={USER.ID}&email_id={RECORD_ID}{RETURN_URL}">{REMOVE_INLINE_PNG}</a>&nbsp;<a class="listViewTdToolsS1" onclick="return confirm('{MOD.NTC_REMOVE_INVITEE}')" href="{URL_PREFIX}index.php?action=DeleteEmailUserRelationship&module=Emails&user_id={USER.ID}&email_id={RECORD_ID}{RETURN_URL}">{APP.LNK_REMOVE}</a></slot></td>
</tr>
<!-- END: row -->
</table>
<!-- END: users -->
<!-- BEGIN: contacts -->
<h3>{APP.LBL_CONTACT_LIST}</h3>
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<tr height="20" >
<td width="25%" ><slot>{APP.LBL_LIST_CONTACT_NAME}</slot></td>
<td width="20%" ><slot>{APP.LBL_LIST_ACCOUNT_NAME}</slot></td>
<td width="30%" ><slot>{APP.LBL_LIST_EMAIL}</slot></td>
<td width="15%" ><slot>{APP.LBL_LIST_PHONE}</slot></td>
<td width="10%" ><slot>&nbsp;</slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign=TOP><slot><a href="{URL_PREFIX}index.php?action=DetailView&module=Contacts&record={CONTACT.ID}" >{CONTACT.FIRST_NAME}&nbsp;{CONTACT.LAST_NAME}</a></slot></td>
<td valign=TOP><slot>{CONTACT.ACCOUNT_NAME}</slot></td>
<td valign=TOP><slot><A HREF="mailto:{CONTACT.EMAIL1}" >{CONTACT.EMAIL1}</A></slot></td>
<td valign=TOP nowrap><slot>{CONTACT.PHONE_WORK}</slot></td>
<td nowrap align="center" valign=TOP><slot><a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=Contacts&record={CONTACT.ID}{RETURN_URL}">{EDIT_INLINE_PNG}</a>&nbsp;<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=Contacts&record={CONTACT.ID}{RETURN_URL}">{APP.LNK_EDIT}</a>&nbsp;&nbsp;<a class="listViewTdToolsS1" onclick="return confirm('{MOD.NTC_REMOVE_INVITEE}')" href="{URL_PREFIX}index.php?action=DeleteEmailContactRelationship&module=Emails&contact_id={CONTACT.ID}&email_id={RECORD_ID}{RETURN_URL}">{REMOVE_INLINE_PNG}</a>&nbsp;<a class="listViewTdToolsS1" onclick="return confirm('{MOD.NTC_REMOVE_INVITEE}')" href="{URL_PREFIX}index.php?action=DeleteEmailContactRelationship&module=Emails&contact_id={CONTACT.ID}&email_id={RECORD_ID}{RETURN_URL}">{APP.LNK_REMOVE}</a></slot></td>
</tr>
<!-- END: row -->
</table>
<!-- END: contacts -->

View File

@@ -0,0 +1,149 @@
<?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 $currentModule;
global $mod_strings;
global $app_strings;
global $theme;
global $focus;
global $action;
// focus_list is the means of passing data to a SubPanelView.
global $focus_list;
$button = "<table cellspacing='0' cellpadding='1' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module' value='Contacts'>\n";
if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n";
$button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
$button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
$button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
$button .= "<input type='hidden' name='action'>\n";
$button .= "<tr><td>&nbsp;</td>";
if ($focus->parent_type == "Accounts") $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
else $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
$button .= "<td><input title='".$app_strings['LBL_SELECT_USER_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_USER_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_SELECT_USER_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Users&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
$button .= "</tr></form></table>\n";
// Stick the form header out there.
echo get_form_header($mod_strings['LBL_INVITEE'], $button, false);
$xtpl=new XTemplate ('modules/Emails/SubPanelViewRecipients.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
$xtpl->assign("EMAIL_ID", $focus->id);
$xtpl->assign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" alt="'.$app_strings['LNK_REMOVE'].'" border="0"'));
$xtpl->assign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
$oddRow = true;
foreach($focus_users_list as $user)
{
$user_fields = array(
'USER_NAME' => $user->user_name,
'FULL_NAME' => $user->first_name." ".$user->last_name,
'ID' => $user->id,
'EMAIL' => $user->email1,
'PHONE_WORK' => $user->phone_work
);
$xtpl->assign("USER", $user_fields);
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
}
$oddRow = !$oddRow;
$xtpl->parse("users.row");
// Put the rows in.
}
$xtpl->parse("users");
$xtpl->out("users");
$oddRow = true;
print count($focus_contacts_list);
foreach($focus_contacts_list as $contact)
{
$contact_fields = array(
'FIRST_NAME' => $contact->first_name,
'LAST_NAME' => $contact->last_name,
'ACCOUNT_NAME' => $contact->account_name,
'ID' => $contact->id,
'EMAIL' => $contact->email1,
'PHONE_WORK' => $contact->phone_work
);
$xtpl->assign("CONTACT", $contact_fields);
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
}
$oddRow = !$oddRow;
$xtpl->parse("contacts.row");
// Put the rows in.
}
$xtpl->parse("contacts");
$xtpl->out("contacts");
?>

View File

@@ -0,0 +1,117 @@
<?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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/
require_once("include/SugarRouting/SugarRouting.php");
$ie = new InboundEmail();
$json = getJSONobj();
$rules = new SugarRouting($ie, $current_user);
switch($_REQUEST['routingAction']) {
case "setRuleStatus":
$rules->setRuleStatus($_REQUEST['rule_id'], $_REQUEST['status']);
break;
case "saveRule":
$rules->save($_REQUEST);
break;
case "deleteRule":
$rules->deleteRule($_REQUEST['rule_id']);
break;
/* returns metadata to construct actions */
case "getActions":
require_once("include/SugarDependentDropdown/SugarDependentDropdown.php");
$sdd = new SugarDependentDropdown();
$sdd->init("include/SugarDependentDropdown/metadata/dependentDropdown.php");
$out = $json->encode($sdd->metadata, true);
echo $out;
break;
/* returns metadata to construct a rule */
case "getRule":
$ret = '';
if(isset($_REQUEST['rule_id']) && !empty($_REQUEST['rule_id']) && isset($_REQUEST['bean']) && !empty($_REQUEST['bean'])) {
if(!isset($beanList))
include("include/modules.php");
$class = $beanList[$_REQUEST['bean']];
//$beanList['Groups'] = 'Group';
if(isset($beanList[$_REQUEST['bean']])) {
require_once("modules/{$_REQUEST['bean']}/{$class}.php");
$bean = new $class();
$rule = $rules->getRule($_REQUEST['rule_id'], $bean);
$ret = array(
'bean' => $_REQUEST['bean'],
'rule' => $rule
);
}
} else {
$bean = new SugarBean();
$rule = $rules->getRule('', $bean);
$ret = array(
'bean' => $_REQUEST['bean'],
'rule' => $rule
);
}
//_ppd($ret);
$out = $json->encode($ret, true);
echo $out;
break;
case "getStrings":
$ret = $rules->getStrings();
$out = $json->encode($ret, true);
echo $out;
break;
default:
echo "NOOP";
}

218
modules/Emails/allList.html Normal file
View File

@@ -0,0 +1,218 @@
<!-- BEGIN: main -->
<link href="modules/Emails/allListStyle.css" rel="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script href="jscalendar/calendar.js"></script>
<script type="text/javascript">
function showHeaders() {
var user_id = $("#user_list option:selected").val();
var date_from = $("#date_from").val();
var date_to = $("#date_to").val();
var answered = $("#answered option:selected").val();
var seen = $("#seen option:selected").val();
var deleted = $("#deleted option:selected").val();
var type = $("#type option:selected").val();
var loader = "<table><tr><td><img src=\"include/javascript/yui/build/assets/skins/sam/ajax-loader.gif\"/></td><td>Trwa ładowanie nagłówków</td></tr></table>";
var ioInput = document.getElementById("ioInput");
document.getElementById("header_list_div").innerHTML = loader;
var callback = {
success: function(o) {
document.getElementById("header_list_div").innerHTML = o.responseText;
}
}
if (type==0)
var connectionObject = YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=Emails&action=allList&to_pdf=1&request=showHeaders&user_id="+user_id+"&date_from="+date_from+"&date_to="+date_to+"&answered="+answered+"&seen="+seen+"&deleted="+deleted+"&io="+ioInput.value.trim(), callback);
if (type==1)
var connectionObject = YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=Emails&action=allList&to_pdf=1&request=showHeaders_outbox&user_id="+user_id+"&date_from="+date_from+"&date_to="+date_to+"&deleted="+deleted+"&io="+ioInput.value.trim(), callback);
}
function showMail(id) {
document.getElementById("mail").style.visibility = "visible";
var user_id = $("#user_list option:selected").val();
var loader = "<img src=\"include/javascript/yui/build/assets/skins/sam/ajax-loader.gif\"/>Trwa ładowanie treści";
document.getElementById("mail").innerHTML = loader;
var callback = {
success: function(o) {
document.getElementById("mail").innerHTML = o.responseText;
}
}
var connectionObject = YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=Emails&action=allList&to_pdf=1&request=showMail&mail_id="+id+"&user_id="+user_id, callback);
}
function showAttachments(id) {
var user_id = $("#user_list option:selected").val();
var callback = {
success: function(o) {
document.getElementById("attachments").innerHTML = o.responseText;
}
}
var connectionObject = YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=Emails&action=allList&to_pdf=1&request=showAttachments&mail_id="+id+"&user_id="+user_id, callback);
}
function changeType(select) {
var ioInputLabel = document.getElementById("ioInputLabel");
switch(parseInt(select.value))
{
default:
case 0:
ioInputLabel.innerHTML = "Nadawca:";
break;
case 1:
ioInputLabel.innerHTML = "Odbiorca:";
break;
}
}
</script>
<div id="allList">
<table>
<tr>
<td>&nbsp</td>
<td>
<table id="options_table">
<tr>
<td>
<table>
<tr>
<td>&nbsp</td>
<td>Format daty yyyy-mm-dd</td>
</tr>
<tr>
<td>Data od:</td>
<td>
<input type="text" id="date_from"/>&nbsp&nbsp<img src="themes/default/images/jscalendar.gif" id="calendar_open"/>
<script type="text/javascript">
Calendar.setup(
{
inputField : "date_from",
ifFormat : "%Y-%m-%d",
button : "calendar_open"
}
);
</script>
</td>
</tr>
<tr>
<td>Data do:</td>
<td>
<input type="text" id="date_to"/>&nbsp&nbsp<img src="themes/default/images/jscalendar.gif" id="calendar_open2"/>
<script type="text/javascript">
Calendar.setup(
{
inputField : "date_to",
ifFormat : "%Y-%m-%d",
button : "calendar_open2"
}
);
</script>
</td>
</tr>
</table>
<br/>
<br/>
</td>
<td>
</td>
<td>
<table>
<tr>
<td colspan="2">Atrybuty wiadomości</td>
</tr>
<tr>
<td><label for="ioInput" id="ioInputLabel">Nadawca:</label></td>
<td>
<input type="text" name="ioInput" id="ioInput"/>
</td>
</tr>
<!--
<tr>
<td>Usunięte:</td>
<td>
<select id="deleted">
<option value="2"></option>
<option value="1">Tak</option>
<option value="0">Nie</option>
</select>
</td>
</tr>
<tr>
<td>Odpowiedziane:</td>
<td>
<select id="answered">
<option value="2"></option>
<option value="1">Tak</option>
<option value="0">Nie</option>
</select>
</td>
</tr>
<tr>
<td>Przyczytane:</td>
<td>
<select id="seen">
<option value="2"></option>
<option value="1">Tak</option>
<option value="0">Nie</option>
</select>
</td>
</tr>
-->
</table>
<br/>
<br/>
</td>
<td width="100">
&nbsp
</td>
<td>
Wiadomości:
<select id="type" onChange="changeType(this);">
<option value="0">Odebrane</option>
<option value="1">Wysłane</option>
</select>
</td>
<td valign="bottom">
<button type="button" onClick="javascript:showHeaders();">Filtruj</button>
<br/>
<br/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="user_list_cell">
{USER_LIST}
</td>
<td>
<div id="header_list_div"></div>
</td>
</tr>
<tr>
<td id="attachments_cell">
<div id="attachments"></div>
</td>
<td>
<div id="mail"></div>
</td>
</tr>
</table>
</div>
<!-- END: main -->

353
modules/Emails/allList.php Normal file
View File

@@ -0,0 +1,353 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
//if (!is_admin($current_user)) die('Nie masz wystarczających uprawnień');
if (isset($_GET['request'])) {
if ($_GET['request'] == 'showHeaders')
echo loadHeaders($_GET['user_id'], $_GET['date_from'], $_GET['date_to'], $_GET['answered'], $_GET['seen'], $_GET['deleted'], $_GET['io'], 'in');
if ($_GET['request'] == 'showHeaders_outbox')
echo loadHeaders($_GET['user_id'], $_GET['date_from'], $_GET['date_to'], null , null , $_GET['deleted'], $_GET['io'], 'out');
if ($_GET['request'] == 'showMail')
echo loadMail($_GET['mail_id'], $_GET['user_id']);
if ($_GET['request'] == 'showAttachments')
echo loadAttachments($_GET['mail_id'], $_GET['user_id']);
} else
initSearch();
function initSearch() {
$xtpl = new XTemplate('modules/Emails/allList.html');
$db = $GLOBALS['db'];
//generate users list
//AND id!='9adce0e8-d0c2-dc41-83f8-4eb9333b6c77'
//list without user Marek Wiśniewski
$query = "
SELECT
id,
first_name,
last_name
FROM
users
WHERE
deleted = 0
AND
employee_status = 'Active'
AND
id != '9adce0e8-d0c2-dc41-83f8-4eb9333b6c77';
";
// print_r($query);
// exit;
$result = $db->query($query);
$user_list = '';
$user_list.='<select size="' . $result->num_rows . '" id="user_list" onClick="javascript:showHeaders()">';
while ($row = $db->fetchByAssoc($result)) {
$user_list.='<option value="' . $row['id'] . '">' . $row['first_name'] . ' ' . $row['last_name'] . '</option>';
}
$user_list.='</select>';
$xtpl->assign("USER_LIST", $user_list);
$xtpl->parse("main");
$xtpl->out("main");
}
function loadHeaders($user_id, $date_from, $date_to, $answered, $seen, $deleted, $io, $in_out) {
$db = $GLOBALS['db'];
$io = trim($io);
if ($in_out != 'in')
$in_out = 'out';
//var_dump($in_out);
$whereConditions = array();
if(strlen($io))
switch($in_out){
default:
case 'in':
array_push($whereConditions, 'ec.`fromaddr` LIKE \'%' . $io . '%\'');
break;
case 'out':
array_push($whereConditions, 'ec.`toaddr` LIKE \'%' . $io . '%\'');
break;
}
//echo '<pre>';
//var_dump($whereConditions);
//echo '</pre>';
$query = "
SELECT
ec.ie_id,
ec.subject,
ec.message_id,
ec.fromaddr,
ec.toaddr,
ec.senddate,
ec.alllist_text_id
FROM
email_cache AS ec
INNER JOIN
email_alllist_texts as et ON et.id=ec.alllist_text_id
WHERE
et.ie_id IN
(
SELECT id FROM inbound_email WHERE group_id='" . $user_id . "'
)
AND
et.in_out LIKE '" . $in_out . "'";
$query .= $whereConditions ? (' AND ' . implode(' AND ', $whereConditions)) : '';
//print_r($query);
//exit;
if (($date_from != '') && ($date_to != ''))
{
$query.=" AND senddate BETWEEN (SELECT DATE_FORMAT('" . $date_from . "', '%Y%m%d')) AND (SELECT DATE_FORMAT('" . $date_to . "', '%Y%m%d'))";
} else {
if ($date_from != '')
$query.=" AND senddate >= '" . $date_from . "'";
if ($date_to != '')
$query.=" AND senddate <= '" . $date_to . "'";
}
$query.=" AND alllist_text_id IS NOT NULL";
$query.=" ORDER BY senddate DESC";
$result = $db->query($query);
$header_list = '';
$header_list .= '<table id ="header_table" cellpadding="1px">';
$header_list .= '<tr id="header_table_head_row">';
$header_list .= '<td width=500><b>Temat</b></td>';
switch($in_out){
default:
case 'in':
$header_list .= '<td width=250><b>Nadawca</b></td>';
break;
case 'out':
$header_list .= '<td width=250><b>Odbiorca</b></td>';
break;
}
$header_list .= '<td width=150><b>Data otrzymania</b></td>';
$header_list .= '</tr>';
$s = 0;
$a = 0;
$d = 0;
while ($row = $db->fetchByAssoc($result)) {
if ($row['deleted'] == 1) {
$przekreP = '<s>';
$przekreK = '</s>';
} else {
$przekreP = '';
$przekreK = '';
}
if ($row['answered'] == 1) {
$podkreP = '<u>';
$podkreK = '</u>';
} else {
$podkreP = '';
$podkreK = '';
}
if ($row['seen'] == 0) {
$pogruP = '<b>';
$pogruK = '</b>';
} else {
$pogruP = '';
$pogruK = '';
}
$subject = charsetEncode($row['subject']);
$from = '';
switch($in_out){
default:
case 'in':
$from = charsetEncode($row['fromaddr']);
break;
case 'out':
$from = charsetEncode($row['toaddr']);
break;
}
$id = $row['alllist_text_id'];
$header_list .= '<tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'" onClick="this.className=\'selected\';javascript:showAttachments(\'' . $id . '\');javascript:showMail(\'' . $id . '\');">
<td width=500>' . $podkreP . $przekreP . $pogruP . $subject . $podkreK . $przekreK . $pogruK . '</td>
<td width=250>' . $podkreP . $przekreP . $pogruP . ($from) . $podkreK . $przekreK . $pogruK . '</td>
<td width=150>' . $podkreP . $przekreP . $pogruP . $row['senddate'] . $podkreK . $przekreK . $pogruK . '</td>
</tr>
';
if ($row['seen'] == 1)
$s++;
if ($row['answered'] == 1)
$a++;
if ($row['deleted'] == 1)
$d++;
}
$header_list.='</table>';
$header_list.='</select></td><td valign="top" style="padding-left: 10px;">';
return $header_list;
}
function loadHeaders_outbox($user_id, $date_from, $date_to, $deleted) {
$db = $GLOBALS['db'];
$query = "SELECT id, assigned_user_id, name, deleted, date_sent FROM emails WHERE assigned_user_id='" . $user_id . "' AND (status='sent' OR status='archived') AND (type='out' OR type='archived') AND mailbox_id IS NULL";
if (($date_from != '') && ($date_to != ''))
$query.=" AND date_sent BETWEEN (SELECT DATE_FORMAT('" . $date_from . "', '%Y%m%d')) AND (SELECT DATE_FORMAT('" . $date_to . "', '%Y%m%d'))";
else {
if ($date_from != '')
$query.=" AND date_sent >= '" . $date_from . "'";
if ($date_to != '')
$query.=" AND date_sent <= '" . $date_to . "'";
}
if ($deleted == 0)
$query.=" AND deleted=0";
if ($deleted == 1)
$query.=" AND deleted=1";
$query.=" ORDER BY date_sent DESC";
$result = $db->query($query);
$emails = array();
while ($row = $db->fetchByAssoc($result)) {
$res = $db->query("SELECT email_address FROM email_addresses AS ea INNER JOIN emails_email_addr_rel AS eear ON (eear.email_address_id=ea.id AND eear.address_type='FROM' AND email_id='" . $row['id'] . "') INNER JOIN inbound_email AS ie ON (ie.email_user!=ea.email_address AND ie.group_id='" . $user_id . "')");
if ($res->num_rows == 0)
$emails[] = $row;
}
//$header_list.='<select size="'.$result->num_rows.'" id="header_list" onClick="javascript:showMail()">';
$header_list = '<table id ="header_table" cellpadding="1px"><tr id="header_table_head_row">
<td width=650><b>Temat</b></td>
<td width=150><b>Data wysłania</b></td>
</tr>';
$s = 0;
$a = 0;
$d = 0;
//while ($row = $db->fetchByAssoc($result)) {
foreach ($emails as $row) {
if ($row['deleted'] == 1) {
$przekreP = '<s>';
$przekreK = '</s>';
} else {
$przekreP = '';
$przekreK = '';
}
$subject = charsetEncode($row['name']);
//$subject = charsetEncode($row['id']);
//$from = fix_text($row['fromaddr']);
$header_list.='<tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'">
<td width=500>
<a href="index.php?module=Emails&action=DetailView&record=' . $row['id'] . '" target="new">
' . $podkreP . $przekreP . $pogruP . $subject . $podkreK . $przekreK . $pogruK . '</a></td>
<td width=150>' . $podkreP . $przekreP . $pogruP . $row['date_sent'] . $podkreK . $przekreK . $pogruK . '</td>
</tr>';
if ($row['seen'] == 1)
$s++;
if ($row['answered'] == 1)
$a++;
if ($row['deleted'] == 1)
$d++;
}
$header_list.='</table>';
//$header_list.='</select></td><td valign="top" style="padding-left: 10px;">';
return $header_list;
}
function loadMail($id, $user_id) {
$db = $GLOBALS['db'];
$query = "SELECT description_html, attachments FROM email_alllist_texts WHERE id='" . $id . "';";
$result = $db->query($query);
$row = $db->fetchByAssoc($result);
$text = htmlspecialchars_decode($row['description_html']);
//return $query;
//to fix images
//
//$attachments = explode(";", $row['attachments']);
//$file_name = array();
//if (count($attachments)>1)
//foreach ($attachments as $file) {
//$parts = explode("/", $file);
// $ext = substr($parts[count($parts)-1],strlen($parts[count($parts)-1])-4, 4);
// if (($ext=='.jpg') || ($ext=='.png') || ($ext=='.gif'))
// array_push($file_name, $parts[count($parts)-1]);
// }
//
//$text = str_replace('http://192.168.0.4/crm/cache//images/','modules/Emails/alllist_upload/'.$id.'/"',$text);
//foreach ($file_name as $file)
//$text = str_replace($id.'/"', $id.'/'.$file.'"', $text, 1);
str_replace("\n", "<br>", $text);
return $text;
}
function loadAttachments($id, $user_id) {
$db = $GLOBALS['db'];
$query = "SELECT attachments FROM email_alllist_texts WHERE id='" . $id . "';";
$result = $db->query($query);
$row = $db->fetchByAssoc($result);
//$text = htmlspecialchars_decode($row['attachments']);
$text = $row['attachments'];
$attachments = explode(";", $row['attachments']);
$return = ' ';
if (count($attachments) == 1)
return 'Załączników: 0<br><br>';
else {
//$return = "Załączników: ".(count($attachments)-1).'<br><br>';
foreach ($attachments as $file) {
$parts = explode("/", $file);
$file_name = $parts[count($parts) - 1];
$return.='<a target="new" href="modules/Emails/alllist_upload/' . $file . '">' . $file_name . '</a><br>';
}
}
return $return;
}
//to fix headers charset
function charsetEncode($string) {
$a = imap_mime_header_decode($string);
$result = '';
foreach ($a as $v)
if ($v->charset != 'default')
$result.=iconv($v->charset, "UTF-8", $v->text) . ' ';
if ($result != '')
return $result;
else
return $string;
}

View File

@@ -0,0 +1,51 @@
<!-- BEGIN: main -->
<link href="modules/Emails/allListStyle.css" rel="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function showHeaders() {
var user_id = $("#user_list option:selected").val();
var date_from = $("#date_from").val();
var date_to = $("#date_to").val();
var answered = $("#answered option:selected").val();
var seen = $("#seen option:selected").val();
var deleted = $("#deleted option:selected").val();
var loader = "<table><tr><td><img src=\"include/javascript/yui/build/assets/skins/sam/ajax-loader.gif\"/></td><td>Trwa <20>adowanie nag<61><67>wk<77>w</td></tr></table>";
document.getElementById("header_list_div").innerHTML = loader;
document.getElementById("mail").innerHTML = "";
var callback = {
success: function(o) {
document.getElementById("header_list_div").innerHTML = o.responseText;
}
}
var connectionObject = YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=Emails&action=allList&to_pdf=1&request=showHeaders&user_id="+user_id+"&date_from="+date_from+"&date_to="+date_to+"&answered="+answered+"&seen="+seen+"&deleted="+deleted, callback);
}
function showMail() {
var id = $("#header_list option:selected").val();
var user_id = $("#user_list option:selected").val();
var loader = "<img src=\"include/javascript/yui/build/assets/skins/sam/ajax-loader.gif\"/>Trwa <20>adowanie tre<72>ci";
document.getElementById("mail").innerHTML = loader;
var callback = {
success: function(o) {
document.getElementById("mail").innerHTML = o.responseText;
}
}
var connectionObject = YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=Emails&action=allList&to_pdf=1&request=showMail&mail_id="+id+"&user_id="+user_id, callback);
}
</script>
<div id="allList">
<div id="user_list_div">
Users
</div>
<div id="main">
<div id="filters">
filtry
</div>
<div id="header_list_div">
Headers
</div>
<div id="mail_text">
Mail text
</div>
</div>
</div>
<!-- END: main -->

View File

@@ -0,0 +1,214 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
set_time_limit(9999999999);
$db = $GLOBALS['db'];
$eaddr = array();
$r=$db->query("SELECT id, email_user FROM inbound_email WHERE id NOT IN ('813761a2-8711-3b3c-7a95-4f0acecfd08b')");
while ($w = $db->fetchByAssoc($r)) {
$eaddr[$w['email_user']] = $w['id'];
}
$ie_id='ec629543-24b1-3326-7f01-5048c8813921';
$cache_query = "SELECT senddate, imap_uid, alllist_text_id FROM email_cache WHERE deleted='0' AND mbox='INBOX' AND ie_id ='".$ie_id."' AND (alllist_text_id IS NULL OR alllist_text_id='') AND datediff(senddate, now())>-7 ORDER BY senddate ASC;";
$result = $db->query($cache_query);
$messages = array();
while ($row = $db->fetchByAssoc($result)) {
$messages[$row['imap_uid']] = $row['senddate'];
}
if (count($messages)==0) continue; //don't connect with server
$ie = new InboundEmail();
$ie->retrieve($ie_id);
$ie->connectMailserver();
$connection = $ie->conn;
if (!isset($connection)) {print_r(imap_errors()); exit;}
//loop throught cache messages and save it if is unsaved
$add =0;
$i==0;
foreach ($messages as $k=>$v) {
$messageNo = $ie->getMsgNo($k);
if ($messageNo<1) {
//echo "Can't find message (date: $v)<br>";
continue;
} //message deleted from server
$add++;
$senddate = $v;
$attachments = array();
$structure = imap_fetchstructure($connection, $messageNo);
//if ($add == 5) return;
$flattenedParts = flattenParts($structure->parts);
//get fromadd & subject
$header = imap_header($connection, $messageNo);
//$fromaddr = $header->from[0]->mailbox.'@'.$header->from[0]->host;
$subject = $header->subject;
//echo 'Temat: '.$subjest.'<br>';
//continue;
//get from addresses
$from_addr=array();
foreach ($header->from as $v) {
$from_addr[] = $v->mailbox.'@'.$v->host;
}
//get to address
$to_addr = array();
foreach ($header->to as $v) {
$to_addr[] = $v->mailbox.'@'.$v->host;
}
foreach ($to_addr as $v)
if ($v!='')
if ($eaddr[$v]) save($connection, $messageNo, $flattenedParts, $eaddr[$v], 'in', $db, $k, $senddate);
foreach ($from_addr as $v)
if ($v!='')
if ($eaddr[$v]) save($connection, $messageNo, $flattenedParts, $eaddr[$v], 'out', $db, $k, $senddate);
//if ($add ==20) return;
//return;;
}
//echo 'Uploaded (user: '.$ie_id.'): '.$add.'<br>';
imap_close($connection);
echo 'Wiadomości odebrane zaktualizowane!';
return true;
function save($connection, $messageNo, $flattenedParts, $ie_id, $in_out, $db, $k, $senddate) {
foreach($flattenedParts as $partNumber => $part) {
switch($part->type) {
case 0:
$message = getPart($connection, $messageNo, $partNumber, $part->encoding);
$charset = $part->parameters[0]->value;
if (($charset!='') && ($charset!="UTF-8"));
$message=addslashes(htmlspecialchars(iconv($charset,"UTF-8",$message)));
break;
case 1:
break;
case 2:
break;
case 3: // application
case 4: // audio
case 5: // image
case 6: // video
case 7: // other
$filename = getFilenameFromPart($part);
if($filename) {
$attachment = getPart($connection, $messageNo, $partNumber, $part->encoding);
$a=array();
$a['filename'] = charsetEncode($filename);
$a['content'] = $attachment;
$attachments[] = $a;
}
break;
}
}
$id = create_guid();
//echo "Before save: $ie_id<br>";
if (count($attachments)!=0)
$path = saveAttachments($ie_id, $id, $attachments);
$db->query("INSERT INTO email_alllist_texts VALUES('".$id."','".$message."','".$path."','".$k."','".$senddate."','".$ie_id."','".date("Y-m-d H:i:s")."','".$in_out."')");
//add info to email_cache
$r = $db->query("UPDATE email_cache SET alllist_text_id='".$id."', alllist_ie_id='".$ie_id."' WHERE ie_id='ec629543-24b1-3326-7f01-5048c8813921' AND imap_uid='".$k."' AND senddate='".$senddate."'");
if (!isset($r)) echo 'error<br>';
//if ($i=50) break;
//$i++;
}
function charsetEncode($string) {
$a = imap_mime_header_decode($string);
$result='';
foreach ($a as $v)
if ($v->charset!='default')
$result.=iconv($v->charset,"UTF-8", $v->text).' ';
if ($result!='') return $result; else return $string;
}
function saveAttachments($ie_id, $id, $attachments) {
$path='';
if ((!$attachments) && (count($attachments)==0)) exit;
foreach ($attachments as $v) {
$file_name = $v['filename'];
$content = $v['content'];
mkdir('./modules/Emails/alllist_upload/'.$ie_id);
$dir = $ie_id.'/'.$id;
mkdir('./modules/Emails/alllist_upload/'.$dir);
$fp = fopen('modules/Emails/alllist_upload/'.$dir.'/'.$file_name, 'wb');
if (!fwrite($fp, $content)==0) {
$path.= $dir.'/'.$file_name.';';
fwrite($fp, $content);
fclose($fp);
}
}
return $path;
}
function getPart($connection, $messageNumber, $partNumber, $encoding) {
$data = imap_fetchbody($connection, $messageNumber, $partNumber);
switch($encoding) {
case 0: return $data; // 7BIT
case 1: return $data; // 8BIT
case 2: return $data; // BINARY
case 3: return base64_decode($data); // BASE64
case 4: return quoted_printable_decode($data); // QUOTED_PRINTABLE
case 5: return $data; // OTHER
}
}
function flattenParts($messageParts, $flattenedParts = array(), $prefix = '', $index = 1, $fullPrefix = true) {
foreach($messageParts as $part) {
$flattenedParts[$prefix.$index] = $part;
if(isset($part->parts)) {
if($part->type == 2) {
$flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix.$index.'.', 0, false);
}
elseif($fullPrefix) {
$flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix.$index.'.');
}
else {
$flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix);
}
unset($flattenedParts[$prefix.$index]->parts);
}
$index++;
}
return $flattenedParts;
}
function getFilenameFromPart($part) {
$filename = '';
if($part->ifdparameters) {
foreach($part->dparameters as $object) {
if(strtolower($object->attribute) == 'filename') {
$filename = $object->value;
}
}
}
if(!$filename && $part->ifparameters) {
foreach($part->parameters as $object) {
if(strtolower($object->attribute) == 'name') {
$filename = $object->value;
}
}
}
return $filename;
}
?>

View File

@@ -0,0 +1,131 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
//$server="{imap.gmail.com:993/ssl}INBOX";
//$login="mz@e5.pl";
//$password="3x4z8123";
//$connection = imap_open($server, $login, $password);
$ie_id = "5292ef35-2864-0002-b6b3-4f3e2bacf43a";
$ie = new InboundEmail();
$ie->retrieve($ie_id);
$ie->connectMailserver();
$connection = $ie->conn;
if (!$connection) {print_r(imap_errors()); exit;}
$messages = imap_search($connection, 'ALL');
$i=0;
foreach ($messages as $messageNo) {
$structure = imap_fetchstructure($connection, $messageNo);
$flattenedParts = flattenParts($structure->parts);
foreach($flattenedParts as $partNumber => $part) {
switch($part->type) {
case 0:
// the HTML or plain text part of the email
$message = getPart($connection, $messageNo, $partNumber, $part->encoding);
// now do something with the message, e.g. render it
break;
case 1:
// multi-part headers, can ignore
break;
case 2:
// attached message headers, can ignore
break;
case 3: // application
case 4: // audio
case 5: // image
case 6: // video
case 7: // other
$filename = getFilenameFromPart($part);
if($filename) {
// it's an attachment
$attachment = getPart($connection, $messageNo, $partNumber, $part->encoding);
// now do something with the attachment, e.g. save it somewhere
}
else {
// don't know what it is
}
break;
}
}
//get from addr
$header = imap_header($connection, $messageNo);
$fromaddr = $header->from[0]->mailbox.'@'.$header->from[0]->host;
$subject = $header->subject;
echo $fromaddr.' - '.$subject;
echo '<br><br>';
$i++;
if ($i==50) break;
}
function getPart($connection, $messageNumber, $partNumber, $encoding) {
$data = imap_fetchbody($connection, $messageNumber, $partNumber);
switch($encoding) {
case 0: return $data; // 7BIT
case 1: return $data; // 8BIT
case 2: return $data; // BINARY
case 3: return base64_decode($data); // BASE64
case 4: return quoted_printable_decode($data); // QUOTED_PRINTABLE
case 5: return $data; // OTHER
}
}
function flattenParts($messageParts, $flattenedParts = array(), $prefix = '', $index = 1, $fullPrefix = true) {
foreach($messageParts as $part) {
$flattenedParts[$prefix.$index] = $part;
if(isset($part->parts)) {
if($part->type == 2) {
$flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix.$index.'.', 0, false);
}
elseif($fullPrefix) {
$flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix.$index.'.');
}
else {
$flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix);
}
unset($flattenedParts[$prefix.$index]->parts);
}
$index++;
}
return $flattenedParts;
}
function getFilenameFromPart($part) {
$filename = '';
if($part->ifdparameters) {
foreach($part->dparameters as $object) {
if(strtolower($object->attribute) == 'filename') {
$filename = $object->value;
}
}
}
if(!$filename && $part->ifparameters) {
foreach($part->parameters as $object) {
if(strtolower($object->attribute) == 'name') {
$filename = $object->value;
}
}
}
return $filename;
}
?>

81
modules/Emails/field_arrays.php Executable file
View File

@@ -0,0 +1,81 @@
<?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: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['Email'] = array(
'column_fields' => array(
"id"
, "date_entered"
, "date_modified"
, "assigned_user_id"
, "modified_user_id"
, "created_by"
, "description"
, "description_html"
, "name"
, "date_start"
, "time_start"
, "parent_type"
, "parent_id"
, "from_addr"
, "from_name"
, "to_addrs"
, "cc_addrs"
, "bcc_addrs"
, "to_addrs_ids"
, "to_addrs_names"
, "to_addrs_emails"
, "cc_addrs_ids"
, "cc_addrs_names"
, "cc_addrs_emails"
, "bcc_addrs_ids"
, "bcc_addrs_names"
, "bcc_addrs_emails"
, "type"
, "status"
, "intent"
),
'list_fields' => array(
'id', 'name', 'parent_type', 'parent_name', 'parent_id', 'date_start', 'time_start', 'assigned_user_name', 'assigned_user_id', 'contact_name', 'contact_id', 'first_name','last_name','to_addrs','from_addr','date_sent','type_name','type','status','link_action','date_entered','attachment_image','intent','date_sent'
),
);
?>

53
modules/Emails/index.php Executable file
View File

@@ -0,0 +1,53 @@
<?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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/
$focus = new Email();
$focus->email2init();
$focus->et->preflightUser($current_user);
$out = $focus->et->displayEmailFrame();
echo $out;
echo "<script>var composePackage = null;</script>";
$skipFooters = true;

1000
modules/Emails/javascript/Email.js Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,89 @@
/*********************************************************************************
* 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.email2 = {
cache : new Object(),
o : null, // holder for reference to AjaxObject's return object (used in composeDraft())
reGUID : new RegExp(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/i),
templates : {},
tinyInstances : {
currentHtmleditor : ''
},
/**
* preserves hits from email server
*/
_setDetailCache : function(ret) {
if(ret.meta) {
var compKey = ret.meta.mbox + ret.meta.uid;
if(!SUGAR.email2.cache[compKey]) {
SUGAR.email2.cache[compKey] = ret;
}
}
},
autoSetLayout : function() {
var c = document.getElementById('container');
var tHeight = YAHOO.util.Dom.getViewportHeight() - YAHOO.util.Dom.getY(c) - 35;
//Ensure a minimum height.
tHeight = Math.max(tHeight, 550);
c.style.height = tHeight + "px";
SUGAR.email2.complexLayout.set('height', tHeight);
SUGAR.email2.complexLayout.set('width', YAHOO.util.Dom.getViewportWidth() - 40);
SUGAR.email2.complexLayout.render();
SUGAR.email2.listViewLayout.resizePreview();
}
};
/**
* Shows overlay progress message
*/
function overlayModal(title, body) {
overlay(title, body);
}
function overlay(reqtitle, body, type, additconfig) {
var config = { };
if (typeof(additconfig) == "object") {
var config = additconfig;
}
config.type = type;
config.title = reqtitle;
config.msg = body;
YAHOO.SUGAR.MessageBox.show(config);
};
function hideOverlay() {
YAHOO.SUGAR.MessageBox.hide();
};

1604
modules/Emails/javascript/ajax.js Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,272 @@
/*********************************************************************************
* 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".
********************************************************************************/
/**
Complex layout init
*/
function complexLayoutInit() {
var se = SUGAR.email2;
var Dom = YAHOO.util.Dom;
se.e2Layout = {
getInnerLayout : function(rows) {
se.listViewLayout = new YAHOO.widget.Layout('listViewDiv', {
parent: se.complexLayout,
border:true,
hideOnLayout: true,
height: 400,
units: [{
position: "center",
scroll:false, // grid should autoScroll itself
split:true,
body: "<div id='emailGrid'></div><div id='dt-pag-nav'></div> "
},{
position: "bottom",
scroll:true,
collapse: false,
resize: true,
useShim:true,
height:'250',
body: "<div id='listBottom' />"
},{
position: "right",
scroll:true,
collapse: false,
resize: true,
useShim:true,
width:'250',
body: "<div id='listRight' />",
titlebar: false //,header: "right"
}]
});
se.complexLayout.on("render", function(){
var height = SUGAR.email2.innerLayout.get("element").clientHeight - 30;
SUGAR.email2.innerLayout.get("activeTab").get("contentEl").parentNode.style.height = height + "px";
SUGAR.email2.listViewLayout.set("height", height);
SUGAR.email2.listViewLayout.render();
});
se.listViewLayout.render();
//CSS hack for now
se.listViewLayout.get("element").parentNode.parentNode.style.padding = "0px"
var rp = se.listViewLayout.resizePreview = function() {
var pre = Dom.get("displayEmailFramePreview");
if (pre) {
var parent = Dom.getAncestorByClassName(pre, "yui-layout-bd");
pre.style.height = (parent.clientHeight - pre.offsetTop) + "px";
}
};
se.listViewLayout.getUnitByPosition("bottom").on("heightChange", se.autoSetLayout);
se.listViewLayout.getUnitByPosition("right").on("endResize", se.autoSetLayout);
se.e2Layout.setPreviewPanel(rows);
se.previewLayout = se.listViewLayout;
return se.listViewLayout;
},
getInnerLayout2Rows : function() {
return this.getInnerLayout(true);
},
getInnerLayout2Columns : function() {
return this.getInnerLayout(false);
},
init : function(){
// initialize state manager, we will use cookies
// Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var viewHeight = document.documentElement ? document.documentElement.clientHeight : self.innerHeight;
se.complexLayout = new YAHOO.widget.Layout("container", {
border:true,
hideOnLayout: true,
height: Dom.getViewportHeight() - (document.getElementById('header').clientHeight ) - 65,
width: Dom.getViewportWidth() - 40,
units: [{
position: "center",
scroll:false,
body: "<div id='emailtabs'></div>"
},
{
position: "left",
scroll: true,
body: "<div id='lefttabs'></div>",
collapse: true,
width: 210,
minWidth: 100,
resize:true,
useShim:true,
titlebar: true,
header: "&nbsp;"
},
{
header: Dom.get('footerLinks').innerHTML,
position: 'bottom',
id: 'mbfooter',
height: 22,
border: false
}]
});
se.complexLayout.render();
var tp = se.innerLayout = new YAHOO.widget.TabView("emailtabs");
tp.addTab(new YAHOO.widget.Tab({
label: "Inbox",
scroll : true,
content : "<div id='listViewDiv'/>",
id : "center",
active : true
}));
var centerEl = se.complexLayout.getUnitByPosition('center').get('wrap');
tp.appendTo(centerEl);
//CSS hack for now
tp.get("element").style.borderRight = "1px solid #666"
var listV = this.getInnerLayout2Rows();
listV.set("height", tp.get("element").clientHeight - 25);
listV.render();
se.leftTabs = new YAHOO.widget.TabView("lefttabs");
var folderTab = new YAHOO.widget.Tab({
label: app_strings.LBL_EMAIL_FOLDERS_SHORT,
scroll : true,
content : "<div id='emailtree'/>",
id : "tree",
active : true
});
folderTab.on("activeChange", function(o){
if (o.newValue) {
se.complexLayout.getUnitByPosition("left").set("header", app_strings.LBL_EMAIL_FOLDERS);
}
});
se.leftTabs.addTab(folderTab);
var tabContent = SUGAR.util.getAndRemove("searchTab");
var searchTab = new YAHOO.widget.Tab({
label: app_strings.LBL_EMAIL_SEARCH_SHORT,
scroll : true,
content : tabContent.innerHTML,
id : tabContent.id
});
searchTab.on("activeChange", function(o){
if (o.newValue)
{
se.complexLayout.getUnitByPosition("left").set("header", app_strings.LBL_EMAIL_SEARCH);
//Setup the calendars if needed
Calendar.setup ({inputField : "searchDateFrom", ifFormat : calFormat, showsTime : false, button : "jscal_trigger_from", singleClick : true, step : 1, weekNumbers:false});
Calendar.setup ({inputField : "searchDateTo", ifFormat : calFormat, showsTime : false, button : "jscal_trigger_to", singleClick : true, step : 1, weekNumbers:false});
//Initalize sqs object for assigned user name
se.e2Layout.initSQSObject('advancedSearchForm','assigned_user_name');
//Attach event handler for when the relate module option is selected for the correct sqs object
var parentSearchArgs = {'formName':'advancedSearchForm','fieldName':'data_parent_name_search',
'moduleSelectField':'data_parent_type_search','fieldId':'data_parent_id_search'};
YAHOO.util.Event.addListener('data_parent_type_search', 'change',function(){
SUGAR.email2.composeLayout.enableQuickSearchRelate(null,parentSearchArgs) });
//If enter key is pressed, perform search
var addKeyPressFields = ['searchSubject','searchFrom','searchTo','data_parent_name_search','searchDateTo','searchDateFrom','attachmentsSearch','assigned_user_name'];
for(var i=0; i < addKeyPressFields.length;i++)
{
YAHOO.util.Event.addListener(window.document.forms['advancedSearchForm'].elements[addKeyPressFields[i]],"keydown", function(e){
if (e.keyCode == 13) {
YAHOO.util.Event.stopEvent(e);
SUGAR.email2.search.searchAdvanced();
}
});
}
//Initiate quick search for the search tab. Do this only when the tab is selected rather than onDomLoad for perf. gains.
enableQS(true);
//Clear parent values if selecting another parent type.
YAHOO.util.Event.addListener('data_parent_type_search','change',
function(){
document.getElementById('data_parent_id_search').value ='';
document.getElementById('data_parent_name_search').value ='';
});
}
});
se.leftTabs.addTab(searchTab);
var resizeTabBody = function() {
var height = SUGAR.email2.leftTabs.get("element").clientHeight - 30;
SUGAR.email2.leftTabs.get("activeTab").get("contentEl").parentNode.style.height = height + "px";
}
resizeTabBody();
se.complexLayout.on("render", resizeTabBody);
se.leftTabs.on("activeTabChange", resizeTabBody);
//hack to allow left pane scroll bar to fully show
var lefttabsDiv = document.getElementById('lefttabs');
var lefttabsDivParent = Dom.getAncestorBy(lefttabsDiv);
var lefttabsDivGParent = Dom.getAncestorBy(lefttabsDivParent);
lefttabsDivParent.style.width = lefttabsDivGParent.offsetWidth - 10 + "px";
},
initSQSObject: function(formName,fieldName)
{
var fullFieldName = formName + '_' + fieldName; //SQS Convention
var resultName = fullFieldName + '_' + 'results';
if (QSFieldsArray[fullFieldName] != null)
{
QSFieldsArray[fullFieldName].destroy();
delete QSFieldsArray[fullFieldName];
}
if (QSProcessedFieldsArray[fullFieldName])
QSProcessedFieldsArray[fullFieldName] = false;
if( Dom.get(resultName) )
{
var obj = document.getElementById(resultName);
obj.parentNode.removeChild(obj);
}
},
setPreviewPanel: function(rows) {
if (rows) {
SUGAR.email2.listViewLayout.getUnitByPosition("right").set("width", 0);
SUGAR.email2.listViewLayout.getUnitByPosition("bottom").set("height", 250);
Dom.get("listRight").innerHTML = "";
Dom.get("listBottom").innerHTML = "<div id='_blank' />";
} else {
SUGAR.email2.listViewLayout.getUnitByPosition("bottom").set("height", 0);
SUGAR.email2.listViewLayout.getUnitByPosition("right").set("width", 250);
Dom.get("listBottom").innerHTML = "";
Dom.get("listRight").innerHTML = "<div id='_blank' />";
}
}
};
se.e2Layout.init();
}
var myBufferedListenerObject = new Object();
myBufferedListenerObject.refit = function() {
if(SUGAR.email2.grid) {
SUGAR.email2.grid.autoSize();
}
}

View File

@@ -0,0 +1,245 @@
/*********************************************************************************
* 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.email2.templates['compose'] = '<div id="composeLayout{idx}" class="ylayout-inactive-content"></div>' +
'<div id="composeOverFrame{idx}" style="height:100%;width:100%">' +
' <form id="emailCompose{idx}" name="ComposeEditView{idx}" action="index.php" method="POST">' +
' <input type="hidden" id="email_id{idx}" name="email_id" value="">' +
' <input type="hidden" id="uid{idx}" name="uid" value="">' +
' <input type="hidden" id="ieId{idx}" name="ieId" value="">' +
' <input type="hidden" id="mbox{idx}" name="mbox" value="">' +
' <input type="hidden" id="type{idx}" name="type" value="">' +
' <input type="hidden" id="composeLayoutId" name="composeLayoutId" value="shouldNotSeeMe">' +
' <input type="hidden" id="composeType" name="composeType">' +
' <input type="hidden" id="fromAccount" name="fromAccount">' +
' <input type="hidden" id="sendSubject" name="sendSubject">' +
' <input type="hidden" id="sendDescription" name="sendDescription">' +
' <input type="hidden" id="sendTo" name="sendTo">' +
' <input type="hidden" id="sendBcc" name="sendBcc">' +
' <input type="hidden" id="sendCc" name="sendCc">' +
' <input type="hidden" id="setEditor" name="setEditor">' +
' <input type="hidden" id="saveToSugar" name="saveToSugar">' +
' <input type="hidden" id="parent_id" name="parent_id">' +
' <input type="hidden" id="parent_type" name="parent_type">' +
' <input type="hidden" id="attachments" name="attachments">' +
' <input type="hidden" id="documents" name="documents">' +
' <input type="hidden" id="outbound_email{idx}" name="outbound_email">' +
' <input type="hidden" id="templateAttachments" name="templateAttachments">' +
' <input type="hidden" id="templateAttachmentsRemove{idx}" name="templateAttachmentsRemove">' +
' <table id="composeHeaderTable{idx}" cellpadding="0" cellspacing="0" border="0" width="100%" class="list">' +
' <tr>' +
' <th><table cellpadding="0" cellspacing="0" border="0"><tbody><tr ><td style="padding: 0px !important;margin:0px; !important" >' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.sendEmail({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_send.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_SEND}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.saveDraft({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_save.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_SAVE_DRAFT}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showAttachmentPanel({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_attach.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_ATTACHMENT}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showOptionsPanel({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_options.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_OPTIONS}</button>' +
'</td><td style="padding: 0px !important;margin:0px; !important">&nbsp;&nbsp;{mod_strings.LBL_EMAIL_RELATE}:&nbsp;&nbsp;<select class="select" id="data_parent_type{idx}" onchange="document.getElementById(\'data_parent_name{idx}\').value=\'\';document.getElementById(\'data_parent_id{idx}\').value=\'\'; SUGAR.email2.composeLayout.enableQuickSearchRelate(\'{idx}\');" name="data_parent_type{idx}">{linkbeans_options}</select>' +
'&nbsp;</td><td style="padding: 0px !important;margin:0px; !important"><input id="data_parent_id{idx}" name="data_parent_id{idx}" type="hidden" value="">' +
'<input class="sqsEnabled" id="data_parent_name{idx}" name="data_parent_name{idx}" type="text" value="">&nbsp;<button type="button" class="button" onclick="SUGAR.email2.composeLayout.callopenpopupForEmail2({idx});"><img src="index.php?entryPoint=getImage&themeName=default&imageName=id-ff-select.png" align="absmiddle" border="0"></button>' +
' </td></tr></tbody></table></th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <div style="margin:5px;">' +
' <table cellpadding="4" cellspacing="0" border="0" width="100%">' +
' <tr>' +
' <td class="emailUILabel" NOWRAP >' +
' {app_strings.LBL_EMAIL_FROM}:' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div>' +
' &nbsp;&nbsp;<select style="width: 500px;" class="ac_input" id="addressFrom{idx}" name="addressFrom{idx}"></select>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td class="emailUILabel" NOWRAP>' +
' <button class="button" type="button" onclick="SUGAR.email2.addressBook.selectContactsDialogue(\'addressTO{idx}\')">' +
' {app_strings.LBL_EMAIL_TO}:' +
' </button>' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="addressTO{idx}" name="addressTO{idx}" onkeyup="SE.composeLayout.showAddressDetails(this);">' +
' <span class="rolloverEmail"> <a id="MoreaddressTO{idx}" href="#" style="display: none;">+<span id="DetailaddressTO{idx}">&nbsp;</span></a> </span>' +
' <div class="ac_container" id="addressToAC{idx}"></div>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr id="add_addr_options_tr{idx}">' +
' <td class="emailUILabel" NOWRAP>&nbsp;</td><td class="emailUIField" valign="top" NOWRAP>&nbsp;&nbsp;<span id="cc_span{idx}"><a href="#" onclick="SE.composeLayout.showHiddenAddress(\'cc\',\'{idx}\');">{mod_strings.LBL_ADD_CC}</a></span><span id="bcc_cc_sep{idx}">&nbsp;{mod_strings.LBL_ADD_CC_BCC_SEP}&nbsp;</span><span id="bcc_span{idx}"><a href="#" onclick="SE.composeLayout.showHiddenAddress(\'bcc\',\'{idx}\');">{mod_strings.LBL_ADD_BCC}</a></span></td>'+
' </tr>'+
' <tr class="yui-hidden" id="cc_tr{idx}">' +
' <td class="emailUILabel" NOWRAP>' +
' <button class="button" type="button" onclick="SUGAR.email2.addressBook.selectContactsDialogue(\'addressCC{idx}\')">' +
' {app_strings.LBL_EMAIL_CC}:' +
' </button>' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="addressCC{idx}" name="addressCC{idx}" onkeyup="SE.composeLayout.showAddressDetails(this);">' +
' <span class="rolloverEmail"> <a id="MoreaddressCC{idx}" href="#" style="display: none;">+<span id="DetailaddressCC{idx}">&nbsp;</span></a> </span>' +
' <div class="ac_container" id="addressCcAC{idx}"></div>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr class="yui-hidden" id="bcc_tr{idx}">' +
' <td class="emailUILabel" NOWRAP>' +
' <button class="button" type="button" onclick="SUGAR.email2.addressBook.selectContactsDialogue(\'addressBCC{idx}\')">' +
' {app_strings.LBL_EMAIL_BCC}:' +
' </button>' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="addressBCC{idx}" name="addressBCC{idx}" onkeyup="SE.composeLayout.showAddressDetails(this);">' +
' <span class="rolloverEmail"> <a id="MoreaddressBCC{idx}" href="#" style="display: none;">+<span id="DetailaddressBCC{idx}">&nbsp;</span></a> </span>' +
' <div class="ac_container" id="addressBccAC{idx}"></div>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td class="emailUILabel" NOWRAP width="1%">' +
' {app_strings.LBL_EMAIL_SUBJECT}:' +
' </td>' +
' <td class="emailUIField" NOWRAP width="99%">' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="emailSubject{idx}" name="subject{idx}" value="">' +
' </div>' +
' </td>' +
' </tr>' +
' </table>' +
' </div>' +
' </td>' +
' </tr>' +
' </table>' +
' <textarea id="htmleditor{idx}" name="htmleditor{idx}" style="width:100%; height: 100px;"></textarea>' +
' <div id="divAttachments{idx}" class="ylayout-inactive-content">' +
' <div style="padding:5px;">' +
' <table cellpadding="2" cellspacing="0" border="0">' +
' <tr>' +
' <th>' +
' <b>{app_strings.LBL_EMAIL_ATTACHMENTS}</b>' +
' <br />' +
' &nbsp;' +
' </th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <input type="button" name="add_file_button" onclick="SUGAR.email2.composeLayout.addFileField();" value="{mod_strings.LBL_ADD_FILE}" class="button" />' +
' <div id="addedFiles{idx}" name="addedFiles{idx}"></div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td>' +
' &nbsp;' +
' <br />' +
' &nbsp;' +
' </td>' +
' </tr>' +
' <tr>' +
' <th>' +
' <b>{app_strings.LBL_EMAIL_ATTACHMENTS2}</b>' +
' <br />' +
' &nbsp;' +
' </th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <input type="button" name="add_document_button" onclick="SUGAR.email2.composeLayout.addDocumentField({idx});" value="{mod_strings.LBL_ADD_DOCUMENT}" class="button" />' +
' <div id="addedDocuments{idx}"></div>' + //<input name="document{idx}0" id="document{idx}0" type="hidden" /><input name="documentId{idx}0" id="documentId{idx}0" type="hidden" /><input name="documentName{idx}0" id="documentName{idx}0" disabled size="30" type="text" /><input type="button" id="documentSelect{idx}0" onclick="SUGAR.email2.selectDocument({idx}0, this);" class="button" value="{app_strings.LBL_EMAIL_SELECT}" /><input type="button" id="documentRemove{idx}0" onclick="SUGAR.email2.deleteDocumentField({idx}0, this);" class="button" value="{app_strings.LBL_EMAIL_REMOVE}" /><br /></div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td>' +
' &nbsp;' +
' <br />' +
' &nbsp;' +
' </td>' +
' </tr>' +
' <tr>' +
' <th>' +
' <div id="templateAttachmentsTitle{idx}" style="display:none"><b>{app_strings.LBL_EMAIL_ATTACHMENTS3}</b></div>' +
' <br />' +
' &nbsp;' +
' </th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <div id="addedTemplateAttachments{idx}"></div>' +
' </td>' +
' </tr>' +
' </table>' +
' </div>' +
' </div>' +
' </form>' +
' <div id="divOptions{idx}" class="ylayout-inactive-content"' +
' <div style="padding:5px;">' +
' <form name="composeOptionsForm{idx}" id="composeOptionsForm{idx}">' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <b>{app_strings.LBL_EMAIL_TEMPLATES}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <select name="email_template{idx}" id="email_template{idx}" onchange="SUGAR.email2.composeLayout.applyEmailTemplate(\'{idx}\', this.options[this.selectedIndex].value);"></select>' +
' </td>' +
' </tr>' +
' </table>' +
' <br />' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <b>{app_strings.LBL_EMAIL_SIGNATURES}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <select name="signatures{idx}" id="signatures{idx}" onchange="SUGAR.email2.composeLayout.setSignature(\'{idx}\');"></select>' +
' </td>' +
' </tr>' +
' </table>' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <input type="checkbox" id="setEditor{idx}" name="setEditor{idx}" value="1" onclick="SUGAR.email2.composeLayout.renderTinyMCEToolBar(\'{idx}\', this.checked);"/>&nbsp;' +
' <b>{mod_strings.LBL_SEND_IN_PLAIN_TEXT}</b>' +
' </td>' +
' </tr>' +
' </table>' +
' </form>' +
' </div> ' +
' </div>' +
'</div>';

View File

@@ -0,0 +1,276 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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.email2.templates['compose'] = '<div id="composeLayout{idx}" class="ylayout-inactive-content"></div>' +
'<div id="composeOverFrame{idx}" style="height:100%;width:100%">' +
' <form id="emailCompose{idx}" name="ComposeEditView" action="index.php" method="POST">' +
' <input type="hidden" id="email_id{idx}" name="email_id" value="">' +
' <input type="hidden" id="type{idx}" name="type" value="">' +
' <input type="hidden" id="composeLayoutId" name="composeLayoutId" value="shouldNotSeeMe">' +
' <input type="hidden" id="composeType" name="composeType">' +
' <input type="hidden" id="fromAccount" name="fromAccount">' +
' <input type="hidden" id="sendSubject" name="sendSubject">' +
' <input type="hidden" id="sendDescription" name="sendDescription">' +
' <input type="hidden" id="sendTo" name="sendTo">' +
' <input type="hidden" id="sendBcc" name="sendBcc">' +
' <input type="hidden" id="sendCc" name="sendCc">' +
' <input type="hidden" id="setEditor" name="setEditor">' +
' <input type="hidden" id="sendCharset" name="sendCharset">' +
' <input type="hidden" id="saveToSugar" name="saveToSugar">' +
' <input type="hidden" id="parent_id" name="parent_id">' +
' <input type="hidden" id="parent_type" name="parent_type">' +
' <input type="hidden" id="attachments" name="attachments">' +
' <input type="hidden" id="documents" name="documents">' +
' <input type="hidden" id="outbound_email{idx}" name="outbound_email">' +
' <input type="hidden" id="templateAttachments" name="templateAttachments">' +
' <input type="hidden" id="templateAttachmentsRemove{idx}" name="templateAttachmentsRemove">' +
' <table id="composeHeaderTable{idx}" cellpadding="0" cellspacing="0" border="0" width="100%">' +
' <tr>' +
' <td class="listViewThS1" NOWRAP>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.sendEmail({idx}, false);"><img src="themes/default/images/icon_email_send.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_SEND}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.saveDraft({idx}, false);"><img src="themes/default/images/icon_email_save.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_SAVE_DRAFT}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showAttachmentPanel({idx}, false);"><img src="themes/default/images/icon_email_attach.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_ATTACHMENT}</button>' +
//' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showContactsPanel({idx}, false);"><img src="themes/default/images/icon_email_addressbook.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_ADDRESS_BOOK_TITLE}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showOptionsPanel({idx}, false);"><img src="themes/default/images/icon_email_options.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_OPTIONS}</button>' +
'&nbsp;&nbsp;{mod_strings.LBL_EMAIL_RELATE}:&nbsp;&nbsp;<select class="select" id="data_parent_type{idx}" onchange="document.getElementById(\'data_parent_name{idx}\').value=\'\';document.getElementById(\'data_parent_id{idx}\').value=\'\';checkParentType(document.getElementById(\'data_parent_type{idx}\').value, document.getElementById(\'change_parent\'));" name="data_parent_type{idx}">{linkbeans_options}</select>' +
'<input id="data_parent_id{idx}" name="data_parent_id{idx}" type="hidden" value="">' +
'&nbsp;&nbsp;<input class="sqsEnabled" id="data_parent_name{idx}" name="data_parent_name{idx}" type="text" value="">&nbsp;<input type="button" name="button" class="button" title="{mod_strings.LBL_EMAIL_SELECTOR}" value="{mod_strings.LBL_EMAIL_SELECTOR}" onclick="SUGAR.email2.composeLayout.callopenpopupForEmail2({idx});"/>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td>' +
' <div style="margin:5px;">' +
' <table cellpadding="4" cellspacing="0" border="0" width="100%">' +
' <tr>' +
' <td class="emailUILabel" NOWRAP >' +
' {app_strings.LBL_EMAIL_FROM}:' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div>' +
' &nbsp;&nbsp;<select class="ac_input" id="addressFrom{idx}" name="addressFrom{idx}"></select>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td class="emailUILabel" NOWRAP>' +
' <button class="button" type="button" onclick=\'open_popup_emails("Contacts",800,600,"&amp;tree=ProductsProd&div=contacts_div_to&pre=contacts_to",true,false,{"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"contact_id","name":"contact_name"}});\'>' +
' {app_strings.LBL_EMAIL_TO}:' +
' </button>' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div class="ac_autocomplete"><input type="hidden" value="{idx}" id="idx" />' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="500" id="addressTo{idx}" name="addressTo{idx}">' +
' <div class="ac_container" id="addressToAC{idx}"></div><input type="hidden" name="contacts_to_count" id="contacts_to_count" value="0" /><div style="margin-left: 10px;width: 510px;" id="contacts_to_div"></div>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td class="emailUILabel" NOWRAP>' +
' <button class="button" type="button" onclick=\'open_popup_emails("Contacts",800,600,"&amp;tree=ProductsProd&div=contacts_div_cc&pre=contacts_cc",true,false,{"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"contact_id","name":"contact_name"}});\'>' +
' {app_strings.LBL_EMAIL_CC}:' +
' </button>' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="2000" id="addressCC{idx}" name="addressCC{idx}">' +
' <div class="ac_container" id="addressCcAC{idx}"></div><input type="hidden" name="contacts_cc_count" id="contacts_cc_count" value="0" /><div style="margin-left: 10px;width: 510px;" id="contacts_cc_div"></div>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td class="emailUILabel" NOWRAP>' +
' <button class="button" type="button" onclick=\'open_popup_emails("Contacts",800,600,"&amp;tree=ProductsProd&div=contacts_div_bcc&pre=contacts_bcc",true,false,{"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"contact_id","name":"contact_name"}});\'>' +
' {app_strings.LBL_EMAIL_BCC}:' +
' </button>' +
' </td>' +
' <td class="emailUIField" NOWRAP>' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="2000" id="addressBCC{idx}" name="addressBCC{idx}">' +
' <div class="ac_container" id="addressBccAC{idx}"></div><input type="hidden" name="contacts_bcc_count" id="contacts_bcc_count" value="0" /><div style="margin-left: 10px;width: 510px;" id="contacts_bcc_div"></div>' +
' </div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td class="emailUILabel" NOWRAP width="1%">' +
' {app_strings.LBL_EMAIL_SUBJECT}:' +
' </td>' +
' <td class="emailUIField" NOWRAP width="99%">' +
' <div class="ac_autocomplete">' +
' &nbsp;&nbsp;<input class="ac_input" type="text" size="2000" id="emailSubject{idx}" name="subject{idx}" value="">' +
' </div>' +
' </td>' +
' </tr>' +
' </table>' +
' </div>' +
' </td>' +
' </tr>' +
' </table>' +
' <div id="htmleditor{idx}" name="htmleditor{idx}"></div>' +
' <div id="divAttachments{idx}" class="ylayout-inactive-content">' +
' <div style="padding:5px;">' +
' <table cellpadding="2" cellspacing="0" border="0">' +
' <tr>' +
' <th>' +
' <b>{app_strings.LBL_EMAIL_ATTACHMENTS}</b>' +
' <br />' +
' &nbsp;' +
' </th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <input type="button" name="add_file_button" onclick="SUGAR.email2.composeLayout.addFileField();" value="{mod_strings.LBL_ADD_FILE}" class="button" />' +
' <div id="addedFiles{idx}" name="addedFiles{idx}"></div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td>' +
' &nbsp;' +
' <br />' +
' &nbsp;' +
' </td>' +
' </tr>' +
' <tr>' +
' <th>' +
' <b>{app_strings.LBL_EMAIL_ATTACHMENTS2}</b>' +
' <br />' +
' &nbsp;' +
' </th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <input type="button" name="add_document_button" onclick="SUGAR.email2.composeLayout.addDocumentField({idx});" value="{mod_strings.LBL_ADD_DOCUMENT}" class="button" />' +
' <div id="addedDocuments{idx}"></div>' + //<input name="document{idx}0" id="document{idx}0" type="hidden" /><input name="documentId{idx}0" id="documentId{idx}0" type="hidden" /><input name="documentName{idx}0" id="documentName{idx}0" disabled size="30" type="text" /><input type="button" id="documentSelect{idx}0" onclick="SUGAR.email2.selectDocument({idx}0, this);" class="button" value="{app_strings.LBL_EMAIL_SELECT}" /><input type="button" id="documentRemove{idx}0" onclick="SUGAR.email2.deleteDocumentField({idx}0, this);" class="button" value="{app_strings.LBL_EMAIL_REMOVE}" /><br /></div>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td>' +
' &nbsp;' +
' <br />' +
' &nbsp;' +
' </td>' +
' </tr>' +
' <tr>' +
' <th>' +
' <div id="templateAttachmentsTitle{idx}" style="display:none"><b>{app_strings.LBL_EMAIL_ATTACHMENTS3}</b></div>' +
' <br />' +
' &nbsp;' +
' </th>' +
' </tr>' +
' <tr>' +
' <td>' +
' <div id="addedTemplateAttachments{idx}"></div>' +
' </td>' +
' </tr>' +
' </table>' +
' </div>' +
' </div>' +
' <div id="divOptions{idx}" class="ylayout-inactive-content"' +
' <div style="padding:5px;">' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <b>{app_strings.LBL_EMAIL_TEMPLATES}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <select name="email_template{idx}" id="email_template{idx}" onchange="SUGAR.email2.composeLayout.applyEmailTemplate(\'{idx}\', this.options[this.selectedIndex].value);"></select>' +
' </td>' +
' </tr>' +
' </table>' +
' <br />' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <b>{app_strings.LBL_EMAIL_SIGNATURES}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <select name="signatures{idx}" id="signatures{idx}" onchange="SUGAR.email2.composeLayout.setSignature(\'{idx}\');"></select>' +
' </td>' +
' </tr>' +
' </table>' +
' <br />' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <b>{app_strings.LBL_EMAIL_CHARSET}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <select name="charsetOptions{idx}" id="charsetOptions{idx}"></select>' +
' </td>' +
' </tr>' +
' </table>' +
' <br />' +
' <table border="0" width="100%">' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <b>{app_strings.LBL_EMAIL_COMMON}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <input type="checkbox" id="setEditor{idx}" name="setEditor{idx}" value="1" />&nbsp;' +
' <b>{app_strings.LBL_EMAIL_HTML_RTF}:</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP style="padding:2px;">' +
' <input class="checkbox" type="checkbox" id="saveOutbound{idx}" name="saveOutbound{idx}" value="1" />&nbsp;' +
' <b>{app_strings.LBL_EMAIL_SETTINGS_SAVE_OUTBOUND}:</b>' +
' </td>' +
' </tr>' +
' </table>' +
' </div>' +
' </div>' +
' </form>' +
'</div>';

View File

@@ -0,0 +1,88 @@
/*********************************************************************************
* 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.email2.templates['displayOneEmail'] =
'<div class="emailDetailTable" style="height:100%">' +
'<div id="viewMenuDiv{idx}"></div>' +
'<div width="100%" class="displayEmailValue">' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.c0_replyForwardEmail(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\', \'reply\');"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_reply.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_REPLY}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.c0_replyForwardEmail(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\', \'replyAll\');"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_replyall.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_REPLY_ALL}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.composeLayout.c0_replyForwardEmail(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\', \'forward\');"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_forward.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_FORWARD}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.detailView.emailDeleteSingle(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\');"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_delete.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_DELETE}</button>' +
' <button type="button" class="button" onclick="SUGAR.email2.detailView.viewPrintable(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\');"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=Print_Email.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_PRINT}</button>' +
' <button id="btnEmailView{idx}" type="button" class="button" onclick="SUGAR.email2.detailView.showViewMenu(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\');"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_view.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_VIEW} <img src="themes/default/images/more.gif" align="absmiddle" border="0"></button>' +
' <button id="archiveEmail{idx}" type="button" class="button" onclick="SUGAR.email2.detailView.importEmail(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\');"><img src="themes/default/images/icon_email_archive.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_IMPORT_EMAIL}</button>' +
' <button id="quickCreateSpan{meta.panelId}" type="button" class="button" onclick="SUGAR.email2.detailView.showQuickCreate(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\');"><img src="themes/default/images/icon_email_create.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_QUICK_CREATE} <img src="themes/default/images/more.gif" align="absmiddle" border="0"></button>' +
' <button type="button" id="showDeialViewForEmail{meta.panelId}" class="button" onclick="SUGAR.email2.contextMenus.showEmailDetailViewInPopup(\'{meta.ieId}\', \'{meta.uid}\', \'{meta.mbox}\');"><img src="themes/default/images/icon_email_relate.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_VIEW_RELATIONSHIPS}</button>' +
'</div>' +
' <table cellpadding="0" cellspacing="0" border="0" width="100%" >' +
' <tr>' +
' <td NOWRAP valign="top" width="1%" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_FROM}:' +
' </td>' +
' <td width="99%" class="displayEmailValue">' +
' {email.from_addr}' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP valign="top" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_SUBJECT}:' +
' </td>' +
' <td NOWRAP valign="top" class="displayEmailValue">' +
' <b>{email.name}</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP valign="top" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_DATE_SENT_BY_SENDER}:' +
' </td>' +
' <td class="displayEmailValue">' +
' {email.date_start} {email.time_start}' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP valign="top" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_TO}:' +
' </td>' +
' <td class="displayEmailValue">' +
' {email.toaddrs}' +
' </td>' +
' </tr>' +
' <tr>{meta.cc}</tr>' +
' <tr>{email.attachments}</tr>' +
' </table>' +
' <div id="displayEmailFrameDiv{idx}" name="displayEmailFrameDiv{idx}"><iframe id="displayEmailFrame{idx}" src="modules/Emails/templates/_blank.html" width="100%" height="100%" frameborder="0"></iframe></div>' +
//' {email.description}' +
'</div>'
;

View File

@@ -0,0 +1,153 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function send_back_selected(module, form, field, error_message, field_to_name_array)
{
// cn: bug 12274 - stripping false-positive security envelope
var temp_request_data = request_data;
if(temp_request_data.jsonObject) {
request_data = temp_request_data.jsonObject;
} else {
request_data = temp_request_data; // passed data that is NOT incorrectly encoded via JSON.encode();
}
// cn: end bug 12274 fix
var passthru_data = Object();
if(typeof(request_data.passthru_data) != 'undefined')
{
passthru_data = request_data.passthru_data;
}
var form_name = request_data.form_name;
var field_to_name_array = request_data.field_to_name_array;
var call_back_function = eval("window.opener." + request_data.call_back_function);
var array_contents = Array();
var j=0;
for (i = 0; i < form.elements.length; i++){
if(form.elements[i].name == field) {
if (form.elements[i].checked == true) {
++j;
var id = form.elements[i].value;
array_contents_row = Array();
for(var the_key in field_to_name_array)
{
if(the_key != 'toJSON')
{
var the_name = field_to_name_array[the_key];
var the_value = '';
if(/*module != '' && */id != '')
{
the_value = associated_javascript_data[id][the_key.toUpperCase()];
}
array_contents_row.push('"' + the_name + '":"' + the_value + '"');
}
}
eval("array_contents.push({" + array_contents_row.join(",") + "})");
}
}
}
var result_data = {"form_name":form_name,"name_to_value_array":array_contents};
if (array_contents.length ==0 ) {
window.alert(error_message);
return;
}
call_back_function(result_data);
var close_popup = window.opener.get_close_popup();
if(close_popup)
{
window.close();
}
}
function send_back(module, id)
{
var associated_row_data = associated_javascript_data[id];
// cn: bug 12274 - stripping false-positive security envelope
eval("var temp_request_data = " + window.document.forms['popup_query_form'].request_data.value);
if(temp_request_data.jsonObject) {
var request_data = temp_request_data.jsonObject;
} else {
var request_data = temp_request_data; // passed data that is NOT incorrectly encoded via JSON.encode();
}
// cn: end bug 12274 fix
var passthru_data = Object();
if(typeof(request_data.passthru_data) != 'undefined')
{
passthru_data = request_data.passthru_data;
}
var form_name = request_data.form_name;
var field_to_name_array = request_data.field_to_name_array;
var call_back_function = eval("window.opener." + request_data.call_back_function);
var array_contents = Array();
// constructs the array of values associated to the bean that the user clicked
for(var the_key in field_to_name_array)
{
if(the_key != 'toJSON')
{
var the_name = field_to_name_array[the_key];
var the_value = '';
if(module != '' && id != '')
{
the_value = associated_row_data[the_key.toUpperCase()];
}
array_contents.push('"' + the_name + '":"' + the_value + '"');
}
}
eval("var name_to_value_array = {'0' : {" + array_contents.join(",") + "}}");
var result_data = {"form_name":form_name,"name_to_value_array":name_to_value_array,"passthru_data":passthru_data};
var close_popup = window.opener.get_close_popup();
call_back_function(result_data);
if(close_popup)
{
window.close();
}
}

649
modules/Emails/javascript/grid.js Executable file
View File

@@ -0,0 +1,649 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function gridInit() {
if(SUGAR.email2.grid) {
SUGAR.email2.grid.destroy();
}
e2Grid = {
init : function() {
var Ck = YAHOO.util.Cookie;
var widths = [ 10, 10, 150, 250, 175, 125 ];
if (Ck.get("EmailGridWidths")) {
for (var i=0; i < widths.length; i++) {
widths[i] = Ck.getSub("EmailGridWidths", i+ "", Number);
}
} else {
for (var i=0; i < widths.length; i++) {
Ck.setSub("EmailGridWidths", i + "", widths[i], {expires: SUGAR.email2.nextYear});
}
}
// changes "F" to an icon
function flaggedIcon(cell, record, column, value) {
if(value != "") {
cell.innerHTML = "<span style='color: #f00; font-weight:bold;'>!</span>";
}
}
// changes "A" to replied icon
function repliedIcon(cell, record, column, value) {
if(value != "") {
cell.innerHTML = "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=export.gif' class='image' border='0' width='10' align='absmiddle'>";
}
}
function attachIcon(cell, record, column, value) {
if(value == "1") {
cell.innerHTML = "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=attachment.gif' class='image' border='0' width='10' align='absmiddle'>";
}
}
var colModel =
[
{
label: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=attachment.gif' class='image' border='0' width='10' align='absmiddle'>",
width: 10,
sortable: false,
fixed: true,
resizeable: true,
formatter: attachIcon,
key: 'hasAttach'
},
{
label: "<span style='color: #f00; font-weight:bold;'>!</span>",
width: widths[0],
sortable: true,
fixed: true,
resizeable: true,
formatter: flaggedIcon,
key: 'flagged'
},
{
label: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=export.gif' class='image' border='0' width='10' align='absmiddle'>",
width: widths[1],
sortable: true,
fixed: true,
resizeable: false,
formatter: repliedIcon,
key: 'status'
},
{
label: app_strings.LBL_EMAIL_FROM,
width: widths[2],
sortable: true,
resizeable: true,
key: 'from'
},
{
label: app_strings.LBL_EMAIL_SUBJECT,
width: widths[3],
sortable: true,
resizeable: true,
key: 'subject'
},
{
label: mod_strings.LBL_LIST_DATE,
width: widths[4],
sortable: true,
resizeable: true,
key: 'date'
},
{
label: app_strings.LBL_EMAIL_TO,
width: widths[5],
sortable: false,
resizeable: true,
key: 'to_addrs'
},
{
label: 'uid',
hidden: true,
key: 'uid'
},
{
label: 'mbox',
hidden: true,
key: 'mbox'
},
{
label: 'ieId',
hidden: true,
key: 'ieId'
},
{
label: 'site_url',
hidden: true,
key: 'site_url'
},
{ label: 'seen',
hidden: true,
key: 'seen'
},
{ label: 'type',
hidden: true,
key: 'type'
}
];
var dataModel = new YAHOO.util.DataSource(urlBase + "?", {
responseType: YAHOO.util.DataSource.TYPE_JSON,
responseSchema: {
resultsList: 'Email',
fields: ['flagged', 'status', 'from', 'subject', 'date','to_addrs', 'uid', 'mbox', 'ieId', 'site_url', 'seen', 'type', 'AssignedTo','hasAttach'],
metaFields: {total: 'TotalCount', unread:"UnreadCount", fromCache: "FromCache"}
}
});
var params = {
to_pdf : "true",
module : "Emails",
action : "EmailUIAjax",
emailUIAction : "getMessageList",
mbox : "INBOX",
ieId : "",
forceRefresh : "false"
};
if(lazyLoadFolder != null) {
params['mbox'] = lazyLoadFolder.folder;
params['ieId'] = lazyLoadFolder.ieId;
//Check if the folder is a Sugar Folder
var test = new String(lazyLoadFolder.folder);
if(test.match(/SUGAR\./)) {
params['emailUIAction'] = 'getMessageListSugarFolders';
params['mbox'] = test.substr(6);
}
}
//dataModel.initPaging(urlBase, SUGAR.email2.userPrefs.emailSettings.showNumInList);
// create the Grid
var grid = SUGAR.email2.grid = new YAHOO.SUGAR.SelectionGrid('emailGrid', colModel, dataModel, {
MSG_EMPTY: SUGAR.language.get("Emails", "LBL_EMPTY_FOLDER"),
dynamicData: true,
paginator: new YAHOO.widget.Paginator({
rowsPerPage:parseInt(SUGAR.email2.userPrefs.emailSettings.showNumInList),
containers : ["dt-pag-nav"],
template: "<div class='pagination'>{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}</div>",
firstPageLinkLabel: "<button class='button'><div class='paginator-start'/></button>",
previousPageLinkLabel: "<button class='button'><div class='paginator-previous'/></button>",
nextPageLinkLabel: "<button class='button'><div class='paginator-next'/></button>",
lastPageLinkLabel: "<button class='button'><div class='paginator-end'/></button>"
}),
initialRequest:SUGAR.util.paramsToUrl(params),
width: "800px",
height: "400px"
});
initRowDD();
//Override Paging request construction
grid.set("generateRequest", function(oState, oSelf) {
oState = oState || {pagination:null, sortedBy:null};
var sort = (oState.sortedBy) ? oState.sortedBy.key : oSelf.getColumnSet().keys[1].getKey();
var dir = (oState.sortedBy && oState.sortedBy.dir === YAHOO.widget.DataTable.CLASS_DESC) ? "desc" : "asc";
var startIndex = (oState.pagination) ? oState.pagination.recordOffset : 0;
var results = (oState.pagination) ? oState.pagination.rowsPerPage : null;
// Build the request
var ret =
SUGAR.util.paramsToUrl(oSelf.params) +
"&sort=" + sort +
"&dir=" + dir +
"&start=" + startIndex +
((results !== null) ? "&limit=" + results : "");
return ret;
});
grid.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
oPayload = oPayload || { };
oPayload.totalRecords = oResponse.meta.total;
oPayload.unreadRecords = oResponse.meta.unread;
var tabObject = SE.innerLayout.get("tabs")[0];
var mboxTitle = "";
if (this.params.mbox != null) {
mboxTitle = this.params.mbox;
}
var tabtext = mboxTitle + " (" + oResponse.meta.total + " " + app_strings.LBL_EMAIL_MESSAGES + " )";
tabObject.get("labelEl").firstChild.data = tabtext;
if (SE.tree) {
var node = SE.tree.getNodeByProperty('id', this.params.ieId) || SE.tree.getNodeByProperty('origText', this.params.mbox);
if (node) {
node.data.unseen = oResponse.meta.unread;
SE.accounts.renderTree();
}
}
return oPayload;
}
var resize = grid.resizeGrid = function () {
SUGAR.email2.grid.set("width", SUGAR.email2.grid.get("element").parentNode.clientWidth + "px");
SUGAR.email2.grid.set("height", (SUGAR.email2.grid.get("element").parentNode.clientHeight - 47) + "px");
}
grid.convertDDRows = function() {
var rowEl = this.getFirstTrEl();
while (rowEl != null) {
new this.DDRow(this, this.getRecord(rowEl), rowEl);
rowEl = this.getNextTrEl(rowEl);
}
}
grid.on("columnResizeEvent", function(o) {
//Find the index of the column
var colSet = SUGAR.email2.grid.getColumnSet().flat;
for (var i=0; i < colSet.length; i++) {
if (o.column == colSet[i]) {
//Store it in the cookie
Ck.setSub("EmailGridWidths", i + "", o.width, {expires: SUGAR.email2.nextYear});
}
}
//this.resizeGrid();
}, null, grid);
grid.on("postRenderEvent", function() {this.convertDDRows()}, null, grid);
grid.on("rowClickEvent", SUGAR.email2.listView.handleClick);
grid.on("rowDblclickEvent", SUGAR.email2.listView.getEmail);
grid.render();
SUGAR.email2.listViewLayout.on("render", resize);
resize();
//Setup the default load parameters
SUGAR.email2.grid.params = params;
grid.on('postRenderEvent', SUGAR.email2.listView.setEmailListStyles);
dataModel.subscribe("requestEvent", grid.disable, grid, true);
dataModel.subscribe("responseParseEvent", grid.undisable, grid, true);
}
};
e2Grid.init();
};
function initRowDD() {
var sg = SUGAR.email2.grid,
Dom = YAHOO.util.Dom;
sg.DDRow = function(oDataTable, oRecord, elTr) {
if(oDataTable && oRecord && elTr) {
this.ddtable = oDataTable;
this.table = oDataTable.getTableEl();
this.row = oRecord;
this.rowEl = elTr;
this.newIndex = null;
this.init(elTr);
this.initFrame(); // Needed for DDProxy
this.invalidHandleTypes = {};
}
};
YAHOO.extend(sg.DDRow, YAHOO.util.DDProxy, {
_resizeProxy: function() {
this.constructor.superclass._resizeProxy.apply(this, arguments);
var dragEl = this.getDragEl(),
el = this.getEl();
var xy = Dom.getXY(el);
Dom.setStyle(dragEl, 'height', this.rowEl.offsetHeight + "px");
Dom.setStyle(dragEl, 'width', (parseInt(Dom.getStyle(dragEl, 'width'),10) + 4) + 'px');
Dom.setXY(dragEl, [xy[0] - 100, xy[1] - 20] );
Dom.setStyle(dragEl, 'display', "");
},
startDrag: function(x, y) {
//Check if we should be dragging a set of rows rather than just the one.
var selectedRows = this.ddtable.getSelectedRows();
var iSelected = false;
for (var i in selectedRows) {
if (this.rowEl.id == selectedRows[i]) {
iSelected = true;
break
}
}
if (iSelected) {
this.rows = [];
for (var i in selectedRows) {
this.rows[i] = this.ddtable.getRecord(selectedRows[i]);
}
} else {
this.rows = [this.row];
this.ddtable.unselectAllRows();
this.ddtable.selectRow(this.row);
}
//Initialize the dragable proxy
var dragEl = this.getDragEl();
var clickEl = this.getEl();
Dom.setStyle(clickEl, "opacity", "0.25");
dragEl.innerHTML = "<table><tr>" + clickEl.innerHTML + "</tr></table>";
Dom.addClass(dragEl, "yui-dt-liner");
Dom.setStyle(dragEl, "opacity", "0.5");
Dom.setStyle(dragEl, "height", (clickEl.clientHeight - 2) + "px");
Dom.setStyle(dragEl, "backgroundColor", Dom.getStyle(clickEl, "backgroundColor"));
Dom.setStyle(dragEl, "border", "2px solid gray");
},
clickValidator: function(e) {
if (this.row.getData()[0] == " ")
return false;
var target = YAHOO.util.Event.getTarget(e);
return ( this.isValidHandleChild(target) &&
(this.id == this.handleElId || this.DDM.handleWasClicked(target, this.id)) );
},
/**
* This funciton checks that the target of the drag is a table row in this
* DDGroup and simply moves the sourceEL to that location as a preview.
*/
onDragOver: function(ev, id) {
var node = SUGAR.email2.tree.getNodeByElement(Dom.get(id));
if (node && node != this.targetNode) {
this.targetNode = node;
SUGAR.email2.folders.unhighliteAll();
node.highlight();
}
},
onDragOut: function(e, id) {
if (this.targetNode) {
SUGAR.email2.folders.unhighliteAll();
this.targetNode = false;
}
},
endDrag: function() {
Dom.setStyle(this.getEl(), "opacity", "");
Dom.setStyle(this.getDragEl(), "display", "none");
if (this.targetNode) {
SUGAR.email2.folders.handleDrop(this.rows, this.targetNode);
}
SUGAR.email2.folders.unhighliteAll();
this.rows = null;
}
});
}
function AddressSearchGridInit() {
function moduleIcon(elCell, oRecord, oColumn, oData) {
elCell.innerHTML = "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=" + oData + ".gif' class='image' border='0' width='16' align='absmiddle'>";
};
function selectionCheckBox(elCell, oRecord, oColumn, oData) {
elCell.innerHTML = '<input type="checkbox" onclick="SUGAR.email2.addressBook.grid.toggleSelectCheckbox(\'' + oRecord.getId() + '\', this.checked);">';
};
var checkHeader = '<input type="checkbox" ';
if (SUGAR.email2.util.isIe()) {
checkHeader += 'style="top:-5px" ';
}
checkHeader += 'onclick="SUGAR.email2.addressBook.grid.toggleSelectAll(this.checked);">';
var colModel =
[{
label: checkHeader,
width: 30,
formatter: selectionCheckBox,
key: 'bean_id'
},
{
label: mod_strings.LBL_LIST_TYPE,
width: 25,
formatter: moduleIcon,
key: 'bean_module'
},
{
label: app_strings.LBL_EMAIL_ADDRESS_BOOK_NAME,
width: 180,
sortable: true,
key: 'name'
},
{
label: app_strings.LBL_EMAIL_ADDRESS_BOOK_EMAIL_ADDR,
width: 300,
sortable: true,
key: 'email'
}];
var dataModel = new YAHOO.util.DataSource(urlBase + "?", {
responseType: YAHOO.util.XHRDataSource.TYPE_JSON,
responseSchema: {
resultsList: 'Person',
fields: ['name', 'email', 'bean_id', 'bean_module'],
metaFields: {total: 'TotalCount'}
},
//enable sorting on the server accross all data
remoteSort: true
});
dataModel.params = {
to_pdf : true,
module : "Emails",
action : "EmailUIAjax",
emailUIAction:"getAddressSearchResults"
}
var rb = document.getElementById('hasRelatedBean').checked;
if (rb) {
var idx = SUGAR.email2.composeLayout.currentInstanceId;
var relatedBeanId = document.getElementById('data_parent_id' + idx).value;
var relatedBeanType = document.getElementById('data_parent_type' + idx).value;
dataModel.params['related_bean_id'] = relatedBeanId;
dataModel.params['related_bean_type'] = relatedBeanType;
dataModel.params['person'] = document.getElementById('input_searchPerson').value;
}
SUGAR.email2.addressBook.addressBookDataModel = dataModel;
var grid = SUGAR.email2.addressBook.grid = new YAHOO.widget.ScrollingDataTable("addrSearchGrid", colModel, dataModel, {
MSG_EMPTY: "&nbsp;", //SUGAR.language.get("Emails", "LBL_EMPTY_FOLDER"),
dynamicData: true,
paginator: new YAHOO.widget.Paginator({
rowsPerPage: 25,
containers : ["dt-pag-nav-addressbook"],
template: "<div class='pagination'>{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}</div>",
firstPageLinkLabel: "<button class='button'><div class='paginator-start'/></button>",
previousPageLinkLabel: "<button class='button'><div class='paginator-previous'/></button>",
nextPageLinkLabel: "<button class='button'><div class='paginator-next'/></button>",
lastPageLinkLabel: "<button class='button'><div class='paginator-end'/></button>"
}),
initialRequest:SUGAR.util.paramsToUrl(dataModel.params),
width: "560px",
height: "250px"
});
//Override Paging request construction
grid.set("generateRequest", function(oState, oSelf) {
oState = oState || {pagination:null, sortedBy:null};
var sort = (oState.sortedBy) ? oState.sortedBy.key : oSelf.getColumnSet().keys[0].getKey();
var dir = (oState.sortedBy && oState.sortedBy.dir === YAHOO.widget.DataTable.CLASS_DESC) ? "desc" : "asc";
var startIndex = (oState.pagination) ? oState.pagination.recordOffset : 0;
var results = (oState.pagination) ? oState.pagination.rowsPerPage : null;
// Build the request
var ret =
SUGAR.util.paramsToUrl(oSelf.getDataSource().params) +
"&sort=" + sort + "&dir=" + dir + "&start=" + startIndex +
((results !== null) ? "&limit=" + results : "");
return ret;
});
grid.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
oPayload = oPayload || { };
oPayload.totalRecords = oResponse.meta.total;
return oPayload;
}
grid.clickToggleSelect= function(args) {
var isIE = (args.event.target == null);
var targetElement = isIE ? args.event.srcElement : args.event.target;
if(targetElement.type == null || targetElement.type != 'checkbox') {
SUGAR.email2.addressBook.grid.toggleSelect(args.target.id);
}
}
grid.reSelectRowsOnRender = function (){
var rows = SUGAR.email2.addressBook.grid.getRecordSet().getRecords();
for (var i = 0; i < rows.length; i++)
{
var emailAddress = rows[i].getData("email");
var alreadyAdded = SUGAR.email2.addressBook.doesEmailAdddressExistInResultTable(emailAddress);
if(alreadyAdded)
{
rows[i].setData("selected", true);
SUGAR.email2.addressBook.grid.selectRow(rows[i]);
}
else
{
rows[i].setData("selected", false);
SUGAR.email2.addressBook.grid.unselectRow(rows[i]);
}
}
}
grid.subscribe("rowMouseoverEvent", grid.onEventHighlightRow);
grid.subscribe("rowMouseoutEvent", grid.onEventUnhighlightRow);
grid.subscribe("rowClickEvent", grid.clickToggleSelect);
grid.subscribe("postRenderEvent", grid.reSelectRowsOnRender);
grid.render();
dataModel.subscribe("requestEvent", grid.disable, grid, true);
dataModel.subscribe("responseParseEvent", grid.undisable, grid, true);
grid.toggleSelectCheckbox = function(id,checked){
var row = SUGAR.email2.addressBook.grid.getRecord(id);
row.setData("checked",checked);
};
grid.toggleSelect = function(id, checked) {
var row = SUGAR.email2.addressBook.grid.getRecord(id);
checked = row.getData("selected");
if (!checked)
{
SUGAR.email2.addressBook.grid.selectRow(row);
SE.addressBook.insertContactRowToResultTable(id,null)
} else
{
SUGAR.email2.addressBook.grid.unselectRow(row);
SE.addressBook.removeRowFromGridResults(id,row.getData("email"));
}
row.setData("selected", !checked);
};
grid.toggleSelectAll = function(checked) {
rows = SUGAR.email2.addressBook.grid.getRecordSet().getRecords();
for (var i = 0; i < rows.length; i++) {
if (typeof(rows[i]) != "undefined")
rows[i].setData("checked", checked);
}
var checkBoxes = SUGAR.email2.addressBook.grid.get("element").getElementsByTagName('input');
for (var i = 0; i < checkBoxes.length; i++) {
checkBoxes[i].checked = checked;
}
};
//Initialize the grid result table.
AddressSearchResultsGridInit();
}
/**
* Initalize the results table for the address book selection.
*
*/
function AddressSearchResultsGridInit()
{
/* Full name sort funciton to compare by last name if available */
var fullNameSort = function(a, b, desc) {
// Deal with empty values
if(!YAHOO.lang.isValue(a))
return (!YAHOO.lang.isValue(b)) ? 0 : 1;
else if(!YAHOO.lang.isValue(b))
return -1;
var aNames = a.getData("name").split(' ');
var bNames = b.getData("name").split(' ');
var aSortField = (aNames.length == 2) ? aNames[1] : a.getData("name");
var bSortField = (bNames.length == 2) ? bNames[1] : b.getData("name");
return YAHOO.util.Sort.compare(aSortField,bSortField, desc);
};
var typeDdOptions = [app_strings.LBL_EMAIL_ADDRESS_BOOK_ADD_TO.replace(/:$/,'') ,
app_strings.LBL_EMAIL_ADDRESS_BOOK_ADD_CC.replace(/:$/,''),
app_strings.LBL_EMAIL_ADDRESS_BOOK_ADD_BCC.replace(/:$/,'')];
var ColumnDefs = [{key:'type',label:app_strings.LBL_EMAIL_ADDRESS_BOOK_ADRRESS_TYPE, width: 60, sortable: true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:typeDdOptions,disableBtns:true})},
{key:'name',label:app_strings.LBL_EMAIL_ACCOUNTS_NAME,width: 280,sortable: true, sortOptions:{sortFunction:fullNameSort}}];
var myDataSource = new YAHOO.util.DataSource([]);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
myDataSource.responseSchema = {
fields: ["name","type","email_address","display_email_address","bean_id","idx"]
};
var gridResults = SUGAR.email2.addressBook.gridResults = new YAHOO.widget.ScrollingDataTable("addrSearchResultGrid", ColumnDefs, myDataSource, {
width: "350px",height: "250px", MSG_EMPTY: "&nbsp;"});
var highlightEditableCell = function(oArgs) {
var elCell = oArgs.target;
if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
this.highlightCell(elCell);
}
};
gridResults.subscribe("cellMouseoverEvent", highlightEditableCell);
gridResults.subscribe("cellMouseoutEvent", gridResults.onEventUnhighlightCell);
gridResults.subscribe("cellClickEvent", gridResults.onEventShowCellEditor);
gridResults.subscribe("rowMouseoverEvent", gridResults.onEventHighlightRow);
gridResults.subscribe("rowMouseoutEvent", gridResults.onEventUnhighlightRow);
//Setup the context menus
var onContextMenuClick = function(p_sType, p_aArgs, p_myDataTable) {
var task = p_aArgs[1];
if(task)
{
var elRow = this.contextEventTarget;
elRow = p_myDataTable.getTrEl(elRow);
if(elRow)
{
switch(task.index)
{
case 0:
var oRecord = p_myDataTable.getRecord(elRow);
p_myDataTable.deleteRow(elRow);
SUGAR.email2.addressBook.grid.reSelectRowsOnRender();
}
}
}
};
var contextMenu = new YAHOO.widget.ContextMenu("contextmenu",
{trigger:gridResults.getTbodyEl()});
contextMenu.addItem(app_strings.LBL_EMAIL_DELETE);
contextMenu.render("addrSearchResultGrid");
contextMenu.clickEvent.subscribe(onContextMenuClick, gridResults);
}

460
modules/Emails/javascript/init.js Executable file
View File

@@ -0,0 +1,460 @@
/*********************************************************************************
* 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".
********************************************************************************/
/******************************************************************************
* Initialize Email 2.0 Application
*/
//Override Sugar Languge so quick creates work properly
function email2init() {
//Init Tiny MCE
// var tinyConfig = "code,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull," +
// "separator,bullist,numlist,outdent,indent,separator,forecolor,backcolor,fontselect,fontsizeselect";
if (!SUGAR.util.isTouchScreen()) {
tinyMCE.init({
convert_urls : false,
theme_advanced_toolbar_align : tinyConfig.theme_advanced_toolbar_align,
width: tinyConfig.width,
theme: tinyConfig.theme,
theme_advanced_toolbar_location : tinyConfig.theme_advanced_toolbar_location,
theme_advanced_buttons1 : tinyConfig.theme_advanced_buttons1,
theme_advanced_buttons2 : tinyConfig.theme_advanced_buttons2,
theme_advanced_buttons3 : tinyConfig.theme_advanced_buttons3,
plugins : tinyConfig.plugins,
elements : tinyConfig.elements,
language : tinyConfig.language,
extended_valid_elements : tinyConfig.extended_valid_elements,
mode: tinyConfig.mode,
strict_loading_mode : true,
force_br_newlines : true,
forced_root_block : ''
});
}
//alert('loadedTiny');
// initialze message overlay
SUGAR.email2.e2overlay = new YAHOO.widget.Dialog("SUGAR.email2.e2overlay", {
//iframe : true,
modal : false,
autoTabs : true,
width : 300,
height : 120,
shadow : true
}
);
// Hide Sugar menu
if (SUGAR.themes.tempHideLeftCol)
SUGAR.themes.tempHideLeftCol();
// add key listener for kb shortcust - disable backspace nav in mozilla/ie
// YAHOO.util.Event.addListener(window.document, 'keypress', SUGAR.email2.keys.overall);
// set defaults for YAHOO.util.DragDropManager
YAHOO.util.DDM.mode = 0; // point mode, default is point (0)
SUGAR.email2.nextYear = new Date();
SUGAR.email2.nextYear.setDate(SUGAR.email2.nextYear.getDate() + 360);
// initialize and display UI framework (complexLayout.js)
complexLayoutInit();
// initialize and display grid (grid.js)
gridInit();
// initialize treeview for folders
//onloadTreeinit();
SUGAR.email2.folders.rebuildFolders(true);
//Setup the Message Box overlay
/*Ext.MessageBox.maxWidth = 350;
Ext.MessageBox.minProgressWidth = 350;
///////////////////////////////////////////////////////////////////////////
//// CONTEXT MENUS
// detailView array
SUGAR.email2.contextMenus.detailViewContextMenus = new Object();
*/
var SEC = SUGAR.email2.contextMenus;
//Grid menu
var emailMenu = SEC.emailListContextMenu = new YAHOO.widget.ContextMenu("emailContextMenu", {
trigger: SUGAR.email2.grid.get("element"),
lazyload: true
});
emailMenu.subscribe("beforeShow", function() {
var oTarget = this.contextEventTarget;
if (typeof(oTarget) == "undefined")
return;
var grid = SUGAR.email2.grid;
var selectedRows = grid.getSelectedRows();
var multipleSelected = (selectedRows.length > 1) ? true: false;
if (!multipleSelected)
{
grid.unselectAllRows();
grid.selectRow(oTarget);
SUGAR.email2.contextMenus.showEmailsListMenu(grid, grid.getRecord(oTarget));
}
else if(multipleSelected)
{
SUGAR.email2.contextMenus.showEmailsListMenu(grid, grid.getRecord(oTarget));
}
});
//When we need to access menu items later we can only do so by indexes so we create a mapping to allow
//us to access individual elements easier by name rather than by index
emailMenu.itemsMapping = {'viewRelationships':0, 'openMultiple': 1, 'archive' : 2, 'reply' : 3,'replyAll' : 4,'forward' : 5,
'delete' : 6,'print' : 7,'mark' : 8,'assignTo' : 9, 'relateTo' : 10};
emailMenu.addItems([
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_relate.gif'/>" + app_strings.LBL_EMAIL_VIEW_RELATIONSHIPS,
id: 'showDetailView',
onclick: { fn: SEC.showDetailView }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=open_multiple.gif'/>" + app_strings.LBL_EMAIL_OPEN_ALL,
onclick: { fn: SEC.openMultiple }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_archive.gif'/>" + app_strings.LBL_EMAIL_ARCHIVE_TO_SUGAR,
onclick: { fn: SEC.archiveToSugar }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_reply.gif'/>"+ app_strings.LBL_EMAIL_REPLY,
id: 'reply',
onclick: { fn: SEC.replyForwardEmailContext }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_replyall.gif'/>" + app_strings.LBL_EMAIL_REPLY_ALL,
id: 'replyAll',
onclick: { fn: SEC.replyForwardEmailContext }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_forward.gif'/>" + app_strings.LBL_EMAIL_FORWARD,
id: 'forward',
onclick: { fn: SEC.replyForwardEmailContext }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_delete.gif'/>" + app_strings.LBL_EMAIL_DELETE,
id: 'delete',
onclick: { fn: SEC.markDeleted }
},
{
text: "<img src='themes/default/images/Print_Email.gif'/>" + app_strings.LBL_EMAIL_PRINT,
id: 'print',
onclick: { fn: SEC.viewPrintable }
},
// Mark... submenu
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_mark.gif'/>" + app_strings.LBL_EMAIL_MARK,
submenu: {
id: "markEmailMenu",
itemdata : [
{
text: app_strings.LBL_EMAIL_MARK + " " + app_strings.LBL_EMAIL_MARK_UNREAD,
onclick: { fn: SEC.markUnread }
},
{
text: app_strings.LBL_EMAIL_MARK + " " + app_strings.LBL_EMAIL_MARK_READ,
onclick: { fn: SEC.markRead }
},
{
text: app_strings.LBL_EMAIL_MARK + " " + app_strings.LBL_EMAIL_MARK_FLAGGED,
onclick: { fn: SEC.markFlagged }
},
{
text: app_strings.LBL_EMAIL_MARK + " " + app_strings.LBL_EMAIL_MARK_UNFLAGGED,
onclick: { fn: SEC.markUnflagged }
}
]
}
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_assign.gif'/>" + app_strings.LBL_EMAIL_ASSIGN_TO,
id: 'assignTo',
onclick: { fn: SEC.assignEmailsTo }
},
{
text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_relate.gif'/>" + app_strings.LBL_EMAIL_RELATE_TO,
id: 'relateTo',
onclick: { fn: SEC.relateTo }
}
]);
SEC.emailListContextMenu.render();
//Handle the Tree folder menu trigger ourselves
YAHOO.util.Event.addListener(YAHOO.util.Dom.get("emailtree"), "contextmenu", SUGAR.email2.folders.handleRightClick)
//Folder Menu
SEC.frameFoldersContextMenu = new YAHOO.widget.ContextMenu("folderContextMenu", {
trigger: "",
lazyload: true
});
SEC.frameFoldersContextMenu.addItems([
{ text: "<img src='index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=icon_email_check.gif'/>" + app_strings.LBL_EMAIL_CHECK,
//helptext: "<i>" + app_strings.LBL_EMAIL_MENU_HELP_ADD_FOLDER + "</i>",
onclick: { fn: function() {
var node = SUGAR.email2.clickedFolderNode;
if (node.data.ieId) {
SUGAR.email2.folders.startEmailCheckOneAccount(node.data.ieId, false)};
}}
},
{ text: app_strings.LBL_EMAIL_MENU_SYNCHRONIZE,
//helptext: "<i>" + app_strings.LBL_EMAIL_MENU_HELP_ADD_FOLDER + "</i>",
onclick: { fn: function() {
var node = SUGAR.email2.clickedFolderNode;
if (node.data.ieId) {
SUGAR.email2.folders.startEmailCheckOneAccount(node.data.ieId, true)};
}}
},
{
text: app_strings.LBL_EMAIL_MENU_ADD_FOLDER,
//helptext: "<i>" + app_strings.LBL_EMAIL_MENU_HELP_ADD_FOLDER + "</i>",
onclick: { fn: SUGAR.email2.folders.folderAdd }
},
{
text: app_strings.LBL_EMAIL_MENU_DELETE_FOLDER,
//helptext: "<i>" + app_strings.LBL_EMAIL_MENU_HELP_DELETE_FOLDER + "</i>",
onclick: { fn: SUGAR.email2.folders.folderDelete }
},
{
text: app_strings.LBL_EMAIL_MENU_RENAME_FOLDER,
//helptext: "<i>" + app_strings.LBL_EMAIL_MENU_HELP_RENAME_FOLDER + "</i>",
onclick: { fn: SUGAR.email2.folders.folderRename }
},
{
text: app_strings.LBL_EMAIL_MENU_EMPTY_TRASH,
//helptext: "<i>" + app_strings.LBL_EMAIL_MENU_HELP_EMPTY_TRASH + "</i>",
onclick: { fn: SUGAR.email2.folders.emptyTrash }
},
{
text: app_strings.LBL_EMAIL_MENU_CLEAR_CACHE,
onclick: { fn: function() {
var node = SUGAR.email2.clickedFolderNode;
if (node.data.ieId) {
SUGAR.email2.folders.clearCacheFiles(node.data.ieId)};
}}
}
]);
SEC.frameFoldersContextMenu.render();
SEC.initContactsMenu = function() {
// contacts
SEC.contactsContextMenu = new YAHOO.widget.ContextMenu("contactsMenu", {
trigger: "contacts",
lazyload: true
});
SEC.contactsContextMenu.addItems([
{
text: app_strings.LBL_EMAIL_MENU_REMOVE,
onclick:{ fn: SUGAR.email2.addressBook.removeContact }
},
{
text: app_strings.LBL_EMAIL_MENU_COMPOSE,
onclick:{ fn: function() {SUGAR.email2.addressBook.composeTo('contacts')}}
}
]);
SEC.contactsContextMenu.subscribe("beforeShow", function() {
var oTarget = this.contextEventTarget, grid = SUGAR.email2.contactView;
if (oTarget && !grid.isSelected(oTarget)) {
grid.unselectAllRows();
grid.selectRow(oTarget);
}
});
SEC.contactsContextMenu.render();
}
// set auto-check timer
SUGAR.email2.folders.startCheckTimer();
// check if we're coming from an email-link click
setTimeout("SUGAR.email2.composeLayout.composePackage()", 2000);
YAHOO.util.Event.on(window, 'resize', SUGAR.email2.autoSetLayout);
//Init fix for YUI 2.7.0 datatable sort.
SUGAR.email2.addressBook.initFixForDatatableSort();
}
function createTreePanel(treeData, params) {
var tree = new YAHOO.widget.TreeView(params.id);
var root = tree.getRoot();
//if (treeData.nodes && treeData[0].id == "Home")
// treeData = treeData[0];
addChildNodes(root, treeData);
return tree;
}
function addChildNodes(parentNode, parentData) {
var Ck = YAHOO.util.Cookie;
var nextyear = SUGAR.email2.nextYear;
var nodes = parentData.nodes || parentData.children;
for (i in nodes) {
if (typeof(nodes[i]) == 'object') {
if (nodes[i].data) {
nodes[i].data.href = '#';
var node = new YAHOO.widget.TextNode(nodes[i].data, parentNode)
node.action = nodes[i].data.action;
} else {
if (nodes[i].id == SUGAR.language.get('app_strings','LBL_EMAIL_HOME_FOLDER')) {
addChildNodes(parentNode, nodes[i]);
return;
}
nodes[i].expanded = Ck.getSub("EmailTreeLayout", nodes[i].id + "") == "true";
Ck.setSub("EmailTreeLayout", nodes[i].id + "", nodes[i].expanded ? true : false, {expires: SUGAR.email2.nextYear});
if (nodes[i].cls) {
nodes[i].className = nodes[i].cls;
}
nodes[i].href = "#";
if (nodes[i].text) nodes[i].label = nodes[i].text;
//Override YUI child node creation
if (nodes[i].children) {
nodes[i].nodes = nodes[i].children;
nodes[i].children = [ ];
}
var node = new YAHOO.widget.TextNode(nodes[i], parentNode);
}
if (typeof(nodes[i].nodes) == 'object') {
addChildNodes(node, nodes[i]);
}
}
}
}
/**
* Custom TreeView initialization sequence to setup DragDrop targets for every tree node
*/
function email2treeinit(tree, treedata, treediv, params) {
//ensure the tree data is not corrupt
if (!treedata) {
return;
}
if (SUGAR.email2.tree) {
SUGAR.email2.tree.destroy();
SUGAR.email2.tree = null;
}
var tree = SUGAR.email2.tree = createTreePanel({nodes : {}}, {
id: 'emailtree'
});
tree.subscribe("clickEvent", SUGAR.email2.folders.handleClick);
tree.subscribe("collapseComplete", function(node){YAHOO.util.Cookie.setSub("EmailTreeLayout", node.data.id + "", false, {expires: SUGAR.email2.nextYear});});
tree.subscribe("expandComplete", function(node){
YAHOO.util.Cookie.setSub("EmailTreeLayout", node.data.id + "", true, {expires: SUGAR.email2.nextYear});
for (var i in node.children) {
SE.accounts.setupDDTarget(node.children[i]);
}
});
tree.setCollapseAnim("TVSlideOut");
tree.setExpandAnim("TVSlideIn");
var root = tree.root;
while (root.hasChildren()) {
var node = root.children[0];
node.destroy();
tree.removeNode(root.children[0], false);
}
addChildNodes(root, treedata);
tree.render();
SUGAR.email2.accounts.renderTree();
}
SUGAR.email2.folders.folderDD = function(id, sGroup, config) {
SUGAR.email2.folders.folderDD.superclass.constructor.call(this, id, sGroup, config);
};
YAHOO.extend(SUGAR.email2.folders.folderDD, YAHOO.util.DDProxy, {
startDrag: function(x, y) {
var Dom = YAHOO.util.Dom;
this.dragNode = SUGAR.email2.tree.getNodeByElement(this.getEl());
this.dragId = "";
var dragEl = this.getDragEl();
var clickEl = this.getEl();
Dom.setStyle(clickEl, "color", "#AAA");
Dom.setStyle(clickEl, "opacity", "0.25");
dragEl.innerHTML = clickEl.innerHTML;
Dom.addClass(dragEl, "ygtvcell");
Dom.addClass(dragEl, "ygtvcontent");
Dom.addClass(dragEl, "folderDragProxy");
Dom.setStyle(dragEl, "height", (clickEl.clientHeight - 5) + "px");
Dom.setStyle(dragEl, "width", (clickEl.clientWidth - 5) + "px");
Dom.setStyle(dragEl, "backgroundColor", "#FFF");
Dom.setStyle(dragEl, "opacity", "0.5");
Dom.setStyle(dragEl, "border", "1px solid #AAA");
},
onDragOver: function(ev, id) {
var Dom = YAHOO.util.Dom;
if (id != this.dragId)
{
var node = SUGAR.email2.tree.getNodeByElement(YAHOO.util.Dom.get(id));
if(node.data.cls != "sugarFolder") {
SUGAR.email2.folders.unhighliteAll();
return;
}
this.dragId = id;
this.targetNode = node;
SUGAR.email2.folders.unhighliteAll();
node.highlight();
}
},
onDragOut: function(e, id) {
if (this.targetNode) {
SUGAR.email2.folders.unhighliteAll();
this.targetNode = false;
this.dragId = false;
}
},
endDrag: function() {
YAHOO.util.Dom.setStyle(this.getEl(), "opacity", "1.0");
if (this.targetNode) {
SUGAR.email2.folders.moveFolder(this.dragNode.data.id, this.targetNode.data.id);
}
}
});

View File

@@ -0,0 +1,595 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
YAHOO.util.Connect.uploadFile = function(id, callback, uri, postData){
// Each iframe has an id prefix of "yuiIO" followed
// by the unique transaction id.
var frameId = 'yuiIO' + id;
var io = document.getElementById(frameId);
/*
* SUGAR - adding try/catch to this block as IE7 has some issue with this the first time it is called.
*/
// Initialize the HTML form properties in case they are
// not defined in the HTML form.
try {
this._formNode.action = null;
this._formNode.action = uri;
} catch(e) {
}
this._formNode.method = 'POST';
this._formNode.target = frameId;
if(this._formNode.encoding){
// IE does not respect property enctype for HTML forms.
// Instead use property encoding.
this._formNode.encoding = 'multipart/form-data';
}
else{
this._formNode.enctype = 'multipart/form-data';
}
if(postData){
var oElements = this.appendPostData(postData);
}
this._formNode.submit();
if(oElements && oElements.length > 0){
try
{
for(var i=0; i < oElements.length; i++){
this._formNode.removeChild(oElements[i]);
}
}
catch(e){}
}
// Reset HTML form status properties.
this.resetFormState();
// Create the upload callback handler that fires when the iframe
// receives the load event. Subsequently, the event handler is detached
// and the iframe removed from the document.
var uploadCallback = function()
{
var obj = {};
obj.tId = id;
obj.argument = callback.argument;
try
{
obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}
catch(e){}
if(callback.upload){
if(!callback.scope){
callback.upload(obj);
}
else{
callback.upload.apply(callback.scope, [obj]);
}
}
if(YAHOO.util.Event){
YAHOO.util.Event.removeListener(io, "load", uploadCallback);
}
else if(window.detachEvent){
io.detachEvent('onload', uploadCallback);
}
else{
io.removeEventListener('load', uploadCallback, false);
}
setTimeout(function(){ document.body.removeChild(io); }, 100);
};
// Bind the onload handler to the iframe to detect the file upload response.
if(YAHOO.util.Event){
YAHOO.util.Event.addListener(io, "load", uploadCallback);
}
else if(window.attachEvent){
io.attachEvent('onload', uploadCallback);
}
else{
io.addEventListener('load', uploadCallback, false);
}
}
/**
* Need by autocomplete library?
*/
YAHOO.register = function(name,mainClass,data) {
var mods = YAHOO.env.modules;
if(!mods[name]) {
mods[name] = {versions:[],builds:[]};
}
var m = mods[name], v = data.version, b = data.build, ls = YAHOO.env.listeners;
m.name = name;
m.version = v;
m.build = b;
m.versions.push(v);
m.builds.push(b);
m.mainClass = mainClass;
for(var i = 0; i<ls.length; i = i+1) {
ls[i](m);
}
if(mainClass) {
mainClass.VERSION = v;
mainClass.BUILD = b;
} else {
YAHOO.log("mainClass is undefined for module "+name,"warn");
}
};
YAHOO.lang = {
isArray : function(obj) {
if(obj && obj.constructor && obj.constructor.toString().indexOf('Array')>-1) {
return true;
} else {
return YAHOO.lang.isObject(obj) && obj.constructor == Array;
}
},
isBoolean : function(obj) {
return typeof obj == 'boolean';
},
isFunction : function(obj) {
return typeof obj == 'function';
},
isNull : function(obj) {
return obj == null;
},
isNumber : function(obj) {
return typeof obj == 'number' && isFinite(obj);
},
isObject : function(obj) {
return obj && (typeof obj == 'object'||YAHOO.lang.isFunction(obj));
},
isString : function(obj) {
return typeof obj == 'string';
},
isUndefined : function(obj) {
return typeof obj == 'undefined';
},
hasOwnProperty : function(obj,prop) {
if(Object.prototype.hasOwnProperty) {
return obj.hasOwnProperty(prop);
}
return !YAHOO.lang.isUndefined(obj[prop]) && obj.constructor.prototype[prop] !== obj[prop];
},
extend : function(subc,superc,overrides) {
if(!superc||!subc) {
throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");
}
}
};
/**
* Adding some error checking since we're immediately transitioning to a modal dialogue in QuickCreate
* and much of this class is unavailable
YAHOO.widget.Menu.prototype._getOffsetWidth = function() {
if(this.element) {
var oClone = this.element.cloneNode(true);
if(typeof(Dom) != 'undefined') {
Dom.setStyle(oClone, "width", "");
document.body.appendChild(oClone);
var sWidth = oClone.offsetWidth;
document.body.removeChild(oClone);
return sWidth;
}
}
};*/
Ext.Template.prototype.applyTemplate = function(values){
var myRE = /\{(\w+\.*\w*)\}/g;
if(this.compiled){
return this.compiled(values);
}
var useF = this.disableFormats !== true;
var fm = Ext.util.Format, tpl = this;
var fn = function(m, name, format, args){
if(name.match(/\./g)) {
var temp = name.split(".");
values[name] = eval(temp[0] + "." + temp[1]);
return values[name];
}
else if(format && useF && typeof(format) == "string") {
if(format.substr(0, 5) == "this."){
return tpl.call(format.substr(5), values[name], values);
}else{
if(args){
var re = /^\s*['"](.*)["']\s*$/;
args = args.split(',');
for(var i = 0, len = args.length; i < len; i++){
args[i] = args[i].replace(re, "$1");
}
args = [values[name]].concat(args);
}else{
args = [values[name]];
}
return fm[format].apply(fm, args);
}
}else{
return values[name] !== undefined ? values[name] : "";
}
};
return this.html.replace(myRE, fn);
};
/*
* Fixes an IE7 issue where this.dom.parentNode is null
*/
Ext.Element.prototype.remove = function() {
if(this.dom.parentNode) {
this.dom.parentNode.removeChild(this.dom);
delete Ext.Element.cache[this.dom.id];
}
};
//Adds translated strings to message boxes
Ext.onReady(function(){Ext.MessageBox.buttonText = {
ok: app_strings.LBL_EMAIL_OK,
cancel: app_strings.LBL_EMAIL_CANCEL,
yes: app_strings.LBL_EMAIL_YES,
no: app_strings.LBL_EMAIL_NO
}});
ContactsDragZone = function(view, config){
this.view = view;
this.view.dragz = this;
this.contacts = [ ];
ContactsDragZone.superclass.constructor.call(this, view.el, config);
};
//This Class recognizes what elements in
//the contacts view are drag dropable and when
Ext.extend(ContactsDragZone, Ext.dd.DragZone, {
setContacts : function(contactArray) {
this.contacts = contactArray;
},
addContact : function(contactObject) {
this.contacts.push(contactObject);
},
getContact : function(index) {
return this.contacts[index];
},
getContactFromEmail : function(emailId) {
for(i in this.contacts) {
var contact = this.contacts[i];
for(j in contact.email) {
if (contact.email[j].id && contact.email[j].id == emailId) {
return contact;
}
}
}
return null;
},
getPrimaryEmail : function(contactId) {
var contact = this.contacts[contactId];
for(j in contact.email) {
if (contact.email[j].id && contact.email[j].primary_address == "1") {
return contact.email[j];
}
}
return null;
},
toggleContact : function(view, index, node, e) {
e = Ext.EventObject.setEvent(e);
e.preventDefault();
if (node.className.indexOf('address-contact') > -1) {
var expNode = view.getNode('ex' + node.id);
expNode.style.display = "";
var contact = view.dragz.getContact(node.id);
for(i in contact.email) {
if (contact.email[i].id) {
view.getNode(contact.email[i].id).style.display = "";
}
}
var i = 0;
node.style.display="none";
view.clearSelections(true);
view.select(expNode);
}
//Collapse Expanded Contact
else if (node.className.indexOf('address-exp-contact') > -1) {
var origId = node.id.substring(2);
var colNode = view.getNode(origId);
colNode.style.display = "";
var contact = view.dragz.getContact(origId);
for(i in contact.email) {
if (contact.email[i].id) {
view.getNode(contact.email[i].id).style.display = "none";
}
}
node.style.display="none";
view.clearSelections(true);
view.select(colNode);
}
},
toggleList : function(view, index, node, e) {
e = Ext.EventObject.setEvent(e);
e.preventDefault();
if (node.className.indexOf('address-list') > -1) {
var length = node.getAttribute('size');
if (length > 0) {
var emails = view.getNodes(index + 1, index + parseInt(length));
for(var i=0; i < emails.length; i++) {
if (emails[i]) {
emails[i].style.display = (emails[i].style.display == 'none') ? '' : 'none';
}
}
}
}
view.clearSelections(true);
view.select(node);
},
//initizlized Drag-Drop objects and proxies.
getDragData : function(e){
e = Ext.EventObject.setEvent(e);
e.preventDefault();
var target = e.getTarget('.address-contact') || e.getTarget('.address-email');
if(target){
var view = this.view;
if(!view.isSelected(target)){
view.select(target, e.ctrlKey);
}
var selNodes = view.getSelectedNodes();
var dragData = { }
if(selNodes.length == 1){
dragData.nodes = target;
var proxy = document.createElement('div');
if (target.className.indexOf('address-contact') != -1) {
var email = view.getNode(view.dragz.getPrimaryEmail(target.id).id);
proxy.innerHTML = target.innerHTML + email.innerHTML;
} else {
var id = view.dragz.getContactFromEmail(target.id).id;
proxy.innerHTML = view.getNode(id).innerHTML + target.innerHTML;
}
dragData.ddel = proxy;
dragData.single = true;
}else{
dragData.nodes = [];
var div = document.createElement('div'); // create the multi element drag "ghost"
div.className = 'contacts-multi-proxy';
for(var i = 0, len = selNodes.length; i < len; i++){
if (selNodes[i].className.indexOf('address-exp-contact') < 0 && selNodes[i].style.display != "none") {
//Append the default email to a contact drag proxy
var proxy = document.createElement('div');
if (selNodes[i].className.indexOf('address-contact') != -1) {
var email = view.getNode(view.dragz.getPrimaryEmail(selNodes[i].id).id);
proxy.innerHTML = selNodes[i].innerHTML + email.innerHTML;
} else {
var id = view.dragz.getContactFromEmail(selNodes[i].id).id;
proxy.innerHTML = view.getNode(id).innerHTML + selNodes[i].innerHTML;
}
div.appendChild(proxy);
dragData.nodes.push(selNodes[i]);
}
}
dragData.ddel = div;
dragData.multi = true;
}
return dragData;
}
var target = e.getTarget('.address-list');
if (target) {
var view = this.view;
if(!view.isSelected(target)){
view.select(target, e.ctrlKey);
}
var selNodes = view.getSelectedNodes();
var dragData = { }
if(selNodes.length == 1){
dragData.nodes = target;
dragData.ddel = target;
dragData.single = true;
}
else {
dragData.nodes = [];
var div = document.createElement('div'); // create the multi element drag "ghost"
div.className = 'contacts-multi-proxy';
for(var i = 0, len = selNodes.length; i < len; i++){
if (selNodes[i].className.indexOf('address-list') > -1) {
//Append the default email to a contact drag proxy
var proxy = document.createElement('div');
proxy.innerHTML = selNodes[i].innerHTML;
div.appendChild(proxy);
dragData.nodes.push(selNodes[i]);
}
}
dragData.ddel = div;
dragData.multi = true;
}
return dragData;
}
return false;
}
});
ListDropZone = function(view, config){
this.view = view;
ListDropZone.superclass.constructor.call(this, view.el, config);
};
//This Class handels contacts dropped onto Mailing Lists
Ext.extend(ListDropZone, Ext.dd.DropZone, {
getTargetFromEvent : function(e){
e = Ext.EventObject.setEvent(e);
//e.preventDefault();
var target = e.getTarget('.address-list');
if(target){
var view = this.view;
if(!view.isSelected(target)){
view.select(target, e.ctrlKey);
}
return target;
}
return null;
},
onNodeOver : function(node, source, e, data ) {
if (source.id == 'contacts') {
return "x-dd-drop-ok-add";
} else {
return this.dropNotAllowed;
}
},
onNodeDrop : function(node, source, e, data) {
if (source.id == 'contacts') {
SUGAR.email2.addressBook.addContactsToMailinglist(node, data);
}
}
});
/**
* Workaround for sliding panel noted here: http://extjs.com/forum/showthread.php?t=11899
*/
Ext.override(Ext.SplitLayoutRegion, {
initAutoHide: function(){
if (this.autoHide !== false) {
if (!this.autoHideHd) {
var st = new Ext.util.DelayedTask(this.slideIn, this);
this.autoHideHd = {
"mouseout": function(e){
if (!e.within(this.el, true)) {
var box = this.el.getBox();
if (e.getPageX() > -1 && e.getPageY() > -1 &&
(e.getPageX() < box.x || e.getPageX() > box.right ||
e.getPageY() < box.y || e.getPageY() > box.bottom)) {
st.delay(500);
}
}
},
"mouseover": function(e){
st.cancel();
},
scope: this
};
}
this.el.on(this.autoHideHd);
}
}
});
/*
* override tinyMCE methods for IE7 (specific to SugarCRM, since the normal code works fine in their examples)
*/
tinyMCE.loadScript = function(url) {
var i;
for (i=0; i<this.loadedFiles.length; i++) {
if (this.loadedFiles[i] == url)
return;
}
if (tinyMCE.settings.strict_loading_mode) {
this.pendingFiles[this.pendingFiles.length] = url;
} else if(this.isIE) {
/*
* SUGARCRM - added this else if() clause
*/
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
} else {
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');
}
this.loadedFiles[this.loadedFiles.length] = url;
}
tinyMCE.loadCSS = function(url) {
var ar = url.replace(/\s+/, '').split(',');
var lflen = 0, csslen = 0;
var skip = false;
var x = 0, i = 0, nl, le;
for (x = 0,csslen = ar.length; x<csslen; x++) {
if (ar[x] != null && ar[x] != 'null' && ar[x].length > 0) {
/* Make sure it doesn't exist. */
for (i=0, lflen=this.loadedFiles.length; i<lflen; i++) {
if (this.loadedFiles[i] == ar[x]) {
skip = true;
break;
}
}
if (!skip) {
/*
* SUGARCRM - added "this.isIE || ..."
*/
if (this.isIE || tinyMCE.settings.strict_loading_mode) {
nl = document.getElementsByTagName("head");
le = document.createElement('link');
le.setAttribute('href', ar[x]);
le.setAttribute('rel', 'stylesheet');
le.setAttribute('type', 'text/css');
nl[0].appendChild(le);
} else
document.write('<link href="' + ar[x] + '" rel="stylesheet" type="text/css" />');
this.loadedFiles[this.loadedFiles.length] = ar[x];
}
}
}
}

View File

@@ -0,0 +1,52 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
var req;
var target;
var flexContentOld = "";
var forcePreview = false;
var inCompose = false;
/* globals for Callback functions */
var email; // AjaxObject.showEmailPreview
var ieId;
var ieName;
var focusFolder;
var meta; // AjaxObject.showEmailPreview
var sendType;
var targetDiv;
var urlBase = 'index.php';
var urlStandard = 'sugar_body_only=true&to_pdf=true&module=Emails&action=EmailUIAjax';
var lazyLoadFolder = null;

View File

@@ -0,0 +1,104 @@
/*********************************************************************************
* 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.email2.templates['viewPrintable'] = '<html>' +
'<body onload="javascript:window.print();">' +
'<style>' +
'body {' +
' margin: 0px;' +
' font-family: helvetica, impact, sans-serif;' +
' font-size : 12pt;' +
'} ' +
'table {' +
' padding:10px;' +
'}' +
'</style>' +
'<div>' +
'<table cellpadding="0" cellspacing="0" border="0" width="100%">' +
' <tr>' +
' <td>' +
' <table cellpadding="0" cellspacing="0" border="0" width="100%">' +
' <tr>' +
' <td NOWRAP valign="top" width="1%" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_FROM}:' +
' </td>' +
' <td width="99%" class="displayEmailValue">' +
' {email.from_name} &lt;{email.from_addr}&gt;' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP valign="top" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_SUBJECT}:' +
' </td>' +
' <td NOWRAP valign="top" class="displayEmailValue">' +
' <b>{email.name}</b>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP valign="top" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_DATE_SENT_BY_SENDER}:' +
' </td>' +
' <td class="displayEmailValue">' +
' {email.date_start} {email.time_start}' +
' </td>' +
' </tr>' +
' <tr>' +
' <td NOWRAP valign="top" class="displayEmailLabel">' +
' {app_strings.LBL_EMAIL_TO}:' +
' </td>' +
' <td class="displayEmailValue">' +
' {email.toaddrs}' +
' </td>' +
' </tr>' +
' {email.cc}' +
' {email.attachments}' +
' </table>' +
' </td>' +
' </tr>' +
' <tr>' +
' <td>' +
' <table cellpadding="0" cellspacing="0" border="0" style="width:100%;">' +
' <tr>' +
' <td style="border-top: 1px solid #333;">' +
' <div style="padding:5px;">' +
'{email.description}' +
' </div>' +
' </td>' +
' </tr>' +
' </table>' +
' </td>' +
' </tr>' +
'</table>' +
'</div>' +
'</body></html>';

View File

@@ -0,0 +1,56 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h2>Create Archived Emails</h2>
<p>Use the Create Archived Emails page to archive emails that you sent or received from your contacts and other users.
<br>Copy the email into the Archived Email form. To associate it with a specific sugar record, select the related module from the drop-down list above and click <span class="helpButton">Select</span> to specify the record. The archived email is listed in the History panel of the related record.
<p>To attach a file that is located on your machine, click <span class="helpButton">Add File</span> and navigate to the file location.
<p>To attach a file that is located in the Sugar database, click <span class="helpButton">Add Document</span> and select the file from the Documents list.
<p>To archive the email in plain text format, select the <span class="helpButton">Edit Plain Text box</span> located below Body and paste the text the text box that displays below.

View File

@@ -0,0 +1,57 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>View Emails</h1>
<p>Use this page to view emails that you saved as drafts, or emails that you sent, or emails that you archived.</p>
<p>This page displays the following information:</p>
<ul>
<li>A Search panel where you can enter information such as the subject or contact name to search for emails. Enter the date and time when the email was sent.
<li>A list of emails that you sent, drafted, or archived; click an email subject to view the contents of the email.
<li>A Mass Update panel that you can use to update or delete multiple emails selected from the list.
</ul>

View File

@@ -0,0 +1,112 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Emails Group Inbox</h1>
<p>Use the Group Inbox page to assign emails from the group inbox to a specific user or team. This page displays the following information:
<ul>
<li>A Search sub-panel where you can enter information such as the email status and subject to find a specific email.
<li>An Assignment sub-panel that enables you to assign some or all group emails to a specific user or team using one of the following options:
<ul>
<li>Direct Assign: The user selects the users and assigns the emails to them.
<li>Round Robin: The assigned emails are distributed equally among assigned users.
<li>Least Busy: The system counts the emails marked as Assigned or Unread in the user inbox and routes assigned emails to the user who has the lowest number of assigned or unread emails. When all the users have an equal number of assigned emails, the system switches to the round robin mode.
/ul>
<li>
A Group Inbox sub-panel where you can view existing group emails, check for new emails, and export some or all the emails to your local machine.
<ul>
<li>To check for new emails, click <span class="helpButton">Check Mail</span>.>
<li>To export some emails, select them from the list, click <span class="helpButton">Export</span>, and choose Selected Records. To export all the emails on the page, choose Current Page; to export all the emails, select Entire list.

View File

@@ -0,0 +1,155 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Emails</h1>
<p>Use the Emails module as an email client to view and manage emails from external mail accounts.
<p>The Emails Home page displays the following information:<br>
<ul>
<li>A list of emails in your Sugar inbox along with related information such as the sender and the subject. Select an email from the list to view the contents in the panel below.
<li>Buttons to perform basic email functions.
<ul>
<li>To check for incoming emails, click <span class="helpButton">Check Mail</span>.
<li>To compose an email, click <span class="helpButton">Compose Email</span>.
<li>To set your email preferences, create email accounts, and create group folders, click <span class="helpButton">Settings</span>.
<li>To change the page layout, click the desired layout displayed in the <span class="helpButton">Views</span> option adjacent to the Settings button.
</ul>
<li>Tabs for Folders, Search, and Address Book.
<ul>
<li>The Folders tab lists existing local folders and group folders. Sugar provides a local folder named My Email to store imported emails that are assigned to you. This folder contains two sub-folders to store your email drafts and outbound emails. You can create additional local folders in the Folders tab.
<p>Only administrators can create group folders. Specific users or teams who are assigned to a Group folder can view its contents to perform assigned tasks.
<li>The Search tab lists fields for simple search and for advanced search within mail accounts. Enter a keyword in the Simple Search field to find emails containing that word. To narrow down search results with additional filters such as subject, sender, and recipient, use the Advanced Search fields. To search within all imported emails, use All Emails.
<li>The Address Book tab provides the ability to add entries from your list of users, contacts, and leads to your address book.
</ul>
<li>A Shortcuts section that displays the following options:
<ul>
<li><span class="helpShortcut">My Email</span>. Click this option to view the Emails module.
<li><span class="helpShortcut">My Archives</span>. Click this option to view a list of emails that you archived for your records.
<li><span class="helpShortcut">Create Archived Email</span>. Click this option to archive an inbound or outbound email for your records.
<li><span class="helpShortcut">Create Email Template</span>. Click this option to create a template for campaign emails. The system extracts variables such as names and addresses from campaign target records and merges them with the email template when you send out campaign emails.
<li><span class="helpShortcut">All Emails</span>. Click this option to view all outbound emails including drafts and archived emails.
<li><span class="helpShortcut">Email Templates</span>. Click this option to view a list of existing email templates.
</ul>
<h3>Setting General Preferences</h3>
To set up general preferences, click <span class="helpButton">Settings</span> and select the <span class="helpButton">General</span> tab.
<br>General settings include options such as how frequently you want to check for incoming emails, the number of emails listed on a page, page layout, character sets, and signatures. Some of these settings have default values, which you can change. General settings apply to all your email accounts in Sugar.
<h3>Creating Mail Accounts</h3>
You can send emails using the default mail account set up by the administrator. However, to access your external mail accounts through Sugar, you must set up a separate mail account for each external email account that you want to access.
<p>To set up a mail account, do as follows:
<ol>
<li>Click <span class="helpButton">Settings</span> and select the <span class="helpButton">Accounts</span> tab.
<li>Enter a name for the account.
<li>Enter the address of the email server from which your emails will be routed to Sugar.
<li>Enter a user name and password for the account. Some Email servers require the user name to be the user's email address.
<li>From the Mail Server Protocol drop-down list, select either IMAP or POP3 as the mail server protocol. If you are setting up a gmail account, click <span class="helpButton">Show Advanced</span> and enable SSL.
<br>If you select IMAP, click <span class="helpButton">Select</span> to specify a Monitored folder, a Trash folder and a Sent folder. The default monitored folder is Inbox. Use the Ctrl key or the Shift key to select multiple folders as the monitored folders.
<li>To change the default mail server for outgoing emails from the Group mail account, select an different one from the drop-down list or specify a new server as described below.
</ol>
<p>Click <span class="helpButton">Test settings</span> to ensure they are correct and then click <span class="helpButton">Save</span> to create the account.
<p>Click <span class="helpButton">Save</span> to save the settings; click <span class="helpButton">Clear Form</span> if you do not want to save the settings.
<h3>Specifying a Mail Server for Outbound Emails</h3>
<ol>
<li>Click the <span class="helpButton">Add</span> button adjacent to the Outgoing Mail Server field on the Mail Accounts tab.
<li>Enter the following information in the Outbound Mail Server window.
<ul>
<li>Name. Enter a name for the account.
<li>SMTP Server. Enter the SMTP Mail Server's address.
<li>SMTP Port. Enter the Mail Server's port number.
<br>To add Google's Gmail Server, click <span class="helpButton">Set Gmail Defaults</span>.The system fills in the SMTP Server and SMTP Port fields with the Gmail server address and port number respectively.
<li>Use SSL when connecting. Select this option if you are using the POP3 protocol and the mail server requires SSL. You can also use SSL with IMAP to access a gmail account.
<li>Use SMTP Authentication. Select this option if the mail server requires authentication to send out the email.
<li>SMTP Username. Enter your username for the mail account.
<li>SMTP Password. Enter your password for the mail account.
</ul>
<li>Click <span class="helpButton">Save</span> to add the mail server.
<br>The new mail server displays in the Outgoing Mail Server drop-down list.
</ol>
<h3>Creating Email Folders</h3>
<br>Sugar automatically creates a folder for every mail account that you configure. Emails in this folder reside on the mail server of the associated external mail account.
<br>Sugar also provides the My Email folder for imported emails that are assigned to you, your teams, and your direct reports.
You can create other local folders to group emails according to subject, project, or other criteria.
<p>As an administrator, you can create Group folders to route incoming emails for distribution among various users in the organization. You create Group folders in the Folders tab of the Settings window, and local folders in the Folders tab of the Emails module home page.<br>
<p>To create a local folder, in the Folders tab in the Emails module, right-click <span class="helpButton">My Email</span> and select <span class="helpButton">Add Folder</span>.<br>
<p>To create a Group folder, do the following:
<ol>
<li>Click <span class="helpButton">Settings</span> and select the <span class="helpButton">Folders</span> tab.
<li>In the Create Group Folder section, enter a name for the folder.
<li>To create a sub-folder, select the parent folder from the Add Folder drop-down list.
<!--BEGIN SUGARCRM CP ONLY -->
<li>Select a group from the group drop-down list.
<!--END SUGARCRM CP ONLY-->
<li>Click <span class="helpButton">Add New Group Folder</span> to create the folder.
</ol>
To view local folders and group folders in the Folders tab of the Emails home page, you must select them in the Folders tab under Settings. Similarly, to hide a folder, de-select it in Settings.
<h3>Creating an Address Book</h3>
You can create an address book consisting of entries from your list of contacts, users, and leads. After you populate the Address Book, you can find an entry quickly by typing in an alphabet, partial name, or full name in the Filter field.<br>
<ol>
<li>Click <span class="helpButton">Add Entries</span> and in the Select Address Book Entries window, enter the first name, last name, or email address of the individual and click <span class="helpButton">Search</span>.
<li>In the search results, click <span class="helpButton">Add</span> to list the individual in your address book.
</ol>
<h3>Composing and Managing Emails</h3>
<ol>
<li>To create an email, click <span class="helpButton">Compose Email</span>.
<li>If you created more than one mail account in Sugar, select a account from the drop-down list in the To field to specify the account from which to send the email.
<li>To save the email as a draft, click <span class="helpButton">Save Draft</span>.
<li>To attach one or more files, click <span class="helpButton">Attach Files</span>. To attach a file located on your local file system, select <span class="helpButton">Add File</span>. To attach a file created in Sugar, click <span class="helpButton">Add Document</span>.
<li>To select an email template for the email as well as a signature or a character set that is different from what you specified in Settings, click <span class="helpButton">Options</span> and select from the appropriate drop-down list. To send the email in HTML format, select <span class="helpButton">Send HTML</span>. To archive the email in Sugar, select <span class="helpButton">Archive Sent Email</span>.
</ol>

View File

@@ -0,0 +1,368 @@
<?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: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_FW' => 'FW:',
'LBL_RE' => 'RE:',
'LBL_BUTTON_CREATE' => 'Create',
'LBL_BUTTON_EDIT' => 'Edit',
'LBL_QS_DISABLED' => '(QuickSearch is not availible for this module. Please use the select button.)',
'LBL_SIGNATURE_PREPEND' => 'Signature above reply',
'LBL_EMAIL_DEFAULT_DESCRIPTION' => 'Here is the quote you requested (You can change this text)',
'LBL_EMAIL_QUOTE_FOR' => 'Quote for: ',
'LBL_QUOTE_LAYOUT_DOES_NOT_EXIST_ERROR' => 'quote layout file does not exist: $layout',
'LBL_QUOTE_LAYOUT_REGISTERED_ERROR' => 'quote layout is not registered in modules/Quotes/Layouts.php',
'LBL_CONFIRM_DELETE' => 'Are you sure you want to delete this folder?',
'LBL_ENTER_FOLDER_NAME' => 'Please enter a folder name',
'LBL_ERROR_SELECT_MODULE' => 'Please select a module for the Related to field',
'ERR_ARCHIVE_EMAIL' => 'Error: Select emails to archive.',
'ERR_DATE_START' => 'Date Start',
'ERR_DELETE_RECORD' => 'Error: You must specify a record number to delete the account.',
'ERR_NOT_ADDRESSED' => 'Error: Email must have a To, CC, or BCC address',
'ERR_TIME_START' => 'Time Start',
'ERR_TIME_SENT' => 'Time Sent',
'LBL_ACCOUNTS_SUBPANEL_TITLE'=> 'Accounts',
'LBL_ADD_ANOTHER_FILE' => 'Add Another File',
'LBL_ADD_DASHLETS' => 'Add Sugar Dashlets',
'LBL_ADD_DOCUMENT' => 'Add Documents',
'LBL_ADD_ENTRIES' => 'Add Entries',
'LBL_ADD_FILE' => 'Add Files',
'LBL_ARCHIVED_EMAIL' => 'Archived Email',
'LBL_ARCHIVED_MODULE_NAME' => 'Create Archived Emails',
'LBL_ATTACHMENTS' => 'Attachments:',
'LBL_HAS_ATTACHMENT' => 'Has Attachment?:',
'LBL_BCC' => 'Bcc:',
'LBL_BODY' => 'Body:',
'LBL_BUGS_SUBPANEL_TITLE' => 'Bugs',
'LBL_CC' => 'Cc:',
'LBL_COLON' => ':',
'LBL_COMPOSE_MODULE_NAME' => 'Compose Email',
'LBL_CONTACT_FIRST_NAME' => 'Contact First Name',
'LBL_CONTACT_LAST_NAME' => 'Contact Last Name',
'LBL_CONTACT_NAME' => 'Contact:',
'LBL_CONTACTS_SUBPANEL_TITLE'=> 'Contacts',
'LBL_CREATED_BY' => 'Created by',
'LBL_DATE_AND_TIME' => 'Date & Time Sent:',
'LBL_DATE_SENT' => 'Date Sent:',
'LBL_DATE' => 'Date Sent:',
'LBL_DELETE_FROM_SERVER' => 'Delete message from server',
'LBL_DESCRIPTION' => 'Description',
'LBL_EDIT_ALT_TEXT' => 'Edit Plain Text',
'LBL_SEND_IN_PLAIN_TEXT' => 'Send in Plain Text',
'LBL_EDIT_MY_SETTINGS' => 'Edit My Settings',
'LBL_EMAIL_ATTACHMENT' => 'Email Attachment',
'LBL_EMAIL_EDITOR_OPTION' => 'Send HTML Email',
'LBL_EMAIL_SELECTOR' => 'Select',
'LBL_EMAIL' => 'Email Address:',
'LBL_EMAILS_ACCOUNTS_REL' => 'Emails:Accounts',
'LBL_EMAILS_BUGS_REL' => 'Emails:Bugs',
'LBL_EMAILS_CASES_REL' => 'Emails:Cases',
'LBL_EMAILS_CONTACTS_REL' => 'Emails:Contacts',
'LBL_EMAILS_LEADS_REL' => 'Emails:Leads',
'LBL_EMAILS_OPPORTUNITIES_REL'=> 'Emails:Opportunities',
'LBL_EMAILS_NOTES_REL' => 'Emails:Notes',
'LBL_EMAILS_PROJECT_REL' => 'Emails:Project',
'LBL_EMAILS_PROJECT_TASK_REL'=> 'Emails:ProjectTask',
'LBL_EMAILS_PROSPECT_REL' => 'Emails:Prospect',
'LBL_EMAILS_TASKS_REL' => 'Emails:Tasks',
'LBL_EMAILS_USERS_REL' => 'Emails:Users',
'LBL_EMPTY_FOLDER' => 'No Emails to display',
'LBL_ERROR_SENDING_EMAIL' => 'Error Sending email',
'LBL_ERROR_SAVING_DRAFT' => 'Error Saving Draft',
'LBL_FORWARD_HEADER' => 'Begin forwarded message:',
'LBL_FROM_NAME' => 'From Name',
'LBL_FROM' => 'From:',
'LBL_REPLY_TO' => 'Reply To:',
'LBL_HTML_BODY' => 'HTML Body',
'LBL_INVITEE' => 'Recipients',
'LBL_LEADS_SUBPANEL_TITLE' => 'Leads',
'LBL_MESSAGE_SENT' => 'Message Sent',
'LBL_MODIFIED_BY' => 'Modified By',
'LBL_MODULE_NAME_NEW' => 'Archive Email',
'LBL_MODULE_NAME' => 'All Emails',
'LBL_MODULE_TITLE' => 'Emails: ',
'LBL_MY_EMAILS' => 'My Emails',
'LBL_NEW_FORM_TITLE' => 'Archive Email',
'LBL_NONE' => 'None',
'LBL_NOT_SENT' => 'Send Error',
'LBL_NOTE_SEMICOLON' => 'Note: Use commas or semi-colons as separators for multiple email addresses.',
'LBL_NOTES_SUBPANEL_TITLE' => 'Attachments',
'LBL_OPPORTUNITY_SUBPANEL_TITLE' => 'Opportunities',
'LBL_PROJECT_SUBPANEL_TITLE'=> 'Projects',
'LBL_PROJECT_TASK_SUBPANEL_TITLE'=> 'Project Tasks',
'LBL_RAW' => 'Raw Email',
'LBL_SAVE_AS_DRAFT_BUTTON_KEY'=> 'R',
'LBL_SAVE_AS_DRAFT_BUTTON_LABEL'=> 'Save Draft',
'LBL_SAVE_AS_DRAFT_BUTTON_TITLE'=> 'Save Draft [Alt+R]',
'LBL_SEARCH_FORM_DRAFTS_TITLE'=> 'Search Drafts',
'LBL_SEARCH_FORM_SENT_TITLE'=> 'Search Sent Emails',
'LBL_SEARCH_FORM_TITLE' => 'Email Search',
'LBL_SEND_ANYWAYS' => 'This email has no subject. Send/save anyway?',
'LBL_SEND_BUTTON_KEY' => 'S',
'LBL_SEND_BUTTON_LABEL' => 'Send',
'LBL_SEND_BUTTON_TITLE' => 'Send [Alt+S]',
'LBL_SEND' => 'SEND',
'LBL_SENT_MODULE_NAME' => 'Sent Emails',
'LBL_SHOW_ALT_TEXT' => 'Show Plain Text',
'LBL_SIGNATURE' => 'Signature',
'LBL_SUBJECT' => 'Subject:',
'LBL_TEXT_BODY' => 'Text Body',
'LBL_TIME' => 'Time Sent:',
'LBL_TO_ADDRS' => 'To',
'LBL_USE_TEMPLATE' => 'Use Template:',
'LBL_USERS_SUBPANEL_TITLE' => 'Users',
'LBL_USERS' => 'Users',
'LNK_ALL_EMAIL_LIST' => 'All Emails',
'LNK_ARCHIVED_EMAIL_LIST' => 'Archived Emails',
'LNK_CALL_LIST' => 'Calls',
'LNK_DRAFTS_EMAIL_LIST' => 'All Drafts',
'LNK_EMAIL_LIST' => 'Emails',
'LBL_EMAIL_RELATE' => 'Related To',
'LNK_EMAIL_TEMPLATE_LIST' => 'View Email Templates',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_NEW_ARCHIVE_EMAIL' => 'Create Archived Email',
'LNK_NEW_CALL' => 'Log Call',
'LNK_NEW_EMAIL_TEMPLATE' => 'Create Email Template',
'LNK_NEW_EMAIL' => 'Send Email',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_NOTE' => 'Create Note or Attachment',
'LNK_NEW_SEND_EMAIL' => 'Compose',
'LNK_NEW_TASK' => 'Create Task',
'LNK_NOTE_LIST' => 'Notes',
'LNK_SENT_EMAIL_LIST' => 'Sent Emails',
'LNK_TASK_LIST' => 'Tasks',
'LNK_VIEW_CALENDAR' => 'Today',
'LBL_LIST_ASSIGNED' => 'Assigned',
'LBL_LIST_CONTACT_NAME' => 'Contact Name',
'LBL_LIST_CREATED' => 'Created',
'LBL_LIST_DATE_SENT' => 'Date Sent',
'LBL_LIST_DATE' => 'Date Sent',
'LBL_LIST_FORM_DRAFTS_TITLE'=> 'Draft',
'LBL_LIST_FORM_SENT_TITLE' => 'Sent Emails',
'LBL_LIST_FORM_TITLE' => 'Email List',
'LBL_LIST_FROM_ADDR' => 'From',
'LBL_LIST_RELATED_TO' => 'Recipient Type',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_TIME' => 'Time Sent',
'LBL_LIST_TO_ADDR' => 'To',
'LBL_LIST_TYPE' => 'Type',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this recipient from the email?',
'WARNING_SETTINGS_NOT_CONF' => 'Warning: Your email settings are not configured to send email.',
'WARNING_NO_UPLOAD_DIR' => 'Attachments may fail: No value for "upload_tmp_dir" was detected. Please correct this in your php.ini file.',
'WARNING_UPLOAD_DIR_NOT_WRITABLE' => 'Attachments may fail: An incorrect or unusable value for "upload_tmp_dir" was detected. Please correct this in your php.ini file.',
// for All emails
'LBL_BUTTON_RAW_TITLE' => 'Show Raw Message [Alt+E]',
'LBL_BUTTON_RAW_KEY' => 'e',
'LBL_BUTTON_RAW_LABEL' => 'Show Raw',
'LBL_BUTTON_RAW_LABEL_HIDE' => 'Hide Raw',
// for InboundEmail
'LBL_BUTTON_CHECK' => 'Check Mail',
'LBL_BUTTON_CHECK_TITLE' => 'Check For New Email [Alt+C]',
'LBL_BUTTON_CHECK_KEY' => 'c',
'LBL_BUTTON_FORWARD' => 'Forward',
'LBL_BUTTON_FORWARD_TITLE' => 'Forward This Email [Alt+F]',
'LBL_BUTTON_FORWARD_KEY' => 'f',
'LBL_BUTTON_REPLY_KEY' => 'r',
'LBL_BUTTON_REPLY_TITLE' => 'Reply [Alt+R]',
'LBL_BUTTON_REPLY' => 'Reply',
'LBL_CASES_SUBPANEL_TITLE' => 'Cases',
'LBL_INBOUND_TITLE' => 'Inbound Email',
'LBL_INTENT' => 'Intent',
'LBL_MESSAGE_ID' => 'Message ID',
'LBL_REPLY_HEADER_1' => 'On ',
'LBL_REPLY_HEADER_2' => 'wrote:',
'LBL_REPLY_TO_ADDRESS' => 'Reply-to Address',
'LBL_REPLY_TO_NAME' => 'Reply-to Name',
'LBL_LIST_BUG' => 'Bugs',
'LBL_LIST_CASE' => 'Cases',
'LBL_LIST_CONTACT' => 'Contacts',
'LBL_LIST_LEAD' => 'Leads',
'LBL_LIST_TASK' => 'Tasks',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
// for Inbox
'LBL_ALL' => 'All',
'LBL_ASSIGN_WARN' => 'Ensure that all 2 options are selected.',
'LBL_BACK_TO_GROUP' => 'Back to Group Inbox',
'LBL_BUTTON_DISTRIBUTE_KEY' => 'a',
'LBL_BUTTON_DISTRIBUTE_TITLE'=> 'Assign [Alt+A]',
'LBL_BUTTON_DISTRIBUTE' => 'Assign',
'LBL_BUTTON_GRAB_KEY' => 't',
'LBL_BUTTON_GRAB_TITLE' => 'Take from Group [Alt+T]',
'LBL_BUTTON_GRAB' => 'Take from Group',
'LBL_CREATE_BUG' => 'Create Bug',
'LBL_CREATE_CASE' => 'Create Case',
'LBL_CREATE_CONTACT' => 'Create Contact',
'LBL_CREATE_LEAD' => 'Create Lead',
'LBL_CREATE_TASK' => 'Create Task',
'LBL_DIST_TITLE' => 'Assignment',
'LBL_LOCK_FAIL_DESC' => 'The chosen item is unavailable currently.',
'LBL_LOCK_FAIL_USER' => ' has taken ownership.',
'LBL_MASS_DELETE_ERROR' => 'No checked items were passed for deletion.',
'LBL_NEW' => 'New',
'LBL_NEXT_EMAIL' => 'Next Free Item',
'LBL_NO_GRAB_DESC' => 'There were no items available. Try again in a moment.',
'LBL_QUICK_REPLY' => 'Reply',
'LBL_REPLIED' => 'Replied',
'LBL_SELECT_TEAM' => 'Select Teams',
'LBL_TAKE_ONE_TITLE' => 'Reps',
'LBL_TITLE_SEARCH_RESULTS' => 'Search Results',
'LBL_TO' => 'To: ',
'LBL_TOGGLE_ALL' => 'Toggle All',
'LBL_UNKNOWN' => 'Unknown',
'LBL_UNREAD_HOME' => 'Unread Emails',
'LBL_UNREAD' => 'Unread',
'LBL_USE_ALL' => 'All Search Results',
'LBL_USE_CHECKED' => 'Only Checked',
'LBL_USE_MAILBOX_INFO' => 'Use Mailbox From: Address',
'LBL_USE' => 'Assign:',
'LBL_ASSIGN_SELECTED_RESULTS_TO' => 'Assign Selected Results To: ',
'LBL_USER_SELECT' => 'Select Users',
'LBL_USING_RULES' => 'Using Rules:',
'LBL_WARN_NO_DIST' => 'No Distribution Method Selected',
'LBL_WARN_NO_USERS' => 'No Users are selected',
'LBL_WARN_NO_USERS_OR_TEAM' => 'Please select either a user or team for assignment.',
'LBL_IMPORT_STATUS_TITLE' => 'Status',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_TITLE_GROUP_INBOX'=> 'Group Inbox',
'LBL_LIST_TITLE_MY_DRAFTS' => 'My Drafts',
'LBL_LIST_TITLE_MY_INBOX' => 'My Inbox',
'LBL_LIST_TITLE_MY_SENT' => 'My Sent Email',
'LBL_LIST_TITLE_MY_ARCHIVES'=> 'My Archived Emails',
'LBL_ACTIVITIES_REPORTS' => 'Activities Report',
'LNK_CHECK_MY_INBOX' => 'Check My Mail',
'LNK_DATE_SENT' => 'Date Sent',
'LNK_GROUP_INBOX' => 'Group Inbox',
'LNK_MY_DRAFTS' => 'My Drafts',
'LNK_MY_INBOX' => 'My Email',
'LNK_VIEW_MY_INBOX' => 'View My Email',
'LNK_QUICK_REPLY' => 'Reply',
'LNK_MY_ARCHIVED_LIST' => 'My Archives',
'LBL_EMAILS_NO_PRIMARY_TEAM_SPECIFIED' =>'No Primary Team specified',
// advanced search
'LBL_ASSIGNED_TO' => 'Assigned To:',
'LBL_MEMBER_OF' => 'Parent',
'LBL_QUICK_CREATE' => 'Quick Create',
'LBL_STATUS' => 'Email Status:',
'LBL_EMAIL_FLAGGED' => 'Flagged:',
'LBL_EMAIL_REPLY_TO_STATUS' => 'Reply To Status:',
'LBL_TYPE' => 'Type:',
//#20680 EmialTemplate Ext.Message.show;
'LBL_EMAILTEMPLATE_MESSAGE_SHOW_TITLE' => 'Please check!',
'LBL_EMAILTEMPLATE_MESSAGE_SHOW_MSG' => 'Selecting this template will overwrite any data already entered within the email body. Do you wish to continue?',
'LBL_EMAILTEMPLATE_MESSAGE_CLEAR_MSG' => 'Selecting "--None--" will clear any data already entered within the email body. Do you wish to continue?',
'LBL_CHECK_ATTACHMENTS'=>'Please Check Attachments!',
'LBL_HAS_ATTACHMENTS' => 'This email already has attachment(s). Would you like to keep the attachment(s)?',
'ERR_MISSING_REQUIRED_FIELDS' => 'Missing required field',
'ERR_INVALID_REQUIRED_FIELDS' => 'Invalid required field',
'LBL_FILTER_BY_RELATED_BEAN' => 'Only show recipients related to',
'LBL_RECIPIENTS_HAVE_BEEN_ADDED' => 'Recipients have been added.',
'LBL_ADD_INBOUND_ACCOUNT' => 'Add',
'LBL_ADD_OUTBOUND_ACCOUNT' => 'Add',
'LBL_EMAIL_ACCOUNTS_INBOUND' => 'Mail Account Properties',
'LBL_EMAIL_SETTINGS_OUTBOUND_ACCOUNT' => 'Outgoing SMTP Mail Server',
'LBL_EMAIL_SETTINGS_OUTBOUND_ACCOUNTS' => 'Outgoing SMTP Mail Servers',
'LBL_EMAIL_SETTINGS_INBOUND_ACCOUNTS' => 'Mail Accounts',
'LBL_EMAIL_SETTINGS_INBOUND' => 'Incoming Email',
'LBL_EMAIL_SETTINGS_OUTBOUND' => 'Outgoing Email',
'LBL_ADD_CC' => 'Add Cc',
'LBL_ADD_BCC' => 'Add Bcc',
'LBL_ADD_TO_ADDR' => 'Add To',
'LBL_SELECTED_ADDR' => 'Selected',
'LBL_ADD_CC_BCC_SEP' => '|',
'LBL_SEND_EMAIL_FAIL_TITLE' => 'Error Sending Email',
'LBL_EMAIL_DETAIL_VIEW_SHOW' => 'show ',
'LBL_EMAIL_DETAIL_VIEW_MORE' => ' more',
'LBL_MORE_OPTIONS' => 'More',
'LBL_LESS_OPTIONS' => 'Less',
'LBL_MAILBOX_TYPE_PERSONAL' => 'Personal',
'LBL_MAILBOX_TYPE_GROUP' => 'Group',
'LBL_MAILBOX_TYPE_GROUP_FOLDER' => 'Group - Auto-Import',
'LBL_SEARCH_FOR' => 'Search For',
'LBL_EMAIL_INBOUND_TYPE_HELP' => '<b>Personal</b>: Email account accessible by you. Only you can manage and import emails from this account.<br><b>Group</b>: Email account accessible by members of specified teams. Team members can manage and import emails from this account.<br><b>Group - auto-import</b>: Email account accessible by members of specified teams. Emails are automatically imported as records.',
'LBL_ADDRESS_BOOK_SEARCH_HELP' => 'Enter an email address, First Name, Last Name or Account Name to find recipients.',
'LBL_TEST_SETTINGS' => 'Test Settings',
'LBL_EMPTY_EMAIL_BODY' => '<p><span style="color: #888888;"><em>This Message Has No Content</em></span></p>',
'LBL_TEST_EMAIL_SUBJECT' => 'Test Email from Sugar',
'LBL_NO_SUBJECT' =>'(no subject)',
'LBL_CHECKING_ACCOUNT' => 'Checking Account',
'LBL_OF' => 'of',
'LBL_TEST_EMAIL_BODY' => 'This email was sent in order to test the outgoing mail server information provided in the Sugar application. A successful receipt of this email indicates that the outgoing mail server information provided is valid.',
// for outbound email dialog
'LBL_MAIL_SMTPUSER' => 'Username',
'LBL_MAIL_SMTPPASS' => 'Password',
'LBL_MAIL_SMTPSERVER' => 'SMTP Mail Server',
'LBL_SMTP_SERVER_HELP' => 'This SMTP Mail Server can be used for outgoing mail. Provide a username and password for your email account in order to use the mail server.',
'LBL_MISSING_DEFAULT_OUTBOUND_SMTP_SETTINGS' => 'The administator has not yet configured the default outbound account. Unable to send test email.',
'LBL_MAIL_SMTPAUTH_REQ' => 'Use SMTP Authentication?',
'LBL_MAIL_SMTPPASS' => 'SMTP Password:',
'LBL_MAIL_SMTPPORT' => 'SMTP Port:',
'LBL_MAIL_SMTPSERVER' => 'SMTP Server:',
'LBL_MAIL_SMTPUSER' => 'SMTP Username:',
'LBL_MAIL_SMTPTYPE' => 'SMTP Server Type:',
'LBL_MAIL_SMTP_SETTINGS' => 'SMTP Server Specification',
'LBL_CHOOSE_EMAIL_PROVIDER' => 'Choose your Email provider:',
'LBL_YAHOOMAIL_SMTPPASS' => 'Yahoo! Mail Password:',
'LBL_YAHOOMAIL_SMTPUSER' => 'Yahoo! Mail ID:',
'LBL_GMAIL_SMTPPASS' => 'Gmail Password:',
'LBL_GMAIL_SMTPUSER' => 'Gmail Email Address:',
'LBL_EXCHANGE_SMTPPASS' => 'Exchange Password:',
'LBL_EXCHANGE_SMTPUSER' => 'Exchange Username:',
'LBL_EXCHANGE_SMTPPORT' => 'Exchange Server Port:',
'LBL_EXCHANGE_SMTPSERVER' => 'Exchange Server:',
);

View File

@@ -0,0 +1,284 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* 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.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2007 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributors: Genius4U Ltd., simplicity GmbH, iscongroup kft.
********************************************************************************/
$mod_strings = array (
'LBL_FW' => 'FW:',
'LBL_RE' => 'RE:',
'LBL_BUTTON_CREATE' => 'Erstellen',
'LBL_BUTTON_EDIT' => 'Bearbeiten',
'LBL_QS_DISABLED' => '(Schnellsuche ist für dieses Modul nicht verfügbar. Bitte verwenden Sie die \'Auswahl \' Schaltfläche.)',
'LBL_SIGNATURE_PREPEND' => 'Signatur oberhalb der Antwort?',
'LBL_EMAIL_DEFAULT_DESCRIPTION' => 'Hier ist das Angebot das Sie angefragt haben (Sie können diesen Text ändern)',
'LBL_EMAIL_QUOTE_FOR' => 'Angebot für:',
'LBL_QUOTE_LAYOUT_DOES_NOT_EXIST_ERROR' => 'Angebotsvorlagedatei exisitert nicht: $layout',
'LBL_QUOTE_LAYOUT_REGISTERED_ERROR' => 'Angebotsvorlage ist nicht in Modules/Quotes/Layouts.php registriert',
'LBL_CONFIRM_DELETE' => 'Möchten Sie diesen Ordner wirklich löschen?',
'LBL_QUOTES_SUBPANEL_TITLE' => 'Angebote',
'LBL_EMAILS_QUOTES_REL' => 'E-Mails: Angebote',
'LBL_ERROR_SELECT_REPORT' => 'Bitte einen Bericht auswählen',
'ERR_ARCHIVE_EMAIL' => 'Fehler: E-Mails zum Archivieren auswählen.',
'ERR_DATE_START' => 'Startdatum',
'ERR_DELETE_RECORD' => 'Fehler: Um diese Firma zu löschen, muss eine Datensatznummer angegeben werden.',
'ERR_NOT_ADDRESSED' => 'Fehler: E-Mail muss eine An:, CC: oder BCC: Adresse haben',
'ERR_TIME_START' => 'Startzeit',
'LBL_ACCOUNTS_SUBPANEL_TITLE'=> 'Firmen',
'LBL_ADD_ANOTHER_FILE' => 'Weitere Datei hinzufügen',
'LBL_ADD_DASHLETS' => 'Dashlets hinzufügen',
'LBL_ADD_DOCUMENT' => 'Dokument aus Sugar hinzufügen',
'LBL_ADD_ENTRIES' => 'Einträge hinzufügen',
'LBL_ADD_FILE' => 'Datei aus dem Dateisystem hinzufügen',
'LBL_ARCHIVED_EMAIL' => 'Archivierte E-Mails',
'LBL_ARCHIVED_MODULE_NAME' => 'Archivierte E-Mails',
'LBL_ATTACHMENTS' => 'Anhänge:',
'LBL_BCC' => 'Bcc:',
'LBL_BODY' => 'Text:',
'LBL_BUGS_SUBPANEL_TITLE' => 'Fehler',
'LBL_CC' => 'Cc:',
'LBL_COLON' => ':',
'LBL_COMPOSE_MODULE_NAME' => 'Neue E-Mail',
'LBL_CONTACT_FIRST_NAME' => 'Kontakt Vorname',
'LBL_CONTACT_LAST_NAME' => 'Kontakt Nachname',
'LBL_CONTACT_NAME' => 'Kontakt:',
'LBL_CONTACTS_SUBPANEL_TITLE'=> 'Kontakte',
'LBL_CREATED_BY' => 'Erstellt von:',
'LBL_DATE_AND_TIME' => 'Sendetag & -zeit :',
'LBL_DATE_SENT' => 'Sendetag:',
'LBL_DATE' => 'Sendetag:',
'LBL_DELETE_FROM_SERVER' => 'Nachricht vom Server löschen',
'LBL_DESCRIPTION' => 'Beschreibung',
'LBL_EDIT_ALT_TEXT' => 'Als Text bearbeiten',
'LBL_EDIT_MY_SETTINGS' => 'Meine Einstellungen bearbeiten',
'LBL_EMAIL_ATTACHMENT' => 'E-Mail Anhang',
'LBL_EMAIL_EDITOR_OPTION' => 'HTML E-Mails versenden',
'LBL_EMAIL_SELECTOR' => 'Auswählen',
'LBL_EMAIL' => 'E-Mail:',
'LBL_EMAILS_ACCOUNTS_REL' => 'E-Mails:Firmen',
'LBL_EMAILS_BUGS_REL' => 'E-Mails:Fehler',
'LBL_EMAILS_CASES_REL' => 'E-Mails:Fälle',
'LBL_EMAILS_CONTACTS_REL' => 'E-Mails:Kontakte',
'LBL_EMAILS_LEADS_REL' => 'E-Mails:Interessenten',
'LBL_EMAILS_OPPORTUNITIES_REL'=> 'E-Mails:Verkaufschancen',
'LBL_EMAILS_NOTES_REL' => 'E-Mails:Notizen',
'LBL_EMAILS_PROJECT_REL' => 'E-Mails:Projekt',
'LBL_EMAILS_PROJECT_TASK_REL'=> 'E-Mails:Projektaufgabe',
'LBL_EMAILS_PROSPECT_REL' => 'E-Mails:Zielkontakt',
'LBL_EMAILS_TASKS_REL' => 'E-Mails:Aufgaben',
'LBL_EMAILS_USERS_REL' => 'E-Mails:Benutzer',
'LBL_ERROR_SENDING_EMAIL' => 'Fehler beim Senden der E-Mail',
'LBL_FORWARD_HEADER' => 'Anfang weitergeleitete Nachricht:',
'LBL_FROM_NAME' => 'Von Name',
'LBL_FROM' => 'Von:',
'LBL_HTML_BODY' => 'HTML Body',
'LBL_INVITEE' => 'Empfänger',
'LBL_LEADS_SUBPANEL_TITLE' => 'Interessenten',
'LBL_MESSAGE_SENT' => 'Mail gesendet',
'LBL_MODIFIED_BY' => 'Geändert von',
'LBL_MODULE_NAME_NEW' => 'E-Mail archivieren',
'LBL_MODULE_NAME' => 'E-Mails',
'LBL_MODULE_TITLE' => 'E-Mails:',
'LBL_NEW_FORM_TITLE' => 'E-Mail archivieren',
'LBL_NONE' => 'Kein(e)',
'LBL_NOT_SENT' => 'Sende-Fehler',
'LBL_NOTE_SEMICOLON' => 'Bemerkung: Verwenden Sie Kommas oder Semikolons als Trennzeichen für mehrere E-Mail Adressen.',
'LBL_NOTES_SUBPANEL_TITLE' => 'Anhänge',
'LBL_OPPORTUNITY_SUBPANEL_TITLE' => 'Verkaufschancen',
'LBL_PROJECT_SUBPANEL_TITLE'=> 'Projekte',
'LBL_PROJECT_TASK_SUBPANEL_TITLE'=> 'Projektaufgaben',
'LBL_RAW' => 'Unbearbeitetes Mail',
'LBL_SAVE_AS_DRAFT_BUTTON_KEY'=> 'Entwurf speichern [Alt+R]',
'LBL_SAVE_AS_DRAFT_BUTTON_LABEL'=> 'Entwurf speichern',
'LBL_SAVE_AS_DRAFT_BUTTON_TITLE'=> 'Entwurf speichern',
'LBL_SEARCH_FORM_DRAFTS_TITLE'=> 'Entwürfe durchsuchen',
'LBL_SEARCH_FORM_SENT_TITLE'=> 'Durchsuche gesendete E-Mails',
'LBL_SEARCH_FORM_TITLE' => 'E-Mail Suche',
'LBL_SEND_ANYWAYS' => 'Diese E-Mail hat kein Betreff. Trotzdem speichern/senden?',
'LBL_SEND_BUTTON_KEY' => 'S',
'LBL_SEND_BUTTON_LABEL' => 'Senden',
'LBL_SEND_BUTTON_TITLE' => 'Versenden [Alt+S]',
'LBL_SEND' => 'Versenden',
'LBL_SENT_MODULE_NAME' => 'Gesendete E-Mail',
'LBL_SHOW_ALT_TEXT' => 'Als Text zeigen',
'LBL_SIGNATURE' => 'Unterschrift',
'LBL_SUBJECT' => 'Betreff:',
'LBL_TEXT_BODY' => 'Textkörper',
'LBL_TIME' => 'Sendezeit:',
'LBL_TO_ADDRS' => 'An',
'LBL_USE_TEMPLATE' => 'Vorlage benutzen:',
'LBL_USERS_SUBPANEL_TITLE' => 'Benutzer',
'LBL_USERS' => 'Benutzer',
'LNK_ALL_EMAIL_LIST' => 'E-Mails',
'LNK_ARCHIVED_EMAIL_LIST' => 'Archivierte E-Mails',
'LNK_CALL_LIST' => 'Anrufe',
'LNK_DRAFTS_EMAIL_LIST' => 'Alle Entwürfe',
'LNK_EMAIL_LIST' => 'E-Mails',
'LBL_EMAIL_RELATE' => 'Verbinden mit',
'LNK_EMAIL_TEMPLATE_LIST' => 'E-Mail Vorlagen',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_NEW_ARCHIVE_EMAIL' => 'E-Mail archivieren',
'LNK_NEW_CALL' => 'Neuer Anruf',
'LNK_NEW_EMAIL_TEMPLATE' => 'Neue E-Mail Vorlage',
'LNK_NEW_EMAIL' => 'E-Mail archivieren',
'LNK_NEW_MEETING' => 'Neues Meeting',
'LNK_NEW_NOTE' => 'Neue Notiz oder Anlage',
'LNK_NEW_SEND_EMAIL' => 'Neue E-Mail',
'LNK_NEW_TASK' => 'Neue Aufgabe',
'LNK_NOTE_LIST' => 'Notizen',
'LNK_SENT_EMAIL_LIST' => 'Gesendete E-Mail',
'LNK_TASK_LIST' => 'Aufgaben',
'LNK_VIEW_CALENDAR' => 'Heute',
'LBL_LIST_ASSIGNED' => 'Zugewiesen',
'LBL_LIST_CONTACT_NAME' => 'Kontakt:',
'LBL_LIST_CREATED' => 'Erstellt',
'LBL_LIST_DATE_SENT' => 'Sendedatum',
'LBL_LIST_DATE' => 'Sendedatum',
'LBL_LIST_FORM_DRAFTS_TITLE'=> 'Entwurf',
'LBL_LIST_FORM_SENT_TITLE' => 'Gesendete E-Mail',
'LBL_LIST_FORM_TITLE' => 'E-Mail Liste',
'LBL_LIST_FROM_ADDR' => 'Von',
'LBL_LIST_RELATED_TO' => 'Gehört zu',
'LBL_LIST_SUBJECT' => 'Betreff',
'LBL_LIST_TIME' => 'Sendezeit',
'LBL_LIST_TO_ADDR' => 'An',
'LBL_LIST_TYPE' => 'Typ:',
'NTC_REMOVE_INVITEE' => 'Möchten Sie diesen Empfänger wirklich von der E-Mail entfernen?',
'WARNING_SETTINGS_NOT_CONF' => 'Warnung: Ihre E-Mail Einstellungen sind zum Senden von Mails nicht konfiguriert.',
'WARNING_NO_UPLOAD_DIR' => 'Anhänge werde nicht funktionieren: Kein Wert für "upload_tmp_dir" gefunden. Bitte korrigieren Sie Ihre php.ini Datei.',
'WARNING_UPLOAD_DIR_NOT_WRITABLE' => 'Anhänge werde nicht funktionieren: Ein inkorrekter oder unbrauchbarer Wert für "upload_tmp_dir" wurde gefunden. Bitte korrigieren Sie Ihre php.ini Datei.',
// for All emails
'LBL_BUTTON_RAW_TITLE' => 'Unbearbeitete E-Mail anzeigen [Alt+E]',
'LBL_BUTTON_RAW_KEY' => 'e',
'LBL_BUTTON_RAW_LABEL' => 'Unbearbeitete anzeigen',
'LBL_BUTTON_RAW_LABEL_HIDE' => 'Unbearbeitete verbergen',
// for InboundEmail
'LBL_BUTTON_CHECK' => 'E-Mails holen',
'LBL_BUTTON_CHECK_TITLE' => 'Auf neue E-Mails prüfen [Alt + C]',
'LBL_BUTTON_CHECK_KEY' => 'c',
'LBL_BUTTON_FORWARD' => 'Vorwärts',
'LBL_BUTTON_FORWARD_TITLE' => 'Diese E-Mail weiterleiten [Alt + F]',
'LBL_BUTTON_FORWARD_KEY' => 'f',
'LBL_BUTTON_REPLY_KEY' => 'r',
'LBL_BUTTON_REPLY_TITLE' => 'Antworten [Alt+R]',
'LBL_BUTTON_REPLY' => 'Antworten',
'LBL_CASES_SUBPANEL_TITLE' => 'Fälle',
'LBL_INBOUND_TITLE' => 'Eingehende E-Mails',
'LBL_INTENT' => 'Absicht',
'LBL_MESSAGE_ID' => 'Nachricht ID',
'LBL_REPLY_HEADER_1' => 'Am',
'LBL_REPLY_HEADER_2' => 'geschrieben:',
'LBL_REPLY_TO_ADDRESS' => 'Antwort-an Adresse',
'LBL_REPLY_TO_NAME' => 'Antwort-an Name',
'LBL_LIST_BUG' => 'Fehler',
'LBL_LIST_CASE' => 'Fälle',
'LBL_LIST_CONTACT' => 'Kontakte',
'LBL_LIST_LEAD' => 'Interessenten',
'LBL_LIST_TASK' => 'Aufgaben',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Zugew. Benutzer',
// for Inbox
'LBL_ALL' => 'Alle',
'LBL_ASSIGN_WARN' => 'Stellen Sie sicher, dass alle 2 Optionen gewählt sind.',
'LBL_BACK_TO_GROUP' => 'Zurück zum Gruppen Posteingang',
'LBL_BUTTON_DISTRIBUTE_KEY' => 'a',
'LBL_BUTTON_DISTRIBUTE_TITLE'=> 'Zuweisen [Alt+A]',
'LBL_BUTTON_DISTRIBUTE' => 'Zuweisen',
'LBL_BUTTON_GRAB_KEY' => 't',
'LBL_BUTTON_GRAB_TITLE' => 'Von Gruppe nehmen [Alt+T]',
'LBL_BUTTON_GRAB' => 'Von Gruppe nehmen',
'LBL_CREATE_BUG' => 'Neuer Fehler',
'LBL_CREATE_CASE' => 'Neuer Fall',
'LBL_CREATE_CONTACT' => 'Neuer Kontakt',
'LBL_CREATE_LEAD' => 'Neuer Interessent',
'LBL_CREATE_TASK' => 'Neue Aufgabe',
'LBL_DIST_TITLE' => 'Aufgabe',
'LBL_LOCK_FAIL_DESC' => 'Das gewählte Item ist momentan nicht verfügbar.',
'LBL_LOCK_FAIL_USER' => 'hat Eigentum übernommen.',
'LBL_MASS_DELETE_ERROR' => 'Es wurden keine Einträge zum löschen markiert.',
'LBL_NEW' => 'Neu',
'LBL_NEXT_EMAIL' => 'Nächster freier Eintrag',
'LBL_NO_GRAB_DESC' => 'Es waren keine Elemente verfügbar. Versuchen Sie es später noch einmal.',
'LBL_QUICK_REPLY' => 'Antworten',
'LBL_REPLIED' => 'Beantwortet',
'LBL_SELECT_TEAM' => 'Teams auswählen',
'LBL_TAKE_ONE_TITLE' => 'Reps',
'LBL_TITLE_SEARCH_RESULTS' => 'Suchergebnisse',
'LBL_TO' => 'An:',
'LBL_TOGGLE_ALL' => 'Alle umschalten',
'LBL_UNKNOWN' => 'Unbekannt',
'LBL_UNREAD_HOME' => 'Ungelesene E-Mails',
'LBL_UNREAD' => 'Ungelesen',
'LBL_USE_ALL' => 'Alle Suchergebnisse',
'LBL_USE_CHECKED' => 'Nur markierte',
'LBL_USE_MAILBOX_INFO' => 'Mailbox E-Mail benutzen',
'LBL_USE' => 'Zuweisen:',
'LBL_ASSIGN_SELECTED_RESULTS_TO' => 'Ausgewählte Resultate zuweisen an:',
'LBL_USER_SELECT' => 'Benutzer auswählen',
'LBL_USING_RULES' => 'Regeln verwenden:',
'LBL_WARN_NO_DIST' => 'Keine Verteilmethode gewählt',
'LBL_WARN_NO_USERS' => 'Keine Benutzer ausgewählt',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_TITLE_GROUP_INBOX'=> 'Gruppen Posteingang',
'LBL_LIST_TITLE_MY_DRAFTS' => 'Meine Entwürfe',
'LBL_LIST_TITLE_MY_INBOX' => 'Mein Posteingang',
'LBL_LIST_TITLE_MY_SENT' => 'Meine gesendeten E-Mails',
'LBL_LIST_TITLE_MY_ARCHIVES'=> 'Meine archvierten E-mails',
'LNK_CHECK_MY_INBOX' => 'Meine E-Mails überprüfen',
'LNK_DATE_SENT' => 'Sendedatum',
'LNK_GROUP_INBOX' => 'Gruppen Posteingang',
'LNK_MY_DRAFTS' => 'Meine Entwürfe',
'LNK_MY_INBOX' => 'Mein Posteingang',
'LNK_QUICK_REPLY' => 'Antworten',
'LNK_MY_ARCHIVED_LIST' => 'Mein Archiv',
// advanced search
'LBL_ASSIGNED_TO' => 'Zugewiesen an:',
'LBL_MEMBER_OF' => 'Vorläufer',
'LBL_QUICK_CREATE' => 'Schnellerfassung',
'LBL_STATUS' => 'E-Mail Status:',
'LBL_TYPE' => 'Typ:',
);

View File

@@ -0,0 +1,370 @@
<?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: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_FW' => 'FW:',
'LBL_RE' => 'RE:',
'LBL_BUTTON_CREATE' => 'Create',
'LBL_BUTTON_EDIT' => 'Edit',
'LBL_QS_DISABLED' => '(QuickSearch is not availible for this module. Please use the select button.)',
'LBL_SIGNATURE_PREPEND' => 'Signature above reply',
'LBL_EMAIL_DEFAULT_DESCRIPTION' => 'Here is the quote you requested (You can change this text)',
'LBL_EMAIL_QUOTE_FOR' => 'Quote for: ',
'LBL_QUOTE_LAYOUT_DOES_NOT_EXIST_ERROR' => 'quote layout file does not exist: $layout',
'LBL_QUOTE_LAYOUT_REGISTERED_ERROR' => 'quote layout is not registered in modules/Quotes/Layouts.php',
'LBL_CONFIRM_DELETE' => 'Are you sure you want to delete this folder?',
'LBL_ENTER_FOLDER_NAME' => 'Please enter a folder name',
'LBL_ERROR_SELECT_MODULE' => 'Please select a module for the Related to field',
'ERR_ARCHIVE_EMAIL' => 'Error: Select emails to archive.',
'ERR_DATE_START' => 'Date Start',
'ERR_DELETE_RECORD' => 'Error: You must specify a record number to delete the account.',
'ERR_NOT_ADDRESSED' => 'Error: Email must have a Do, CC, or BCC address',
'ERR_TIME_START' => 'Time Start',
'ERR_TIME_SENT' => 'Time Sent',
'LBL_ACCOUNTS_SUBPANEL_TITLE'=> 'Accounts',
'LBL_ADD_ANOTHER_FILE' => 'Add Another File',
'LBL_ADD_DASHLETS' => 'Add Sugar Dashlets',
'LBL_ADD_DOCUMENT' => 'Add Documents',
'LBL_ADD_ENTRIES' => 'Add Entries',
'LBL_ADD_FILE' => 'Add Files',
'LBL_ARCHIVED_EMAIL' => 'Archived Email',
'LBL_ARCHIVED_MODULE_NAME' => 'Create Archived Emails',
'LBL_ATTACHMENTS' => 'Załączniki:',
'LBL_HAS_ATTACHMENT' => 'Has Attachment?:',
'LBL_BCC' => 'Bcc:',
'LBL_BODY' => 'Treść:',
'LBL_BUGS_SUBPANEL_TITLE' => 'Bugs',
'LBL_CC' => 'Cc:',
'LBL_COLON' => ':',
'LBL_COMPOSE_MODULE_NAME' => 'Compose Email',
'LBL_CONTACT_FIRST_NAME' => 'Contact First Name',
'LBL_CONTACT_LAST_NAME' => 'Contact Last Name',
'LBL_CONTACT_NAME' => 'Kontakt:',
'LBL_CONTACTS_SUBPANEL_TITLE'=> 'Contacts',
'LBL_CREATED_BY' => 'Created by',
'LBL_DATE_AND_TIME' => 'Date & Time Sent:',
'LBL_DATE_SENT' => 'Data wysłania:',
'LBL_DATE' => 'Data wysłania:',
'LBL_DELETE_FROM_SERVER' => 'Delete message from server',
'LBL_DESCRIPTION' => 'Description',
'LBL_EDIT_ALT_TEXT' => 'Edit Plain Text',
'LBL_SEND_IN_PLAIN_TEXT' => 'Send in Plain Text',
'LBL_EDIT_MY_SETTINGS' => 'Edit My Settings',
'LBL_EMAIL_ATTACHMENT' => 'Email Attachment',
'LBL_EMAIL_EDITOR_OPTION' => 'Send HTML Email',
'LBL_EMAIL_SELECTOR' => 'Select',
'LBL_EMAIL' => 'Email Address:',
'LBL_EMAILS_ACCOUNTS_REL' => 'Emails:Accounts',
'LBL_EMAILS_BUGS_REL' => 'Emails:Bugs',
'LBL_EMAILS_CASES_REL' => 'Emails:Cases',
'LBL_EMAILS_CONTACTS_REL' => 'Emails:Contacts',
'LBL_EMAILS_LEADS_REL' => 'Emails:Leads',
'LBL_EMAILS_OPPORTUNITIES_REL'=> 'Emails:Opportunities',
'LBL_EMAILS_NOTES_REL' => 'Emails:Notes',
'LBL_EMAILS_PROJECT_REL' => 'Emails:Project',
'LBL_EMAILS_PROJECT_TASK_REL'=> 'Emails:ProjectTask',
'LBL_EMAILS_PROSPECT_REL' => 'Emails:Prospect',
'LBL_EMAILS_TASKS_REL' => 'Emails:Tasks',
'LBL_EMAILS_USERS_REL' => 'Emails:Users',
'LBL_EMPTY_FOLDER' => 'No Emails to display',
'LBL_ERROR_SENDING_EMAIL' => 'Error Sending email',
'LBL_ERROR_SAVING_DRAFT' => 'Error Saving Draft',
'LBL_FORWARD_HEADER' => 'Begin forwarded message:',
'LBL_FROM_NAME' => 'Od Name',
'LBL_FROM' => 'Od:',
'LBL_REPLY_TO' => 'Reply Do:',
'LBL_HTML_BODY' => 'HTML Treść',
'LBL_INVITEE' => 'Recipients',
'LBL_LEADS_SUBPANEL_TITLE' => 'Leads',
'LBL_MESSAGE_SENT' => 'Message Sent',
'LBL_MODIFIED_BY' => 'Modified By',
'LBL_MODULE_NAME_NEW' => 'Archive Email',
'LBL_MODULE_NAME' => 'All Emails',
'LBL_MODULE_TITLE' => 'Emails: ',
'LBL_MY_EMAILS' => 'My Emails',
'LBL_NEW_FORM_TITLE' => 'Archive Email',
'LBL_NONE' => 'None',
'LBL_NOT_SENT' => 'Send Error',
'LBL_NOTE_SEMICOLON' => 'Note: Use commas or semi-colons as separators for multiple email addresses.',
'LBL_NOTES_SUBPANEL_TITLE' => 'Załączniki',
'LBL_OPPORTUNITY_SUBPANEL_TITLE' => 'Opportunities',
'LBL_PROJECT_SUBPANEL_TITLE'=> 'Projects',
'LBL_PROJECT_TASK_SUBPANEL_TITLE'=> 'Project Tasks',
'LBL_RAW' => 'Raw Email',
'LBL_SAVE_AS_DRAFT_BUTTON_KEY'=> 'R',
'LBL_SAVE_AS_DRAFT_BUTTON_LABEL'=> 'Save Draft',
'LBL_SAVE_AS_DRAFT_BUTTON_TITLE'=> 'Save Draft [Alt+R]',
'LBL_SEARCH_FORM_DRAFTS_TITLE'=> 'Search Drafts',
'LBL_SEARCH_FORM_SENT_TITLE'=> 'Search Sent Emails',
'LBL_SEARCH_FORM_TITLE' => ' ',
'LBL_SEND_ANYWAYS' => 'This email has no subject. Send/save anyway?',
'LBL_SEND_BUTTON_KEY' => 'S',
'LBL_SEND_BUTTON_LABEL' => 'Send',
'LBL_SEND_BUTTON_TITLE' => 'Send [Alt+S]',
'LBL_SEND' => 'SEND',
'LBL_SENT_MODULE_NAME' => 'Sent Emails',
'LBL_SHOW_ALT_TEXT' => 'Show Plain Text',
'LBL_SIGNATURE' => 'Signature',
'LBL_SUBJECT' => 'Temat:',
'LBL_TEXT_BODY' => 'Text Treść',
'LBL_TIME' => 'Time Sent:',
'LBL_TO_ADDRS' => 'Do',
'LBL_USE_TEMPLATE' => 'Use Template:',
'LBL_USERS_SUBPANEL_TITLE' => 'Users',
'LBL_USERS' => 'Users',
'LNK_ALL_EMAIL_LIST' => 'All Emails',
'LNK_ARCHIVED_EMAIL_LIST' => 'Archived Emails',
'LNK_CALL_LIST' => 'Calls',
'LNK_DRAFTS_EMAIL_LIST' => 'All Drafts',
'LNK_EMAIL_LIST' => 'Emails',
'LBL_EMAIL_RELATE' => 'Related Do',
'LNK_EMAIL_TEMPLATE_LIST' => 'View Email Templates',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_NEW_ARCHIVE_EMAIL' => 'Create Archived Email',
'LNK_NEW_CALL' => 'Log Call',
'LNK_NEW_EMAIL_TEMPLATE' => 'Create Email Template',
'LNK_NEW_EMAIL' => 'Send Email',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_NOTE' => 'Create Note or Attachment',
'LNK_NEW_SEND_EMAIL' => 'Utwórz wiadomość',
'LNK_NEW_TASK' => 'Create Task',
'LNK_NOTE_LIST' => 'Notes',
'LNK_SENT_EMAIL_LIST' => 'Sent Emails',
'LNK_TASK_LIST' => 'Tasks',
'LNK_VIEW_CALENDAR' => 'Doday',
'LBL_LIST_ASSIGNED' => 'Przypisany do',
'LBL_LIST_CONTACT_NAME' => 'Contact Name',
'LBL_LIST_CREATED' => 'Utworzony',
'LBL_LIST_DATE_SENT' => 'Data wysłania',
'LBL_LIST_DATE' => 'Data wysłania',
'LBL_LIST_FORM_DRAFTS_TITLE'=> 'Draft',
'LBL_LIST_FORM_SENT_TITLE' => 'Sent Emails',
'LBL_LIST_FORM_TITLE' => 'Lista Emaili',
'LBL_LIST_FROM_ADDR' => 'Od',
'LBL_LIST_RELATED_TO' => 'Szukaj w',
'LBL_LIST_SUBJECT' => 'Temat',
'LBL_LIST_TIME' => 'Time Sent',
'LBL_LIST_TO_ADDR' => 'Do',
'LBL_LIST_TYPE' => 'Typ',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this recipient from the email?',
'WARNING_SETTINGS_NOT_CONF' => 'Warning: Your email settings are not configured to send email.',
'WARNING_NO_UPLOAD_DIR' => 'Załączniki may fail: No value for "upload_tmp_dir" was detected. Please correct this in your php.ini file.',
'WARNING_UPLOAD_DIR_NOT_WRITABLE' => 'Załączniki may fail: An incorrect or unusable value for "upload_tmp_dir" was detected. Please correct this in your php.ini file.',
// for All emails
'LBL_BUTTON_RAW_TITLE' => 'Show Raw Message [Alt+E]',
'LBL_BUTTON_RAW_KEY' => 'e',
'LBL_BUTTON_RAW_LABEL' => 'Show Raw',
'LBL_BUTTON_RAW_LABEL_HIDE' => 'Hide Raw',
// for InboundEmail
'LBL_BUTTON_CHECK' => 'Check Mail',
'LBL_BUTTON_CHECK_TITLE' => 'Check For New Email [Alt+C]',
'LBL_BUTTON_CHECK_KEY' => 'c',
'LBL_BUTTON_FORWARD' => 'Forward',
'LBL_BUTTON_FORWARD_TITLE' => 'Forward This Email [Alt+F]',
'LBL_BUTTON_FORWARD_KEY' => 'f',
'LBL_BUTTON_REPLY_KEY' => 'r',
'LBL_BUTTON_REPLY_TITLE' => 'Reply [Alt+R]',
'LBL_BUTTON_REPLY' => 'Reply',
'LBL_CASES_SUBPANEL_TITLE' => 'Cases',
'LBL_INBOUND_TITLE' => 'Inbound Email',
'LBL_INTENT' => 'Intent',
'LBL_MESSAGE_ID' => 'Message ID',
'LBL_REPLY_HEADER_1' => 'On ',
'LBL_REPLY_HEADER_2' => 'wrote:',
'LBL_REPLY_TO_ADDRESS' => 'Reply-to Address',
'LBL_REPLY_TO_NAME' => 'Reply-to Name',
'LBL_LIST_BUG' => 'Bugs',
'LBL_LIST_CASE' => 'Cases',
'LBL_LIST_CONTACT' => 'Kontakt',
'LBL_LIST_LEAD' => 'Leads',
'LBL_LIST_TASK' => 'Tasks',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
// for Inbox
'LBL_ALL' => 'All',
'LBL_ASSIGN_WARN' => 'Ensure that all 2 options are selected.',
'LBL_BACK_TO_GROUP' => 'Back to Group Inbox',
'LBL_BUTTON_DISTRIBUTE_KEY' => 'a',
'LBL_BUTTON_DISTRIBUTE_TITLE'=> 'Assign [Alt+A]',
'LBL_BUTTON_DISTRIBUTE' => 'Assign',
'LBL_BUTTON_GRAB_KEY' => 't',
'LBL_BUTTON_GRAB_TITLE' => 'Take from Group [Alt+T]',
'LBL_BUTTON_GRAB' => 'Take from Group',
'LBL_CREATE_BUG' => 'Create Bug',
'LBL_CREATE_CASE' => 'Create Case',
'LBL_CREATE_CONTACT' => 'Create Contact',
'LBL_CREATE_LEAD' => 'Create Lead',
'LBL_CREATE_TASK' => 'Create Task',
'LBL_DIST_TITLE' => 'Assignment',
'LBL_LOCK_FAIL_DESC' => 'The chosen item is unavailable currently.',
'LBL_LOCK_FAIL_USER' => ' has taken ownership.',
'LBL_MASS_DELETE_ERROR' => 'No checked items were passed for deletion.',
'LBL_NEW' => 'New',
'LBL_NEXT_EMAIL' => 'Next Free Item',
'LBL_NO_GRAB_DESC' => 'There were no items available. Try again in a moment.',
'LBL_QUICK_REPLY' => 'Reply',
'LBL_REPLIED' => 'Replied',
'LBL_SELECT_TEAM' => 'Select Teams',
'LBL_TAKE_ONE_TITLE' => 'Reps',
'LBL_TITLE_SEARCH_RESULTS' => 'Search Results',
'LBL_TO' => 'Do: ',
'LBL_TOGGLE_ALL' => 'Doggle All',
'LBL_UNKNOWN' => 'Unknown',
'LBL_UNREAD_HOME' => 'Unread Emails',
'LBL_UNREAD' => 'Unread',
'LBL_USE_ALL' => 'All Search Results',
'LBL_USE_CHECKED' => 'Only Checked',
'LBL_USE_MAILBOX_INFO' => 'Use Mailbox Od: Address',
'LBL_USE' => 'Assign:',
'LBL_ASSIGN_SELECTED_RESULTS_TO' => 'Assign Selected Results Do: ',
'LBL_USER_SELECT' => 'Select Users',
'LBL_USING_RULES' => 'Using Rules:',
'LBL_WARN_NO_DIST' => 'No Distribution Method Selected',
'LBL_WARN_NO_USERS' => 'No Users are selected',
'LBL_WARN_NO_USERS_OR_TEAM' => 'Please select either a user or team for assignment.',
'LBL_IMPORT_STATUS_TITLE' => 'Status',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_TITLE_GROUP_INBOX'=> 'Group Inbox',
'LBL_LIST_TITLE_MY_DRAFTS' => 'My Drafts',
'LBL_LIST_TITLE_MY_INBOX' => 'My Inbox',
'LBL_LIST_TITLE_MY_SENT' => 'My Sent Email',
'LBL_LIST_TITLE_MY_ARCHIVES'=> 'My Archived Emails',
'LBL_ACTIVITIES_REPORTS' => 'Activities Report',
'LNK_CHECK_MY_INBOX' => 'Check My Mail',
'LNK_DATE_SENT' => 'Data wysłania',
'LNK_GROUP_INBOX' => 'Group Inbox',
'LNK_MY_DRAFTS' => 'My Drafts',
'LNK_MY_INBOX' => 'Mój Email',
'LNK_VIEW_MY_INBOX' => 'Pokaż moje Emaile',
'LNK_QUICK_REPLY' => 'Reply',
'LNK_MY_ARCHIVED_LIST' => 'My Archives',
'LBL_EMAILS_NO_PRIMARY_TEAM_SPECIFIED' =>'No Primary Team specified',
// advanced search
'LBL_ASSIGNED_TO' => 'Przypisane do:',
'LBL_MEMBER_OF' => 'Parent',
'LBL_QUICK_CREATE' => 'Quick Create',
'LBL_STATUS' => 'Status:',
'LBL_EMAIL_FLAGGED' => 'Flagged:',
'LBL_EMAIL_REPLY_TO_STATUS' => 'Reply Do Status:',
'LBL_TYPE' => 'Typ:',
//#20680 EmialTemplate Ext.Message.show;
'LBL_EMAILTEMPLATE_MESSAGE_SHOW_TITLE' => 'Please check!',
'LBL_EMAILTEMPLATE_MESSAGE_SHOW_MSG' => 'Selecting this template will overwrite any data already entered within the email body. Do you wish to continue?',
'LBL_EMAILTEMPLATE_MESSAGE_CLEAR_MSG' => 'Selecting "--None--" will clear any data already entered within the email body. Do you wish to continue?',
'LBL_CHECK_ATTACHMENTS'=>'Please Check Załączniki!',
'LBL_HAS_ATTACHMENTS' => 'This email already has attachment(s). Would you like to keep the attachment(s)?',
'ERR_MISSING_REQUIRED_FIELDS' => 'Missing required field',
'ERR_INVALID_REQUIRED_FIELDS' => 'Invalid required field',
'LBL_FILTER_BY_RELATED_BEAN' => 'Only show recipients related to',
'LBL_RECIPIENTS_HAVE_BEEN_ADDED' => 'Recipients have been added.',
'LBL_ADD_INBOUND_ACCOUNT' => 'Add',
'LBL_ADD_OUTBOUND_ACCOUNT' => 'Add',
'LBL_EMAIL_ACCOUNTS_INBOUND' => 'Mail Account Properties',
'LBL_EMAIL_SETTINGS_OUTBOUND_ACCOUNT' => 'Outgoing SMTP Mail Server',
'LBL_EMAIL_SETTINGS_OUTBOUND_ACCOUNTS' => 'Outgoing SMTP Mail Servers',
'LBL_EMAIL_SETTINGS_INBOUND_ACCOUNTS' => 'Mail Accounts',
'LBL_EMAIL_SETTINGS_INBOUND' => 'Incoming Email',
'LBL_EMAIL_SETTINGS_OUTBOUND' => 'Outgoing Email',
'LBL_ADD_CC' => 'Dodaj Cc',
'LBL_ADD_BCC' => 'Dodaj Bcc',
'LBL_ADD_TO_ADDR' => 'Add Do',
'LBL_SELECTED_ADDR' => 'Selected',
'LBL_ADD_CC_BCC_SEP' => '|',
'LBL_SEND_EMAIL_FAIL_TITLE' => 'Error Sending Email',
'LBL_EMAIL_DETAIL_VIEW_SHOW' => 'show ',
'LBL_EMAIL_DETAIL_VIEW_MORE' => ' more',
'LBL_MORE_OPTIONS' => 'More',
'LBL_LESS_OPTIONS' => 'Less',
'LBL_MAILBOX_TYPE_PERSONAL' => 'Personal',
'LBL_MAILBOX_TYPE_GROUP' => 'Group',
'LBL_MAILBOX_TYPE_GROUP_FOLDER' => 'Group - Auto-Import',
'LBL_SEARCH_FOR' => 'Szukaj',
'LBL_EMAIL_INBOUND_TYPE_HELP' => '<b>Personal</b>: Email account accessible by you. Only you can manage and import emails from this account.<br><b>Group</b>: Email account accessible by members of specified teams. Team members can manage and import emails from this account.<br><b>Group - auto-import</b>: Email account accessible by members of specified teams. Emails are automatically imported as records.',
// 'LBL_ADDRESS_BOOK_SEARCH_HELP' => 'Enter an email address, First Name, Last Name or Account Name to find recipients.',
'LBL_ADDRESS_BOOK_SEARCH_HELP' => 'Wpisz adres email, imię, nazwisko, lub nazwę kontaktu',
'LBL_TEST_SETTINGS' => 'Test Settings',
'LBL_EMPTY_EMAIL_BODY' => '<p><span style="color: #888888;"><em>This Message Has No Content</em></span></p>',
'LBL_TEST_EMAIL_SUBJECT' => 'Test Email from Sugar',
'LBL_NO_SUBJECT' =>'(no subject)',
'LBL_CHECKING_ACCOUNT' => 'Checking Account',
'LBL_OF' => 'of',
'LBL_TEST_EMAIL_BODY' => 'This email was sent in order to test the outgoing mail server information provided in the Sugar application. A successful receipt of this email indicates that the outgoing mail server information provided is valid.',
// for outbound email dialog
'LBL_MAIL_SMTPUSER' => 'Username',
'LBL_MAIL_SMTPPASS' => 'Password',
'LBL_MAIL_SMTPSERVER' => 'SMTP Mail Server',
'LBL_SMTP_SERVER_HELP' => 'This SMTP Mail Server can be used for outgoing mail. Provide a username and password for your email account in order to use the mail server.',
'LBL_MISSING_DEFAULT_OUTBOUND_SMTP_SETTINGS' => 'The administator has not yet configured the default outbound account. Unable to send test email.',
'LBL_MAIL_SMTPAUTH_REQ' => 'Use SMTP Authentication?',
'LBL_MAIL_SMTPPASS' => 'SMTP Password:',
'LBL_MAIL_SMTPPORT' => 'SMTP Port:',
'LBL_MAIL_SMTPSERVER' => 'SMTP Server:',
'LBL_MAIL_SMTPUSER' => 'SMTP Username:',
'LBL_MAIL_SMTPTYPE' => 'SMTP Server Type:',
'LBL_MAIL_SMTP_SETTINGS' => 'SMTP Server Specification',
'LBL_CHOOSE_EMAIL_PROVIDER' => 'Choose your Email provider:',
'LBL_YAHOOMAIL_SMTPPASS' => 'Yahoo! Mail Password:',
'LBL_YAHOOMAIL_SMTPUSER' => 'Yahoo! Mail ID:',
'LBL_GMAIL_SMTPPASS' => 'Gmail Password:',
'LBL_GMAIL_SMTPUSER' => 'Gmail Email Address:',
'LBL_EXCHANGE_SMTPPASS' => 'Exchange Password:',
'LBL_EXCHANGE_SMTPUSER' => 'Exchange Username:',
'LBL_EXCHANGE_SMTPPORT' => 'Exchange Server Port:',
'LBL_EXCHANGE_SMTPSERVER' => 'Exchange Server:',
);

View File

@@ -0,0 +1,88 @@
<?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".
********************************************************************************/
function additionalDetailsEmail($fields) {
global $current_language;
$mod_strings = return_module_language($current_language, 'Emails');
$newLines = array("\r", "\R", "\n", "\N");
$overlib_string = '';
// From Name
if(!empty($fields['FROM_NAME'])) {
$overlib_string .= '<b>' . $mod_strings['LBL_FROM'] . '</b>&nbsp;';
$overlib_string .= $fields['FROM_NAME'];
}
// email text
if(!empty($fields['DESCRIPTION_HTML'])) {
if(!empty($overlib_string)) $overlib_string .= '<br>';
$overlib_string .= '<b>'.$mod_strings['LBL_BODY'].'</b><br>';
$descH = strip_tags($fields['DESCRIPTION_HTML'], '<a>');
$desc = str_replace($newLines, ' ', $descH);
$overlib_string .= substr($desc, 0, 300);
if(strlen($descH) > 300) $overlib_string .= '...';
} elseif (!empty($fields['DESCRIPTION'])) {
if(!empty($overlib_string)) $overlib_string .= '<br>';
$overlib_string .= '<b>'.$mod_strings['LBL_BODY'].'</b><br>';
$descH = strip_tags(nl2br($fields['DESCRIPTION']));
$desc = str_replace($newLines, ' ', $descH);
$overlib_string .= substr($desc, 0, 300);
if(strlen($descH) > 300) $overlib_string .= '...';
}
$editLink = "index.php?action=EditView&module=Emails&record={$fields['ID']}";
$viewLink = "index.php?action=DetailView&module=Emails&record={$fields['ID']}";
$return_module = empty($_REQUEST['module']) ? 'Meetings' : $_REQUEST['module'];
$return_action = empty($_REQUEST['action']) ? 'ListView' : $_REQUEST['action'];
$type = empty($_REQUEST['type']) ? '' : $_REQUEST['type'];
$user_id = empty($_REQUEST['assigned_user_id']) ? '' : $_REQUEST['assigned_user_id'];
$additional_params = "&return_module=$return_module&return_action=$return_action&type=$type&assigned_user_id=$user_id";
$editLink .= $additional_params;
$viewLink .= $additional_params;
return array('fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => $editLink,
'viewLink' => $viewLink);
}
?>

View File

@@ -0,0 +1,53 @@
<?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".
********************************************************************************/
$popupMeta = array(
'moduleMain' => 'Email',
'varName' => 'EMAIL',
'orderBy' => 'name',
'whereClauses' => array(
'name' => 'emails.name',
'contact_name' => 'contacts.last_name'
),
'searchInputs' => array(
'name',
'contact_name',
'request_data'
),
);
?>

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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/
$layout_defs['Emails'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'notes' => array(
'order' => 5,
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'default',
'get_subpanel_data' => 'notes',
'title_key' => 'LBL_NOTES_SUBPANEL_TITLE',
'module' => 'Notes',
'top_buttons' => array(),
),
'accounts' => array(
'order' => 10,
'module' => 'Accounts',
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'accounts',
'add_subpanel_data' => 'account_id',
'title_key' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'contacts' => array(
'order' => 20,
'module' => 'Contacts',
'sort_order' => 'asc',
'sort_by' => 'last_name, first_name',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'contacts',
'add_subpanel_data' => 'contact_id',
'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'opportunities' => array(
'order' => 25,
'module' => 'Opportunities',
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'opportunities',
'add_subpanel_data' => 'opportunity_id',
'title_key' => 'LBL_OPPORTUNITY_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'leads' => array(
'order' => 30,
'module' => 'Leads',
'sort_order' => 'asc',
'sort_by' => 'last_name, first_name',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'leads',
'add_subpanel_data' => 'lead_id',
'title_key' => 'LBL_LEADS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'cases' => array(
'order' => 40,
'module' => 'Cases',
'sort_order' => 'desc',
'sort_by' => 'case_number',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'cases',
'add_subpanel_data' => 'case_id',
'title_key' => 'LBL_CASES_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'users' => array(
'order' => 50,
'module' => 'Users',
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'user_id',
'title_key' => 'LBL_USERS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'bugs' => array(
'order' => 60,
'module' => 'Bugs',
'sort_order' => 'desc',
'sort_by' => 'bug_number',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'bugs',
'add_subpanel_data' => 'bug_id',
'title_key' => 'LBL_BUGS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'project' => array(
'order' => 80,
'module' => 'Project',
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'ForEmails',
'get_subpanel_data' => 'project',
'add_subpanel_data' => 'project_id',
'title_key' => 'LBL_PROJECT_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
),
);

View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
$layout_defs['ForContacts'] = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Contacts'),
),
);
?>

View File

@@ -0,0 +1,111 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Emails.
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '5%',
),
'to_addr_list' => array(
'vname' => 'LBL_TO_ADDRS',
'width' => '20%',
'sortable' => false,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
'usage'=>'query_only',
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button' => array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,111 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Emails.
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '5%',
),
'to_addr_list' => array(
'vname' => 'LBL_TO_ADDRS',
'width' => '20%',
'sortable' => false,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
'usage'=>'query_only',
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button' => array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,111 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Emails.
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '5%',
),
'to_addr_list' => array(
'vname' => 'LBL_TO_ADDRS',
'width' => '20%',
'sortable' => false,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
'usage'=>'query_only',
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button' => array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,111 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Emails.
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '5%',
),
'to_addr_list' => array(
'vname' => 'LBL_TO_ADDRS',
'width' => '20%',
'sortable' => false,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
'usage'=>'query_only',
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button' => array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,111 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Emails.
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '5%',
),
'to_addr_list' => array(
'vname' => 'LBL_TO_ADDRS',
'width' => '20%',
'sortable' => false,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
'usage'=>'query_only',
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button' => array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,114 @@
<?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".
********************************************************************************/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'AD' => array (
'widget_class' => 'SubPanelAdditionalDetailsLink',
'vname' => '&nbsp;',
'sortable' => false,
'width' => 0,
),
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'reply_to_status' => array(
'usage' => 'query_only',
'force_exists' => true,
'force_default' => 0,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_type'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,115 @@
<?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".
********************************************************************************/
//$layout_defs['ForQueues'] = array(
// 'top_buttons' => array(
// array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Queues'),
// ),
//);
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Queues'),
),
'where' => "",
'fill_in_additional_fields'=>true,
'list_fields' => array(
/* 'mass_update' => array (
),
*/ 'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '68%',
),
'case_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'case_id',
'target_module' => 'Cases',
'module' => 'Cases',
'vname' => 'LBL_LIST_CASE',
'width' => '20%',
'force_exists'=>true,
'sortable'=>false,
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true,
) ,
/* 'parent_name'=>array(
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
'target_record_key' => 'parent_id',
'target_module_key'=>'parent_type',
'widget_class' => 'SubPanelDetailViewLink',
'sortable'=>false,
),*/
'date_modified'=>array(
'vname' => 'LBL_DATE_MODIFIED',
'width' => '10%',
),
/* 'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'parent_id'=>array(
'usage'=>'query_only',
),
'parent_type'=>array(
'usage'=>'query_only',
),
'filename'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
*/
),
);
?>

View File

@@ -0,0 +1,117 @@
<?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".
********************************************************************************/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'AD' => array (
'widget_class' => 'SubPanelAdditionalDetailsLink',
'vname' => '&nbsp;',
'sortable' => false,
'width' => 0,
),
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'reply_to_status' => array(
'usage' => 'query_only',
'force_exists' => true,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_type'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
$layout_defs['ForUsers'] = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
);
?>

View File

@@ -0,0 +1,54 @@
<h2>Raport Niedopasowanych Emaili</h2>
<table width="100%">
<tr><td width="33%">Tytuł</td><td width="14%">Nadawca</td><td width="22%">Odbiorca</td><td width="10%">Typ</td><td width="10%">Przypisane do</td><td width="10%">Data</td></tr>
<?php
mb_internal_encoding("UTF-8");
include_once("../../config.php");
function get_emails ($str)
{
$emails = array();
preg_match_all("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $str, $output);
foreach($output[0] as $email) array_push ($emails, strtolower($email));
if (count ($emails) >= 1) return $emails;
else return false;
}
global $sugar_config;
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
mysql_select_db($sugar_config['dbconfig']['db_name']);
mysql_query ('SET NAMES utf-8');
// dopasuj nowy kontakty do pojedynczych odbiorców
$r=mysql_query("select emails.id,rel.address_type,txt.user_id,txt.to_addrs,txt.from_addr,emails.type,emails.name,us.first_name,us.last_name,emails.date_sent from emails as emails
inner join emails_email_addr_rel as rel on emails.id=rel.email_id
inner join users as us on us.id=emails.created_by
inner join emails_text as txt on txt.email_id=emails.id
where txt.gid is not null group by rel.email_id having count(rel.email_id)<2;");
//echo "Znaleziono: ".mysql_num_rows($r)." nie dopasowanych emaili<br>";
while($dane=mysql_fetch_array($r)){
if($dane['type']=='out'){
$typ='Wychodząca';
} else {
$typ='Przychodząca';
}
$emails = get_emails ($dane['from_addr']);
$emails = get_emails ($dane['to_addrs']);
echo "<tr><td><a href='index.php?action=DetailView&module=Emails&record=".$dane['id']."'>".$dane['name']."</a></td><td>".$emails[0]."</td><td>".implode(",", $emails)."</td><td>".$typ."</td><td><a href='index.php?module=Users&action=DetailView&record=".$dane['user_id']."'>".$dane['first_name']." ".$dane['last_name']."</a></td><td>".$dane['date_sent']."</td></tr>";
}
// dopasuj nowe kontakty do wiadomosci z instniejacymi juz odbiorcami
$q=mysql_query("select emails.tid,emails.id,rel.email_id,rel.address_type,txt.user_id,txt.to_addrs,txt.from_addr,emails.type,emails.name,us.first_name,us.last_name,emails.date_sent from emails as emails
inner join emails_email_addr_rel as rel on emails.id=rel.email_id
inner join emails_text as txt on txt.email_id=emails.id
inner join users as us on us.id=emails.created_by
where emails.tid is not null and rel.address_type='to' group by rel.email_id having count(rel.email_id)<emails.tid;");
while($dane=mysql_fetch_array($q)){
$emails = get_emails ($dane['from_addr']);
$emails = get_emails ($dane['to_addrs']);
echo "<tr><td><a href='index.php?action=DetailView&module=Emails&record=".$dane['id']."'>".$dane['name']."</a></td><td>".$emails[0]."</td><td>".implode(",", $emails)."</td><td>".$typ."</td><td><a href='index.php?module=Users&action=DetailView&record=".$dane['user_id']."'>".$dane['first_name']." ".$dane['last_name']."</a></td><td>".$dane['date_sent']."</td></tr>";
}
//var_dump($mail->getAttachments());
?>
</table>

View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
$layout_defs['ForContacts'] = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Contacts'),
),
);
?>

View File

@@ -0,0 +1,102 @@
<?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".
********************************************************************************/
$subpanel_layout = array(
'where' => "",
'fill_in_additional_fields' => true,
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name' => array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
'parent_info' => true
),
'status' => array(
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable' => false,
'force_exists' => true,
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified' => array(
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button' => array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button' => array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename' => array(
'usage' => 'query_only',
'force_exists' => true
),
), // end list_fields
);
?>

View File

@@ -0,0 +1,115 @@
<?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".
********************************************************************************/
//$layout_defs['ForQueues'] = array(
// 'top_buttons' => array(
// array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Queues'),
// ),
//);
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Queues'),
),
'where' => "",
'fill_in_additional_fields'=>true,
'list_fields' => array(
/* 'mass_update' => array (
),
*/ 'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '68%',
),
'case_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'case_id',
'target_module' => 'Cases',
'module' => 'Cases',
'vname' => 'LBL_LIST_CASE',
'width' => '20%',
'force_exists'=>true,
'sortable'=>false,
),
'contact_id'=>array(
'usage'=>'query_only',
'force_exists'=>true,
) ,
/* 'parent_name'=>array(
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
'target_record_key' => 'parent_id',
'target_module_key'=>'parent_type',
'widget_class' => 'SubPanelDetailViewLink',
'sortable'=>false,
),*/
'date_modified'=>array(
'vname' => 'LBL_DATE_MODIFIED',
'width' => '10%',
),
/* 'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'parent_id'=>array(
'usage'=>'query_only',
),
'parent_type'=>array(
'usage'=>'query_only',
),
'filename'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
*/
),
);
?>

View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
$layout_defs['ForUsers'] = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
);
?>

View File

@@ -0,0 +1,44 @@
{*
/*********************************************************************************
* 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.email2.composeLayout.charsets = {$emailCharsets};
SUGAR.default_inbound_accnt_id = '{$defaultOutID}';
SUGAR.email2.userPrefs = {$userPrefs};
SUGAR.email2.signatures = {$defaultSignature};
{$tinyMCE}
linkBeans = {$linkBeans};
{$lang}

View File

@@ -0,0 +1,171 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<link rel="stylesheet" type="text/css" href="include/javascript/yui/assets/menu.css" />
<link rel="stylesheet" type="text/css" href="modules/Emails/EmailUI.css" />
{include file="modules/Emails/templates/_baseJsVars.tpl"}
<script type="text/javascript" src='{sugar_getjspath file='include/javascript/tiny_mce/tiny_mce.js'}'></script>
<script type="text/javascript" src='{sugar_getjspath file='include/javascript/sugar_grp_emails.js'}'></script>
<script type="text/javascript" src='{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}'></script>
<script type="text/javascript" language="Javascript">
{include file="modules/Emails/templates/_baseConfigData.tpl"}
var calFormat = '{$calFormat}';
var theme = "{$theme}";
{$quickSearchForAssignedUser}
SUGAR.email2.detailView.qcmodules = {$qcModules};
var isAdmin = {$is_admin};
var loadingSprite = app_strings.LBL_EMAIL_LOADING + " <img src='include/javascript/yui/build/assets/skins/sam/wait.gif' height='14' align='absmiddle'>";
</script>
<div class="email">
<form id="emailUIForm" name="emailUIForm">
<input type="hidden" id="module" name="module" value="Emails">
<input type="hidden" id="action" name="action" value="EmailUIAjax">
<input type="hidden" id="to_pdf" name="to_pdf" value="true">
<input type="hidden" id="emailUIAction" name="emailUIAction">
<input type="hidden" id="mbox" name="mbox">
<input type="hidden" id="uid" name="uid">
<input type="hidden" id="ieId" name="ieId">
<input type="hidden" id="forceRefresh" name="forceRefresh">
<input type="hidden" id="focusFolder" name="focusFolder">
<input type="hidden" id="focusFolderOpen" name="focusFolderOpen">
<input type="hidden" id="sortBy" name="sortBy">
<input type="hidden" id="reverse" name="reverse">
</form>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td NOWRAP style="padding-bottom: 2px;">
<button class="button" id="checkEmailButton" onclick="SUGAR.email2.folders.startEmailAccountCheck();"><img src="themes/default/images/icon_email_check.gif" align="absmiddle" border="0"> {$app_strings.LBL_EMAIL_CHECK}</button>
<button class="button" id="composeButton" onclick="SUGAR.email2.composeLayout.c0_composeNewEmail();"><img src="themes/default/images/icon_email_compose.gif" align="absmiddle" border="0"> {$mod_strings.LNK_NEW_SEND_EMAIL}</button>
<button class="button" id="settingsButton" onclick="SUGAR.email2.settings.showSettings();"><img src="themes/default/images/icon_email_settings.gif" align="absmiddle" border="0"> {$app_strings.LBL_EMAIL_SETTINGS}</button>
</td>
<td NOWRAP align="right" style="padding-bottom: 2px;">
<a href="index.php?module=Administration&action=SupportPortal&view=documentation&version={$sugar_version}&edition={$sugar_flavor}&lang={$current_language}&help_module=Emails&help_action=index&key={$server_unique_key}" width='13' height='13' alt='{$app_strings.LNK_HELP}' border='0' align='absmiddle' target="_blank"></a>
&nbsp;
<a href="index.php?module=Administration&action=SupportPortal&view=documentation&version={$sugar_version}&edition={$sugar_flavor}&lang={$current_language}&help_module=Emails&help_action=index&key={$server_unique_key}" class='utilsLink' target="_blank">{$app_strings.LNK_HELP}</a>
</td>
</tr>
</table>
{include file="modules/Emails/templates/overlay.tpl"}
<div id="emailContextMenu"></div>
<div id="folderContextMenu"></div>
<div id="container" class="email" style="position:relative; height:550px; overflow:hidden;"></div>
<div id="innerLayout" class="yui-hidden"></div>
<div id="listViewLayout" class="yui-hidden"></div>
<div id="settingsDialog"></div>
<!-- Hidden Content -->
<div class="yui-hidden">
<div id="searchTab" style="padding:5px">
{include file="modules/Emails/templates/advancedSearch.tpl"}
</div>
<div id="settings">
{include file="modules/Emails/templates/emailSettings.tpl"}
</div>
<div id="footerLinks" class="yui-hidden"></div>
</div>
<div id="editContact" class="yui-hidden"></div>
<div id="editContactTab" class="yui-hidden"></div>
<div id="editMailingList" class="yui-hidden"></div>
<div id="editMailingListTab" class="yui-hidden"></div>
<!-- for detailView quickCreate() calls -->
<div id="quickCreate"></div>
<div id="quickCreateContent"></div>
<div id="importDialog"></div>
<div id="importDialogContent" ></div>
<div id="relateDialog" ></div>
<div id="relateDialogContent" ></div>
<div id="assignmentDialog" ></div>
<div id="assignmentDialogContent" ></div>
<div id="emailDetailDialog" ></div>
<div id="emailDetailDialogContent" ></div>
<!-- for detailView views -->
<div id="viewDialog"></div>
<div id="viewDialogContent"></div>
<!-- addressBook select -->
{include file="modules/Emails/templates/addressSearchContent.tpl"}
<!-- accounts outbound server dialogue -->
<div id="outboundDialog" class="yui-hidden">
{include file="modules/Emails/templates/outboundDialog.tpl"}
</div>
<!-- accounts edit dialogue -->
<div id="editAccountDialogue" class="yui-hidden">
{include file="modules/Emails/templates/editAccountDialogue.tpl"}
</div>
<div id="testOutboundDialog" class="yui-hidden">
{include file="modules/Emails/templates/outboundDialogTest.tpl"}
</div>
<div id="assignToDiv" class="yui-hidden">
{include file="modules/Emails/templates/assignTo.tpl"}
</div>
<script type="text/javascript" language="Javascript">
enableQS(true);
</script>
</div>

View File

@@ -0,0 +1,57 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<script type="text/javascript" language="Javascript">
var req;
var target;
var flexContentOld = "";
var forcePreview = false;
var inCompose = false;
/* globals for Callback functions */
var email; // AjaxObject.showEmailPreview
var ieId;
var ieName;
var focusFolder;
var meta; // AjaxObject.showEmailPreview
var sendType;
var targetDiv;
var urlBase = 'index.php';
var urlStandard = 'sugar_body_only=true&to_pdf=true&module=Emails&action=EmailUIAjax';
var lazyLoadFolder = null;
</script>

View File

@@ -0,0 +1,37 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
-->
<html><body></body></html>

Some files were not shown because too many files have changed in this diff Show More