From de7d7c2dbc3430140fac70bab0c907018fb682e3 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 11 Aug 2015 22:30:46 +0200 Subject: [PATCH 1/5] add translations for hr_HR and ko_KR --- languages/es_ES/lang.inc | 6 +++--- languages/nl_NL/lang.inc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/es_ES/lang.inc b/languages/es_ES/lang.inc index f4b65e580..7ded19a0e 100644 --- a/languages/es_ES/lang.inc +++ b/languages/es_ES/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: acabello (20), Admin (948), angel (123), francisco (2), jaimem (14) +// Translators: acabello (20), Admin (950), angel (123), francisco (2), jaimem (14) $text = array( 'accept' => 'Aceptar', @@ -473,7 +473,7 @@ URL: [url]', 'home_folder' => '', 'hourly' => 'Horaria', 'hours' => 'horas', -'hr_HR' => '', +'hr_HR' => 'Croata', 'human_readable' => 'Archivo legible por humanos', 'hu_HU' => 'Hungaro', 'id' => 'ID', @@ -536,7 +536,7 @@ URL: [url]', 'keep_doc_status' => 'Mantener estado del documento', 'keywords' => 'Palabras clave', 'keyword_exists' => 'La palabra clave ya existe', -'ko_KR' => '', +'ko_KR' => 'Coreano', 'language' => 'Idioma', 'lastaccess' => 'Último acceso', 'last_update' => 'Última modificación', diff --git a/languages/nl_NL/lang.inc b/languages/nl_NL/lang.inc index e51e021e8..97971ce4d 100644 --- a/languages/nl_NL/lang.inc +++ b/languages/nl_NL/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 (699), pepijn (45), reinoutdijkstra@hotmail.com (270) +// Translators: Admin (701), pepijn (45), reinoutdijkstra@hotmail.com (270) $text = array( 'accept' => 'Accept', @@ -466,7 +466,7 @@ URL: [url]', 'home_folder' => '', 'hourly' => 'Elk uur', 'hours' => 'uren', -'hr_HR' => '', +'hr_HR' => 'Kroatisch', 'human_readable' => 'Leesbaar Archief', 'hu_HU' => 'Hongaars', 'id' => 'ID', @@ -529,7 +529,7 @@ URL: [url]', 'keep_doc_status' => 'Behoud document status', 'keywords' => 'Sleutelwoorden', 'keyword_exists' => 'Sleutelwoord bestaat al', -'ko_KR' => '', +'ko_KR' => 'Koreaans', 'language' => 'Talen', 'lastaccess' => '', 'last_update' => 'Laatste Update', From 36fff2cfcb81f70739d2580bd9cba9ec4c9a534b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 12 Aug 2015 17:12:41 +0200 Subject: [PATCH 2/5] index mimetype and orgfilename --- SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php index a1abab017..a0fbac574 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php @@ -57,7 +57,7 @@ class SeedDMS_SQLiteFTS_Indexer { static function create($indexerDir) { /* {{{ */ unlink($indexerDir.'/index.db'); $index = new SeedDMS_SQLiteFTS_Indexer($indexerDir); - $sql = 'CREATE VIRTUAL TABLE docs USING fts4(title, comment, keywords, category, owner, content, created, notindexed=created, matchinfo=fts3)'; + $sql = 'CREATE VIRTUAL TABLE docs USING fts4(title, comment, keywords, category, mimetype, orgfilename, owner, content, created, notindexed=created, matchinfo=fts3)'; $res = $index->_conn->exec($sql); if($res === false) { return null; @@ -88,7 +88,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(!$this->_conn) return false; - $sql = "INSERT INTO docs (docid, title, comment, keywords, category, owner, content, created) VALUES(".$doc->getFieldValue('document_id').", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($doc->getFieldValue('comment')).", ".$this->_conn->quote($doc->getFieldValue('keywords')).", ".$this->_conn->quote($doc->getFieldValue('category')).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($doc->getFieldValue('content')).", ".time().")"; + $sql = "INSERT INTO docs (docid, title, comment, keywords, category, owner, content, mimetype, orgfilename, created) VALUES(".$doc->getFieldValue('document_id').", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($doc->getFieldValue('comment')).", ".$this->_conn->quote($doc->getFieldValue('keywords')).", ".$this->_conn->quote($doc->getFieldValue('category')).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($doc->getFieldValue('content')).", ".$this->_conn->quote($doc->getFieldValue('mimetype')).", ".$this->_conn->quote($doc->getFieldValue('orgfilename')).", ".time().")"; $res = $this->_conn->exec($sql); if($res === false) { var_dump($this->_conn->errorInfo()); @@ -180,7 +180,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(!$this->_conn) return false; - $sql = "SELECT title, comment, owner, keywords, category, created FROM docs WHERE docid=".(int) $id; + $sql = "SELECT title, comment, owner, keywords, category, mimetype, orgfilename, created FROM docs WHERE docid=".(int) $id; $res = $this->_conn->query($sql); $doc = false; if($res) { @@ -190,6 +190,8 @@ class SeedDMS_SQLiteFTS_Indexer { $doc->addField('comment', $rec['comment']); $doc->addField('keywords', $rec['keywords']); $doc->addField('category', $rec['category']); + $doc->addField('mimetype', $rec['mimetype']); + $doc->addField('orgfilename', $rec['orgfilename']); $doc->addField('owner', $rec['owner']); $doc->addField('created', $rec['created']); } From 6eb37664e9bbbb13dc4f694ac327c12417da0fb5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 13 Aug 2015 08:16:19 +0200 Subject: [PATCH 3/5] do not use AND in query string, precede query term with : --- SeedDMS_SQLiteFTS/SQLiteFTS/Search.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php index 1226eaded..18b20fdaf 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php @@ -68,17 +68,19 @@ class SeedDMS_SQliteFTS_Search { } if($owner) { if($querystr) - $querystr .= ' AND '; + $querystr .= ' '; + //$querystr .= ' AND '; $querystr .= 'owner:'.$owner; + //$querystr .= $owner; } if($categories) { if($querystr) - $querystr .= ' AND '; + $querystr .= ' '; + //$querystr .= ' AND '; $querystr .= 'category:'; $querystr .= implode(' OR category:', $categories); $querystr .= ''; } -// echo $querystr; try { $hits = $this->index->find($querystr); $recs = array(); From b692439165e605974274bd5219020c902493c008 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 13 Aug 2015 08:17:03 +0200 Subject: [PATCH 4/5] replace orgfilename by origfilename --- SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php | 11 +++++++---- SeedDMS_SQLiteFTS/SQLiteFTS/Term.php | 8 +++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php index a0fbac574..8a311cd50 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php @@ -57,7 +57,10 @@ class SeedDMS_SQLiteFTS_Indexer { static function create($indexerDir) { /* {{{ */ unlink($indexerDir.'/index.db'); $index = new SeedDMS_SQLiteFTS_Indexer($indexerDir); - $sql = 'CREATE VIRTUAL TABLE docs USING fts4(title, comment, keywords, category, mimetype, orgfilename, owner, content, created, notindexed=created, matchinfo=fts3)'; + /* Make sure the sequence of fields is identical to the field list + * in SeedDMS_SQLiteFTS_Term + */ + $sql = 'CREATE VIRTUAL TABLE docs USING fts4(title, comment, keywords, category, mimetype, origfilename, owner, content, created, notindexed=created, matchinfo=fts3)'; $res = $index->_conn->exec($sql); if($res === false) { return null; @@ -88,7 +91,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(!$this->_conn) return false; - $sql = "INSERT INTO docs (docid, title, comment, keywords, category, owner, content, mimetype, orgfilename, created) VALUES(".$doc->getFieldValue('document_id').", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($doc->getFieldValue('comment')).", ".$this->_conn->quote($doc->getFieldValue('keywords')).", ".$this->_conn->quote($doc->getFieldValue('category')).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($doc->getFieldValue('content')).", ".$this->_conn->quote($doc->getFieldValue('mimetype')).", ".$this->_conn->quote($doc->getFieldValue('orgfilename')).", ".time().")"; + $sql = "INSERT INTO docs (docid, title, comment, keywords, category, owner, content, mimetype, origfilename, created) VALUES(".$doc->getFieldValue('document_id').", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($doc->getFieldValue('comment')).", ".$this->_conn->quote($doc->getFieldValue('keywords')).", ".$this->_conn->quote($doc->getFieldValue('category')).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($doc->getFieldValue('content')).", ".$this->_conn->quote($doc->getFieldValue('mimetype')).", ".$this->_conn->quote($doc->getFieldValue('origfilename')).", ".time().")"; $res = $this->_conn->exec($sql); if($res === false) { var_dump($this->_conn->errorInfo()); @@ -180,7 +183,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(!$this->_conn) return false; - $sql = "SELECT title, comment, owner, keywords, category, mimetype, orgfilename, created FROM docs WHERE docid=".(int) $id; + $sql = "SELECT title, comment, owner, keywords, category, mimetype, origfilename, created FROM docs WHERE docid=".(int) $id; $res = $this->_conn->query($sql); $doc = false; if($res) { @@ -191,7 +194,7 @@ class SeedDMS_SQLiteFTS_Indexer { $doc->addField('keywords', $rec['keywords']); $doc->addField('category', $rec['category']); $doc->addField('mimetype', $rec['mimetype']); - $doc->addField('orgfilename', $rec['orgfilename']); + $doc->addField('origfilename', $rec['origfilename']); $doc->addField('owner', $rec['owner']); $doc->addField('created', $rec['created']); } diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php index eb87f1a6b..ae768b245 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php @@ -52,9 +52,11 @@ class SeedDMS_SQLiteFTS_Term { 1 => 'comment', 2 => 'keywords', 3 => 'category', - 4 => 'owner', - 5 => 'content', - 6 => 'created' + 4 => 'mimetype', + 5 => 'origfilename', + 6 => 'owner', + 7 => 'content', + 8 => 'created' ); $this->field = $fields[$col]; $this->_occurrence = $occurrence; From 3687cceb3fe00594f7a26884ce248a5f39ce3708 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 13 Aug 2015 08:17:39 +0200 Subject: [PATCH 5/5] make fulltext search form at least 330px needed because the user selection will be cut off otherwise --- views/bootstrap/class.Search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 7de29335e..7abe14499 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -355,7 +355,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style { echo "
\n"; $this->contentContainerStart(); ?> -
+