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.celcount = {$celcount};
65 CAL.cells_per_day = {$cells_per_day};
66 CAL.current_params = {literal}{}{/literal};
67 CAL.dashlet = "{$dashlet}";
69 CAL.grid_start_ts = {$grid_start_ts};
70 CAL.scroll_slot = {$scroll_slot};
72 CAL.lbl_create_new = "{$MOD.LBL_CREATE_NEW_RECORD}";
73 CAL.lbl_edit = "{$MOD.LBL_EDIT_RECORD}";
74 CAL.lbl_saving = "{$MOD.LBL_SAVING}";
75 CAL.lbl_loading = "{$MOD.LBL_LOADING}";
76 CAL.lbl_confirm_remove = "{$MOD.LBL_CONFIRM_REMOVE}";
77 CAL.lbl_error_saving = "{$MOD.LBL_ERROR_SAVING}";
78 CAL.lbl_error_loading = "{$MOD.LBL_ERROR_LOADING}";
79 CAL.lbl_desc = "{$MOD.LBL_INFO_DESC}";
80 CAL.lbl_start = "{$MOD.LBL_INFO_START_DT}";
81 CAL.lbl_due = "{$MOD.LBL_INFO_DUE_DT}";
82 CAL.lbl_duration = "{$MOD.LBL_INFO_DURATION}";
83 CAL.lbl_name = "{$MOD.LBL_INFO_NAME}";
84 CAL.lbl_title = "{$MOD.LBL_INFO_TITLE}";
85 CAL.lbl_related = "{$MOD.LBL_INFO_RELATED_TO}";
86 CAL.lbl_hours_abbrev = "{$MOD.LBL_HOURS_ABBREV}";
87 CAL.lbl_mins_abbrev = "{$MOD.LBL_MINS_ABBREV}";
89 CAL.img_edit_inline = "{$img_edit_inline}";
90 CAL.img_view_inline = "{$img_view_inline}";
91 CAL.img_close = "{$img_close}";
95 var scrollable = CAL.get("cal-scrollable");
97 scrollable.scrollTop = 15 * CAL.scroll_slot - 1;
99 scrollable.scrollTop++;
103 {if $view == "shared"}
104 {counter name="un" start=0 print=false assign="un"}
105 {foreach name="shared" from=$shared_ids key=k item=member_id}
106 CAL.shared_users['{$member_id}'] = '{$un}';
107 {counter name="un" print=false}
109 CAL.shared_users_count = "{$shared_users_count}";
112 CAL.field_list = new Array();
113 CAL.field_disabled_list = new Array();
115 CAL.activity_colors = [];
116 {foreach name=colors from=$activity_colors key=module item=v}
117 CAL.activity_colors['{$module}'] = [];
118 CAL.activity_colors['{$module}']['border'] = '{$v.border}';
119 CAL.activity_colors['{$module}']['body'] = '{$v.body}'
123 CAL.act_types['Meetings'] = 'meeting';
124 CAL.act_types['Calls'] = 'call';
125 CAL.act_types['Tasks'] = 'task';
129 if(CAL.items_draggable){
130 var target_slots = [];
131 var slots = CAL.query('#cal-grid div.slot');
135 target_slots[i] = new YAHOO.util.DDTarget(slots[i].id,"cal");
140 var nodes = CAL.query("#cal-grid div.slot");
141 CAL.each(nodes, function(i,v){
142 YAHOO.util.Event.on(nodes[i],"mouseover",function(){
143 if(CAL.records_openable)
144 this.style.backgroundColor = "#D1DCFF";
145 if(!this.childNodes.length)
146 this.setAttribute("title",this.getAttribute("time"));
148 YAHOO.util.Event.on(nodes[i],"mouseout",function(){
149 this.style.backgroundColor = "";
150 this.removeAttribute("title");
152 YAHOO.util.Event.on(nodes[i],"click",function(){
153 if(!CAL.disable_creating){
154 CAL.dialog_create(this);
159 CAL.init_edit_dialog(
161 width: "{/literal}{$editview_width}{literal}",
162 height: "{/literal}{$editview_height}{literal}"
166 YAHOO.util.Event.on(window, 'resize', function(){
168 CAL.update_dd.fire();
171 YAHOO.util.Event.on("btn-save","click",function(){
172 if(!(check_form('CalendarEditView') && cal_isValidDuration())){
173 CAL.select_tab("cal-tab-1");
179 YAHOO.util.Event.on("btn-send-invites","click",function(){
180 if(!(check_form('CalendarEditView') && cal_isValidDuration())){
181 CAL.select_tab("cal-tab-1");
184 CAL.get("send_invites").value = "1";
189 YAHOO.util.Event.on("btn-apply","click",function(){
190 if(!(check_form('CalendarEditView') && cal_isValidDuration())){
191 CAL.select_tab("cal-tab-1");
197 YAHOO.util.Event.on("btn-delete","click",function(){
198 if(CAL.get("record").value != "")
199 if(confirm(CAL.lbl_confirm_remove))
204 YAHOO.util.Event.on("btn-cancel","click",function(){
205 CAL.editDialog.cancel();
208 CAL.select_tab("cal-tab-1");
210 YAHOO.util.Event.on(CAL.get("btn-cancel-settings"), 'click', function(){
211 CAL.settingsDialog.cancel();
214 YAHOO.util.Event.on(CAL.get("btn-save-settings"), 'click', function(){
215 CAL.get("form_settings").submit();
220 var calendar_items = [
225 CAL.each(calendar_items, function(i,v){
226 CAL.add_item_to_grid(calendar_items[i]);
231 CAL.arrange_advanced();
233 CAL.update_dd.fire();
240 <div id="cal-edit" style="display: none;">
242 <div class="hd"><span id="title-cal-edit"></span></div>
243 <div class="bd" id="edit-dialog-content">
244 <div id="cal-tabs" class="yui-navset yui-navset-top yui-content" style="height: auto; padding: 0 2px;">
246 <li id="tab_general"><a tabname="cal-tab-1" id="cal-tab-1-link"><em>{$MOD.LBL_GENERAL_TAB}</em></a></li>
247 <li id="tab_invitees"><a tabname="cal-tab-2" id="cal-tab-2-link"><em>{$MOD.LBL_PARTICIPANTS_TAB}</em></a></li>
249 <div id="cal-tab-1" class="yui-content">
252 <div id="cal-tab-2" class="yui-content">
253 <div class="h3Row" id="scheduler"></div>
257 <div id="cal-edit-buttons" class="ft">
258 <button id="btn-save" class="button" type="button">{$MOD.LBL_SAVE_BUTTON}</button>
259 <button id="btn-apply" class="button" type="button">{$MOD.LBL_APPLY_BUTTON}</button>
260 <button id="btn-delete" class="button" type="button">{$MOD.LBL_DELETE_BUTTON}</button>
261 <button id="btn-cancel" class="button" type="button">{$MOD.LBL_CANCEL_BUTTON}</button>
262 <button id="btn-send-invites" class="button" type="button">{$MOD.LBL_SEND_INVITES}</button>
267 {include file=$settings}
270 <script type="text/javascript">
274 <script type="text/javascript">
277 YAHOO.util.Event.onDOMReady(function(){
278 var schedulerLoader = new YAHOO.util.YUILoader({
279 require : ["jsclass_scheduler"],
280 onSuccess: function(){
281 var root_div = document.getElementById('scheduler');
282 var sugarContainer_instance = new SugarContainer(document.getElementById('scheduler'));
283 sugarContainer_instance.start(SugarWidgetScheduler);
286 schedulerLoader.addModule({
287 name :"jsclass_scheduler",
289 fullpath: "modules/Meetings/jsclass_scheduler.js",
290 varName: "global_rpcClient",
293 schedulerLoader.insert();
298 <script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
299 <script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
300 <script type="text/javascript" src="include/javascript/overlibmws.js"></script>
302 <style type="text/css">
308 width: auto !important;
313 <style type="text/css">
315 .day_col, .left_time_col{
316 border-top: 1px solid silver;