help and default search method be set

This commit is contained in:
Uwe Steinmann 2016-02-01 19:57:08 +01:00
parent 0ca91816b5
commit 4dce5d7ab3
9 changed files with 37 additions and 11 deletions

View File

@ -91,6 +91,8 @@ class Settings { /* {{{ */
var $_enableFullSearch = true;
// fulltext search engine
var $_fullSearchEngine = 'lucene';
// default search method
var $_defaultSearchMethod = 'database'; // or 'fulltext'
// contentOffsetDirTo
var $_contentOffsetDir = "1048576";
// Maximum number of sub-directories per parent directory
@ -166,6 +168,8 @@ class Settings { /* {{{ */
var $_enableRecursiveCount = false;
// maximum number of documents or folders when counted recursively
var $_maxRecursiveCount = 10000;
// enable/disable help
var $_enableHelp = true;
// enable/disable language selection menu
var $_enableLanguageSelector = true;
// enable/disable theme selector
@ -349,10 +353,12 @@ class Settings { /* {{{ */
$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]);
$this->_enableRecursiveCount = Settings::boolVal($tab["enableRecursiveCount"]);
$this->_maxRecursiveCount = intval($tab["maxRecursiveCount"]);
$this->_enableHelp = Settings::boolVal($tab["enableHelp"]);
$this->_enableLanguageSelector = Settings::boolVal($tab["enableLanguageSelector"]);
$this->_enableThemeSelector = Settings::boolVal($tab["enableThemeSelector"]);
$this->_enableFullSearch = Settings::boolVal($tab["enableFullSearch"]);
$this->_fullSearchEngine = strval($tab["fullSearchEngine"]);
$this->_defaultSearchMethod = strval($tab["defaultSearchMethod"]);
$this->_stopWordsFile = strval($tab["stopWordsFile"]);
$this->_sortUsersInList = strval($tab["sortUsersInList"]);
$this->_sortFoldersDefault = strval($tab["sortFoldersDefault"]);
@ -625,10 +631,12 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree);
$this->setXMLAttributValue($node, "enableRecursiveCount", $this->_enableRecursiveCount);
$this->setXMLAttributValue($node, "maxRecursiveCount", $this->_maxRecursiveCount);
$this->setXMLAttributValue($node, "enableHelp", $this->_enableHelp);
$this->setXMLAttributValue($node, "enableLanguageSelector", $this->_enableLanguageSelector);
$this->setXMLAttributValue($node, "enableThemeSelector", $this->_enableThemeSelector);
$this->setXMLAttributValue($node, "enableFullSearch", $this->_enableFullSearch);
$this->setXMLAttributValue($node, "fullSearchEngine", $this->_fullSearchEngine);
$this->setXMLAttributValue($node, "defaultSearchMethod", $this->_defaultSearchMethod);
$this->setXMLAttributValue($node, "expandFolderTree", $this->_expandFolderTree);
$this->setXMLAttributValue($node, "stopWordsFile", $this->_stopWordsFile);
$this->setXMLAttributValue($node, "sortUsersInList", $this->_sortUsersInList);

View File

@ -67,6 +67,7 @@ class UI extends UI_Default {
$view->setParam('enablecalendar', $settings->_enableCalendar);
$view->setParam('calendardefaultview', $settings->_calendarDefaultView);
$view->setParam('enablefullsearch', $settings->_enableFullSearch);
$view->setParam('enablehelp', $settings->_enableHelp);
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
$view->setParam('printdisclaimer', $settings->_printDisclaimer);
$view->setParam('footnote', $settings->_footNote);

View File

@ -19,7 +19,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Translators: Admin (2161), dgrutsch (21)
// Translators: Admin (2162), dgrutsch (21)
$text = array(
'accept' => 'Übernehmen',
@ -1015,7 +1015,7 @@ URL: [url]',
'settings_enableFullSearch' => 'Volltextsuche einschalten',
'settings_enableFullSearch_desc' => 'Anwählen, um die Volltextsuche mittels Lucene einzuschalten.',
'settings_enableGuestAutoLogin' => 'Automatische Anmeldung als Gast',
'settings_enableGuestAutoLogin_desc' => '',
'settings_enableGuestAutoLogin_desc' => 'Wenn das Gast-Login und automatisches Anmelden eingeschaltet ist, dann wird der Gast-Benutzer sofort angemeldet.',
'settings_enableGuestLogin' => 'Anmeldung als Gast',
'settings_enableGuestLogin_desc' => 'Wenn Sie Gast-Logins erlauben wollen, dann wählen Sie diese Option an. Anmerkung: Gast-Logins sollten nur in einer vertrauenswürdigen Umgebung erlaubt werden.',
'settings_enableHelp' => 'Hilfe einschalten',

View File

@ -19,7 +19,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Translators: Admin (1296), dgrutsch (7), netixw (14)
// Translators: Admin (1297), dgrutsch (7), netixw (14)
$text = array(
'accept' => 'Accept',
@ -985,7 +985,7 @@ URL: [url]',
'settings_defaultSearchMethod' => 'Default search method',
'settings_defaultSearchMethod_desc' => 'Default search method, when a search is started by the search form in the main menu.',
'settings_defaultSearchMethod_valdatabase' => 'database',
'settings_defaultSearchMethod_valfulltext' => 'Fulltext',
'settings_defaultSearchMethod_valfulltext' => 'fulltext',
'settings_delete_install_folder' => 'In order to use SeedDMS, you must delete the file ENABLE_INSTALL_TOOL in the configuration directory',
'settings_disableSelfEdit' => 'Disable Self Edit',
'settings_disableSelfEdit_desc' => 'If checked user cannot edit his own profile',

View File

@ -19,7 +19,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Translators: acabello (20), Admin (980), angel (123), francisco (2), jaimem (14)
// Translators: acabello (20), Admin (981), angel (123), francisco (2), jaimem (14)
$text = array(
'accept' => 'Aceptar',
@ -984,7 +984,7 @@ URL: [url]',
'settings_enableFullSearch' => 'Habilitar búsqueda de texto completo',
'settings_enableFullSearch_desc' => 'Habilitar búsqueda de texto completo',
'settings_enableGuestAutoLogin' => '',
'settings_enableGuestAutoLogin_desc' => 'Wenn das Gast-Login und automatisches Anmelden eingeschaltet ist, dann wird der Gast-Benutzer sofort angemeldet.',
'settings_enableGuestAutoLogin_desc' => '',
'settings_enableGuestLogin' => 'Habilitar acceso de invitado',
'settings_enableGuestLogin_desc' => 'Si quiere que cualquiera acceda como invitado, chequee esta opción. Nota: El acceso de invitado debería permitirse solo en entornos de confianza',
'settings_enableHelp' => '',

View File

@ -68,12 +68,14 @@ if ($action == "saveSettings")
$settings->_enableUsersView = getBoolValue("enableUsersView");
$settings->_enableFullSearch = getBoolValue("enableFullSearch");
$settings->_fullSearchEngine = $_POST["fullSearchEngine"];
$settings->_defaultSearchMethod = $_POST["defaultSearchMethod"];
$settings->_enableClipboard = getBoolValue("enableClipboard");
$settings->_enableDropUpload = getBoolValue("enableDropUpload");
$settings->_enableFolderTree = getBoolValue("enableFolderTree");
$settings->_enableRecursiveCount = getBoolValue("enableRecursiveCount");
$settings->_maxRecursiveCount = intval($_POST["maxRecursiveCount"]);
$settings->_enableLanguageSelector = getBoolValue("enableLanguageSelector");
$settings->_enableHelp = getBoolValue("enableHelp");
$settings->_enableThemeSelector = getBoolValue("enableThemeSelector");
$settings->_expandFolderTree = intval($_POST["expandFolderTree"]);
$settings->_stopWordsFile = $_POST["stopWordsFile"];

View File

@ -59,7 +59,7 @@ if (isset($_GET["navBar"])) {
*/
}
if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
if((isset($_GET["fullsearch"]) && $_GET["fullsearch"] || $settings->_defaultSearchMethod == 'fulltext') && $settings->_enableFullSearch) {
// Search in Fulltext {{{
if (isset($_GET["query"]) && is_string($_GET["query"])) {
$query = $_GET["query"];
@ -407,7 +407,7 @@ if(count($entries) == 1) {
if($view) {
$view->setParam('totaldocs', $dcount /*resArr['totalDocs']*/);
$view->setParam('totalfolders', $fcount /*resArr['totalFolders']*/);
$view->setParam('fullsearch', (isset($_GET["fullsearch"]) && $_GET["fullsearch"]) ? true : false);
$view->setParam('fullsearch', ((isset($_GET["fullsearch"]) && $_GET["fullsearch"] || $settings->_defaultSearchMethod == 'fulltext') && $settings->_enableFullSearch) ? true : false);
$view->setParam('mode', isset($mode) ? $mode : '');
$view->setParam('resultmode', isset($resultmode) ? $resultmode : '');
$view->setParam('searchin', isset($searchin) ? $searchin : array());

View File

@ -293,8 +293,10 @@ $(document).ready(function () {
// echo " <li><a href=\"../out/out.SearchForm.php?folderid=".$this->params['rootfolderid']."\">".getMLText("search")."</a></li>\n";
if ($this->params['enablecalendar']) echo " <li><a href=\"../out/out.Calendar.php?mode=".$this->params['calendardefaultview']."\">".getMLText("calendar")."</a></li>\n";
if ($this->params['user']->isAdmin()) echo " <li><a href=\"../out/out.AdminTools.php\">".getMLText("admin_tools")."</a></li>\n";
if($this->params['enablehelp']) {
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
echo " <li><a href=\"../out/out.Help.php?context=".$tmp[1]."\">".getMLText("help")."</a></li>\n";
}
echo " </ul>\n";
echo " <form action=\"../out/out.Search.php\" class=\"form-inline navbar-search pull-left\" autocomplete=\"off\">";
if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), "SeedDMS_Core_Folder")) {
@ -306,9 +308,9 @@ $(document).ready(function () {
echo " <input type=\"hidden\" name=\"searchin[]\" value=\"3\" />";
echo " <input type=\"hidden\" name=\"searchin[]\" value=\"4\" />";
echo " <input name=\"query\" class=\"search-query\" id=\"searchfield\" data-provide=\"typeahead\" type=\"text\" style=\"width: 150px;\" placeholder=\"".getMLText("search")."\"/>";
if($this->params['enablefullsearch']) {
echo " <label class=\"checkbox\" style=\"color: #999999;\"><input type=\"checkbox\" name=\"fullsearch\" value=\"1\" title=\"".getMLText('fullsearch_hint')."\"/> ".getMLText('fullsearch')."</label>";
}
// if($this->params['enablefullsearch']) {
// echo " <label class=\"checkbox\" style=\"color: #999999;\"><input type=\"checkbox\" name=\"fullsearch\" value=\"1\" title=\"".getMLText('fullsearch_hint')."\"/> ".getMLText('fullsearch')."</label>";
// }
// echo " <input type=\"submit\" value=\"".getMLText("search")."\" id=\"searchButton\" class=\"btn\"/>";
echo "</form>\n";
echo " </div>\n";

View File

@ -189,6 +189,15 @@ if(!is_writeable($settings->_configFilePath)) {
</select>
</td>
</tr>
<tr title="<?php printMLText("settings_defaultSearchMethod_desc");?>">
<td><?php printMLText("settings_defaultSearchMethod");?>:</td>
<td>
<select name="defaultSearchMethod">
<option value="database" <?php if ($settings->_defaultSearchMethod=='database') echo "selected" ?>><?php printMLText("settings_defaultSearchMethod_valdatabase");?></option>
<option value="fulltext" <?php if ($settings->_defaultSearchMethod=='fulltext') echo "selected" ?>><?php printMLText("settings_defaultSearchMethod_valfulltext");?></option>
</select>
</td>
</tr>
<tr title="<?php printMLText("settings_stopWordsFile_desc");?>">
<td><?php printMLText("settings_stopWordsFile");?>:</td>
<td><?php $this->showTextField("stopWordsFile", $settings->_stopWordsFile); ?></td>
@ -226,6 +235,10 @@ if(!is_writeable($settings->_configFilePath)) {
<td><?php printMLText("settings_enableLanguageSelector");?>:</td>
<td><input name="enableLanguageSelector" type="checkbox" <?php if ($settings->_enableLanguageSelector) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableHelp_desc");?>">
<td><?php printMLText("settings_enableHelp");?>:</td>
<td><input name="enableHelp" type="checkbox" <?php if ($settings->_enableHelp) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableThemeSelector_desc");?>">
<td><?php printMLText("settings_enableThemeSelector");?>:</td>
<td><input name="enableThemeSelector" type="checkbox" <?php if ($settings->_enableThemeSelector) echo "checked" ?> /></td>