From 01449f66e368e02b1ca8ddbf801ad078273c1cbd Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 25 Sep 2015 16:16:48 +0200 Subject: [PATCH 1/5] check if data-query is set in div.ajax elements, pass it to the url --- styles/bootstrap/application.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index b440132bb..bc750fb96 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -406,9 +406,13 @@ $(document).ready( function() { var href = element.data('href'); var view = element.data('view'); var action = element.data('action'); - if(view && action) + var query = element.data('query'); + if(view && action) { url = "out."+view+".php?action="+action; - else + if(query) { + url += "&"+query; + } + } else url = href; // console.log('Calling '+url); $.get(url, function(data) { From 23362f81464002dc4e6cdf557d8e6d76b96f21e5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 25 Sep 2015 16:17:23 +0200 Subject: [PATCH 2/5] remove old code, set data-query in div.ajax elements load an initial user when the page is opened --- views/bootstrap/class.UsrMgr.php | 33 ++------------------------------ 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/views/bootstrap/class.UsrMgr.php b/views/bootstrap/class.UsrMgr.php index f7565fbc6..c0d49370a 100644 --- a/views/bootstrap/class.UsrMgr.php +++ b/views/bootstrap/class.UsrMgr.php @@ -406,21 +406,6 @@ function showUser(selectObj) { id = selectObj.options[selectObj.selectedIndex].value; $('div.ajax').trigger('update', {userid: id}); } - - -obj = -1; -function showUser(selectObj) { - if (obj != -1) - obj.style.display = "none"; - - id = selectObj.options[selectObj.selectedIndex].value; - if (id == -1) - return; - - obj = document.getElementById("keywords" + id); - obj.style.display = ""; -} - contentHeading(getMLText("user_management")); @@ -444,26 +429,12 @@ function showUser(selectObj) { ?> -
+
getID()."\"" : "") ?>>
-
- - - -getID()."\" style=\"display : none;\">"; - $this->showUserForm($currUser); - print "
\n"; - } - endif; -?> -
+
getID()."\"" : "") ?>>
From 9514115460ca2951215f8ca8656366d9481520e4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 28 Sep 2015 06:39:26 +0200 Subject: [PATCH 3/5] rename doNotCheckVersion to doNotCheckDBVersion --- inc/inc.ClassSettings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 984f1dce5..fe5beb606 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -443,7 +443,7 @@ class Settings { /* {{{ */ $this->_dbDatabase = strval($tab["dbDatabase"]); $this->_dbUser = strval($tab["dbUser"]); $this->_dbPass = strval($tab["dbPass"]); - $this->_doNotCheckDBVersion = Settings::boolVal($tab["doNotCheckVersion"]); + $this->_doNotCheckDBVersion = Settings::boolVal($tab["doNotCheckDBVersion"]); // XML Path: /configuration/system/smtp $node = $xml->xpath('/configuration/system/smtp'); @@ -722,7 +722,7 @@ class Settings { /* {{{ */ $this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase); $this->setXMLAttributValue($node, "dbUser", $this->_dbUser); $this->setXMLAttributValue($node, "dbPass", $this->_dbPass); - $this->setXMLAttributValue($node, "doNotCheckVersion", $this->_doNotCheckVersion); + $this->setXMLAttributValue($node, "doNotCheckVersion", $this->_doNotCheckDBVersion); // XML Path: /configuration/system/smtp $node = $this->getXMLNode($xml, '/configuration/system', 'smtp'); From 7e507e6a9e37074f4a2be0b2d5117b49bda76aa7 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 28 Sep 2015 12:32:41 +0200 Subject: [PATCH 4/5] fix searching in fulltext, number of hits and pages was often wrong --- op/op.Search.php | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/op/op.Search.php b/op/op.Search.php index 2b47cf0ed..966c59c58 100644 --- a/op/op.Search.php +++ b/op/op.Search.php @@ -99,7 +99,6 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) { } } - // --------------- Suche starten -------------------------------------------- // Check to see if the search has been restricted to a particular @@ -121,10 +120,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) { if(strlen($query) < 4 && strpos($query, '*')) { $session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm'))); - $resArr = array(); - $resArr['totalDocs'] = 0; - $resArr['totalFolders'] = 0; - $resArr['totalPages'] = 0; + $totalPages = 0; $entries = array(); $searchTime = 0; } else { @@ -134,26 +130,10 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) { $hits = $lucenesearch->search($query, $owner ? $owner->getLogin() : '', '', $categorynames); if($hits === false) { $session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm'))); - $resArr = array(); - $resArr['totalDocs'] = 0; - $resArr['totalFolders'] = 0; - $resArr['totalPages'] = 0; + $totalPages = 0; $entries = array(); $searchTime = 0; } else { - $limit = 20; - $resArr = array(); - $resArr['totalDocs'] = count($hits); - $resArr['totalFolders'] = 0; - if($pageNumber != 'all' && count($hits) > $limit) { - $resArr['totalPages'] = (int) (count($hits) / $limit); - if ((count($hits)%$limit) > 0) - $resArr['totalPages']++; - $hits = array_slice($hits, ($pageNumber-1)*$limit, $limit); - } else { - $resArr['totalPages'] = 1; - } - $entries = array(); $dcount = 0; $fcount = 0; @@ -167,6 +147,16 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) { } } } + $limit = 20; + if($pageNumber != 'all' && count($entries) > $limit) { + $totalPages = (int) (count($entries)/$limit); + if(count($entries)%$limit) + $totalPages++; + if($limit > 0) + $entries = array_slice($entries, ($pageNumber-1)*$limit, $limit); + } else { + $totalPages = 1; + } } $searchTime = getTime() - $startTime; $searchTime = round($searchTime, 2); From a91d385ee873a913c7b8d785963cd33866a2e645 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 28 Sep 2015 12:34:38 +0200 Subject: [PATCH 5/5] add some translations for timeline --- languages/hu_HU/lang.inc | 4 ++-- languages/it_IT/lang.inc | 6 +++--- languages/sv_SE/lang.inc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/languages/hu_HU/lang.inc b/languages/hu_HU/lang.inc index 533644f2e..7baaf6748 100644 --- a/languages/hu_HU/lang.inc +++ b/languages/hu_HU/lang.inc @@ -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 (570), ribaz (1019) +// Translators: Admin (571), ribaz (1019) $text = array( 'accept' => 'Elfogad', @@ -1236,7 +1236,7 @@ URL: [url]', 'theme' => 'Téma', 'thursday' => 'Csütörtök', 'thursday_abbr' => 'Cs', -'timeline' => '', +'timeline' => 'Vremenska crta', 'timeline_add_file' => '', 'timeline_add_version' => '', 'timeline_full_add_file' => '', diff --git a/languages/it_IT/lang.inc b/languages/it_IT/lang.inc index 8eab708f5..a8751e86d 100644 --- a/languages/it_IT/lang.inc +++ b/languages/it_IT/lang.inc @@ -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 (1500), s.pnt (26) +// Translators: Admin (1502), s.pnt (26) $text = array( 'accept' => 'Accetta', @@ -1273,7 +1273,7 @@ URL: [url]', 'timeline_skip_status_change_1' => '', 'timeline_skip_status_change_2' => '', 'timeline_skip_status_change_3' => '', -'timeline_status_change' => '', +'timeline_status_change' => 'Versione - Stato', 'to' => 'A', 'toggle_manager' => 'Gestore', 'to_before_from' => 'La data di fine non può essere antecedente a quella di inizio', @@ -1295,7 +1295,7 @@ URL: [url]', 'transmittal_comment' => 'Commento', 'transmittal_name' => 'Nome', 'transmittal_size' => 'Dimensione', -'tree_loading' => '', +'tree_loading' => 'Caricamento directory in corso', 'trigger_workflow' => 'Flusso di lavoro', 'tr_TR' => 'Turco', 'tuesday' => 'Martedì', diff --git a/languages/sv_SE/lang.inc b/languages/sv_SE/lang.inc index 93c312087..0a67cba3f 100644 --- a/languages/sv_SE/lang.inc +++ b/languages/sv_SE/lang.inc @@ -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 (1097), tmichelfelder (106) +// Translators: Admin (1098), tmichelfelder (106) $text = array( 'accept' => 'Godkänn', @@ -1222,7 +1222,7 @@ URL: [url]', 'theme' => 'Visningstema', 'thursday' => 'torsdag', 'thursday_abbr' => 'to', -'timeline' => '', +'timeline' => 'Tidslinje', 'timeline_add_file' => '', 'timeline_add_version' => '', 'timeline_full_add_file' => '',