mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
Merge branch 'seeddms-5.0.x' into seeddms-5.1.x
This commit is contained in:
commit
b76448c3a4
|
@ -88,6 +88,8 @@
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 4.3.34
|
Changes in version 4.3.34
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
- add multibyte save basename() replacement, which fixes uploading files whose
|
||||||
|
name starts with a multibyte char
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 4.3.33
|
Changes in version 4.3.33
|
||||||
|
|
|
@ -339,6 +339,27 @@ function dskspace($dir) { /* {{{ */
|
||||||
return $space;
|
return $space;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replacement of PHP's basename function
|
||||||
|
*
|
||||||
|
* Because basename is locale dependent and strips off non ascii chars
|
||||||
|
* from the beginning of filename, it cannot be used in a environment
|
||||||
|
* where locale is set to e.g. 'C'
|
||||||
|
*/
|
||||||
|
function utf8_basename($path, $suffix='') { /* {{{ */
|
||||||
|
$rpos = strrpos($path, DIRECTORY_SEPARATOR);
|
||||||
|
if($rpos === false)
|
||||||
|
return $path;
|
||||||
|
$file = substr($path, $rpos+1);
|
||||||
|
|
||||||
|
$suflen = strlen($suffix);
|
||||||
|
if($suflen && (substr($file, -$suflen) == $suffix)){
|
||||||
|
$file = substr($file, 0, -$suflen);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $file;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
|
|
|
@ -244,7 +244,7 @@ if(isset($_POST['fineuploaderuuids']) && $_POST['fineuploaderuuids']) {
|
||||||
$uuids = explode(';', $_POST['fineuploaderuuids']);
|
$uuids = explode(';', $_POST['fineuploaderuuids']);
|
||||||
$names = explode(';', $_POST['fineuploadernames']);
|
$names = explode(';', $_POST['fineuploadernames']);
|
||||||
foreach($uuids as $i=>$uuid) {
|
foreach($uuids as $i=>$uuid) {
|
||||||
$fullfile = $settings->_stagingDir.'/'.basename($uuid);
|
$fullfile = $settings->_stagingDir.'/'.utf8_basename($uuid);
|
||||||
if(file_exists($fullfile)) {
|
if(file_exists($fullfile)) {
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$mimetype = finfo_file($finfo, $fullfile);
|
$mimetype = finfo_file($finfo, $fullfile);
|
||||||
|
@ -281,7 +281,7 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
|
||||||
|
|
||||||
if ((count($_FILES["userfile"]["tmp_name"])==1)&&($_POST["name"]!=""))
|
if ((count($_FILES["userfile"]["tmp_name"])==1)&&($_POST["name"]!=""))
|
||||||
$name = trim($_POST["name"]);
|
$name = trim($_POST["name"]);
|
||||||
else $name = basename($userfilename);
|
else $name = utf8_basename($userfilename);
|
||||||
|
|
||||||
/* Check if name already exists in the folder */
|
/* Check if name already exists in the folder */
|
||||||
if(!$settings->_enableDuplicateDocNames) {
|
if(!$settings->_enableDuplicateDocNames) {
|
||||||
|
@ -307,7 +307,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, $owner, $keywords,
|
$res = $folder->addDocument($name, $comment, $expires, $owner, $keywords,
|
||||||
$cats, $userfiletmp, basename($userfilename),
|
$cats, $userfiletmp, utf8_basename($userfilename),
|
||||||
$fileType, $userfiletype, $sequence,
|
$fileType, $userfiletype, $sequence,
|
||||||
$reviewers, $approvers, $reqversion,
|
$reviewers, $approvers, $reqversion,
|
||||||
$version_comment, $attributes, $attributes_version, $workflow);
|
$version_comment, $attributes, $attributes_version, $workflow);
|
||||||
|
|
|
@ -454,19 +454,24 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams);
|
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams);
|
||||||
// $this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
|
|
||||||
print "<table class=\"table table-hover\">";
|
$txt = $this->callHook('searchListHeader', $folder, $orderby);
|
||||||
print "<thead>\n<tr>\n";
|
if(is_string($txt))
|
||||||
print "<th></th>\n";
|
echo $txt;
|
||||||
print "<th>".getMLText("name")."</th>\n";
|
else {
|
||||||
print "<th>".getMLText("attributes")."</th>\n";
|
print "<table class=\"table table-hover\">";
|
||||||
print "<th>".getMLText("status")."</th>\n";
|
print "<thead>\n<tr>\n";
|
||||||
print "<th>".getMLText("action")."</th>\n";
|
print "<th></th>\n";
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
print "<th>".getMLText("name")."</th>\n";
|
||||||
|
print "<th>".getMLText("attributes")."</th>\n";
|
||||||
|
print "<th>".getMLText("status")."</th>\n";
|
||||||
|
print "<th>".getMLText("action")."</th>\n";
|
||||||
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
}
|
||||||
|
|
||||||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
if(get_class($entry) == $dms->getClassname('document')) {
|
if(get_class($entry) == $dms->getClassname('document')) {
|
||||||
$txt = $this->callHook('documentListItem', $entry, $previewer);
|
$txt = $this->callHook('documentListItem', $entry, $previewer, 'search');
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
echo $txt;
|
echo $txt;
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -300,36 +300,34 @@ function folderSelected(id, name) {
|
||||||
print "<th>".getMLText("action")."</th>\n";
|
print "<th>".getMLText("action")."</th>\n";
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else printMLText("empty_folder_list");
|
|
||||||
|
|
||||||
|
foreach($subFolders as $subFolder) {
|
||||||
foreach($subFolders as $subFolder) {
|
$txt = $this->callHook('folderListItem', $subFolder, 'viewfolder');
|
||||||
$txt = $this->callHook('folderListItem', $subFolder);
|
if(is_string($txt))
|
||||||
if(is_string($txt))
|
echo $txt;
|
||||||
echo $txt;
|
else {
|
||||||
else {
|
echo $this->folderListRow($subFolder);
|
||||||
echo $this->folderListRow($subFolder);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach($documents as $document) {
|
foreach($documents as $document) {
|
||||||
$document->verifyLastestContentExpriry();
|
$document->verifyLastestContentExpriry();
|
||||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
$txt = $this->callHook('documentListItem', $document, $previewer, 'viewfolder');
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
echo $txt;
|
echo $txt;
|
||||||
else {
|
else {
|
||||||
echo $this->documentListRow($document, $previewer);
|
echo $this->documentListRow($document, $previewer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((count($subFolders) > 0)||(count($documents) > 0)) {
|
|
||||||
$txt = $this->callHook('folderListFooter', $folder);
|
$txt = $this->callHook('folderListFooter', $folder);
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
echo $txt;
|
echo $txt;
|
||||||
else
|
else
|
||||||
echo "</tbody>\n</table>\n";
|
echo "</tbody>\n</table>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else printMLText("empty_folder_list");
|
||||||
|
|
||||||
echo "</div>\n"; // End of right column div
|
echo "</div>\n"; // End of right column div
|
||||||
echo "</div>\n"; // End of div around left and right column
|
echo "</div>\n"; // End of div around left and right column
|
||||||
|
|
Loading…
Reference in New Issue
Block a user