<?php
/* Smarty version 4.3.2, created on 2024-07-19 18:15:20
  from '/var/www/html/public/legacy/cache/themes/suite8/modules/OAuth2Clients/SearchFormHeader.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.3.2',
  'unifunc' => 'content_669aad387a7330_36193396',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'ce90bbb07bc190bea3d717fe2f9d23446bca8cae' => 
    array (
      0 => '/var/www/html/public/legacy/cache/themes/suite8/modules/OAuth2Clients/SearchFormHeader.tpl',
      1 => 1721412920,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:include/SearchForm/tpls/headerPopup.tpl' => 1,
  ),
),false)) {
function content_669aad387a7330_36193396 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/var/www/html/public/legacy/include/Smarty/plugins/function.sugar_getjspath.php','function'=>'smarty_function_sugar_getjspath',),));
?>

<div class="clear"></div>
<div class='listViewBody'>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo smarty_function_sugar_getjspath(array('file'=>'include/javascript/popup_parent_helper.js'),$_smarty_tpl);?>
"><?php echo '</script'; ?>
>
    <?php echo $_smarty_tpl->tpl_vars['TABS']->value;?>

        
        <?php echo '<script'; ?>
>


            function addXMLRequestCallback(callback) {
                var oldSend, i;
                if (XMLHttpRequest.callbacks) {
                    // we've already overridden send() so just add the callback
                    XMLHttpRequest.callbacks.push(callback);
                } else {
                    // create a callback queue
                    XMLHttpRequest.callbacks = [callback];
                    // store the native send()
                    oldSend = XMLHttpRequest.prototype.send;
                    // override the native send()
                    XMLHttpRequest.prototype.send = function () {
                        // process the callback queue
                        for (i = XMLHttpRequest.callbacks.length - 1; i >= 0; i--) {
                            XMLHttpRequest.callbacks[i](this);
                        }
                        // call the native send()
                        oldSend.apply(this, arguments);
                    }
                }
            }

            function refreshSearchForm() {
                $('.search_form textarea').each(function (i, e) {
                    $(e).css('max-width', $(e).parent().width());
                });
                if (!$('#search_form .tabFormAdvLink').prev().hasClass('clear')) {
                    $('#search_form .tabFormAdvLink').before('<div class="clear"></div>');
                }
                $('#search_form .dateTimeRangeChoice').css({
                    'white-space': 'initial',
                    'display': 'block'
                });
            }

            $(function () {
                var refreshSearchFormIntervals = [];
                var refreshSearchFormIntervalsCountDown = 100;
                addXMLRequestCallback(function (xhr) {
                    refreshSearchFormIntervalsCountDown = 100;
                    refreshSearchFormIntervals.push(setInterval(function () {
                        refreshSearchForm();
                        refreshSearchFormIntervalsCountDown -= 1 / refreshSearchFormIntervals.length;
                        if (refreshSearchFormIntervalsCountDown <= 0) {
                            $.each(refreshSearchFormIntervals, function (i, e) {
                                clearInterval(e);
                            });
                            refreshSearchFormIntervals = [];
                        }
                    }, 100));
                });
            });

            function submitOnEnter(e) {
                var characterCode = (e && e.which) ? e.which : event.keyCode;
                if (characterCode == 13 && event.target.type !== "textarea") {
                    document.getElementById('search_form').submit();
                    return false;
                } else {
                    return true;
                }
            }
        <?php echo '</script'; ?>
>
    

    <?php if ($_smarty_tpl->tpl_vars['searchFormInPopup']->value) {?>
        <?php $_smarty_tpl->_subTemplateRender('file:include/SearchForm/tpls/headerPopup.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
    <?php }?>

    <form name='search_form' id='search_form' class='search_form <?php if (!$_smarty_tpl->tpl_vars['searchFormInPopup']->value) {?> non-popup<?php }?>' method='post'
          action='index.php?module=<?php echo $_smarty_tpl->tpl_vars['module']->value;?>
&action=<?php echo $_smarty_tpl->tpl_vars['action']->value;?>
' onkeydown='submitOnEnter(event);'>
        <input type='hidden' name='searchFormTab' value='<?php echo $_smarty_tpl->tpl_vars['displayView']->value;?>
'/>
        <input type='hidden' name='module' value='<?php echo $_smarty_tpl->tpl_vars['module']->value;?>
'/>
        <input type='hidden' name='action' value='<?php echo $_smarty_tpl->tpl_vars['action']->value;?>
'/>
        <input type='hidden' name='query' value='true'/>
        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['TAB_ARRAY']->value, 'tabData', false, 'tabkey', 'tabIteration', array (
));
$_smarty_tpl->tpl_vars['tabData']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['tabkey']->value => $_smarty_tpl->tpl_vars['tabData']->value) {
$_smarty_tpl->tpl_vars['tabData']->do_else = false;
?>
            <div id='<?php echo $_smarty_tpl->tpl_vars['module']->value;
echo $_smarty_tpl->tpl_vars['tabData']->value['name'];?>
_searchSearchForm' style='<?php echo $_smarty_tpl->tpl_vars['tabData']->value['displayDiv'];?>
'
                 class="edit view search <?php echo $_smarty_tpl->tpl_vars['tabData']->value['name'];?>
"><?php if ($_smarty_tpl->tpl_vars['tabData']->value['displayDiv']) {
} else {
echo $_smarty_tpl->tpl_vars['return_txt']->value;
}?></div>
        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
        <div id='<?php echo $_smarty_tpl->tpl_vars['module']->value;?>
saved_viewsSearchForm'
             style='display: none;'><?php echo $_smarty_tpl->tpl_vars['saved_views_txt']->value;?>
</div>
<?php }
}
