2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 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.enable_repeat = "{$enable_repeat}";
61 CAL.items_draggable = "{$items_draggable}";
62 CAL.items_resizable = "{$items_resizable}";
63 CAL.cells_per_day = {$cells_per_day};
64 CAL.current_params = {literal}{}{/literal};
65 CAL.dashlet = "{$dashlet}";
66 CAL.grid_start_ts = {$grid_start_ts};
67 CAL.scroll_slot = {$scroll_slot};
68 CAL.basic.min_height = {$basic_min_height};
70 CAL.lbl_create_new = "{$MOD.LBL_CREATE_NEW_RECORD}";
71 CAL.lbl_edit = "{$MOD.LBL_EDIT_RECORD}";
72 CAL.lbl_saving = "{$MOD.LBL_SAVING}";
73 CAL.lbl_loading = "{$MOD.LBL_LOADING}";
74 CAL.lbl_sending = "{$MOD.LBL_SENDING_INVITES}";
75 CAL.lbl_confirm_remove = "{$MOD.LBL_CONFIRM_REMOVE}";
76 CAL.lbl_confirm_remove_all_recurring = "{$MOD.LBL_CONFIRM_REMOVE_ALL_RECURRING}";
78 CAL.lbl_error_saving = "{$MOD.LBL_ERROR_SAVING}";
79 CAL.lbl_error_loading = "{$MOD.LBL_ERROR_LOADING}";
80 CAL.lbl_repeat_limit_error = "{$MOD.LBL_REPEAT_LIMIT_ERROR}";
86 CAL.print = {$isPrint};
89 var scrollable = CAL.get("cal-scrollable");
91 scrollable.scrollTop = (CAL.slot_height + 1) * CAL.scroll_slot - 1;
93 scrollable.scrollTop++;
97 {if $view == "shared"}
98 {counter name="un" start=0 print=false assign="un"}
99 {foreach name="shared" from=$shared_ids key=k item=member_id}
100 CAL.shared_users['{$member_id}'] = '{$un}';
101 {counter name="un" print=false}
103 CAL.shared_users_count = "{$shared_users_count}";
106 CAL.field_list = new Array();
107 CAL.field_disabled_list = new Array();
109 CAL.activity_colors = [];
110 {foreach name=colors from=$activity_colors key=module item=v}
111 CAL.activity_colors['{$module}'] = [];
112 CAL.activity_colors['{$module}']['border'] = '{$v.border}';
113 CAL.activity_colors['{$module}']['body'] = '{$v.body}'
117 CAL.act_types['Meetings'] = 'meeting';
118 CAL.act_types['Calls'] = 'call';
119 CAL.act_types['Tasks'] = 'task';
123 if(CAL.items_draggable){
124 var target_slots = [];
125 var slots = CAL.query('#cal-grid div.slot');
130 target_slots[i] = new YAHOO.util.DDTarget(slots[i].id,"cal");
134 slots = CAL.query('#cal-grid div.basic_slot');
138 target_slots[cnt + i] = new YAHOO.util.DDTarget(slots[i].id,"basic_cal");
143 var nodes = CAL.query("#cal-grid div.slot, #cal-grid div.basic_slot");
144 CAL.each(nodes, function(i,v){
145 YAHOO.util.Event.on(nodes[i],"mouseover",function(){
146 if(CAL.records_openable && !CAL.disable_creating)
147 this.style.backgroundColor = "#D1DCFF";
148 if(!this.childNodes.length)
149 this.setAttribute("title",this.getAttribute("time"));
151 YAHOO.util.Event.on(nodes[i],"mouseout",function(){
152 this.style.backgroundColor = "";
153 this.removeAttribute("title");
155 YAHOO.util.Event.on(nodes[i],"click",function(){
156 if(!CAL.disable_creating){
157 CAL.dialog_create(this);
162 CAL.init_edit_dialog({
163 width: "{/literal}{$editview_width}{literal}",
164 height: "{/literal}{$editview_height}{literal}"
167 YAHOO.util.Event.on(window, 'resize', function(){
169 CAL.update_dd.fire();
172 YAHOO.util.Event.on("btn-save","click",function(){
173 if(!CAL.check_forms())
178 YAHOO.util.Event.on("btn-send-invites","click",function(){
179 if(!CAL.check_forms())
181 CAL.get("send_invites").value = "1";
185 YAHOO.util.Event.on("btn-delete","click",function(){
186 if(CAL.get("record").value != "")
187 if(confirm(CAL.lbl_confirm_remove))
192 YAHOO.util.Event.on("btn-cancel","click",function(){
193 document.schedulerwidget.reset();
194 if(document.getElementById('empty-search-message')) {
195 document.getElementById('empty-search-message').style.display = 'none';
197 CAL.editDialog.cancel();
200 YAHOO.util.Event.on("btn-full-form","click",function(){
204 CAL.select_tab("cal-tab-1");
206 YAHOO.util.Event.on(CAL.get("btn-cancel-settings"), 'click', function(){
207 CAL.settingsDialog.cancel();
210 YAHOO.util.Event.on(CAL.get("btn-save-settings"), 'click', function(){
211 CAL.get("form_settings").submit();
216 var calendar_items = {$a_str};
219 CAL.each(calendar_items, function(i,v){
220 CAL.add_item_to_grid(calendar_items[i]);
225 CAL.arrange_advanced();
226 CAL.basic.populate_grid();
228 CAL.update_dd.fire();
235 <div id="cal-edit" style="display: none;">
237 <div class="hd"><span id="title-cal-edit"></span></div>
238 <div class="bd" id="edit-dialog-content">
239 <div id="cal-tabs" class="yui-navset yui-navset-top yui-content" style="height: auto; padding: 0 2px;">
241 <li id="tab_general"><a tabname="cal-tab-1" id="cal-tab-1-link"><em>{$MOD.LBL_GENERAL_TAB}</em></a></li>
242 <li id="tab_invitees"><a tabname="cal-tab-2" id="cal-tab-2-link"><em>{$MOD.LBL_PARTICIPANTS_TAB}</em></a></li>
244 <li id="tab_repeat"><a tabname="cal-tab-3" id="cal-tab-3-link"><em>{$MOD.LBL_REPEAT_TAB}</em></a></li>
247 <div id="cal-tab-1" class="yui-content">
250 <div id="cal-tab-2" class="yui-content">
251 <div class="h3Row" id="scheduler"></div>
254 <div id="cal-tab-3" class="yui-content">
255 {include file=$repeat}
260 <div id="cal-edit-buttons" class="ft">
261 <button id="btn-save" class="button" type="button">{$MOD.LBL_SAVE_BUTTON}</button>
262 <button id="btn-cancel" class="button" type="button">{$MOD.LBL_CANCEL_BUTTON}</button>
263 <button id="btn-delete" class="button" type="button">{$MOD.LBL_DELETE_BUTTON}</button>
264 <button id="btn-send-invites" class="button" type="button">{$MOD.LBL_SEND_INVITES}</button>
265 <button id="btn-full-form" class="button" type="button">{$APP.LBL_FULL_FORM_BUTTON_LABEL}</button>
270 {include file=$settings}
273 <script type="text/javascript">
277 <script type="text/javascript">
279 YAHOO.util.Event.onDOMReady(function(){
280 var schedulerLoader = new YAHOO.util.YUILoader({
281 require : ["jsclass_scheduler"],
282 onSuccess: function(){
283 var root_div = document.getElementById('scheduler');
284 var sugarContainer_instance = new SugarContainer(document.getElementById('scheduler'));
285 sugarContainer_instance.start(SugarWidgetScheduler);
288 schedulerLoader.addModule({
289 name :"jsclass_scheduler",
291 fullpath: "modules/Meetings/jsclass_scheduler.js",
292 varName: "global_rpcClient",
295 schedulerLoader.insert();
300 <script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
301 <script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
303 <style type="text/css">
309 width: auto !important;
314 <style type="text/css">
316 #cal-grid div.col, #cal-grid div.left_col{
317 border-top: 1px solid silver;
323 <div id="cal-width-helper" style="width: auto;"></div>