From 72d9e1a27cd7a1ec5b81e472bd02b50b27372676 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 25 Feb 2016 10:26:26 +0100 Subject: [PATCH 1/3] use cmdTimeout from settings --- utils/indexer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/indexer.php b/utils/indexer.php index d8170469a..5b7fc36cf 100644 --- a/utils/indexer.php +++ b/utils/indexer.php @@ -83,7 +83,7 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */ $lucenesearch = new $indexconf['Search']($index); if(!($hit = $lucenesearch->getDocument($document->getId()))) { try { - $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false)); + $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout)); echo " (Document added)\n"; } catch(Exception $e) { echo " (Timeout)\n"; @@ -100,7 +100,7 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */ } else { if($index->delete($hit->id)) { try { - $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false)); + $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout)); echo " (Document updated)\n"; } catch(Exception $e) { echo " (Timeout)\n"; From d984f758718eab54eef0e11f741a24af776f0dcb Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 25 Feb 2016 10:49:18 +0100 Subject: [PATCH 2/3] set $objvalue in printAttributeEditField() --- views/bootstrap/class.Bootstrap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index d9b087381..4be8b176f 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1102,6 +1102,7 @@ $('#acceptkeywords').click(function(ev) { echo "getId()."]\" value=\"1\" ".(($attribute && $attribute->getValue()) ? 'checked' : '')." />"; break; case SeedDMS_Core_AttributeDefinition::type_date: + $objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : ''; ?> "> From 0369e95157344d4b9a745dfa1d8af3d6f9709785 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 26 Feb 2016 08:17:30 +0100 Subject: [PATCH 3/3] add fold marks --- inc/inc.Utils.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 8342681f7..28c33937d 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -26,13 +26,13 @@ function formatted_size($size_bytes) { /* {{{ */ return number_format($size_bytes,0,"","")." Bytes"; } /* }}} */ -function getReadableDate($timestamp) { +function getReadableDate($timestamp) { /* {{{ */ return date("Y-m-d", $timestamp); -} +} /* }}} */ -function getLongReadableDate($timestamp) { +function getLongReadableDate($timestamp) { /* {{{ */ return date("Y-m-d H:i:s", $timestamp); -} +} /* }}} */ /* * Converts a date/time string into a timestamp @@ -40,7 +40,7 @@ function getLongReadableDate($timestamp) { * @param $date string date in form Y-m-d H:i:s * @return integer/boolean unix timestamp or false in case of an error */ -function makeTsFromLongDate($date) { /* }}} */ +function makeTsFromLongDate($date) { /* {{{ */ $tmp = explode(' ', $date); if(count($tmp) != 2) return false; @@ -52,16 +52,16 @@ function makeTsFromLongDate($date) { /* }}} */ return $ts; } /* }}} */ -function getReadableDuration($secs) { +function getReadableDuration($secs) { /* {{{ */ $s = ""; foreach ( getReadableDurationArray($secs) as $k => $v ) { if ( $v ) $s .= $v." ".($v==1? substr($k,0,-1) : $k).", "; } return substr($s, 0, -2); -} +} /* }}} */ -function getReadableDurationArray($secs) { +function getReadableDurationArray($secs) { /* {{{ */ $units = array( getMLText("weeks") => 7*24*3600, getMLText("days") => 24*3600, @@ -77,7 +77,7 @@ function getReadableDurationArray($secs) { } return $units; -} +} /* }}} */ // // The original string sanitizer, kept for reference.