mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
Compare commits
4 Commits
fix_calend
...
421-signat
Author | SHA1 | Date | |
---|---|---|---|
c4d5984b92 | |||
376497b704 | |||
f90e9ea3bc | |||
5465a6f336 |
6
.changes/unreleased/Feature-20250724-161556.yaml
Normal file
6
.changes/unreleased/Feature-20250724-161556.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Only allow delete of attachment on workflows that are not final
|
||||||
|
time: 2025-07-24T16:15:56.042884578+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
6
.changes/unreleased/Feature-20250724-161628.yaml
Normal file
6
.changes/unreleased/Feature-20250724-161628.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Move up signature buttons on index workflow page for easier access
|
||||||
|
time: 2025-07-24T16:16:28.609598883+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
6
.changes/unreleased/Feature-20250724-172013.yaml
Normal file
6
.changes/unreleased/Feature-20250724-172013.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Filter out document from attachment list if it is the same as the workflow document
|
||||||
|
time: 2025-07-24T17:20:13.118537573+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
@@ -1,6 +0,0 @@
|
|||||||
kind: Feature
|
|
||||||
body: Add 45 and 60 min calendar ranges
|
|
||||||
time: 2025-08-11T15:21:54.209009751+02:00
|
|
||||||
custom:
|
|
||||||
Issue: "409"
|
|
||||||
SchemaChange: No schema change
|
|
@@ -1,6 +0,0 @@
|
|||||||
kind: Fixed
|
|
||||||
body: adjust display logic for accompanying period dates, include closing date if period is closed.
|
|
||||||
time: 2025-08-06T13:46:09.241584292+02:00
|
|
||||||
custom:
|
|
||||||
Issue: "382"
|
|
||||||
SchemaChange: No schema change
|
|
@@ -1,6 +0,0 @@
|
|||||||
kind: Fixed
|
|
||||||
body: add min and step attributes to integer field in DateIntervalType
|
|
||||||
time: 2025-08-06T17:35:27.413787704+02:00
|
|
||||||
custom:
|
|
||||||
Issue: "384"
|
|
||||||
SchemaChange: No schema change
|
|
@@ -1,6 +0,0 @@
|
|||||||
kind: Fixed
|
|
||||||
body: fix date formatting in calendar range display
|
|
||||||
time: 2025-08-11T15:52:12.949078671+02:00
|
|
||||||
custom:
|
|
||||||
Issue: ""
|
|
||||||
SchemaChange: No schema change
|
|
@@ -70,8 +70,6 @@
|
|||||||
<option value="00:10:00">10 minutes</option>
|
<option value="00:10:00">10 minutes</option>
|
||||||
<option value="00:15:00">15 minutes</option>
|
<option value="00:15:00">15 minutes</option>
|
||||||
<option value="00:30:00">30 minutes</option>
|
<option value="00:30:00">30 minutes</option>
|
||||||
<option value="00:45:00">45 minutes</option>
|
|
||||||
<option value="00:60:00">60 minutes</option>
|
|
||||||
</select>
|
</select>
|
||||||
<label class="input-group-text" for="slotMinTime">De</label>
|
<label class="input-group-text" for="slotMinTime">De</label>
|
||||||
<select
|
<select
|
||||||
|
@@ -32,8 +32,6 @@
|
|||||||
<option value="00:10:00">10 minutes</option>
|
<option value="00:10:00">10 minutes</option>
|
||||||
<option value="00:15:00">15 minutes</option>
|
<option value="00:15:00">15 minutes</option>
|
||||||
<option value="00:30:00">30 minutes</option>
|
<option value="00:30:00">30 minutes</option>
|
||||||
<option value="00:45:00">45 minutes</option>
|
|
||||||
<option value="00:60:00">60 minutes</option>
|
|
||||||
</select>
|
</select>
|
||||||
<label class="input-group-text" for="slotMinTime">De</label>
|
<label class="input-group-text" for="slotMinTime">De</label>
|
||||||
<select
|
<select
|
||||||
@@ -104,7 +102,7 @@
|
|||||||
event.title
|
event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else-if="event.extendedProps.is === 'range'"
|
<b v-else-if="event.extendedProps.is === 'range'"
|
||||||
>{{ formatDate(event.startStr) }} - {{ formatDate(event.endStr, 'time') }}:
|
>{{ formatDate(event.startStr) }} -
|
||||||
{{ event.extendedProps.locationName }}</b
|
{{ event.extendedProps.locationName }}</b
|
||||||
>
|
>
|
||||||
<b v-else-if="event.extendedProps.is === 'local'">{{
|
<b v-else-if="event.extendedProps.is === 'local'">{{
|
||||||
@@ -296,26 +294,9 @@ const nextWeeks = computed((): Weeks[] =>
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const formatDate = (datetime: string, format: null | 'time' = null) => {
|
const formatDate = (datetime: string) => {
|
||||||
const date = ISOToDate(datetime);
|
console.log(typeof datetime);
|
||||||
if (!date) return '';
|
return ISOToDate(datetime);
|
||||||
|
|
||||||
if (format === 'time') {
|
|
||||||
return date.toLocaleTimeString('fr-FR', {
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// French date formatting
|
|
||||||
return date.toLocaleDateString('fr-FR', {
|
|
||||||
weekday: 'short',
|
|
||||||
year: 'numeric',
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit'
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseOptions = ref<CalendarOptions>({
|
const baseOptions = ref<CalendarOptions>({
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { fetchResults } from "ChillMainAssets/lib/api/apiMethods";
|
import {fetchResults, makeFetch} from "ChillMainAssets/lib/api/apiMethods";
|
||||||
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
||||||
|
import {EntityWorkflow} from "ChillMainAssets/types";
|
||||||
|
|
||||||
export function fetch_generic_docs_by_accompanying_period(
|
export function fetch_generic_docs_by_accompanying_period(
|
||||||
periodId: number,
|
periodId: number,
|
||||||
@@ -8,3 +9,17 @@ export function fetch_generic_docs_by_accompanying_period(
|
|||||||
`/api/1.0/doc-store/generic-doc/by-period/${periodId}/index`,
|
`/api/1.0/doc-store/generic-doc/by-period/${periodId}/index`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const fetchWorkflow = async (
|
||||||
|
workflowId: number,
|
||||||
|
): Promise<EntityWorkflow> => {
|
||||||
|
try {
|
||||||
|
return await makeFetch<null, EntityWorkflow>(
|
||||||
|
"GET",
|
||||||
|
`/api/1.0/main/workflow/${workflowId}.json`,
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to fetch workflow ${workflowId}:`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@@ -25,7 +25,7 @@ export interface GenericDoc {
|
|||||||
type: "doc_store_generic_doc";
|
type: "doc_store_generic_doc";
|
||||||
uniqueKey: string;
|
uniqueKey: string;
|
||||||
key: string;
|
key: string;
|
||||||
identifiers: object;
|
identifiers: { id: number; };
|
||||||
context: "person" | "accompanying-period";
|
context: "person" | "accompanying-period";
|
||||||
doc_date: DateTime;
|
doc_date: DateTime;
|
||||||
metadata: GenericDocMetadata;
|
metadata: GenericDocMetadata;
|
||||||
|
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||||
@@ -27,7 +28,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
|||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
|
||||||
class WorkflowApiController
|
class WorkflowApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {}
|
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {}
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@ use Chill\MainBundle\Controller\UserGroupAdminController;
|
|||||||
use Chill\MainBundle\Controller\UserGroupApiController;
|
use Chill\MainBundle\Controller\UserGroupApiController;
|
||||||
use Chill\MainBundle\Controller\UserJobApiController;
|
use Chill\MainBundle\Controller\UserJobApiController;
|
||||||
use Chill\MainBundle\Controller\UserJobController;
|
use Chill\MainBundle\Controller\UserJobController;
|
||||||
|
use Chill\MainBundle\Controller\WorkflowApiController;
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
||||||
use Chill\MainBundle\Doctrine\DQL\Age;
|
use Chill\MainBundle\Doctrine\DQL\Age;
|
||||||
use Chill\MainBundle\Doctrine\DQL\Extract;
|
use Chill\MainBundle\Doctrine\DQL\Extract;
|
||||||
@@ -66,6 +67,7 @@ use Chill\MainBundle\Entity\Regroupment;
|
|||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Entity\UserGroup;
|
use Chill\MainBundle\Entity\UserGroup;
|
||||||
use Chill\MainBundle\Entity\UserJob;
|
use Chill\MainBundle\Entity\UserJob;
|
||||||
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||||
use Chill\MainBundle\Form\CenterType;
|
use Chill\MainBundle\Form\CenterType;
|
||||||
use Chill\MainBundle\Form\CivilityType;
|
use Chill\MainBundle\Form\CivilityType;
|
||||||
use Chill\MainBundle\Form\CountryType;
|
use Chill\MainBundle\Form\CountryType;
|
||||||
@@ -79,6 +81,7 @@ use Chill\MainBundle\Form\UserGroupType;
|
|||||||
use Chill\MainBundle\Form\UserJobType;
|
use Chill\MainBundle\Form\UserJobType;
|
||||||
use Chill\MainBundle\Form\UserType;
|
use Chill\MainBundle\Form\UserType;
|
||||||
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
||||||
|
use Chill\MainBundle\Security\Authorization\EntityWorkflowVoter;
|
||||||
use Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType;
|
use Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType;
|
||||||
use Ramsey\Uuid\Doctrine\UuidType;
|
use Ramsey\Uuid\Doctrine\UuidType;
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
@@ -940,6 +943,21 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'class' => EntityWorkflow::class,
|
||||||
|
'name' => 'workflow',
|
||||||
|
'base_path' => '/api/1.0/main/workflow',
|
||||||
|
'base_role' => EntityWorkflowVoter::SEE,
|
||||||
|
'controller' => WorkflowApiController::class,
|
||||||
|
'actions' => [
|
||||||
|
'_entity' => [
|
||||||
|
'methods' => [
|
||||||
|
Request::METHOD_GET => true,
|
||||||
|
Request::METHOD_HEAD => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -55,10 +55,6 @@ class DateIntervalType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('n', IntegerType::class, [
|
->add('n', IntegerType::class, [
|
||||||
'attr' => [
|
|
||||||
'min' => 0,
|
|
||||||
'step' => 1,
|
|
||||||
],
|
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new GreaterThan([
|
new GreaterThan([
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
|
@@ -37,13 +37,8 @@ export const ISOToDate = (str: string | null): Date | null => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the string already contains time info, use it directly
|
|
||||||
if (str.includes('T') || str.includes(' ')) {
|
|
||||||
return new Date(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, parse date only
|
|
||||||
const [year, month, day] = str.split("-").map((p) => parseInt(p));
|
const [year, month, day] = str.split("-").map((p) => parseInt(p));
|
||||||
|
|
||||||
return new Date(year, month - 1, day, 0, 0, 0, 0);
|
return new Date(year, month - 1, day, 0, 0, 0, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { GenericDoc } from "ChillDocStoreAssets/types/generic_doc";
|
import { GenericDoc } from "ChillDocStoreAssets/types/generic_doc";
|
||||||
import { StoredObject, StoredObjectStatus } from "ChillDocStoreAssets/types";
|
import { StoredObject, StoredObjectStatus } from "ChillDocStoreAssets/types";
|
||||||
|
import {Person} from "../../../ChillPersonBundle/Resources/public/types";
|
||||||
|
|
||||||
export interface DateTime {
|
export interface DateTime {
|
||||||
datetime: string;
|
datetime: string;
|
||||||
@@ -202,6 +203,55 @@ export interface WorkflowAttachment {
|
|||||||
genericDoc: null | GenericDoc;
|
genericDoc: null | GenericDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Workflow {
|
||||||
|
name: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EntityWorkflowStep {
|
||||||
|
type: "entity_workflow_step";
|
||||||
|
id: number;
|
||||||
|
comment: string;
|
||||||
|
currentStep: StepDefinition;
|
||||||
|
isFinal: boolean;
|
||||||
|
isFreezed: boolean;
|
||||||
|
isFinalized: boolean;
|
||||||
|
transitionPrevious: Transition | null;
|
||||||
|
transitionAfter: Transition | null;
|
||||||
|
previousId: number | null;
|
||||||
|
nextId: number | null;
|
||||||
|
transitionPreviousBy: User | null;
|
||||||
|
transitionPreviousAt: DateTime | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Transition {
|
||||||
|
name: string;
|
||||||
|
text: string;
|
||||||
|
isForward: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StepDefinition {
|
||||||
|
name: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EntityWorkflow {
|
||||||
|
type: "entity_workflow";
|
||||||
|
id: number;
|
||||||
|
relatedEntityClass: string;
|
||||||
|
relatedEntityId: number;
|
||||||
|
workflow: Workflow;
|
||||||
|
currentStep: EntityWorkflowStep;
|
||||||
|
steps: EntityWorkflowStep[];
|
||||||
|
datas: WorkflowData;
|
||||||
|
title: string;
|
||||||
|
isOnHoldAtCurrentStep: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowData {
|
||||||
|
persons: Person[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface ExportGeneration {
|
export interface ExportGeneration {
|
||||||
id: string;
|
id: string;
|
||||||
type: "export_generation";
|
type: "export_generation";
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, useTemplateRef } from "vue";
|
import {computed, onMounted, ref, useTemplateRef} from "vue";
|
||||||
import type { WorkflowAttachment } from "ChillMainAssets/types";
|
import type {EntityWorkflow, WorkflowAttachment} from "ChillMainAssets/types";
|
||||||
import PickGenericDocModal from "ChillMainAssets/vuejs/WorkflowAttachment/Component/PickGenericDocModal.vue";
|
import PickGenericDocModal from "ChillMainAssets/vuejs/WorkflowAttachment/Component/PickGenericDocModal.vue";
|
||||||
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
||||||
import AttachmentList from "ChillMainAssets/vuejs/WorkflowAttachment/Component/AttachmentList.vue";
|
import AttachmentList from "ChillMainAssets/vuejs/WorkflowAttachment/Component/AttachmentList.vue";
|
||||||
import { GenericDoc } from "ChillDocStoreAssets/types";
|
import { GenericDoc } from "ChillDocStoreAssets/types";
|
||||||
|
import {fetch_generic_docs_by_accompanying_period, fetchWorkflow} from "ChillDocStoreAssets/js/generic-doc-api";
|
||||||
|
|
||||||
interface AppConfig {
|
interface AppConfig {
|
||||||
workflowId: number;
|
workflowId: number;
|
||||||
@@ -34,6 +35,13 @@ const attachedGenericDoc = computed<GenericDocForAccompanyingPeriod[]>(
|
|||||||
) as GenericDocForAccompanyingPeriod[],
|
) as GenericDocForAccompanyingPeriod[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const workflow = ref<EntityWorkflow | null>(null);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
workflow.value = await fetchWorkflow(Number(props.workflowId));
|
||||||
|
console.log('workflow', workflow.value);
|
||||||
|
});
|
||||||
|
|
||||||
const openModal = function () {
|
const openModal = function () {
|
||||||
pickDocModal.value?.openModal();
|
pickDocModal.value?.openModal();
|
||||||
};
|
};
|
||||||
@@ -53,12 +61,14 @@ const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<pick-generic-doc-modal
|
<pick-generic-doc-modal
|
||||||
|
:workflow="workflow"
|
||||||
:accompanying-period-id="props.accompanyingPeriodId"
|
:accompanying-period-id="props.accompanyingPeriodId"
|
||||||
:to-remove="attachedGenericDoc"
|
:to-remove="attachedGenericDoc"
|
||||||
ref="pickDocModal"
|
ref="pickDocModal"
|
||||||
@pickGenericDoc="onPickGenericDoc"
|
@pickGenericDoc="onPickGenericDoc"
|
||||||
></pick-generic-doc-modal>
|
></pick-generic-doc-modal>
|
||||||
<attachment-list
|
<attachment-list
|
||||||
|
:workflow="workflow"
|
||||||
:attachments="props.attachments"
|
:attachments="props.attachments"
|
||||||
@removeAttachment="onRemoveAttachment"
|
@removeAttachment="onRemoveAttachment"
|
||||||
></attachment-list>
|
></attachment-list>
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { WorkflowAttachment } from "ChillMainAssets/types";
|
import {EntityWorkflow, WorkflowAttachment} from "ChillMainAssets/types";
|
||||||
import GenericDocItemBox from "ChillMainAssets/vuejs/WorkflowAttachment/Component/GenericDocItemBox.vue";
|
import GenericDocItemBox from "ChillMainAssets/vuejs/WorkflowAttachment/Component/GenericDocItemBox.vue";
|
||||||
import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue";
|
import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue";
|
||||||
|
|
||||||
interface AttachmentListProps {
|
interface AttachmentListProps {
|
||||||
attachments: WorkflowAttachment[];
|
attachments: WorkflowAttachment[];
|
||||||
|
workflow: EntityWorkflow | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -36,7 +37,7 @@ const props = defineProps<AttachmentListProps>();
|
|||||||
:stored-object="a.genericDoc.storedObject"
|
:stored-object="a.genericDoc.storedObject"
|
||||||
></document-action-buttons-group>
|
></document-action-buttons-group>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li v-if="!workflow?.currentStep.isFinal">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="btn btn-delete"
|
class="btn btn-delete"
|
||||||
|
@@ -1,13 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import {GenericDoc, GenericDocForAccompanyingPeriod,} from "ChillDocStoreAssets/types/generic_doc";
|
||||||
GenericDoc,
|
|
||||||
GenericDocForAccompanyingPeriod,
|
|
||||||
} from "ChillDocStoreAssets/types/generic_doc";
|
|
||||||
import PickGenericDocItem from "ChillMainAssets/vuejs/WorkflowAttachment/Component/PickGenericDocItem.vue";
|
import PickGenericDocItem from "ChillMainAssets/vuejs/WorkflowAttachment/Component/PickGenericDocItem.vue";
|
||||||
import { fetch_generic_docs_by_accompanying_period } from "ChillDocStoreAssets/js/generic-doc-api";
|
import {fetch_generic_docs_by_accompanying_period} from "ChillDocStoreAssets/js/generic-doc-api";
|
||||||
import { computed, onMounted, ref } from "vue";
|
import {computed, onMounted, ref} from "vue";
|
||||||
|
import {EntityWorkflow} from "ChillMainAssets/types";
|
||||||
|
|
||||||
interface PickGenericDocProps {
|
interface PickGenericDocProps {
|
||||||
|
workflow: EntityWorkflow | null;
|
||||||
accompanyingPeriodId: number;
|
accompanyingPeriodId: number;
|
||||||
pickedList: GenericDocForAccompanyingPeriod[];
|
pickedList: GenericDocForAccompanyingPeriod[];
|
||||||
toRemove: GenericDocForAccompanyingPeriod[];
|
toRemove: GenericDocForAccompanyingPeriod[];
|
||||||
@@ -36,9 +35,19 @@ const isPicked = (genericDoc: GenericDocForAccompanyingPeriod): boolean =>
|
|||||||
) !== -1;
|
) !== -1;
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
genericDocs.value = await fetch_generic_docs_by_accompanying_period(
|
const fetchedGenericDocs = await fetch_generic_docs_by_accompanying_period(
|
||||||
props.accompanyingPeriodId,
|
props.accompanyingPeriodId,
|
||||||
);
|
);
|
||||||
|
const documentClasses = [
|
||||||
|
"Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument",
|
||||||
|
"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
|
||||||
|
"Chill\\DocStoreBundle\\Entity\\PersonDocument"
|
||||||
|
];
|
||||||
|
|
||||||
|
genericDocs.value = fetchedGenericDocs.filter(doc =>
|
||||||
|
!documentClasses.includes(props.workflow?.relatedEntityClass || '') ||
|
||||||
|
props.workflow?.relatedEntityId !== doc.identifiers.id
|
||||||
|
);
|
||||||
loaded.value = true;
|
loaded.value = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -3,8 +3,10 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
|||||||
import { computed, ref, useTemplateRef } from "vue";
|
import { computed, ref, useTemplateRef } from "vue";
|
||||||
import PickGenericDoc from "ChillMainAssets/vuejs/WorkflowAttachment/Component/PickGenericDoc.vue";
|
import PickGenericDoc from "ChillMainAssets/vuejs/WorkflowAttachment/Component/PickGenericDoc.vue";
|
||||||
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
||||||
|
import {EntityWorkflow} from "ChillMainAssets/types";
|
||||||
|
|
||||||
interface PickGenericDocModalProps {
|
interface PickGenericDocModalProps {
|
||||||
|
workflow: EntityWorkflow | null;
|
||||||
accompanyingPeriodId: number;
|
accompanyingPeriodId: number;
|
||||||
toRemove: GenericDocForAccompanyingPeriod[];
|
toRemove: GenericDocForAccompanyingPeriod[];
|
||||||
}
|
}
|
||||||
@@ -80,6 +82,7 @@ defineExpose({ openModal, closeModal });
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<pick-generic-doc
|
<pick-generic-doc
|
||||||
|
:workflow="props.workflow"
|
||||||
:accompanying-period-id="props.accompanyingPeriodId"
|
:accompanying-period-id="props.accompanyingPeriodId"
|
||||||
:to-remove="props.toRemove"
|
:to-remove="props.toRemove"
|
||||||
:picked-list="pickeds"
|
:picked-list="pickeds"
|
||||||
|
@@ -58,12 +58,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
{% if signatures|length > 0 %}
|
||||||
|
<section class="step my-4">{% include '@ChillMain/Workflow/_signature.html.twig' %}</section>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<section class="step my-4">{% include '@ChillMain/Workflow/_attachment.html.twig' %}</section>
|
<section class="step my-4">{% include '@ChillMain/Workflow/_attachment.html.twig' %}</section>
|
||||||
|
|
||||||
<section class="step my-4">{% include '@ChillMain/Workflow/_follow.html.twig' %}</section>
|
<section class="step my-4">{% include '@ChillMain/Workflow/_follow.html.twig' %}</section>
|
||||||
{% if signatures|length > 0 %}
|
{% if entity_workflow.currentStep.sends|length > 0 %}
|
||||||
<section class="step my-4">{% include '@ChillMain/Workflow/_signature.html.twig' %}</section>
|
|
||||||
{% elseif entity_workflow.currentStep.sends|length > 0 %}
|
|
||||||
<section class="step my-4">
|
<section class="step my-4">
|
||||||
<h2>{{ 'workflow.external_views.title'|trans({'numberOfSends': entity_workflow.currentStep.sends|length }) }}</h2>
|
<h2>{{ 'workflow.external_views.title'|trans({'numberOfSends': entity_workflow.currentStep.sends|length }) }}</h2>
|
||||||
{% include '@ChillMain/Workflow/_send_views_list.html.twig' with {'sends': entity_workflow.currentStep.sends} %}
|
{% include '@ChillMain/Workflow/_send_views_list.html.twig' with {'sends': entity_workflow.currentStep.sends} %}
|
||||||
|
@@ -965,6 +965,31 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/UserJob"
|
$ref: "#/components/schemas/UserJob"
|
||||||
|
/1.0/main/workflow/{id}.json:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- workflow
|
||||||
|
summary: Return a workflow
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
description: The workflow id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: integer
|
||||||
|
minimum: 1
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "ok"
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Workflow"
|
||||||
|
404:
|
||||||
|
description: "not found"
|
||||||
|
401:
|
||||||
|
description: "Unauthorized"
|
||||||
/1.0/main/workflow/my:
|
/1.0/main/workflow/my:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
|
@@ -32,16 +32,9 @@
|
|||||||
<div class="wl-col list">
|
<div class="wl-col list">
|
||||||
<div class="d-flex flex-column justify-content-center">
|
<div class="d-flex flex-column justify-content-center">
|
||||||
{% if app != null %}
|
{% if app != null %}
|
||||||
{% if acp.closingDate != null %}
|
<div class="date">
|
||||||
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
|
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
||||||
'%opening_date%': acp.openingDate|format_date('long'),
|
</div>
|
||||||
'%closing_date%': acp.closingDate|format_date('long')}
|
|
||||||
) }}
|
|
||||||
{% else %}
|
|
||||||
<div class="date">
|
|
||||||
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
|
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
|
||||||
@@ -77,20 +70,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if acp.step == 'CLOSED' and acp.closingMotive is not null %}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
<h3 class="closingMotive">{{ 'Closing motive'|trans }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
<div>
|
|
||||||
{{ acp.closingMotive.name|localize_translatable_string }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
{% if acp.user is not null %}
|
{% if acp.user is not null %}
|
||||||
<div class="wl-row">
|
<div class="wl-row">
|
||||||
<div class="wl-col title">
|
<div class="wl-col title">
|
||||||
|
@@ -624,7 +624,8 @@ final class SingleTaskController extends AbstractController
|
|||||||
->addCheckbox('status', $statuses, $statuses, $statusTrans);
|
->addCheckbox('status', $statuses, $statuses, $statusTrans);
|
||||||
|
|
||||||
$states = $this->singleTaskStateRepository->findAllExistingStates();
|
$states = $this->singleTaskStateRepository->findAllExistingStates();
|
||||||
$checked = array_values(array_filter($states, fn (string $state) => !in_array($state, ['to_validate', 'in_progress', 'closed', 'canceled', 'validated'], true)));
|
$checked = array_values(array_filter($states, fn (string $state) => !in_array($state, ['in_progress', 'closed', 'canceled', 'validated'], true)));
|
||||||
|
|
||||||
if ([] !== $states) {
|
if ([] !== $states) {
|
||||||
$filterBuilder
|
$filterBuilder
|
||||||
->addCheckbox('states', $states, $checked);
|
->addCheckbox('states', $states, $checked);
|
||||||
|
Reference in New Issue
Block a user