Ejemplo n.º 1
0
 /**
  * Store a note in the current document
  * @param type $dataValue Note text
  */
 private function storeNoteObject($dataValue)
 {
     $note = new Opus_Note();
     $note->setMessage($dataValue);
     $note->setVisibility("private");
     try {
         $this->_document->addNote($note);
     } catch (Opus_Model_Exception $e) {
         $this->_log->err("could not add note with message {$dataValue} to document " . $this->_docId . " : " . $e->getMessage());
         throw new Publish_Model_Exception();
     }
 }
 public function testPreserveNewlinesForNote()
 {
     $this->markTestIncomplete("Muss fuer OPUS 4.4 angepasst werden.");
     // TODO OPUSVIER-2794
     $doc = $this->createTestDocument();
     $doc->setLanguage("eng");
     $doc->setServerState("published");
     $note = new Opus_Note();
     $note->setMessage("foo\nbar\n\nbaz");
     $note->setVisibility("public");
     $doc->addNote($note);
     $doc->store();
     $this->dispatch('/admin/document/index/id/' . $doc->getId());
     $this->assertContains('<pre class="preserve-spaces noteTextContainer">' . "foo\nbar\n\nbaz" . '</pre>', $this->getResponse()->getBody());
 }
Ejemplo n.º 3
0
 public function testPrepareRenderingAsView()
 {
     $form = new Admin_Form_Document_Note();
     $note = new Opus_Note();
     $note->setMessage('Message1');
     $note->setVisibility('public');
     $form->populateFromModel($note);
     $form->prepareRenderingAsView();
     $this->assertFalse($form->getElement('Visibility')->getDecorator('Label'));
 }
 public function testNotePerserveSpace()
 {
     $doc = $this->createTestDocument();
     $doc->setLanguage("eng");
     $doc->setServerState("published");
     $note = new Opus_Note();
     $note->setMessage("foo\nbar\n\nbaz");
     $note->setVisibility("public");
     $doc->addNote($note);
     $doc->store();
     $this->dispatch('/frontdoor/index/index/docId/' . $doc->getId());
     $this->assertContains('<pre class="preserve-spaces">' . "foo\nbar\n\nbaz</pre>", $this->getResponse()->getBody());
 }