}
// }}}
+// {{{ updatepromofields
+
+function updatepromofields(egal1, egal2, promo2) {
+ var comparator = egal1.val();
+
+ if (comparator == '=') {
+ egal2.attr('disabled', 'disabled');
+ promo2.attr('disabled', 'disabled');
+ } else if (comparator == '<=' || comparator == '>=') {
+ egal2.removeAttr('disabled');
+ promo2.removeAttr('disabled');
+ if (comparator == '<=') {
+ egal2.val('>=');
+ } else {
+ egal2.val('<=');
+ }
+ }
+}
+
+// }}}
/***************************************************************************
* Quick search
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<select name="{$egal1}" onchange="updatepromofields($('select[name={$egal1}]'), $('input[name={$egal2}]'), $('input[name={$promo2}]'))" style="text-align: center">
+ <option value="=" {if $promo_data.$egal1 eq "="}selected="selected"{/if}> = </option>
+ <option value=">=" {if $promo_data.$egal1 eq ">="}selected="selected"{/if}> >= </option>
+ <option value="<=" {if $promo_data.$egal1 eq "<="}selected="selected"{/if}> <= </option>
+</select>
+<input type="text" name="{$promo1}" size="4" maxlength="4" value="{$promo_data.$promo1}" />
+ et
+<input type="text" name="{$egal2}" size="1" style="text-align:center" {if t($promo_data.$egal1) && $promo_data.$egal1 neq "="}value="{$promo_data.$egal2}"{else}value=">=" disabled="disabled"{/if} readonly="readonly" />
+<input type="text" name="{$promo2}" size="4" maxlength="4" {if t($promo_data.$egal1) && $promo_data.$egal1 neq "="}value="{$promo_data.$promo2}"{else}disabled="disabled"{/if} />
+<select name="edu_type" style="text-align: center">
+ <option value="{#UserFilter::GRADE_ING#}" {if $promo_data.$edu_type eq #UserFilter::GRADE_ING#}selected="selected"{/if}>X</option>
+ <option value="{#UserFilter::GRADE_MST#}" {if $promo_data.$edu_type eq #UserFilter::GRADE_MST#}selected="selected"{/if}>Master</option>
+ <option value="{#UserFilter::GRADE_PHD#}" {if $promo_data.$edu_type eq #UserFilter::GRADE_PHD#}selected="selected"{/if}>Docteur</option>
+</select>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<tr>
<td class="titre">Promotions</td>
<td>
- <script type="text/javascript">/*<![CDATA[*/
- {literal}
- function updatepromofields(egal1) {
- var f = egal1.form;
- f.egal2.disabled = f.promo2.disabled = egal1.value == '=';
- f.egal2.readOnly = true;
- if (f.egal1.value == '>=') {
- f.egal2.value = '<=';
- } else {
- f.egal2.value = '>=';
- }
- }
- $(function() { updatepromofields($('select[name=egal1]')[0]); });
- {/literal}
- /*]]>*/</script>
- <select name="egal1" onchange="updatepromofields(this)" style="text-align:center">
- <option value="=" {if $smarty.request.egal1 eq "="}selected="selected"{/if}> = </option>
- <option value=">=" {if $smarty.request.egal1 eq ">="}selected="selected"{/if}> >= </option>
- <option value="<=" {if $smarty.request.egal1 eq "<="}selected="selected"{/if}> <= </option>
- </select>
- <input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
- et
- <input type="text" name="egal2" size="1" style="text-align:center" value="{if t($smarty.request.egal2) eq '<'}<{else}>{/if}" readonly="readonly" />
- <input type="text" name="promo2" size="4" maxlength="4" value="{$smarty.request.promo2}" />
- <select name="edu_type" style="text-align:center">
- <option value="{#UserFilter::GRADE_ING#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_ING#}selected="selected"{/if}>X</option>
- <option value="{#UserFilter::GRADE_MST#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_MST#}selected="selected"{/if}>Master</option>
- <option value="{#UserFilter::GRADE_PHD#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_PHD#}selected="selected"{/if}>Docteur</option>
- </select>
+ {include file="include/select_promo.tpl" promo_data=$smarty.request egal1="egal1" egal2="egal2" promo1="promo1" promo2="promo2" edu_type="edu_type"}
</td>
</tr>
{/if}
<tr>
<td>Promotion</td>
<td>
- <script type="text/javascript">/*<![CDATA[*/
- {literal}
- function updatepromofields(egal1) {
- var f = egal1.form;
- f.egal2.disabled = f.promo2.disabled = egal1.value == '=';
- f.egal2.readOnly = true;
- if (f.egal1.value == '>=') {
- f.egal2.value = '<=';
- } else {
- f.egal2.value = '>=';
- }
- }
- $(function() { updatepromofields($('select[name=egal1]')[0]); });
- {/literal}
- /*]]>*/</script>
- <select name="egal1" onchange="updatepromofields(this)" style="text-align:center">
- <option value="=" {if $smarty.request.egal1 eq "="}selected="selected"{/if}> = </option>
- <option value=">=" {if $smarty.request.egal1 eq ">="}selected="selected"{/if}> >= </option>
- <option value="<=" {if $smarty.request.egal1 eq "<="}selected="selected"{/if}> <= </option>
- </select>
- <input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
- et
- <input type="text" name="egal2" size="1" style="text-align:center" value="{if t($smarty.request.egal2) eq '<'}<{else}>{/if}" readonly="readonly" />
- <input type="text" name="promo2" size="4" maxlength="4" value="{$smarty.request.promo2}" />
- <select name="edu_type" style="text-align:center">
- <option value="{#UserFilter::GRADE_ING#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_ING#}selected="selected"{/if}>X</option>
- <option value="{#UserFilter::GRADE_MST#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_MST#}selected="selected"{/if}>Master</option>
- <option value="{#UserFilter::GRADE_PHD#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_PHD#}selected="selected"{/if}>Docteur</option>
- </select>
+ {include file="include/select_promo.tpl" promo_data=$smarty.request egal1="egal1" egal2="egal2" promo1="promo1" promo2="promo2" edu_type="edu_type"}
</td>
</tr>
<tr>