mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
4a23c1df86
|
@ -203,6 +203,7 @@
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
- output path of parent folder in many document/folder lists
|
- output path of parent folder in many document/folder lists
|
||||||
- list affected documents when transfering processes to another user
|
- list affected documents when transfering processes to another user
|
||||||
|
- check for quota and duplicate content in restapi
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.22
|
Changes in version 5.1.22
|
||||||
|
|
|
@ -183,10 +183,12 @@ class UI extends UI_Default {
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
static function exitError($pagetitle, $error, $noexit=false, $plain=false) {
|
static function exitError($pagetitle, $error, $noexit=false, $plain=false) {
|
||||||
global $theme, $dms, $user;
|
global $theme, $dms, $user, $settings;
|
||||||
|
$accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings);
|
||||||
$view = UI::factory($theme, 'ErrorDlg');
|
$view = UI::factory($theme, 'ErrorDlg');
|
||||||
$view->setParam('dms', $dms);
|
$view->setParam('dms', $dms);
|
||||||
$view->setParam('user', $user);
|
$view->setParam('user', $user);
|
||||||
|
$view->setParam('accessobject', $accessop);
|
||||||
$view->setParam('pagetitle', $pagetitle);
|
$view->setParam('pagetitle', $pagetitle);
|
||||||
$view->setParam('errormsg', $error);
|
$view->setParam('errormsg', $error);
|
||||||
$view->setParam('plain', $plain);
|
$view->setParam('plain', $plain);
|
||||||
|
|
|
@ -37,7 +37,10 @@ require_once("inc/inc.Authentication.php");
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||||
|
|
||||||
|
$accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings);
|
||||||
|
|
||||||
if($view) {
|
if($view) {
|
||||||
|
$view->setParam('accessobject', $accessop);
|
||||||
$view($_GET);
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -595,6 +595,13 @@ class RestapiController { /* {{{ */
|
||||||
return $response->withJson(array('success'=>false, 'message'=>'No parent folder id given', 'data'=>''), 400);
|
return $response->withJson(array('success'=>false, 'message'=>'No parent folder id given', 'data'=>''), 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($settings->_quota > 0) {
|
||||||
|
$remain = checkQuota($userobj);
|
||||||
|
if ($remain < 0) {
|
||||||
|
return $response->withJson(array('success'=>false, 'message'=>'Quota exceeded', 'data'=>''), 400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$mfolder = $dms->getFolder($args['id']);
|
$mfolder = $dms->getFolder($args['id']);
|
||||||
if($mfolder) {
|
if($mfolder) {
|
||||||
$uploadedFiles = $request->getUploadedFiles();
|
$uploadedFiles = $request->getUploadedFiles();
|
||||||
|
@ -692,6 +699,7 @@ class RestapiController { /* {{{ */
|
||||||
function updateDocument($request, $response, $args) { /* {{{ */
|
function updateDocument($request, $response, $args) { /* {{{ */
|
||||||
$dms = $this->container->dms;
|
$dms = $this->container->dms;
|
||||||
$userobj = $this->container->userobj;
|
$userobj = $this->container->userobj;
|
||||||
|
$settings = $this->container->config;
|
||||||
|
|
||||||
if(!$userobj) {
|
if(!$userobj) {
|
||||||
return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403);
|
return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403);
|
||||||
|
@ -701,6 +709,13 @@ class RestapiController { /* {{{ */
|
||||||
return $response->withJson(array('success'=>false, 'message'=>'No document id given', 'data'=>''), 400);
|
return $response->withJson(array('success'=>false, 'message'=>'No document id given', 'data'=>''), 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($settings->_quota > 0) {
|
||||||
|
$remain = checkQuota($userobj);
|
||||||
|
if ($remain < 0) {
|
||||||
|
return $response->withJson(array('success'=>false, 'message'=>'Quota exceeded', 'data'=>''), 400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$document = $dms->getDocument($args['id']);
|
$document = $dms->getDocument($args['id']);
|
||||||
if($document) {
|
if($document) {
|
||||||
if ($document->getAccessMode($userobj, 'updateDocument') >= M_READWRITE) {
|
if ($document->getAccessMode($userobj, 'updateDocument') >= M_READWRITE) {
|
||||||
|
@ -726,7 +741,13 @@ class RestapiController { /* {{{ */
|
||||||
$file_info = array_pop($uploadedFiles);
|
$file_info = array_pop($uploadedFiles);
|
||||||
if ($origfilename == null)
|
if ($origfilename == null)
|
||||||
$origfilename = $file_info->getClientFilename();
|
$origfilename = $file_info->getClientFilename();
|
||||||
$temp = $file_info->file;
|
$temp = $file_info->file;
|
||||||
|
|
||||||
|
/* Check if the uploaded file is identical to last version */
|
||||||
|
$lc = $document->getLatestContent();
|
||||||
|
if($lc->getChecksum() == SeedDMS_Core_File::checksum($temp)) {
|
||||||
|
return $response->withJson(array('success'=>false, 'message'=>'Uploaded file identical to last version', 'data'=>''), 400);
|
||||||
|
}
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$userfiletype = finfo_file($finfo, $temp);
|
$userfiletype = finfo_file($finfo, $temp);
|
||||||
$fileType = ".".pathinfo($origfilename, PATHINFO_EXTENSION);
|
$fileType = ".".pathinfo($origfilename, PATHINFO_EXTENSION);
|
||||||
|
@ -762,7 +783,15 @@ class RestapiController { /* {{{ */
|
||||||
|
|
||||||
if(!ctype_digit($args['id']) || $args['id'] == 0) {
|
if(!ctype_digit($args['id']) || $args['id'] == 0) {
|
||||||
return $response->withJson(array('success'=>false, 'message'=>'No document id given', 'data'=>''), 400);
|
return $response->withJson(array('success'=>false, 'message'=>'No document id given', 'data'=>''), 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($settings->_quota > 0) {
|
||||||
|
$remain = checkQuota($userobj);
|
||||||
|
if ($remain < 0) {
|
||||||
|
return $response->withJson(array('success'=>false, 'message'=>'Quota exceeded', 'data'=>''), 400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$mfolder = $dms->getFolder($args['id']);
|
$mfolder = $dms->getFolder($args['id']);
|
||||||
if($mfolder) {
|
if($mfolder) {
|
||||||
if ($mfolder->getAccessMode($userobj, 'addDocument') >= M_READWRITE) {
|
if ($mfolder->getAccessMode($userobj, 'addDocument') >= M_READWRITE) {
|
||||||
|
|
|
@ -32,13 +32,13 @@
|
||||||
class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
||||||
|
|
||||||
protected function showPaneHeader($name, $title, $isactive) { /* {{{ */
|
protected function showPaneHeader($name, $title, $isactive) { /* {{{ */
|
||||||
echo '<li class="'.($isactive ? 'active' : '').'"><a data-target="#'.$name.'" data-toggle="tab">'.$title.'</a></li>'."\n";
|
echo '<li class="nav-item '.($isactive ? 'active' : '').'"><a class="nav-link '.($isactive ? 'active' : '').'" data-target="#'.$name.'" data-toggle="tab">'.$title.'</a></li>'."\n";
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
protected function showStartPaneContent($name, $isactive) { /* {{{ */
|
protected function showStartPaneContent($name, $isactive) { /* {{{ */
|
||||||
echo '<div class="tab-pane'.($isactive ? ' active' : '').'" id="'.$name.'">';
|
echo '<div class="tab-pane'.($isactive ? ' active' : '').'" id="'.$name.'">';
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
echo '<table class="table-condensed" style="table-layout: fixed;">';
|
echo '<table class="table-condensed table-sm" style="table-layout: fixed;">';
|
||||||
echo '<tr><td width="20%"></td><td width="80%"></td></tr>';
|
echo '<tr><td width="20%"></td><td width="80%"></td></tr>';
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
||||||
protected function getTextField($name, $value, $type='', $placeholder='') { /* {{{ */
|
protected function getTextField($name, $value, $type='', $placeholder='') { /* {{{ */
|
||||||
$html = '';
|
$html = '';
|
||||||
if($type == 'textarea' || ($type != 'password' && strlen($value) > 80))
|
if($type == 'textarea' || ($type != 'password' && strlen($value) > 80))
|
||||||
$html .= '<textarea class="input-xxlarge" name="'.$name.'">'.$value.'</textarea>';
|
$html .= '<textarea class="form-control input-xxlarge" name="'.$name.'">'.$value.'</textarea>';
|
||||||
else {
|
else {
|
||||||
if(strlen($value) > 40)
|
if(strlen($value) > 40)
|
||||||
$class = 'input-xxlarge';
|
$class = 'input-xxlarge';
|
||||||
|
@ -63,7 +63,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="text"').' class="'.$class.'" name="'.$name.'" value="'.$value.'" placeholder="'.$placeholder.'"/>';
|
$html .= '<input '.($type=='password' ? 'type="password"' : 'type="text"').' class="form-control '.$class.'" name="'.$name.'" value="'.$value.'" placeholder="'.$placeholder.'"/>';
|
||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
@ -158,9 +158,9 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
||||||
<td><?= getMLText($title) ?>:</td>
|
<td><?= getMLText($title) ?>:</td>
|
||||||
<td>
|
<td>
|
||||||
<?php if($multiple) { ?>
|
<?php if($multiple) { ?>
|
||||||
<select name="<?= $name ?>[]" multiple>
|
<select class="form-control" name="<?= $name ?>[]" multiple>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<select name="<?= $name ?>">
|
<select class="form-control" name="<?= $name ?>">
|
||||||
<?php }
|
<?php }
|
||||||
foreach($values as $i=>$value) {
|
foreach($values as $i=>$value) {
|
||||||
$optval = trim($isass ? $i : $value);
|
$optval = trim($isass ? $i : $value);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user