mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +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
|
||||
- list affected documents when transfering processes to another user
|
||||
- check for quota and duplicate content in restapi
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.22
|
||||
|
|
|
@ -183,10 +183,12 @@ class UI extends UI_Default {
|
|||
} /* }}} */
|
||||
|
||||
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->setParam('dms', $dms);
|
||||
$view->setParam('user', $user);
|
||||
$view->setParam('accessobject', $accessop);
|
||||
$view->setParam('pagetitle', $pagetitle);
|
||||
$view->setParam('errormsg', $error);
|
||||
$view->setParam('plain', $plain);
|
||||
|
|
|
@ -37,7 +37,10 @@ require_once("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, null, $user, $settings);
|
||||
|
||||
if($view) {
|
||||
$view->setParam('accessobject', $accessop);
|
||||
$view($_GET);
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -595,6 +595,13 @@ class RestapiController { /* {{{ */
|
|||
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']);
|
||||
if($mfolder) {
|
||||
$uploadedFiles = $request->getUploadedFiles();
|
||||
|
@ -692,6 +699,7 @@ class RestapiController { /* {{{ */
|
|||
function updateDocument($request, $response, $args) { /* {{{ */
|
||||
$dms = $this->container->dms;
|
||||
$userobj = $this->container->userobj;
|
||||
$settings = $this->container->config;
|
||||
|
||||
if(!$userobj) {
|
||||
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);
|
||||
}
|
||||
|
||||
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']);
|
||||
if($document) {
|
||||
if ($document->getAccessMode($userobj, 'updateDocument') >= M_READWRITE) {
|
||||
|
@ -726,7 +741,13 @@ class RestapiController { /* {{{ */
|
|||
$file_info = array_pop($uploadedFiles);
|
||||
if ($origfilename == null)
|
||||
$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);
|
||||
$userfiletype = finfo_file($finfo, $temp);
|
||||
$fileType = ".".pathinfo($origfilename, PATHINFO_EXTENSION);
|
||||
|
@ -762,7 +783,15 @@ class RestapiController { /* {{{ */
|
|||
|
||||
if(!ctype_digit($args['id']) || $args['id'] == 0) {
|
||||
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']);
|
||||
if($mfolder) {
|
||||
if ($mfolder->getAccessMode($userobj, 'addDocument') >= M_READWRITE) {
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
||||
|
||||
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) { /* {{{ */
|
||||
echo '<div class="tab-pane'.($isactive ? ' active' : '').'" id="'.$name.'">';
|
||||
$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>';
|
||||
} /* }}} */
|
||||
|
||||
|
@ -51,7 +51,7 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
|||
protected function getTextField($name, $value, $type='', $placeholder='') { /* {{{ */
|
||||
$html = '';
|
||||
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 {
|
||||
if(strlen($value) > 40)
|
||||
$class = 'input-xxlarge';
|
||||
|
@ -63,7 +63,7 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
|||
$class = 'input-medium';
|
||||
else
|
||||
$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;
|
||||
} /* }}} */
|
||||
|
@ -158,9 +158,9 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
|
|||
<td><?= getMLText($title) ?>:</td>
|
||||
<td>
|
||||
<?php if($multiple) { ?>
|
||||
<select name="<?= $name ?>[]" multiple>
|
||||
<select class="form-control" name="<?= $name ?>[]" multiple>
|
||||
<?php } else { ?>
|
||||
<select name="<?= $name ?>">
|
||||
<select class="form-control" name="<?= $name ?>">
|
||||
<?php }
|
||||
foreach($values as $i=>$value) {
|
||||
$optval = trim($isass ? $i : $value);
|
||||
|
|
Loading…
Reference in New Issue
Block a user