Merge branch 'develop' into seeddms-5.1.x

This commit is contained in:
Uwe Steinmann 2016-04-22 12:59:04 +02:00
commit 6930202349
6 changed files with 35 additions and 26 deletions

View File

@ -48,9 +48,15 @@ class SeedDMS_Download_Mgr {
function __construct($tmpdir = '') {
$this->tmpdir = $tmpdir;
$this->items = array();
$this->header = array('Dokumenten-Nr.', 'Dokumentenname', 'Dateiname', 'Status', 'Int. Version', 'Prüfer', 'Prüfdatum', 'Prüfkommentar', 'Prüfstatus', 'Freigeber', 'Freigabedatum', 'Freigabekommentar', 'Freigabestatus');
$this->extracols = array();
$this->extraheader = array();
}
public function addHeader($extraheader) { /* {{{ */
$this->extraheader = $extraheader;
} /* }}} */
public function addItem($item, $extracols) { /* {{{ */
$this->items[$item->getID()] = $item;
$this->extracols[$item->getID()] = $extracols;
@ -64,19 +70,10 @@ class SeedDMS_Download_Mgr {
$i = 1;
$col = 0;
$sheet->setCellValueByColumnAndRow($col++, $i, 'Dokumenten-Nr.');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Dokumentenname');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Dateiname');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Status');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Int. Version');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Prüfer');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Prüfdatum');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Prüfkommentar');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Prüfstatus');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Freigeber');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Freigabedatum');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Freigabekommentar');
$sheet->setCellValueByColumnAndRow($col++, $i, 'Freigabestatus');
foreach($this->header as $h)
$sheet->setCellValueByColumnAndRow($col++, $i, $h);
foreach($this->extraheader as $h)
$sheet->setCellValueByColumnAndRow($col++, $i, $h);
$i++;
foreach($items as $item) {
$document = $item->getDocument();

View File

@ -61,12 +61,12 @@ if($settings->_quota > 0) {
}
}
$comment = $_POST["comment"];
$version_comment = $_POST["version_comment"];
$comment = trim($_POST["comment"]);
$version_comment = trim($_POST["version_comment"]);
if($version_comment == "" && isset($_POST["use_comment"]))
$version_comment = $comment;
$keywords = $_POST["keywords"];
$keywords = trim($_POST["keywords"]);
$categories = isset($_POST["categories"]) ? $_POST["categories"] : null;
$cats = array();
if($categories) {
@ -354,7 +354,7 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
}
if ((count($_FILES["userfile"]["tmp_name"])==1)&&($_POST["name"]!=""))
$name = $_POST["name"];
$name = trim($_POST["name"]);
else $name = basename($userfilename);
/* Check if name already exists in the folder */

View File

@ -52,9 +52,9 @@ if($document->isLocked()) {
}
}
$name = isset($_POST['name']) ? $_POST["name"] : "";
$comment = isset($_POST['comment']) ? $_POST["comment"] : "";
$keywords = isset($_POST["keywords"]) ? $_POST["keywords"] : "";
$name = isset($_POST['name']) ? trim($_POST["name"]) : "";
$comment = isset($_POST['comment']) ? trim($_POST["comment"]) : "";
$keywords = isset($_POST["keywords"]) ? trim($_POST["keywords"]) : "";
if(isset($_POST['categoryidform1'])) {
$categories = explode(',', preg_replace('/[^0-9,]+/', '', $_POST["categoryidform1"]));
} elseif(isset($_POST["categories"])) {

View File

@ -58,7 +58,8 @@ if($settings->_libraryFolder) {
}
if ($libfolder->getAccessMode($user) < M_READ) {
UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($libfolder->getName()))), getMLText("access_denied"));
$libfolder = null;
// UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($libfolder->getName()))), getMLText("access_denied"));
}
} else {
$libfolder = null;

View File

@ -28,6 +28,10 @@ include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassAccessOperation.php");
include("../inc/inc.Authentication.php");
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
@ -57,12 +61,17 @@ if($settings->_quota > 0) {
$folder = $document->getFolder();
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp, 'dropfolderdir'=>$settings->_dropFolderDir, 'workflowmode'=>$settings->_workflowMode, 'presetexpiration'=>$settings->_presetExpirationDate));
if($view) {
$view->setParam('folder', $folder);
$view->setParam('document', $document);
$view->setParam('strictformcheck', $settings->_strictFormCheck);
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);
$view->setParam('dropfolderdir', $settings->_dropFolderDir);
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('presetexpiration', $settings->_presetExpirationDate);
$view->setParam('accessobject', $accessop);
$view($_GET);
exit;

View File

@ -69,6 +69,8 @@ $(document).ready( function() {
include("../inc/inc.ClassDownloadMgr.php");
$downmgr = new SeedDMS_Download_Mgr();
if($extraheader = $this->callHook('extraDownloadHeader'))
$downmgr->addHeader($extraheader);
foreach($entries as $entry) {
if(get_class($entry) == $dms->getClassname('document')) {
$extracols = $this->callHook('extraDownloadColumns', $entry);