diff --git a/CHANGELOG b/CHANGELOG index 916a3e1b4..dcf08821a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ -------------------------------------------------------------------------------- - cancel checkout needs confirmation - add input field to filter list of recipients if more then 10 +- add task for creating missing preview images -------------------------------------------------------------------------------- Changes in version 6.0.15 @@ -213,6 +214,13 @@ - output path of parent folder in many document/folder lists - list affected documents when transfering processes to another user - check for quota and duplicate content in restapi +- remove preview images before removing document +- fixed error due to multiple declared function when controller method + RemoveFolder::run was called more than once +- fix php error setting mandatory workflow when uploading documents via webdav +- typeahead search for folders can search in subfolders +- new theme based on bootstrap 4, including many improvements on small displays +- propperly check for translation of html email body (Closes: #510) -------------------------------------------------------------------------------- Changes in version 5.1.22 diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index dc3c3b374..5fc0098c7 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -4207,7 +4207,13 @@ class SeedDMS_Core_DMS { /** @var SeedDMS_Core_Document[] $timeline */ $timeline = array(); - $queryStr = "SELECT DISTINCT document FROM `tblDocumentContent` WHERE `date` > ".$startts." AND `date` < ".$endts." OR `revisiondate` > '".date('Y-m-d H:i:s', $startts)."' AND `revisiondate` < '".date('Y-m-d H:i:s', $endts)."' UNION SELECT DISTINCT document FROM `tblDocumentFiles` WHERE `date` > ".$startts." AND `date` < ".$endts; + if(0) { + $queryStr = "SELECT DISTINCT `document` FROM `tblDocumentContent` WHERE `date` > ".$startts." AND `date` < ".$endts." OR `revisiondate` > '".date('Y-m-d H:i:s', $startts)."' AND `revisiondate` < '".date('Y-m-d H:i:s', $endts)."' UNION SELECT DISTINCT `document` FROM `tblDocumentFiles` WHERE `date` > ".$startts." AND `date` < ".$endts; + } else { + $startdate = date('Y-m-d H:i:s', $startts); + $enddate = date('Y-m-d H:i:s', $endts); + $queryStr = "SELECT DISTINCT `documentID` AS `document` FROM `tblDocumentStatus` LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatus`.`statusId`=`tblDocumentStatusLog`.`statusID` WHERE `date` > ".$this->db->qstr($startdate)." AND `date` < ".$this->db->qstr($enddate)." UNION SELECT DISTINCT document FROM `tblDocumentFiles` WHERE `date` > ".$this->db->qstr($startdate)." AND `date` < ".$this->db->qstr($enddate)." UNION SELECT DISTINCT `document` FROM `tblDocumentFiles` WHERE `date` > ".$startts." AND `date` < ".$endts; + } $resArr = $this->db->getResultArray($queryStr); if ($resArr === false) return false; diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 68c6b6e8d..37e85f73a 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -12,8 +12,8 @@ uwe@steinmann.cx yes - 2021-04-07 - + 2021-05-07 + 6.1.0 6.1.0 @@ -1886,6 +1886,22 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp() problem when removing a document + + 2021-05-07 + + + 5.1.23 + 5.1.23 + + + stable + stable + + GPL License + +- SeedDMS_Core_DMS::getTimeline() uses status log instead of document content + + 2017-02-28 diff --git a/SeedDMS_Lucene/Lucene/IndexedDocument.php b/SeedDMS_Lucene/Lucene/IndexedDocument.php index f4ef10432..a0b1b8ae7 100644 --- a/SeedDMS_Lucene/Lucene/IndexedDocument.php +++ b/SeedDMS_Lucene/Lucene/IndexedDocument.php @@ -40,9 +40,11 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { protected $cmd; /** + * Run a shell command + * * @param $cmd * @param int $timeout - * @return string + * @return array * @throws Exception */ static function execWithTimeout($cmd, $timeout=2) { /* {{{ */ @@ -54,7 +56,11 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { $pipes = array(); $timeout += time(); - $process = proc_open($cmd, $descriptorspec, $pipes); + // Putting an 'exec' before the command will not fork the command + // and therefore not create any child process. proc_terminate will + // then reliably terminate the cmd and not just shell. See notes of + // https://www.php.net/manual/de/function.proc-terminate.php + $process = proc_open('exec '.$cmd, $descriptorspec, $pipes); if (!is_resource($process)) { throw new Exception("proc_open failed on: " . $cmd); } @@ -79,11 +85,15 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { $timeleft = $timeout - time(); } while (!feof($pipes[1]) && $timeleft > 0); + fclose($pipes[0]); + fclose($pipes[1]); + fclose($pipes[2]); if ($timeleft <= 0) { proc_terminate($process); throw new Exception("command timeout on: " . $cmd); } else { - return array('stdout'=>$output, 'stderr'=>$error); + $return_value = proc_close($process); + return array('stdout'=>$output, 'stderr'=>$error, 'return'=>$return_value); } } /* }}} */ diff --git a/SeedDMS_Lucene/package.xml b/SeedDMS_Lucene/package.xml index 8d80f829e..01192ead0 100644 --- a/SeedDMS_Lucene/package.xml +++ b/SeedDMS_Lucene/package.xml @@ -11,11 +11,11 @@ uwe@steinmann.cx yes - 2020-12-12 + 2021-05-10 - 1.1.16 - 1.1.16 + 1.1.17 + 1.1.17 stable @@ -23,7 +23,7 @@ GPL License -- add indexing of folders +- close pipes in execWithTimeout(), also return exit code of command @@ -352,5 +352,21 @@ Index users with at least read access on the document and SeedDMS_Lucene_Indexer::open() + + 2020-12-12 + + + 1.1.16 + 1.1.16 + + + stable + stable + + GPL License + +- add indexing of folders + + diff --git a/SeedDMS_Preview/Preview/Base.php b/SeedDMS_Preview/Preview/Base.php index 415afe4e4..ce2f16ea9 100644 --- a/SeedDMS_Preview/Preview/Base.php +++ b/SeedDMS_Preview/Preview/Base.php @@ -71,6 +71,14 @@ class SeedDMS_Preview_Base { $this->xsendfile = $xsendfile; } /* }}} */ + /** + * Run a shell command + * + * @param $cmd + * @param int $timeout + * @return array + * @throws Exception + */ static function execWithTimeout($cmd, $timeout=5) { /* {{{ */ $descriptorspec = array( 0 => array("pipe", "r"), @@ -109,11 +117,15 @@ class SeedDMS_Preview_Base { $timeleft = $timeout - time(); } while (!feof($pipes[1]) && $timeleft > 0); + fclose($pipes[0]); + fclose($pipes[1]); + fclose($pipes[2]); if ($timeleft <= 0) { proc_terminate($process); throw new Exception("command timeout on: " . $cmd); } else { - return array('stdout'=>$output, 'stderr'=>$error); + $return_value = proc_close($process); + return array('stdout'=>$output, 'stderr'=>$error, 'return'=>$return_value); } } /* }}} */ diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php index ba69b75a4..32a06cc89 100644 --- a/SeedDMS_Preview/Preview/Previewer.php +++ b/SeedDMS_Preview/Preview/Previewer.php @@ -89,7 +89,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { * @param string $target optional name of preview image (without extension) * @return boolean true on success, false on failure */ - public function createRawPreview($infile, $dir, $mimetype, $width=0, $target='') { /* {{{ */ + public function createRawPreview($infile, $dir, $mimetype, $width=0, $target='', &$new=false) { /* {{{ */ if($width == 0) $width = $this->width; else @@ -120,6 +120,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { if($cmd) { try { self::execWithTimeout($cmd, $this->timeout); + $new = true; } catch(Exception $e) { $this->lastpreviewfile = ''; return false; @@ -127,6 +128,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { } return true; } + $new = false; return true; } /* }}} */ @@ -144,7 +146,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { * @param integer $width desired width of preview image * @return boolean true on success, false on failure */ - public function createPreview($object, $width=0) { /* {{{ */ + public function createPreview($object, $width=0, &$new=false) { /* {{{ */ if(!$object) return false; @@ -155,7 +157,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { $document = $object->getDocument(); $file = $document->_dms->contentDir.$object->getPath(); $target = $this->getFileName($object, $width); - return $this->createRawPreview($file, $document->getDir(), $object->getMimeType(), $width, $target); + return $this->createRawPreview($file, $document->getDir(), $object->getMimeType(), $width, $target, $new); } /* }}} */ /** diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index 715278e1a..fa544e705 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -14,8 +14,8 @@ 2020-12-23 - 1.3.2 - 1.3.1 + 1.3.3 + 1.3.3 stable @@ -23,8 +23,9 @@ GPL License -set header Content-Length -update package description +- close pipes in execWithTimeout(), also return exit code of command +- createPreview() has optional parameter by referenz to return true if a + preview image was actually created @@ -453,5 +454,22 @@ add new methode getPreviewFile() add parameter $target to SeedDMS_Preview_pdfPreviewer::hasRawPreview() and SeedDMS_Preview_pdfPreviewer::getRawPreview() + + 2020-12-23 + + + 1.3.2 + 1.3.1 + + + stable + stable + + GPL License + +set header Content-Length +update package description + + diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php b/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php index 7c235976b..eb551ed4d 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php @@ -44,6 +44,14 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { */ protected $cmd; + /** + * Run a shell command + * + * @param $cmd + * @param int $timeout + * @return array + * @throws Exception + */ static function execWithTimeout($cmd, $timeout=2) { /* {{{ */ $descriptorspec = array( 0 => array("pipe", "r"), @@ -53,7 +61,11 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { $pipes = array(); $timeout += time(); - $process = proc_open($cmd, $descriptorspec, $pipes); + // Putting an 'exec' before the command will not fork the command + // and therefore not create any child process. proc_terminate will + // then reliably terminate the cmd and not just shell. See notes of + // https://www.php.net/manual/de/function.proc-terminate.php + $process = proc_open('exec '.$cmd, $descriptorspec, $pipes); if (!is_resource($process)) { throw new Exception("proc_open failed on: " . $cmd); } @@ -78,11 +90,15 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { $timeleft = $timeout - time(); } while (!feof($pipes[1]) && $timeleft > 0); + fclose($pipes[0]); + fclose($pipes[1]); + fclose($pipes[2]); if ($timeleft <= 0) { proc_terminate($process); throw new Exception("command timeout on: " . $cmd); } else { - return array('stdout'=>$output, 'stderr'=>$error); + $return_value = proc_close($process); + return array('stdout'=>$output, 'stderr'=>$error, 'return'=>$return_value); } } /* }}} */ diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php index 2eb15428b..cc5b39119 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php @@ -175,6 +175,8 @@ class SeedDMS_SQLiteFTS_Indexer { if($query) $sql .= " WHERE docs MATCH ".$this->_conn->quote($query); $res = $this->_conn->query($sql); + if(!$res) + return false; $row = $res->fetch(); $sql = "SELECT ".$this->_rawid.", documentid FROM docs"; diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php index 78b5ed86c..77b3993f6 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php @@ -79,11 +79,11 @@ class SeedDMS_SQliteFTS_Search { if(!empty($fields['owner'])) { if(is_string($fields['owner'])) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $querystr .= 'owner:'.$fields['owner']; } elseif(is_array($fields['owner'])) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $querystr .= '(owner:'; $querystr .= implode(' OR owner:', $fields['owner']); $querystr .= ')'; @@ -91,14 +91,14 @@ class SeedDMS_SQliteFTS_Search { } if(!empty($fields['category'])) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $querystr .= '(category:'; $querystr .= implode(' OR category:', $fields['category']); $querystr .= ')'; } if(!empty($fields['status'])) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $status = array_map(function($v){return $v+10;}, $fields['status']); $querystr .= '(status:'; $querystr .= implode(' OR status:', $status); @@ -106,21 +106,21 @@ class SeedDMS_SQliteFTS_Search { } if(!empty($fields['user'])) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $querystr .= '(users:'; $querystr .= implode(' OR users:', $fields['user']); $querystr .= ')'; } if(!empty($fields['rootFolder']) && $fields['rootFolder']->getFolderList()) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $querystr .= '(path:'; $querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':'); $querystr .= ')'; } if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) { if($querystr) - $querystr .= ' '; + $querystr .= ' AND '; $querystr .= '(path:'; $querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':'); $querystr .= ')'; diff --git a/SeedDMS_SQLiteFTS/package.xml b/SeedDMS_SQLiteFTS/package.xml index 1fddaeb00..8e05d96ef 100644 --- a/SeedDMS_SQLiteFTS/package.xml +++ b/SeedDMS_SQLiteFTS/package.xml @@ -11,7 +11,7 @@ uwe@steinmann.cx yes - 2021-04-19 + 2021-05-10 1.0.16 @@ -23,6 +23,7 @@ GPL License +- close pipes in execWithTimeout(), also return exit code of command - add support for fts5 (make it the default) diff --git a/controllers/class.RemoveDocument.php b/controllers/class.RemoveDocument.php index 1b78314d9..70cff8fe1 100644 --- a/controllers/class.RemoveDocument.php +++ b/controllers/class.RemoveDocument.php @@ -43,6 +43,9 @@ class SeedDMS_Controller_RemoveDocument extends SeedDMS_Controller_Common { $result = $this->callHook('removeDocument', $document); if($result === null) { + require_once("SeedDMS/Preview.php"); + $previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir); + $previewer->deleteDocumentPreviews($document); if (!$document->remove()) { if($dms->lasterror) $this->errormsg = $dms->lasterror; diff --git a/controllers/class.RemoveFolder.php b/controllers/class.RemoveFolder.php index 4dfd686cf..6706eb8e4 100644 --- a/controllers/class.RemoveFolder.php +++ b/controllers/class.RemoveFolder.php @@ -22,7 +22,33 @@ */ class SeedDMS_Controller_RemoveFolder extends SeedDMS_Controller_Common { - public function run() { + /* Register a callback which removes each document from the fulltext index + * The callback must return null otherwise the removal will be canceled. + */ + static function removeFromIndex($arr, $document) { /* {{{ */ + $fulltextservice = $arr[0]; + $lucenesearch = $fulltextservice->Search(); + $hit = null; + if($document->isType('document')) + $hit = $lucenesearch->getDocument($document->getID()); + elseif($document->isType('folder')) + $hit = $lucenesearch->getFolder($document->getID()); + if($hit) { + $index = $fulltextservice->Indexer(); + $index->delete($hit->id); + $index->commit(); + } + return null; + } /* }}} */ + + static function removePreviews($arr, $document) { /* {{{ */ + $previewer = $arr[0]; + + $previewer->deleteDocumentPreviews($document); + return null; + } /* }}} */ + + public function run() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $settings = $this->params['settings']; @@ -41,38 +67,19 @@ class SeedDMS_Controller_RemoveFolder extends SeedDMS_Controller_Common { $result = $this->callHook('removeFolder', $folder); if($result === null) { - /* Register a callback which removes each document from the fulltext index - * The callback must return null other the removal will be canceled. - */ - function removeFromIndex($arr, $document) { - $fulltextservice = $arr[0]; - $lucenesearch = $fulltextservice->Search(); - $hit = null; - if($document->isType('document')) - $hit = $lucenesearch->getDocument($document->getID()); - elseif($document->isType('folder')) - $hit = $lucenesearch->getFolder($document->getID()); - if($hit) { - $index = $fulltextservice->Indexer(); - $index->delete($hit->id); - $index->commit(); - } - return null; - } if($fulltextservice && ($index = $fulltextservice->Indexer())) { - $dms->addCallback('onPreRemoveDocument', 'removeFromIndex', array($fulltextservice)); - $dms->addCallback('onPreRemoveFolder', 'removeFromIndex', array($fulltextservice)); + /* Register a callback which is called by SeedDMS_Core when a folder + * or document is removed. The second parameter passed to this callback + * is the document or folder to be removed. + */ + $dms->addCallback('onPreRemoveDocument', 'SeedDMS_Controller_RemoveFolder::removeFromIndex', array($fulltextservice)); + $dms->addCallback('onPreRemoveFolder', 'SeedDMS_Controller_RemoveFolder::removeFromIndex', array($fulltextservice)); } - function removePreviews($arr, $document) { - $previewer = $arr[0]; - - $previewer->deleteDocumentPreviews($document); - return null; - } + /* Register another callback which removes the preview images of the document */ require_once("SeedDMS/Preview.php"); $previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir); - $dms->addCallback('onPreRemoveDocument', 'removePreviews', array($previewer)); + $dms->addCallback('onPreRemoveDocument', 'SeedDMS_Controller_RemoveFolder::removePreviews', array($previewer)); if (!$folder->remove()) { $this->errormsg = 'error_occured'; @@ -88,5 +95,5 @@ class SeedDMS_Controller_RemoveFolder extends SeedDMS_Controller_Common { } return true; - } + } /* }}} */ } diff --git a/inc/inc.ClassEmailNotify.php b/inc/inc.ClassEmailNotify.php index 5100d2e2e..b5b1905de 100644 --- a/inc/inc.ClassEmailNotify.php +++ b/inc/inc.ClassEmailNotify.php @@ -133,7 +133,7 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify { } $bodyhtml = ''; - if(isset($params['__body_html__']) || getMLText($messagekey.'_html')) { + if(isset($params['__body_html__']) || getMLText($messagekey.'_html', $params, "", $lang)) { if(!isset($params['__skip_header__']) || !$params['__skip_header__']) { if(!isset($params['__header_html__'])) $bodyhtml .= getMLText("email_header_html", $params, "", $lang)."\r\n\r\n"; diff --git a/inc/inc.ClassUI.php b/inc/inc.ClassUI.php index 4114cb7f2..3d288427d 100644 --- a/inc/inc.ClassUI.php +++ b/inc/inc.ClassUI.php @@ -184,7 +184,7 @@ class UI extends UI_Default { static function exitError($pagetitle, $error, $noexit=false, $plain=false) { global $theme, $dms, $user, $settings; - $accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings); + $accessop = new SeedDMS_AccessOperation($dms, $user, $settings); $view = UI::factory($theme, 'ErrorDlg'); $view->setParam('dms', $dms); $view->setParam('user', $user); diff --git a/inc/inc.Settings.php b/inc/inc.Settings.php index 2515be2a5..df11ccada 100644 --- a/inc/inc.Settings.php +++ b/inc/inc.Settings.php @@ -47,7 +47,7 @@ if(isset($settings->_maxExecutionTime)) { } } -if (get_magic_quotes_gpc()) { +if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); while (list($key, $val) = each($process)) { foreach ($val as $k => $v) { diff --git a/inc/inc.Tasks.php b/inc/inc.Tasks.php index 246f5cb8b..290604eaa 100644 --- a/inc/inc.Tasks.php +++ b/inc/inc.Tasks.php @@ -289,6 +289,100 @@ class SeedDMS_CheckSumTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ } } /* }}} */ +/** + * Class for processing a single folder + * + * SeedDMS_Task_Preview_Process_Folder::process() is used as a callable when + * iterating over all folders recursively. + */ +class SeedDMS_Task_Preview_Process_Folder { /* {{{ */ + protected $logger; + + protected $previewer; + + protected $widths; + + public function __construct($previewer, $widths, $logger) { /* {{{ */ + $this->logger = $logger; + $this->previewer = $previewer; + $this->widths = $widths; + } /* }}} */ + + public function process($folder) { /* {{{ */ + $dms = $folder->getDMS(); + $documents = $folder->getDocuments(); + if($documents) { + foreach($documents as $document) { + $versions = $document->getContent(); + foreach($versions as $version) { + foreach($this->widths as $previewtype=>$width) { + if($previewtype == 'detail' || $document->isLatestContent($version->getVersion())) { + $isnew = null; + if($this->previewer->createPreview($version, $width, $isnew)) { + if($isnew){ + $this->logger->log('Task \'preview\': created preview ('.$width.'px) for document '.$document->getId().':'.$version->getVersion(), PEAR_LOG_INFO); + } + } + } + } + } + $files = $document->getDocumentFiles(); + foreach($files as $file) { + $this->previewer->createPreview($file, $width['detail'], $isnew); + if($isnew){ + $this->logger->log('Task \'preview\': created preview ('.$width.'px) for attachment of document '.$document->getId().':'.$file->getId(), PEAR_LOG_INFO); + } + } + } + } + } /* }}} */ +} /* }}} */ + +/** + * Class containing methods for running a scheduled task + * + * @author Uwe Steinmann + * @package SeedDMS + * @subpackage core + */ +class SeedDMS_PreviewTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ + + /** + * Run the task + * + * @param $task task to be executed + * @param $dms dms + * @return boolean true if task was executed succesfully, otherwise false + */ + public function execute($task) { + $dms = $this->dms; + $logger = $this->logger; + $settings = $this->settings; + $taskparams = $task->getParameter(); + $folder = $dms->getRootFolder(); + + $previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir); + $previewer->setConverters(isset($settings->_converters['preview']) ? $settings->_converters['preview'] : array()); + $logger->log('Cachedir is '.$settings->_cacheDir, PEAR_LOG_INFO); + + $folderprocess = new SeedDMS_Task_Preview_Process_Folder($previewer, array('list'=>$settings->_previewWidthList, 'detail'=>$settings->_previewWidthDetail), $logger); + $tree = new SeedDMS_FolderTree($folder, array($folderprocess, 'process')); + call_user_func(array($folderprocess, 'process'), $folder); + + return true; + } + + public function getDescription() { + return 'Check all documents for a missing preview image'; + } + + public function getAdditionalParams() { + return array( + ); + } +} /* }}} */ + $GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['expireddocs'] = 'SeedDMS_ExpiredDocumentsTask'; $GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['indexingdocs'] = 'SeedDMS_IndexingDocumentsTask'; $GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['checksum'] = 'SeedDMS_CheckSumTask'; +$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['preview'] = 'SeedDMS_PreviewTask'; diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index d55f67d37..80032f262 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -981,6 +981,67 @@ class SeedDMS_CSRF { /* {{{ */ } /* }}} */ } /* }}} */ +/** + * Class to represent a jwt token + * + * + * @category DMS + * @package SeedDMS + * @author Uwe Steinmann + * @copyright 2016 Uwe Steinmann + * @version Release: @package_version@ + */ +class SeedDMS_JwtToken { /* {{{ */ + protected $jwtsecret; + + public function __construct($jwtsecret = '') { /* {{{ */ + $this->jwtsecret = $jwtsecret; + } /* }}} */ + + public function jwtEncode($payload) { /* {{{ */ + $header = [ + "alg" => "HS256", + "typ" => "JWT" + ]; + $encHeader = self::base64UrlEncode(json_encode($header)); + $encPayload = self::base64UrlEncode(json_encode($payload)); + $hash = self::base64UrlEncode(self::calculateHash($encHeader, $encPayload)); + + return "$encHeader.$encPayload.$hash"; + } /* }}} */ + + public function jwtDecode($token) { /* {{{ */ + if (!$this->jwtsecret) return ""; + + $split = explode(".", $token); + if (count($split) != 3) return ""; + + $hash = self::base64UrlEncode(self::calculateHash($split[0], $split[1])); + + if (strcmp($hash, $split[2]) != 0) return ""; + return self::base64UrlDecode($split[1]); + } /* }}} */ + + protected function calculateHash($encHeader, $encPayload) { /* {{{ */ + return hash_hmac("sha256", "$encHeader.$encPayload", $this->jwtsecret, true); + } /* }}} */ + + protected function base64UrlEncode($str) { /* {{{ */ + return str_replace("/", "_", str_replace("+", "-", trim(base64_encode($str), "="))); + } /* }}} */ + + protected function base64UrlDecode($payload) { /* {{{ */ + $b64 = str_replace("_", "/", str_replace("-", "+", $payload)); + switch (strlen($b64) % 4) { + case 2: + $b64 = $b64 . "=="; break; + case 3: + $b64 = $b64 . "="; break; + } + return base64_decode($b64); + } /* }}} */ +} /* }}} */ + class SeedDMS_FolderTree { /* {{{ */ public function __construct($folder, $callback) { /* {{{ */ diff --git a/languages/ar_EG/lang.inc b/languages/ar_EG/lang.inc index 63364bee9..7976d05e8 100644 --- a/languages/ar_EG/lang.inc +++ b/languages/ar_EG/lang.inc @@ -694,6 +694,7 @@ URL: [url]', 'individuals' => 'افراد', 'individuals_in_groups' => 'أفراد في المجموعات', 'info_recipients_tab_not_released' => 'رابط معلومات المستلمين لم يصدر بعد', +'info_rm_user_from_processes_user' => '', 'inherited' => 'موروث', 'inherits_access_copy_msg' => 'نسخ قائمة صلاحيات موروثة.', 'inherits_access_empty_msg' => 'ابدأ بقائمة صلاحيات فارغة', diff --git a/languages/bg_BG/lang.inc b/languages/bg_BG/lang.inc index 9e5905db0..bda2b786d 100644 --- a/languages/bg_BG/lang.inc +++ b/languages/bg_BG/lang.inc @@ -623,6 +623,7 @@ $text = array( 'individuals' => 'Личности', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'наследен', 'inherits_access_copy_msg' => 'Изкопирай наследения список', 'inherits_access_empty_msg' => 'Започни с празен списък за достъп', diff --git a/languages/ca_ES/lang.inc b/languages/ca_ES/lang.inc index ac395ee76..d808086f3 100644 --- a/languages/ca_ES/lang.inc +++ b/languages/ca_ES/lang.inc @@ -628,6 +628,7 @@ URL: [url]', 'individuals' => 'Individuals', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'Heredat', 'inherits_access_copy_msg' => 'Copiar llista d\'accés heretat', 'inherits_access_empty_msg' => 'Començar amb una llista d\'accés buida', diff --git a/languages/cs_CZ/lang.inc b/languages/cs_CZ/lang.inc index a4257f7e6..90d8cf129 100644 --- a/languages/cs_CZ/lang.inc +++ b/languages/cs_CZ/lang.inc @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Jednotlivci', 'individuals_in_groups' => 'Členové skupiny', 'info_recipients_tab_not_released' => 'Potvrzení o příjmu této verze dokumentu není možné, protože verze není uvolněna.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'Zděděno', 'inherits_access_copy_msg' => 'Zkopírovat zděděný seznam řízení přístupu', 'inherits_access_empty_msg' => 'Založit nový seznam řízení přístupu', diff --git a/languages/de_DE/lang.inc b/languages/de_DE/lang.inc index 25043edae..7c4c37b45 100644 --- a/languages/de_DE/lang.inc +++ b/languages/de_DE/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 (2881), dgrutsch (22) +// Translators: Admin (2886), dgrutsch (22) $text = array( '2_factor_auth' => '2-Faktor Authentifizierung', @@ -485,8 +485,8 @@ URL: [url]', 'do_object_setfiletype' => 'Setze Dateityp', 'do_object_unlink' => 'Lösche Dokumentenversion', 'draft' => 'Entwurf', -'draft_pending_approval' => 'Entwurf - bevorstehende Freigabe', -'draft_pending_review' => 'Entwurf - bevorstehende Prüfung', +'draft_pending_approval' => 'Freigabe erforderlich', +'draft_pending_review' => 'Prüfung erforderlich', 'drag_icon_here' => 'Icon eines Ordners oder Dokuments hier hin ziehen!', 'dropfolderdir_missing' => 'Ihr persönlicher Ablageordner auf dem Server existiert nicht! Kontaktieren Sie den Administrator, um in anlegen zu lassen.', 'dropfolder_file' => 'Datei aus Ablageordner', @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Einzelpersonen', 'individuals_in_groups' => 'Mitglieder einer Gruppe', 'info_recipients_tab_not_released' => 'Die Bestätigung des Empfangs für diese Dokumentenversion ist nicht möglich, weil die Version nicht freigegeben ist.', +'info_rm_user_from_processes_user' => 'Nur die noch offenen Aufgaben können auf einen anderen Benutzer übertragen werden. Bei Aufgaben, die bereits bearbeitet wurden, wird der Benutzer aus der Bearbeitungshistorie gelöscht, als würde der Benutzer selbst gelöscht.', 'inherited' => 'geerbt', 'inherits_access_copy_msg' => 'Berechtigungen kopieren', 'inherits_access_empty_msg' => 'Leere Zugriffsliste', @@ -1812,7 +1813,7 @@ Name: [username] 'state_and_next_state' => 'Status/Nächster Status', 'statistic' => 'Statistik', 'status' => 'Status', -'status_approval_rejected' => 'Entwurf abgelehnt', +'status_approval_rejected' => 'abgelehnt', 'status_approved' => 'freigegeben', 'status_approver_removed' => 'Freigebender wurde vom Prozess ausgeschlossen', 'status_change' => 'Statusänderung', @@ -1825,7 +1826,7 @@ Name: [username] 'status_receipt_rejected' => 'Abgelehnt', 'status_recipient_removed' => 'Empfänger aus Liste entfernt', 'status_reviewed' => 'geprüft', -'status_reviewer_rejected' => 'Entwurf abgelehnt', +'status_reviewer_rejected' => 'abgelehnt', 'status_reviewer_removed' => 'Prüfer wurde vom Prozess ausgeschlossen', 'status_revised' => 'überprüft', 'status_revision_rejected' => 'Abgelehnt', diff --git a/languages/el_GR/lang.inc b/languages/el_GR/lang.inc index a0f86b395..e91a3c4db 100644 --- a/languages/el_GR/lang.inc +++ b/languages/el_GR/lang.inc @@ -623,6 +623,7 @@ $text = array( 'individuals' => 'Άτομα', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'Κληρονομημένο', 'inherits_access_copy_msg' => 'Αντιγραφή δικαιωμάτων πρόσβασης', 'inherits_access_empty_msg' => 'Έναρξη με κενή λίστα δικαιωμάτων πρόσβασης', diff --git a/languages/en_GB/lang.inc b/languages/en_GB/lang.inc index 787428c1d..fbb6a800a 100644 --- a/languages/en_GB/lang.inc +++ b/languages/en_GB/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 (1990), archonwang (3), dgrutsch (9), netixw (14) +// Translators: Admin (1996), archonwang (3), dgrutsch (9), netixw (14) $text = array( '2_factor_auth' => '2-factor authentication', @@ -485,8 +485,8 @@ URL: [url]', 'do_object_setfiletype' => 'Set file type', 'do_object_unlink' => 'Delete document version', 'draft' => 'Draft', -'draft_pending_approval' => 'Draft - pending approval', -'draft_pending_review' => 'Draft - pending review', +'draft_pending_approval' => 'pending approval', +'draft_pending_review' => 'pending review', 'drag_icon_here' => 'Drag icon of folder or document here!', 'dropfolderdir_missing' => 'Your personal drop folder does not exist on the server! Please ask your administrator to create it.', 'dropfolder_file' => 'File from drop folder', @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Individuals', 'individuals_in_groups' => 'Members of a group', 'info_recipients_tab_not_released' => 'Acknowledgement of reception for this document version is not possible, because the version is not released.', +'info_rm_user_from_processes_user' => 'Only tasks not being touched can be transfered to another user. Task which has been taken care of, will just add an item in the history, as if the user was deleted.', 'inherited' => 'inherited', 'inherits_access_copy_msg' => 'Copy inherited access list', 'inherits_access_empty_msg' => 'Start with empty access list', @@ -1806,7 +1807,7 @@ Name: [username] 'state_and_next_state' => 'State/Next state', 'statistic' => 'Statistic', 'status' => 'Status', -'status_approval_rejected' => 'Draft rejected', +'status_approval_rejected' => 'rejected', 'status_approved' => 'Approved', 'status_approver_removed' => 'Approver removed from process', 'status_change' => 'Status change', @@ -1819,7 +1820,7 @@ Name: [username] 'status_receipt_rejected' => 'Rejected', 'status_recipient_removed' => 'Recipient removed from list', 'status_reviewed' => 'Reviewed', -'status_reviewer_rejected' => 'Draft rejected', +'status_reviewer_rejected' => 'rejected', 'status_reviewer_removed' => 'Reviewer removed from process', 'status_revised' => 'revised', 'status_revision_rejected' => 'Rejected', diff --git a/languages/es_ES/lang.inc b/languages/es_ES/lang.inc index 05183928c..4cbba0183 100644 --- a/languages/es_ES/lang.inc +++ b/languages/es_ES/lang.inc @@ -701,6 +701,7 @@ URL: [url]', 'individuals' => 'Individuales', 'individuals_in_groups' => 'Miembros del grupo', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'heredado', 'inherits_access_copy_msg' => 'Copiar lista de acceso heredado', 'inherits_access_empty_msg' => 'Empezar con una lista de acceso vacía', diff --git a/languages/fr_FR/lang.inc b/languages/fr_FR/lang.inc index 191a081e8..e3ee03f37 100644 --- a/languages/fr_FR/lang.inc +++ b/languages/fr_FR/lang.inc @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Individuels', 'individuals_in_groups' => 'Membres d’un groupe', 'info_recipients_tab_not_released' => 'L’accusé de réception pour cette version du document n’est pas possible car la version n’est pas en état « publié ».', +'info_rm_user_from_processes_user' => '', 'inherited' => 'hérité', 'inherits_access_copy_msg' => 'Recopier la liste des accès hérités', 'inherits_access_empty_msg' => 'Commencer avec une liste d\'accès vide', diff --git a/languages/hr_HR/lang.inc b/languages/hr_HR/lang.inc index e83a31a50..a426f9453 100644 --- a/languages/hr_HR/lang.inc +++ b/languages/hr_HR/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 (1243), marbanas (16) +// Translators: Admin (1246), marbanas (16) $text = array( '2_factor_auth' => '', @@ -75,7 +75,7 @@ Internet poveznica: [url]', 'add_receipt' => 'Potvrdi prijem', 'add_review' => 'Dodaj osvrt', 'add_revision' => 'Dodaj reviziju', -'add_role' => '', +'add_role' => 'Dodaj novu rolu', 'add_subfolder' => 'Dodaj podmapu', 'add_task' => '', 'add_to_clipboard' => 'Dodaj u međuspremnik', @@ -166,7 +166,7 @@ Internet poveznica: [url]', 'attrdef_minvalues_help' => '', 'attrdef_min_greater_max' => 'Minimalni broj vrijednosti je veći od maksimalnog broja vrijednosti', 'attrdef_multiple' => 'Dozvoli više vrijednosti', -'attrdef_multiple_needs_valueset' => '', +'attrdef_multiple_needs_valueset' => 'Atribut s višestrukim vrijednostima mora imati set vrijednosti', 'attrdef_must_be_multiple' => 'Atribut mora imati više od jedne vrijednosti, ali nije postavljeno više vrijednosti', 'attrdef_name' => 'Naziv', 'attrdef_noname' => 'Nedostaje naziv za definiciju atributa', @@ -275,7 +275,7 @@ Internet poveznica: [url]', 'choose_attrdefgroup' => '', 'choose_category' => 'Molim odaberite', 'choose_group' => 'Odaberite grupu', -'choose_role' => '', +'choose_role' => 'Izaberi rolu', 'choose_target_category' => 'Odaberite kategoriju', 'choose_target_document' => 'Odaberite dokument', 'choose_target_file' => 'Odaberite datoteku', @@ -706,6 +706,7 @@ Internet poveznica: [url]', 'individuals' => 'Pojedinci', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'naslijeđeno', 'inherits_access_copy_msg' => 'Kopiraj listu naslijeđenih prava pristupa', 'inherits_access_empty_msg' => 'Započnite s praznim popisom pristupa', diff --git a/languages/hu_HU/lang.inc b/languages/hu_HU/lang.inc index 033aaf024..3b84ee19c 100644 --- a/languages/hu_HU/lang.inc +++ b/languages/hu_HU/lang.inc @@ -701,6 +701,7 @@ URL: [url]', 'individuals' => 'Egyedek', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'örökölt', 'inherits_access_copy_msg' => 'Örökített hozzáférési lista másolása', 'inherits_access_empty_msg' => 'Indulás üres hozzáférési listával', diff --git a/languages/it_IT/lang.inc b/languages/it_IT/lang.inc index 855f345c7..4e6c5d46e 100644 --- a/languages/it_IT/lang.inc +++ b/languages/it_IT/lang.inc @@ -711,6 +711,7 @@ URL: [url]', 'individuals' => 'Singoli', 'individuals_in_groups' => 'I membri de la gruppo', 'info_recipients_tab_not_released' => 'Non è possibile confermare la ricezione di questa versione del documento, poiché la versione non è stata rilasciata.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'ereditato', 'inherits_access_copy_msg' => 'Copia la lista degli accessi ereditati', 'inherits_access_empty_msg' => 'Reimposta una lista di permessi vuota', diff --git a/languages/ko_KR/lang.inc b/languages/ko_KR/lang.inc index cad922e60..904e7f936 100644 --- a/languages/ko_KR/lang.inc +++ b/languages/ko_KR/lang.inc @@ -707,6 +707,7 @@ URL: [url]', 'individuals' => '개인', 'individuals_in_groups' => '개별 그룹', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => '상속', 'inherits_access_copy_msg' => '상속 액세스 목록 복사', 'inherits_access_empty_msg' => '빈 액세스 목록으로 시작', diff --git a/languages/lo_LA/lang.inc b/languages/lo_LA/lang.inc index 41fd5cf89..c1a0d6b3d 100644 --- a/languages/lo_LA/lang.inc +++ b/languages/lo_LA/lang.inc @@ -704,6 +704,7 @@ URL: [url]', 'individuals' => 'ບຸກຄົນ', 'individuals_in_groups' => 'ສະມາຊິກຂອງກຸ່ມ', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'ຮັບການຖ່າຍທອດ', 'inherits_access_copy_msg' => 'ຄັດລັອກລາຍການເຂົາເຖິງທີສືບທອດ', 'inherits_access_empty_msg' => 'ເລີ້ມຕົ້ນດ້ວຍລາຍການທີ່ວ່າງເປົ່າ', diff --git a/languages/nb_NO/lang.inc b/languages/nb_NO/lang.inc index 38b7e68b2..e0252b514 100644 --- a/languages/nb_NO/lang.inc +++ b/languages/nb_NO/lang.inc @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Personer', 'individuals_in_groups' => 'Medlemmer i en gruppe', 'info_recipients_tab_not_released' => 'Bekreftelse av mottak for denne dokumentversjonen er ikke mulig fordi versjonen ikke er utgitt.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'arvet', 'inherits_access_copy_msg' => 'Kopier arvet adgangsliste', 'inherits_access_empty_msg' => 'Start med tom adgangsliste', diff --git a/languages/nl_NL/lang.inc b/languages/nl_NL/lang.inc index cc635ee8e..173f65adf 100644 --- a/languages/nl_NL/lang.inc +++ b/languages/nl_NL/lang.inc @@ -718,6 +718,7 @@ URL: [url]', 'individuals' => 'Individuen', 'individuals_in_groups' => 'Individuen in groepen', 'info_recipients_tab_not_released' => 'Ontvangstbevestiging van deze versie van het document is niet mogelijk omdat de versie nog niet is vrijgegeven.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'overgeërfd', 'inherits_access_copy_msg' => 'Lijst van overgeërfde toegang', 'inherits_access_empty_msg' => 'Begin met een lege toegangslijst', diff --git a/languages/pl_PL/lang.inc b/languages/pl_PL/lang.inc index 266990f5e..598e6f979 100644 --- a/languages/pl_PL/lang.inc +++ b/languages/pl_PL/lang.inc @@ -694,6 +694,7 @@ URL: [url]', 'individuals' => 'Indywidualni', 'individuals_in_groups' => 'Członkowie grupy', 'info_recipients_tab_not_released' => 'Potwierdzenie odbioru dla tej wersji dokumentu nie jest możliwe, ponieważ wersja nie została wydana.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'dziedziczony', 'inherits_access_copy_msg' => 'Kopiuj odziedziczoną listę dostępu', 'inherits_access_empty_msg' => 'Rozpocznij z pustą listą dostępu', diff --git a/languages/pt_BR/lang.inc b/languages/pt_BR/lang.inc index c371fbd03..a03ab870e 100644 --- a/languages/pt_BR/lang.inc +++ b/languages/pt_BR/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 (1847), flaviove (627), lfcristofoli (352) +// Translators: Admin (1850), flaviove (627), lfcristofoli (352) $text = array( '2_factor_auth' => 'Autenticação de dois fatores', @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Indivíduos', 'individuals_in_groups' => 'Members of a group', 'info_recipients_tab_not_released' => 'Confirmação de recebimento para esta versão do documento não é possível, porque a versão não é liberada.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'herdado', 'inherits_access_copy_msg' => 'Copiar lista de acesso herdada', 'inherits_access_empty_msg' => 'Inicie com a lista de acesso vazia', @@ -1161,7 +1162,7 @@ URL: [url]', 'review_update_failed' => 'Erro ao atualizar o status da revisão. Atualização falhou.', 'revise_document' => 'Revisar documento', 'revise_document_on' => 'Próxima revisão da versão do documento em [date]', -'revision' => '', +'revision' => 'Revisão', 'revisions_accepted' => '[no_revisions] revisões já aceitas', 'revisions_accepted_latest' => 'revisões aceitas mais recentes', 'revisions_not_touched' => '[no_revisions] revisões não sendo tocadas', @@ -1807,7 +1808,7 @@ Nome: [username] 'status_approval_rejected' => 'Rascunho rejeitado', 'status_approved' => 'Aprovado', 'status_approver_removed' => 'Aprovador removido do processo', -'status_change' => '', +'status_change' => 'Mudança de status', 'status_needs_correction' => 'Precisa de correção', 'status_not_approved' => 'Não aprovado', 'status_not_receipted' => 'Ainda não recebido', @@ -2004,7 +2005,7 @@ URL: [url]', 'version_info' => 'Informações da versão', 'view' => 'Visualizar', 'view_document' => 'Ver detalhes do documento', -'view_folder' => '', +'view_folder' => 'Ver detalhes da pasta', 'view_online' => 'Ver online', 'warning' => 'Aviso', 'webauthn_auth' => '', diff --git a/languages/ro_RO/lang.inc b/languages/ro_RO/lang.inc index 7fd0d689b..303a97f25 100644 --- a/languages/ro_RO/lang.inc +++ b/languages/ro_RO/lang.inc @@ -706,6 +706,7 @@ URL: [url]', 'individuals' => 'Individuals', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'moștenit', 'inherits_access_copy_msg' => 'Copie lista de acces moștenită', 'inherits_access_empty_msg' => 'Începeți cu lista de acces goală', diff --git a/languages/ru_RU/lang.inc b/languages/ru_RU/lang.inc index d6a09310f..d1632dd99 100644 --- a/languages/ru_RU/lang.inc +++ b/languages/ru_RU/lang.inc @@ -706,6 +706,7 @@ URL: [url]', 'individuals' => 'Пользователи', 'individuals_in_groups' => 'Пользователи группы', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'унаследованный', 'inherits_access_copy_msg' => 'Скопировать наследованный список', 'inherits_access_empty_msg' => 'Начать с пустого списка доступа', diff --git a/languages/sk_SK/lang.inc b/languages/sk_SK/lang.inc index 16ed9836a..2453099c3 100644 --- a/languages/sk_SK/lang.inc +++ b/languages/sk_SK/lang.inc @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => 'Jednotlivci', 'individuals_in_groups' => 'Členovia skupiny', 'info_recipients_tab_not_released' => 'Acknowledgement of reception for this document version is not possible, because the version is not released.', +'info_rm_user_from_processes_user' => '', 'inherited' => 'zdedené', 'inherits_access_copy_msg' => 'Skopírovať zdedený zoznam riadenia prístupu', 'inherits_access_empty_msg' => 'Založiť nový zoznam riadenia prístupu', diff --git a/languages/sv_SE/lang.inc b/languages/sv_SE/lang.inc index 50b4ff66d..4bcf3f192 100644 --- a/languages/sv_SE/lang.inc +++ b/languages/sv_SE/lang.inc @@ -712,6 +712,7 @@ URL: [url]', 'individuals' => 'Personer', 'individuals_in_groups' => 'Medlemmar i en grupp', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'ärvd', 'inherits_access_copy_msg' => 'Kopiera lista för behörighetsarv', 'inherits_access_empty_msg' => 'Börja med tom behörighetslista', diff --git a/languages/tr_TR/lang.inc b/languages/tr_TR/lang.inc index 1796e6c3a..b597dd104 100644 --- a/languages/tr_TR/lang.inc +++ b/languages/tr_TR/lang.inc @@ -700,6 +700,7 @@ URL: [url]', 'individuals' => 'Bireysel', 'individuals_in_groups' => '', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'devralındı', 'inherits_access_copy_msg' => 'Devralınan erişim listesini kopyala', 'inherits_access_empty_msg' => 'Boş erişim listesiyle başla', diff --git a/languages/uk_UA/lang.inc b/languages/uk_UA/lang.inc index 88f84ab73..27113fab7 100644 --- a/languages/uk_UA/lang.inc +++ b/languages/uk_UA/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 (1340) +// Translators: Admin (1342) $text = array( '2_factor_auth' => '', @@ -337,7 +337,7 @@ URL: [url]', 'daily' => 'Щоденно', 'databasesearch' => 'Пошук по БД', 'database_schema_version' => '', -'data_loading' => '', +'data_loading' => 'Зачекайте, дані завантажуються...', 'date' => 'Дата', 'days' => 'дні', 'debug' => '', @@ -706,6 +706,7 @@ URL: [url]', 'individuals' => 'Користувачі', 'individuals_in_groups' => 'Користувачі групи', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => 'успадкований', 'inherits_access_copy_msg' => 'Скопіювати успадкований список', 'inherits_access_empty_msg' => 'Почати з порожнього списку доступу', @@ -1863,7 +1864,7 @@ URL: [url]', 'total' => '', 'to_before_from' => 'Кінцева дата не може бути меншою початкової дати', 'transfer_content' => '', -'transfer_document' => '', +'transfer_document' => 'Передача документа', 'transfer_no_read_access' => '', 'transfer_no_users' => '', 'transfer_no_write_access' => '', diff --git a/languages/zh_CN/lang.inc b/languages/zh_CN/lang.inc index 2c35a8e06..d58972259 100644 --- a/languages/zh_CN/lang.inc +++ b/languages/zh_CN/lang.inc @@ -696,6 +696,7 @@ URL: [url]', 'individuals' => '个人', 'individuals_in_groups' => '组成员', 'info_recipients_tab_not_released' => '', +'info_rm_user_from_processes_user' => '', 'inherited' => '继承', 'inherits_access_copy_msg' => '复制继承访问权限列表', 'inherits_access_empty_msg' => '从访问权限空列表开始', diff --git a/languages/zh_TW/lang.inc b/languages/zh_TW/lang.inc index 388cc43cd..adb741fe0 100644 --- a/languages/zh_TW/lang.inc +++ b/languages/zh_TW/lang.inc @@ -725,6 +725,7 @@ URL: [url]', 'individuals' => '個人', 'individuals_in_groups' => '小組成員', 'info_recipients_tab_not_released' => '由於未發布該文檔版本,因此無法確認接收。', +'info_rm_user_from_processes_user' => '', 'inherited' => '繼承', 'inherits_access_copy_msg' => '複製繼承存取權限列表', 'inherits_access_empty_msg' => '從存取權限空列表開始', diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index 2e4890193..73ed1b615 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -236,7 +236,7 @@ if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'tra $approvers['i'] = array_merge($approvers['i'], $mapprovers['i']); if($settings->_workflowMode == 'traditional' && !$settings->_allowReviewerOnly) { - /* Check if reviewers are send but no approvers */ + /* Check if reviewers are set but no approvers */ if(($reviewers["i"] || $reviewers["g"]) && !$approvers["i"] && !$approvers["g"]) { UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_uploading_reviewer_only")); } @@ -333,7 +333,7 @@ if($settings->_libraryFolder) { if($clonedoc = $dms->getDocument($_POST["librarydoc"])) { if($content = $clonedoc->getLatestContent()) { $docsource = 'library'; - $fullfile = tempnam('/tmp', ''); + $fullfile = tempnam(sys_get_temp_dir(), ''); if(SeedDMS_Core_File::copyFile($dms->contentDir . $content->getPath(), $fullfile)) { /* Check if a local file is uploaded as well */ if(isset($_FILES["userfile"]['error'][0])) { diff --git a/op/op.AddToTransmittal.php b/op/op.AddToTransmittal.php index 6aa99dc12..de8d6c466 100644 --- a/op/op.AddToTransmittal.php +++ b/op/op.AddToTransmittal.php @@ -68,7 +68,7 @@ if (!is_object($transmittal)) { } if ($transmittal->getUser()->getID() != $user->getID()) { - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_transmittal")); } if($transmittal->addContent($version)) { diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 244abc8b4..908774682 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -157,6 +157,37 @@ switch($command) { if($user) { $query = $_GET['query']; + if(false !== ($pos = strpos($query, '/'))) { + $subquery = substr($query, 0, $pos); + $hits = $dms->search($subquery, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array()); + if($hits) { + if(count($hits['folders']) == 1) { + $hit = $hits['folders'][0]; + $basefolder = $dms->getFolder($hit->getID()); + if($subquery = substr($query, $pos+1)) { + $hits = $dms->search($subquery, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$basefolder, $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array()); + if($hits) { + $result = array(); + foreach($hits['folders'] as $hit) { + $result[] = $hit->getID().'#'.$basefolder->getName().'/'.$hit->getName(); + } + header('Content-Type: application/json'); + echo json_encode($result); + return; + } + } else { + $subfolders = $basefolder->getSubFolders(); + $result = array(); + foreach($subfolders as $subfolder) { + $result[] = $subfolder->getID().'#'.$basefolder->getName().'/'.$subfolder->getName(); + } + header('Content-Type: application/json'); + echo json_encode($result); + return; + } + } + } + } $hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array()); if($hits) { $result = array(); diff --git a/op/op.SetRevisors.php b/op/op.SetRevisors.php index 087b2eb27..4c6b9568b 100644 --- a/op/op.SetRevisors.php +++ b/op/op.SetRevisors.php @@ -56,10 +56,11 @@ if (!is_object($content)) { } if (isset($_POST["startdate"])) { - $startdate = $_POST["startdate"]; + $ts = makeTsFromDate($_POST["startdate"]); } else { - $startdate = date('Y-m-d'); + $ts = time(); } +$startdate = date('Y-m-d', $ts); if(!$content->setRevisionDate($startdate)) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); diff --git a/op/op.TimelineFeedPreview.php b/op/op.TimelineFeedPreview.php new file mode 100644 index 000000000..183b3d4b7 --- /dev/null +++ b/op/op.TimelineFeedPreview.php @@ -0,0 +1,82 @@ +_encryptionKey); +if(!($tokenstr = $token->jwtDecode($_GET['hash']))) + exit; + +$tokendata = json_decode($tokenstr, true); + +if (!isset($tokendata['d']) || !is_numeric($tokendata['d'])) { + exit; +} + +$document = $dms->getDocument($tokendata['d']); +if (!is_object($document)) { + exit; +} + +if (!isset($tokendata['u']) || !is_numeric($tokendata['u'])) { + exit; +} + +$user = $dms->getUser($tokendata['u']); +if (!is_object($user)) { + exit; +} + +if ($document->getAccessMode($user) < M_READ) { + exit; +} + +if (!isset($tokendata['v']) || !is_numeric($tokendata['v'])) { + exit; +} + +$controller = Controller::factory('Preview', array('dms'=>$dms, 'user'=>$user)); +$controller->setParam('width', !empty($tokendata["w"]) ? $tokendata["w"] : null); +$controller->setParam('document', $document); +$controller->setParam('version', $tokendata['v']); +$controller->setParam('type', 'version'); +if(!$controller->run()) { + header('Content-Type: image/svg+xml'); + readfile('../views/'.$theme.'/images/empty.svg'); + exit; +} diff --git a/out/out.AddEvent.php b/out/out.AddEvent.php index 8df59b9c4..0510b6035 100644 --- a/out/out.AddEvent.php +++ b/out/out.AddEvent.php @@ -25,6 +25,7 @@ require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); +require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); @@ -38,6 +39,8 @@ if ($user->isGuest()) { UI::exitError(getMLText("edit_event"),getMLText("access_denied")); } +$accessop = new SeedDMS_AccessOperation($dms, $user, $settings); + if($view) { $view->setParam('accessobject', $accessop); $view->setParam('strictformcheck', $settings->_strictFormCheck); diff --git a/out/out.DefaultKeywords.php b/out/out.DefaultKeywords.php index 80cddaf7e..bc0f1b02f 100644 --- a/out/out.DefaultKeywords.php +++ b/out/out.DefaultKeywords.php @@ -37,15 +37,15 @@ if (!$accessop->check_view_access($view, $_GET)) { } if(isset($_GET['categoryid'])) - $selcategoryid = $_GET['categoryid']; + $selcategory = $dms->getKeywordCategory($_GET['categoryid']); else - $selcategoryid = 0; + $selcategory = null; $categories = $dms->getAllUserKeywordCategories($user->getID()); if($view) { $view->setParam('categories', $categories); - $view->setParam('selcategoryid', $selcategoryid); + $view->setParam('selcategory', $selcategory); $view->setParam('accessobject', $accessop); $view($_GET); exit; diff --git a/out/out.Help.php b/out/out.Help.php index 3a6c70816..7de5bd165 100644 --- a/out/out.Help.php +++ b/out/out.Help.php @@ -29,6 +29,7 @@ require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $view = UI::factory($theme, $tmp[1]); +$accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings); if(isset($_GET['context'])) $context = $_GET['context']; @@ -38,6 +39,7 @@ if($view) { $view->setParam('dms', $dms); $view->setParam('user', $user); $view->setParam('context', $context); + $view->setParam('accessobject', $accessop); $view($_GET); exit; } diff --git a/out/out.ObjectCheck.php b/out/out.ObjectCheck.php index 170cc9edf..8dbc3ab20 100644 --- a/out/out.ObjectCheck.php +++ b/out/out.ObjectCheck.php @@ -240,6 +240,8 @@ if($view) { $view->setParam('repairobjects', $repairobjects); $view->setParam('cachedir', $settings->_cacheDir); $view->setParam('timeout', $settings->_cmdTimeout); + $view->setParam('enableRecursiveCount', $settings->_enableRecursiveCount); + $view->setParam('maxRecursiveCount', $settings->_maxRecursiveCount); $view->setParam('accessobject', $accessop); $view->setParam('previewWidthList', $settings->_previewWidthList); $view->setParam('previewConverters', isset($settings->_converters['preview']) ? $settings->_converters['preview'] : array()); diff --git a/out/out.Search.php b/out/out.Search.php index 6ef77b44a..19e39fb46 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -64,15 +64,7 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext $categories = array(); $categorynames = array(); if(isset($_GET['category']) && $_GET['category']) { - foreach($_GET['category'] as $catname) { - if($catname) { - $cat = $dms->getDocumentCategoryByName($catname); - $categories[] = $cat; - $categorynames[] = $cat->getName(); - } - } - } elseif(isset($_GET['categoryids']) && $_GET['categoryids']) { - foreach($_GET['categoryids'] as $catid) { + foreach($_GET['category'] as $catid) { if($catid) { $cat = $dms->getDocumentCategory($catid); $categories[] = $cat; @@ -104,16 +96,18 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext // Check to see if the search has been restricted to a particular // document owner. $owner = []; + $ownernames = []; if (isset($_GET["owner"])) { + $owner = $_GET['owner']; if (!is_array($_GET['owner'])) { - if(!empty($_GET['owner']) && $o = $dms->getUserByLogin($_GET['owner'])) - $owner[] = $o->getLogin(); + if(!empty($_GET['owner']) && $o = $dms->getUser($_GET['owner'])) + $ownernames[] = $o->getLogin(); else UI::exitError(getMLText("search"),getMLText("unknown_owner")); } else { foreach($_GET["owner"] as $l) { - if($l && $o = $dms->getUserByLogin($l)) - $owner[] = $o->getLogin(); + if($l && $o = $dms->getUser($l)) + $ownernames[] = $o->getLogin(); } } } @@ -134,34 +128,16 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext } // status - $status = array(); - if (isset($_GET["pendingReview"])){ - $status[] = S_DRAFT_REV; - } - if (isset($_GET["pendingApproval"])){ - $status[] = S_DRAFT_APP; - } - if (isset($_GET["inWorkflow"])){ - $status[] = S_IN_WORKFLOW; - } - if (isset($_GET["released"])){ - $status[] = S_RELEASED; - } - if (isset($_GET["rejected"])){ - $status[] = S_REJECTED; - } - if (isset($_GET["obsolete"])){ - $status[] = S_OBSOLETE; - } - if (isset($_GET["expired"])){ - $status[] = S_EXPIRED; - } + if(isset($_GET['status'])) + $status = $_GET['status']; + else + $status = array(); // Check to see if the search has been restricted to a particular sub-tree in // the folder hierarchy. $startFolder = null; - if (isset($_GET["targetid"]) && is_numeric($_GET["targetid"]) && $_GET["targetid"]>0) { - $targetid = $_GET["targetid"]; + if (isset($_GET["folderfullsearchid"]) && is_numeric($_GET["folderfullsearchid"]) && $_GET["folderfullsearchid"]>0) { + $targetid = $_GET["folderfullsearchid"]; $startFolder = $dms->getFolder($targetid); if (!is_object($startFolder)) { UI::exitError(getMLText("search"),getMLText("invalid_folder_id")); @@ -188,7 +164,7 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext $index = $fulltextservice->Indexer(); if($index) { $lucenesearch = $fulltextservice->Search(); - $searchresult = $lucenesearch->search($query, array('owner'=>$owner, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1)))); + $searchresult = $lucenesearch->search($query, array('owner'=>$ownernames, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1)))); if($searchresult === false) { $session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm'))); $dcount = 0; @@ -314,132 +290,100 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext $owner = array(); $ownerobjs = array(); if (isset($_GET["owner"])) { + $owner = $_GET['owner']; if (!is_array($_GET['owner'])) { - if(!empty($_GET['owner']) && $o = $dms->getUserByLogin($_GET['owner'])) { + if(!empty($_GET['owner']) && $o = $dms->getUser($_GET['owner'])) { $ownerobjs[] = $o; - $owner = $o->getLogin(); } else UI::exitError(getMLText("search"),getMLText("unknown_owner")); } else { foreach($_GET["owner"] as $l) { - if($o = $dms->getUserByLogin($l)) { + if($o = $dms->getUser($l)) { $ownerobjs[] = $o; - $owner[] = $o->getLogin(); } } } } - // Is the search restricted to documents created between two specific dates? - $startdate = array(); - $stopdate = array(); - if (isset($_GET["creationdate"]) && $_GET["creationdate"]!=null) { - $creationdate = true; - } else { - $creationdate = false; + /* Creation date {{{ */ + $createstartdate = array(); + $createenddate = array(); + if(!empty($_GET["createstart"])) { + $createstartts = makeTsFromDate($_GET["createstart"]); + $createstartdate = array('year'=>(int)date('Y', $createstartts), 'month'=>(int)date('m', $createstartts), 'day'=>(int)date('d', $createstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); } - - if(isset($_GET["createstart"])) { - $tmp = explode("-", $_GET["createstart"]); - $startdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); - } else { - if(isset($_GET["createstartyear"])) - $startdate = array('year'=>$_GET["createstartyear"], 'month'=>$_GET["createstartmonth"], 'day'=>$_GET["createstartday"], 'hour'=>0, 'minute'=>0, 'second'=>0); - } - if ($startdate && !checkdate($startdate['month'], $startdate['day'], $startdate['year'])) { + if ($createstartdate && !checkdate($createstartdate['month'], $createstartdate['day'], $createstartdate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_create_date_end")); } - if(isset($_GET["createend"])) { - $tmp = explode("-", $_GET["createend"]); - $stopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>23, 'minute'=>59, 'second'=>59); - } else { - if(isset($_GET["createendyear"])) - $stopdate = array('year'=>$_GET["createendyear"], 'month'=>$_GET["createendmonth"], 'day'=>$_GET["createendday"], 'hour'=>23, 'minute'=>59, 'second'=>59); + if(!empty($_GET["createend"])) { + $createendts = makeTsFromDate($_GET["createend"]); + $createenddate = array('year'=>(int)date('Y', $createendts), 'month'=>(int)date('m', $createendts), 'day'=>(int)date('d', $createendts), 'hour'=>23, 'minute'=>59, 'second'=>59); } - if ($stopdate && !checkdate($stopdate['month'], $stopdate['day'], $stopdate['year'])) { + if ($createenddate && !checkdate($createenddate['month'], $createenddate['day'], $createenddate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_create_date_end")); } + /* }}} */ + /* Revision date {{{ */ $revisionstartdate = array(); - $revisionstopdate = array(); - if (isset($_GET["revisiondate"]) && $_GET["revisiondate"]!=null) { - $revisiondate = true; - } else { - $revisiondate = false; - } - - if(isset($_GET["revisionstart"]) && $_GET["revisionstart"]) { - $tmp = explode("-", $_GET["revisionstart"]); - $revisionstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); + $revisionenddate = array(); + if(!empty($_GET["revisiondatestart"])) { + $revisionstartts = makeTsFromDate($_GET["revisiondatestart"]); + $revisionstartdate = array('year'=>(int)date('Y', $revisionstartts), 'month'=>(int)date('m', $revisionstartts), 'day'=>(int)date('d', $revisionstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); if (!checkdate($revisionstartdate['month'], $revisionstartdate['day'], $revisionstartdate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_revision_date_start")); } - } else { - $revisionstartdate = array(); } - if(isset($_GET["revisionend"]) && $_GET["revisionend"]) { - $tmp = explode("-", $_GET["revisionend"]); - $revisionstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); - if (!checkdate($revisionstopdate['month'], $revisionstopdate['day'], $revisionstopdate['year'])) { + if(!empty($_GET["revisiondateend"])) { + $revisionendts = makeTsFromDate($_GET["revisiondateend"]); + $revisionenddate = array('year'=>(int)date('Y', $revisionendts), 'month'=>(int)date('m', $revisionendts), 'day'=>(int)date('d', $revisionendts), 'hour'=>23, 'minute'=>59, 'second'=>59); + if (!checkdate($revisionenddate['month'], $revisionenddate['day'], $revisionenddate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_revision_date_end")); } - } else { - $revisionstopdate = array(); } + /* }}} */ + /* Status date {{{ */ $statusstartdate = array(); - $statusstopdate = array(); - if (isset($_GET["statusdate"]) && $_GET["statusdate"]!=null) { - $statusdate = true; - } else { - $statusdate = false; + $statusenddate = array(); + if(!empty($_GET["statusdatestart"])) { + $statusstartts = makeTsFromDate($_GET["statusdatestart"]); + $statusstartdate = array('year'=>(int)date('Y', $statusstartts), 'month'=>(int)date('m', $statusstartts), 'day'=>(int)date('d', $statusstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); } - - if(isset($_GET["statusstart"])) { - $tmp = explode("-", $_GET["statusstart"]); - $statusstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); + if ($statusstartdate && !checkdate($statusstartdate['month'], $statusstartdate['day'], $statusstartdate['year'])) { + UI::exitError(getMLText("search"),getMLText("invalid_status_date_start")); } - if ($statusstartdate && !checkdate($statusstartdate['month'], $startdate['day'], $startdate['year'])) { - UI::exitError(getMLText("search"),getMLText("invalid_status_date_end")); - } - if(isset($_GET["statusend"])) { - $tmp = explode("-", $_GET["statusend"]); - $statusstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>23, 'minute'=>59, 'second'=>59); - } - if ($statusstopdate && !checkdate($statusstopdate['month'], $stopdate['day'], $stopdate['year'])) { + if(!empty($_GET["statusdateend"])) { + $statusendts = makeTsFromDate($_GET["statusdateend"]); + $statusenddate = array('year'=>(int)date('Y', $statusendts), 'month'=>(int)date('m', $statusendts), 'day'=>(int)date('d', $statusendts), 'hour'=>23, 'minute'=>59, 'second'=>59); + } + if ($statusenddate && !checkdate($statusenddate['month'], $statusenddate['day'], $statusenddate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_status_date_end")); } + /* }}} */ + /* Expiration date {{{ */ $expstartdate = array(); - $expstopdate = array(); - if (isset($_GET["expirationdate"]) && $_GET["expirationdate"]!=null) { - $expirationdate = true; - } else { - $expirationdate = false; - } - - if(isset($_GET["expirationstart"]) && $_GET["expirationstart"]) { - $tmp = explode("-", $_GET["expirationstart"]); - $expstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); + $expenddate = array(); + if(!empty($_GET["expirationstart"])) { + $expstartts = makeTsFromDate($_GET["expirationstart"]); + $expstartdate = array('year'=>(int)date('Y', $expstartts), 'month'=>(int)date('m', $expstartts), 'day'=>(int)date('d', $expstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); if (!checkdate($expstartdate['month'], $expstartdate['day'], $expstartdate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_expiration_date_start")); } - } else { -// $expstartdate = array('year'=>$_GET["expirationstartyear"], 'month'=>$_GET["expirationstartmonth"], 'day'=>$_GET["expirationstartday"], 'hour'=>0, 'minute'=>0, 'second'=>0); - $expstartdate = array(); } - if(isset($_GET["expirationend"]) && $_GET["expirationend"]) { - $tmp = explode("-", $_GET["expirationend"]); - $expstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); - if (!checkdate($expstopdate['month'], $expstopdate['day'], $expstopdate['year'])) { + if(!empty($_GET["expirationend"])) { + $expendts = makeTsFromDate($_GET["expirationend"]); + $expenddate = array('year'=>(int)date('Y', $expendts), 'month'=>(int)date('m', $expendts), 'day'=>(int)date('d', $expendts), 'hour'=>23, 'minute'=>59, 'second'=>59); + if (!checkdate($expenddate['month'], $expenddate['day'], $expenddate['year'])) { UI::exitError(getMLText("search"),getMLText("invalid_expiration_date_end")); } - } else { - //$expstopdate = array('year'=>$_GET["expirationendyear"], 'month'=>$_GET["expirationendmonth"], 'day'=>$_GET["expirationendday"], 'hour'=>23, 'minute'=>59, 'second'=>59); - $expstopdate = array(); } + /* }}} */ // status + $status = isset($_GET['status']) ? $_GET['status'] : array(); + /* $status = array(); if (isset($_GET["draft"])){ $status[] = S_DRAFT; @@ -471,6 +415,7 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext if (isset($_GET["needs_correction"])){ $status[] = S_NEEDS_CORRECTION; } + */ $reception = array(); if (isset($_GET["reception"])){ @@ -488,13 +433,10 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext // category $categories = array(); - $categorynames = array(); if(isset($_GET['category']) && $_GET['category']) { - foreach($_GET['category'] as $catname) { - if($catname) { - $cat = $dms->getDocumentCategoryByName($catname); + foreach($_GET['category'] as $catid) { + if($cat = $dms->getDocumentCategory($catid)) { $categories[] = $cat; - $categorynames[] = $cat->getName(); } } } @@ -555,20 +497,20 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext 'startFolder'=>$startFolder, 'owner'=>$ownerobjs, 'status'=>$status, - 'creationstartdate'=>$creationdate ? $startdate : array(), - 'creationenddate'=>$creationdate ? $stopdate : array(), + 'creationstartdate'=>$createstartdate ? $createstartdate : array(), + 'creationenddate'=>$createenddate ? $createenddate : array(), 'modificationstartdate'=>array(), 'modificationenddate'=>array(), 'categories'=>$categories, 'attributes'=>$attributes, 'mode'=>$resultmode, - 'expirationstartdate'=>$expirationdate ? $expstartdate : array(), - 'expirationenddate'=>$expirationdate ? $expstopdate : array(), - 'revisionstartdate'=>$revisiondate ? $revisionstartdate : array(), - 'revisionenddate'=>$revisiondate ? $revisionstopdate : array(), + 'expirationstartdate'=>$expstartdate ? $expstartdate : array(), + 'expirationenddate'=>$expenddate ? $expenddate : array(), + 'revisionstartdate'=>$revisionstartdate ? $revisionstartdate : array(), + 'revisionenddate'=>$revisionenddate ? $revisionenddate : array(), 'reception'=>$reception, - 'statusstartdate'=>$statusdate ? $statusstartdate : array(), - 'statusenddate'=>$statusdate ? $statusstopdate : array(), + 'statusstartdate'=>$statusstartdate ? $statusstartdate : array(), + 'statusenddate'=>$statusenddate ? $statusenddate : array(), 'orderby'=>$orderby )); $total = $resArr['totalDocs'] + $resArr['totalFolders']; @@ -652,21 +594,20 @@ if($settings->_showSingleSearchHit && count($entries) == 1) { $view->setParam('searchin', isset($searchin) ? $searchin : array()); $view->setParam('startfolder', isset($startFolder) ? $startFolder : null); $view->setParam('owner', $owner); - $view->setParam('startdate', isset($startdate) ? $startdate : array()); - $view->setParam('stopdate', isset($stopdate) ? $stopdate : array()); - $view->setParam('revisionstartdate', isset($revisionstartdate) ? $revisionstartdate : array()); - $view->setParam('revisionstopdate', isset($revisionstopdate) ? $revisionstopdate : array()); - $view->setParam('expstartdate', isset($expstartdate) ? $expstartdate : array()); - $view->setParam('expstopdate', isset($expstopdate) ? $expstopdate : array()); - $view->setParam('statusstartdate', isset($statusstartdate) ? $statusstartdate : array()); - $view->setParam('statusstopdate', isset($statusstopdate) ? $statusstopdate : array()); + $view->setParam('createstartdate', !empty($createstartdate) ? getReadableDate($createstartts) : ''); + $view->setParam('createenddate', !empty($createenddate) ? getReadableDate($createendts) : ''); + $view->setParam('revisionstartdate', !empty($revisionstartdate) ? getReadableDate($revisionstartts) : ''); + $view->setParam('revisionenddate', !empty($revisionenddate) ? getReadableDate($revisionendts) : ''); + $view->setParam('expstartdate', !empty($expstartdate) ? getReadableDate($expstartts) : ''); + $view->setParam('expenddate', !empty($expenddate) ? getReadableDate($expendts) : ''); + $view->setParam('statusstartdate', !empty($statusstartdate) ? getReadableDate($statusstartts) : ''); + $view->setParam('statusenddate', !empty($statusenddate) ? getReadableDate($statusendts) : ''); $view->setParam('creationdate', isset($creationdate) ? $creationdate : ''); $view->setParam('expirationdate', isset($expirationdate) ? $expirationdate: ''); $view->setParam('revisiondate', isset($revisiondate) ? $revisiondate: ''); $view->setParam('statusdate', isset($statusdate) ? $statusdate: ''); $view->setParam('status', isset($status) ? $status : array()); $view->setParam('categories', isset($categories) ? $categories : ''); - $view->setParam('category', isset($categorynames) ? $categorynames : ''); $view->setParam('mimetype', isset($mimetype) ? $mimetype : ''); $view->setParam('attributes', isset($attributes) ? $attributes : ''); $attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all)); diff --git a/views/bootstrap/class.AddDocument.php b/views/bootstrap/class.AddDocument.php index c838ef474..a6912a700 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -273,7 +273,7 @@ $(document).ready(function() { 'element'=>'input', 'type'=>'hidden', 'name'=>'sequence', - 'value'=>$seq, + 'value'=>(string) $seq, ) ); } diff --git a/views/bootstrap/class.AddEvent.php b/views/bootstrap/class.AddEvent.php index eb7cdebab..b013885d7 100644 --- a/views/bootstrap/class.AddEvent.php +++ b/views/bootstrap/class.AddEvent.php @@ -78,7 +78,6 @@ $(document).ready(function() { $this->pageNavigation("", "calendar"); $this->contentHeading(getMLText("add_event")); - $this->contentContainerStart(); $expdate = getReadableDate(); ?> @@ -87,6 +86,7 @@ $(document).ready(function() { contentContainerStart(); $this->formField( getMLText("from"), $this->getDateChooser($expdate, "from", $this->params['session']->getLanguage()) @@ -114,13 +114,13 @@ $(document).ready(function() { 'cols'=>80 ) ); + $this->contentContainerEnd(); $this->formSubmit(getMLText('add_event')); ?> contentContainerEnd(); $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ diff --git a/views/bootstrap/class.AddToTransmittal.php b/views/bootstrap/class.AddToTransmittal.php index dd9c665a9..0f8a43a39 100644 --- a/views/bootstrap/class.AddToTransmittal.php +++ b/views/bootstrap/class.AddToTransmittal.php @@ -16,7 +16,7 @@ /** * Include parent class */ -require_once("class.Bootstrap.php"); +//require_once("class.Bootstrap.php"); /** * Class which outputs the html page for AddToTransmittal view @@ -29,7 +29,7 @@ require_once("class.Bootstrap.php"); * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ -class SeedDMS_View_AddToTransmittal extends SeedDMS_Bootstrap_Style { +class SeedDMS_View_AddToTransmittal extends SeedDMS_Theme_Style { function show() { /* {{{ */ $dms = $this->params['dms']; @@ -42,31 +42,34 @@ class SeedDMS_View_AddToTransmittal extends SeedDMS_Bootstrap_Style { $this->contentStart(); $this->pageNavigation(getMLText("my_documents"), "my_documents"); $this->contentHeading(getMLText("add_to_transmittal")); - $this->contentContainerStart(); - ?> -
+ - -

-: - -

- -

-
contentContainerEnd(); $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ diff --git a/views/bootstrap/class.AttributeMgr.php b/views/bootstrap/class.AttributeMgr.php index ccfbad831..4bcb6928f 100644 --- a/views/bootstrap/class.AttributeMgr.php +++ b/views/bootstrap/class.AttributeMgr.php @@ -194,6 +194,7 @@ $(document).ready( function() { contentContainerStart(); $this->formField( getMLText("attrdef_name"), array( @@ -302,6 +303,7 @@ $(document).ready( function() { ), ['help'=>getMLText('attrdef_regex_help')] ); + $this->contentContainerEnd(); $this->formSubmit(' '.getMLText('save')); ?> @@ -321,8 +323,6 @@ $(document).ready( function() { $selattrdef = $this->params['selattrdef']; $accessop = $this->params['accessobject']; - $this->htmlAddHeader(''."\n", 'js'); - $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); $this->contentStart(); @@ -332,7 +332,7 @@ $(document).ready( function() { $this->columnStart(6); ?>
- columnEnd(); $this->columnStart(6); ?> - contentContainerStart(); ?> check_view_access($this, array('action'=>'form'))) { ?>
getID()."\"" : "") ?>>
contentContainerEnd(); $this->columnEnd(); $this->rowEnd(); diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index fb013d1dc..8391ae1d9 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -372,10 +372,30 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo " \n"; echo " \n"; echo " \n"; - echo " params['dms']->getRootFolder()->getId()."\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " params['dms']->getRootFolder()->getId()."\">"; + echo " params['dms']->getRootFolder()->getId()."\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."\n"; /* user profile menu {{{ */ if(isset($this->params['session']) && isset($this->params['user']) && $this->params['user']) { + /* search form {{{ */ + echo " "; + if ($folder!=null && is_object($folder) && $folder->isType('folder')) { + echo " getID()."\" />"; + } + echo " "; + echo " params['defaultsearchmethod'] == 'fulltext_' ? "" : "id=\"searchfield\"")." data-provide=\"typeahead\" type=\"search\" style=\"width: 150px;\" placeholder=\"".getMLText("search")."\"/>"; + if($this->params['defaultsearchmethod'] == 'fulltext') + echo " "; +// if($this->params['enablefullsearch']) { +// echo " "; +// } + // echo " "; + echo "
\n"; + /* }}} End of search form */ + echo "
\n"; echo "
    \n"; echo "
  • \n"; @@ -485,12 +505,15 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo "
      \n"; $menuitems = array(); + /* calendar {{{ */ if ($this->params['enablecalendar'] && $accessobject->check_view_access('Calendar')) $menuitems['calendar'] = array('link'=>'../out/out.Calendar.php?mode='.$this->params['calendardefaultview'], 'label'=>"calendar"); if ($accessobject->check_view_access('AdminTools')) $menuitems['admintools'] = array('link'=>'../out/out.AdminTools.php', 'label'=>"admin_tools"); if($this->params['enablehelp']) { $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $menuitems['help'] = array('link'=>'../out/out.Help.php?context='.$tmp[1], 'label'=>"help"); } + /* }}} End of calendar */ + /* Check if hook exists because otherwise callHook() will override $menuitems */ if($this->hasHook('globalNavigationBar')) $menuitems = $this->callHook('globalNavigationBar', $menuitems); @@ -508,22 +531,6 @@ background-image: linear-gradient(to bottom, #882222, #111111);; } } echo "
    \n"; - - /* search form {{{ */ - echo "
    "; - if ($folder!=null && is_object($folder) && $folder->isType('folder')) { - echo " getID()."\" />"; - } - echo " "; - echo " params['defaultsearchmethod'] == 'fulltext_' ? "" : "id=\"searchfield\"")." data-provide=\"typeahead\" type=\"search\" style=\"width: 150px;\" placeholder=\"".getMLText("search")."\"/>"; - if($this->params['defaultsearchmethod'] == 'fulltext') - echo " "; -// if($this->params['enablefullsearch']) { -// echo " "; -// } - // echo " "; - echo "
    \n"; - /* }}} End of search form */ echo "
\n"; } echo " \n"; @@ -662,7 +669,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $content = ''; $content .= "\n"; foreach($menuitems as $menuitem) { - $content .= "
  • \n"; + $content .= "
  • \n"; $content .= ' "; + $content .= ''.$menuitem['badge'].""; $content .= ' '."\n"; $content .= "
  • \n"; } @@ -707,6 +714,18 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo $content; } /* }}} */ + protected function showPaneHeader($name, $title, $isactive) { /* {{{ */ + echo ''."\n"; + } /* }}} */ + + protected function showStartPaneContent($name, $isactive) { /* {{{ */ + echo '
    '; + } /* }}} */ + + protected function showEndPaneContent($name, $currentab) { /* {{{ */ + echo '
    '; + } /* }}} */ + private function folderNavigationBar($folder) { /* {{{ */ $dms = $this->params['dms']; $accessobject = $this->params['accessobject']; @@ -1218,6 +1237,9 @@ background-image: linear-gradient(to bottom, #882222, #111111);; (!empty($value['cols']) ? ' rows="'.$value['cols'].'"' : ''). (!empty($value['required']) ? ' required' : '').">".(!empty($value['value']) ? $value['value'] : '').""; break; + case 'plain': + echo $value['value']; + break; case 'input': default: switch($value['type']) { @@ -1360,6 +1382,26 @@ background-image: linear-gradient(to bottom, #882222, #111111);; } } /* }}} */ + /** + * Get attributes for a button opening a modal box + * + * @param array $config contains elements + * target: id of modal box + * remote: URL of data to be loaded into box + * @return string + */ + function getModalBoxLinkAttributes($config) { /* {{{ */ + $attrs = array(); + $attrs[] = array('data-target', '#'.$config['target']); + if(isset($config['remote'])) + $attrs[] = array('href', $config['remote']); + $attrs[] = array('data-toggle', 'modal'); + $attrs[] = array('role', 'button'); + if(isset($config['class'])) + $attrs[] = array('class', $config['class']); + return $attrs; + } /* }}} */ + /** * Get html for button opening a modal box * @@ -1372,11 +1414,17 @@ background-image: linear-gradient(to bottom, #882222, #111111);; function getModalBoxLink($config) { /* {{{ */ $content = ''; $content .= "$attrval) $content .= ' '.$attrname.'="'.$attrval.'"'; } - $content .= ">".$config['title']."…\n"; + $content .= ">".$config['title']."\n"; return $content; } /* }}} */ @@ -1391,7 +1439,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; */ function getModalBox($config) { /* {{{ */ $content = ' - @@ -1834,8 +1882,8 @@ $(document).ready(function() { case SeedDMS_Core_AttributeDefinition::type_date: $objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : ''; $dateformat = getConvertDateFormat($this->params['settings']->_dateformat); - $content .= ' - + $content .= ' + '; break; @@ -1953,7 +2001,7 @@ $(document).ready(function() { array( 'target' => 'dropfolderChooser', 'remote' => "../out/out.DropFolderChooser.php?form=".$formName."&dropfolderfile=".urlencode($dropfolderfile)."&showfolders=".$showfolders, - 'title' => ($showfolders ? getMLText("choose_target_folder"): getMLText("choose_target_file")) + 'title' => ($showfolders ? getMLText("choose_target_folder"): getMLText("choose_target_file")).'…' )); $content .= "\n"; $content .= $this->getModalBox( @@ -2980,7 +3028,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) $content .= "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; $content .= ""; - $content .= ""; + $content .= ""; if($onepage) $content .= "".htmlspecialchars($document->getName()) . ""; else @@ -3021,6 +3069,12 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) } } } + + if($categories = $document->getCategories()) { + $content .= "
    "; + foreach($categories as $category) + $content .= "".$category->getName()." "; + } if(!empty($extracontent['bottom_title'])) $content .= $extracontent['bottom_title']; $content .= "\n"; @@ -3168,9 +3222,9 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) $content .= $this->folderListRowStart($subFolder); $content .= "getID()."&showtree=".$showtree."\">getMimeIcon(".folder")."\" width=\"24\" height=\"24\" border=0>\n"; if($onepage) - $content .= "" . "getId()."\">".htmlspecialchars($subFolder->getName()).""; + $content .= "" . "getId()."\">".htmlspecialchars($subFolder->getName()).""; else - $content .= "getID()."&showtree=".$showtree."\">" . htmlspecialchars($subFolder->getName()) . ""; + $content .= "getID()."&showtree=".$showtree."\">" . htmlspecialchars($subFolder->getName()) . ""; if(isset($extracontent['below_title'])) $content .= $extracontent['below_title']; $content .= "
    ".getMLText('owner').": ".htmlspecialchars($owner->getFullName()).", ".getMLText('creation_date').": ".date('Y-m-d', $subFolder->getDate()).""; diff --git a/views/bootstrap/class.Calendar.php b/views/bootstrap/class.Calendar.php index 580b64f8f..5b701cd66 100644 --- a/views/bootstrap/class.Calendar.php +++ b/views/bootstrap/class.Calendar.php @@ -65,13 +65,13 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style { if($event) { // print_r($event); $this->contentHeading(getMLText('edit_event')); - $this->contentContainerStart(); ?>
    "> contentContainerStart(); $this->formField( getMLText("from"), $this->getDateChooser(getReadableDate($event["start"]), "from") @@ -100,11 +100,11 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style { 'required'=>$strictformcheck ) ); + $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('save')); ?>
    contentContainerEnd(); $this->contentHeading(getMLText('rm_event')); $this->contentContainerStart(); ?> diff --git a/views/bootstrap/class.Categories.php b/views/bootstrap/class.Categories.php index 3931cfd80..e3711fb53 100644 --- a/views/bootstrap/class.Categories.php +++ b/views/bootstrap/class.Categories.php @@ -64,7 +64,7 @@ $(document).ready( function() { if($selcat) { $this->contentHeading(getMLText("category_info")); $c = $selcat->countDocumentsByCategory(); - echo "\n"; + echo "
    \n"; echo "\n"; echo "
    ".getMLText('document_count')."".($c)."
    "; @@ -115,6 +115,7 @@ $(document).ready( function() { contentContainerStart(); $this->formField( getMLText("name"), array( @@ -124,6 +125,7 @@ $(document).ready( function() { 'value'=>($category ? htmlspecialchars($category->getName()) : '') ) ); + $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('save')); ?> @@ -143,8 +145,6 @@ $(document).ready( function() { $categories = $this->params['categories']; $selcat = $this->params['selcategory']; - $this->htmlAddHeader(''."\n", 'js'); - $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); $this->contentStart(); @@ -155,26 +155,33 @@ $(document).ready( function() { $this->columnStart(6); ?>
    -
    getID()."\"" : "") ?>>
    getID()."\"" : "") ?>>
    columnEnd(); $this->columnStart(6); - $this->contentContainerStart(); ?>
    getID()."\"" : "") ?>>
    contentContainerEnd(); $this->columnEnd(); $this->rowEnd(); diff --git a/views/bootstrap/class.Charts.php b/views/bootstrap/class.Charts.php index 282b8c05f..e7f5ee535 100644 --- a/views/bootstrap/class.Charts.php +++ b/views/bootstrap/class.Charts.php @@ -225,7 +225,7 @@ $(document).ready( function() {
    contentContainerEnd(); - echo ""; + echo "
    "; echo ""; echo ""; if(in_array($type, array('docspermonth', 'docsaccumulated'))) diff --git a/views/bootstrap/class.CheckInDocument.php b/views/bootstrap/class.CheckInDocument.php index b14b43701..904596c8b 100644 --- a/views/bootstrap/class.CheckInDocument.php +++ b/views/bootstrap/class.CheckInDocument.php @@ -14,7 +14,7 @@ /** * Include parent class */ -require_once("class.Bootstrap.php"); +//require_once("class.Bootstrap.php"); /** * Class which outputs the html page for Document view @@ -25,7 +25,7 @@ require_once("class.Bootstrap.php"); * @copyright Copyright (C) 2015 Uwe Steinmann * @version Release: @package_version@ */ -class SeedDMS_View_CheckInDocument extends SeedDMS_Bootstrap_Style { +class SeedDMS_View_CheckInDocument extends SeedDMS_Theme_Style { function js() { /* {{{ */ $strictformcheck = $this->params['strictformcheck']; diff --git a/views/bootstrap/class.Clipboard.php b/views/bootstrap/class.Clipboard.php index 1bd9055a9..063a34808 100644 --- a/views/bootstrap/class.Clipboard.php +++ b/views/bootstrap/class.Clipboard.php @@ -119,9 +119,12 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style { $content .= $this->folderListRowStart($folder); $content .= "\n"; $content .= "\n"; $content .= ""; $content .= "\n"; $content .= "
    ".getMLText('chart_'.$type.'_title')."".getMLText('total')."getID()."&showtree=".showtree()."\">getMimeIcon(".folder")."\" width=\"24\" height=\"24\" border=0>getID()."&showtree=".showtree()."\">" . htmlspecialchars($folder->getName()) . ""; + /* if($comment) { $content .= "
    ".htmlspecialchars($comment).""; } + */ + $content .= $this->getListRowPath($folder); $content .= "
    \n"; $content .= ""; @@ -165,9 +168,12 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style { $content .= "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">getID()."&showtree=".showtree()."\">" . htmlspecialchars($document->getName()) . ""; + /* if($comment) { $content .= "
    ".htmlspecialchars($comment).""; } + */ + $content .= $this->getListRowPath($document); $content .= "
    \n"; $content .= ""; @@ -233,7 +239,7 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style { * actually available */ if($foldercount || $doccount) { - $content = "".$content; + $content = "
    ".$content; $content .= "
    "; } else { } diff --git a/views/bootstrap/class.DefaultKeywords.php b/views/bootstrap/class.DefaultKeywords.php index dcd12592f..79cbabcbd 100644 --- a/views/bootstrap/class.DefaultKeywords.php +++ b/views/bootstrap/class.DefaultKeywords.php @@ -120,13 +120,13 @@ $(document).ready( function() { function actionmenu() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; - $selcategoryid = $this->params['selcategoryid']; + $selcategory = $this->params['selcategory']; - if($selcategoryid && $selcategoryid > 0) { + if($selcategory && $selcategory->getId() > 0) { ?>
    - +
    @@ -137,20 +137,20 @@ $(document).ready( function() { function form() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; - $category = $dms->getKeywordCategory($this->params['selcategoryid']); + $category = $this->params['selcategory']; $this->showKeywordForm($category, $user); } /* }}} */ function showKeywordForm($category, $user) { /* {{{ */ if(!$category) { - $this->contentContainerStart(); ?>
    contentContainerStart(); $this->formField( getMLText("name"), array( @@ -160,20 +160,21 @@ $(document).ready( function() { 'value'=>'' ) ); + $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('new_default_keyword_category')); ?>
    contentContainerEnd(); } else { - $this->contentContainerStart(); $owner = $category->getOwner(); if ((!$user->isAdmin()) && ($owner->getID() != $user->getID())) return; ?>
    + contentContainerStart(); $this->formField( getMLText("name"), array( @@ -183,13 +184,13 @@ $(document).ready( function() { 'value'=>$category->getName() ) ); + $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('save')); ?>
    contentContainerEnd(); $this->contentHeading(getMLText("default_keywords")); - $this->contentContainerStart(); +// $this->contentContainerStart(); ?> getKeywordLists(); @@ -198,13 +199,13 @@ $(document).ready( function() { else foreach ($lists as $list) { ?> -
    + "> - "> - + "> +
    @@ -212,7 +213,7 @@ $(document).ready( function() { "> - +

    @@ -224,14 +225,14 @@ $(document).ready( function() { - - "> +   + contentContainerEnd(); +// $this->contentContainerEnd(); } } /* }}} */ @@ -239,7 +240,7 @@ $(document).ready( function() { $dms = $this->params['dms']; $user = $this->params['user']; $categories = $this->params['categories']; - $selcategoryid = $this->params['selcategoryid']; + $selcategory = $this->params['selcategory']; $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); @@ -251,31 +252,33 @@ $(document).ready( function() { $this->columnStart(4); ?>
    -
    -
    >
    +
    getId()."\"" : "") ?>>
    columnEnd(); $this->columnStart(8); ?> -
    >
    +
    getId()."\"" : "") ?>>
    columnEnd(); diff --git a/views/bootstrap/class.DocumentAccess.php b/views/bootstrap/class.DocumentAccess.php index acccb932d..994017c7b 100644 --- a/views/bootstrap/class.DocumentAccess.php +++ b/views/bootstrap/class.DocumentAccess.php @@ -35,7 +35,7 @@ class SeedDMS_View_DocumentAccess extends SeedDMS_Theme_Style { } /* }}} */ function getAccessModeSelection($defMode) { /* {{{ */ - $content = "\n"; $content .= "\t\n"; $content .= "\t\n"; $content .= "\t\n"; @@ -160,7 +160,7 @@ $(document).ready( function() { - "> + "> contentContainerEnd(); diff --git a/views/bootstrap/class.DocumentNotify.php b/views/bootstrap/class.DocumentNotify.php index c9a1750ff..a6463abcf 100644 --- a/views/bootstrap/class.DocumentNotify.php +++ b/views/bootstrap/class.DocumentNotify.php @@ -91,7 +91,6 @@ $(document).ready( function() { $this->rowStart(); $this->columnStart(6); - $this->contentContainerStart(); ?> @@ -111,6 +110,7 @@ $(document).ready( function() { } elseif (!$user->isGuest() && !in_array($user->getID(), $userNotifyIDs)) { $options[] = array($user->getID(), htmlspecialchars($user->getLogin() . " - " .$user->getFullName())); } + $this->contentContainerStart(); $this->formField( getMLText("user"), array( @@ -139,18 +139,17 @@ $(document).ready( function() { 'options'=>$options ) ); + $this->contentContainerEnd(); $this->formSubmit(getMLText('add')); ?> contentContainerEnd(); $this->columnEnd(); $this->columnStart(6); - print "\n"; if ((count($notifyList["users"]) == 0) && (count($notifyList["groups"]) == 0)) { - print ""; - } - else { + $this->infoMsg(getMLText("empty_notify_list")); + } else { + print "
    ".getMLText("empty_notify_list")."
    \n"; foreach ($notifyList["users"] as $userNotify) { print ""; print ""; @@ -162,7 +161,7 @@ $(document).ready( function() { print "\n"; print "getID()."\">\n"; print ""; print "\n"; }else print ""; @@ -179,14 +178,14 @@ $(document).ready( function() { print "\n"; print "getID()."\">\n"; print ""; print "\n"; }else print ""; print ""; } + print "
    "; - print ""; + print ""; print ""; - print ""; + print ""; print "
    \n"; } - print "
    \n"; $this->columnEnd(); $this->rowEnd(); diff --git a/views/bootstrap/class.EditComment.php b/views/bootstrap/class.EditComment.php index 072c96820..d0a049581 100644 --- a/views/bootstrap/class.EditComment.php +++ b/views/bootstrap/class.EditComment.php @@ -82,13 +82,13 @@ $(document).ready(function() { $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); $this->contentHeading(getMLText("edit_comment")); - $this->contentContainerStart(); ?>
    contentContainerStart(); $this->formField( getMLText("comment"), array( @@ -99,11 +99,11 @@ $(document).ready(function() { 'value'=>htmlspecialchars($version->getComment()) ) ); + $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('save')); ?>
    contentContainerEnd(); $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ diff --git a/views/bootstrap/class.EditEvent.php b/views/bootstrap/class.EditEvent.php index 061a1b803..67b0dcc4c 100644 --- a/views/bootstrap/class.EditEvent.php +++ b/views/bootstrap/class.EditEvent.php @@ -16,7 +16,7 @@ /** * Include parent class */ -require_once("class.Bootstrap.php"); +//require_once("class.Bootstrap.php"); /** * Class which outputs the html page for EditEvent view @@ -29,7 +29,7 @@ require_once("class.Bootstrap.php"); * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ -class SeedDMS_View_EditEvent extends SeedDMS_Bootstrap_Style { +class SeedDMS_View_EditEvent extends SeedDMS_Theme_Style { function js() { /* {{{ */ $strictformcheck = $this->params['strictformcheck']; diff --git a/views/bootstrap/class.EditOnline.php b/views/bootstrap/class.EditOnline.php index abba022a6..0b611fc60 100644 --- a/views/bootstrap/class.EditOnline.php +++ b/views/bootstrap/class.EditOnline.php @@ -96,18 +96,18 @@ $(document).ready(function() { $document = $this->params['document']; $version = $this->params['version']; ?> -