mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +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
|
||||
--------------------------------------------------------------------------------
|
||||
- add multibyte save basename() replacement, which fixes uploading files whose
|
||||
name starts with a multibyte char
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 4.3.33
|
||||
|
|
|
@ -339,6 +339,27 @@ function dskspace($dir) { /* {{{ */
|
|||
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
|
||||
*
|
||||
|
|
|
@ -244,7 +244,7 @@ if(isset($_POST['fineuploaderuuids']) && $_POST['fineuploaderuuids']) {
|
|||
$uuids = explode(';', $_POST['fineuploaderuuids']);
|
||||
$names = explode(';', $_POST['fineuploadernames']);
|
||||
foreach($uuids as $i=>$uuid) {
|
||||
$fullfile = $settings->_stagingDir.'/'.basename($uuid);
|
||||
$fullfile = $settings->_stagingDir.'/'.utf8_basename($uuid);
|
||||
if(file_exists($fullfile)) {
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$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"]!=""))
|
||||
$name = trim($_POST["name"]);
|
||||
else $name = basename($userfilename);
|
||||
else $name = utf8_basename($userfilename);
|
||||
|
||||
/* Check if name already exists in the folder */
|
||||
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);
|
||||
$res = $folder->addDocument($name, $comment, $expires, $owner, $keywords,
|
||||
$cats, $userfiletmp, basename($userfilename),
|
||||
$cats, $userfiletmp, utf8_basename($userfilename),
|
||||
$fileType, $userfiletype, $sequence,
|
||||
$reviewers, $approvers, $reqversion,
|
||||
$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->contentContainerStart();
|
||||
|
||||
print "<table class=\"table table-hover\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\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";
|
||||
$txt = $this->callHook('searchListHeader', $folder, $orderby);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
print "<table class=\"table table-hover\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\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);
|
||||
foreach ($entries as $entry) {
|
||||
if(get_class($entry) == $dms->getClassname('document')) {
|
||||
$txt = $this->callHook('documentListItem', $entry, $previewer);
|
||||
$txt = $this->callHook('documentListItem', $entry, $previewer, 'search');
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
|
|
|
@ -300,36 +300,34 @@ function folderSelected(id, name) {
|
|||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
}
|
||||
}
|
||||
else printMLText("empty_folder_list");
|
||||
|
||||
|
||||
foreach($subFolders as $subFolder) {
|
||||
$txt = $this->callHook('folderListItem', $subFolder);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->folderListRow($subFolder);
|
||||
foreach($subFolders as $subFolder) {
|
||||
$txt = $this->callHook('folderListItem', $subFolder, 'viewfolder');
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->folderListRow($subFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($documents as $document) {
|
||||
$document->verifyLastestContentExpriry();
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer);
|
||||
foreach($documents as $document) {
|
||||
$document->verifyLastestContentExpriry();
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer, 'viewfolder');
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((count($subFolders) > 0)||(count($documents) > 0)) {
|
||||
$txt = $this->callHook('folderListFooter', $folder);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else
|
||||
echo "</tbody>\n</table>\n";
|
||||
|
||||
}
|
||||
else printMLText("empty_folder_list");
|
||||
|
||||
echo "</div>\n"; // End of right column div
|
||||
echo "</div>\n"; // End of div around left and right column
|
||||
|
|
Loading…
Reference in New Issue
Block a user