return false;
}
- if (!$this->empty) {
+ if (!$this->isEmpty()) {
$ufc = $this->buildUFC($ufb);
if ($ufc != null) {
$ufb->addCond($ufc);
}
}
+ public function isEmpty()
+ {
+ return parent::isEmpty() || $this->nwtype == 0;
+ }
+
public function buildUFC(UserFilterBuilder &$ufb)
{
return new UFC_Networking($this->nwtype, $this->val);
$page->assign('advanced',1);
$page->addJsLink('jquery.autocomplete.js');
+ $networks = DirEnum::getOptions(DirEnum::NETWORKS);
+ $networks[-1] = 'Tous types';
+ $networks[0] = '-';
+ ksort($networks);
+ $page->assign('networking_types', $networks);
+
if (!Env::has('rechercher') && $model != 'geoloc') {
$this->form_prepare();
} else {
});
});
/** Regexps to wipe out from search queries */
-var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal[12]=[^&]*&promo[12]=(&|$)/g, /&[^&=]+=(&|$)/g ];
+var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal[12]=[^&]*&promo[12]=(&|$)/g, /&networking_type=0(&|$)/, /&[^&=]+=(&|$)/g ];
/** Uses javascript to clean form from all empty fields */
function cleanForm(f) {
var query = $(f).formSerialize();
<input type="text" name="networking_address" size="32" value="{$smarty.request.networking_address}" />
</td>
<td>
- <input type="text" name="networking_typeTxt" class="autocomplete" size="10" value="{$smarty.request.networking_typeTxt}" />
- <input name="networking_type" class="autocompleteTarget" type="hidden" value="{$smarty.request.networking_type}"/>
- <a href="networking_type" class="autocompleteToSelect">{icon name="table" title="Tous les types d'adresse"}</a>
+ <select name="networking_type">
+ {foreach from=$networking_types key=id item=network}
+ <option value="{$id}" {if $smarty.request.networking_type eq $id}selected="selected"{/if}>{$network}</option>
+ {/foreach}
+ </select>
</td>
</tr>
</table>