mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
set default access and owner
This commit is contained in:
parent
13973dd276
commit
6d9798753b
|
@ -56,6 +56,18 @@ if($settings->_quota > 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if($user->isAdmin()) {
|
||||
$ownerid = (int) $_POST["ownerid"];
|
||||
if($ownerid) {
|
||||
if(!($owner = $dms->getUser($ownerid))) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
|
||||
}
|
||||
} else {
|
||||
$owner = $user;
|
||||
}
|
||||
} else {
|
||||
$owner = $user;
|
||||
}
|
||||
$comment = trim($_POST["comment"]);
|
||||
$version_comment = trim($_POST["version_comment"]);
|
||||
if($version_comment == "" && isset($_POST["use_comment"]))
|
||||
|
@ -287,7 +299,7 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
|
|||
}
|
||||
|
||||
$filesize = SeedDMS_Core_File::fileSize($userfiletmp);
|
||||
$res = $folder->addDocument($name, $comment, $expires, $user, $keywords,
|
||||
$res = $folder->addDocument($name, $comment, $expires, $owner, $keywords,
|
||||
$cats, $userfiletmp, basename($userfilename),
|
||||
$fileType, $userfiletype, $sequence,
|
||||
$reviewers, $approvers, $reqversion,
|
||||
|
@ -297,6 +309,15 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
|
||||
} else {
|
||||
$document = $res[0];
|
||||
|
||||
/* Set access as specified in settings. */
|
||||
if($settings->_defaultAccessDocs) {
|
||||
if($settings->_defaultAccessDocs > 0 && $settings->_defaultAccessDocs < 4) {
|
||||
$document->setInheritAccess(0, true);
|
||||
$document->setDefaultAccess($settings->_defaultAccessDocs, true);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postAddDocument')) {
|
||||
|
|
|
@ -196,6 +196,24 @@ console.log(element);
|
|||
<td><?php printMLText("sequence");?>:</td>
|
||||
<td><?php $this->printSequenceChooser($folder->getDocuments('s')); if($orderby != 's') echo "<br />".getMLText('order_by_sequence_off'); ?></td>
|
||||
</tr>
|
||||
<?php if($user->isAdmin()) { ?>
|
||||
<tr>
|
||||
<td><?php printMLText("owner");?>:</td>
|
||||
<td>
|
||||
<select class="chzn-select" name="ownerid">
|
||||
<?php
|
||||
$allUsers = $dms->getAllUsers($sortusersinlist);
|
||||
foreach ($allUsers as $currUser) {
|
||||
if ($currUser->isGuest())
|
||||
continue;
|
||||
print "<option value=\"".$currUser->getID()."\" ".($currUser->getID()==$user->getID() ? 'selected' : '')." data-subtitle=\"".htmlspecialchars($currUser->getFullName())."\"";
|
||||
print ">" . htmlspecialchars($currUser->getLogin()) . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user