mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
8907c2f20a
|
@ -412,7 +412,7 @@ class Settings { /* {{{ */
|
||||||
* @param string $var value
|
* @param string $var value
|
||||||
* @return true/false
|
* @return true/false
|
||||||
*/
|
*/
|
||||||
function boolVal($var) { /* {{{ */
|
protected static function boolVal($var) { /* {{{ */
|
||||||
$var = strtolower(strval($var));
|
$var = strtolower(strval($var));
|
||||||
switch ($var) {
|
switch ($var) {
|
||||||
case 'true':
|
case 'true':
|
||||||
|
@ -465,7 +465,7 @@ class Settings { /* {{{ */
|
||||||
* @param string $stringValue string value
|
* @param string $stringValue string value
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */
|
protected function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */
|
||||||
$this->_viewOnlineFileTypes = explode(";", $stringValue);
|
$this->_viewOnlineFileTypes = explode(";", $stringValue);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -475,7 +475,7 @@ class Settings { /* {{{ */
|
||||||
* @return string value
|
* @return string value
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getViewOnlineFileTypesToString() { /* {{{ */
|
protected function getViewOnlineFileTypesToString() { /* {{{ */
|
||||||
return implode(";", $this->_viewOnlineFileTypes);
|
return implode(";", $this->_viewOnlineFileTypes);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -485,7 +485,7 @@ class Settings { /* {{{ */
|
||||||
* @param string $stringValue string value
|
* @param string $stringValue string value
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */
|
protected function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */
|
||||||
$this->_editOnlineFileTypes = explode(";", $stringValue);
|
$this->_editOnlineFileTypes = explode(";", $stringValue);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -495,7 +495,7 @@ class Settings { /* {{{ */
|
||||||
* @return string value
|
* @return string value
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getEditOnlineFileTypesToString() { /* {{{ */
|
protected function getEditOnlineFileTypesToString() { /* {{{ */
|
||||||
return implode(";", $this->_editOnlineFileTypes);
|
return implode(";", $this->_editOnlineFileTypes);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -1279,7 +1279,7 @@ class Settings { /* {{{ */
|
||||||
* If none was found a final try will be made checking /etc/seeddms
|
* If none was found a final try will be made checking /etc/seeddms
|
||||||
* @return NULL|string config directory
|
* @return NULL|string config directory
|
||||||
*/
|
*/
|
||||||
static function getConfigDir() { /* {{{ */
|
protected static function getConfigDir() { /* {{{ */
|
||||||
if(defined("SEEDDMS_CONFIG_FILE"))
|
if(defined("SEEDDMS_CONFIG_FILE"))
|
||||||
return dirname(SEEDDMS_CONFIG_FILE);
|
return dirname(SEEDDMS_CONFIG_FILE);
|
||||||
elseif(getenv("SEEDDMS_CONFIG_FILE"))
|
elseif(getenv("SEEDDMS_CONFIG_FILE"))
|
||||||
|
@ -1781,5 +1781,22 @@ class Settings { /* {{{ */
|
||||||
$this->_extensions[$extname]['__disable__'] = true;
|
$this->_extensions[$extname]['__disable__'] = true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get maximum upload size
|
||||||
|
*
|
||||||
|
* Determine the maximum upload size by checking the php config
|
||||||
|
* variables upload_max_filesize, post_max_size and the seeddms
|
||||||
|
* setting maxUploadSize
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getMaximumUploadSize() { /* {{{ */
|
||||||
|
$mus = [];
|
||||||
|
$mus[] = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
|
||||||
|
$mus[] = SeedDMS_Core_File::parse_filesize(ini_get("post_max_size"));
|
||||||
|
if(is_numeric($this->_maxUploadSize) && $this->_maxUploadSize > 0)
|
||||||
|
$mus[] = SeedDMS_Core_File::parse_filesize($this->_maxUploadSize);
|
||||||
|
return min($mus);
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ class UI extends UI_Default {
|
||||||
$view->setParam('workflowmode', $settings->_workflowMode);
|
$view->setParam('workflowmode', $settings->_workflowMode);
|
||||||
$view->setParam('checkoutdir', $settings->_checkOutDir);
|
$view->setParam('checkoutdir', $settings->_checkOutDir);
|
||||||
$view->setParam('partitionsize', SeedDMS_Core_File::parse_filesize( $settings->_partitionSize));
|
$view->setParam('partitionsize', SeedDMS_Core_File::parse_filesize( $settings->_partitionSize));
|
||||||
$view->setParam('maxuploadsize', SeedDMS_Core_File::parse_filesize($settings->_maxUploadSize));
|
$view->setParam('maxuploadsize', $settings->getMaximumUploadSize());
|
||||||
$view->setParam('showmissingtranslations', $settings->_showMissingTranslations);
|
$view->setParam('showmissingtranslations', $settings->_showMissingTranslations);
|
||||||
$view->setParam('defaultsearchmethod', $settings->_defaultSearchMethod);
|
$view->setParam('defaultsearchmethod', $settings->_defaultSearchMethod);
|
||||||
$view->setParam('cachedir', $settings->_cacheDir);
|
$view->setParam('cachedir', $settings->_cacheDir);
|
||||||
|
|
|
@ -41,12 +41,23 @@ function getConvertDateFormat() { /* {{{ */
|
||||||
return 'yyyy-mm-dd';
|
return 'yyyy-mm-dd';
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a human readable date string
|
||||||
|
*
|
||||||
|
* This function formats a timestamp according to the date format
|
||||||
|
* settings. If no timestamp is passed the current date is used.
|
||||||
|
* If null or an empty string is passed, then an empty string
|
||||||
|
* is returned. If $timestamp is numeric it will be taken as a unix
|
||||||
|
* timestamp. If $timestamp is a string it will be parѕed with strtotime().
|
||||||
|
*/
|
||||||
function getReadableDate($timestamp=0) { /* {{{ */
|
function getReadableDate($timestamp=0) { /* {{{ */
|
||||||
global $settings;
|
global $settings;
|
||||||
if(!$timestamp)
|
if($timestamp === 0)
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
elseif(!is_numeric($timestamp))
|
elseif($timestamp && is_string($timestamp))
|
||||||
$timestamp = strtotime($timestamp);
|
$timestamp = strtotime($timestamp);
|
||||||
|
elseif(!is_numeric($timestamp))
|
||||||
|
return '';
|
||||||
if($settings->_dateformat)
|
if($settings->_dateformat)
|
||||||
return date($settings->_dateformat, $timestamp);
|
return date($settings->_dateformat, $timestamp);
|
||||||
else
|
else
|
||||||
|
|
|
@ -186,11 +186,7 @@ console.log(params);
|
||||||
$this->contentStart();
|
$this->contentStart();
|
||||||
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
|
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
|
||||||
|
|
||||||
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
|
|
||||||
if($maxuploadsize && $maxuploadsize < $mus2)
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
||||||
else
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
|
|
||||||
$this->warningMsg($msg);
|
$this->warningMsg($msg);
|
||||||
$this->contentHeading(getMLText("add_document"));
|
$this->contentHeading(getMLText("add_document"));
|
||||||
|
|
||||||
|
|
|
@ -126,11 +126,7 @@ $(document).ready( function() {
|
||||||
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
||||||
|
|
||||||
$this->contentHeading(getMLText("linked_files"));
|
$this->contentHeading(getMLText("linked_files"));
|
||||||
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
|
|
||||||
if($maxuploadsize && $maxuploadsize < $mus2)
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
||||||
else
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
|
|
||||||
$this->warningMsg($msg);
|
$this->warningMsg($msg);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -197,25 +197,7 @@ console.log(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($enablelargefileupload) {
|
|
||||||
if($maxuploadsize) {
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
||||||
} else {
|
|
||||||
$msg = '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize");
|
|
||||||
}
|
|
||||||
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
|
|
||||||
if($maxuploadsize && $maxuploadsize < $mus2)
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
|
|
||||||
else
|
|
||||||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
|
|
||||||
|
|
||||||
if(0 && $enablelargefileupload) {
|
|
||||||
$msg .= "<p>".sprintf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folder->getID()."&showtree=".showtree())."</p>";
|
|
||||||
}
|
|
||||||
if($msg)
|
|
||||||
$this->warningMsg($msg);
|
$this->warningMsg($msg);
|
||||||
|
|
||||||
if ($document->isCheckedOut()) {
|
if ($document->isCheckedOut()) {
|
||||||
|
|
|
@ -217,11 +217,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
||||||
echo "SeedDMSUpload.setUrl('".$this->params['settings']->_httpRoot."op/op.Ajax.php');";
|
echo "SeedDMSUpload.setUrl('".$this->params['settings']->_httpRoot."op/op.Ajax.php');";
|
||||||
echo "SeedDMSUpload.setAbortBtnLabel('".getMLText("cancel")."');";
|
echo "SeedDMSUpload.setAbortBtnLabel('".getMLText("cancel")."');";
|
||||||
echo "SeedDMSUpload.setEditBtnLabel('');";
|
echo "SeedDMSUpload.setEditBtnLabel('');";
|
||||||
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
|
|
||||||
if($maxuploadsize && $maxuploadsize < $mus2)
|
|
||||||
echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);\n";
|
echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);\n";
|
||||||
else
|
|
||||||
echo "SeedDMSUpload.setMaxFileSize($mus2);\n";
|
|
||||||
echo "SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');";
|
echo "SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -470,11 +470,12 @@ $('body').on('click', '.order-btn', function(ev) {
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
$folder = $this->params['folder'];
|
$folder = $this->params['folder'];
|
||||||
|
$maxuploadsize = $this->params['maxuploadsize'];
|
||||||
|
|
||||||
$this->contentHeading(getMLText("dropupload"), true);
|
$this->contentHeading(getMLText("dropupload"), true);
|
||||||
if ($folder->getAccessMode($user) >= M_READWRITE) {
|
if ($folder->getAccessMode($user) >= M_READWRITE) {
|
||||||
?>
|
?>
|
||||||
<div id="draganddrophandler" class="well alert alert-warning" data-droptarget="folder_<?php echo $folder->getID(); ?>" data-target="<?php echo $folder->getID(); ?>" data-uploadformtoken="<?php echo createFormKey(''); ?>"><?php printMLText('drop_files_here'); ?></div>
|
<div id="draganddrophandler" class="well alert alert-warning" data-droptarget="folder_<?php echo $folder->getID(); ?>" data-target="<?php echo $folder->getID(); ?>" data-uploadformtoken="<?php echo createFormKey(''); ?>"><?php printMLText('drop_files_here', ['maxuploadsize'=>SeedDMS_Core_File::format_filesize($maxuploadsize)]); ?></div>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
$this->errorMsg(getMLText('access_denied'));
|
$this->errorMsg(getMLText('access_denied'));
|
||||||
|
|
|
@ -489,7 +489,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
|
|
||||||
if ($pageType!=null && strcasecmp($pageType, "noNav")) {
|
if ($pageType!=null && strcasecmp($pageType, "noNav")) {
|
||||||
// echo "<div class=\"fixed-top\" style=\"z-index: 1029; margin-top: 51px;\">";
|
// echo "<div class=\"fixed-top\" style=\"z-index: 1029; margin-top: 51px;\">";
|
||||||
echo "<nav class=\"navbar navbar-expand-lg bg-light navbar-light\">\n";
|
echo "<nav class=\"navbar navbar-expand-lg mb-4 bg-light navbar-light\">\n";
|
||||||
echo '<a class="navbar-brand">'.getMLText('nav_brand_'.$pageType).'</a>';
|
echo '<a class="navbar-brand">'.getMLText('nav_brand_'.$pageType).'</a>';
|
||||||
echo "<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarPageContent\" aria-controls=\"navbarMain\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n";
|
echo "<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarPageContent\" aria-controls=\"navbarMain\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n";
|
||||||
echo " <span class=\"navbar-toggler-icon\"></span>\n";
|
echo " <span class=\"navbar-toggler-icon\"></span>\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user