Skip to content

Commit

Permalink
Merge branch 'master' into PHRAS-3957-th-input-search
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaillat authored Dec 11, 2023
2 parents 4bc7cb7 + 4cefad3 commit 3d82b63
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 141 deletions.
37 changes: 36 additions & 1 deletion lib/Alchemy/Phrasea/Model/Entities/BasketElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
use record_adapter;

/**
* @ORM\Table(name="BasketElements", uniqueConstraints={@ORM\UniqueConstraint(name="unique_recordcle", columns={"basket_id","sbas_id","record_id"})})
* @ORM\Table(name="BasketElements",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="unique_recordcle", columns={"basket_id","sbas_id","record_id"})
* },
* indexes={
* @ORM\Index(name="vote_expired", columns={"vote_expired"})
* }
* )
* @ORM\Entity(repositoryClass="Alchemy\Phrasea\Model\Repositories\BasketElementRepository")
*/
class BasketElement
Expand Down Expand Up @@ -70,6 +77,11 @@ class BasketElement
*/
private $basket;

/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $vote_expired;

/**
* Constructor
*/
Expand Down Expand Up @@ -168,6 +180,29 @@ public function getOrd()
return $this->ord;
}

/**
* Get vote_expired
*
* @return DateTime
*/
public function getVoteExpired()
{
return $this->vote_expired;
}

/**
* Set vote_expired
*
* @param DateTime $voteExpired
* @return self
*/
public function setVoteExpired(DateTime $voteExpired)
{
$this->vote_expired = $voteExpired;

return $this;
}

/**
* Set created
*
Expand Down
86 changes: 45 additions & 41 deletions lib/Alchemy/Phrasea/WorkerManager/Subscriber/RecordSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,50 +162,54 @@ public function onRecordsWriteMeta(RecordsWriteMetaEvent $event)

$databox = $this->getApplicationBox()->get_databox($databoxId);
$record = $databox->get_record($recordId);
$type = $record->getType();

$subdefGroupe = $record->getDatabox()->get_subdef_structure()->getSubdefGroup($record->getType());
// do not try to write meta on non story record
if (!$record->isStory()) {
$type = $record->getType();

if ($subdefGroupe !== null) {
$toWritemetaOriginalDocument = $subdefGroupe->toWritemetaOriginalDocument();
} else {
$toWritemetaOriginalDocument = true;
}
$subdefGroupe = $record->getDatabox()->get_subdef_structure()->getSubdefGroup($record->getType());

foreach ($mediaSubdefs as $subdef) {
// check subdefmetadatarequired from the subview setup in admin
// check if we want to write meta in this mime type
if (in_array(trim($subdef->get_mime()), $acceptedMimeTypes) &&
(
($subdef->get_name() == 'document' && $toWritemetaOriginalDocument) ||
$this->isSubdefMetadataUpdateRequired($databox, $type, $subdef->get_name())
)
) {
$payload = [
'message_type' => MessagePublisher::WRITE_METADATAS_TYPE,
'payload' => [
'recordId' => $recordId,
'databoxId' => $databoxId,
'subdefName' => $subdef->get_name()
]
];
if ($subdef->is_physically_present()) {
$this->messagePublisher->publishMessage($payload, MessagePublisher::WRITE_METADATAS_TYPE);
}
else {
$logMessage = sprintf('Subdef "%s" is not physically present! to be passed in the retry q of "%s" ! payload >>> %s',
$subdef->get_name(),
MessagePublisher::WRITE_METADATAS_TYPE,
json_encode($payload)
);
$this->messagePublisher->pushLog($logMessage);

$this->messagePublisher->publishRetryMessage(
$payload,
MessagePublisher::WRITE_METADATAS_TYPE,
2,
'Subdef is not physically present!'
);
if ($subdefGroupe !== null) {
$toWritemetaOriginalDocument = $subdefGroupe->toWritemetaOriginalDocument();
} else {
$toWritemetaOriginalDocument = true;
}

foreach ($mediaSubdefs as $subdef) {
// check subdefmetadatarequired from the subview setup in admin
// check if we want to write meta in this mime type
if (in_array(trim($subdef->get_mime()), $acceptedMimeTypes) &&
(
($subdef->get_name() == 'document' && $toWritemetaOriginalDocument) ||
$this->isSubdefMetadataUpdateRequired($databox, $type, $subdef->get_name())
)
) {
$payload = [
'message_type' => MessagePublisher::WRITE_METADATAS_TYPE,
'payload' => [
'recordId' => $recordId,
'databoxId' => $databoxId,
'subdefName' => $subdef->get_name()
]
];
if ($subdef->is_physically_present()) {
$this->messagePublisher->publishMessage($payload, MessagePublisher::WRITE_METADATAS_TYPE);
}
else {
$logMessage = sprintf('Subdef "%s" is not physically present! to be passed in the retry q of "%s" ! payload >>> %s',
$subdef->get_name(),
MessagePublisher::WRITE_METADATAS_TYPE,
json_encode($payload)
);
$this->messagePublisher->pushLog($logMessage);

$this->messagePublisher->publishRetryMessage(
$payload,
MessagePublisher::WRITE_METADATAS_TYPE,
2,
'Subdef is not physically present!'
);
}
}
}
}
Expand Down
75 changes: 0 additions & 75 deletions lib/classes/patch/418RC8PHRAS3768.php

This file was deleted.

8 changes: 8 additions & 0 deletions lib/classes/patch/418RC8PHRAS3777.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,13 @@ private function patch_appbox(base $appbox, Application $app)
$conf->set(['workers', 'queues', 'downloadAsync'], $value);
}

// patch for stamp PHRAS-3520
if (!$conf->has(['registry', 'actions', 'export-stamp-choice'])) {
$conf->set(['registry', 'actions', 'export-stamp-choice'], false);
}
if (!$conf->has(['registry', 'actions', 'stamp-subdefs'])) {
$conf->set(['registry', 'actions', 'stamp-subdefs'], false);
}

}
}
3 changes: 3 additions & 0 deletions lib/conf.d/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ border-manager:
registry:
api-clients:
api-subdef_service: false
actions:
export-stamp-choice: false
stamp-subdefs: false
user_account:
deleting_policies:
email_confirmation: true
Expand Down
16 changes: 8 additions & 8 deletions resources/locales/messages.de.xlf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2023-11-29T15:09:52Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
<header>
Expand All @@ -7,8 +7,8 @@
</header>
<body>
<trans-unit id="da39a3ee5e6b4b0d3255bfef95601890afd80709" resname="">
<source></source>
<target state="new"></target>
<source/>
<target state="new"/>
<jms:reference-file line="363">WorkerManager/Worker/DownloadAsyncWorker.php</jms:reference-file>
<jms:reference-file line="51">Form/Configuration/EmailFormType.php</jms:reference-file>
<jms:reference-file line="64">Form/Login/PhraseaAuthenticationForm.php</jms:reference-file>
Expand Down Expand Up @@ -196,7 +196,7 @@
<jms:reference-file line="7">Bridge/Dailymotion/element_informations.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="de0804eb70c10b14d71df74292e45c6daa13d672" resname="%number% documents&lt;br/&gt;selectionnes" approved="yes">
<source><![CDATA[%number% documents<br/>selectionnes]]></source>
<source>%number% documents&lt;br/&gt;selectionnes</source>
<target state="translated"><![CDATA[%number% Dokumente<br/> ausgewählt]]></target>
<jms:reference-file line="269">Controller/Prod/QueryController.php</jms:reference-file>
</trans-unit>
Expand Down Expand Up @@ -2557,7 +2557,7 @@
<jms:reference-file line="68">Form/Configuration/ActionsFormType.php</jms:reference-file>
</trans-unit>
<trans-unit id="fa9fd169cd55f0433c6e7a4b5d758f90d0847411" resname="Display &amp; action settings" approved="yes">
<source><![CDATA[Display & action settings]]></source>
<source>Display &amp; action settings</source>
<target state="translated">Anzeige und Handlung-Einstellungen</target>
<jms:reference-file line="154">admin/fields/templates.html.twig</jms:reference-file>
</trans-unit>
Expand Down Expand Up @@ -11393,7 +11393,7 @@
</trans-unit>
<trans-unit id="484db3d45053a06d362ea0cf0c31ba8ca406001e" resname="input-disable">
<source>input-disable</source>
<target state="new">input-disable</target>
<target state="needs-translation">Feldinhalte auf vorgeschlagene Werte und Thesaurus beschränken (Beta-Funktion)</target>
<jms:reference-file line="222">admin/fields/templates.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="830af6e37576114c7943a0e190f35ad2f0302b4d" resname="invite:: Redirection vers la zone d'authentification, cliquez sur OK pour continuer ou annulez" approved="yes">
Expand Down Expand Up @@ -12463,7 +12463,7 @@
<jms:reference-file line="563">Controller/Root/AccountController.php</jms:reference-file>
</trans-unit>
<trans-unit id="bf7028b694aea3fc9ede5014a9f8b5d617b83b6f" resname="phraseanet::account: &lt;&lt; your account can be deleted via admin interface &gt;&gt; " approved="yes">
<source><![CDATA[phraseanet::account: << your account can be deleted via admin interface >>]]></source>
<source>phraseanet::account: &lt;&lt; your account can be deleted via admin interface &gt;&gt;</source>
<target state="translated">Ihr Benutzerkonto kann nur durch die Administration Anwendung gelöscht werden.</target>
<jms:reference-file line="289">web/account/account.html.twig</jms:reference-file>
</trans-unit>
Expand Down Expand Up @@ -15623,7 +15623,7 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben</target>
<jms:reference-file line="1327">web/thesaurus/thesaurus.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="33df70d7fa528a31071e11d1b987b49dc947ce16" resname="thesaurus:: Supprimer cette branche ?&amp;#10;(les termes concernes remonteront en candidats a la prochaine indexation)" approved="yes">
<source><![CDATA[thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation)]]></source>
<source>thesaurus:: Supprimer cette branche ?&amp;#10;(les termes concernes remonteront en candidats a la prochaine indexation)</source>
<target state="translated"><![CDATA[Diese Verzweigung löschen?&#10; (die betroffenende Begriffe werden als mögliche Begriffe beim nächsten Indexierung erscheinen)]]></target>
<jms:reference-file line="536">web/thesaurus/thesaurus.html.twig</jms:reference-file>
</trans-unit>
Expand Down
16 changes: 8 additions & 8 deletions resources/locales/messages.en.xlf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2023-11-29T15:10:09Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
<header>
Expand All @@ -7,8 +7,8 @@
</header>
<body>
<trans-unit id="da39a3ee5e6b4b0d3255bfef95601890afd80709" resname="">
<source></source>
<target state="new"></target>
<source/>
<target state="new"/>
<jms:reference-file line="363">WorkerManager/Worker/DownloadAsyncWorker.php</jms:reference-file>
<jms:reference-file line="51">Form/Configuration/EmailFormType.php</jms:reference-file>
<jms:reference-file line="64">Form/Login/PhraseaAuthenticationForm.php</jms:reference-file>
Expand Down Expand Up @@ -196,7 +196,7 @@
<jms:reference-file line="7">Bridge/Dailymotion/element_informations.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="de0804eb70c10b14d71df74292e45c6daa13d672" resname="%number% documents&lt;br/&gt;selectionnes" approved="yes">
<source><![CDATA[%number% documents<br/>selectionnes]]></source>
<source>%number% documents&lt;br/&gt;selectionnes</source>
<target state="translated"><![CDATA[%number% documents<br/>selected]]></target>
<jms:reference-file line="269">Controller/Prod/QueryController.php</jms:reference-file>
</trans-unit>
Expand Down Expand Up @@ -2559,7 +2559,7 @@
<jms:reference-file line="68">Form/Configuration/ActionsFormType.php</jms:reference-file>
</trans-unit>
<trans-unit id="fa9fd169cd55f0433c6e7a4b5d758f90d0847411" resname="Display &amp; action settings" approved="yes">
<source><![CDATA[Display & action settings]]></source>
<source>Display &amp; action settings</source>
<target state="translated">Display and action settings</target>
<jms:reference-file line="154">admin/fields/templates.html.twig</jms:reference-file>
</trans-unit>
Expand Down Expand Up @@ -11395,7 +11395,7 @@
</trans-unit>
<trans-unit id="484db3d45053a06d362ea0cf0c31ba8ca406001e" resname="input-disable">
<source>input-disable</source>
<target state="new">input-disable</target>
<target state="needs-translation">Restrict field content to suggested values and thesaurus (beta feature)</target>
<jms:reference-file line="222">admin/fields/templates.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="830af6e37576114c7943a0e190f35ad2f0302b4d" resname="invite:: Redirection vers la zone d'authentification, cliquez sur OK pour continuer ou annulez" approved="yes">
Expand Down Expand Up @@ -12465,7 +12465,7 @@
<jms:reference-file line="563">Controller/Root/AccountController.php</jms:reference-file>
</trans-unit>
<trans-unit id="bf7028b694aea3fc9ede5014a9f8b5d617b83b6f" resname="phraseanet::account: &lt;&lt; your account can be deleted via admin interface &gt;&gt; " approved="yes">
<source><![CDATA[phraseanet::account: << your account can be deleted via admin interface >>]]></source>
<source>phraseanet::account: &lt;&lt; your account can be deleted via admin interface &gt;&gt;</source>
<target state="translated">Your rights do not allow to perform this action. Your account can only be deleted via the Administration interface.</target>
<jms:reference-file line="289">web/account/account.html.twig</jms:reference-file>
</trans-unit>
Expand Down Expand Up @@ -15628,7 +15628,7 @@ It is possible to place several search areas</target>
<jms:reference-file line="1327">web/thesaurus/thesaurus.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="33df70d7fa528a31071e11d1b987b49dc947ce16" resname="thesaurus:: Supprimer cette branche ?&amp;#10;(les termes concernes remonteront en candidats a la prochaine indexation)" approved="yes">
<source><![CDATA[thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation)]]></source>
<source>thesaurus:: Supprimer cette branche ?&amp;#10;(les termes concernes remonteront en candidats a la prochaine indexation)</source>
<target state="translated"><![CDATA[Delete branch : &#10 (concerned terms will be displayed as candidates on future indexation)]]></target>
<jms:reference-file line="536">web/thesaurus/thesaurus.html.twig</jms:reference-file>
</trans-unit>
Expand Down
Loading

0 comments on commit 3d82b63

Please sign in to comment.