diff --git a/.gitignore b/.gitignore index 6e364c0de..ab8e987dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.tar.gz SeedDMS_*/*.tgz ext/* +vendor webapp/* +www/ext diff --git a/Makefile b/Makefile index 77c70a98d..42890015e 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,11 @@ NODISTFILES=utils/importmail.php utils/seedddms-importmail utils/remote-email-up PHPDOC=~/Downloads/phpDocumentor.phar -dist: +INSTALL_PATH=/home/www-data/seeddms-test + +all: dist + +olddist: mkdir -p tmp/seeddms-$(VERSION) cp -a $(SRC) tmp/seeddms-$(VERSION) mkdir -p tmp/seeddms-$(VERSION)/views @@ -23,9 +27,18 @@ dist: (cd tmp; tar --exclude=.svn --exclude=.gitignore -czvf ../seeddms-$(VERSION).tar.gz seeddms-$(VERSION)) rm -rf tmp +dist: + php vendor/bin/phing -Dversion=$(VERSION) dist + quickstart: php8.2 vendor/bin/phing -Dversion=$(VERSION) package +quickstart-dev: + php vendor/bin/phing -Dversion=$(VERSION) -Dmode=development package + +install: + php vendor/bin/phing -Dversion=$(VERSION) -Dinstallpath=$(INSTALL_PATH) -Ddomain=dms.seeddms.org install + unittest: vendor/bin/phing -Dversion=$(VERSION) phpunitfast @@ -95,4 +108,4 @@ PKGFILE=SeedDMS_Core/package.xml changelog: @sgrep 'stag("DATE") .. etag("DATE") or ((stag("RELEASE") .. etag("RELEASE")) in (stag("VERSION") .. etag("VERSION"))) or inner(stag("NOTES") __ etag("NOTES"))' ${PKGFILE} | sed -e 's#^ *\([-0-9]*\)\([0-9.preRC]*\)#\n\n\2 (\1)\n---------------------#' | awk -F'\n' -vRS='' -vOFS='|' '{$$1=$$1}1' | sort -V -r | sed 's/$$/\n/' | tr '|' '\n' -.PHONY: doc webdav webapp repository changelog +.PHONY: doc webdav webapp repository changelog install diff --git a/README.md b/README.md new file mode 100644 index 000000000..0c32c7ddc --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +SeedDMS is a PHP based Document Management System. For more information +check the web site at https://www.seeddms.org + +There are detailed installation instructions from a preconfigured distribution +at [doc/README.Install.md] + +If you prefer to install from git, you will need to: + +1. Create a directory, e.g. seeddms + + `mkdir seeddms` +2. Change into that directory + + `cd seeddms` +3. Clone the various SeedDMS repositories + + ``` + git clone https://codeberg.org/SeedDMS/preview.git + git clone https://codeberg.org/SeedDMS/lucene.git + git clone https://codeberg.org/SeedDMS/ѕqlitefts.git + git clone https://codeberg.org/SeedDMS/http_webdav_server.git + ``` +4. For SeedDMS 5.1.x + + ``` + git clone -b seeddms-5.1.x https://codeberg.org/SeedDMS/seeddms.git + git clone -b seeddms-5.1.x https://codeberg.org/SeedDMS/core.git + ``` + + For SeedDMS 6.0.x + + ``` + git clone -b seeddms-6.0.x https://codeberg.org/SeedDMS/seeddms.git + git clone -b seeddms-6.0.x https://codeberg.org/SeedDMS/core.git + ``` +5. Run composer + + `composer update` + +6. Create an installable distribution + + `vendor/bin/phing -Dversion=$(php -r 'include "inc/inc.Version.php"; echo (new SeedDMS_Version())->version();') package` + + or create an installable distribution with softlinks + + `vendor/bin/phing -Dversion=$(php -r 'include "inc/inc.Version.php"; echo (new SeedDMS_Version())->version();') -Dmode=development package` + + This archive does not contain any sources but only links to the previously + cloned repositories. + +The archive created in step 6. can be installed like the official releases of +SeedDMS. diff --git a/build.xml b/build.xml index 3c48c9c24..f2c94aa45 100644 --- a/build.xml +++ b/build.xml @@ -1,6 +1,6 @@ - + @@ -16,9 +16,13 @@ - - - + + + + + + + @@ -35,44 +39,43 @@ - - + - + - - Hello - + + Hello + - - - - - - - - - - + + + + + + + + + + - - + + - + - - - - - - + + + + + + @@ -80,10 +83,13 @@ - - - - + + + + + + + @@ -92,7 +98,7 @@ - + @@ -107,6 +113,9 @@ + + + @@ -114,103 +123,202 @@ - - - + + + + - - - + + + + + + + + + - - + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/composer-dist.json b/composer-dist.json index 21ab9b52f..e4628d19f 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -6,6 +6,8 @@ }, "require": { "robthree/twofactorauth": "^3.0", + "pear/http_request2": "2.5.0", + "robthree/twofactorauth": "^1.5", "slim/slim": "^4.0", "guzzlehttp/psr7": "*", "erusev/parsedown": "*", @@ -28,7 +30,7 @@ "php-di/php-di": "^6.4", "slim/psr7": "^1.7", "bacon/bacon-qr-code": "^3.0", - "seeddms/core": "dev-master", + "seeddms/core": "dev-__CORE_BRANCH__", "seeddms/lucene": "dev-master", "seeddms/preview": "dev-master", "seeddms/sqlitefts": "dev-master", diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..5c756707b --- /dev/null +++ b/composer.json @@ -0,0 +1,116 @@ +{ + "name": "seeddms/dms", + "description": "Open Source Document Management System", + "type": "project", + "license": "GPL 2", + "authors": [ + { + "name": "Uwe Steinmann", + "email": "steinm@debian.org" + } + ], + "minimum-stability": "stable", + "config": { + "platform": { + "php": "8.2" + }, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "wikimedia/composer-merge-plugin": true + } + }, + "require": { + "php": ">=8.2.0", + "phing/phing": "3.*", + "pear/http_request2": "2.5.0", + "robthree/twofactorauth": "^3.0", + "php-mime-mail-parser/php-mime-mail-parser": "*", + "slim/slim": "^4.0", + "guzzlehttp/psr7": "*", + "erusev/parsedown": "*", + "erusev/parsedown-extra": "*", + "mibe/feedwriter": "^1.1", + "phpoffice/phpspreadsheet": "*", + "sabre/xml": "*", + "sabre/dav": "^4.", + "pear/log": "*", + "pear/mail": "*", + "pear/mail_mime": "*", + "pear/net_smtp": "*", + "pear/auth_sasl": "*", + "pear/db": "*", + "dragonmantank/cron-expression": "^3.1", + "alecrabbit/php-console-colour": "*", + "zf1/zend-search-lucene": "*", + "symfony/http-foundation": "^5.4", + "php-di/php-di": "^6.4", + "slim/psr7": "^1.7", + "bacon/bacon-qr-code": "^3.0", + "seeddms/core": "dev-seeddms-5.1.x", + "seeddms/lucene": "dev-master", + "seeddms/preview": "dev-master", + "seeddms/sqlitefts": "dev-master", + "seeddms/http_webdav_server": "dev-master" + }, + "require-dev": { + "composer/composer": "dev-main", + "behat/mink": "1.8.1", + "behat/mink-selenium2-driver": "1.4.0", + "dmore/chrome-mink-driver": "2.8.0", + "friendsofphp/php-cs-fixer": "3.87.2", + "phpunit/phpunit": "9.5.9", + "squizlabs/php_codesniffer": "3.6.0", + "phpstan/phpstan": "^2.1" + }, + "repositories": [ + { + "type": "path", + "url": "../core", + "options": { + "symlink": false + } + }, + { + "type": "path", + "url": "../lucene", + "options": { + "symlink": false + } + }, + { + "type": "path", + "url": "../preview", + "options": { + "symlink": false + } + }, + { + "type": "path", + "url": "../sqlitefts", + "options": { + "symlink": false + } + }, + { + "type": "path", + "url": "../http_webdav_server", + "options": { + "symlink": false + } + } + ], + "extra": { + "merge-plugin": { + "include": [ + "composer.local.json" + ], + "recurse": true, + "replace": true, + "ignore-duplicates": false, + "merge-dev": true, + "merge-extra": false, + "merge-extra-deep": false, + "merge-scripts": true + } + } +} diff --git a/conf/apache.virtualhost.template b/conf/apache.virtualhost.template new file mode 100644 index 000000000..4c3b39c22 --- /dev/null +++ b/conf/apache.virtualhost.template @@ -0,0 +1,27 @@ + + ServerName _DOMAIN_ + ErrorLog /var/log/apache2/seeddms-error.log + CustomLog /var/log/apache2/seeddms-access.log combined + + DocumentRoot _INSTALL_PATH_/www + + SSLEngine on + SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem + SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key +# SSLCertificateChainFile /just/if/needed/fullchain.cer + + + Options Indexes FollowSymLinks MultiViews + AllowOverride All + Require all granted + + + + # Apache 2.4.10+ can proxy to unix socket + SetHandler "proxy:unix:/var/run/php/php8.2-fpm.sock|fcgi://localhost" + + + # Consider to install the webdav_checkout extension + Alias /checkout _INSTALL_PATH_/www/ext/webdav_checkout/op/remote.php + + diff --git a/doc/README.Install.md b/doc/README.Install.md index dcd0cb09e..284f29571 100644 --- a/doc/README.Install.md +++ b/doc/README.Install.md @@ -254,6 +254,29 @@ in your current installation with new versions from the quickstart archive. contain database updates. +Installing from git +==================== + +SeedDMS is hosted at https://codeberg.org/SeedDMS + +In order to install SeedDMS you need to: + +1. Create a directory, e.g. seeddms + `mkdir seeddms` +2. Change into that directory + `cd seeddms` +3. Clone the various SeedDMS repositories + `git clone https://codeberg.org/SeedDMS/seeddms.git` + `git clone -b seeddms-5.1.x https://codeberg.org/SeedDMS/core.git` + `git clone https://codeberg.org/SeedDMS/preview.git` + `git clone https://codeberg.org/SeedDMS/lucene.git` + `git clone https://codeberg.org/SeedDMS/ѕqlitefts.git` + `git clone https://codeberg.org/SeedDMS/http_webdav_server.git` +4. Run composer + `composer update` +5. Create an installable distribution + `vendor/bin/phing -Dversion=$(php -r 'include "inc/inc.Version.php"; echo (new SeedDMS_Version())->version();') package` + THE LONG STORY ================ diff --git a/inc/inc.ClassDownloadMgr.php b/inc/inc.ClassDownloadMgr.php index 4e4f6dad0..f49173d4c 100644 --- a/inc/inc.ClassDownloadMgr.php +++ b/inc/inc.ClassDownloadMgr.php @@ -93,6 +93,18 @@ class SeedDMS_Download_Mgr { */ protected $filenames; + /** + * @var bool $includereviewers whether to include reviewers + * @access protected + */ + protected $includereviewers; + + /** + * @var bool $includeapprovers whether to include approvers + * @access protected + */ + protected $includeapprovers; + /** * @var boolean $skipdefaultcols skip default columns, will only export extracols * @access protected diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 00495fd20..082cf5029 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -1875,13 +1875,13 @@ class Settings { /* {{{ */ * Check if extension is disabled * * @param string $extname name of extension - * @return true if extension is disabled + * @return true if extension is disabled or extension could not be found in configuration */ public function extensionIsDisabled($extname) { /* {{{ */ if(array_key_exists($extname, $this->_extensions)) return $this->_extensions[$extname]['__disable__']; - return false; + return true; } /* }}} */ /** diff --git a/inc/inc.Extension.php b/inc/inc.Extension.php index b88500706..fcc1d174d 100644 --- a/inc/inc.Extension.php +++ b/inc/inc.Extension.php @@ -22,11 +22,17 @@ $extMgr = new SeedDMS_Extension_Mgr($settings->_rootDir."/ext", $settings->_cach $version = new SeedDMS_Version; foreach($extMgr->getExtensionConfiguration() as $extname=>$extconf) { + if($extconf['disable']) { + $settings->disableExtension($extname); + continue; + } if(!$settings->extensionIsDisabled($extname)) { - $disabled = true; + $disabled = false; if($extMgr->checkExtensionByName($extname, $extconf)) { $disabled = false; + $settings->enableExtension($extname); } else { + $disabled = true; $settings->disableExtension($extname); // echo $extMgr->getErrorMsg(); } @@ -66,5 +72,9 @@ foreach($extMgr->getExtensionConfiguration() as $extname=>$extconf) { } } } + } else { + // Ensure $settings->_extensions has an entry for the extension, even if + // the extension is disabled already. + $settings->disableExtension($extname); } } diff --git a/inc/inc.Settings.php b/inc/inc.Settings.php index 90b26ac24..07a49b021 100644 --- a/inc/inc.Settings.php +++ b/inc/inc.Settings.php @@ -60,7 +60,7 @@ if($settings->_dbDriver == 'sqlite' && empty($settings->_dbDatabase)) { $settings->_dbDatabase = $__datadir."/content.db"; } -ini_set('include_path', $settings->_rootDir.'pear'. PATH_SEPARATOR .ini_get('include_path')); +ini_set('include_path', $settings->_rootDir.'..'. PATH_SEPARATOR .ini_get('include_path')); if(!empty($settings->_extraPath)) { ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path')); } @@ -75,12 +75,8 @@ if(isset($settings->_maxExecutionTime)) { * relative to it. */ ini_set('include_path', $settings->_rootDir. PATH_SEPARATOR .ini_get('include_path')); -/* Add root Dir.'../pear'. Needed because the SeedDMS_Core, etc. are included - * relative to it. - */ -ini_set('include_path', $settings->_rootDir.'../pear'. PATH_SEPARATOR .ini_get('include_path')); -/* composer is installed in pear directory, but install tool does not need it */ +/* composer is installed in vendor directory, but install tool does not need it */ if(!defined("SEEDDMS_INSTALL")) require_once 'vendor/autoload.php'; diff --git a/out/out.Search.php b/out/out.Search.php index 301c5fefa..0ece477b2 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -247,7 +247,9 @@ $status = isset($get['status']) ? $get['status'] : array(); // // Default page to display is always one. $pageNumber=1; -if (isset($get["pg"])) { +if (isset($get['action']) && $get['action'] == 'export') { + $pageNumber = 'all'; +} elseif (isset($get["pg"])) { if (is_numeric($get["pg"]) && $get["pg"]>0) { $pageNumber = (int) $get["pg"]; } @@ -368,7 +370,7 @@ if($fullsearch) { 'filesize_start'=>$filesize['from'], 'filesize_end'=>$filesize['to'], 'attributes'=>$attributes - ), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1))), $order); + ), ($pageNumber == 'all' ? array('limit'=>1000) : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1))), $order); if($searchresult === false) { $session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm'))); $dcount = 0; diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 3cd399199..ee7d59666 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -268,6 +268,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style { echo "SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');"; } ?> + $(document).ready( function() { $("#form1").validate({ ignore: [], @@ -640,7 +641,7 @@ $(document).ready( function() { $this->contentHeading(getMLText("preview")); ?>
- +
extensionIsDisabled('pdfviewer')) { $pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout, $xsendfile); if($conversionmgr) $pdfpreviewer->setConversionMgr($conversionmgr); @@ -677,7 +678,7 @@ $(document).ready( function() { $this->contentHeading(getMLText("preview_pdf")); ?>
- +