id(), SavedSearchMailings::getFrequencyOptions(User::getCurrentUser()), $Item->frequency() ); $OptList->submitOnChange(true); return $OptList->getHtml(); } # ----- SETUP ---------------------------------------------------------------- # checks to see if required incoming variables are set if (!isset($H_StartingIndex)) { throw new Exception("Required variable \$H_StartingIndex is not initialized"); } if (!isset($H_ItemsPerPage)) { throw new Exception("Required variable \$H_ItemsPerPage is not initialized"); } if (!isset($H_SavedSearches)) { throw new Exception("Required variable \$H_SavedSearches is not initialized"); } if (!isset($H_SearchCount)) { throw new Exception("Required variable \$H_SearchCount is not initialized"); } $AF = ApplicationFramework::getInstance(); $MailingsEnabled = PluginManager::getInstance()->pluginReady( "SavedSearchMailings" ); $BaseLink = "index.php?P=ListSavedSearches"; $TransferLink = "index.php?P=TransferSavedSearch&ID=\$ID"; $EditLink = "index.php?P=AdvancedSearch&ID=\$ID"; $DeleteLink = "index.php?P=ListSavedSearches&AC=Delete&ID=\$ID&" .TransportControlsUI::PNAME_STARTINGINDEX."=".$H_StartingIndex; $Fields = [ "SearchName" => [ "Heading" => "Search Name", "MaxLength" => 80, "AllowHTML" => true, "ValueFunction" => function ($Item) { return "" .htmlspecialchars($Item->searchName()).""; }, ], "Search Criteria" => [ "AllowHTML" => true, "ValueFunction" => function ($Item) { return $Item->searchParameters()->textDescription(); }, ], ]; if ($MailingsEnabled) { $Fields["Email"] = [ "AllowHTML" => true, "ValueFunction" => "Metavus\\GetEmailFrequency", ]; } $ListUI = new ItemListUI($Fields); $ListUI->noItemsMessage("There are no searches currently saved. You can enter and save a search via the Advanced Search page."); $ListUI->heading("Saved Searches"); $ListUI->baseLink($BaseLink); if (User::getCurrentUser()->hasPriv(PRIV_USERADMIN)) { $ListUI->addActionButton("Transfer", $TransferLink, "Exchange.svg"); } $ListUI->addActionButton("Edit", $EditLink, "Pencil.svg"); $ListUI->addActionButton("Delete", $DeleteLink, "Delete.svg"); $ListUI->itemsPerPage($H_ItemsPerPage); $ListUI->fieldsSortableByDefault(false); # ----- DISPLAY -------------------------------------------------------------- $AF->setPageTitle("Manage Saved Searches"); ?> display($H_SavedSearches, $H_SearchCount, $H_StartingIndex); ?>