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 {{if empty($displayParams.idName)}}
39 {assign var="id" value={{sugarvar key='name' string=true}} }
41 {assign var="id" value={{$displayParams.idName}} }
44 {if isset($smarty.request.{{$id_range_choice}})}
45 {assign var="starting_choice" value=$smarty.request.{{$id_range_choice}}}
47 {assign var="starting_choice" value="="}
50 <div style="white-space:nowrap !important;">
51 <select id="{$id}_range_choice" name="{$id}_range_choice" style="width:125px !important;" onchange="{$id}_range_change(this.value);">
52 {html_options options={{sugarvar key='options' string=true}} selected=$starting_choice}
56 <div id="{$id}_range_div" style="{if preg_match('/^\[/', $smarty.request.{{$id_range}}) || $starting_choice == 'between'}display:none{else}display:''{/if};">
57 <input autocomplete="off" type="text" name="range_{$id}" id="range_{$id}" value='{if empty($smarty.request.{{$id_range}}) && !empty($smarty.request.{{$original_id}})}{$smarty.request.{{$original_id}}}{else}{$smarty.request.{{$id_range}}}{/if}' title='{{$vardef.help}}' {{$displayParams.field}} tabindex='{{$tabindex}}' size="11" style="width:100px !important;">
58 {{if !$displayParams.hiddeCalendar}}
59 <img border="0" src="{sugar_getimagepath file='jscalendar.gif'}" alt="{$APP.LBL_ENTER_DATE}" id="{$id}_trigger" align="absmiddle"/>
61 {{if $displayParams.showFormats}}
62 (<span class="dateFormat">{$USER_DATEFORMAT}</span>)
64 {{if !$displayParams.hiddeCalendar}}
65 <script type="text/javascript">
66 Calendar.setup ({ldelim}
67 inputField : "range_{$id}",
68 daFormat : "{$CALENDAR_FORMAT}",
69 button : "{$id}_trigger",
71 dateStr : "{$date_value}",
80 <div id="{$id}_between_range_div" style="{if $starting_choice=='between'}display:'';{else}display:none;{/if}">
81 {assign var=date_value value={{sugarvar key='value' string=true}} }
82 <input autocomplete="off" type="text" name="start_range_{$id}" id="start_range_{$id}" value='{$smarty.request.{{$id_range_start}} }' title='{{$vardef.help}}' {{$displayParams.field}} tabindex='{{$tabindex}}' size="11" style="width:100px !important;">
83 {{if !$displayParams.hiddeCalendar}}
84 <img border="0" src="{sugar_getimagepath file='jscalendar.gif'}" alt="{$APP.LBL_ENTER_DATE}" id="start_range_{$id}_trigger" align="absmiddle" />
86 {{if $displayParams.showFormats}}
87 (<span class="dateFormat">{$USER_DATEFORMAT}</span>)
89 {{if !$displayParams.hiddeCalendar}}
90 <script type="text/javascript">
91 Calendar.setup ({ldelim}
92 inputField : "start_range_{$id}",
93 daFormat : "{$CALENDAR_FORMAT}",
94 button : "start_range_{$id}_trigger",
96 dateStr : "{$date_value}",
104 {assign var=date_value value={{sugarvar key='value' string=true}} }
105 <input autocomplete="off" type="text" name="end_range_{$id}" id="end_range_{$id}" value='{$smarty.request.{{$id_range_end}} }' title='{{$vardef.help}}' {{$displayParams.field}} tabindex='{{$tabindex}}' size="11" style="width:100px !important;" maxlength="10">
106 {{if !$displayParams.hiddeCalendar}}
107 <img border="0" src="{sugar_getimagepath file='jscalendar.gif'}" alt="{$APP.LBL_ENTER_DATE}" id="end_range_{$id}_trigger" align="absmiddle" />
109 {{if $displayParams.showFormats}}
110 (<span class="dateFormat">{$USER_DATEFORMAT}</span>)
112 {{if !$displayParams.hiddeCalendar}}
113 <script type="text/javascript">
114 Calendar.setup ({ldelim}
115 inputField : "end_range_{$id}",
116 daFormat : "{$CALENDAR_FORMAT}",
117 button : "end_range_{$id}_trigger",
119 dateStr : "{$date_value}",
129 <script type='text/javascript'>
131 function {$id}_range_change(val)
133 if(val == 'between') {ldelim}
134 document.getElementById("range_{$id}").value = '';
135 document.getElementById("{$id}_range_div").style.display = 'none';
136 document.getElementById("{$id}_between_range_div").style.display = '';
137 {rdelim} else if (val == '=' || val == 'not_equal' || val == 'greater_than' || val == 'less_than') {ldelim}
138 if((/^\[.*\]$/).test(document.getElementById("range_{$id}").value))
140 document.getElementById("range_{$id}").value = '';
142 document.getElementById("start_range_{$id}").value = '';
143 document.getElementById("end_range_{$id}").value = '';
144 document.getElementById("{$id}_range_div").style.display = '';
145 document.getElementById("{$id}_between_range_div").style.display = 'none';
146 {rdelim} else {ldelim}
147 document.getElementById("range_{$id}").value = '[' + val + ']';
148 document.getElementById("start_range_{$id}").value = '';
149 document.getElementById("end_range_{$id}").value = '';
150 document.getElementById("{$id}_range_div").style.display = 'none';
151 document.getElementById("{$id}_between_range_div").style.display = 'none';
155 var {$id}_range_reset = function()
157 {$id}_range_change('=');
160 YAHOO.util.Event.onDOMReady(function() {ldelim}
161 if(document.getElementById('search_form_clear'))
163 YAHOO.util.Event.addListener('search_form_clear', 'click', {$id}_range_reset);