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 ********************************************************************************/
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>
44 <div id="cal-repeat-block" style="dispaly: none;">
45 <form name="CalendarRepeatForm" id="CalendarRepeatForm" onsubmit="return false;">
47 <input type="hidden" name="repeat_parent_id">
48 <table class="edit view" width="100%" border="0" cellpadding="0" cellspacing="0">
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>
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>
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">
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}
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;">
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",
84 startWeekday: {$CALENDAR_FDOW|default:'0'},
86 {literal}}{/literal});
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;">
105 <script type="text/javascript">
107 function toggle_repeat_type(){
109 if(typeof validate != "undefined" && typeof validate['CalendarRepeatForm'] != "undefined")
110 validate['CalendarRepeatForm'] = undefined;
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";
116 document.getElementById("repeat_interval_row").style.display = "";
117 document.getElementById("repeat_end_row").style.display = "";
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 = "";
125 repeat_dow_row.style.display = "none";
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];
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";
140 if(typeof validate != "undefined" && typeof validate['CalendarRepeatForm'] != "undefined"){
141 removeFromValidate('CalendarRepeatForm', 'repeat_until');
143 addToValidateMoreThan('CalendarRepeatForm', 'repeat_count', 'int', true,'{/literal}{$MOD.LBL_REPEAT_COUNT}{literal}', 1);
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 = "";
149 if(typeof validate != "undefined" && typeof validate['CalendarRepeatForm'] != "undefined"){
150 removeFromValidate('CalendarRepeatForm', 'repeat_count');
152 addToValidate('CalendarRepeatForm', 'repeat_until', 'date', true,'{/literal}{$MOD.LBL_REPEAT_UNTIL}{literal}');
155 // prevent an issue when a calendar date picker is hidden under a dialog
156 var editContainer = document.getElementById('cal-edit_c');
158 var pickerContainer = document.getElementById('container_repeat_until_trigger_c');
159 if (pickerContainer) {
160 pickerContainer.style.zIndex = editContainer.style.zIndex + 1;