Commit 79c4ab41 authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

dev #93553 : federated reviews

parent 172a0d93
Pipeline #8317 passed with stage
in 38 minutes and 26 seconds
...@@ -177,13 +177,11 @@ class AbonneController extends ZendAfi_Controller_Action { ...@@ -177,13 +177,11 @@ class AbonneController extends ZendAfi_Controller_Action {
->setTypeDoc($notice->getTypeDoc()) ->setTypeDoc($notice->getTypeDoc())
->setStatut(0); ->setStatut(0);
$journal_type = $avis->isNew() ? 'REVIEW_CREATE' : 'REVIEW_UPDATE';
if ($avis->save()) { if ($avis->save()) {
$this->_user $this->_user
->setPseudo($this->_request->getParam('avisSignature')) ->setPseudo($this->_request->getParam('avisSignature'))
->save(); ->save();
$this->_helper->journal($journal_type, $avis);
$this->_helper->notify($this->_('Votre avis à bien été enregistré')); $this->_helper->notify($this->_('Votre avis à bien été enregistré'));
return $this->_redirectClose($this->_getReferer()); return $this->_redirectClose($this->_getReferer());
...@@ -192,13 +190,13 @@ class AbonneController extends ZendAfi_Controller_Action { ...@@ -192,13 +190,13 @@ class AbonneController extends ZendAfi_Controller_Action {
$this->view->message = implode('.', $avis->getErrors()); $this->view->message = implode('.', $avis->getErrors());
} }
if ($avis != null) { if ($avis != null) {
$this->view->id = $avis->getId(); $this->view->id = $avis->getId();
$this->view->avisEntete = $avis->getEntete(); $this->view->avisEntete = $avis->getEntete();
$this->view->avisTexte = $avis->getAvis(); $this->view->avisTexte = $avis->getAvis();
$this->view->avisNote = $avis->getNote(); $this->view->avisNote = $avis->getNote();
} }
$this->view->avisSignature = $this->_user->getNomAff(); $this->view->avisSignature = $this->_user->getNomAff();
$this->view->id_notice = $id_notice; $this->view->id_notice = $id_notice;
} }
......
<?php <?php
//re run 1.2 //re run 1.2
(new Class_Migration_DigitalResource_ToutApprendre())->run(); (new Class_Migration_DigitalResource_ToutApprendre())->run();
\ No newline at end of file
<?php <?php
(new Class_Migration_DigitalResource_1DTouch())->run(); (new Class_Migration_DigitalResource_1DTouch())->run();
\ No newline at end of file
...@@ -9,4 +9,4 @@ $try = function ($query) use($adapter) { ...@@ -9,4 +9,4 @@ $try = function ($query) use($adapter) {
$try('ALTER TABLE notices add column type int not null default 1, add KEY type (type)'); $try('ALTER TABLE notices add column type int not null default 1, add KEY type (type)');
$try('ALTER TABLE exemplaires add column type int not null default 1, add KEY type (type)'); $try('ALTER TABLE exemplaires add column type int not null default 1, add KEY type (type)');
$try("UPDATE `variables` SET liste='0:notices\r\n1:abonnés\r\n2:prêts\r\n3:reservations\r\n4:paniers\r\n5:autorités' WHERE clef='type_fichier'"); $try("UPDATE `variables` SET liste='0:notices\r\n1:abonnés\r\n2:prêts\r\n3:reservations\r\n4:paniers\r\n5:autorités' WHERE clef='type_fichier'");
\ No newline at end of file
...@@ -38,7 +38,8 @@ class Class_WebService_ActivityPub { ...@@ -38,7 +38,8 @@ class Class_WebService_ActivityPub {
use Trait_SimpleWebClient, Trait_TimeSource, Trait_LastMessage, Trait_Translator; use Trait_SimpleWebClient, Trait_TimeSource, Trait_LastMessage, Trait_Translator;
const const
MIME_TYPE = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; MIME_TYPE = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
EMPTY_DIGEST = 'ZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2U=';
protected static protected static
$_throw_errors = false, $_throw_errors = false,
...@@ -266,7 +267,7 @@ class Class_WebService_ActivityPub { ...@@ -266,7 +267,7 @@ class Class_WebService_ActivityPub {
protected function _activityGet($url, $request_target) { protected function _activityGet($url, $request_target) {
$headers = ['date' => $this->getTimeSource()->dateHttpHeader(), $headers = ['date' => $this->getTimeSource()->dateHttpHeader(),
'digest' => 'MD5=' . base64_encode(md5('')), 'digest' => 'MD5=' . static::EMPTY_DIGEST,
Class_HttpSignature::REQUEST_TARGET => $request_target]; Class_HttpSignature::REQUEST_TARGET => $request_target];
return $this return $this
......
...@@ -160,14 +160,6 @@ class AbonneControllerAvisNoticeAvisSaveTest extends AbonneControllerAvisTestCas ...@@ -160,14 +160,6 @@ class AbonneControllerAvisNoticeAvisSaveTest extends AbonneControllerAvisTestCas
$this->postDispatch('/opac/abonne/avis/id_notice/53', $data); $this->postDispatch('/opac/abonne/avis/id_notice/53', $data);
$this->assertNotNull(Class_AvisNotice::findFirstBy(['entete' => 'Sorcellerie'])); $this->assertNotNull(Class_AvisNotice::findFirstBy(['entete' => 'Sorcellerie']));
$this->assertNotNull($journal = Class_Journal::findFirstBy(['type' => 'REVIEW_CREATE']));
$details = $journal->getDetails();
$this->assertNotEmpty($details);
$this->assertEquals('AUTHOR', $details[0]->getType());
$this->assertEquals('FloCouv', $details[0]->getValue());
$this->assertEquals('NEEDS_VALIDATION', $details[1]->getType());
$this->assertEquals(false, $details[1]->getValue());
} }
...@@ -191,8 +183,6 @@ class AbonneControllerAvisNoticeAvisSaveTest extends AbonneControllerAvisTestCas ...@@ -191,8 +183,6 @@ class AbonneControllerAvisNoticeAvisSaveTest extends AbonneControllerAvisTestCas
$this->postDispatch('/opac/abonne/avis/id_notice/53', $data); $this->postDispatch('/opac/abonne/avis/id_notice/53', $data);
$this->assertEquals(4, Class_AvisNotice::find(12)->getNote()); $this->assertEquals(4, Class_AvisNotice::find(12)->getNote());
$this->assertNotNull($journal = Class_Journal::findFirstBy(['type' => 'REVIEW_UPDATE']));
$this->assertTrue($journal->hasDetails());
} }
} }
......
...@@ -1800,7 +1800,7 @@ class NoticeAjaxControllerNoticeWithAvisEditLinkModoLoggedTest extends NoticeAja ...@@ -1800,7 +1800,7 @@ class NoticeAjaxControllerNoticeWithAvisEditLinkModoLoggedTest extends NoticeAja
/** @test */ /** @test */
public function editLinkShouldBePresent() { public function editLinkShouldBePresent() {
$this->assertXPath('//a[contains(@href, "abonne/editavisnotice")]', $this->_response->getBody()); $this->assertXPath('//a[contains(@href, "abonne/editavisnotice")]');
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment