2010-10-30 18:38:07 +00:00
|
|
|
|
<?php
|
2018-03-07 11:35:06 +00:00
|
|
|
|
if(isset($_SERVER['SEEDDMS_HOME'])) {
|
|
|
|
|
ini_set('include_path', $_SERVER['SEEDDMS_HOME'].'/utils'. PATH_SEPARATOR .ini_get('include_path'));
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$myincpath = $_SERVER['SEEDDMS_HOME'];
|
2018-03-07 11:35:06 +00:00
|
|
|
|
} else {
|
|
|
|
|
ini_set('include_path', dirname($argv[0]). PATH_SEPARATOR .ini_get('include_path'));
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$myincpath = dirname($argv[0]);
|
2018-03-07 11:35:06 +00:00
|
|
|
|
}
|
2010-10-30 18:38:07 +00:00
|
|
|
|
|
|
|
|
|
function usage() { /* {{{ */
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Usage:".PHP_EOL;
|
|
|
|
|
echo " seeddms-adddoc [--config <file>] [-c <comment>] [-k <keywords>] [-s <number>] [-n <name>] [-V <version>] [-s <sequence>] [-t <mimetype>] [-a <attribute=value>] [-h] [-v] -F <folder id> -D <document id> -f <filename>".PHP_EOL;
|
|
|
|
|
echo PHP_EOL;
|
|
|
|
|
echo "Description:".PHP_EOL;
|
|
|
|
|
echo " This program uploads a file into a folder or updates a document of SeedDMS.".PHP_EOL;
|
|
|
|
|
echo PHP_EOL;
|
|
|
|
|
echo "Options:".PHP_EOL;
|
|
|
|
|
echo " -h, --help: print usage information and exit.".PHP_EOL;
|
|
|
|
|
echo " -v, --version: print version and exit.".PHP_EOL;
|
|
|
|
|
echo " --config: set alternative config file.".PHP_EOL;
|
|
|
|
|
echo " -F <folder id>: id of folder the file is uploaded to".PHP_EOL;
|
|
|
|
|
echo " -D <document id>: id of document the file is uploaded to.".PHP_EOL;
|
|
|
|
|
echo " This will only be used if no folder id is given.".PHP_EOL;
|
|
|
|
|
echo " -c <comment>: set comment for document. See [1].".PHP_EOL;
|
|
|
|
|
echo " -C <comment>: set comment for version".PHP_EOL;
|
|
|
|
|
echo " -k <keywords>: set keywords for file. See [1].".PHP_EOL;
|
|
|
|
|
echo " -K <categories>: set categories for file. See [1].".PHP_EOL;
|
|
|
|
|
echo " -s <number>: set sequence for file (used for ordering files within a folder. See [1].".PHP_EOL;
|
|
|
|
|
echo " -n <name>: set name of file".PHP_EOL;
|
|
|
|
|
echo " -V <version>: set version of file (defaults to 1). See [2].".PHP_EOL;
|
|
|
|
|
echo " -u <user>: login name of user".PHP_EOL;
|
|
|
|
|
echo " -f <filename>: upload this file".PHP_EOL;
|
|
|
|
|
echo " -s <sequence>: set sequence of file. See [1]".PHP_EOL;
|
|
|
|
|
echo " -t <mimetype> set mimetype of file manually. Do not do that unless you know".PHP_EOL;
|
|
|
|
|
echo " what you do. If not set, the mimetype will be determined automatically.".PHP_EOL;
|
|
|
|
|
echo " -a <attribute=value>: Set a document attribute; can occur multiple times. See [1].".PHP_EOL;
|
|
|
|
|
echo " -A <attribute=value>: Set a version attribute; can occur multiple times.".PHP_EOL;
|
|
|
|
|
echo PHP_EOL;
|
|
|
|
|
echo "[1] This option applies only if a new document is uploaded. It has no effect".PHP_EOL." if a new document version is uploaded.".PHP_EOL;
|
|
|
|
|
echo "[2] If a new document version is uploaded it defaults to the next version number.".PHP_EOL;
|
2010-10-30 18:38:07 +00:00
|
|
|
|
} /* }}} */
|
|
|
|
|
|
2011-07-21 06:56:35 +00:00
|
|
|
|
$version = "0.0.1";
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$shortoptions = "D:F:c:C:k:K:s:V:u:f:n:t:a:A:hv";
|
2011-07-21 06:56:35 +00:00
|
|
|
|
$longoptions = array('help', 'version', 'config:');
|
|
|
|
|
if(false === ($options = getopt($shortoptions, $longoptions))) {
|
2010-10-30 18:38:07 +00:00
|
|
|
|
usage();
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(0);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print help and exit */
|
2011-07-21 06:56:35 +00:00
|
|
|
|
if(isset($options['h']) || isset($options['help'])) {
|
2010-10-30 18:38:07 +00:00
|
|
|
|
usage();
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(0);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print version and exit */
|
2011-07-21 06:56:35 +00:00
|
|
|
|
if(isset($options['v']) || isset($options['verѕion'])) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo $version.PHP_EOL;
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(0);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-07-21 06:56:35 +00:00
|
|
|
|
/* Set alternative config file */
|
|
|
|
|
if(isset($options['config'])) {
|
2018-03-07 11:35:06 +00:00
|
|
|
|
define('SEEDDMS_CONFIG_FILE', $options['config']);
|
2020-09-03 18:11:15 +00:00
|
|
|
|
} elseif(isset($_SERVER['SEEDDMS_CONFIG_FILE'])) {
|
|
|
|
|
define('SEEDDMS_CONFIG_FILE', $_SERVER['SEEDDMS_CONFIG_FILE']);
|
2011-07-21 06:56:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-25 12:45:55 +00:00
|
|
|
|
/* Set parent folder or document */
|
|
|
|
|
$folderid = $documentid = 0;
|
2010-10-30 18:38:07 +00:00
|
|
|
|
if(isset($options['F'])) {
|
|
|
|
|
$folderid = (int) $options['F'];
|
|
|
|
|
} else {
|
2020-05-25 12:45:55 +00:00
|
|
|
|
if(isset($options['D'])) {
|
|
|
|
|
$documentid = (int) $options['D'];
|
|
|
|
|
} else {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Missing folder/document ID".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
usage();
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-07 14:10:19 +00:00
|
|
|
|
/* Set comment of document */
|
2010-12-01 13:38:45 +00:00
|
|
|
|
$comment = '';
|
2010-10-30 18:38:07 +00:00
|
|
|
|
if(isset($options['c'])) {
|
|
|
|
|
$comment = $options['c'];
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-07 14:10:19 +00:00
|
|
|
|
/* Set comment of version */
|
2011-07-20 16:47:58 +00:00
|
|
|
|
$version_comment = '';
|
|
|
|
|
if(isset($options['C'])) {
|
|
|
|
|
$version_comment = $options['C'];
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-07 14:10:19 +00:00
|
|
|
|
/* Set keywords */
|
2010-12-01 13:38:45 +00:00
|
|
|
|
$keywords = '';
|
2010-10-30 18:38:07 +00:00
|
|
|
|
if(isset($options['k'])) {
|
|
|
|
|
$keywords = $options['k'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$sequence = 0;
|
|
|
|
|
if(isset($options['s'])) {
|
|
|
|
|
$sequence = $options['s'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$name = '';
|
|
|
|
|
if(isset($options['n'])) {
|
|
|
|
|
$name = $options['n'];
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-15 05:16:46 +00:00
|
|
|
|
$username = '';
|
|
|
|
|
if(isset($options['u'])) {
|
|
|
|
|
$username = $options['u'];
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-30 18:38:07 +00:00
|
|
|
|
$filename = '';
|
|
|
|
|
if(isset($options['f'])) {
|
|
|
|
|
$filename = $options['f'];
|
|
|
|
|
} else {
|
|
|
|
|
usage();
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(1);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-31 06:14:52 +00:00
|
|
|
|
$mymimetype = '';
|
2010-10-30 18:38:07 +00:00
|
|
|
|
if(isset($options['t'])) {
|
2022-01-31 06:14:52 +00:00
|
|
|
|
$mymimetype = $options['t'];
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$reqversion = 0;
|
|
|
|
|
if(isset($options['V'])) {
|
|
|
|
|
$reqversion = $options['V'];
|
|
|
|
|
}
|
|
|
|
|
if($reqversion<1)
|
|
|
|
|
$reqversion=1;
|
|
|
|
|
|
2020-05-25 12:45:55 +00:00
|
|
|
|
include($myincpath."/inc/inc.Settings.php");
|
2023-04-18 10:48:20 +00:00
|
|
|
|
include($myincpath."/inc/inc.LogInit.php");
|
2020-05-25 12:45:55 +00:00
|
|
|
|
include($myincpath."/inc/inc.Init.php");
|
|
|
|
|
include($myincpath."/inc/inc.Extension.php");
|
|
|
|
|
include($myincpath."/inc/inc.DBInit.php");
|
|
|
|
|
include($myincpath."/inc/inc.ClassController.php");
|
2018-03-07 11:35:06 +00:00
|
|
|
|
|
2023-04-18 10:48:20 +00:00
|
|
|
|
/* Parse categories {{{ */
|
|
|
|
|
$categories = array();
|
|
|
|
|
if(isset($options['K'])) {
|
|
|
|
|
$categorynames = explode(',', $options['K']);
|
|
|
|
|
foreach($categorynames as $categoryname) {
|
|
|
|
|
$cat = $dms->getDocumentCategoryByName($categoryname);
|
|
|
|
|
if($cat) {
|
|
|
|
|
$categories[] = $cat;
|
|
|
|
|
} else {
|
|
|
|
|
echo "Category '".$categoryname."' not found".PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
|
|
/* Parse document attributes. {{{ */
|
|
|
|
|
$document_attributes = array();
|
|
|
|
|
if (isset($options['a'])) {
|
|
|
|
|
$docattr = array();
|
|
|
|
|
if (is_array($options['a'])) {
|
|
|
|
|
$docattr = $options['a'];
|
2018-02-20 05:17:44 +00:00
|
|
|
|
} else {
|
2023-04-18 10:48:20 +00:00
|
|
|
|
$docattr = array($options['a']);
|
2018-02-20 05:17:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-18 10:48:20 +00:00
|
|
|
|
foreach ($docattr as $thisAttribute) {
|
|
|
|
|
$attrKey = strstr($thisAttribute, '=', true);
|
|
|
|
|
$attrVal = substr(strstr($thisAttribute, '='), 1);
|
|
|
|
|
if (empty($attrKey) || empty($attrVal)) {
|
|
|
|
|
echo "Document attribute $thisAttribute not understood".PHP_EOL;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
$attrdef = $dms->getAttributeDefinitionByName($attrKey);
|
|
|
|
|
if (!$attrdef) {
|
|
|
|
|
echo "Document attribute $attrKey unknown".PHP_EOL;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
$document_attributes[$attrdef->getID()] = $attrVal;
|
2016-01-31 10:22:40 +00:00
|
|
|
|
}
|
2023-04-18 10:48:20 +00:00
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
|
|
/* Parse version attributes. {{{ */
|
|
|
|
|
$version_attributes = array();
|
|
|
|
|
if (isset($options['A'])) {
|
|
|
|
|
$verattr = array();
|
|
|
|
|
if (is_array($options['A'])) {
|
|
|
|
|
$verattr = $options['A'];
|
|
|
|
|
} else {
|
|
|
|
|
$verattr = array($options['A']);
|
2016-01-31 10:22:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-18 10:48:20 +00:00
|
|
|
|
foreach ($verattr as $thisAttribute) {
|
|
|
|
|
$attrKey = strstr($thisAttribute, '=', true);
|
|
|
|
|
$attrVal = substr(strstr($thisAttribute, '='), 1);
|
|
|
|
|
if (empty($attrKey) || empty($attrVal)) {
|
|
|
|
|
echo "Version attribute $thisAttribute not understood".PHP_EOL;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
$attrdef = $dms->getAttributeDefinitionByName($attrKey);
|
|
|
|
|
if (!$attrdef) {
|
|
|
|
|
echo "Version attribute $attrKey unknown".PHP_EOL;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
$version_attributes[$attrdef->getID()] = $attrVal;
|
2016-01-31 10:22:40 +00:00
|
|
|
|
}
|
2023-04-18 10:48:20 +00:00
|
|
|
|
} /* }}} */
|
2010-12-01 13:38:45 +00:00
|
|
|
|
|
2023-04-18 10:48:20 +00:00
|
|
|
|
/* Create a global user object {{{ */
|
|
|
|
|
if($username) {
|
|
|
|
|
if(!($user = $dms->getUserByLogin($username))) {
|
|
|
|
|
echo "No such user '".$username."'.";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
$user = $dms->getUser(1);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
|
2018-03-07 11:35:06 +00:00
|
|
|
|
$dms->setUser($user);
|
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
|
|
/* Create a global notifier object {{{ */
|
|
|
|
|
$notifier = new SeedDMS_NotificationService();
|
|
|
|
|
|
|
|
|
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
|
|
|
|
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
|
|
|
|
if(method_exists($notificationObj, 'preAddService')) {
|
|
|
|
|
$notificationObj->preAddService($dms, $notifier);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($settings->_enableEmail) {
|
|
|
|
|
$notifier->addService(new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
|
|
|
|
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
|
|
|
|
if(method_exists($notificationObj, 'postAddService')) {
|
|
|
|
|
$notificationObj->postAddService($dms, $notifier);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
|
|
/* Check if file is readable {{{ */
|
2010-10-30 18:38:07 +00:00
|
|
|
|
if(is_readable($filename)) {
|
|
|
|
|
if(filesize($filename)) {
|
2015-05-02 06:34:28 +00:00
|
|
|
|
$finfo = new finfo(FILEINFO_MIME_TYPE);
|
2022-01-31 06:14:52 +00:00
|
|
|
|
if(!$mymimetype) {
|
|
|
|
|
$mymimetype = $finfo->file($filename);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
2014-06-16 12:30:13 +00:00
|
|
|
|
$filetype = "." . pathinfo($filename, PATHINFO_EXTENSION);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
} else {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "File '".$filename."' has zero size".PHP_EOL;
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(1);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "File '".$filename."' is not readable".PHP_EOL;
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(1);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
2018-03-07 11:35:06 +00:00
|
|
|
|
/* }}} */
|
2010-10-30 18:38:07 +00:00
|
|
|
|
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$folder = null;
|
|
|
|
|
$document = null;
|
|
|
|
|
if($folderid) {
|
|
|
|
|
$folder = $dms->getFolder($folderid);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
|
2020-05-25 12:45:55 +00:00
|
|
|
|
if (!is_object($folder)) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Could not find specified folder".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
2010-10-30 18:38:07 +00:00
|
|
|
|
|
2020-05-25 12:45:55 +00:00
|
|
|
|
if ($folder->getAccessMode($user) < M_READWRITE) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Not sufficient access rights".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
} elseif($documentid) {
|
|
|
|
|
$document = $dms->getDocument($documentid);
|
|
|
|
|
|
|
|
|
|
if (!is_object($document)) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Could not find specified document".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($document->getAccessMode($user) < M_READWRITE) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Not sufficient access rights".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($sequence)) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Sequence must be numeric".PHP_EOL;
|
2011-07-05 12:04:56 +00:00
|
|
|
|
exit(1);
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$expires = false;
|
|
|
|
|
|
|
|
|
|
if(!$name)
|
|
|
|
|
$name = basename($filename);
|
|
|
|
|
$filetmp = $filename;
|
|
|
|
|
|
|
|
|
|
$reviewers = array();
|
|
|
|
|
$approvers = array();
|
2024-05-24 06:25:13 +00:00
|
|
|
|
$recipients = array();
|
2010-10-30 18:38:07 +00:00
|
|
|
|
|
2020-05-25 12:45:55 +00:00
|
|
|
|
if($folder) {
|
|
|
|
|
$controller = Controller::factory('AddDocument', array('dms'=>$dms, 'user'=>$user));
|
|
|
|
|
$controller->setParam('documentsource', 'script');
|
|
|
|
|
$controller->setParam('folder', $folder);
|
2022-01-31 06:14:52 +00:00
|
|
|
|
$controller->setParam('fulltextservice', $fulltextservice);
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$controller->setParam('name', $name);
|
|
|
|
|
$controller->setParam('comment', $comment);
|
|
|
|
|
$controller->setParam('expires', $expires);
|
|
|
|
|
$controller->setParam('keywords', $keywords);
|
|
|
|
|
$controller->setParam('categories', $categories);
|
|
|
|
|
$controller->setParam('owner', $user);
|
|
|
|
|
$controller->setParam('userfiletmp', $filetmp);
|
|
|
|
|
$controller->setParam('userfilename', basename($filename));
|
|
|
|
|
$controller->setParam('filetype', $filetype);
|
2022-01-31 06:14:52 +00:00
|
|
|
|
$controller->setParam('userfiletype', $mymimetype);
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$minmax = $folder->getDocumentsMinMax();
|
|
|
|
|
if($settings->_defaultDocPosition == 'start')
|
|
|
|
|
$controller->setParam('sequence', $minmax['min'] - 1);
|
|
|
|
|
else
|
|
|
|
|
$controller->setParam('sequence', $minmax['max'] + 1);
|
|
|
|
|
$controller->setParam('reviewers', $reviewers);
|
|
|
|
|
$controller->setParam('approvers', $approvers);
|
2024-05-24 06:25:13 +00:00
|
|
|
|
$controller->setParam('recipients', $recipients);
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$controller->setParam('reqversion', $reqversion);
|
|
|
|
|
$controller->setParam('versioncomment', $version_comment);
|
|
|
|
|
$controller->setParam('attributes', $document_attributes);
|
|
|
|
|
$controller->setParam('attributesversion', $version_attributes);
|
|
|
|
|
$controller->setParam('workflow', null);
|
|
|
|
|
$controller->setParam('notificationgroups', array());
|
|
|
|
|
$controller->setParam('notificationusers', array());
|
2024-05-24 06:25:13 +00:00
|
|
|
|
$controller->setParam('initialdocumentstatus', $settings->_initialDocumentStatus);
|
2020-05-25 12:45:55 +00:00
|
|
|
|
$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText);
|
|
|
|
|
$controller->setParam('defaultaccessdocs', $settings->_defaultAccessDocs);
|
|
|
|
|
|
|
|
|
|
if(!$document = $controller->run()) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Could not add document to folder".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
} elseif($document) {
|
|
|
|
|
$controller = Controller::factory('UpdateDocument', array('dms'=>$dms, 'user'=>$user));
|
|
|
|
|
$controller->setParam('folder', $document->getFolder());
|
|
|
|
|
$controller->setParam('document', $document);
|
|
|
|
|
$controller->setParam('index', $index);
|
|
|
|
|
$controller->setParam('indexconf', $indexconf);
|
|
|
|
|
$controller->setParam('comment', $comment);
|
|
|
|
|
$controller->setParam('userfiletmp', $filetmp);
|
|
|
|
|
$controller->setParam('userfilename', $filename);
|
|
|
|
|
$controller->setParam('filetype', $filetype);
|
|
|
|
|
$controller->setParam('userfiletype', $mimetype);
|
|
|
|
|
$controller->setParam('reviewers', $reviewers);
|
|
|
|
|
$controller->setParam('approvers', $approvers);
|
|
|
|
|
$controller->setParam('attributes', $version_attributes);
|
|
|
|
|
$controller->setParam('workflow', null);
|
|
|
|
|
|
|
|
|
|
if(!$content = $controller->run()) {
|
2020-09-04 07:21:40 +00:00
|
|
|
|
echo "Could not add version to document".PHP_EOL;
|
2020-05-25 12:45:55 +00:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
2010-10-30 18:38:07 +00:00
|
|
|
|
}
|