/**
  * @return Zend_Form
  */
 public function getUploadForm()
 {
     static $form;
     if (null === $form) {
         $form = new Zend_Form();
         $form->setAttrib('enctype', 'multipart/form-data')->addElement('file', 'xml', array('label' => _('File'), 'required' => true, 'validators' => array('NotEmpty' => array())));
         $statusOptions = ['label' => 'Status for imported concepts'];
         if ($this->getTenant()['enableStatusesSystem']) {
             $statusOptions['multiOptions'] = OpenSKOS_Concept_Status::statusesToOptions();
         } else {
             $statusOptions['multiOptions'] = [OpenSKOS_Concept_Status::APPROVED];
             $statusOptions['disabled'] = true;
         }
         $form->addElement('select', 'status', $statusOptions);
         $form->addElement('checkbox', 'ignoreIncomingStatus', array('label' => 'Ignore incoming status'));
         $editorOptions = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOption('editor');
         $form->addElement('select', 'lang', array('label' => 'The default language to use if no "xml:lang" attribute is found', 'multiOptions' => $editorOptions['languages']));
         $form->addElement('checkbox', 'toBeChecked', array('label' => 'Sets the toBeCheked status of imported concepts'));
         $form->addElement('checkbox', 'purge', array('label' => 'Purge. Delete all concept schemes found in the file. (will also delete concepts inside them)'));
         $form->addElement('checkbox', 'delete-before-import', array('label' => _('Delete concepts in this collection before import')));
         $form->addElement('checkbox', 'onlyNewConcepts', array('label' => _('Import contains only new concepts. Do not update any concepts if they match by notation (or uri if useUriAsIdentifier is used).')));
         $form->addElement('checkbox', 'useUriAsIdentifier', array('label' => _('Use uri as identifier if concept notation does not exist in the importing concept.')));
         $form->addElement('submit', 'submit', array('label' => 'Submit'));
     }
     return $form;
 }
示例#2
0
 /**
  * Build the statuses dropdown.
  */
 protected function buildStatuses()
 {
     if ($this->getEnableStatusesSystem()) {
         if ($this->_isProposalOnly) {
             $availableStatuses = [OpenSKOS_Concept_Status::CANDIDATE];
         } else {
             $availableStatuses = OpenSKOS_Concept_Status::getAvailableStatuses($this->getCurrentStatus());
         }
         // Fallback for expired status for beg
         //!TODO Can be removed when conversion ready
         if ($this->getCurrentStatus() == OpenSKOS_Concept_Status::_EXPIRED) {
             $availableStatuses[] = OpenSKOS_Concept_Status::OBSOLETE;
         }
         $this->addElement('select', 'status', array('label' => 'Status:', 'multiOptions' => OpenSKOS_Concept_Status::statusesToOptions($availableStatuses), 'value' => 'candidate', 'decorators' => array('ViewHelper', 'Label', array('HtmlTag', array('tag' => 'span', 'id' => 'concept-edit-status')))));
         if ($this->_isProposalOnly) {
             $this->getElement('status')->setValue(OpenSKOS_Concept_Status::CANDIDATE);
         }
         // Fallback for expired status for beg
         //!TODO Can be removed when conversion ready
         if ($this->getCurrentStatus() == OpenSKOS_Concept_Status::_EXPIRED) {
             $this->getElement('status')->setValue(OpenSKOS_Concept_Status::OBSOLETE);
         }
     } else {
         $this->addElement('hidden', 'status', array('decorators' => array('ViewHelper'), 'value' => OpenSKOS_Concept_Status::APPROVED));
     }
     $this->addElement('hidden', 'statusOtherConcept', array('decorators' => array('ViewHelper')));
     $this->addElement('hidden', 'statusOtherConceptLabelToFill', array('decorators' => array('ViewHelper')));
 }
 protected function buildStatus()
 {
     $this->addElement('select', 'status', array('label' => 'Status:', 'separator' => '', 'multiOptions' => OpenSKOS_Concept_Status::statusesToOptions(), 'decorators' => array('ViewHelper', 'Label')));
     return $this;
 }