allow changing evaluation for a document

- Remove restriction on changing evaluation in entity logic
This commit is contained in:
2025-08-13 17:01:24 +02:00
parent d508fde8d2
commit bf2181c2f1
4 changed files with 22 additions and 19 deletions

View File

@@ -46,7 +46,6 @@ readonly class AccompanyingPeriodWorkEvaluationDocumentMoveController
throw new AccessDeniedHttpException('not allowed to edit this accompanying period work');
}
// Simply set the new evaluation - Doctrine will handle the collection updates
$document->setAccompanyingPeriodWorkEvaluation($evaluation);
$this->entityManager->persist($document);

View File

@@ -100,14 +100,14 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
{
// if an evaluation is already associated, we cannot change the association (removing the association,
// by setting a null value, is allowed.
if (
$this->accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
&& $accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
) {
if ($this->accompanyingPeriodWorkEvaluation !== $accompanyingPeriodWorkEvaluation) {
throw new \RuntimeException('It is not allowed to change the evaluation for a document');
}
}
// if (
// $this->accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
// && $accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
// ) {
// if ($this->accompanyingPeriodWorkEvaluation !== $accompanyingPeriodWorkEvaluation) {
// throw new \RuntimeException('It is not allowed to change the evaluation for a document');
// }
// }
$this->accompanyingPeriodWorkEvaluation = $accompanyingPeriodWorkEvaluation;
return $this;

View File

@@ -140,8 +140,10 @@
</div>
</li>
<li v-if="d.storedObject._permissions.canEdit">
<a class="btn btn-choose" @click="prepareDocumentMoveToWork(d)"
>EVALUATION_DOCUMENT_MOVE</a
<a
class="btn btn-choose"
@click="prepareDocumentMoveToWork(d)"
>{{ trans(EVALUATION_DOCUMENT_MOVE) }}</a
>
</li>
<li v-if="d.storedObject._permissions.canEdit">
@@ -186,14 +188,15 @@ import ListWorkflowModal from "ChillMainAssets/vuejs/_components/EntityWorkflow/
import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue";
import DropFileModal from "ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue";
import {
EVALUATION_NOTIFICATION_NOTIFY_REFERRER,
EVALUATION_NOTIFICATION_NOTIFY_ANY,
EVALUATION_NOTIFICATION_SEND,
EVALUATION_DOCUMENTS,
EVALUATION_DOCUMENT_DUPLICATE,
EVALUATION_DOCUMENT_DUPLICATE_HERE,
EVALUATION_DOCUMENT_DUPLICATE_TO_OTHER_EVALUATION,
trans,
EVALUATION_NOTIFICATION_NOTIFY_REFERRER,
EVALUATION_NOTIFICATION_NOTIFY_ANY,
EVALUATION_NOTIFICATION_SEND,
EVALUATION_DOCUMENTS,
EVALUATION_DOCUMENT_MOVE,
EVALUATION_DOCUMENT_DUPLICATE,
EVALUATION_DOCUMENT_DUPLICATE_HERE,
EVALUATION_DOCUMENT_DUPLICATE_TO_OTHER_EVALUATION,
trans,
} from "translator";
import { ref, watch } from "vue";
import AccompanyingPeriodWorkSelectorModal from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue";

View File

@@ -777,6 +777,7 @@ evaluation:
notification_notify_any: Notifier d'autres utilisateurs
notification_send: Envoyer une notification
document:
move: Déplacer
duplicate: Dupliquer
duplicate_here: Dupliquer ici
duplicate_to_other_evaluation: Dupliquer vers une autre évaluation