diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index 10f18e780..8e1ef93ae 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -88,107 +88,93 @@ $(document).ready( function() { else $expdate = ''; ?> -
+ - - - - - - - - - - - - - - - - - - - - - - > - - - formField( + getMLText("name"), + array( + 'element'=>'input', + 'type'=>'text', + 'name'=>'name', + 'value'=>htmlspecialchars($document->getName()), + '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()) + ); + $options = array(); + $categories = $dms->getDocumentCategories(); + foreach($categories as $category) { + $options[] = array($category->getID(), $category->getName(), in_array($category, $document->getCategories())); + } + $this->formField( + getMLText("categories"), + 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 + ) + ); + $options = array(); + $options[] = array('never', getMLText('does_not_expire')); + $options[] = array('date', getMLText('expire_by_date'), $expdate != ''); + $options[] = array('1w', getMLText('expire_in_1w')); + $options[] = array('1m', getMLText('expire_in_1m')); + $options[] = array('1y', getMLText('expire_in_1y')); + $options[] = array('2y', getMLText('expire_in_2y')); + $this->formField( + getMLText("preset_expires"), + array( + 'element'=>'select', + 'id'=>'presetexpdate', + 'name'=>'presetexpdate', + 'options'=>$options + ) + ); + $this->formField( + getMLText("expires"), + $this->getDateChooser($expdate, "expdate", $this->params['session']->getLanguage()) + ); if ($folder->getAccessMode($user) > M_READ) { - print ""; - print ""; - print ""; + $this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s'), $document->getID()).($orderby != 's' ? "
".getMLText('order_by_sequence_off') : '')); } if($attrdefs) { foreach($attrdefs as $attrdef) { $arr = $this->callHook('editDocumentAttribute', $document, $attrdef); if(is_array($arr)) { if($arr) { - echo ""; - echo ""; - echo ""; - echo ""; + $this->formField($arr[0], $arr[1]); } } else { -?> - - - - -formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $document->getAttribute($attrdef))); } } } $arrs = $this->callHook('addDocumentAttributes', $folder); if(is_array($arrs)) { foreach($arrs as $arr) { - echo ""; - echo ""; - echo ""; - echo ""; + $this->formField($arr[0], $arr[1]); } } + $this->formSubmit(" ".getMLText('save')); ?> - - - - -
:
:
: -printKeywordChooserHtml('form1', $document->getKeywords()); -?> -
: - -
: - -
: - - - - -
" . getMLText("sequence") . ":"; - $this->printSequenceChooser($folder->getDocuments('s'), $document->getID()); - if($orderby != 's') echo "
".getMLText('order_by_sequence_off'); - print "
".$arr[0].":".$arr[1]."
getName()); ?>:printAttributeEditField($attrdef, $document->getAttribute($attrdef)) ?>
".$arr[0].":".$arr[1]."
contentContainerEnd();