Exemplo n.º 1
0
 /**
  * Initialisiert Formular und fuegt Unterformulare fuer Schlagworttypen hinzu.
  */
 public function init()
 {
     parent::init();
     $this->addSubForm(new Admin_Form_Document_SubjectType('swd', array('columns' => array(array(), array('label' => 'Opus_Subject_Value'), array('label' => 'ExternalKey')))), 'Swd');
     $this->addSubForm(new Admin_Form_Document_SubjectType('psyndex', array('columns' => array(array(), array('label' => 'Opus_Subject_Value'), array('label' => 'ExternalKey')))), 'Psyndex');
     $this->addSubForm(new Admin_Form_Document_SubjectType('uncontrolled', array('columns' => array(array(), array('label' => 'Opus_Subject_Value'), array('label' => 'ExternalKey')))), 'Uncontrolled');
     // TODO Unterformular fuer unbekannte Typen hinzufügen?
     $this->setDecorators(array('FormElements'));
 }
Exemplo n.º 2
0
 /**
  * Initialisiert das Formular und erzeugt die Unterformulare für die Titeltypen.
  */
 public function init()
 {
     parent::init();
     $this->setLegend('admin_document_section_titles');
     $this->addSubForm(new Admin_Form_Document_TitlesMain(), 'Main');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Title', 'TitleAdditional', new Form_Validate_MultiSubForm_RepeatedLanguages()), 'Additional');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Title', 'TitleParent', new Form_Validate_MultiSubForm_RepeatedLanguages()), 'Parent');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Title', 'TitleSub', new Form_Validate_MultiSubForm_RepeatedLanguages()), 'Sub');
 }
Exemplo n.º 3
0
 /**
  * Konstruiert das Metadaten-Formular aus verschiedenen Unterformularen und den Aktion Buttons.
  */
 public function init()
 {
     parent::init();
     $this->setDecorators(array('FormElements', array(array('wrapperDivClose' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true', 'placement' => 'append'))));
     $this->addSubForm(new Admin_Form_ActionBox($this), 'ActionBox');
     $subform = new Admin_Form_InfoBox();
     $subform->addDecorator(array('wrapperDivOpen' => 'HtmlTag'), array('tag' => 'div', 'placement' => 'prepend', 'class' => 'wrapper', 'openOnly' => 'true'));
     $this->addSubForm($subform, 'InfoBox');
     $this->addSubForm(new Admin_Form_Document_General(), 'General');
     $this->addSubForm(new Admin_Form_Document_Persons(), 'Persons');
     // Bibliographische Beschreibung
     $this->addSubForm(new Admin_Form_Document_Titles(), 'Titles');
     $this->addSubForm(new Admin_Form_Document_Bibliographic(), 'Bibliographic');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Series', 'Series', new Form_Validate_MultiSubForm_RepeatedValues('SeriesId', 'admin_document_error_repeated_series'), array('columns' => array(array(), array('label' => 'Opus_Model_Dependent_Link_DocumentSeries_Number'), array('label' => 'Opus_Model_Dependent_Link_DocumentSeries_SortOrder')))), 'Series');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Enrichment', 'Enrichment', null, array('columns' => array(array('label' => 'KeyName'), array('label' => 'Value')))), 'Enrichments');
     $this->addSubForm(new Admin_Form_Document_Collections(), 'Collections');
     // Inhaltliche Erschließung
     $subform = new Admin_Form_Document_Section();
     $subform->setLegend('admin_document_section_content');
     $subform->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Abstract', 'TitleAbstract', new Form_Validate_MultiSubForm_RepeatedValues('Language', 'admin_document_error_MoreThanOneTitleInLanguage')), 'Abstracts');
     $subform->addSubForm(new Admin_Form_Document_Subjects(), 'Subjects');
     $this->addSubForm($subform, 'Content');
     // Weiteres Allgemeines
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Identifier', 'Identifier', new Form_Validate_MultiSubForm_RepeatedValues('Value', 'admin_document_error_repeated_identifier', 'Type'), array('columns' => array(array('label' => 'Opus_Identifier_Type'), array('label' => 'Text')))), 'Identifiers');
     $this->addSubForm(new Admin_Form_Document_Licences(), 'Licences');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Patent', 'Patent'), 'Patents');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Note', 'Note'), 'Notes');
     $this->addSubForm(new Admin_Form_Document_Actions(), 'Actions');
 }
Exemplo n.º 4
0
 public function testUpdateModel()
 {
     $form = new Admin_Form_Document_Section();
     $model = $this->createTestDocument();
     $form->updateModel($model);
 }
Exemplo n.º 5
0
 protected function _getRoleForm($roleName)
 {
     $roleForm = $this->getSubForm($roleName);
     if (is_null($roleForm)) {
         $roleForm = new Admin_Form_Document_Section();
         $roleForm->setLegend('default_collection_role_' . $roleName);
         $this->addSubForm($roleForm, $roleName);
     }
     return $roleForm;
 }
Exemplo n.º 6
0
 public function updateModel($document)
 {
     parent::updateModel($document);
     $datesHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Dates');
     $document->setContributingCorporation($this->getElementValue(self::ELEMENT_CONTRIBUTING_CORPORATION));
     $document->setCreatingCorporation($this->getElementValue(self::ELEMENT_CREATING_CORPORATION));
     $document->setEdition($this->getElementValue(self::ELEMENT_EDITION));
     $document->setIssue($this->getElementValue(self::ELEMENT_ISSUE));
     $document->setPageFirst($this->getElementValue(self::ELEMENT_PAGE_FIRST));
     $document->setPageLast($this->getElementValue(self::ELEMENT_PAGE_LAST));
     $document->setPageNumber($this->getElementValue(self::ELEMENT_PAGE_COUNT));
     $document->setPublisherName($this->getElementValue(self::ELEMENT_PUBLISHER_NAME));
     $document->setPublisherPlace($this->getElementValue(self::ELEMENT_PUBLISHER_PLACE));
     $document->setVolume($this->getElementValue(self::ELEMENT_VOLUME));
     $value = $this->getElementValue(self::ELEMENT_THESIS_DATE_ACCEPTED);
     $date = is_null($value) ? null : $datesHelper->getOpusDate($value);
     $document->setThesisDateAccepted($date);
     $document->setThesisYearAccepted($this->getElementValue(self::ELEMENT_THESIS_YEAR_ACCEPTED));
     $document->setBelongsToBibliography($this->getElementValue(self::ELEMENT_BELONGS_TO_BIBLIOGRAPHY));
 }