mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +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"]);
|
$comment = trim($_POST["comment"]);
|
||||||
$version_comment = trim($_POST["version_comment"]);
|
$version_comment = trim($_POST["version_comment"]);
|
||||||
if($version_comment == "" && isset($_POST["use_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);
|
$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),
|
$cats, $userfiletmp, basename($userfilename),
|
||||||
$fileType, $userfiletype, $sequence,
|
$fileType, $userfiletype, $sequence,
|
||||||
$reviewers, $approvers, $reqversion,
|
$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"));
|
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
|
||||||
} else {
|
} else {
|
||||||
$document = $res[0];
|
$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'])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'])) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'] as $hookObj) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'] as $hookObj) {
|
||||||
if (method_exists($hookObj, 'postAddDocument')) {
|
if (method_exists($hookObj, 'postAddDocument')) {
|
||||||
|
|
|
@ -196,6 +196,24 @@ console.log(element);
|
||||||
<td><?php printMLText("sequence");?>:</td>
|
<td><?php printMLText("sequence");?>:</td>
|
||||||
<td><?php $this->printSequenceChooser($folder->getDocuments('s')); if($orderby != 's') echo "<br />".getMLText('order_by_sequence_off'); ?></td>
|
<td><?php $this->printSequenceChooser($folder->getDocuments('s')); if($orderby != 's') echo "<br />".getMLText('order_by_sequence_off'); ?></td>
|
||||||
</tr>
|
</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
|
<?php
|
||||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user