diff --git a/CHANGELOG b/CHANGELOG index 8f8d56df1..89410c416 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,16 @@ +-------------------------------------------------------------------------------- + Changes in version 4.3.23 +-------------------------------------------------------------------------------- +- send notification if document is delete to those users watching the folder +- fix editing of customer attributes of type checkbox +- disallowed read access for a group didn't prevent the users from being selected + as a reviewer/approver +- move the last bits of plain sql code from op/*.php into the core +- group manager uses ajax like user manager +- start to enforce content security policy +- fixed possible XSS attack in user manager +- ldap search can be filtered (Thanks to Tobias for the patch) + -------------------------------------------------------------------------------- Changes in version 4.3.22 -------------------------------------------------------------------------------- diff --git a/Makefile b/Makefile index 15b632e01..8893fe0d7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=4.3.22 +VERSION=4.3.23 SRC=CHANGELOG inc conf utils index.php languages views op out README.md README.Notification README.Ubuntu drop-tables-innodb.sql styles js TODO LICENSE Makefile webdav install restapi # webapp diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index d091296d5..c0964b753 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -273,7 +273,7 @@ class SeedDMS_Core_DMS { $this->convertFileTypes = array(); $this->version = '@package_version@'; if($this->version[0] == '@') - $this->version = '4.3.21'; + $this->version = '4.3.23'; } /* }}} */ /** @@ -2269,5 +2269,39 @@ class SeedDMS_Core_DMS { $this->callbacks[$name] = array($func, $params); } /* }}} */ + /** + * Create an sql dump of the complete database + * + * @param string $filename name of dump file + */ + function createDump($filename) { /* {{{ */ + $h = fopen($filename, "w"); + if(!$h) + return false; + + $tables = $this->db->TableList('TABLES'); + foreach($tables as $table) { + $query = "SELECT * FROM `".$table."`"; + $records = $this->db->getResultArray($query); + fwrite($h,"\n-- TABLE: ".$table."--\n\n"); + foreach($records as $record) { + $values=""; + $i = 1; + foreach ($record as $column) { + if (is_numeric($column)) $values .= $column; + else $values .= $this->db->qstr($column); + + if ($i<(count($record))) $values .= ","; + $i++; + } + + fwrite($h, "INSERT INTO `".$table."` VALUES (".$values.");\n"); + } + } + + fclose($h); + return true; + } /* }}} */ + } ?> diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 2f7191408..e19ec8313 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -1955,7 +1955,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ (strlen($userIDs) == 0 ? "" : " OR (`tblUsers`.`id` IN (". $userIDs ."))"). ") ORDER BY `login`"; } - /* If default access is equal or greate then read, $userIDs and + /* If default access is equal or greater then M_READ, $userIDs and * $groupIDs contains a list of user without read access */ else { @@ -1965,15 +1965,20 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ "WHERE `tblGroupMembers`.`groupID` NOT IN (". $groupIDs .")". "AND `tblUsers`.`role` != ".SeedDMS_Core_User::role_guest." ". (strlen($userIDs) == 0 ? "" : " AND (`tblUsers`.`id` NOT IN (". $userIDs ."))")." UNION "; + } else { + $queryStr .= + "SELECT `tblUsers`.* FROM `tblUsers` ". + "WHERE `tblUsers`.`role` != ".SeedDMS_Core_User::role_guest." ". + (strlen($userIDs) == 0 ? "" : " AND (`tblUsers`.`id` NOT IN (". $userIDs ."))")." UNION "; } $queryStr .= "SELECT `tblUsers`.* FROM `tblUsers` ". "WHERE (`tblUsers`.`id` = ". $this->_ownerID . ") ". "OR (`tblUsers`.`role` = ".SeedDMS_Core_User::role_admin.") ". - "UNION ". - "SELECT `tblUsers`.* FROM `tblUsers` ". - "WHERE `tblUsers`.`role` != ".SeedDMS_Core_User::role_guest." ". - (strlen($userIDs) == 0 ? "" : " AND (`tblUsers`.`id` NOT IN (". $userIDs ."))"). +// "UNION ". +// "SELECT `tblUsers`.* FROM `tblUsers` ". +// "WHERE `tblUsers`.`role` != ".SeedDMS_Core_User::role_guest." ". +// (strlen($userIDs) == 0 ? "" : " AND (`tblUsers`.`id` NOT IN (". $userIDs ."))"). " ORDER BY `login`"; } $resArr = $db->getResultArray($queryStr); diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 42792819f..9f7a467a2 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -12,11 +12,11 @@ uwe@steinmann.cx yes - 2015-11-09 - + 2016-01-21 + - 4.3.22 - 4.3.22 + 4.3.23 + 4.3.23 stable @@ -24,8 +24,8 @@ GPL License -- fix sql statement to reset password -- pass some more information for timeline +- new method SeedDMS_Core_DMS::createDump() +- minor improvements int SeedDMS_Core_Document::getReadAccessList() @@ -909,5 +909,22 @@ by a group or user right - user getCurrentTimestamp() and getCurrentDatetime() whenever possible + + 2015-11-09 + + + 4.3.22 + 4.3.22 + + + stable + stable + + GPL License + +- fix sql statement to reset password +- pass some more information for timeline + + diff --git a/SeedDMS_Lucene/Lucene/IndexedDocument.php b/SeedDMS_Lucene/Lucene/IndexedDocument.php index 8d24b3793..82e1df9b7 100644 --- a/SeedDMS_Lucene/Lucene/IndexedDocument.php +++ b/SeedDMS_Lucene/Lucene/IndexedDocument.php @@ -124,7 +124,7 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { $mimetype = $version->getMimeType(); if(isset($_convcmd[$mimetype])) { $cmd = sprintf($_convcmd[$mimetype], $path); - $content = self::execWithTimeout($cmd); + $content = self::execWithTimeout($cmd, $timeout); /* $fp = popen($cmd, 'r'); if($fp) { diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php b/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php index 455b3dd77..3ad771513 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php @@ -129,7 +129,7 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { $mimetype = $version->getMimeType(); if(isset($_convcmd[$mimetype])) { $cmd = sprintf($_convcmd[$mimetype], $path); - $content = self::execWithTimeout($cmd); + $content = self::execWithTimeout($cmd, $timeout); if($content) { $this->addField('content', $content, 'unstored'); } diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php index 8a311cd50..a6eb09aa6 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php @@ -55,7 +55,8 @@ class SeedDMS_SQLiteFTS_Indexer { * @param string $indexerDir directory on disk containing the index */ static function create($indexerDir) { /* {{{ */ - unlink($indexerDir.'/index.db'); + if(file_exists($indexerDir.'/index.db')) + unlink($indexerDir.'/index.db'); $index = new SeedDMS_SQLiteFTS_Indexer($indexerDir); /* Make sure the sequence of fields is identical to the field list * in SeedDMS_SQLiteFTS_Term diff --git a/SeedDMS_SQLiteFTS/package.xml b/SeedDMS_SQLiteFTS/package.xml index 67e694d9c..1a8b927ca 100644 --- a/SeedDMS_SQLiteFTS/package.xml +++ b/SeedDMS_SQLiteFTS/package.xml @@ -11,10 +11,10 @@ uwe@steinmann.cx yes - 2015-11-16 + 2016-01-10 - 1.0.1 + 1.0.2 1.0.1 @@ -23,7 +23,7 @@ GPL License -add __get() to SQLiteFTS_Document because class.IndexInfo.php access class variable title which doesn't exists +check if index exists before removing it when creating a new one @@ -82,5 +82,21 @@ add __get() to SQLiteFTS_Document because class.IndexInfo.php access class varia initial release + + 2015-11-16 + + + 1.0.1 + 1.0.1 + + + stable + stable + + GPL License + +add __get() to SQLiteFTS_Document because class.IndexInfo.php access class variable title which doesn't exists + + diff --git a/conf/settings.xml.template b/conf/settings.xml.template index 11e30dcd4..e8c0f56ae 100644 --- a/conf/settings.xml.template +++ b/conf/settings.xml.template @@ -111,6 +111,7 @@ - URIs are supported, e.g.: ldaps://ldap.host.com - port: port of the authentification server - baseDN: top level of the LDAP directory tree + - filter: Additional filters which are to be checked --> - +$('#clearfilename').click(function(ev) { + $('#dropfolderfile').val(''); +}); +printDropFolderChooserHtml($formName, $dropfolderfile); +?> + () { exit; } /* }}} */ + function printNewTreeNavigation($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */ + $this->printNewTreeNavigationHtml($folderid, $accessmode, $showdocs, $formid, $expandtree, $orderby); +?> + +\n"; + } /* }}} */ + /** * Create a tree of folders using jqtree. * @@ -1150,7 +1224,7 @@ function clearFilename() { * @param boolean $showdocs set to true if tree shall contain documents * as well. */ - function printNewTreeNavigation($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */ + function printNewTreeNavigationJs($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */ function jqtree($path, $folder, $user, $accessmode, $showdocs=1, $expandtree=0, $orderby='') { if($path || $expandtree) { if($path) @@ -1213,9 +1287,7 @@ function clearFilename() { $tree = array(array('label'=>$root->getName(), 'id'=>$root->getID(), 'load_on_demand'=>true, 'is_folder'=>true)); } - echo "
\n"; ?> - getID(); $content = ''; - $content .= ''; - $this->addFooterJS(" -$('#delete-document-btn-".$docid."').popover({ - title: '".getMLText("rm_document")."', - placement: 'left', - html: true, - content: \"
".htmlspecialchars(getMLText("confirm_rm_document", array ("documentname" => $document->getName())), ENT_QUOTES)."
\"}); -"); + $content .= ' $document->getName())), ENT_QUOTES).'">'; if($return) return $content; else @@ -1393,6 +1457,56 @@ $('#delete-document-btn-".$docid."').popover({ return ''; } /* }}} */ + function printDeleteDocumentButtonJs(){ /* {{{ */ + echo " + $(document).ready(function () { + $('.delete-document-btn').click(function(ev) { + id = $(ev.currentTarget).attr('rel'); + confirmmsg = $(ev.currentTarget).attr('confirmmsg'); + msg = $(ev.currentTarget).attr('msg'); + formtoken = '".createFormKey('removedocument')."'; + bootbox.dialog(confirmmsg, [{ + \"label\" : \" ".getMLText("rm_document")."\", + \"class\" : \"btn-danger\", + \"callback\": function() { + $.get('../op/op.Ajax.php', + { command: 'deletedocument', id: id, formtoken: formtoken }, + function(data) { + if(data.success) { + $('#table-row-document-'+id).hide('slow'); + noty({ + text: msg, + type: 'success', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 1500, + }); + } else { + noty({ + text: data.message, + type: 'error', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 3500, + }); + } + }, + 'json' + ); + } + }, { + \"label\" : \"".getMLText("cancel")."\", + \"class\" : \"btn-cancel\", + \"callback\": function() { + } + }]); + }); + }); + "; + } /* }}} */ + /** * Print button with link for deleting a folder * @@ -1407,14 +1521,7 @@ $('#delete-document-btn-".$docid."').popover({ function printDeleteFolderButton($folder, $msg, $return=false){ /* {{{ */ $folderid = $folder->getID(); $content = ''; - $content .= ''; - $this->addFooterJS(" -$('#delete-folder-btn-".$folderid."').popover({ - title: '".getMLText("rm_folder")."', - placement: 'left', - html: true, - content: \"
".htmlspecialchars(getMLText("confirm_rm_folder", array ("foldername" => $folder->getName())), ENT_QUOTES)."
\"}); -"); + $content .= ' $folder->getName())), ENT_QUOTES).'">'; if($return) return $content; else @@ -1422,6 +1529,56 @@ $('#delete-folder-btn-".$folderid."').popover({ return ''; } /* }}} */ + function printDeleteFolderButtonJs(){ /* {{{ */ + echo " + $(document).ready(function () { + $('.delete-folder-btn').click(function(ev) { + id = $(ev.currentTarget).attr('rel'); + confirmmsg = $(ev.currentTarget).attr('confirmmsg'); + msg = $(ev.currentTarget).attr('msg'); + formtoken = '".createFormKey('removefolder')."'; + bootbox.dialog(confirmmsg, [{ + \"label\" : \" ".getMLText("rm_folder")."\", + \"class\" : \"btn-danger\", + \"callback\": function() { + $.get('../op/op.Ajax.php', + { command: 'deletefolder', id: id, formtoken: formtoken }, + function(data) { + if(data.success) { + $('#table-row-folder-'+id).hide('slow'); + noty({ + text: msg, + type: 'success', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 1500, + }); + } else { + noty({ + text: data.message, + type: 'error', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 3500, + }); + } + }, + 'json' + ); + } + }, { + \"label\" : \"".getMLText("cancel")."\", + \"class\" : \"btn-cancel\", + \"callback\": function() { + } + }]); + }); + }); + "; + } /* }}} */ + function printLockButton($document, $msglock, $msgunlock, $return=false) { /* {{{ */ $docid = $document->getID(); if($document->isLocked()) { @@ -2037,11 +2194,10 @@ mayscript> * * @param object $document document */ - protected function printTimeline($timelineurl, $height=300, $start='', $end='', $skip=array()) { /* {{{ */ + protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array()) { /* {{{ */ if(!$timelineurl) return; ?> - + protected function printTimelineHtml($height) { /* {{{ */ +?>
\n"; + $this->printTimelineJs($timelineurl, $height, $start, $end, $skip); + echo ""; + $this->printTimelineHtml($height); + } /* }}} */ } ?> diff --git a/views/bootstrap/class.Charts.php b/views/bootstrap/class.Charts.php index 101348018..9ca2b287c 100644 --- a/views/bootstrap/class.Charts.php +++ b/views/bootstrap/class.Charts.php @@ -30,68 +30,14 @@ require_once("class.Bootstrap.php"); * @version Release: @package_version@ */ class SeedDMS_View_Charts extends SeedDMS_Bootstrap_Style { - var $dms; - var $folder_count; - var $document_count; - var $file_count; - var $storage_size; - function show() { /* {{{ */ - $this->dms = $this->params['dms']; - $user = $this->params['user']; - $rootfolder = $this->params['rootfolder']; + function js() { /* {{{ */ $data = $this->params['data']; $type = $this->params['type']; - $this->htmlAddHeader( - ''."\n". - ''."\n". - ''."\n". - ''."\n"); - - $this->htmlStartPage(getMLText("folders_and_documents_statistic")); - $this->globalNavigation(); - $this->contentStart(); - $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); + header('Content-Type: application/json'); ?> - -\n"; - -echo "
\n"; -$this->contentHeading(getMLText("chart_selection")); -echo "
\n"; -foreach(array('docsperuser', 'sizeperuser', 'docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) { - echo "\n"; -} -echo "
\n"; -echo "
\n"; - -if(in_array($type, array('docspermonth', 'docsaccumulated'))) { - echo "
\n"; -} else { - echo "
\n"; -} -$this->contentHeading(getMLText('chart_'.$type.'_title')); -echo "
\n"; -?> -
-\n"; -echo "
\n"; - -if(!in_array($type, array('docspermonth', 'docsaccumulated'))) { - echo "
\n"; - $this->contentHeading(getMLText('legend')); - echo "
\n"; - echo "
\n"; - echo "
\n"; -} - -echo "
\n"; -?> -'."\n". + ''."\n". + ''."\n". + ''."\n"); + + $this->htmlStartPage(getMLText("folders_and_documents_statistic")); + $this->globalNavigation(); + $this->contentStart(); + $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); + ?> - + \n"; + +echo "
\n"; +$this->contentHeading(getMLText("chart_selection")); +echo "
\n"; +foreach(array('docsperuser', 'sizeperuser', 'docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) { + echo "\n"; +} +echo "
\n"; +echo "
\n"; + +if(in_array($type, array('docspermonth', 'docsaccumulated'))) { + echo "
\n"; +} else { + echo "
\n"; +} +$this->contentHeading(getMLText('chart_'.$type.'_title')); +echo "
\n"; +?> +
+\n"; +echo "
\n"; + +if(!in_array($type, array('docspermonth', 'docsaccumulated'))) { + echo "
\n"; + $this->contentHeading(getMLText('legend')); + echo "
\n"; + echo "
\n"; + echo "
\n"; +} + +echo "
\n"; $this->contentContainerEnd(); $this->htmlEndPage(); diff --git a/views/bootstrap/class.DocumentAccess.php b/views/bootstrap/class.DocumentAccess.php index 51f3d9b89..b58478e54 100644 --- a/views/bootstrap/class.DocumentAccess.php +++ b/views/bootstrap/class.DocumentAccess.php @@ -40,23 +40,9 @@ class SeedDMS_View_DocumentAccess extends SeedDMS_Bootstrap_Style { print "\n"; } /* }}} */ - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $document = $this->params['document']; - $folder = $this->params['folder']; - $allUsers = $this->params['allusers']; - $allGroups = $this->params['allgroups']; - - - $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); - $this->globalNavigation($folder); - $this->contentStart(); - $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); - + function js() { /* {{{ */ + header('Content-Type: application/json'); ?> - - +$(document).ready( function() { + $('body').on('submit', '#form1', function(ev){ + if(checkForm()) return; + event.preventDefault(); + }); +}); params['dms']; + $user = $this->params['user']; + $document = $this->params['document']; + $folder = $this->params['folder']; + $allUsers = $this->params['allusers']; + $allGroups = $this->params['allgroups']; + + + $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); + $this->globalNavigation($folder); + $this->contentStart(); + $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); $this->contentHeading(getMLText("edit_document_access")); $this->contentContainerStart(); @@ -233,7 +239,7 @@ function checkForm() print "
"; } ?> -
+ diff --git a/views/bootstrap/class.DocumentChooser.php b/views/bootstrap/class.DocumentChooser.php index 71e71a8db..9c704dfe8 100644 --- a/views/bootstrap/class.DocumentChooser.php +++ b/views/bootstrap/class.DocumentChooser.php @@ -31,17 +31,27 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style { + function js() { /* {{{ */ + $folder = $this->params['folder']; + $form = $this->params['form']; + + header('Content-Type: application/json'); + $this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form); + } /* }}} */ + function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $folder = $this->params['folder']; $form = $this->params['form']; - $this->htmlStartPage(getMLText("choose_target_document")); - $this->contentContainerStart(); - $this->printNewTreeNavigation($folder->getID(), M_READ, 1, $form); - $this->contentContainerEnd(); - echo "\n\n"; +// $this->htmlStartPage(getMLText("choose_target_document")); +// $this->contentContainerStart(); +// $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form); + $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form); + echo ''."\n"; +// $this->contentContainerEnd(); +// $this->htmlEndPage(true); } /* }}} */ } ?> diff --git a/views/bootstrap/class.DocumentNotify.php b/views/bootstrap/class.DocumentNotify.php index e6c752fbe..b2191a18e 100644 --- a/views/bootstrap/class.DocumentNotify.php +++ b/views/bootstrap/class.DocumentNotify.php @@ -31,22 +31,9 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_DocumentNotify extends SeedDMS_Bootstrap_Style { - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $folder = $this->params['folder']; - $document = $this->params['document']; - $sortusersinlist = $this->params['sortusersinlist']; - - $notifyList = $document->getNotifyList(); - - $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); - $this->globalNavigation($folder); - $this->contentStart(); - $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); - + function js() { /* {{{ */ + header('Content-Type: application/json'); ?> - +$(document).ready( function() { + $('body').on('submit', '#form1', function(ev){ + if(checkForm()) return; + event.preventDefault(); + }); +}); params['dms']; + $user = $this->params['user']; + $folder = $this->params['folder']; + $document = $this->params['document']; + $sortusersinlist = $this->params['sortusersinlist']; + + $notifyList = $document->getNotifyList(); + + $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); + $this->globalNavigation($folder); + $this->contentStart(); + $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); + $this->contentHeading(getMLText("edit_existing_notify")); $this->contentContainerStart(); @@ -107,7 +115,7 @@ function checkForm() ?>
- + diff --git a/views/bootstrap/class.DropFolderChooser.php b/views/bootstrap/class.DropFolderChooser.php index c344342ad..96e7016b3 100644 --- a/views/bootstrap/class.DropFolderChooser.php +++ b/views/bootstrap/class.DropFolderChooser.php @@ -31,6 +31,15 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_DropFolderChooser extends SeedDMS_Bootstrap_Style { + function js() { /* {{{ */ +?> +$('#fileselect').click(function(ev) { + attr_filename = $(ev.currentTarget).attr('filename'); + fileSelected(attr_filename); +}); +params['dms']; $user = $this->params['user']; @@ -75,12 +84,13 @@ var targetName = document..dropfolderfile; if($previewer->hasRawPreview($dir.'/'.$entry, 'dropfolder/')) { echo ""; } - echo "\n"; + echo "\n"; } } } echo "\n"; echo "
".$entry."".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."
".$entry."".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."
\n"; + echo ''."\n"; } } diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index ab2f4fd69..e2fc89c1c 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -31,31 +31,19 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_EditDocument extends SeedDMS_Bootstrap_Style { - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $folder = $this->params['folder']; - $document = $this->params['document']; - $attrdefs = $this->params['attrdefs']; + function js() { /* {{{ */ $strictformcheck = $this->params['strictformcheck']; - $orderby = $this->params['orderby']; - - $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); - $this->globalNavigation($folder); - $this->contentStart(); - $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); - + $this->printKeywordChooserJs(); ?> - +$(document).ready( function() { + $('body').on('submit', '#form1', function(ev){ + if(checkForm()) return; + event.preventDefault(); + }); +}); params['dms']; + $user = $this->params['user']; + $folder = $this->params['folder']; + $document = $this->params['document']; + $attrdefs = $this->params['attrdefs']; + $strictformcheck = $this->params['strictformcheck']; + $orderby = $this->params['orderby']; + + $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); + $this->globalNavigation($folder); + $this->contentStart(); + $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); + $this->contentHeading(getMLText("edit_document_props")); $this->contentContainerStart(); @@ -85,22 +94,22 @@ function checkForm() else $expdate = ''; ?> - + - + - + diff --git a/views/bootstrap/class.FolderChooser.php b/views/bootstrap/class.FolderChooser.php index 4d346de45..b7ae3d257 100644 --- a/views/bootstrap/class.FolderChooser.php +++ b/views/bootstrap/class.FolderChooser.php @@ -31,6 +31,15 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style { + function js() { /* {{{ */ + $rootfolderid = $this->params['rootfolderid']; + $form = $this->params['form']; + $mode = $this->params['mode']; + + header('Content-Type: application/json'); + $this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form); + } /* }}} */ + function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; @@ -39,11 +48,16 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style { $form = $this->params['form']; $rootfolderid = $this->params['rootfolderid']; - $this->htmlStartPage(getMLText("choose_target_folder")); - $this->contentContainerStart(); - $this->printNewTreeNavigation($rootfolderid, $mode, 0, $form); - $this->contentContainerEnd(); - echo "\n\n"; +// $this->htmlStartPage(getMLText("choose_target_folder")); +// $this->contentContainerStart(); +if(1) { + $this->printNewTreeNavigationHtml($rootfolderid, $mode, 0, $form); + echo ''."\n"; +} else { + $this->printNewTreeNavigation($rootfolderid, $mode, 0, $form); +} +// $this->contentContainerEnd(); +// $this->htmlEndPage(true); } /* }}} */ } ?> diff --git a/views/bootstrap/class.GroupMgr.php b/views/bootstrap/class.GroupMgr.php index ad84e3e79..292376b31 100644 --- a/views/bootstrap/class.GroupMgr.php +++ b/views/bootstrap/class.GroupMgr.php @@ -31,36 +31,24 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_GroupMgr extends SeedDMS_Bootstrap_Style { - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; + function js() { /* {{{ */ $selgroup = $this->params['selgroup']; - $allUsers = $this->params['allusers']; - $allGroups = $this->params['allgroups']; $strictformcheck = $this->params['strictformcheck']; - $this->htmlStartPage(getMLText("admin_tools")); - $this->globalNavigation(); - $this->contentStart(); - $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); - + header("Content-type: text/javascript"); ?> - +$(document).ready( function() { + $('body').on('submit', '#form_1', function(ev){ + if(checkForm1()) + return; + event.preventDefault(); + }); + + $('body').on('submit', '#form_2', function(ev){ + if(checkForm2()) + return; + event.preventDefault(); + }); + + $( "#selector" ).change(function() { + $('div.ajax').trigger('update', {groupid: $(this).val()}); + }); +}); contentHeading(getMLText("group_management")); + } /* }}} */ + + function info() { /* {{{ */ + $dms = $this->params['dms']; + $selgroup = $this->params['selgroup']; + $cachedir = $this->params['cachedir']; + $previewwidth = $this->params['previewWidthList']; + + if($selgroup) { + $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth); + $this->contentHeading(getMLText("group_info")); + echo "
:
:
: printKeywordChooser('form1', $document->getKeywords()); + $this->printKeywordChooserHtml('form1', $document->getKeywords()); ?>
\n"; + $reviewstatus = $selgroup->getReviewStatus(); + $i = 0; + foreach($reviewstatus as $rv) { + if($rv['status'] == 0) { + $i++; + /* + $document = $dms->getDocument($rv['documentID']); + $latestContent = $document->getLatestContent(); + $previewer->createPreview($latestContent); + echo ""; + print ""; + print ""; + echo ""; + */ + } + } + echo ""; + $approvalstatus = $selgroup->getApprovalStatus(); + $i = 0; + foreach($approvalstatus as $rv) { + if($rv['status'] == 0) { + $i++; + } + } + echo ""; + echo "
"; + if($previewer->hasPreview($latestContent)) { + print "getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + } else { + print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + } + print "getID()."¤ttab=revapp\">".htmlspecialchars($document->getName())."
".getMLText('pending_reviews')."".$i."
".getMLText('pending_approvals')."".$i."
"; + } + } /* }}} */ + + function showGroupForm($group) { /* {{{ */ + $dms = $this->params['dms']; + $user = $this->params['user']; + $allUsers = $this->params['allusers']; + $groups = $this->params['allgroups']; ?> - -
-
-
-: - + + + getID()==$selgroup->getID()) $selected=$count; - print "
-
- -
-
- - - - -getID()."\" style=\"display : none;\">"; +
+ - - - - -
+ - + - + @@ -189,6 +193,7 @@ function showUser(selectObj) {
:
:
contentSubHeading(getMLText("group_members")); ?> @@ -218,14 +223,14 @@ function showUser(selectObj) { $this->contentSubHeading(getMLText("add_member")); ?> - +
-
- - + - + function form() { /* {{{ */ + $selgroup = $this->params['selgroup']; + + $this->showGroupForm($selgroup); + } /* }}} */ + + function show() { /* {{{ */ + $dms = $this->params['dms']; + $user = $this->params['user']; + $selgroup = $this->params['selgroup']; + $allUsers = $this->params['allusers']; + $allGroups = $this->params['allgroups']; + $strictformcheck = $this->params['strictformcheck']; + + $this->htmlStartPage(getMLText("admin_tools")); + $this->globalNavigation(); + $this->contentStart(); + $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); + + $this->contentHeading(getMLText("group_management")); +?> + +
+
+
+: + +
+
getID()."\"" : "") ?>>
+
+ +
+
+
getID()."\"" : "") ?>>
- - contentContainerEnd(); $this->htmlEndPage(); diff --git a/views/bootstrap/class.KeywordChooser.php b/views/bootstrap/class.KeywordChooser.php index b6c5d94ad..c7d586d37 100644 --- a/views/bootstrap/class.KeywordChooser.php +++ b/views/bootstrap/class.KeywordChooser.php @@ -31,15 +31,10 @@ require_once("class.Bootstrap.php"); */ class SeedDMS_View_KeywordChooser extends SeedDMS_Bootstrap_Style { - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $categories = $this->params['categories']; + function js() { /* {{{ */ $form = $this->params['form']; - -// $this->htmlStartPage(getMLText("use_default_keywords")); + header('Content-Type: application/json'); ?> - + +$('#categories0').change(function(ev) { + showKeywords(0); +}); + +$('#categories1').change(function(ev) { + showKeywords(1); +}); + +$('.insertkeyword').click(function(ev) { + attr_keyword = $(ev.currentTarget).attr('keyword'); + insertKeywords(attr_keyword); +}); + +myTA = document.getElementById("keywordta"); +myTA.value = targetObj.value; +myTA.focus(); +params['dms']; + $user = $this->params['user']; + $categories = $this->params['categories']; + $form = $this->params['form']; + +// $this->htmlStartPage(getMLText("use_default_keywords")); +?>
: -