mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 21:16:07 +00:00
do not allow to select category if no categories exists
This commit is contained in:
parent
14d8a1bd91
commit
004af591a9
|
@ -223,23 +223,25 @@ console.log(params);
|
||||||
getMLText("keywords"),
|
getMLText("keywords"),
|
||||||
$this->getKeywordChooserHtml('adddocform')
|
$this->getKeywordChooserHtml('adddocform')
|
||||||
);
|
);
|
||||||
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
|
||||||
$options = array();
|
|
||||||
$categories = $dms->getDocumentCategories();
|
$categories = $dms->getDocumentCategories();
|
||||||
foreach($categories as $category) {
|
if($categories) {
|
||||||
$options[] = array($category->getID(), $category->getName());
|
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
||||||
}
|
$options = array();
|
||||||
$this->formField(
|
foreach($categories as $category) {
|
||||||
getMLText("categories"),
|
$options[] = array($category->getID(), $category->getName());
|
||||||
array(
|
}
|
||||||
'element'=>'select',
|
$this->formField(
|
||||||
'class'=>'chzn-select',
|
getMLText("categories"),
|
||||||
'name'=>'categories[]',
|
array(
|
||||||
'multiple'=>true,
|
'element'=>'select',
|
||||||
'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))),
|
'class'=>'chzn-select',
|
||||||
'options'=>$options
|
'name'=>'categories[]',
|
||||||
)
|
'multiple'=>true,
|
||||||
);
|
'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))),
|
||||||
|
'options'=>$options
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!$nodocumentformfields || !in_array('sequence', $nodocumentformfields)) {
|
if(!$nodocumentformfields || !in_array('sequence', $nodocumentformfields)) {
|
||||||
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s')).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
|
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s')).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
|
||||||
|
|
|
@ -134,35 +134,37 @@ $(document).ready( function() {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
|
||||||
$options = array();
|
|
||||||
$categories = $dms->getDocumentCategories();
|
$categories = $dms->getDocumentCategories();
|
||||||
foreach($categories as $category) {
|
if($categories) {
|
||||||
$options[] = array($category->getID(), $category->getName(), in_array($category, $document->getCategories()));
|
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
||||||
}
|
$options = array();
|
||||||
$this->formField(
|
foreach($categories as $category) {
|
||||||
getMLText("categories"),
|
$options[] = array($category->getID(), $category->getName(), in_array($category, $document->getCategories()));
|
||||||
array(
|
}
|
||||||
'element'=>'select',
|
|
||||||
'class'=>'chzn-select',
|
|
||||||
'name'=>'categories[]',
|
|
||||||
'multiple'=>true,
|
|
||||||
'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))),
|
|
||||||
'options'=>$options
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$categories = $document->getCategories();
|
|
||||||
foreach($categories as $category) {
|
|
||||||
$this->formField(
|
$this->formField(
|
||||||
null,
|
getMLText("categories"),
|
||||||
array(
|
array(
|
||||||
'element'=>'input',
|
'element'=>'select',
|
||||||
'type'=>'hidden',
|
'class'=>'chzn-select',
|
||||||
'name'=>'categories[]',
|
'name'=>'categories[]',
|
||||||
'value'=>htmlspecialchars($category->getId()),
|
'multiple'=>true,
|
||||||
|
'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))),
|
||||||
|
'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)) {
|
if(!$nodocumentformfields || !in_array('expires', $nodocumentformfields)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user