mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
add new config variable noDocumentFormFields
used for hiding some fields like comment, keywords, categories, ...
This commit is contained in:
parent
058fc1217e
commit
c332e0393b
|
@ -70,6 +70,9 @@ class Settings { /* {{{ */
|
|||
var $_defaultAccessDocs = '';
|
||||
// Strict form checking
|
||||
var $_strictFormCheck = false;
|
||||
// list of form fields which are visible by default but can be explixitly
|
||||
// turn off (comment, keywords, categories, sequence, expiration, owner
|
||||
var $_noDocumentFormFields = array();
|
||||
// Path to where SeedDMS is located
|
||||
var $_rootDir = null;
|
||||
// Path to SeedDMS_Core
|
||||
|
@ -455,6 +458,8 @@ class Settings { /* {{{ */
|
|||
$node = $xml->xpath('/configuration/site/edition');
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_strictFormCheck = Settings::boolVal($tab["strictFormCheck"]);
|
||||
if(trim(strval($tab["noDocumentFormFields"])))
|
||||
$this->_noDocumentFormFields = explode(',',strval($tab["noDocumentFormFields"]));
|
||||
$this->setViewOnlineFileTypesFromString(strval($tab["viewOnlineFileTypes"]));
|
||||
$this->setEditOnlineFileTypesFromString(strval($tab["editOnlineFileTypes"]));
|
||||
$this->_enableConverting = Settings::boolVal($tab["enableConverting"]);
|
||||
|
@ -802,6 +807,7 @@ class Settings { /* {{{ */
|
|||
// XML Path: /configuration/site/edition
|
||||
$node = $this->getXMLNode($xml, '/configuration/site', 'edition');
|
||||
$this->setXMLAttributValue($node, "strictFormCheck", $this->_strictFormCheck);
|
||||
$this->setXMLAttributValue($node, "noDocumentFormFields", implode(',', $this->_noDocumentFormFields));
|
||||
$this->setXMLAttributValue($node, "viewOnlineFileTypes", $this->getViewOnlineFileTypesToString());
|
||||
$this->setXMLAttributValue($node, "editOnlineFileTypes", $this->getEditOnlineFileTypesToString());
|
||||
$this->setXMLAttributValue($node, "enableConverting", $this->_enableConverting);
|
||||
|
|
|
@ -76,6 +76,10 @@ if ($action == "saveSettings")
|
|||
|
||||
// SETTINGS - SITE - EDITION
|
||||
$settings->_strictFormCheck = getBoolValue("strictFormCheck");
|
||||
if(empty($_POST["noDocumentFormFields"]))
|
||||
$settings->_noDocumentFormFields = array();
|
||||
else
|
||||
$settings->_noDocumentFormFields = $_POST["noDocumentFormFields"];
|
||||
$settings->setViewOnlineFileTypesFromString($_POST["viewOnlineFileTypes"]);
|
||||
$settings->setEditOnlineFileTypesFromString($_POST["editOnlineFileTypes"]);
|
||||
$settings->_enableConverting = getBoolValue("enableConverting");
|
||||
|
|
|
@ -56,6 +56,7 @@ if($settings->_quota > 0) {
|
|||
if($view) {
|
||||
$view->setParam('folder', $folder);
|
||||
$view->setParam('strictformcheck', $settings->_strictFormCheck);
|
||||
$view->setParam('nodocumentformfields', $settings->_noDocumentFormFields);
|
||||
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
|
||||
$view->setParam('enablemultiupload', $settings->_enableMultiUpload);
|
||||
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
|
||||
|
|
|
@ -59,6 +59,7 @@ $accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
|||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'attrdefs'=>$attrdefs, 'strictformcheck'=>$settings->_strictFormCheck, 'orderby'=>$settings->_sortFoldersDefault));
|
||||
if($view) {
|
||||
$view->setParam('nodocumentformfields', $settings->_noDocumentFormFields);
|
||||
$view->setParam('defaultposition', $settings->_defaultDocPosition);
|
||||
$view->setParam('accessobject', $accessop);
|
||||
$view($_GET);
|
||||
|
|
|
@ -154,6 +154,7 @@ $(document).ready(function() {
|
|||
$enableownerrevapp = $this->params['enableownerrevapp'];
|
||||
$enableselfrevapp = $this->params['enableselfrevapp'];
|
||||
$strictformcheck = $this->params['strictformcheck'];
|
||||
$nodocumentformfields = $this->params['nodocumentformfields'];
|
||||
$dropfolderdir = $this->params['dropfolderdir'];
|
||||
$dropfolderfile = $this->params['dropfolderfile'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
|
@ -202,6 +203,7 @@ $(document).ready(function() {
|
|||
'required'=>false
|
||||
)
|
||||
);
|
||||
if(!$nodocumentformfields || !in_array('comment', $nodocumentformfields))
|
||||
$this->formField(
|
||||
getMLText("comment"),
|
||||
array(
|
||||
|
@ -212,10 +214,12 @@ $(document).ready(function() {
|
|||
'required'=>$strictformcheck
|
||||
)
|
||||
);
|
||||
if(!$nodocumentformfields || !in_array('keywords', $nodocumentformfields))
|
||||
$this->formField(
|
||||
getMLText("keywords"),
|
||||
$this->getKeywordChooserHtml('form1')
|
||||
);
|
||||
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
||||
$options = array();
|
||||
$categories = $dms->getDocumentCategories();
|
||||
foreach($categories as $category) {
|
||||
|
@ -232,7 +236,11 @@ $(document).ready(function() {
|
|||
'options'=>$options
|
||||
)
|
||||
);
|
||||
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s')).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('sequence', $nodocumentformfields)) {
|
||||
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s')).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('expires', $nodocumentformfields)) {
|
||||
if($presetexpiration) {
|
||||
if(!($expts = strtotime($presetexpiration)))
|
||||
$expts = false;
|
||||
|
@ -259,6 +267,7 @@ $(document).ready(function() {
|
|||
getMLText("expires"),
|
||||
$this->getDateChooser(($expts ? date('Y-m-d', $expts) : ''), "expdate", $this->params['session']->getLanguage())
|
||||
);
|
||||
}
|
||||
if($user->isAdmin()) {
|
||||
$options = array();
|
||||
$allUsers = $dms->getAllUsers($sortusersinlist);
|
||||
|
|
|
@ -71,6 +71,7 @@ $(document).ready( function() {
|
|||
$document = $this->params['document'];
|
||||
$attrdefs = $this->params['attrdefs'];
|
||||
$strictformcheck = $this->params['strictformcheck'];
|
||||
$nodocumentformfields = $this->params['nodocumentformfields'];
|
||||
$orderby = $this->params['orderby'];
|
||||
|
||||
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/validate/jquery.validate.js"></script>'."\n", 'js');
|
||||
|
@ -101,21 +102,46 @@ $(document).ready( function() {
|
|||
'required'=>true
|
||||
)
|
||||
);
|
||||
$this->formField(
|
||||
getMLText("comment"),
|
||||
array(
|
||||
'element'=>'textarea',
|
||||
'name'=>'comment',
|
||||
'rows'=>4,
|
||||
'cols'=>80,
|
||||
'value'=>htmlspecialchars($document->getComment()),
|
||||
'required'=>$strictformcheck
|
||||
)
|
||||
);
|
||||
$this->formField(
|
||||
getMLText("keywords"),
|
||||
$this->getKeywordChooserHtml('form1', $document->getKeywords())
|
||||
);
|
||||
if(!$nodocumentformfields || !in_array('comment', $nodocumentformfields)) {
|
||||
$this->formField(
|
||||
getMLText("comment"),
|
||||
array(
|
||||
'element'=>'textarea',
|
||||
'name'=>'comment',
|
||||
'rows'=>4,
|
||||
'cols'=>80,
|
||||
'value'=>htmlspecialchars($document->getComment()),
|
||||
'required'=>$strictformcheck
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$this->formField(
|
||||
null,
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'hidden',
|
||||
'name'=>'comment',
|
||||
'value'=>htmlspecialchars($document->getComment()),
|
||||
)
|
||||
);
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('keywords', $nodocumentformfields)) {
|
||||
$this->formField(
|
||||
getMLText("keywords"),
|
||||
$this->getKeywordChooserHtml('form1', $document->getKeywords())
|
||||
);
|
||||
} else {
|
||||
$this->formField(
|
||||
null,
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'hidden',
|
||||
'name'=>'keywords',
|
||||
'value'=>htmlspecialchars($document->getKeywords()),
|
||||
)
|
||||
);
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
||||
$options = array();
|
||||
$categories = $dms->getDocumentCategories();
|
||||
foreach($categories as $category) {
|
||||
|
@ -132,6 +158,21 @@ $(document).ready( function() {
|
|||
'options'=>$options
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$categories = $document->getCategories();
|
||||
foreach($categories as $category) {
|
||||
$this->formField(
|
||||
null,
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'hidden',
|
||||
'name'=>'categories[]',
|
||||
'value'=>htmlspecialchars($category->getId()),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('expires', $nodocumentformfields)) {
|
||||
$options = array();
|
||||
$options[] = array('never', getMLText('does_not_expire'));
|
||||
$options[] = array('date', getMLText('expire_by_date'), $expdate != '');
|
||||
|
@ -152,9 +193,22 @@ $(document).ready( function() {
|
|||
getMLText("expires"),
|
||||
$this->getDateChooser($expdate, "expdate", $this->params['session']->getLanguage())
|
||||
);
|
||||
} else {
|
||||
$this->formField(
|
||||
null,
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'hidden',
|
||||
'name'=>'expdate',
|
||||
'value'=>$expdate,
|
||||
)
|
||||
);
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('sequence', $nodocumentformfields)) {
|
||||
if ($folder->getAccessMode($user) > M_READ) {
|
||||
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s'), $document->getID()).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
|
||||
}
|
||||
}
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
|
||||
|
|
|
@ -286,6 +286,7 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
|
|||
-->
|
||||
<?php $this->showConfigHeadline('settings_Edition'); ?>
|
||||
<?php $this->showConfigCheckbox('settings_strictFormCheck', 'strictFormCheck'); ?>
|
||||
<?php $this->showConfigOption('settings_noDocumentFormFields', 'noDocumentFormFields', array('comment', 'keywords', 'categories', 'sequence', 'expires', 'version_comment'), true, true); ?>
|
||||
<?php $this->showConfigText('settings_viewOnlineFileTypes', 'viewOnlineFileTypes', 'array'); ?>
|
||||
<?php $this->showConfigText('settings_editOnlineFileTypes', 'editOnlineFileTypes', 'array'); ?>
|
||||
<?php $this->showConfigCheckbox('settings_enableConverting', 'enableConverting'); ?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user