Exemplo n.º 1
0
 * 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/SugarTinyMCE.php';
require_once 'modules/Users/UserSignature.php';
global $app_strings;
global $app_list_strings;
global $curent_language;
$mod_strings = return_module_language($current_language, $currentModule);
$focus = new UserSignature();
if (isset($_REQUEST['record']) && !empty($_REQUEST['record'])) {
    $focus->retrieve($_REQUEST['record']);
}
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
    $focus->id = "";
}
$GLOBALS['log']->info('EmailTemplate detail view');
///////////////////////////////////////////////////////////////////////////////
////	OUTPUT
echo insert_popup_header();
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SIGNATURE'] . ' ' . $focus->name, true);
$xtpl = new XTemplate('modules/Users/UserSignatureEditView.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('CANCEL_SCRIPT', 'window.close()');
Exemplo n.º 2
0
 case "getSignature":
     $GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: getSignature");
     if (isset($_REQUEST['id'])) {
         $signature = $current_user->getSignature($_REQUEST['id']);
         $signature['signature_html'] = from_html($signature['signature_html']);
         $out = $json->encode($signature);
         echo $out;
     } else {
         die;
     }
     break;
 case "deleteSignature":
     $GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: deleteSignature");
     if (isset($_REQUEST['id'])) {
         require_once "modules/Users/UserSignature.php";
         $us = new UserSignature();
         $us->mark_deleted($_REQUEST['id']);
         $signatureArray = $current_user->getSignaturesArray();
         // clean "none"
         foreach ($signatureArray as $k => $v) {
             if ($k == "") {
                 $sigs[$k] = $app_strings['LBL_NONE'];
             } else {
                 if (is_array($v) && isset($v['name'])) {
                     $sigs[$k] = $v['name'];
                 } else {
                     $sigs[$k] = $v;
                 }
             }
         }
         $out['signatures'] = $signatureArray;
Exemplo n.º 3
0
 * 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 ********************************************************************************/
require_once 'modules/Users/UserSignature.php';
global $current_user;
$us = new UserSignature();
if (isset($_REQUEST['record']) && !empty($_REQUEST['record'])) {
    $us->retrieve($_REQUEST['record']);
} else {
    $us->id = create_guid();
    $us->new_with_id = true;
}
$us->name = $_REQUEST['name'];
$us->signature = strip_tags(br2nl(from_html($_REQUEST['description'])));
$us->signature_html = $_REQUEST['description'];
if (empty($us->user_id) && isset($_REQUEST['the_user_id'])) {
    $us->user_id = $_REQUEST['the_user_id'];
} else {
    $us->user_id = $current_user->id;
}
//_pp($_REQUEST);
if (isset($mail_sendtype) && $mail_sendtype == 'SMTP') {
    $xtpl->assign('MAIL_SMTPSERVER', $focus->getPreference('mail_smtpserver'));
    $xtpl->assign('MAIL_SMTPPORT', $focus->getPreference('mail_smtpport'));
    $xtpl->assign('MAIL_SMTPAUTH', $focus->getPreference('mail_smtpauth'));
    $mail_smtpauth = $focus->getPreference('mail_smtpauth_req');
    if ($focus->getPreference('mail_smtpauth_req')) {
        $xtpl->assign('MAIL_SMTPUSER', $focus->getPreference('mail_smtpuser'));
        $xtpl->assign('MAIL_SMTPAUTH_REQ', ' checked');
        $xtpl->parse('user_info.show_smtp.show_smtp_auth');
    }
    $xtpl->parse('user_info.show_smtp');
}
//_ppd($focus->getPreference('signature_prepend'));
if ($sigDef = $focus->getPreference('signature_default')) {
    require_once 'modules/Users/UserSignature.php';
    $sig = new UserSignature();
    $sig->retrieve($sigDef);
    if ($focus->getPreference('email_editor_option') == 'PLAIN') {
        $xtpl->assign('DEFAULT_SIGNATURE', $sig->signature);
    } else {
        $xtpl->assign('DEFAULT_SIGNATURE', from_html($sig->signature_html));
    }
}
$getCounts = $focus->getPreference('email_show_counts');
if (empty($getCounts)) {
    $getCounts = 0;
}
$xtpl->assign('EMAIL_EDITOR_OPTION', $app_list_strings['dom_email_editor_option'][$focus->getPreference('email_editor_option')]);
$xtpl->assign('SIGNATURE_PREPEND', $app_list_strings['dom_switch_bool'][$focus->getPreference('signature_prepend')]);
$xtpl->assign('EMAIL_SHOW_COUNTS', $app_list_strings['dom_int_bool'][$getCounts]);
$xtpl->assign('EMAIL_LINK_TYPE', $app_list_strings['dom_email_link_type'][$focus->getPreference('email_link_type')]);