Пример #1
0
 public function testOptions()
 {
     $element = $this->getElement();
     $grantors = Opus_DnbInstitute::getGrantors();
     $this->assertEquals(count($grantors), count($element->getMultiOptions()));
     $index = 0;
     foreach ($element->getMultiOptions() as $modelId => $label) {
         $this->assertEquals($grantors[$index]->getId(), $modelId);
         $this->assertEquals($grantors[$index]->getDisplayName(), $label);
         $index++;
     }
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->setRequired(true);
     $this->setDisableTranslator(true);
     // Grantor institutes are not translated
     $validator = new Zend_Validate_Int();
     $validator->setMessage('validation_error_int');
     $this->addValidator($validator);
     $options = Opus_DnbInstitute::getGrantors();
     foreach ($options as $option) {
         $this->addMultiOption($option->getId(), $option->getDisplayName());
     }
 }
$issn = $doc->addIdentifierIssn();
$issn->setValue('1234-5678');
$doc->addIdentifierOpac()->setValue('OPAC-ID 001 1237890654');
// Valid Arxiv-Identifier from ArXiv.org Homepage: http://arxiv.org/help/arxiv_identifier
$arxiv = $doc->addIdentifierArxiv();
$arxiv->setValue('arXiv:0706.0001');
// Valid DOI Identifier from DOI Homepage: http://www.doi.org/
$doi = $doc->addIdentifierDoi();
$doi->setValue('10.1000/182');
// Valid Pubmed-Identifier from official Pubmed Tutorial: http://www.nlm.nih.gov/bsd/disted/pubmedtutorial/020_830.html
$pubmed = $doc->addIdentifierPubmed();
$pubmed->setValue('9382368');
$doc->setThesisDateAccepted('2003-02-01');
$dnbInstitute = new Opus_DnbInstitute();
$dnbInstitute->setName('Forschungsinstitut für Code Coverage');
foreach (Opus_DnbInstitute::getGrantors() as $grantor) {
    if ($dnbInstitute->getName() === $grantor->getName()) {
        $dnbInstitute = $grantor;
        break;
    }
}
if (is_null($dnbInstitute->getId()) === true) {
    $dnbInstitute->setCity('Mousetown')->setIsGrantor(1)->store();
}
$doc->setThesisGrantor($dnbInstitute);
$doc->setThesisPublisher($dnbInstitute);
$referee = new Opus_Person();
$referee->setFirstName('Gyro');
$referee->setLastName('Gearloose');
$referee->setAcademicTitle('Prof. Dr.');
$referee->store();
Пример #4
0
 /**
  * Retrieves all available ThesisGrantors or ThesisPublishers in a array.
  * Used for generating a select box.
  *
  * @param $grantors true -> get thesis grantors
  *                  null -> get thesis publishers
  * @return Array of Dnb_Institutes Objects
  */
 private function getThesis($grantors = null)
 {
     $thesises = array();
     if ($grantors === true) {
         $thesises = Opus_DnbInstitute::getGrantors();
     } else {
         if (is_null($grantors)) {
             $thesises = Opus_DnbInstitute::getPublishers();
         }
     }
     if (empty($thesises)) {
         return null;
     }
     $thesisList = array();
     foreach ($thesises as $thesis) {
         $thesisList[$thesis->getId()] = $thesis->getDisplayName();
     }
     return $thesisList;
 }