]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calendar/tpls/repeat.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / Calendar / tpls / repeat.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 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
39 <div id="edit_all_recurrences_block" style="display: none;">
40         <button type="button" id="btn-edit-all-recurrences" onclick="CAL.edit_all_recurrences();"> {$MOD.LBL_EDIT_ALL_RECURRENCES} </button>
41         <button type="button" id="btn-remove-all-recurrences" onclick="CAL.remove_all_recurrences();"> {$MOD.LBL_REMOVE_ALL_RECURRENCES} </button>
42 </div>
43
44 <div id="cal-repeat-block" style="dispaly: none;">
45 <form name="CalendarRepeatForm" id="CalendarRepeatForm" onsubmit="return false;">
46
47 <input type="hidden" name="repeat_parent_id">
48 <table class="edit view" width="100%" border="0" cellpadding="0" cellspacing="0">
49         <tr>
50                 <td width="12.5%" valign="top" scope="row">{$MOD.LBL_REPEAT_TYPE}:</td>
51                 <td width="37.5%" valign="top">
52                         <select name="repeat_type" onchange="toggle_repeat_type();">{html_options options=$APPLIST.repeat_type_dom}</select>
53                 </td>
54         </tr>
55         
56         <tr id="repeat_interval_row" style="display: none;">
57                 <td width="12.5%" valign="top" scope="row">{$MOD.LBL_REPEAT_INTERVAL}:</td>
58                 <td width="37.5%" valign="top">
59                         <select name="repeat_interval">{html_options options=$repeat_intervals selected="1"}</select> <span id="repeat-interval-text"></span>
60                 </td>
61         </tr>
62         
63         <tr id="repeat_end_row" style="display: none;">
64                 <td width="12.5%" valign="top" scope="row">{$MOD.LBL_REPEAT_END}:</td>
65                 <td width="37.5%" valign="top">
66                         <div>
67                                 <input type="radio" name="repeat_end_type" value="number" id="repeat_count_radio" checked onclick="toggle_repeat_end();" style="position: relative; top: -5px;"> {$MOD.LBL_REPEAT_END_AFTER} 
68                                 <input type="input" size="3" name="repeat_count" value="10"> {$MOD.LBL_REPEAT_OCCURRENCES}
69                         </div>
70                         <div>                                   
71                                 <input type="radio" name="repeat_end_type" id="repeat_until_radio" value="date" onclick="toggle_repeat_end();" style="position: relative; top: -5px;"> {$MOD.LBL_REPEAT_END_BY}
72                                 <input type="input" size="11" maxlength="10" id="repeat_until_input" name="repeat_until" value="" disabled>
73                                 <img border="0" src="index.php?entryPoint=getImage&imageName=jscalendar.gif" alt="{$APP.LBL_ENTER_DATE}" id="repeat_until_trigger" align="absmiddle" style="display: none;">    
74                                                         
75                                 <script type="text/javascript">
76                                                 Calendar.setup ({literal}{{/literal}
77                                                         inputField : "repeat_until_input",
78                                                         ifFormat : "{$CALENDAR_FORMAT}",
79                                                         daFormat : "{$CALENDAR_FORMAT}",
80                                                         button : "repeat_until_trigger",
81                                                         singleClick : true,
82                                                         dateStr : "",
83                                                         step : 1,
84                                                         startWeekday: {$CALENDAR_FDOW|default:'0'},
85                                                         weekNumbers:false
86                                                 {literal}}{/literal});
87                                 </script>                                                                                                               
88                         </div>
89                 </td>
90         </tr>
91         
92         <tr id="repeat_dow_row" style="display: none;">
93                 <td width="12.5%" valign="top" scope="row">{$MOD.LBL_REPEAT_DOW}:</td>
94                 <td width="37.5%" valign="top">
95                         {foreach name=dow from=$dow key=i item=d}
96                                 {$d.label} <input type="checkbox" id="repeat_dow_{$d.index}" name="repeat_dow[]" style="margin-right: 10px;">   
97                         {/foreach}
98                 </td>
99         </tr>
100         
101 </table>
102 </form>
103 </div>
104
105 <script type="text/javascript"> 
106 {literal}
107         function toggle_repeat_type(){
108                 
109                 if(typeof validate != "undefined" && typeof validate['CalendarRepeatForm'] != "undefined")
110                         validate['CalendarRepeatForm'] = undefined;
111                         
112                 if(document.forms['CalendarRepeatForm'].repeat_type.value == ""){
113                         document.getElementById("repeat_interval_row").style.display = "none";
114                         document.getElementById("repeat_end_row").style.display = "none";
115                 }else{                                          
116                         document.getElementById("repeat_interval_row").style.display = "";
117                         document.getElementById("repeat_end_row").style.display = "";
118                         toggle_repeat_end();
119                 }
120                 
121                 var repeat_dow_row = document.getElementById("repeat_dow_row");
122                 if(document.forms['CalendarRepeatForm'].repeat_type.value == "Weekly"){
123                         repeat_dow_row.style.display = "";
124                 }else{
125                         repeat_dow_row.style.display = "none";
126                 }
127                 
128                 var intervalTextElm = document.getElementById('repeat-interval-text');          
129                 if (intervalTextElm && typeof SUGAR.language.languages.app_list_strings['repeat_intervals'] != 'undefined') {
130                         intervalTextElm.innerHTML = SUGAR.language.languages.app_list_strings['repeat_intervals'][document.forms['CalendarRepeatForm'].repeat_type.value];
131                 }
132         }
133
134         function toggle_repeat_end(){   
135                 if(document.getElementById("repeat_count_radio").checked){
136                         document.forms['CalendarRepeatForm'].repeat_until.setAttribute("disabled","disabled");
137                         document.forms['CalendarRepeatForm'].repeat_count.removeAttribute("disabled");
138                         document.getElementById("repeat_until_trigger").style.display = "none"; 
139                         
140                         if(typeof validate != "undefined" && typeof validate['CalendarRepeatForm'] != "undefined"){
141                                 removeFromValidate('CalendarRepeatForm', 'repeat_until');
142                         }
143                         addToValidateMoreThan('CalendarRepeatForm', 'repeat_count', 'int', true,'{/literal}{$MOD.LBL_REPEAT_COUNT}{literal}', 1);                       
144                 }else{
145                         document.forms['CalendarRepeatForm'].repeat_count.setAttribute("disabled","disabled");                  
146                         document.forms['CalendarRepeatForm'].repeat_until.removeAttribute("disabled");
147                         document.getElementById("repeat_until_trigger").style.display = "";
148                         
149                         if(typeof validate != "undefined" && typeof validate['CalendarRepeatForm'] != "undefined"){
150                                 removeFromValidate('CalendarRepeatForm', 'repeat_count');
151                         }
152                         addToValidate('CalendarRepeatForm', 'repeat_until', 'date', true,'{/literal}{$MOD.LBL_REPEAT_UNTIL}{literal}');                 
153                 }
154                 
155                 // prevent an issue when a calendar date picker is hidden under a dialog
156                 var editContainer = document.getElementById('cal-edit_c');
157                 if (editContainer) {
158                         var pickerContainer = document.getElementById('container_repeat_until_trigger_c');
159                         if (pickerContainer) {
160                                 pickerContainer.style.zIndex = editContainer.style.zIndex + 1;
161                         }
162                 }               
163         }
164 {/literal}
165 </script>
166