mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 07:14:58 +00:00
Merge branch 'master' into 285-cancel-calendar
This commit is contained in:
@@ -68,14 +68,23 @@
|
||||
socialActionsSelected.length)
|
||||
"
|
||||
>
|
||||
<check-social-action
|
||||
v-for="action in socialActionsList"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@updateSelected="updateActionsSelected"
|
||||
<div
|
||||
id="actionsList"
|
||||
v-for="group in socialActionsList"
|
||||
:key="group.issue"
|
||||
>
|
||||
</check-social-action>
|
||||
<span class="badge bg-chill-l-gray text-dark">{{
|
||||
group.issue
|
||||
}}</span>
|
||||
<check-social-action
|
||||
v-for="action in group.actions"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@updateSelected="updateActionsSelected"
|
||||
>
|
||||
</check-social-action>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<span
|
||||
@@ -249,7 +258,23 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "ChillMainAssets/module/bootstrap/shared";
|
||||
@import "ChillPersonAssets/chill/scss/mixins";
|
||||
@import "ChillMainAssets/chill/scss/chill_variables";
|
||||
|
||||
span.multiselect__single {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#actionsList {
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
margin: 0.5rem;
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
span.badge {
|
||||
margin-bottom: 0.5rem;
|
||||
@include badge_social($social-issue-color);
|
||||
}
|
||||
</style>
|
||||
|
@@ -10,7 +10,9 @@
|
||||
:value="action"
|
||||
/>
|
||||
<label class="form-check-label" :for="action.id">
|
||||
<span class="badge bg-light text-dark">{{ action.text }}</span>
|
||||
<span class="badge bg-light text-dark" :title="action.text">{{
|
||||
action.text
|
||||
}}</span>
|
||||
</label>
|
||||
</div>
|
||||
</span>
|
||||
@@ -43,5 +45,9 @@ span.badge {
|
||||
font-size: 95%;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 1em;
|
||||
max-width: 100%; /* Adjust as needed */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
@@ -124,9 +124,19 @@ const store = createStore({
|
||||
);
|
||||
},
|
||||
socialActionsListSorted(state) {
|
||||
return [...state.socialActionsList].sort(
|
||||
(a, b) => a.ordering - b.ordering,
|
||||
);
|
||||
return [...state.socialActionsList]
|
||||
.sort((a, b) => a.ordering - b.ordering)
|
||||
.reduce((acc, action) => {
|
||||
const issueText = action.issue?.text || "Uncategorized";
|
||||
// Find if the group for the issue already exists
|
||||
let group = acc.find((item) => item.issue === issueText);
|
||||
if (!group) {
|
||||
group = { issue: issueText, actions: [] };
|
||||
acc.push(group);
|
||||
}
|
||||
group.actions.push(action);
|
||||
return acc;
|
||||
}, []);
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
|
@@ -96,13 +96,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||
<template v-slot:eventContent="arg: EventApi">
|
||||
<template v-slot:eventContent="{ arg }: { arg: { event: EventApi } }">
|
||||
<span :class="eventClasses(arg.event)">
|
||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
||||
arg.event.title
|
||||
}}</b>
|
||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
||||
>{{ arg.timeText }} -
|
||||
>{{ arg.event.startStr }} -
|
||||
{{ arg.event.extendedProps.locationName }}</b
|
||||
>
|
||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
||||
|
@@ -2,26 +2,26 @@
|
||||
<teleport to="body">
|
||||
<modal v-if="modalOpen" @close="modalOpen = false">
|
||||
<template v-slot:header>
|
||||
<h2>{{ $t("signature_confirmation") }}</h2>
|
||||
<h2>{{ trans(SIGNATURES_SIGNATURE_CONFIRMATION) }}</h2>
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<div class="signature-modal-body text-center" v-if="loading">
|
||||
<p>{{ $t("electronic_signature_in_progress") }}</p>
|
||||
<p>{{ trans(SIGNATURES_ELECTRONIC_SIGNATURE_IN_PROGRESS) }}</p>
|
||||
<div class="loading">
|
||||
<i
|
||||
class="fa fa-circle-o-notch fa-spin fa-3x"
|
||||
:title="$t('loading')"
|
||||
:title="trans(SIGNATURES_LOADING)"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="signature-modal-body text-center" v-else>
|
||||
<p>{{ $t("you_are_going_to_sign") }}</p>
|
||||
<p>{{ $t("are_you_sure") }}</p>
|
||||
<p>{{ trans(SIGNATURES_YOU_ARE_GOING_TO_SIGN) }}</p>
|
||||
<p>{{ trans(SIGNATURES_ARE_YOU_SURE) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button class="btn btn-action" @click.prevent="confirmSign">
|
||||
{{ $t("yes") }}
|
||||
{{ trans(SIGNATURES_YES) }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -82,7 +82,7 @@
|
||||
@change="toggleMultiPage"
|
||||
/>
|
||||
<label class="form-check-label" for="checkboxMulti">
|
||||
{{ $t("all_pages") }}
|
||||
{{ trans(SIGNATURES_ALL_PAGES) }}
|
||||
</label>
|
||||
</template>
|
||||
</div>
|
||||
@@ -91,24 +91,19 @@
|
||||
class="col-5 p-0 text-center turnSignature"
|
||||
>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone === null ||
|
||||
userSignatureZone?.index < 1
|
||||
"
|
||||
:disabled="isFirstSignatureZone"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
>
|
||||
{{ $t("last_zone") }}
|
||||
{{ trans(SIGNATURES_LAST_ZONE) }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone?.index >= signature.zones.length - 1
|
||||
"
|
||||
:disabled="isLastSignatureZone"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ $t("next_zone") }}
|
||||
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||
@@ -117,9 +112,9 @@
|
||||
:hidden="!userSignatureZone"
|
||||
@click="undoSign"
|
||||
v-if="signature.zones.length > 1"
|
||||
:title="$t('choose_another_signature')"
|
||||
:title="trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE)"
|
||||
>
|
||||
{{ $t("another_zone") }}
|
||||
{{ trans(SIGNATURES_ANOTHER_ZONE) }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-misc btn-sm"
|
||||
@@ -127,7 +122,7 @@
|
||||
@click="undoSign"
|
||||
v-else
|
||||
>
|
||||
{{ $t("cancel") }}
|
||||
{{ trans(SIGNATURES_CANCEL) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="userSignatureZone === null"
|
||||
@@ -139,7 +134,7 @@
|
||||
active: canvasEvent === 'add',
|
||||
}"
|
||||
@click="toggleAddZone()"
|
||||
:title="$t('add_sign_zone')"
|
||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||
>
|
||||
<template v-if="canvasEvent === 'add'">
|
||||
<div
|
||||
@@ -191,7 +186,7 @@
|
||||
@change="toggleMultiPage"
|
||||
/>
|
||||
<label class="form-check-label" for="checkboxMulti">
|
||||
{{ $t("see_all_pages") }}
|
||||
{{ trans(SIGNATURES_SEE_ALL_PAGES) }}
|
||||
</label>
|
||||
</template>
|
||||
</div>
|
||||
@@ -200,49 +195,48 @@
|
||||
class="col-4 d-xl-none text-center turnSignature p-0"
|
||||
>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone === null ||
|
||||
userSignatureZone?.index < 1
|
||||
"
|
||||
:disabled="!hasSignatureZoneSelected"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
>
|
||||
{{ $t("last_zone") }}
|
||||
{{ trans(SIGNATURES_LAST_ZONE) }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone?.index >= signature.zones.length - 1
|
||||
"
|
||||
:disabled="isLastSignatureZone"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ $t("next_zone") }}
|
||||
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature">
|
||||
<button
|
||||
class="btn btn-light btn-sm"
|
||||
@click="goToSignatureZoneUnique"
|
||||
>
|
||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length > 0 && signedState !== 'signed'"
|
||||
v-if="signature.zones.length > 1 && signedState !== 'signed'"
|
||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
||||
>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone === null ||
|
||||
userSignatureZone?.index < 1
|
||||
"
|
||||
:disabled="isFirstSignatureZone"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
>
|
||||
{{ $t("last_sign_zone") }}
|
||||
{{ trans(SIGNATURES_LAST_SIGN_ZONE) }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone?.index >= signature.zones.length - 1
|
||||
"
|
||||
:disabled="isLastSignatureZone"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ $t("next_sign_zone") }}
|
||||
{{ trans(SIGNATURES_NEXT_SIGN_ZONE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||
@@ -252,7 +246,7 @@
|
||||
@click="undoSign"
|
||||
v-if="signature.zones.length > 1"
|
||||
>
|
||||
{{ $t("choose_another_signature") }}
|
||||
{{ trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE) }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-misc btn-sm"
|
||||
@@ -260,7 +254,7 @@
|
||||
@click="undoSign"
|
||||
v-else
|
||||
>
|
||||
{{ $t("cancel") }}
|
||||
{{ trans(SIGNATURES_CANCEL) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="userSignatureZone === null"
|
||||
@@ -272,13 +266,13 @@
|
||||
active: canvasEvent === 'add',
|
||||
}"
|
||||
@click="toggleAddZone()"
|
||||
:title="$t('add_sign_zone')"
|
||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||
>
|
||||
<template v-if="canvasEvent !== 'add'">
|
||||
{{ $t("add_zone") }}
|
||||
{{ trans(SIGNATURES_ADD_ZONE) }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ $t("click_on_document") }}
|
||||
{{ trans(SIGNATURES_CLICK_ON_DOCUMENT) }}
|
||||
<div
|
||||
class="spinner-border spinner-border-sm"
|
||||
role="status"
|
||||
@@ -312,10 +306,10 @@
|
||||
v-if="signedState !== 'signed'"
|
||||
:href="getReturnPath()"
|
||||
>
|
||||
{{ $t("cancel") }}
|
||||
{{ trans(SIGNATURES_CANCEL) }}
|
||||
</a>
|
||||
<a class="btn btn-misc" v-else :href="getReturnPath()">
|
||||
{{ $t("return") }}
|
||||
{{ trans(SIGNATURES_RETURN) }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||
@@ -324,7 +318,7 @@
|
||||
:disabled="!userSignatureZone"
|
||||
@click="sign"
|
||||
>
|
||||
{{ $t("sign") }}
|
||||
{{ trans(SIGNATURES_SIGN) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4" v-else></div>
|
||||
@@ -333,7 +327,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, Ref, reactive } from "vue";
|
||||
import { ref, Ref, computed } from "vue";
|
||||
import { useToast } from "vue-toast-notification";
|
||||
import "vue-toast-notification/dist/theme-sugar.css";
|
||||
import {
|
||||
@@ -344,25 +338,48 @@ import {
|
||||
SignedState,
|
||||
ZoomLevel,
|
||||
} from "../../types";
|
||||
import { makeFetch } from "../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import * as pdfjsLib from "pdfjs-dist";
|
||||
import {
|
||||
PDFDocumentProxy,
|
||||
PDFPageProxy,
|
||||
} from "pdfjs-dist/types/src/display/api";
|
||||
|
||||
// @ts-ignore
|
||||
import {
|
||||
SIGNATURES_YES,
|
||||
SIGNATURES_ARE_YOU_SURE,
|
||||
SIGNATURES_YOU_ARE_GOING_TO_SIGN,
|
||||
SIGNATURES_SIGNATURE_CONFIRMATION,
|
||||
SIGNATURES_SIGN,
|
||||
SIGNATURES_CHOOSE_ANOTHER_SIGNATURE,
|
||||
SIGNATURES_CANCEL,
|
||||
SIGNATURES_LAST_SIGN_ZONE,
|
||||
SIGNATURES_NEXT_SIGN_ZONE,
|
||||
SIGNATURES_ADD_SIGN_ZONE,
|
||||
SIGNATURES_CLICK_ON_DOCUMENT,
|
||||
SIGNATURES_LAST_ZONE,
|
||||
SIGNATURES_NEXT_ZONE,
|
||||
SIGNATURES_ADD_ZONE,
|
||||
SIGNATURES_ANOTHER_ZONE,
|
||||
SIGNATURES_ELECTRONIC_SIGNATURE_IN_PROGRESS,
|
||||
SIGNATURES_LOADING,
|
||||
SIGNATURES_RETURN,
|
||||
SIGNATURES_SEE_ALL_PAGES,
|
||||
SIGNATURES_ALL_PAGES,
|
||||
SIGNATURES_GO_TO_SIGNATURE_UNIQUE,
|
||||
trans
|
||||
} from "translator";
|
||||
|
||||
|
||||
// @ts-ignore incredible but the console.log is needed
|
||||
import * as PdfWorker from "pdfjs-dist/build/pdf.worker.mjs";
|
||||
console.log(PdfWorker); // incredible but this is needed
|
||||
console.log(PdfWorker);
|
||||
|
||||
// import { PdfWorker } from 'pdfjs-dist/build/pdf.worker.mjs'
|
||||
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
|
||||
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||
import {
|
||||
download_and_decrypt_doc,
|
||||
download_doc_as_pdf,
|
||||
} from "../StoredObjectButton/helpers";
|
||||
import { download_doc_as_pdf } from "../StoredObjectButton/helpers";
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
|
||||
|
||||
@@ -433,6 +450,22 @@ const $toast = useToast();
|
||||
|
||||
const signature = window.signature;
|
||||
|
||||
const isFirstSignatureZone = () => {
|
||||
console.log(userSignatureZone.value?.index)
|
||||
return userSignatureZone.value?.index ? userSignatureZone.value.index < 1 : false;
|
||||
}
|
||||
const isLastSignatureZone = () =>
|
||||
userSignatureZone.value?.index
|
||||
? userSignatureZone.value.index >= signature.zones.length - 1
|
||||
: false;
|
||||
|
||||
/**
|
||||
* Return true if the user has selected a user zone (existing on the doc or created by the user)
|
||||
*/
|
||||
const hasSignatureZoneSelected = computed<boolean>(
|
||||
() => userSignatureZone.value !== null,
|
||||
);
|
||||
|
||||
const setZoomLevel = async (zoomLevel: string) => {
|
||||
zoom.value = Number.parseFloat(zoomLevel);
|
||||
await resetPages();
|
||||
@@ -604,6 +637,15 @@ const turnPage = async (upOrDown: number) => {
|
||||
}
|
||||
};
|
||||
|
||||
const goToSignatureZoneUnique = () => {
|
||||
let signatureZone = signature.zones[0];
|
||||
|
||||
page.value = signatureZone.PDFPage.index + 1;
|
||||
const canvas = getCanvas(signatureZone.PDFPage.index + 1);
|
||||
selectZone(signatureZone, canvas);
|
||||
canvas.scrollIntoView();
|
||||
}
|
||||
|
||||
const turnSignature = async (upOrDown: number) => {
|
||||
let zoneIndex = userSignatureZone.value?.index ?? -1;
|
||||
if (zoneIndex < -1) {
|
||||
@@ -754,7 +796,7 @@ const confirmSign = () => {
|
||||
zone: userSignatureZone.value,
|
||||
};
|
||||
makeFetch("POST", url, body)
|
||||
.then((r) => {
|
||||
.then(() => {
|
||||
checkForReady();
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -776,9 +818,7 @@ const undoSign = async () => {
|
||||
};
|
||||
|
||||
const toggleAddZone = () => {
|
||||
canvasEvent.value === "select"
|
||||
? (canvasEvent.value = "add")
|
||||
: (canvasEvent.value = "select");
|
||||
canvasEvent.value = canvasEvent.value === "select" ? "add" : "select";
|
||||
};
|
||||
|
||||
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {
|
||||
|
@@ -28,6 +28,10 @@ const open = () => {
|
||||
state.opened = true;
|
||||
};
|
||||
|
||||
const onRestoreVersion = (payload: {
|
||||
newVersion: StoredObjectVersionWithPointInTime;
|
||||
}) => emit("restoreVersion", payload);
|
||||
|
||||
defineExpose({ open });
|
||||
</script>
|
||||
<template>
|
||||
@@ -42,9 +46,7 @@ defineExpose({ open });
|
||||
:versions="props.versions"
|
||||
:can-edit="canEdit"
|
||||
:stored-object="storedObject"
|
||||
@restore-version="
|
||||
(payload) => emit('restoreVersion', payload)
|
||||
"
|
||||
@restore-version="onRestoreVersion"
|
||||
></history-button-list>
|
||||
</template>
|
||||
</modal>
|
||||
|
@@ -99,3 +99,30 @@ CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE: Modifier un document
|
||||
entity_display_title:
|
||||
Document (n°%doc%): "Document (n°%doc%)"
|
||||
Doc for evaluation (n°%eval%): Document de l'évaluation n°%eval%
|
||||
|
||||
|
||||
# SIGNATURES
|
||||
|
||||
signatures:
|
||||
yes: Oui
|
||||
are_you_sure: Êtes-vous sûr·e?
|
||||
you_are_going_to_sign: Vous allez signer le document
|
||||
signature_confirmation: Confirmation de la signature
|
||||
sign: Signer
|
||||
choose_another_signature: Choisir une autre zone
|
||||
cancel: Annuler
|
||||
last_sign_zone: Zone de signature précédente
|
||||
next_sign_zone: Zone de signature suivante
|
||||
add_sign_zone: Ajouter une zone de signature
|
||||
click_on_document: Cliquer sur le document
|
||||
last_zone: Zone précédente
|
||||
next_zone: Zone suivante
|
||||
add_zone: Ajouter une zone
|
||||
another_zone: Autre zone
|
||||
electronic_signature_in_progress: Signature électronique en cours...
|
||||
loading: Chargement...
|
||||
remove_sign_zone: Enlever la zone
|
||||
return: Retour
|
||||
see_all_pages: Voir toutes les pages
|
||||
all_pages: Toutes les pages
|
||||
go_to_signature_unique: Aller vers zone de signature
|
||||
|
@@ -63,7 +63,6 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
parent::getSubscribedServices(),
|
||||
[
|
||||
'chill_main.paginator_factory' => PaginatorFactory::class,
|
||||
ManagerRegistry::class => ManagerRegistry::class,
|
||||
'translator' => TranslatorInterface::class,
|
||||
AuthorizationHelper::class => AuthorizationHelper::class,
|
||||
EventDispatcherInterface::class => EventDispatcherInterface::class,
|
||||
@@ -213,7 +212,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
|
||||
protected function getManagerRegistry(): ManagerRegistry
|
||||
{
|
||||
return $this->container->get(ManagerRegistry::class);
|
||||
return $this->container->get('doctrine');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,7 +225,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
|
||||
protected function getValidator(): ValidatorInterface
|
||||
{
|
||||
return $this->get('validator');
|
||||
return $this->container->get('validator');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -75,8 +75,8 @@ final class UserGroupRepository implements UserGroupRepositoryInterface, LocaleA
|
||||
->setWhereClauses('
|
||||
ug.active AND (
|
||||
SIMILARITY(LOWER(UNACCENT(?)), ug.label->>?) > 0.15
|
||||
OR ug.label->>? LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
||||
', [$pattern, $lang, $pattern, $lang]);
|
||||
OR LOWER(UNACCENT(ug.label->>?)) LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
||||
', [$pattern, $lang, $lang, $pattern]);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
@@ -12,10 +12,6 @@ function loadDynamicPicker(element) {
|
||||
let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
|
||||
|
||||
apps.forEach(function (el) {
|
||||
let suggested;
|
||||
let as_id;
|
||||
let submit_on_adding_new_entity;
|
||||
let label;
|
||||
const isMultiple = parseInt(el.dataset.multiple) === 1,
|
||||
uniqId = el.dataset.uniqid,
|
||||
input = element.querySelector(
|
||||
@@ -26,12 +22,12 @@ function loadDynamicPicker(element) {
|
||||
? JSON.parse(input.value)
|
||||
: input.value === "[]" || input.value === ""
|
||||
? null
|
||||
: [JSON.parse(input.value)];
|
||||
suggested = JSON.parse(el.dataset.suggested);
|
||||
as_id = parseInt(el.dataset.asId) === 1;
|
||||
submit_on_adding_new_entity =
|
||||
parseInt(el.dataset.submitOnAddingNewEntity) === 1;
|
||||
label = el.dataset.label;
|
||||
: [JSON.parse(input.value)],
|
||||
suggested = JSON.parse(el.dataset.suggested),
|
||||
as_id = parseInt(el.dataset.asId) === 1,
|
||||
submit_on_adding_new_entity =
|
||||
parseInt(el.dataset.submitOnAddingNewEntity) === 1,
|
||||
label = el.dataset.label;
|
||||
|
||||
if (!isMultiple) {
|
||||
if (input.value === "[]") {
|
||||
|
@@ -45,6 +45,10 @@ const onPickGenericDoc = ({
|
||||
}) => {
|
||||
emit("pickGenericDoc", { genericDoc });
|
||||
};
|
||||
|
||||
const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
|
||||
emit("removeAttachment", payload);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -56,7 +60,7 @@ const onPickGenericDoc = ({
|
||||
></pick-generic-doc-modal>
|
||||
<attachment-list
|
||||
:attachments="props.attachments"
|
||||
@removeAttachment="(payload) => emit('removeAttachment', payload)"
|
||||
@removeAttachment="onRemoveAttachment"
|
||||
></attachment-list>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
|
@@ -72,6 +72,14 @@ const placeTrans = (str: string): string => {
|
||||
}
|
||||
};
|
||||
|
||||
const onPickDocument = (payload: {
|
||||
genericDoc: GenericDocForAccompanyingPeriod;
|
||||
}) => emit("pickGenericDoc", payload);
|
||||
|
||||
const onRemoveGenericDoc = (payload: {
|
||||
genericDoc: GenericDocForAccompanyingPeriod;
|
||||
}) => emit("removeGenericDoc", payload);
|
||||
|
||||
const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
||||
if (false === loaded.value) {
|
||||
return [];
|
||||
@@ -245,10 +253,8 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
||||
:accompanying-period-id="accompanyingPeriodId"
|
||||
:genericDoc="g"
|
||||
:is-picked="isPicked(g)"
|
||||
@pickGenericDoc="(payload) => emit('pickGenericDoc', payload)"
|
||||
@removeGenericDoc="
|
||||
(payload) => emit('removeGenericDoc', payload)
|
||||
"
|
||||
@pickGenericDoc="onPickDocument"
|
||||
@removeGenericDoc="onRemoveGenericDoc"
|
||||
></pick-generic-doc-item>
|
||||
</div>
|
||||
<div v-else class="text-center chill-no-data-statement">
|
||||
|
@@ -68,8 +68,8 @@ class AddressReferenceBEFromBestAddress
|
||||
$csv->setDelimiter(',');
|
||||
$csv->setHeaderOffset(0);
|
||||
|
||||
$stmt = Statement::create()
|
||||
->process($csv);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv);
|
||||
|
||||
foreach ($stmt as $record) {
|
||||
$this->baseImporter->importAddress(
|
||||
|
@@ -55,32 +55,32 @@ class AddressReferenceFromBAN
|
||||
|
||||
$csv = Reader::createFromStream($csvDecompressed);
|
||||
$csv->setDelimiter(';')->setHeaderOffset(0);
|
||||
$stmt = Statement::create()
|
||||
->process($csv, [
|
||||
'id',
|
||||
'id_fantoir',
|
||||
'numero',
|
||||
'rep',
|
||||
'nom_voie',
|
||||
'code_postal',
|
||||
'code_insee',
|
||||
'nom_commune',
|
||||
'code_insee_ancienne_commune',
|
||||
'nom_ancienne_commune',
|
||||
'x',
|
||||
'y',
|
||||
'lon',
|
||||
'lat',
|
||||
'type_position',
|
||||
'alias',
|
||||
'nom_ld',
|
||||
'libelle_acheminement',
|
||||
'nom_afnor',
|
||||
'source_position',
|
||||
'source_nom_voie',
|
||||
'certification_commune',
|
||||
'cad_parcelles',
|
||||
]);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv, [
|
||||
'id',
|
||||
'id_fantoir',
|
||||
'numero',
|
||||
'rep',
|
||||
'nom_voie',
|
||||
'code_postal',
|
||||
'code_insee',
|
||||
'nom_commune',
|
||||
'code_insee_ancienne_commune',
|
||||
'nom_ancienne_commune',
|
||||
'x',
|
||||
'y',
|
||||
'lon',
|
||||
'lat',
|
||||
'type_position',
|
||||
'alias',
|
||||
'nom_ld',
|
||||
'libelle_acheminement',
|
||||
'nom_afnor',
|
||||
'source_position',
|
||||
'source_nom_voie',
|
||||
'certification_commune',
|
||||
'cad_parcelles',
|
||||
]);
|
||||
|
||||
foreach ($stmt as $record) {
|
||||
$this->baseImporter->importAddress(
|
||||
|
@@ -43,17 +43,17 @@ class AddressReferenceFromBano
|
||||
|
||||
$csv = Reader::createFromStream($file);
|
||||
$csv->setDelimiter(',');
|
||||
$stmt = Statement::create()
|
||||
->process($csv, [
|
||||
'refId',
|
||||
'streetNumber',
|
||||
'street',
|
||||
'postcode',
|
||||
'city',
|
||||
'_o',
|
||||
'lat',
|
||||
'lon',
|
||||
]);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv, [
|
||||
'refId',
|
||||
'streetNumber',
|
||||
'street',
|
||||
'postcode',
|
||||
'city',
|
||||
'_o',
|
||||
'lat',
|
||||
'lon',
|
||||
]);
|
||||
|
||||
foreach ($stmt as $record) {
|
||||
$this->baseImporter->importAddress(
|
||||
|
@@ -54,7 +54,8 @@ class AddressReferenceLU
|
||||
|
||||
private function process_address(Reader $csv, ?string $sendAddressReportToEmail = null): void
|
||||
{
|
||||
$stmt = Statement::create()->process($csv);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv);
|
||||
foreach ($stmt as $record) {
|
||||
$this->addressBaseImporter->importAddress(
|
||||
$record['id_geoportail'],
|
||||
@@ -74,7 +75,8 @@ class AddressReferenceLU
|
||||
|
||||
private function process_postal_code(Reader $csv): void
|
||||
{
|
||||
$stmt = Statement::create()->process($csv);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv);
|
||||
$arr_postal_codes = [];
|
||||
foreach ($stmt as $record) {
|
||||
if (false === \array_key_exists($record['code_postal'], $arr_postal_codes)) {
|
||||
|
Reference in New Issue
Block a user