2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
38 <link type="text/css" href="modules/Calendar/Cal.css" rel="stylesheet" />
39 <script type="text/javascript" src="modules/Calendar/Cal.js"></script>
40 <script type="text/javascript">
43 YAHOO.util.Event.onDOMReady(function(){
47 function check_cal_loaded(){
48 return (typeof cal_loaded != 'undefined' && cal_loaded == true && typeof dom_loaded != 'undefined' && dom_loaded == true);
52 SUGAR.util.doWhen(check_cal_loaded, function(){literal}{{/literal}
55 CAL.style = "{$style}";
56 CAL.t_step = {$t_step};
57 CAL.current_user_id = "{$current_user_id}";
58 CAL.current_user_name = "{$current_user_name}";
59 CAL.time_format = "{$time_format}";
60 CAL.items_draggable = "{$items_draggable}";
61 CAL.item_text = "{$item_text}";
62 CAL.mouseover_expand = "{$mouseover_expand}";
64 CAL.cells_per_day = {$cells_per_day};
65 CAL.current_params = {literal}{}{/literal};
66 CAL.dashlet = "{$dashlet}";
68 CAL.grid_start_ts = {$grid_start_ts};
69 CAL.scroll_slot = {$scroll_slot};
71 CAL.lbl_create_new = "{$MOD.LBL_CREATE_NEW_RECORD}";
72 CAL.lbl_edit = "{$MOD.LBL_EDIT_RECORD}";
73 CAL.lbl_saving = "{$MOD.LBL_SAVING}";
74 CAL.lbl_loading = "{$MOD.LBL_LOADING}";
75 CAL.lbl_confirm_remove = "{$MOD.LBL_CONFIRM_REMOVE}";
76 CAL.lbl_error_saving = "{$MOD.LBL_ERROR_SAVING}";
77 CAL.lbl_error_loading = "{$MOD.LBL_ERROR_LOADING}";
78 CAL.lbl_another_browser = "{$MOD.LBL_ANOTHER_BROWSER}";
79 CAL.lbl_remove_participants = "{$MOD.LBL_REMOVE_PARTICIPANTS}";
80 CAL.lbl_desc = "{$MOD.LBL_INFO_DESC}";
81 CAL.lbl_start = "{$MOD.LBL_INFO_START_DT}";
82 CAL.lbl_due = "{$MOD.LBL_INFO_DUE_DT}";
83 CAL.lbl_duration = "{$MOD.LBL_INFO_DURATION}";
84 CAL.lbl_name = "{$MOD.LBL_INFO_NAME}";
85 CAL.lbl_title = "{$MOD.LBL_INFO_TITLE}";
86 CAL.lbl_related = "{$MOD.LBL_INFO_RELATED_TO}";
87 CAL.lbl_hours_abbrev = "{$MOD.LBL_HOURS_ABBREV}";
88 CAL.lbl_mins_abbrev = "{$MOD.LBL_MINS_ABBREV}";
90 CAL.img_edit_inline = "{$img_edit_inline}";
91 CAL.img_view_inline = "{$img_view_inline}";
92 CAL.img_close = "{$img_close}";
96 var scrollable = CAL.get("cal-scrollable");
98 scrollable.scrollTop = 15 * CAL.scroll_slot;
102 {if $view == "shared"}
103 {counter name="un" start=0 print=false assign="un"}
104 {foreach name="shared" from=$shared_ids key=k item=member_id}
105 CAL.shared_users['{$member_id}'] = '{$un}';
106 {counter name="un" print=false}
108 CAL.shared_users_count = "{$shared_users_count}";
111 CAL.field_list = new Array();
112 CAL.field_disabled_list = new Array();
114 CAL.activity_colors = [];
115 {foreach name=colors from=$activity_colors key=module item=v}
116 CAL.activity_colors['{$module}'] = [];
117 CAL.activity_colors['{$module}']['border'] = '{$v.border}';
118 CAL.activity_colors['{$module}']['body'] = '{$v.body}'
122 CAL.act_types['Meetings'] = 'meeting';
123 CAL.act_types['Calls'] = 'call';
124 CAL.act_types['Tasks'] = 'task';
128 if(CAL.items_draggable){
129 var target_slots = [];
130 var slots = CAL.query('#cal-grid div.slot');
134 target_slots[i] = new YAHOO.util.DDTarget(slots[i].id,"cal");
139 var nodes = CAL.query("#cal-grid div.slot");
140 CAL.each(nodes, function(i,v){
141 YAHOO.util.Event.on(nodes[i],"mouseover",function(){
142 if(CAL.records_openable)
143 this.style.backgroundColor = "#D1DCFF";
144 if(!this.childNodes.length)
145 this.setAttribute("title",this.getAttribute("time"));
147 YAHOO.util.Event.on(nodes[i],"mouseout",function(){
148 this.style.backgroundColor = "";
149 this.removeAttribute("title");
151 YAHOO.util.Event.on(nodes[i],"click",function(){
152 if(!CAL.disable_creating){
153 CAL.dialog_create(this);
158 CAL.init_edit_dialog(
160 width: "{/literal}{$editview_width}{literal}",
161 height: "{/literal}{$editview_height}{literal}"
165 YAHOO.util.Event.on(window, 'resize', function(){
169 YAHOO.util.Event.on("btn-save","click",function(){
170 if(!(check_form('CalendarEditView') && cal_isValidDuration()))
175 YAHOO.util.Event.on("btn-send-invites","click",function(){
176 if(!(check_form('CalendarEditView') && cal_isValidDuration()))
178 CAL.get("send_invites").value = "1";
183 YAHOO.util.Event.on("btn-apply","click",function(){
184 if(!(check_form('CalendarEditView') && cal_isValidDuration()))
189 YAHOO.util.Event.on("btn-delete","click",function(){
190 if(CAL.get("record").value != "")
191 if(confirm(CAL.lbl_confirm_remove))
196 YAHOO.util.Event.on("btn-cancel","click",function(){
197 CAL.editDialog.cancel();
200 CAL.select_tab("cal-tab-1");
202 YAHOO.util.Event.on(CAL.get("btn-cancel-settings"), 'click', function(){
203 CAL.settingsDialog.cancel();
206 YAHOO.util.Event.on(CAL.get("btn-save-settings"), 'click', function(){
207 CAL.get("form_settings").submit();
212 var calendar_items = [
217 CAL.each(calendar_items, function(i,v){
218 CAL.add_item_to_grid(calendar_items[i]);
230 <div id="cal-edit" style="display: none;">
232 <div class="hd"><span id="title-cal-edit"></span></div>
233 <div class="bd" id="edit-dialog-content">
234 <div id="cal-tabs" class="yui-navset yui-navset-top yui-content" style="height: auto; padding: 0 2px;">
236 <li id="tab_general"><a tabname="cal-tab-1"><em>{$MOD.LBL_GENERAL_TAB}</em></a></li>
237 <li id="tab_invitees"><a tabname="cal-tab-2"><em>{$MOD.LBL_PARTICIPANTS_TAB}</em></a></li>
239 <div id="cal-tab-1" class="yui-content">
242 <div id="cal-tab-2" class="yui-content">
243 <div class="h3Row" id="scheduler"></div>
247 <div id="cal-edit-buttons" class="ft">
248 <button id="btn-save" class="button" type="button">{$MOD.LBL_SAVE_BUTTON}</button>
249 <button id="btn-delete" class="button" type="button">{$MOD.LBL_DELETE_BUTTON}</button>
250 <button id="btn-apply" class="button" type="button">{$MOD.LBL_APPLY_BUTTON}</button>
251 <button id="btn-send-invites" class="button" type="button">{$MOD.LBL_SEND_INVITES}</button>
252 <button id="btn-cancel" class="button" type="button" style="float: right;">{$MOD.LBL_CANCEL_BUTTON}</button>
257 {include file=$settings}
260 <script type="text/javascript">
264 <script type="text/javascript">
266 YAHOO.util.Event.onDOMReady(function(){
267 var schedulerLoader = new YAHOO.util.YUILoader({
268 require : ["jsclass_scheduler"],
269 onSuccess: function(){
270 var root_div = document.getElementById('scheduler');
271 var sugarContainer_instance = new SugarContainer(document.getElementById('scheduler'));
272 sugarContainer_instance.start(SugarWidgetScheduler);
275 schedulerLoader.addModule({
276 name :"jsclass_scheduler",
278 fullpath: "modules/Meetings/jsclass_scheduler.js",
279 varName: "global_rpcClient",
282 schedulerLoader.insert();
287 <script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
288 <script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
289 <script type="text/javascript" src="include/javascript/overlibmws.js"></script>
291 <style type="text/css">
299 <style type="text/css">
301 .day_col, .left_time_col{
302 border-top: 1px solid silver;