mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
read status log from xml file
This commit is contained in:
parent
42eaabfd2d
commit
f9b75e5071
|
@ -187,8 +187,8 @@ function insert_keywordcategory($keywordcat) { /* {{{ */
|
||||||
function insert_document($document) { /* {{{ */
|
function insert_document($document) { /* {{{ */
|
||||||
global $dms, $debug, $defaultUser, $objmap, $sections, $rootfolder;
|
global $dms, $debug, $defaultUser, $objmap, $sections, $rootfolder;
|
||||||
|
|
||||||
if($debug)
|
if($debug) print_r($document);
|
||||||
print_r($document);
|
|
||||||
if(!array_key_exists((int) $document['attributes']['owner'], $objmap['users'])) {
|
if(!array_key_exists((int) $document['attributes']['owner'], $objmap['users'])) {
|
||||||
echo "Warning: owner of document cannot be mapped using default user\n";
|
echo "Warning: owner of document cannot be mapped using default user\n";
|
||||||
$owner = $defaultUser;
|
$owner = $defaultUser;
|
||||||
|
@ -574,7 +574,7 @@ function resolve_links() { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function startElement($parser, $name, $attrs) { /* {{{ */
|
function startElement($parser, $name, $attrs) { /* {{{ */
|
||||||
global $elementstack, $objmap, $cur_user, $cur_group, $cur_folder, $cur_document, $cur_version, $cur_approval, $cur_approvallog, $cur_review, $cur_reviewlog, $cur_attrdef, $cur_documentcat, $cur_keyword, $cur_keywordcat, $cur_file, $cur_link;
|
global $elementstack, $objmap, $cur_user, $cur_group, $cur_folder, $cur_document, $cur_version, $cur_statuslog, $cur_approval, $cur_approvallog, $cur_review, $cur_reviewlog, $cur_attrdef, $cur_documentcat, $cur_keyword, $cur_keywordcat, $cur_file, $cur_link;
|
||||||
|
|
||||||
$parent = end($elementstack);
|
$parent = end($elementstack);
|
||||||
array_push($elementstack, array('name'=>$name, 'attributes'=>$attrs));
|
array_push($elementstack, array('name'=>$name, 'attributes'=>$attrs));
|
||||||
|
@ -648,6 +648,10 @@ function startElement($parser, $name, $attrs) { /* {{{ */
|
||||||
$cur_version['approvals'] = array();
|
$cur_version['approvals'] = array();
|
||||||
$cur_version['reviews'] = array();
|
$cur_version['reviews'] = array();
|
||||||
break;
|
break;
|
||||||
|
case "STATUSLOG":
|
||||||
|
$cur_statuslog = array();
|
||||||
|
$cur_statuslog['attributes'] = array();
|
||||||
|
break;
|
||||||
case "APPROVAL":
|
case "APPROVAL":
|
||||||
$cur_approval = array();
|
$cur_approval = array();
|
||||||
$cur_approval['attributes'] = array();
|
$cur_approval['attributes'] = array();
|
||||||
|
@ -685,6 +689,8 @@ function startElement($parser, $name, $attrs) { /* {{{ */
|
||||||
} else {
|
} else {
|
||||||
$cur_version['attributes'][$attrs['NAME']] = '';
|
$cur_version['attributes'][$attrs['NAME']] = '';
|
||||||
}
|
}
|
||||||
|
} elseif($parent['name'] == 'STATUSLOG') {
|
||||||
|
$cur_statuslog['attributes'][$attrs['NAME']] = '';
|
||||||
} elseif($parent['name'] == 'APPROVAL') {
|
} elseif($parent['name'] == 'APPROVAL') {
|
||||||
$cur_approval['attributes'][$attrs['NAME']] = '';
|
$cur_approval['attributes'][$attrs['NAME']] = '';
|
||||||
} elseif($parent['name'] == 'APPROVALLOG') {
|
} elseif($parent['name'] == 'APPROVALLOG') {
|
||||||
|
@ -823,7 +829,7 @@ function startElement($parser, $name, $attrs) { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function endElement($parser, $name) { /* {{{ */
|
function endElement($parser, $name) { /* {{{ */
|
||||||
global $dms, $sections, $rootfolder, $objmap, $elementstack, $users, $groups, $links,$cur_user, $cur_group, $cur_folder, $cur_document, $cur_version, $cur_approval, $cur_approvallog, $cur_review, $cur_reviewlog, $cur_attrdef, $cur_documentcat, $cur_keyword, $cur_keywordcat, $cur_file, $cur_link;
|
global $dms, $sections, $rootfolder, $objmap, $elementstack, $users, $groups, $links,$cur_user, $cur_group, $cur_folder, $cur_document, $cur_version, $cur_statuslog, $cur_approval, $cur_approvallog, $cur_review, $cur_reviewlog, $cur_attrdef, $cur_documentcat, $cur_keyword, $cur_keywordcat, $cur_file, $cur_link;
|
||||||
|
|
||||||
array_pop($elementstack);
|
array_pop($elementstack);
|
||||||
$parent = end($elementstack);
|
$parent = end($elementstack);
|
||||||
|
@ -839,6 +845,9 @@ function endElement($parser, $name) { /* {{{ */
|
||||||
case "VERSION":
|
case "VERSION":
|
||||||
$cur_document['versions'][] = $cur_version;
|
$cur_document['versions'][] = $cur_version;
|
||||||
break;
|
break;
|
||||||
|
case "STATUSLOG":
|
||||||
|
$cur_version['statuslogs'][] = $cur_statuslog;
|
||||||
|
break;
|
||||||
case "APPROVAL":
|
case "APPROVAL":
|
||||||
$cur_version['approvals'][] = $cur_approval;
|
$cur_version['approvals'][] = $cur_approval;
|
||||||
break;
|
break;
|
||||||
|
@ -854,7 +863,7 @@ function endElement($parser, $name) { /* {{{ */
|
||||||
case "USER":
|
case "USER":
|
||||||
/* users can be the users data or the member of a group */
|
/* users can be the users data or the member of a group */
|
||||||
$first = $elementstack[1];
|
$first = $elementstack[1];
|
||||||
if($first['name'] == 'USERS') {
|
if($first['name'] == 'USERS' && $parent['name'] == 'USERS') {
|
||||||
$users[$cur_user['id']] = $cur_user;
|
$users[$cur_user['id']] = $cur_user;
|
||||||
insert_user($cur_user);
|
insert_user($cur_user);
|
||||||
}
|
}
|
||||||
|
@ -894,7 +903,7 @@ function endElement($parser, $name) { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function characterData($parser, $data) { /* {{{ */
|
function characterData($parser, $data) { /* {{{ */
|
||||||
global $elementstack, $objmap, $cur_user, $cur_group, $cur_folder, $cur_document, $cur_version, $cur_approval, $cur_approvallog, $cur_review, $cur_reviewlog, $cur_attrdef, $cur_documentcat, $cur_keyword, $cur_keywordcat, $cur_file, $cur_link;
|
global $elementstack, $objmap, $cur_user, $cur_group, $cur_folder, $cur_document, $cur_version, $cur_statuslog, $cur_approval, $cur_approvallog, $cur_review, $cur_reviewlog, $cur_attrdef, $cur_documentcat, $cur_keyword, $cur_keywordcat, $cur_file, $cur_link;
|
||||||
|
|
||||||
$current = end($elementstack);
|
$current = end($elementstack);
|
||||||
$parent = prev($elementstack);
|
$parent = prev($elementstack);
|
||||||
|
@ -922,6 +931,9 @@ function characterData($parser, $data) { /* {{{ */
|
||||||
$cur_version['attributes'][$current['attributes']['NAME']] = $data;
|
$cur_version['attributes'][$current['attributes']['NAME']] = $data;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'STATUSLOG':
|
||||||
|
$cur_statuslog['attributes'][$current['attributes']['NAME']] = $data;
|
||||||
|
break;
|
||||||
case 'APPROVAL':
|
case 'APPROVAL':
|
||||||
$cur_approval['attributes'][$current['attributes']['NAME']] = $data;
|
$cur_approval['attributes'][$current['attributes']['NAME']] = $data;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user