diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index e269ebb57..cef929ed9 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -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); diff --git a/op/op.CancelCheckOut.php b/op/op.CancelCheckOut.php index bed1b5013..787a9ea84 100644 --- a/op/op.CancelCheckOut.php +++ b/op/op.CancelCheckOut.php @@ -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")); } diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index c3f545ff5..8412bbcd6 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -286,7 +286,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo "
\n"; echo "
\n"; echo " params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$this->params['dms']->getRootFolder()->getId()."\">".(!empty($this->extraheader['logo']) ? '' : '').""; - echo " params['settings']->_httpRoot."/out/out.ViewFolder.php\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."\n"; + echo " params['settings']->_httpRoot."out/out.ViewFolder.php\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."\n"; echo "
\n"; echo "
\n"; echo "\n"; @@ -466,13 +466,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; if($accessobject->check_view_access('Tasks', array('action'=>'menuTasks'))) { echo "
"; echo "
"; - // echo " \n"; echo "
"; - //$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 .= "\n"; foreach($menuitems as $menuitem) { @@ -1614,7 +1608,7 @@ $(document).ready(function() { else $folderid = $folder->getID(); $content = ''; - $content .= "getID() : "") ."\">"; + $content .= "getID() : "") ."\">"; $content .= "
\n"; $content .= "getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\"".($default ? ' title="'.htmlspecialchars($default->getFolder()->getFolderPathPlain().' / '.$default->getName()).'"' : '')." />"; $content .= ""; @@ -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) . "..."; diff --git a/views/bootstrap/class.CheckInDocument.php b/views/bootstrap/class.CheckInDocument.php index 904596c8b..8fe539ab5 100644 --- a/views/bootstrap/class.CheckInDocument.php +++ b/views/bootstrap/class.CheckInDocument.php @@ -124,19 +124,13 @@ $(document).ready(function() { if ($checkoutstatus = $document->checkOutStatus()) { switch($checkoutstatus) { case 1: - print "
"; - printMLText("checkedout_file_has_disappeared"); - print "
"; + $this->warningMsg(getMLText("checkedout_file_has_disappeared")); break; case 2: - print "
"; - printMLText("checkedout_file_has_different_version"); - print "
"; + $this->warningMsg(getMLText("checkedout_file_has_different_version")); break; case 3: - print "
"; - printMLText("checkedout_file_is_unchanged"); - print "
"; + $this->warningMsg(getMLText("checkedout_file_is_unchanged")); break; } } diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 1690c5ba1..14092287f 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -327,12 +327,15 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo "
\n"; echo "
    \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 "
    "; echo "
    "; - // echo "
      \n"; - // echo "
    • \n"; - // echo $this->menuTasks(array('review'=>array(), 'approval'=>array(), 'receipt'=>array(), 'revision'=>array())); - // echo "
    • \n"; - // echo "
    \n"; echo "
    "; - //$this->addFooterJS('checkTasks();'); } } /* }}} End of menu tasks */ @@ -1554,7 +1551,7 @@ $(document).ready(function() { else $folderid = $folder->getID(); $content = ''; - $content .= "getID() : "") ."\">"; + $content .= "getID() : "") ."\">"; $content .= "
    \n"; $content .= "getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />"; $content .= '
    '; @@ -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) . "...";