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

This commit is contained in:
Uwe Steinmann 2021-07-14 19:47:05 +02:00
commit 0b814df0c6
5 changed files with 23 additions and 27 deletions

View File

@ -429,7 +429,7 @@ foreach($file_ary as $file) {
$userfiletype = $tmpfiletype;
}
if (!$file["tmp_name"] && ($_POST["name"]!=""))
if ($_POST["name"]!="")
$name = trim($_POST["name"]);
else $name = utf8_basename($userfilename);

View File

@ -37,7 +37,8 @@ if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval(
$documentid = $_POST["documentid"];
$document = $dms->getDocument($documentid);
if(empty($settings->_enableCancelCheckout)) {
$checkoutstatus = $document->checkOutStatus();
if($checkoutstatus != 3 && empty($settings->_enableCancelCheckout)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("operation_disallowed"));
}

View File

@ -286,7 +286,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo " <div class=\"navbar-inner\">\n";
echo " <div class=\"container-fluid\">\n";
echo " <a href=\"".$this->params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$this->params['dms']->getRootFolder()->getId()."\">".(!empty($this->extraheader['logo']) ? '<img src="'.$this->extraheader['logo'].'">' : '<img src="'.$this->params['settings']->_httpRoot.'views/bootstrap/images/seeddms-logo.svg">')."</a>";
echo " <a class=\"brand\" href=\"".$this->params['settings']->_httpRoot."/out/out.ViewFolder.php\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</a>\n";
echo " <a class=\"brand\" href=\"".$this->params['settings']->_httpRoot."out/out.ViewFolder.php\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</a>\n";
echo " </div>\n";
echo " </div>\n";
echo "</div>\n";
@ -466,13 +466,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
if($accessobject->check_view_access('Tasks', array('action'=>'menuTasks'))) {
echo " <div id=\"menu-tasks\">";
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Tasks\" data-action=\"menuTasks\"></div>";
// echo " <ul id=\"main-menu-tasks\" class=\"nav pull-right\">\n";
// echo " <li class=\"dropdown\">\n";
// echo $this->menuTasks(array('review'=>array(), 'approval'=>array(), 'receipt'=>array(), 'revision'=>array()));
// echo " </li>\n";
// echo " </ul>\n";
echo " </div>";
//$this->addFooterJS('checkTasks();');
}
}
/* }}} End of menu tasks */
@ -611,7 +605,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
return;
} /* }}} */
protected function showNavigationBar($menuitems, $options = array()) { /* {{{ */
protected function showNavigationBar($menuitems, $options=array()) { /* {{{ */
$content = '';
$content .= "<ul".(isset($options['id']) ? ' id="'.$options['id'].'"' : '')." class=\"nav".(isset($options['right']) ? ' pull-right' : '')."\">\n";
foreach($menuitems as $menuitem) {
@ -1614,7 +1608,7 @@ $(document).ready(function() {
else
$folderid = $folder->getID();
$content = '';
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" data-target-highlight=\"choosedocsearch".$formid."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<input type=\"hidden\" class=\"fileupload-group\" id=\"".$formid."\" name=\"".$formname."\" data-target-highlight=\"choosedocsearch".$formid."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<div class=\"input-append\">\n";
$content .= "<input type=\"text\" id=\"choosedocsearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"docname".$formid."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\"".($default ? ' title="'.htmlspecialchars($default->getFolder()->getFolderPathPlain().' / '.$default->getName()).'"' : '')." />";
$content .= "<button type=\"button\" class=\"btn\" id=\"cleardocument".$form."\" data-target=\"".$formid."\"><i class=\"fa fa-remove\"></i></button>";
@ -2938,6 +2932,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
* @return string
*/
function getListRowPath($object) { /* {{{ */
if(!$object)
return '';
$belowtitle = '';
$folder = $object->getParent();
if($folder) {
@ -3234,6 +3230,9 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
$accessop = $this->params['accessobject'];
$onepage = $this->params['onepage'];
if(!$subFolder)
return '';
$owner = $subFolder->getOwner();
$comment = $subFolder->getComment();
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";

View File

@ -124,19 +124,13 @@ $(document).ready(function() {
if ($checkoutstatus = $document->checkOutStatus()) {
switch($checkoutstatus) {
case 1:
print "<div class=\"alert alert-warning\">";
printMLText("checkedout_file_has_disappeared");
print "</div>";
$this->warningMsg(getMLText("checkedout_file_has_disappeared"));
break;
case 2:
print "<div class=\"alert alert-warning\">";
printMLText("checkedout_file_has_different_version");
print "</div>";
$this->warningMsg(getMLText("checkedout_file_has_different_version"));
break;
case 3:
print "<div class=\"alert alert-warning\">";
printMLText("checkedout_file_is_unchanged");
print "</div>";
$this->warningMsg(getMLText("checkedout_file_is_unchanged"));
break;
}
}

View File

@ -327,12 +327,15 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo " <div class=\"collapse navbar-collapse\" id=\"navbarMain\">\n";
echo " <ul class=\"navbar-nav\">\n";
$menuitems = array();
/* calendar {{{ */
if ($this->params['enablecalendar'] && $accessobject->check_view_access('Calendar')) $menuitems['calendar'] = array('link'=>$this->params['settings']->_httpRoot.'out/out.Calendar.php?mode='.$this->params['calendardefaultview'], 'label'=>"calendar");
if ($this->params['user']->isAdmin()) $menuitems['admintools'] = array('link'=>$this->params['settings']->_httpRoot.'out/out.AdminTools.php', 'label'=>"admin_tools");
if($this->params['enablehelp']) {
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$menuitems['help'] = array('link'=>$this->params['settings']->_httpRoot.'out/out.Help.php?context='.$tmp[1], 'label'=>"help");
}
/* }}} End of calendar */
/* Check if hook exists because otherwise callHook() will override $menuitems */
if($this->hasHook('globalNavigationBar'))
$menuitems = $this->callHook('globalNavigationBar', $menuitems);
@ -356,13 +359,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
if($accessobject->check_view_access('Tasks', array('action'=>'menuTasks'))) {
echo " <div id=\"menu-tasks\" class=\"ml-auto\">";
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Tasks\" data-action=\"menuTasks\"></div>";
// echo " <ul id=\"main-menu-tasks\" class=\"navbar-nav ml-auto\">\n";
// echo " <li class=\"nav-item dropdown\">\n";
// echo $this->menuTasks(array('review'=>array(), 'approval'=>array(), 'receipt'=>array(), 'revision'=>array()));
// echo " </li>\n";
// echo " </ul>\n";
echo " </div>";
//$this->addFooterJS('checkTasks();');
}
}
/* }}} End of menu tasks */
@ -1554,7 +1551,7 @@ $(document).ready(function() {
else
$folderid = $folder->getID();
$content = '';
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" data-target-highlight=\"choosedocsearch".$formid."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<input type=\"hidden\" class=\"fileupload-group\" id=\"".$formid."\" name=\"".$formname."\" data-target-highlight=\"choosedocsearch".$formid."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<div class=\"input-group\">\n";
$content .= "<input class=\"form-control\" type=\"text\" id=\"choosedocsearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"docname".$formid."\"value=\"" . (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />";
$content .= '<div class="input-group-append">';
@ -2914,6 +2911,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
* @return string
*/
function getListRowPath($object) { /* {{{ */
if(!$object)
return '';
$belowtitle = '';
$folder = $object->getParent();
if($folder) {
@ -3182,6 +3181,9 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
$accessop = $this->params['accessobject'];
$onepage = $this->params['onepage'];
if(!$subFolder)
return '';
$owner = $subFolder->getOwner();
$comment = $subFolder->getComment();
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";