edit comment and sequence of folders can be turned off

This commit is contained in:
Uwe Steinmann 2021-09-22 09:59:33 +02:00
parent 3e1dcc3c75
commit e95b5a971e
3 changed files with 32 additions and 15 deletions

View File

@ -5,6 +5,8 @@
- major overhaul of notifications - major overhaul of notifications
- check view access for FolderAccess and DocumentAccess - check view access for FolderAccess and DocumentAccess
- more settings to disable import and download of extensions - more settings to disable import and download of extensions
- add new configuration for excluding sequence and comment when creating
a folder
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.23 Changes in version 5.1.23

View File

@ -54,6 +54,7 @@ if($view) {
$view->setParam('folder', $folder); $view->setParam('folder', $folder);
$view->setParam('attrdefs', $attrdefs); $view->setParam('attrdefs', $attrdefs);
$view->setParam('strictformcheck', $settings->_strictFormCheck); $view->setParam('strictformcheck', $settings->_strictFormCheck);
$view->setParam('nofolderformfields', $settings->_noFolderFormFields);
$view->setParam('rootfolderid', $settings->_rootFolderID); $view->setParam('rootfolderid', $settings->_rootFolderID);
$view->setParam('orderby', $settings->_sortFoldersDefault); $view->setParam('orderby', $settings->_sortFoldersDefault);
$view->setParam('accessobject', $accessop); $view->setParam('accessobject', $accessop);

View File

@ -54,6 +54,7 @@ $(document).ready(function() {
$attrdefs = $this->params['attrdefs']; $attrdefs = $this->params['attrdefs'];
$rootfolderid = $this->params['rootfolderid']; $rootfolderid = $this->params['rootfolderid'];
$strictformcheck = $this->params['strictformcheck']; $strictformcheck = $this->params['strictformcheck'];
$nofolderformfields = $this->params['nofolderformfields'];
$orderby = $this->params['orderby']; $orderby = $this->params['orderby'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js'); $this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
@ -81,22 +82,35 @@ $(document).ready(function() {
'required'=>true 'required'=>true
) )
); );
$this->formField( if(!$nofolderformfields || !in_array('comment', $nofolderformfields)) {
getMLText("comment"), $this->formField(
array( getMLText("comment"),
'element'=>'textarea', array(
'name'=>'comment', 'element'=>'textarea',
'rows'=>4, 'name'=>'comment',
'cols'=>80, 'rows'=>4,
'value'=>htmlspecialchars($folder->getComment()), 'cols'=>80,
'required'=>$strictformcheck 'value'=>htmlspecialchars($folder->getComment()),
) 'required'=>$strictformcheck
); )
$parent = ($folder->getID() == $rootfolderid) ? false : $folder->getParent(); );
if ($parent && $parent->getAccessMode($user) > M_READ) { } else {
$this->formField(getMLText("sequence"), $this->getSequenceChooser($parent->getSubFolders('s'), $folder->getID()).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : '')); $this->formField(
null,
array(
'element'=>'input',
'type'=>'hidden',
'name'=>'comment',
'value'=>htmlspecialchars($folder->getComment()),
)
);
}
$parent = ($folder->getID() == $rootfolderid) ? false : $folder->getParent();
if(!$nofolderformfields || !in_array('sequence', $nofolderformfields)) {
if ($parent && $parent->getAccessMode($user) > M_READ) {
$this->formField(getMLText("sequence"), $this->getSequenceChooser($parent->getSubFolders('s'), $folder->getID()).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
}
} }
if($attrdefs) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
$arr = $this->callHook('editFolderAttribute', $folder, $attrdef); $arr = $this->callHook('editFolderAttribute', $folder, $attrdef);