mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
f1b502b2f2
|
@ -55,6 +55,9 @@
|
|||
- documents, folders, files, events can be moved to a new user
|
||||
- do not show quota information in user manager if quotas are turn off
|
||||
- files in drop folder can be listed in main menu
|
||||
- webdav can use orig. filename of last version instead of document name (experimental)
|
||||
- fix browse button of fine-uploader when 'Enable large file upload' is
|
||||
turned on firefox is used (Closes #339)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.2
|
||||
|
|
|
@ -703,6 +703,43 @@ class SeedDMS_Core_DMS {
|
|||
return $document;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Returns a document by the original file name of the last version
|
||||
*
|
||||
* This function searches a document by the name of the last document
|
||||
* version and restricts the search
|
||||
* to given folder if passed as the second parameter.
|
||||
*
|
||||
* @param string $name
|
||||
* @param object $folder
|
||||
* @return object/boolean found document or false
|
||||
*/
|
||||
function getDocumentByOriginalFilename($name, $folder=null) { /* {{{ */
|
||||
if (!$name) return false;
|
||||
|
||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser` ".
|
||||
"FROM `tblDocuments` ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`document` = `tblDocuments`.`id` ".
|
||||
"LEFT JOIN `tblDocumentContent` ON `tblDocumentContent`.`document` = `tblDocuments`.`id` AND `tblDocumentContent`.`version` = `ttcontentid`.`maxVersion` ".
|
||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
||||
"WHERE `tblDocumentContent`.`orgFileName` = " . $this->db->qstr($name);
|
||||
if($folder)
|
||||
$queryStr .= " AND `tblDocuments`.`folder` = ". $folder->getID();
|
||||
$queryStr .= " LIMIT 1";
|
||||
|
||||
$resArr = $this->db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr)
|
||||
return false;
|
||||
|
||||
if(!$resArr)
|
||||
return false;
|
||||
|
||||
$row = $resArr[0];
|
||||
$document = new $this->classnames['document']($row["id"], $row["name"], $row["comment"], $row["date"], $row["expires"], $row["owner"], $row["folder"], $row["inheritAccess"], $row["defaultAccess"], $row["lockUser"], $row["keywords"], $row["sequence"]);
|
||||
$document->setDMS($this);
|
||||
return $document;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return a document content by its id
|
||||
*
|
||||
|
|
|
@ -1508,6 +1508,7 @@ returns just users which are not disabled
|
|||
- add new methods removeFromProcesses(), getWorkflowsInvolved(), getKeywordCategories() to SeedDMS_Core_User
|
||||
- add methods isMandatoryReviewerOf() and isMandatoryApproverOf()
|
||||
- add methods transferDocumentsFolders() and transferEvents()
|
||||
- add method SeedDMS_Core_DMS::getDocumentByOriginalFilename()
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
|
|
|
@ -277,7 +277,7 @@ else if ($action == "transferobjects") {
|
|||
}
|
||||
|
||||
// send login data to user
|
||||
else if ($action == "sendlogindata") {
|
||||
else if ($action == "sendlogindata" && $settings->_enableEmail) {
|
||||
/* Check if the form data comes from a trusted request */
|
||||
if(!checkFormKey('sendlogindata')) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_request_token"));
|
||||
|
|
|
@ -71,5 +71,6 @@ if($view) {
|
|||
$view->setParam('quota', $settings->_quota);
|
||||
$view->setParam('strictformcheck', $settings->_strictFormCheck);
|
||||
$view->setParam('accessobject', $accessop);
|
||||
$view->setParam('enableemail', $settings->_enableEmail);
|
||||
$view($_GET);
|
||||
}
|
||||
|
|
|
@ -2548,7 +2548,7 @@ mayscript>
|
|||
<div class="qq-upload-drop-area-selector qq-upload-drop-area" _qq-hide-dropzone>
|
||||
<span class="qq-upload-drop-area-text-selector"></span>
|
||||
</div>
|
||||
<button class="btn qq-upload-button-selector qq-upload-button">'.getMLText('browse').'…</button>
|
||||
<span class="btn qq-upload-button-selector qq-upload-button">'.getMLText('browse').'…</span>
|
||||
</div>
|
||||
<span class="qq-drop-processing-selector qq-drop-processing">
|
||||
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
|
||||
|
|
|
@ -192,6 +192,7 @@ $(document).ready( function() {
|
|||
$quota = $this->params['quota'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
$undeluserids = $this->params['undeluserids'];
|
||||
$enableemail = $this->params['enableemail'];
|
||||
|
||||
if($seluser) {
|
||||
?>
|
||||
|
@ -209,7 +210,8 @@ $(document).ready( function() {
|
|||
echo '<li><a href="../out/out.TransferObjects.php?userid='.$seluser->getID().'"><i class="icon-share-alt"></i> '.getMLText("transfer_objects").'</a></li>';
|
||||
if($user->isAdmin() && $seluser->getID() != $user->getID())
|
||||
echo "<li><a href=\"../op/op.SubstituteUser.php?userid=".$seluser->getID()."&formtoken=".createFormKey('substituteuser')."\"><i class=\"icon-exchange\"></i> ".getMLText("substitute_user")."</a></li>\n";
|
||||
echo '<li><a href="../out/out.SendLoginData.php?userid='.$seluser->getID().'"><i class="icon-envelope-alt"></i> '.getMLText("send_login_data").'</a></li>';
|
||||
if($enableemail)
|
||||
echo '<li><a href="../out/out.SendLoginData.php?userid='.$seluser->getID().'"><i class="icon-envelope-alt"></i> '.getMLText("send_login_data").'</a></li>';
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -43,6 +43,14 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
*/
|
||||
var $user = "";
|
||||
|
||||
/**
|
||||
* Set to true if original file shall be used instead of document name
|
||||
*
|
||||
* @access private
|
||||
* @var boolean
|
||||
*/
|
||||
var $useorgfilename = false;
|
||||
|
||||
/**
|
||||
* Serve a webdav request
|
||||
*
|
||||
|
@ -184,7 +192,11 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
$this->logger->log('reverseLookup: found folder '.$root->getName().' ('.$root->getID().')', PEAR_LOG_DEBUG);
|
||||
return $root;
|
||||
} else {
|
||||
if($document = $this->dms->getDocumentByName($docname, $root)) {
|
||||
if($this->useorgfilename)
|
||||
$document = $this->dms->getDocumentByOriginalFilename($docname, $root);
|
||||
else
|
||||
$document = $this->dms->getDocumentByName($docname, $root);
|
||||
if($document) {
|
||||
if($this->logger)
|
||||
$this->logger->log('reverseLookup: found document '.$document->getName().' ('.$document->getID().')', PEAR_LOG_DEBUG);
|
||||
return $document;
|
||||
|
@ -201,7 +213,11 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
}
|
||||
if($folder) {
|
||||
if($docname) {
|
||||
if($document = $this->dms->getDocumentByName($docname, $folder)) {
|
||||
if($this->useorgfilename)
|
||||
$document = $this->dms->getDocumentByOriginalFilename($docname, $folder);
|
||||
else
|
||||
$document = $this->dms->getDocumentByName($docname, $folder);
|
||||
if($document) {
|
||||
if($this->logger)
|
||||
$this->logger->log('reverseLookup: found document '.$document->getName().' ('.$document->getID().')', PEAR_LOG_DEBUG);
|
||||
return $document;
|
||||
|
@ -341,8 +357,13 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
// $path .= rawurlencode($pathseg->getName()).'/';
|
||||
$path .= $pathseg->getName().'/';
|
||||
// $info["path"] = htmlspecialchars($path.rawurlencode($obj->getName()));
|
||||
$info["path"] = $path.$obj->getName();
|
||||
$info["props"][] = $this->mkprop("displayname", $obj->getName());
|
||||
if($this->useorgfilename) {
|
||||
$info["path"] = $path.$content->getOriginalFileName();
|
||||
$info["props"][] = $this->mkprop("displayname", $content->getOriginalFileName());
|
||||
} else {
|
||||
$info["path"] = $path.$obj->getName();
|
||||
$info["props"][] = $this->mkprop("displayname", $obj->getName());
|
||||
}
|
||||
|
||||
$info["props"][] = $this->mkprop("resourcetype", "");
|
||||
if (1 /*is_readable($fspath)*/) {
|
||||
|
@ -495,6 +516,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
|
||||
$fspath = $this->dms->contentDir.'/'.$content->getPath();
|
||||
$filesize = filesize($fspath);
|
||||
if($this->useorgfilename)
|
||||
$filename = $content->getOriginalFileName();;
|
||||
}
|
||||
// $name = htmlspecialchars($filename);
|
||||
$name = $filename;
|
||||
|
@ -562,7 +585,11 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
else $fileType = substr($name, $lastDotIndex);
|
||||
}
|
||||
/* First check whether there is already a file with the same name */
|
||||
if($document = $this->dms->getDocumentByName($name, $folder)) {
|
||||
if($this->useorgfilename)
|
||||
$document = $this->dms->getDocumentByOriginalFilename($name, $folder);
|
||||
else
|
||||
$document = $this->dms->getDocumentByName($name, $folder);
|
||||
if($document) {
|
||||
if ($document->getAccessMode($this->user) < M_READWRITE) {
|
||||
unlink($tmpFile);
|
||||
return "403 Forbidden";
|
||||
|
|
Loading…
Reference in New Issue
Block a user