]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calendar/tpls/main.tpl
Release 6.4.0beta3
[Github/sugarcrm.git] / modules / Calendar / tpls / main.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
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.
12  * 
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
16  * details.
17  * 
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
21  * 02110-1301 USA.
22  * 
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.
25  * 
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.
29  * 
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  ********************************************************************************/
36
37 *}
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">
41
42         {literal}
43         YAHOO.util.Event.onDOMReady(function(){
44                 dom_loaded = true;
45         });
46         
47         function check_cal_loaded(){
48                 return (typeof cal_loaded != 'undefined' && cal_loaded == true && typeof dom_loaded != 'undefined' && dom_loaded == true);
49         }
50         {/literal}
51         
52         SUGAR.util.doWhen(check_cal_loaded, function(){literal}{{/literal}
53         
54                 CAL.view = "{$view}";
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}";           
63                 
64                 CAL.cells_per_day = {$cells_per_day};   
65                 CAL.current_params = {literal}{}{/literal};
66                 CAL.dashlet = "{$dashlet}";     
67                 
68                 CAL.grid_start_ts = {$grid_start_ts};
69                 CAL.scroll_slot = {$scroll_slot};
70
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}";                 
89         
90                 CAL.img_edit_inline = "{$img_edit_inline}";
91                 CAL.img_view_inline = "{$img_view_inline}";
92                 CAL.img_close = "{$img_close}";         
93                 
94                 
95                 {literal}
96                 var scrollable = CAL.get("cal-scrollable");
97                 if(scrollable){
98                         scrollable.scrollTop = 15 * CAL.scroll_slot;
99                 }
100                 {/literal}                      
101
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}
107                         {/foreach}
108                         CAL.shared_users_count = "{$shared_users_count}";
109                 {/if}
110         
111                 CAL.field_list = new Array();
112                 CAL.field_disabled_list = new Array();                  
113
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}'
119                 {/foreach}
120
121                 CAL.act_types = [];
122                 CAL.act_types['Meetings'] = 'meeting';
123                 CAL.act_types['Calls'] = 'call';
124                 CAL.act_types['Tasks'] = 'task';
125
126                 {literal}
127
128                 if(CAL.items_draggable){                        
129                         var target_slots = [];                  
130                         var slots = CAL.query('#cal-grid div.slot');
131                         CAL.each(
132                                 slots,
133                                 function(i,v){
134                                         target_slots[i] = new YAHOO.util.DDTarget(slots[i].id,"cal"); 
135                                 }
136                         );                      
137                 }       
138                 
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"));
146                         });
147                         YAHOO.util.Event.on(nodes[i],"mouseout",function(){
148                                 this.style.backgroundColor = "";
149                                 this.removeAttribute("title");
150                         });
151                         YAHOO.util.Event.on(nodes[i],"click",function(){
152                                 if(!CAL.disable_creating){                                                      
153                                         CAL.dialog_create(this);
154                                 }
155                         });
156                 });                             
157                 
158                 CAL.init_edit_dialog(
159                                 {
160                                         width: "{/literal}{$editview_width}{literal}",
161                                         height: "{/literal}{$editview_height}{literal}"
162                                 }
163                 );
164                 
165                 YAHOO.util.Event.on(window, 'resize', function(){
166                         CAL.fit_grid();
167                 });             
168                                 
169                 YAHOO.util.Event.on("btn-save","click",function(){                                                                                                                                              
170                         if(!(check_form('CalendarEditView') && cal_isValidDuration()))
171                                 return false;                                                           
172                         CAL.dialog_save();      
173                 });
174                 
175                 YAHOO.util.Event.on("btn-send-invites","click",function(){                                                                                                                                              
176                         if(!(check_form('CalendarEditView') && cal_isValidDuration()))
177                                 return false;                           
178                         CAL.get("send_invites").value = "1";                                                    
179                         CAL.dialog_save();      
180                 });             
181                 
182
183                 YAHOO.util.Event.on("btn-apply","click",function(){
184                         if(!(check_form('CalendarEditView') && cal_isValidDuration()))
185                                 return false;
186                         CAL.dialog_apply();
187                 });     
188                                 
189                 YAHOO.util.Event.on("btn-delete","click",function(){
190                         if(CAL.get("record").value != "")
191                                 if(confirm(CAL.lbl_confirm_remove))
192                                         CAL.dialog_remove();                            
193                                                 
194                 });     
195         
196                 YAHOO.util.Event.on("btn-cancel","click",function(){                    
197                         CAL.editDialog.cancel();                                                
198                 }); 
199
200                 CAL.select_tab("cal-tab-1");
201
202                 YAHOO.util.Event.on(CAL.get("btn-cancel-settings"), 'click', function(){
203                         CAL.settingsDialog.cancel();    
204                 });
205                 
206                 YAHOO.util.Event.on(CAL.get("btn-save-settings"), 'click', function(){                  
207                         CAL.get("form_settings").submit();
208                 });
209                 
210                 {/literal}
211                                 
212                 var calendar_items = [
213                         {$a_str}                
214                 ];
215                         
216                 {literal}
217                 CAL.each(calendar_items, function(i,v){                         
218                         CAL.add_item_to_grid(calendar_items[i]);                                
219                 });
220                 {/literal}
221                 
222                 {if $view != "year"}
223                 CAL.fit_grid(); 
224                 {/if}
225                 
226                 cal_loaded = null;              
227         });
228 </script>
229                         
230 <div id="cal-edit" style="display: none;">
231         
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;">
235                         <ul class="yui-nav">
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>
238                         </ul>
239                         <div id="cal-tab-1" class="yui-content">
240                                 {include file=$form}
241                         </div>                          
242                         <div id="cal-tab-2" class="yui-content">
243                                 <div class="h3Row" id="scheduler"></div>
244                         </div>
245                 </div>
246         </div>  
247         <div id="cal-edit-buttons" class="ft">
248                 <button id="btn-save" class="button" type="button">{$MOD.LBL_SAVE_BUTTON}</button>&nbsp;
249                 <button id="btn-delete" class="button" type="button">{$MOD.LBL_DELETE_BUTTON}</button>&nbsp;
250                 <button id="btn-apply" class="button" type="button">{$MOD.LBL_APPLY_BUTTON}</button>&nbsp;
251                 <button id="btn-send-invites" class="button" type="button">{$MOD.LBL_SEND_INVITES}</button>&nbsp;
252                 <button id="btn-cancel" class="button" type="button" style="float: right;">{$MOD.LBL_CANCEL_BUTTON}</button>&nbsp;
253         </div>
254 </div>
255
256 {if $settings}
257 {include file=$settings}
258 {/if}
259         
260 <script type="text/javascript">                 
261 {$GRjavascript}
262 </script>
263         
264 <script type="text/javascript"> 
265 {literal}
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);
273                 }
274         });
275         schedulerLoader.addModule({
276                 name :"jsclass_scheduler",
277                 type : "js",
278                 fullpath: "modules/Meetings/jsclass_scheduler.js",
279                 varName: "global_rpcClient",
280                 requires: []
281         });
282         schedulerLoader.insert();
283 });     
284 {/literal}      
285 </script>
286         
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>
290         
291 <style type="text/css">
292 {literal}
293         .schedulerDiv h3{
294                 display: none;
295         }
296 {/literal}
297 </style>        
298 {if $view == 'day'}
299 <style type="text/css">
300 {literal}
301         .day_col, .left_time_col{
302                 border-top: 1px solid silver;   
303         }
304 {/literal}
305 </style>
306 {/if}
307