mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
Merge branch 'seeddms-5.0.x' into seeddms-5.1.x
This commit is contained in:
commit
556626501c
|
@ -401,6 +401,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo $indent." <!-- ".$dms->contentDir . $version->getPath()." not found -->\n";
|
echo $indent." <!-- ".$dms->contentDir . $version->getPath()." not found -->\n";
|
||||||
|
echo $indent." <data length=\"0\"></data>\n";
|
||||||
}
|
}
|
||||||
echo $indent." </version>\n";
|
echo $indent." </version>\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -497,35 +497,13 @@ function insert_document($document) { /* {{{ */
|
||||||
|
|
||||||
if(in_array('documents', $sections)) {
|
if(in_array('documents', $sections)) {
|
||||||
$initversion = array_shift($document['versions']);
|
$initversion = array_shift($document['versions']);
|
||||||
|
if(!$initversion) {
|
||||||
|
$logger->err("Document '".$document['attributes']['name']."' missing initial version");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/* Rewriting the review/approval log will set reviewers/approvers */
|
||||||
$reviews = array('i'=>array(), 'g'=>array());
|
$reviews = array('i'=>array(), 'g'=>array());
|
||||||
/*
|
|
||||||
if($initversion['reviews']) {
|
|
||||||
foreach($initversion['reviews'] as $review) {
|
|
||||||
if($review['attributes']['type'] == 1) {
|
|
||||||
if(isset($objmap['groups'][(int) $review['attributes']['required']]))
|
|
||||||
$reviews['g'][] = $objmap['groups'][(int) $review['attributes']['required']];
|
|
||||||
} else {
|
|
||||||
if(isset($objmap['users'][(int) $review['attributes']['required']]))
|
|
||||||
$reviews['i'][] = $objmap['users'][(int) $review['attributes']['required']];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
$approvals = array('i'=>array(), 'g'=>array());
|
$approvals = array('i'=>array(), 'g'=>array());
|
||||||
/*
|
|
||||||
if($initversion['approvals']) {
|
|
||||||
foreach($initversion['approvals'] as $approval) {
|
|
||||||
if($approval['attributes']['type'] == 1) {
|
|
||||||
if(isset($objmap['groups'][(int) $approval['attributes']['required']]))
|
|
||||||
$approvals['g'][] = $objmap['groups'][(int) $approval['attributes']['required']];
|
|
||||||
} else {
|
|
||||||
if(isset($objmap['users'][(int) $approval['attributes']['required']]))
|
|
||||||
$approvals['i'][] = $objmap['users'][(int) $approval['attributes']['required']];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$workflow = null;
|
$workflow = null;
|
||||||
$workflowstate = null;
|
$workflowstate = null;
|
||||||
if(isset($initversion['workflow']) && $initversion['workflow']) {
|
if(isset($initversion['workflow']) && $initversion['workflow']) {
|
||||||
|
@ -561,6 +539,8 @@ function insert_document($document) { /* {{{ */
|
||||||
$filename = tempnam('/tmp', 'FOO');
|
$filename = tempnam('/tmp', 'FOO');
|
||||||
copy($contentdir.$initversion['fileref'], $filename);
|
copy($contentdir.$initversion['fileref'], $filename);
|
||||||
} else {
|
} else {
|
||||||
|
if(!isset($initversion['data']))
|
||||||
|
echo $document['attributes']['name']."\n";
|
||||||
$filecontents = base64_decode($initversion['data']);
|
$filecontents = base64_decode($initversion['data']);
|
||||||
if(strlen($filecontents) != $initversion['data_length']) {
|
if(strlen($filecontents) != $initversion['data_length']) {
|
||||||
$logger->warning("File length (".strlen($filecontents).") doesn't match expected length (".$initversion['data_length'].").");
|
$logger->warning("File length (".strlen($filecontents).") doesn't match expected length (".$initversion['data_length'].").");
|
||||||
|
@ -655,35 +635,9 @@ function insert_document($document) { /* {{{ */
|
||||||
}
|
}
|
||||||
$owner = $dms->getUser($objmap['users'][(int) $version['attributes']['owner']]);
|
$owner = $dms->getUser($objmap['users'][(int) $version['attributes']['owner']]);
|
||||||
|
|
||||||
|
/* Rewriting the review/approval log will set reviewers/approvers */
|
||||||
$reviews = array('i'=>array(), 'g'=>array());
|
$reviews = array('i'=>array(), 'g'=>array());
|
||||||
/*
|
|
||||||
if($version['reviews']) {
|
|
||||||
foreach($version['reviews'] as $review) {
|
|
||||||
if($review['attributes']['type'] == 1) {
|
|
||||||
if(isset($objmap['groups'][(int) $review['attributes']['required']]))
|
|
||||||
$reviews['g'][] = $objmap['groups'][(int) $review['attributes']['required']];
|
|
||||||
} else {
|
|
||||||
if(isset($objmap['users'][(int) $review['attributes']['required']]))
|
|
||||||
$reviews['i'][] = $objmap['users'][(int) $review['attributes']['required']];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
$approvals = array('i'=>array(), 'g'=>array());
|
$approvals = array('i'=>array(), 'g'=>array());
|
||||||
/*
|
|
||||||
if($version['approvals']) {
|
|
||||||
foreach($version['approvals'] as $approval) {
|
|
||||||
if($approval['attributes']['type'] == 1) {
|
|
||||||
if(isset($objmap['groups'][(int) $approval['attributes']['required']]))
|
|
||||||
$approvals['g'][] = $objmap['groups'][(int) $approval['attributes']['required']];
|
|
||||||
} else {
|
|
||||||
if(isset($objmap['users'][(int) $approval['attributes']['required']]))
|
|
||||||
$approvals['i'][] = $objmap['users'][(int) $approval['attributes']['required']];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$workflow = null;
|
$workflow = null;
|
||||||
$workflowstate = null;
|
$workflowstate = null;
|
||||||
if(isset($version['workflow']) && $version['workflow']) {
|
if(isset($version['workflow']) && $version['workflow']) {
|
||||||
|
@ -704,8 +658,6 @@ function insert_document($document) { /* {{{ */
|
||||||
$logger->warning("Workflowstate ".$version['workflow']['state']." cannot be mapped");
|
$logger->warning("Workflowstate ".$version['workflow']['state']." cannot be mapped");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($version['workflowlogs']) {
|
|
||||||
}
|
|
||||||
|
|
||||||
$version_attributes = array();
|
$version_attributes = array();
|
||||||
if(isset($version['user_attributes'])) {
|
if(isset($version['user_attributes'])) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user