Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2023-09-27 11:40:04 +02:00
commit b5dbadfb66
7 changed files with 36 additions and 21 deletions

View File

@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
Changes in version 6.0.26
--------------------------------------------------------------------------------
- merge changes up to 5.1.33
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 6.0.25 Changes in version 6.0.25
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -264,6 +269,14 @@
- add document list which can be exported as an archive - add document list which can be exported as an archive
- search results can be exported - search results can be exported
--------------------------------------------------------------------------------
Changes in version 5.1.33
--------------------------------------------------------------------------------
- use SeedDMS_Core_File::mimetype() to determine mime type when uploading a
file with drag&drop
- user images may be 300px height, do not scale them up
>>>>>>> seeddms-5.1.x
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.32 Changes in version 5.1.32
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -197,7 +197,7 @@ class UI extends UI_Default {
$view = UI::factory($theme, 'ErrorDlg'); $view = UI::factory($theme, 'ErrorDlg');
$request = $view->getParam('request'); $request = $view->getParam('request');
if($request) { if($request) {
$request->query->set('action', 'show'); $request->request->set('action', 'show');
} }
$view->setParam('dms', $dms); $view->setParam('dms', $dms);
$view->setParam('user', $user); $view->setParam('user', $user);

View File

@ -755,8 +755,7 @@ switch($command) {
$fileType = ".".pathinfo($userfilename, PATHINFO_EXTENSION); $fileType = ".".pathinfo($userfilename, PATHINFO_EXTENSION);
if($settings->_overrideMimeType) { if($settings->_overrideMimeType) {
$finfo = finfo_open(FILEINFO_MIME_TYPE); $userfiletype = SeedDMS_Core_File::mimetype($userfiletmp);
$userfiletype = finfo_file($finfo, $userfiletmp);
} }
if (!empty($_POST["name"])) if (!empty($_POST["name"]))
@ -1006,8 +1005,7 @@ switch($command) {
$fileType = ".".pathinfo($userfilename, PATHINFO_EXTENSION); $fileType = ".".pathinfo($userfilename, PATHINFO_EXTENSION);
if($settings->_overrideMimeType) { if($settings->_overrideMimeType) {
$finfo = finfo_open(FILEINFO_MIME_TYPE); $userfiletype = SeedDMS_Core_File::mimetype($userfiletmp);
$userfiletype = finfo_file($finfo, $userfiletmp);
} }
if (!empty($_POST["name"])) if (!empty($_POST["name"]))

View File

@ -382,6 +382,7 @@ default:
$controller->setParam('attributes', $attributes); $controller->setParam('attributes', $attributes);
$controller->setParam('workflow', $workflow); $controller->setParam('workflow', $workflow);
$controller->setParam('initialdocumentstatus', $settings->_initialDocumentStatus); $controller->setParam('initialdocumentstatus', $settings->_initialDocumentStatus);
$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText);
if(!$content = $controller()) { if(!$content = $controller()) {
$err = $controller->getErrorMsg(); $err = $controller->getErrorMsg();

View File

@ -517,30 +517,27 @@ else UI::exitError(getMLText("admin_tools"),getMLText("unknown_command"));
function resizeImage($imageFile) { function resizeImage($imageFile) {
// Not perfect. Creates a new image even if the old one is acceptable,
// and the output quality is low. Now uses the function imagecreatetruecolor(),
// though, so at least the pictures are in colour.
// read original image // read original image
$origImg = imagecreatefromjpeg($imageFile); $origImg = imagecreatefromjpeg($imageFile);
$width = imagesx($origImg); $width = imagesx($origImg);
$height = imagesy($origImg); $height = imagesy($origImg);
// Create thumbnail in memory // Create thumbnail in memory
$newHeight = 150; $newHeight = 300;
$newWidth = ($width/$height) * $newHeight; $newWidth = ($width/$height) * $newHeight;
$newImg = imagecreatetruecolor($newWidth, $newHeight); /* Do not scale images which are already small enough */
// resize if($newWidth < $width || $newHeight < $height) {
imagecopyresized($newImg, $origImg, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); $newImg = imagecreatetruecolor($newWidth, $newHeight);
// save to file // resize
imagejpeg($newImg, $imageFile); imagecopyresized($newImg, $origImg, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
// Clean up // save to file
imagejpeg($newImg, $imageFile);
// Clean up
imagedestroy($newImg);
}
imagedestroy($origImg); imagedestroy($origImg);
imagedestroy($newImg);
return true; return true;
} }
header("Location:../out/out.UsrMgr.php?userid=".$userid); header("Location:../out/out.UsrMgr.php?userid=".$userid);
?>

View File

@ -59,7 +59,7 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
$class = 'input-medium'; $class = 'input-medium';
else else
$class = 'input-small'; $class = 'input-small';
$html .= '<input '.($type=='password' ? 'type="password"' : ($type=='number' ? 'type="number"' : 'type="text"')).' class="form-control '.$class.'" name="'.$name.'" value="'.$value.'" placeholder="'.$placeholder.'"/>'; $html .= '<input '.($type=='password' ? 'type="password"' : ($type=='number' ? 'type="number"' : ($type=='color' ? 'type="color"' : 'type="text"'))).' class="form-control '.$class.'" name="'.$name.'" value="'.$value.'" placeholder="'.$placeholder.'"/>';
} }
return $html; return $html;
} /* }}} */ } /* }}} */
@ -718,6 +718,12 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
case 'hook': case 'hook':
echo $this->callHook('showConfig', $confkey, $extname, $extconf); echo $this->callHook('showConfig', $confkey, $extname, $extconf);
break; break;
case "date":
$this->formField(
null,
$this->getDateChooser((isset($settings->_extensions[$extname][$confkey]) ? getReadableDate($settings->_extensions[$extname][$confkey]) : ''), "extensions[".$extname."][".$confkey."]", $this->params['session']->getLanguage())
);
break;
default: default:
$this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', isset($conf['type']) ? $conf['type'] : '', isset($conf['placeholder']) ? $conf['placeholder'] : ''); $this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', isset($conf['type']) ? $conf['type'] : '', isset($conf['placeholder']) ? $conf['placeholder'] : '');
} }

View File

@ -431,7 +431,7 @@ $(document).ready( function() {
if ($currUser) { if ($currUser) {
$this->formField( $this->formField(
getMLText("user_image"), getMLText("user_image"),
($currUser->hasImage() ? "<img src=\"".$httproot."out/out.UserImage.php?userid=".$currUser->getId()."\">" : getMLText('no_user_image')) ($currUser->hasImage() ? "<img src=\"".$httproot."out/out.UserImage.php?userid=".$currUser->getId()."\" style=\"max-height: 150px;\">" : getMLText('no_user_image'))
); );
$this->formField( $this->formField(
getMLText("new_user_image"), getMLText("new_user_image"),