{*<!--
 /*+*******************************************************************************
 * The content of this file is subject to the CRMTiger Pro license.
 * ("License"); You may not use this file except in compliance with the License
 * The Initial Developer of the Original Code is vTiger
 * The Modified Code of the Original Code owned by https://crmtiger.com/
 * Portions created by CRMTiger.com are Copyright(C) CRMTiger.com
 * All Rights Reserved.
  ***************************************************************************** */
-->*}
 <form action="index.php" method="post" id="search_Settings" class="form-horizontal">
      <input type="hidden" name="module" value="CTMobileSettings">
      <input type="hidden" name="action" value="SaveSearchAjax">
      <input type="hidden" name="search_module" value="{$SEARCH_SOURCE_MODULE}">

      <div class="select-search" style="margin-top:5px;">
        <select class="select2" multiple="true" id="search_users" name="search_users[]" data-placeholder="Select Users" style="width: 300px;">
          <option value="selectAll">{vtranslate('LBL_ALL','CTMobileSettings')} {vtranslate('LBL_USERS','CTMobileSettings')}</option>
          {foreach key=FIELD_NAME item=FIELD_MODEL from=$SEARCH_USER_MODEL}
            <option value="{$FIELD_MODEL['userid']}" data-field-name="{$FIELD_MODEL['username']}"
                >{$FIELD_MODEL['username']}
            </option>
          {/foreach}
        </select>
      </div>

      <div class="select-search" style="margin-top:15px;">
        <select class="inputElement select2 {if $OCCUPY_COMPLETE_WIDTH} row {/if}" id="search_field" name="search_field" style="width: 300px;">
            
            {foreach key=BLOCK_LABEL item=BLOCK_FIELDS from=$SEARCH_RECORD_STRUCTURE}
              <optgroup label='{vtranslate($BLOCK_LABEL, $SEARCH_SOURCE_MODULE)}'>
                  {foreach key=FIELD_NAME item=FIELD_MODEL from=$BLOCK_FIELDS}
                      <option value="{$FIELD_MODEL->getCustomViewColumnName()}" data-field-name="{$FIELD_NAME}">{vtranslate($FIELD_MODEL->get('label'), $SEARCH_SOURCE_MODULE)}
                      </option>
                  {/foreach}
              </optgroup>
            {/foreach}
            {*Required to include event fields for columns in calendar module advanced filter*}
            {foreach key=BLOCK_LABEL item=BLOCK_FIELDS from=$EVENT_RECORD_STRUCTURE}
              <optgroup label='{vtranslate($BLOCK_LABEL, 'Events')}'>
                  {foreach key=FIELD_NAME item=FIELD_MODEL from=$BLOCK_FIELDS}
                      <option value="{$FIELD_MODEL->getCustomViewColumnName()}" data-field-name="{$FIELD_NAME}">{vtranslate($FIELD_MODEL->get('label'), $SEARCH_SOURCE_MODULE)}
                      </option>
                  {/foreach}
              </optgroup>
            {/foreach}
        </select>
      </div>
      <br/>
      <br/>
      <div class="row-fluid">
        <button class="btn btn-success btnSaveSettings" type="button">{vtranslate('LBL_SAVE', 'CTMobileSettings')}</button>
        <a class="cancelLink" type="reset" onclick="javascript:window.history.back();">{vtranslate('Cancel','CTMobileSettings')}</a>
    </div>
  </form>

