コード例 #1
0
ファイル: view.edit.php プロジェクト: jglaine/sugar761-ent
 public function display()
 {
     // Disable VCR Control
     $this->ev->showVCRControl = false;
     // Default Team as Global
     if (empty($this->bean->id) && !$this->ev->isDuplicate) {
         $this->bean->team_id = 1;
         $this->bean->team_set_id = 1;
     }
     // Load TinyMCE
     require_once 'include/SugarTinyMCE.php';
     $tiny = new SugarTinyMCE();
     $tiny->defaultConfig['apply_source_formatting'] = true;
     $tiny->defaultConfig['cleanup_on_startup'] = true;
     $tiny->defaultConfig['relative_urls'] = false;
     $tiny->defaultConfig['convert_urls'] = false;
     $ed = $tiny->getInstance('body_html');
     $this->ss->assign('tiny_script', $ed);
     // Load Fields for main module
     if (empty($this->bean->base_module)) {
         $modulesList = PdfManagerHelper::getAvailableModules();
         $this->bean->base_module = key($modulesList);
     }
     $fieldsForSelectedModule = PdfManagerHelper::getFields($this->bean->base_module, true);
     $this->ss->assign('fieldsForSelectedModule', $fieldsForSelectedModule);
     parent::display();
 }
コード例 #2
0
/**
 * 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".
 */
function get_body(&$ss, $vardef)
{
    $edit_mod_strings = return_module_language($GLOBALS['current_language'], 'EditCustomFields');
    $ss->assign('MOD', $edit_mod_strings);
    if (!empty($cf)) {
        $ss->assign('cf', $cf);
    }
    ///////////////////////////////////
    require_once 'include/SugarTinyMCE.php';
    $tiny = new SugarTinyMCE();
    $tiny->defaultConfig['width'] = 300;
    $tiny->defaultConfig['height'] = 300;
    $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,\n                         justifyfull,separator,forecolor,backcolor,\n                         ";
    $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
    $tiny->buttonConfig3 = "";
    $ed = $tiny->getInstance('htmlarea');
    $ss->assign("tiny", $ed);
    $edValue = '';
    if (!empty($vardef['default_value'])) {
        $edValue = $vardef['default_value'];
        $edValue = str_replace(array("\r\n", "\n"), " ", $edValue);
    }
    $ss->assign('HTML_EDITOR', $edValue);
    $ss->assign('preSave', 'document.popup_form.presave();');
    ///////////////////////////////////
    return $ss->fetch('modules/DynamicFields/templates/Fields/Forms/html.tpl');
}
コード例 #3
0
 public static function setUpBeforeClass()
 {
     if (file_exists(self::$customConfigFile)) {
         rename(self::$customConfigFile, self::$customConfigFile . ".bak");
     }
     if (file_exists(self::$customDefaultConfigFile)) {
         rename(self::$customDefaultConfigFile, self::$customDefaultConfigFile . ".bak");
     }
     file_put_contents(self::$customConfigFile, "<?php\n\t\t\t\$buttonConfigs = array('default' => array('buttonConfig' =>'testcase',\n\t\t\t\t\t\t\t\t\t'buttonConfig2' => 'cut,copy,paste,pastetext,pasteword,selectall,separator,search,replace,separator,bullist,numlist,separator,outdent,\n\t                     \t\t\t\t\tindent,separator,ltr,rtl,separator,undo,redo,separator, link,unlink,anchor,image,separator,sub,sup,separator,charmap,\n\t                     \t\t\t\t\tvisualaid', \n\t                    \t\t\t'buttonConfig3' => 'tablecontrols,separator,advhr,hr,removeformat,separator,insertdate,inserttime,separator,preview'),\n\t\t\t\t\t\t\t\t\t'badkey1' => 'bad data1');\n\t\t\t?>");
     file_put_contents(self::$customDefaultConfigFile, "<?php\n\t\t\t\$defaultConfig = array('extended_valid_elements' => 'upload[testlength|ratio|initialtest|mintestsize|threads|maxchunksize|maxchunkcount],download[testlength|initialtest|mintestsize|threads|maximagesize]',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'badkey2' => 'bad data2');\n\t\t\t?>");
     $tinySugar = new SugarTinyMCE();
     self::$MCE = $tinySugar->getInstance();
 }
コード例 #4
0
ファイル: view.edit.php プロジェクト: auf/crm_auf_org
 function display(){
     parent::display();
     global $sugar_config;
     $new = empty($this->bean->id);
     if($new){
         ?>
         <script>
             $(document).ready(function(){
                 $('#update_text').closest('td').html('');
                 $('#update_text_label').closest('td').html('');
                 $('#internal').closest('td').html('');
                 $('#internal_label').closest('td').html('');
                 $('#addFileButton').closest('td').html('');
                 $('#case_update_form_label').closest('td').html('');
             });
         </script>
     <?php
     }
     $tiny = new SugarTinyMCE();
     echo $tiny->getInstance('update_text,description', 'email_compose_light');
 }
コード例 #5
0
ファイル: EditView.php プロジェクト: sysraj86/carnivalcrm
    $xtpl->assign("BODY", $focus->body);
} else {
    $xtpl->assign("BODY", "");
}
if (isset($focus->body_html)) {
    $xtpl->assign("BODY_HTML", $focus->body_html);
} else {
    $xtpl->assign("BODY_HTML", "");
}
if (true) {
    if (!isTouchScreen()) {
        require_once "include/SugarTinyMCE.php";
        $tiny = new SugarTinyMCE();
        $tiny->defaultConfig['cleanup_on_startup'] = true;
        $tiny->defaultConfig['height'] = 600;
        $tinyHtml = $tiny->getInstance();
        $xtpl->assign("tiny", $tinyHtml);
    }
    ///////////////////////////////////////
    ////	MACRO VARS
    $xtpl->assign("INSERT_VARIABLE_ONCLICK", "insert_variable(document.EditView.variable_text.value)");
    if (!$inboundEmail) {
        $xtpl->parse("main.NoInbound.variable_button");
    }
    ///////////////////////////////////////
    ////	CAMPAIGNS
    if ($has_campaign || $inboundEmail) {
        $xtpl->assign("INPOPUPWINDOW", 'true');
        $xtpl->assign("INSERT_URL_ONCLICK", "insert_variable_html_link(document.EditView.tracker_url.value)");
        if ($has_campaign) {
            $campaign_urls = get_campaign_urls($_REQUEST['campaign_id']);
コード例 #6
0
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('CANCEL_SCRIPT', 'window.close()');
if (isset($_REQUEST['return_module'])) {
    $xtpl->assign('RETURN_MODULE', $_REQUEST['return_module']);
}
if (isset($_REQUEST['return_action'])) {
    $xtpl->assign('RETURN_ACTION', $_REQUEST['return_action']);
}
if (isset($_REQUEST['return_id'])) {
    $xtpl->assign('RETURN_ID', $_REQUEST['return_id']);
}
// handle Create $module then Cancel
if (empty($_REQUEST['return_id'])) {
    $xtpl->assign('RETURN_ACTION', 'index');
}
$xtpl->assign('INPOPUPWINDOW', 'true');
$xtpl->assign('PRINT_URL', 'index.php?' . $GLOBALS['request_string']);
$xtpl->assign('JAVASCRIPT', get_set_focus_js());
$xtpl->assign('ID', $focus->id);
$xtpl->assign('NAME', $focus->name);
$xtpl->assign('SIGNATURE_TEXT', !empty($focus->signature_html) ? $focus->signature_html : $focus->signature);
if (isset($_REQUEST['the_user_id'])) {
    $xtpl->assign('THE_USER_ID', $_REQUEST['the_user_id']);
}
$tiny = new SugarTinyMCE();
$xtpl->assign("tinyjs", $tiny->getInstance('sigText'));
$xtpl->parse('main.textarea');
//Add Custom Fields
$xtpl->parse('main');
$xtpl->out('main');
コード例 #7
0
ファイル: view.main.php プロジェクト: klr2003/sourceread
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme;
     if (is_dir("themes/{$theme}/ext/resources/css")) {
         $cssDir = opendir("themes/{$theme}/ext/resources/css");
     }
     $smarty = new Sugar_Smarty();
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main';
     $mbt = false;
     $admin = false;
     $mb = strtolower($type);
     $smarty->assign('TYPE', $type);
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     //Replaced by javascript function "setMode"
     switch ($type) {
         case 'studio':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
             require_once 'modules/ModuleBuilder/Module/StudioTree.php';
             $mbt = new StudioTree();
             break;
         case 'mb':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
             require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
             $mbt = new MBPackageTree();
             break;
         case 'dropdowns':
             // $admin = is_admin($current_user);
             require_once 'modules/ModuleBuilder/Module/DropDownTree.php';
             $mbt = new DropDownTree();
             break;
         default:
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');
             require_once 'modules/ModuleBuilder/Module/MainTree.php';
             $mbt = new MainTree();
     }
     $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
     $smarty->assign('ADMIN', is_admin($current_user));
     $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
     if ($mbt) {
         $smarty->assign('TREE', $mbt->fetch());
         $smarty->assign('TREElabel', $mbt->getName());
     }
     $userPref = $current_user->getPreference('mb_assist', 'Assistant');
     if (!$userPref) {
         $userPref = "na";
     }
     $smarty->assign('userPref', $userPref);
     ///////////////////////////////////
     require_once 'include/SugarTinyMCE.php';
     $tiny = new SugarTinyMCE();
     $tiny->defaultConfig['width'] = 300;
     $tiny->defaultConfig['height'] = 300;
     $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,\n\t                         justifyfull,separator,forecolor,backcolor,\n\t                         ";
     $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
     $tiny->buttonConfig3 = "";
     $ed = $tiny->getInstance();
     $smarty->assign("tiny", $ed);
     $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
 }
コード例 #8
0
} else {
    $xtpl->assign("BODY", "");
}
if (isset($focus->body_html)) {
    $xtpl->assign("BODY_HTML", $focus->body_html);
} else {
    $xtpl->assign("BODY_HTML", "");
}
//////////////////////////////////
require_once 'include/SugarTinyMCE.php';
$tiny = new SugarTinyMCE();
$tiny->defaultConfig['apply_source_formatting'] = true;
$tiny->defaultConfig['cleanup_on_startup'] = true;
$tiny->defaultConfig['relative_urls'] = false;
$tiny->defaultConfig['convert_urls'] = false;
$ed = $tiny->getInstance('body_text');
$xtpl->assign("tiny", $ed);
$edValue = $focus->body_html;
$xtpl->assign("HTMLAREA", $edValue);
$xtpl->parse("main.htmlarea");
//////////////////////////////////
//Add Custom Fields
require_once 'modules/DynamicFields/templates/Files/EditView.php';
/*
Only allowed the related module dynamic fields 
if the config setting "show_related" in this file is set to true
*/
if ($show_related == true) {
    $xtpl->parse("main.special");
    $xtpl->parse("main.special2");
}
コード例 #9
0
if (isset($Web_To_Lead_Form_html)) {
    $xtpl->assign("BODY", $Web_To_Lead_Form_html);
} else {
    $xtpl->assign("BODY", "");
}
if (isset($Web_To_Lead_Form_html)) {
    $xtpl->assign("BODY_HTML", $Web_To_Lead_Form_html);
} else {
    $xtpl->assign("BODY_HTML", "");
}
require_once 'include/SugarTinyMCE.php';
$tiny = new SugarTinyMCE();
$tiny->defaultConfig['height'] = 400;
$tiny->defaultConfig['apply_source_formatting'] = true;
$tiny->defaultConfig['cleanup'] = false;
$ed = $tiny->getInstance('body_html');
$xtpl->assign("tiny", $ed);
$xtpl->parse("main.textarea");
$xtpl->assign("INSERT_VARIABLE_ONCLICK", "insert_variable_html(document.EditView.variable_text.value)");
$xtpl->parse("main.variable_button");
$xtpl->parse("main");
$xtpl->out("main");
function ifRadioButton($customFieldName)
{
    $custRow = null;
    $query = "select id,type from fields_meta_data where deleted = 0 and name = '{$customFieldName}'";
    $result = $GLOBALS['db']->query($query);
    $row = $GLOBALS['db']->fetchByAssoc($result);
    if ($row != null && $row['type'] == 'radioenum') {
        return $custRow = $row;
    }
コード例 #10
0
 function setup($parentFieldArray, $vardef, $displayParams, $tabindex, $twopass = true)
 {
     parent::setup($parentFieldArray, $vardef, $displayParams, $tabindex, $twopass);
     $editor = "";
     if ($vardef['editor'] == "html") {
         if (!isset($displayParams['htmlescape'])) {
             $displayParams['htmlescape'] = false;
         }
         if ($_REQUEST['action'] == "EditView") {
             require_once "include/SugarTinyMCE.php";
             $tiny = new SugarTinyMCE();
             $editor = $tiny->getInstance($vardef['name'], 'email_compose_light');
         }
         $this->ss->assign("tinymce", $editor);
     } else {
         $this->ss->assign("tinymce", $editor);
     }
 }
コード例 #11
0
ファイル: EditView.php プロジェクト: rgauss/sugarcrm_dev
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);