public function display()
 {
     require_once "modules/Calendar/CalendarUtils.php";
     $module = $this->view_object_map['currentModule'];
     $_REQUEST['module'] = $module;
     $base = 'modules/' . $module . '/metadata/';
     $source = SugarAutoLoader::existingCustomOne($base . 'editviewdefs.php', $base . 'quickcreatedefs.php');
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], $module);
     $tpl = SugarAutoLoader::existingCustomOne('include/EditView/EditView.tpl');
     $this->ev = new EditView();
     $this->ev->view = "QuickCreate";
     $this->ev->ss = new Sugar_Smarty();
     $this->ev->formName = "CalendarEditView";
     $this->ev->setup($module, $this->bean, $source, $tpl);
     $this->ev->defs['templateMeta']['form']['headerTpl'] = "modules/Calendar/tpls/editHeader.tpl";
     $this->ev->defs['templateMeta']['form']['footerTpl'] = "modules/Calendar/tpls/empty.tpl";
     $this->ev->process(false, "CalendarEditView");
     if (!empty($this->bean->id)) {
         require_once 'include/json_config.php';
         $jsonConfig = new json_config();
         $grJavascript = $jsonConfig->getFocusData($module, $this->bean->id);
     } else {
         $grJavascript = "";
     }
     $jsonArr = array('access' => 'yes', 'module_name' => $this->bean->module_dir, 'record' => $this->bean->id, 'edit' => $this->editable, 'html' => $this->ev->display(false, true), 'gr' => $grJavascript, 'acl' => array('delete' => $this->bean->aclAccess('delete')));
     if (!empty($this->view_object_map['repeatData'])) {
         $jsonArr = array_merge($jsonArr, array("repeat" => $this->view_object_map['repeatData']));
     }
     ob_clean();
     echo json_encode($jsonArr);
 }
Beispiel #2
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     $this->ss->assign('APPLIST', $GLOBALS['app_list_strings']);
     $repeatIntervals = array();
     for ($i = 1; $i <= self::MAX_REPEAT_INTERVAL; $i++) {
         $repeatIntervals[$i] = $i;
     }
     $this->ss->assign("repeat_intervals", $repeatIntervals);
     $fdow = $GLOBALS['current_user']->get_first_day_of_week();
     $dow = array();
     for ($i = $fdow; $i < $fdow + 7; $i++) {
         $dayIndex = $i % 7;
         $dow[] = array("index" => $dayIndex, "label" => $GLOBALS['app_list_strings']['dom_cal_day_short'][$dayIndex + 1]);
     }
     $this->ss->assign('dow', $dow);
     $this->ss->assign('repeatData', json_encode($this->view_object_map['repeatData']));
     parent::display();
 }
Beispiel #3
0
	function display(){
		error_reporting(0);
		require_once('include/json_config.php');
		global $json;
        	$json = getJSONobj();
        	$json_config = new json_config();
        	$GRjavascript = $json_config->getFocusData($_REQUEST['type'], $_REQUEST['record']);
        	ob_clean();
        	echo $GRjavascript;
	}
Beispiel #4
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     parent::display();
 }
Beispiel #5
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS'];
     }
     //if
     parent::display();
 }
    function getQSScripts()
    {
        require_once 'include/json_config.php';
        static $json_config = null;
        if (!isset($json_config)) {
            $json_config = new json_config();
        }
        global $sugar_version, $sugar_config, $theme;
        $qsScripts = '<script type="text/javascript" src="include/JSON.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script><script type="text/javascript">' . $json_config->get_static_json_server() . '</script>
		<script type="text/javascript" src="include/jsolait/init.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>
		<script type="text/javascript" src="include/jsolait/lib/urllib.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>
		<script type="text/javascript" src="include/javascript/jsclass_base.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>
		<script type="text/javascript" src="include/javascript/jsclass_async.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>
		<script type="text/javascript">sqsWaitGif = "themes/' . $theme . '/images/sqsWait.gif";</script>
		<script type="text/javascript" src="include/javascript/quicksearch.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>
		';
        return $qsScripts;
    }
Beispiel #7
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     parent::display();
     echo "<script> showStatus( \$('#status'), 'Meetings' );\n                          \$('#status').change(function(){\n                               showStatus( \$(this), 'Meetings' );\n                          });\n                </script>";
 }
Beispiel #8
0
 public function display()
 {
     require_once "modules/Calendar/CalendarUtils.php";
     $module = $this->view_object_map['currentModule'];
     $_REQUEST['module'] = $module;
     $base = 'modules/' . $module . '/metadata/';
     $source = 'custom/' . $base . 'quickcreatedefs.php';
     if (!file_exists($source)) {
         $source = $base . 'quickcreatedefs.php';
         if (!file_exists($source)) {
             $source = 'custom/' . $base . 'editviewdefs.php';
             if (!file_exists($source)) {
                 $source = $base . 'editviewdefs.php';
             }
         }
     }
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], $module);
     $tpl = $this->getCustomFilePathIfExists('include/EditView/EditView.tpl');
     $this->ev = new EditView();
     $this->ev->view = "QuickCreate";
     $this->ev->ss = new Sugar_Smarty();
     $this->ev->formName = "CalendarEditView";
     $this->ev->setup($module, $this->bean, $source, $tpl);
     $this->ev->defs['templateMeta']['form']['headerTpl'] = "modules/Calendar/tpls/editHeader.tpl";
     $this->ev->defs['templateMeta']['form']['footerTpl'] = "modules/Calendar/tpls/empty.tpl";
     $this->ev->process(false, "CalendarEditView");
     if (!empty($this->bean->id)) {
         require_once 'include/json_config.php';
         global $json;
         $json = getJSONobj();
         $json_config = new json_config();
         $GRjavascript = $json_config->getFocusData($module, $this->bean->id);
     } else {
         $GRjavascript = "";
     }
     $json_arr = array('access' => 'yes', 'module_name' => $this->bean->module_dir, 'record' => $this->bean->id, 'edit' => $this->editable, 'html' => $this->ev->display(false, true), 'gr' => $GRjavascript);
     if ($repeat_arr = CalendarUtils::get_sendback_repeat_data($this->bean)) {
         $json_arr = array_merge($json_arr, array("repeat" => $repeat_arr));
     }
     ob_clean();
     echo json_encode($json_arr);
 }
 function display()
 {
     $users_arr = array();
     require_once "modules/Users/User.php";
     $user_ids = explode(",", trim($_REQUEST['users'], ','));
     $user_ids = array_unique($user_ids);
     require_once 'include/json_config.php';
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     foreach ($user_ids as $u_id) {
         if (empty($u_id)) {
             continue;
         }
         $bean = BeanFactory::getBean('Users', $u_id);
         array_push($users_arr, $json_config->populateBean($bean));
     }
     $GRjavascript = "\n" . $json_config->global_registry_var_name . "['focus'].users_arr = " . $json->encode($users_arr) . ";\n";
     ob_clean();
     echo $GRjavascript;
 }
Beispiel #10
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     $this->ss->assign('remindersData', Reminder::loadRemindersData('Calls', $this->bean->id));
     $this->ss->assign('remindersDataJson', Reminder::loadRemindersDataJson('Calls', $this->bean->id));
     $this->ss->assign('remindersDefaultValuesDataJson', Reminder::loadRemindersDefaultValuesDataJson());
     $this->ss->assign('remindersDisabled', json_encode(false));
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     parent::display();
 }
 /**
  * main displaying function of Calendar
  */
 public function display()
 {
     global $timedate, $current_user;
     $cal =& $this->cal;
     $ss = new Sugar_Smarty();
     $ss->assign('APP', $GLOBALS['app_strings']);
     $ss->assign('APPLIST', $GLOBALS['app_list_strings']);
     $ss->assign('MOD', $GLOBALS['cal_strings']);
     $ss->assign('view', $cal->view);
     $ss->assign('style', $cal->style);
     $ss->assign('t_step', $cal->time_step);
     $ss->assign('current_user_id', $GLOBALS['current_user']->id);
     $ss->assign('current_user_name', $GLOBALS['current_user']->name);
     $ss->assign('time_format', $GLOBALS['timedate']->get_user_time_format());
     $ss->assign('enable_repeat', $this->cal->enable_repeat);
     $ss->assign('items_draggable', SugarConfig::getInstance()->get('calendar.items_draggable', true));
     $ss->assign('items_resizable', SugarConfig::getInstance()->get('calendar.items_resizable', true));
     $ss->assign('cells_per_day', $cal->cells_per_day);
     $ss->assign('activityColors', json_encode($this->checkActivity($this->activity_colors)));
     $ss->assign('dashlet', $cal->dashlet);
     $ss->assign('grid_start_ts', intval($cal->grid_start_ts));
     $ss->assign('year', $cal->date_time->format('Y'));
     $ss->assign('month', $cal->date_time->format('m'));
     $ss->assign('day', $cal->date_time->format('d'));
     $ss->assign('CALENDAR_FORMAT', $GLOBALS['timedate']->get_cal_date_format());
     $ss->assign('CALENDAR_FDOW', $GLOBALS['current_user']->get_first_day_of_week());
     switch ($cal->view) {
         case "agendaDay":
         case "agendaWeek":
         case "sharedMonth":
         case "sharedWeek":
             $height = 650;
             break;
         default:
             $height = 650;
             break;
     }
     $ss->assign('basic_min_height', $height);
     $ss->assign('isPrint', $this->cal->isPrint() ? 'true' : 'false');
     if (count($cal->shared_ids)) {
         $ss->assign('shared_ids', $cal->shared_ids);
         $ss->assign('shared_users_count', count($cal->shared_ids));
     }
     $ss->assign('start_weekday', $GLOBALS['current_user']->get_first_day_of_week());
     $ss->assign('scroll_slot', $this->cal->scroll_slot);
     $ss->assign('editview_width', SugarConfig::getInstance()->get('calendar.editview_width', 800));
     $ss->assign('editview_height', SugarConfig::getInstance()->get('calendar.editview_height', 600));
     $ss->assign('a_str', json_encode($cal->items));
     $start = $current_user->getPreference('day_start_time');
     if (is_null($start)) {
         $start = SugarConfig::getInstance()->get('calendar.default_day_start', "08:00");
     }
     $ss->assign('day_start_time', $start);
     $end = $current_user->getPreference('day_end_time');
     if (is_null($end)) {
         $end = SugarConfig::getInstance()->get('calendar.default_day_end', "19:00");
     }
     $ss->assign('day_end_time', $end);
     $ss->assign('sugar_body_only', isset($_REQUEST['to_pdf']) && $_REQUEST['to_pdf'] || isset($_REQUEST['sugar_body_only']) && $_REQUEST['sugar_body_only']);
     require_once 'include/json_config.php';
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     $ss->assign('GRjavascript', $json_config->get_static_json_server(false, true, 'Meetings'));
     // form
     $user_default_date_start = $timedate->asUser($timedate->getNow());
     $ss->assign('user_default_date_start', $user_default_date_start);
     // end form
     $location_array = "";
     foreach ($this->views as $view) {
         $location_array[] = $view;
     }
     $current_language = explode("_", $GLOBALS['current_language']);
     $ss->assign("langprefix", $current_language[0]);
     $ss->assign('custom_views', $location_array);
     if ($_REQUEST['module'] == "Calendar") {
         $this->load_settings_template($ss);
         $settings = get_custom_file_if_exists("modules/Calendar/tpls/settings.tpl");
         $ss->assign("settings", $settings);
     }
     //mark date format for user.
     $date_format = $this->convertPHPToMomentFormat($GLOBALS['current_user']->getPreference('datef') . " " . $GLOBALS['current_user']->getPreference('timef'));
     $ss->assign('datetime_user_format', $date_format);
     $main = get_custom_file_if_exists("modules/Calendar/tpls/main.tpl");
     $form_tpl = get_custom_file_if_exists("modules/Calendar/tpls/form.tpl");
     $ss->assign("form", $form_tpl);
     if ($this->cal->enable_repeat) {
         $repeat_tpl = get_custom_file_if_exists("modules/Calendar/tpls/repeat.tpl");
         $ss->assign("repeat", $repeat_tpl);
         $repeat_intervals = array();
         for ($i = 1; $i <= 30; $i++) {
             $repeat_intervals[$i] = $i;
         }
         $ss->assign("repeat_intervals", $repeat_intervals);
         $fdow = $GLOBALS['current_user']->get_first_day_of_week();
         $dow = array();
         for ($i = $fdow; $i < $fdow + 7; $i++) {
             $day_index = $i % 7;
             $dow[] = array("index" => $day_index, "label" => $GLOBALS['app_list_strings']['dom_cal_day_short'][$day_index + 1]);
         }
         $ss->assign("dow", $dow);
     }
     echo $ss->fetch($main);
 }
Beispiel #12
0
<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
error_reporting(0);
require_once 'include/json_config.php';
global $json;
$json = getJSONobj();
$json_config = new json_config();
$GRjavascript = $json_config->getFocusData($_REQUEST['type'], $_REQUEST['record']);
ob_clean();
echo $GRjavascript;
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 ********************************************************************************/
/*********************************************************************************
 * 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 'data/Tracker.php';
require_once 'modules/Calls/Call.php';
require_once 'include/time.php';
require_once 'include/json_config.php';
$json_config = new json_config();
global $timedate;
global $app_strings;
global $app_list_strings;
global $current_language;
global $current_user;
global $sugar_version, $sugar_config;
$json = getJSONobj();
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$focus =& new Call();
if (!empty($_REQUEST['record'])) {
    $focus->retrieve($_REQUEST['record']);
}
Beispiel #14
0
* 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 Letrium Inc. at email address crm@letrium.com.
*
* ECalendar, Copyright (C) Letrium Inc., Yuri Kuznetsov.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Letrium" label.
*
*For more information on how to apply and follow the GNU GPL, see http://www.gnu.org/licenses.
********************************************************************************/
$users_arr = array();
require_once "modules/Users/User.php";
$user_ids = explode(",", trim($_REQUEST['users'], ','));
$user_ids = array_unique($user_ids);
require_once 'include/json_config.php';
global $json;
$json = getJSONobj();
$json_config = new json_config();
foreach ($user_ids as $u_id) {
    if (empty($u_id)) {
        continue;
    }
    $bean = new User();
    $bean->retrieve($u_id);
    array_push($users_arr, $json_config->populateBean($bean));
}
$GRjavascript = "\n" . $json_config->global_registry_var_name . "['focus'].users_arr = " . $json->encode($users_arr) . ";\n";
ob_clean();
echo $GRjavascript;
Beispiel #15
0
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
// $Id: Step2.php 45763 2009-04-01 19:16:18Z majed $
/*
 * Created on Oct 4, 2005
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
//require_once('include/utils.php');
require_once 'include/json_config.php';
$json_config = new json_config();
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $current_user;
global $theme;
global $sugar_version, $sugar_config;
$xtpl = new XTemplate('modules/MailMerge/Step2.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign('JSON_CONFIG_JAVASCRIPT', $json_config->get_static_json_server(false, true));
if (isset($_POST['mailmerge_module'])) {
    $_SESSION['MAILMERGE_MODULE'] = $_POST['mailmerge_module'];
    if ($_SESSION['MAILMERGE_MODULE'] == 'Campaigns') {
        $_SESSION['MAILMERGE_MODULE'] = 'CampaignProspects';
    }
 /**
  * main displaying function of Calendar
  */
 public function display()
 {
     global $timedate;
     $cal =& $this->cal;
     $ss = new Sugar_Smarty();
     $ss->assign('APP', $GLOBALS['app_strings']);
     $ss->assign('APPLIST', $GLOBALS['app_list_strings']);
     $ss->assign('MOD', $GLOBALS['cal_strings']);
     $ss->assign('view', $cal->view);
     $ss->assign('t_step', $cal->time_step);
     $ss->assign('current_user_id', $GLOBALS['current_user']->id);
     $ss->assign('current_user_name', $GLOBALS['current_user']->name);
     $ss->assign('time_format', $GLOBALS['timedate']->get_user_time_format());
     $ss->assign('items_draggable', SugarConfig::getInstance()->get('calendar.items_draggable', true));
     $ss->assign('mouseover_expand', SugarConfig::getInstance()->get('calendar.mouseover_expand', true));
     $ss->assign('item_text', 'name');
     $ss->assign('cells_per_day', $cal->cells_per_day);
     $ss->assign('img_edit_inline', SugarThemeRegistry::current()->getImageURL('edit_inline.gif', false));
     $ss->assign('img_view_inline', SugarThemeRegistry::current()->getImageURL('view_inline.gif', false));
     $ss->assign('img_close', SugarThemeRegistry::current()->getImageURL('close.gif', false));
     $ss->assign('dashlet', $cal->dashlet);
     $ss->assign('grid_start_ts', $cal->grid_start_ts);
     $ss->assign('celcount', $cal->celcount);
     if (count($cal->shared_ids)) {
         $ss->assign('shared_ids', $cal->shared_ids);
         $ss->assign('shared_users_count', count($cal->shared_ids));
     }
     $ss->assign('activity_colors', $this->activity_colors);
     $ss->assign('scroll_slot', $this->cal->scroll_slot);
     $ss->assign('editview_width', SugarConfig::getInstance()->get('calendar.editview_width', 800));
     $ss->assign('editview_height', SugarConfig::getInstance()->get('calendar.editview_height', 600));
     $ss->assign('a_str', $cal->get_activities_js());
     $ss->assign('sugar_body_only', isset($_REQUEST['to_pdf']) && $_REQUEST['to_pdf'] || isset($_REQUEST['sugar_body_only']) && $_REQUEST['sugar_body_only']);
     require_once 'include/json_config.php';
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     $ss->assign('GRjavascript', $json_config->get_static_json_server(false, true, 'Meetings'));
     // form
     $user_default_date_start = $timedate->asUser($timedate->getNow());
     $ss->assign('user_default_date_start', $user_default_date_start);
     // end form
     if ($_REQUEST['module'] == "Calendar") {
         $this->load_settings_template($ss);
         $settings = "custom/modules/Calendar/tpls/settings.tpl";
         if (!file_exists($settings)) {
             $settings = "modules/Calendar/tpls/settings.tpl";
         }
         $ss->assign("settings", $settings);
     }
     $main = "custom/modules/Calendar/tpls/main.tpl";
     if (!file_exists($main)) {
         $main = "modules/Calendar/tpls/main.tpl";
     }
     $form_tpl = "custom/modules/Calendar/tpls/form.tpl";
     if (!file_exists($form_tpl)) {
         $form_tpl = "modules/Calendar/tpls/form.tpl";
     }
     $ss->assign("form", $form_tpl);
     echo $ss->fetch($main);
     // drid
     $grid = new CalendarGrid($cal);
     echo $grid->display();
     // end grid
 }
Beispiel #17
0
echo $GLOBALS['mod_strings']['LBL_CANCEL_BUTTON'];
?>
</button>&nbsp;
		</div>
	</div>
	
	<script type="text/javascript" src="include/JSON.js"></script>
	<script type="text/javascript" src="include/jsolait/init.js"></script>
	<script type="text/javascript" src="include/jsolait/lib/urllib.js"></script>

	<script type="text/javascript">	
	<?php 
require_once 'include/json_config.php';
global $json;
$json = getJSONobj();
$json_config = new json_config();
$GRjavascript = $json_config->get_static_json_server(false, true, 'Meetings');
echo $GRjavascript;
?>
	</script>
	
	<script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
	<script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
	<script type="text/javascript" src="modules/Meetings/jsclass_scheduler.js"></script>
	<script>toggle_portal_flag();function toggle_portal_flag()  {  } </script>

	<script type="text/javascript">	
		function fill_invitees() { 
			if (typeof(GLOBAL_REGISTRY) != 'undefined')  {    
				SugarWidgetScheduler.fill_invitees(document.EditView);
			} 
Beispiel #18
0
 /**
  * main displaying function of Calendar
  */
 public function display()
 {
     global $timedate;
     $cal =& $this->cal;
     $ss = new Sugar_Smarty();
     $ss->assign('APP', $GLOBALS['app_strings']);
     $ss->assign('APPLIST', $GLOBALS['app_list_strings']);
     $ss->assign('MOD', $GLOBALS['cal_strings']);
     $ss->assign('view', $cal->view);
     $ss->assign('style', $cal->style);
     $ss->assign('t_step', $cal->time_step);
     $ss->assign('current_user_id', $GLOBALS['current_user']->id);
     $ss->assign('current_user_name', $GLOBALS['current_user']->name);
     $ss->assign('time_format', $GLOBALS['timedate']->get_user_time_format());
     $ss->assign('enable_repeat', $this->cal->enable_repeat);
     $ss->assign('items_draggable', SugarConfig::getInstance()->get('calendar.items_draggable', true));
     $ss->assign('items_resizable', SugarConfig::getInstance()->get('calendar.items_resizable', true));
     $ss->assign('cells_per_day', $cal->cells_per_day);
     $ss->assign('dashlet', $cal->dashlet);
     $ss->assign('grid_start_ts', intval($cal->grid_start_ts));
     $ss->assign('year', $cal->date_time->format('Y'));
     $ss->assign('month', $cal->date_time->format('m'));
     $ss->assign('day', $cal->date_time->format('d'));
     $ss->assign('CALENDAR_FORMAT', $GLOBALS['timedate']->get_cal_date_format());
     $ss->assign('CALENDAR_FDOW', $GLOBALS['current_user']->get_first_day_of_week());
     if ($cal->style == "basic") {
         switch ($cal->view) {
             case "day":
                 $height = 250;
                 break;
             case "week":
                 $height = 250;
                 break;
             case "shared":
                 $height = 100;
                 break;
             default:
                 $height = 80;
                 break;
         }
     } else {
         $height = 20;
     }
     $ss->assign('basic_min_height', $height);
     $ss->assign('isPrint', $this->cal->isPrint() ? 'true' : 'false');
     if (count($cal->shared_ids)) {
         $ss->assign('shared_ids', $cal->shared_ids);
         $ss->assign('shared_users_count', count($cal->shared_ids));
     }
     $ss->assign('activity_colors', $this->activity_colors);
     $ss->assign('scroll_slot', $this->cal->scroll_slot);
     $ss->assign('editview_width', SugarConfig::getInstance()->get('calendar.editview_width', 800));
     $ss->assign('editview_height', SugarConfig::getInstance()->get('calendar.editview_height', 600));
     $ss->assign('a_str', json_encode($cal->items));
     $ss->assign('sugar_body_only', isset($_REQUEST['to_pdf']) && $_REQUEST['to_pdf'] || isset($_REQUEST['sugar_body_only']) && $_REQUEST['sugar_body_only']);
     require_once 'include/json_config.php';
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     $ss->assign('GRjavascript', $json_config->get_static_json_server(false, true, 'Meetings'));
     // form
     $user_default_date_start = $timedate->asUser($timedate->getNow());
     $ss->assign('user_default_date_start', $user_default_date_start);
     // end form
     if ($_REQUEST['module'] == "Calendar") {
         $this->load_settings_template($ss);
         $settings = "custom/modules/Calendar/tpls/settings.tpl";
         if (!file_exists($settings)) {
             $settings = "modules/Calendar/tpls/settings.tpl";
         }
         $ss->assign("settings", $settings);
     }
     $main = "custom/modules/Calendar/tpls/main.tpl";
     if (!file_exists($main)) {
         $main = "modules/Calendar/tpls/main.tpl";
     }
     $form_tpl = "custom/modules/Calendar/tpls/form.tpl";
     if (!file_exists($form_tpl)) {
         $form_tpl = "modules/Calendar/tpls/form.tpl";
     }
     $ss->assign("form", $form_tpl);
     if ($this->cal->enable_repeat) {
         $repeat_tpl = "custom/modules/Calendar/tpls/repeat.tpl";
         if (!file_exists($repeat_tpl)) {
             $repeat_tpl = "modules/Calendar/tpls/repeat.tpl";
         }
         $ss->assign("repeat", $repeat_tpl);
         $repeat_intervals = array();
         for ($i = 1; $i <= 30; $i++) {
             $repeat_intervals[$i] = $i;
         }
         $ss->assign("repeat_intervals", $repeat_intervals);
         $fdow = $GLOBALS['current_user']->get_first_day_of_week();
         $dow = array();
         for ($i = $fdow; $i < $fdow + 7; $i++) {
             $day_index = $i % 7;
             $dow[] = array("index" => $day_index, "label" => $GLOBALS['app_list_strings']['dom_cal_day_short'][$day_index + 1]);
         }
         $ss->assign("dow", $dow);
     }
     echo $ss->fetch($main);
     // grid
     $grid = new CalendarGrid($cal);
     echo $grid->display();
     // end grid
 }
 public function display()
 {
     require_once "modules/Calendar/CalendarUtils.php";
     $module = $_REQUEST['current_module'];
     $_REQUEST['module'] = $module;
     $base = 'modules/' . $module . '/metadata/';
     $source = 'custom/' . $base . 'quickcreatedefs.php';
     if (!file_exists($source)) {
         $source = $base . 'quickcreatedefs.php';
         if (!file_exists($source)) {
             $source = 'custom/' . $base . 'editviewdefs.php';
             if (!file_exists($source)) {
                 $source = $base . 'editviewdefs.php';
             }
         }
     }
     $tpl = "custom/include/EditView/EditView.tpl";
     if (!file_exists($tpl)) {
         $tpl = "include/EditView/EditView.tpl";
     }
     $this->ev = new EditView();
     $this->ev->view = "QuickCreate";
     $this->ev->ss = new Sugar_Smarty();
     $this->ev->formName = "CalendarEditView";
     $this->ev->setup($module, $this->bean, $source, $tpl);
     $this->ev->defs['templateMeta']['form']['headerTpl'] = "modules/Calendar/tpls/empty.tpl";
     $this->ev->defs['templateMeta']['form']['footerTpl'] = "modules/Calendar/tpls/empty.tpl";
     $this->ev->process(false, "CalendarEditView");
     if (!empty($this->bean->id)) {
         require_once 'include/json_config.php';
         global $json;
         $json = getJSONobj();
         $json_config = new json_config();
         $GRjavascript = $json_config->getFocusData($module, $this->bean->id);
     } else {
         $GRjavascript = "";
     }
     $json_arr = array('success' => 'yes', 'module_name' => $this->bean->module_dir, 'record' => $this->bean->id, 'edit' => $this->editable, 'html' => $this->ev->display(false, true), 'gr' => $GRjavascript);
     ob_clean();
     echo json_encode($json_arr);
 }