Exemplo n.º 1
0
    if (count($where_clauses) > 0) {
        $where = implode(' and ', $where_clauses);
    }
    $GLOBALS['log']->info("Here is the where clause for the list view: {$where}");
}
// start display
// which tab of search form to display
if (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
    $searchForm->setup();
    if (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
        $searchForm->displayAdvanced();
    } elseif (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'saved_views') {
        $searchForm->displaySavedViews($listViewDefs, $lv);
    } else {
        $searchForm->displayBasic();
    }
}
echo $qsd->GetQSScripts();
$lv->setup($seedProducts, 'include/ListView/ListViewGeneric.tpl', $where, $params);
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : ' - ' . $_REQUEST['saved_search_select_name'];
echo get_form_header($current_module_strings['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
echo $lv->display();
$savedSearch = new SavedSearch();
$json = getJSONobj();
// fills in saved views select box on shortcut menu
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('Products')));
$str = "<script>\nYAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, {$savedSearchSelects});\n</script>";
echo $str;
?>

Exemplo n.º 2
0
 /**
  * get the search buttons
  *
  * @return string html of contents
  */
 function getButtons()
 {
     global $app_strings;
     $SAVED_SEARCHES_OPTIONS = '';
     $savedSearch = new SavedSearch();
     $SAVED_SEARCHES_OPTIONS = $savedSearch->getSelect($this->module);
     $str = "<input tabindex='2' title='{$app_strings['LBL_SEARCH_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SEARCH_BUTTON_KEY']}' onclick='SUGAR.savedViews.setChooser()' class='button' type='submit' name='button' value='{$app_strings['LBL_SEARCH_BUTTON_LABEL']}' id='search_form_submit'/>&nbsp;";
     $str .= "<input tabindex='2' title='{$app_strings['LBL_CLEAR_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CLEAR_BUTTON_KEY']}' onclick='SUGAR.searchForm.clear_form(this.form); return false;' class='button' type='button' name='clear' value=' {$app_strings['LBL_CLEAR_BUTTON_LABEL']} ' id='search_form_clear'/>";
     if (!empty($SAVED_SEARCHES_OPTIONS) && $this->showSavedSearchOptions) {
         $str .= "   <span class='white-space'>\n                        &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<b>{$app_strings['LBL_SAVED_SEARCH_SHORTCUT']}</b>&nbsp;\n                        {$SAVED_SEARCHES_OPTIONS}\n                        <span id='go_btn_span' style='display:none'><input tabindex='2' title='go_select' id='go_select'  onclick='SUGAR.searchForm.clear_form(this.form);' class='button' type='button' name='go_select' value=' {$app_strings['LBL_GO_BUTTON_LABEL']} '/></span>\n                    </span>\n                    </form>";
     }
     $str .= "\n                <script>\n                    function toggleInlineSearch(){\n                        if (document.getElementById('inlineSavedSearch').style.display == 'none'){\n                            document.getElementById('showSSDIV').value = 'yes'\n                            document.getElementById('inlineSavedSearch').style.display = '';\n\n                            document.getElementById('up_down_img').src='" . SugarThemeRegistry::current()->getImageURL('basic_search.gif') . "';\n\n                        }else{\n\n                            document.getElementById('up_down_img').src='" . SugarThemeRegistry::current()->getImageURL('advanced_search.gif') . "';\n\n                            document.getElementById('showSSDIV').value = 'no';\n                            document.getElementById('inlineSavedSearch').style.display = 'none';\n                        }\n                    }\n\n\n                </script>\n            ";
     return $str;
 }
Exemplo n.º 3
0
 function displaySavedSearchSelect()
 {
     $savedSearch = new SavedSearch($this->listViewDefs[$this->module], $this->lv->data['pageData']['ordering']['orderBy'], $this->lv->data['pageData']['ordering']['sortOrder']);
     return $savedSearch->getSelect($this->module);
 }
Exemplo n.º 4
0
 public function testgetSelect()
 {
     $savedSearch = new SavedSearch(array('id', 'name'), 'id', 'ASC');
     $result = $savedSearch->getSelect('Leads');
     $this->assertGreaterThan(0, strlen($result));
 }
Exemplo n.º 5
0
        $xtpl->assign('stat_action', $_REQUEST['stat_action']);
    } else {
        $xtpl->assign('stat_action', '');
    }
    //Add Custom Fields
    require_once 'modules/DynamicFields/templates/Files/EditView.php';
    global $current_user;
    if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
        $record = '';
        if (!empty($_REQUEST['record'])) {
            $record = $_REQUEST['record'];
        }
        $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>");
    }
    $xtpl->parse("main.open_source");
    $xtpl->parse("main");
    $xtpl->out("main");
    require_once 'include/javascript/javascript.php';
    $javascript = new javascript();
    $javascript->setFormName('EditView');
    $javascript->setSugarBean($focus);
    $javascript->addAllFields('');
    $javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
    echo $javascript->getScript();
    require_once 'modules/SavedSearch/SavedSearch.php';
    $savedSearch = new SavedSearch();
    $json = getJSONobj();
    $savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('ComponentEstimateCalc')));
    $str = "<script>\n\tYAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, {$savedSearchSelects});\n\t</script>";
    echo $str;
}
 /**
  * Called from process(). This method will display the search form on the left of the page.
  */
 function displaySearch()
 {
     global $app_list_strings;
     $savedSearch = new SavedSearch();
     $json = getJSONobj();
     $savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect($this->module)));
     $str = "<script>\n\t\tYAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, {$savedSearchSelects});\n\t\t</script>";
     echo $str;
 }