Commit 288434b1 by Damien Moulard

Merge branch 'ssa-gironde' into 5657-prestataire-data-self-administration

parents 1b71e285 54ca3a9e
...@@ -330,6 +330,11 @@ form[name="formEncaissement"] label { ...@@ -330,6 +330,11 @@ form[name="formEncaissement"] label {
border-color: transparent transparent black transparent; border-color: transparent transparent black transparent;
} }
.global-evaluation-container {
background-color:powderblue;
border-radius:10px;
border: 5px solid powderblue;
}
/** /**
* END Success check animation. * END Success check animation.
*/ */
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"/build/app.a8f5cd0d.js" "/build/app.a8f5cd0d.js"
], ],
"css": [ "css": [
"/build/app.9c351632.css" "/build/app.8e23f36c.css"
] ]
}, },
"admin": { "admin": {
......
{ {
"build/app.css": "/build/app.9c351632.css", "build/app.css": "/build/app.8e23f36c.css",
"build/app.js": "/build/app.a8f5cd0d.js", "build/app.js": "/build/app.a8f5cd0d.js",
"build/admin.css": "/build/admin.5dc0eea7.css", "build/admin.css": "/build/admin.5dc0eea7.css",
"build/admin.js": "/build/admin.cee4d78d.js", "build/admin.js": "/build/admin.cee4d78d.js",
......
(()=>{"use strict";var e={913:()=>{try{self["workbox:core:6.5.1"]&&_()}catch(e){}},977:()=>{try{self["workbox:precaching:6.5.1"]&&_()}catch(e){}},80:()=>{try{self["workbox:routing:6.5.1"]&&_()}catch(e){}},873:()=>{try{self["workbox:strategies:6.5.1"]&&_()}catch(e){}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,s),r.exports}(()=>{s(913);const e=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},n=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),r=e=>e||n(a.precache),i=e=>e||n(a.runtime);function c(e,t){const s=t();return e.waitUntil(s),s}s(977);function o(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:a}=e;if(!a)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(a,location.href),r=new URL(a,location.href);return n.searchParams.set("__WB_REVISION__",s),{cacheKey:n.href,url:r.href}}class h{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class l{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}let u;async function f(e,s){let a=null;if(e.url){a=new URL(e.url).origin}if(a!==self.location.origin)throw new t("cross-origin-copy-response",{origin:a});const n=e.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=s?s(r):r,c=function(){if(void 0===u){const e=new Response("");if("body"in e)try{new Response(e.body),u=!0}catch(e){u=!1}u=!1}return u}()?n.body:await n.blob();return new Response(c,i)}function d(e,t){const s=new URL(e);for(const e of t)s.searchParams.delete(e);return s.href}class p{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const g=new Set;s(873);function y(e){return"string"==typeof e?new Request(e):e}class w{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new p,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let a=y(e);if("navigate"===a.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?a.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:s})}catch(e){if(e instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}const r=a.clone();try{let e;e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(e){throw n&&await this.runCallbacks("fetchDidFail",{error:e,event:s,originalRequest:n.clone(),request:r.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=y(e);let s;const{cacheName:a,matchOptions:n}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},n),{cacheName:a});s=await caches.match(r,i);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await e({cacheName:a,matchOptions:n,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(e,s){const a=y(e);var n;await(n=0,new Promise((e=>setTimeout(e,n))));const r=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:(i=r.url,new URL(String(i),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var i;const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:o,matchOptions:h}=this._strategy,l=await self.caches.open(o),u=this.hasCallback("cacheDidUpdate"),f=u?await async function(e,t,s,a){const n=d(t.url,s);if(t.url===n)return e.match(t,a);const r=Object.assign(Object.assign({},a),{ignoreSearch:!0}),i=await e.keys(t,r);for(const t of i)if(n===d(t.url,s))return e.match(t,a)}(l,r.clone(),["__WB_REVISION__"],h):null;try{await l.put(r,u?c.clone():c)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of g)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:o,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=y(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const s=this._pluginStateMap.get(t),a=a=>{const n=Object.assign(Object.assign({},a),{state:s});return t[e](n)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class m extends class{constructor(e={}){this.cacheName=i(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,n=new w(this,{event:t,request:s,params:a}),r=this._getResponse(n,s,t);return[r,this._awaitComplete(r,n,s,t)]}async _getResponse(e,s,a){let n;await e.runCallbacks("handlerWillStart",{event:a,request:s});try{if(n=await this._handle(s,e),!n||"error"===n.type)throw new t("no-response",{url:s.url})}catch(t){if(t instanceof Error)for(const r of e.iterateCallbacks("handlerDidError"))if(n=await r({error:t,event:a,request:s}),n)break;if(!n)throw t}for(const t of e.iterateCallbacks("handlerWillRespond"))n=await t({event:a,request:s,response:n});return n}async _awaitComplete(e,t,s,a){let n,r;try{n=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(r=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:n,error:r}),t.destroy(),r)throw r}}{constructor(e={}){e.cacheName=r(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(m.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let a;const n=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=n.integrity,r=e.integrity,i=!r||r===t;if(a=await s.fetch(new Request(e,{integrity:r||t})),t&&i){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,a.clone());0}}return a}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const a=await s.fetch(e);if(!await s.cachePut(e,a.clone()))throw new t("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,a]of this.plugins.entries())a!==m.copyRedirectedCacheableResponsesPlugin&&(a===m.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(m.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}m.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},m.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await f(e):e};class _{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new m({cacheName:r(e),plugins:[...t,new l({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const a of e){"string"==typeof a?s.push(a):a&&void 0===a.revision&&s.push(a.url);const{cacheKey:e,url:n}=o(a),r="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,a.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,r),s.length>0){const e=`Workbox is precaching URLs without revision info: ${s.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return c(e,(async()=>{const t=new h;this.strategy.plugins.push(t);for(const[t,s]of this._urlsToCacheKeys){const a=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(t),r=new Request(t,{integrity:a,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:e}))}const{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}}))}activate(e){return c(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(const n of t)s.has(n.url)||(await e.delete(n),a.push(n.url));return{deletedURLs:a}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}let R;const v=()=>(R||(R=new _),R);s(80);const C=e=>e&&"object"==typeof e?e:{handle:e};class b{constructor(e,t,s="GET"){this.handler=C(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=C(e)}}class q extends b{constructor(e,t,s){super((({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)}),t,s)}}class U{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return void 0;const a=s.origin===location.origin,{params:n,route:r}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:s});let i=r&&r.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return void 0;let o;try{o=i.handle({url:s,request:e,event:t,params:n})}catch(e){o=Promise.reject(e)}const h=r&&r.catchHandler;return o instanceof Promise&&(this._catchHandler||h)&&(o=o.catch((async a=>{if(h){0;try{return await h.handle({url:s,request:e,event:t,params:n})}catch(e){e instanceof Error&&(a=e)}}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a}))),o}findMatchingRoute({url:e,sameOrigin:t,request:s,event:a}){const n=this._routes.get(s.method)||[];for(const r of n){let n;const i=r.match({url:e,sameOrigin:t,request:s,event:a});if(i)return n=i,(Array.isArray(n)&&0===n.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"==typeof i)&&(n=void 0),{route:r,params:n}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t("unregister-route-but-not-found-with-method",{method:e.method});const s=this._routes.get(e.method).indexOf(e);if(!(s>-1))throw new t("unregister-route-route-not-registered");this._routes.get(e.method).splice(s,1)}}let L;class k extends b{constructor(e,t){super((({request:s})=>{const a=e.getURLsToCacheKeys();for(const n of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:a=!0,urlManipulation:n}={}){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e,t=[]){for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(a){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(n){const e=n({url:r});for(const t of e)yield t.href}}(s.url,t)){const t=a.get(n);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}function K(e){const s=v();!function(e,s,a){let n;if("string"==typeof e){const t=new URL(e,location.href);n=new b((({url:e})=>e.href===t.href),s,a)}else if(e instanceof RegExp)n=new q(e,s,a);else if("function"==typeof e)n=new b(e,s,a);else{if(!(e instanceof b))throw new t("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=e}(L||(L=new U,L.addFetchListener(),L.addCacheListener()),L).registerRoute(n)}(new k(s,e))}var T;(function(e){v().precache(e)})([{'revision':null,'url':'/build/admin.5dc0eea7.css'},{'revision':null,'url':'/build/admin.cee4d78d.js'},{'revision':'ad79405d542b397996a3079203114b42','url':'/build/admin.cee4d78d.js.LICENSE.txt'},{'revision':null,'url':'/build/app.9c351632.css'},{'revision':null,'url':'/build/app.a8f5cd0d.js'},{'revision':'4ff7361e3c3e359ae88c5fae5738746d','url':'/build/app.a8f5cd0d.js.LICENSE.txt'},{'revision':null,'url':'/build/fonts/fa-brands-400.3dc44d22.woff2'},{'revision':null,'url':'/build/fonts/fa-regular-400.3dc6ca01.woff2'},{'revision':null,'url':'/build/fonts/fa-solid-900.496d5fc1.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-300.d2c7d5c5.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-600.17c0392c.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-600italic.cc34c6e7.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-700.ed37bc60.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-900.476756cd.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-italic.a07cb9c5.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-regular.f74389bd.woff2'},{'revision':null,'url':'/build/images/fa-brands-400.05d20183.svg'},{'revision':null,'url':'/build/images/fa-regular-400.9a0810d6.svg'},{'revision':null,'url':'/build/images/fa-solid-900.a838c42a.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-300.4e7fe004.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-600.cf2758ae.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-600italic.7249d863.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-700.3e4b9e19.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-900.060d8c51.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-italic.08dc9b1c.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-regular.3bb9538c.svg'},{'revision':null,'url':'/build/runtime.6ad5c9da.js'}]),K(T),self.addEventListener("fetch",(function(e){e.respondWith(caches.match(e.request).then((function(t){return t||fetch(e.request)})).catch((function(){return caches.match("/offline.html")})))}))})()})(); (()=>{"use strict";var e={913:()=>{try{self["workbox:core:6.5.1"]&&_()}catch(e){}},977:()=>{try{self["workbox:precaching:6.5.1"]&&_()}catch(e){}},80:()=>{try{self["workbox:routing:6.5.1"]&&_()}catch(e){}},873:()=>{try{self["workbox:strategies:6.5.1"]&&_()}catch(e){}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,s),r.exports}(()=>{s(913);const e=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},n=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),r=e=>e||n(a.precache),i=e=>e||n(a.runtime);function c(e,t){const s=t();return e.waitUntil(s),s}s(977);function o(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:a}=e;if(!a)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(a,location.href),r=new URL(a,location.href);return n.searchParams.set("__WB_REVISION__",s),{cacheKey:n.href,url:r.href}}class h{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class l{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}let u;async function f(e,s){let a=null;if(e.url){a=new URL(e.url).origin}if(a!==self.location.origin)throw new t("cross-origin-copy-response",{origin:a});const n=e.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=s?s(r):r,c=function(){if(void 0===u){const e=new Response("");if("body"in e)try{new Response(e.body),u=!0}catch(e){u=!1}u=!1}return u}()?n.body:await n.blob();return new Response(c,i)}function d(e,t){const s=new URL(e);for(const e of t)s.searchParams.delete(e);return s.href}class p{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const g=new Set;s(873);function y(e){return"string"==typeof e?new Request(e):e}class w{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new p,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let a=y(e);if("navigate"===a.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?a.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:s})}catch(e){if(e instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}const r=a.clone();try{let e;e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(e){throw n&&await this.runCallbacks("fetchDidFail",{error:e,event:s,originalRequest:n.clone(),request:r.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=y(e);let s;const{cacheName:a,matchOptions:n}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},n),{cacheName:a});s=await caches.match(r,i);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await e({cacheName:a,matchOptions:n,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(e,s){const a=y(e);var n;await(n=0,new Promise((e=>setTimeout(e,n))));const r=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:(i=r.url,new URL(String(i),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var i;const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:o,matchOptions:h}=this._strategy,l=await self.caches.open(o),u=this.hasCallback("cacheDidUpdate"),f=u?await async function(e,t,s,a){const n=d(t.url,s);if(t.url===n)return e.match(t,a);const r=Object.assign(Object.assign({},a),{ignoreSearch:!0}),i=await e.keys(t,r);for(const t of i)if(n===d(t.url,s))return e.match(t,a)}(l,r.clone(),["__WB_REVISION__"],h):null;try{await l.put(r,u?c.clone():c)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of g)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:o,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=y(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const s=this._pluginStateMap.get(t),a=a=>{const n=Object.assign(Object.assign({},a),{state:s});return t[e](n)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class m extends class{constructor(e={}){this.cacheName=i(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,n=new w(this,{event:t,request:s,params:a}),r=this._getResponse(n,s,t);return[r,this._awaitComplete(r,n,s,t)]}async _getResponse(e,s,a){let n;await e.runCallbacks("handlerWillStart",{event:a,request:s});try{if(n=await this._handle(s,e),!n||"error"===n.type)throw new t("no-response",{url:s.url})}catch(t){if(t instanceof Error)for(const r of e.iterateCallbacks("handlerDidError"))if(n=await r({error:t,event:a,request:s}),n)break;if(!n)throw t}for(const t of e.iterateCallbacks("handlerWillRespond"))n=await t({event:a,request:s,response:n});return n}async _awaitComplete(e,t,s,a){let n,r;try{n=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(r=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:n,error:r}),t.destroy(),r)throw r}}{constructor(e={}){e.cacheName=r(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(m.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let a;const n=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=n.integrity,r=e.integrity,i=!r||r===t;if(a=await s.fetch(new Request(e,{integrity:r||t})),t&&i){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,a.clone());0}}return a}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const a=await s.fetch(e);if(!await s.cachePut(e,a.clone()))throw new t("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,a]of this.plugins.entries())a!==m.copyRedirectedCacheableResponsesPlugin&&(a===m.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(m.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}m.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},m.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await f(e):e};class _{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new m({cacheName:r(e),plugins:[...t,new l({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const a of e){"string"==typeof a?s.push(a):a&&void 0===a.revision&&s.push(a.url);const{cacheKey:e,url:n}=o(a),r="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,a.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,r),s.length>0){const e=`Workbox is precaching URLs without revision info: ${s.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return c(e,(async()=>{const t=new h;this.strategy.plugins.push(t);for(const[t,s]of this._urlsToCacheKeys){const a=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(t),r=new Request(t,{integrity:a,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:e}))}const{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}}))}activate(e){return c(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(const n of t)s.has(n.url)||(await e.delete(n),a.push(n.url));return{deletedURLs:a}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}let R;const v=()=>(R||(R=new _),R);s(80);const C=e=>e&&"object"==typeof e?e:{handle:e};class b{constructor(e,t,s="GET"){this.handler=C(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=C(e)}}class q extends b{constructor(e,t,s){super((({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)}),t,s)}}class U{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return void 0;const a=s.origin===location.origin,{params:n,route:r}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:s});let i=r&&r.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return void 0;let o;try{o=i.handle({url:s,request:e,event:t,params:n})}catch(e){o=Promise.reject(e)}const h=r&&r.catchHandler;return o instanceof Promise&&(this._catchHandler||h)&&(o=o.catch((async a=>{if(h){0;try{return await h.handle({url:s,request:e,event:t,params:n})}catch(e){e instanceof Error&&(a=e)}}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a}))),o}findMatchingRoute({url:e,sameOrigin:t,request:s,event:a}){const n=this._routes.get(s.method)||[];for(const r of n){let n;const i=r.match({url:e,sameOrigin:t,request:s,event:a});if(i)return n=i,(Array.isArray(n)&&0===n.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"==typeof i)&&(n=void 0),{route:r,params:n}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t("unregister-route-but-not-found-with-method",{method:e.method});const s=this._routes.get(e.method).indexOf(e);if(!(s>-1))throw new t("unregister-route-route-not-registered");this._routes.get(e.method).splice(s,1)}}let L;class k extends b{constructor(e,t){super((({request:s})=>{const a=e.getURLsToCacheKeys();for(const n of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:a=!0,urlManipulation:n}={}){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e,t=[]){for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(a){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(n){const e=n({url:r});for(const t of e)yield t.href}}(s.url,t)){const t=a.get(n);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}function K(e){const s=v();!function(e,s,a){let n;if("string"==typeof e){const t=new URL(e,location.href);n=new b((({url:e})=>e.href===t.href),s,a)}else if(e instanceof RegExp)n=new q(e,s,a);else if("function"==typeof e)n=new b(e,s,a);else{if(!(e instanceof b))throw new t("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=e}(L||(L=new U,L.addFetchListener(),L.addCacheListener()),L).registerRoute(n)}(new k(s,e))}var T;(function(e){v().precache(e)})([{'revision':null,'url':'/build/admin.5dc0eea7.css'},{'revision':null,'url':'/build/admin.cee4d78d.js'},{'revision':'ad79405d542b397996a3079203114b42','url':'/build/admin.cee4d78d.js.LICENSE.txt'},{'revision':null,'url':'/build/app.8e23f36c.css'},{'revision':null,'url':'/build/app.a8f5cd0d.js'},{'revision':'4ff7361e3c3e359ae88c5fae5738746d','url':'/build/app.a8f5cd0d.js.LICENSE.txt'},{'revision':null,'url':'/build/fonts/fa-brands-400.3dc44d22.woff2'},{'revision':null,'url':'/build/fonts/fa-regular-400.3dc6ca01.woff2'},{'revision':null,'url':'/build/fonts/fa-solid-900.496d5fc1.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-300.d2c7d5c5.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-600.17c0392c.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-600italic.cc34c6e7.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-700.ed37bc60.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-900.476756cd.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-italic.a07cb9c5.woff2'},{'revision':null,'url':'/build/fonts/source-sans-pro-v14-latin-regular.f74389bd.woff2'},{'revision':null,'url':'/build/images/fa-brands-400.05d20183.svg'},{'revision':null,'url':'/build/images/fa-regular-400.9a0810d6.svg'},{'revision':null,'url':'/build/images/fa-solid-900.a838c42a.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-300.4e7fe004.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-600.cf2758ae.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-600italic.7249d863.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-700.3e4b9e19.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-900.060d8c51.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-italic.08dc9b1c.svg'},{'revision':null,'url':'/build/images/source-sans-pro-v14-latin-regular.3bb9538c.svg'},{'revision':null,'url':'/build/runtime.6ad5c9da.js'}]),K(T),self.addEventListener("fetch",(function(e){e.respondWith(caches.match(e.request).then((function(t){return t||fetch(e.request)})).catch((function(){return caches.match("/offline.html")})))}))})()})();
\ No newline at end of file \ No newline at end of file
...@@ -8,15 +8,21 @@ use App\Entity\AccountPrestataire; ...@@ -8,15 +8,21 @@ use App\Entity\AccountPrestataire;
use App\Entity\AccountSiege; use App\Entity\AccountSiege;
use App\Entity\Comptoir; use App\Entity\Comptoir;
use App\Entity\Geoloc; use App\Entity\Geoloc;
use App\Entity\GeolocPrestataire;
use App\Entity\GlobalParameter; use App\Entity\GlobalParameter;
use App\Entity\Groupe; use App\Entity\Groupe;
use App\Entity\Prestataire; use App\Entity\Prestataire;
use App\Entity\SelfEvalPrestaQuiz;
use App\Entity\Siege; use App\Entity\Siege;
use App\Entity\User; use App\Entity\User;
use App\Entity\Usergroup; use App\Entity\Usergroup;
use App\Enum\CurrencyEnum; use App\Enum\CurrencyEnum;
use App\Form\Type\DistributorSelfEvalPrestaQuizType;
use App\Form\Type\InfosPrestaQuizType;
use App\Form\Type\InstallFormType; use App\Form\Type\InstallFormType;
use App\Form\Type\ProducerSelfEvalPrestaQuizType;
use App\Security\LoginAuthenticator; use App\Security\LoginAuthenticator;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Event\FilterUserResponseEvent; use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\FOSUserEvents;
...@@ -35,11 +41,11 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface; ...@@ -35,11 +41,11 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\Security as Secur; use Symfony\Component\Security\Core\Security as Secur;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Security\Guard\GuardAuthenticatorHandler; use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;
use Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken; use Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken;
use Symfony\Component\Security\Core\Security;
class IndexController extends AbstractController class IndexController extends AbstractController
{ {
...@@ -53,6 +59,7 @@ class IndexController extends AbstractController ...@@ -53,6 +59,7 @@ class IndexController extends AbstractController
private $tokenStorage; private $tokenStorage;
private $router; private $router;
private $security; private $security;
private $mailer;
public function __construct( public function __construct(
EventDispatcherInterface $eventDispatcher, EventDispatcherInterface $eventDispatcher,
...@@ -64,7 +71,8 @@ class IndexController extends AbstractController ...@@ -64,7 +71,8 @@ class IndexController extends AbstractController
LoginAuthenticator $authenticator, LoginAuthenticator $authenticator,
TokenStorageInterface $tokenStorage, TokenStorageInterface $tokenStorage,
RouterInterface $router, RouterInterface $router,
Security $security Security $security,
\Swift_Mailer $mailer
) { ) {
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
$this->em = $em; $this->em = $em;
...@@ -76,7 +84,8 @@ class IndexController extends AbstractController ...@@ -76,7 +84,8 @@ class IndexController extends AbstractController
$this->tokenStorage = $tokenStorage; $this->tokenStorage = $tokenStorage;
$this->router = $router; $this->router = $router;
$this->security = $security; $this->security = $security;
} $this->mailer = $mailer;
}
/** /**
* @Route("/", name="index") * @Route("/", name="index")
...@@ -105,16 +114,20 @@ class IndexController extends AbstractController ...@@ -105,16 +114,20 @@ class IndexController extends AbstractController
} }
if ( if (
isset($_GET["upswd"]) isset($_GET['upswd'])
&& $_GET["upswd"] == "success" && 'success' == $_GET['upswd']
&& $this->security->isGranted('ROLE_ADHERENT') && $this->security->isGranted('ROLE_ADHERENT')
&& $this->getParameter('tav_env') == true && true == $this->getParameter('tav_env')
) { ) {
$this->addFlash( $this->addFlash(
'warning', 'warning',
'Suite à la modification de votre mot de passe, pensez à mettre à jour votre code de paiment pour pouvoir effectuer des achats.' 'Suite à la modification de votre mot de passe, pensez à mettre à jour votre code de paiment pour pouvoir effectuer des achats.'
); );
} }
list($redirRoute,$presta) = $this->getAndDispatchPrestataire('index');
if ($redirRoute) {
return $this->redirectToRoute($redirRoute);
}
return $this->render('@kohinos/' . $template, [ return $this->render('@kohinos/' . $template, [
'news' => [], 'news' => [],
...@@ -124,6 +137,87 @@ class IndexController extends AbstractController ...@@ -124,6 +137,87 @@ class IndexController extends AbstractController
} }
/** /**
* This method is core method to guide the new
* prestataire when using presta_self_init_and_eval mode.
* It is basically a state machine that returns the appropriate
* route path depending on current state (details in the body).
* It also provides the prestataire object itself for convenience
* (not so easy to fetch from user when prestataire is disabled).
* @param $origin
* @return array|null[]
*/
private function getAndDispatchPrestataire($origin)
{
/*
* Go to home page if process is not active or if user is not connected as adherent.
* Second filter is just an easy way to early detect anonymous users.
* Why adherent ? Because once prestataire is created disabled and after is has been linked
* to some user, this user will connect to the platform as an adherent (because prestataire is disabled).
*/
if (!$this->getParameter('presta_self_init_and_eval')
|| !$this->security->isGranted('ROLE_ADHERENT')) { //not sure ROLE_ADHERENT is the proper check here
$destination = 'index';
return $destination !== $origin ? [$destination, null] : [null, null];
}
//Fetch the prestataire even when it is disabled
/* @var ArrayCollection $prestas */
if ($this->em->getFilters()->isEnabled('enabled_filter')) {
$this->em->getFilters()->disable('enabled_filter');
}
$prestas = $this->em->getRepository(Prestataire::class)->findByData(['user' => $this->security->getUser()]);
if (!$this->em->getFilters()->isEnabled('enabled_filter')) {
$this->em->getFilters()->enable('enabled_filter');
}
if (!$prestas) {
$destination = 'index';
return $destination !== $origin ? [$destination, null] : [null, null];
}
/* @var Prestataire $presta */
$presta = $prestas[0];
//Go to home page if the prestataire is enabled
if ($presta->isEnabled()) {
$destination = 'index';
return $destination !== $origin ? [$destination, $presta] : [null, $presta];
}
//Go to "all forms already sent, please just wait now" page if questionnaire has been submitted already
if ($presta->getSelfEvalPrestaQuiz()) {
$destination = 'prestaquiz-sent';
return $destination !== $origin ? [$destination, $presta] : [null, $presta];
}
//Go to questionnaire if first identification form has been submitted
//Condition is detected using market_channel_function attributes which is
//set in the first form (it is also the only mandatory attribute to start
//the self-eval part)
if ($presta->getMarketChannelFunction()) {
$destination = 'prestaquiz-selfeval';
return $destination !== $origin ? [$destination, $presta] : [null, $presta];
}
//In other cases, start the subscription process
$destination = 'prestaquiz-infos';
return $destination !== $origin ? [$destination, $presta] : [null, $presta];
}
/**
* @Route("/prestaquiz-sent", name="prestaquiz-sent")
*/
public function prestaQuizSent(Request $request): Response
{
list($redirRoute,$presta) = $this->getAndDispatchPrestataire('prestaquiz-sent');
if ($redirRoute) {
return $this->redirectToRoute($redirRoute);
}
return $this->render('@kohinos/tav/prestaquiz_sent.html.twig');
}
/**
* @Route("/manifest.json", name="manifest") * @Route("/manifest.json", name="manifest")
*/ */
public function manifest(Request $request) public function manifest(Request $request)
...@@ -140,6 +234,105 @@ class IndexController extends AbstractController ...@@ -140,6 +234,105 @@ class IndexController extends AbstractController
} }
/** /**
* @Route("/prestaquiz-infos", name="prestaquiz-infos")
*/
public function prestaQuizInfosAction(Request $request): Response
{
list($redirRoute,$presta) = $this->getAndDispatchPrestataire('prestaquiz-infos');
if ($redirRoute) {
return $this->redirectToRoute($redirRoute);
}
/* @var Prestataire $presta */
if(!$presta->getGeolocs() || $presta->getGeolocs()->isEmpty()) {
$address = new GeolocPrestataire();
$presta->addGeoloc($address);
}
$form = $this->createForm(InfosPrestaQuizType::class, $presta);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->security->getUser()->setFirstName($form->get('userFirstName')->getData());
$this->security->getUser()->setLastName($form->get('userLastName')->getData());
$this->em->flush();
list($redirRoute,$presta) = $this->getAndDispatchPrestataire('prestaquiz-infos');
if ($redirRoute) {
return $this->redirectToRoute($redirRoute);
}
}
return $this->render('@kohinos/tav/infos_prestaquiz.html.twig', [
'form' => $form->createView(),
]);
}
/**
* @Route("/prestaquiz-selfeval", name="prestaquiz-selfeval")
*/
public function prestaQuizSelfEvalAction(Request $request): Response
{
list($redirRoute,$presta) = $this->getAndDispatchPrestataire('prestaquiz-selfeval');
if ($redirRoute) {
return $this->redirectToRoute($redirRoute);
}
/* @var Prestataire $presta */
$formClass = Prestataire::DISTRIBUTOR === $presta->getMarketChannelFunction() ?
DistributorSelfEvalPrestaQuizType::class : ProducerSelfEvalPrestaQuizType::class;
$quiz = new SelfEvalPrestaQuiz();
$form = $this->createForm($formClass, $quiz);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$presta->setSelfEvalPrestaQuiz($quiz);
$this->em->persist($quiz);
$this->em->flush();
//Send email !
$this->notifyGestionnaireAfterPrestaquizSent($presta);
list($redirRoute,$presta) = $this->getAndDispatchPrestataire('prestaquiz-selfeval');
if ($redirRoute) {
return $this->redirectToRoute($redirRoute);
}
}
$tmpl = Prestataire::DISTRIBUTOR === $presta->getMarketChannelFunction() ?
'@kohinos/tav/distributor_selfeval_prestaquiz.html.twig'
: '@kohinos/tav/producer_selfeval_prestaquiz.html.twig';
return $this->render($tmpl, [
'form' => $form->createView(),
]);
}
private function notifyGestionnaireAfterPrestaquizSent(Prestataire $presta)
{
$user = $this->security->getUser();
$gestionnaires = $presta->getGroupe()->getGestionnaires();
if(!$gestionnaires || $gestionnaires->isEmpty() || !$gestionnaires->first()->getEmail()) {
$to = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_CONTACT_EMAIL);
} else {
$to = $gestionnaires->first()->getEmail();
}
$subject = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NAME_SMALL)
. ' : Réception questionnaire point de vente';
$mail = (new \Swift_Message($subject))
->setFrom($this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NOTIF_EMAIL)) //using $from here sometimes fails with 550 5.7.1 Sender mismatch
->setTo($to)
->setBody("L'utilisateur " . $user->getUsername()
. " vient de soumettre un questionnaire pour le point de vente " . $presta->getRaison() . "."
);
$this->mailer->send($mail);
}
/**
* @Route("/installation", name="installation") * @Route("/installation", name="installation")
*/ */
public function installationAction(Request $request) public function installationAction(Request $request)
...@@ -379,7 +572,7 @@ class IndexController extends AbstractController ...@@ -379,7 +572,7 @@ class IndexController extends AbstractController
$this->session->set('_groupegere', $groupe); $this->session->set('_groupegere', $groupe);
$this->reloadUserTokenFromGroup($group, $request); $this->reloadUserTokenFromGroup($group, $request);
if ($this->getParameter('tav_env') == true) { if (true == $this->getParameter('tav_env')) {
return $this->redirectToRoute('index'); return $this->redirectToRoute('index');
} else { } else {
return $this->redirectToRoute('sonata_admin_dashboard'); return $this->redirectToRoute('sonata_admin_dashboard');
...@@ -412,7 +605,7 @@ class IndexController extends AbstractController ...@@ -412,7 +605,7 @@ class IndexController extends AbstractController
$this->session->set('_comptoirgere', $comptoir); $this->session->set('_comptoirgere', $comptoir);
$this->reloadUserTokenFromGroup($group, $request); $this->reloadUserTokenFromGroup($group, $request);
if ($this->getParameter('tav_env') == true) { if (true == $this->getParameter('tav_env')) {
return $this->redirectToRoute('index'); return $this->redirectToRoute('index');
} else { } else {
return $this->redirectToRoute('sonata_admin_dashboard'); return $this->redirectToRoute('sonata_admin_dashboard');
......
...@@ -44,6 +44,9 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -44,6 +44,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
use HasEcompteEntity; use HasEcompteEntity;
use HasAccountsTrait; use HasAccountsTrait;
const DISTRIBUTOR = 'distributor';
const PRODUCER = 'producer';
/** /**
* @var \Ramsey\Uuid\UuidInterface * @var \Ramsey\Uuid\UuidInterface
* *
...@@ -198,6 +201,22 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -198,6 +201,22 @@ class Prestataire extends AccountableObject implements AccountableInterface
private $horaires; private $horaires;
/** /**
* @var string|null (champ libre)
*
* @ORM\Column(name="marketchannelfunction", type="text", nullable=true)
* @Groups({"read", "write"})
*/
private $marketchannelfunction;
public function setMarketChannelFunction($var)
{
$this->marketchannelfunction = $var;
}
public function getMarketChannelFunction()
{
return $this->marketchannelfunction;
}
/**
* @var TypePrestataire * @var TypePrestataire
* *
* @ORM\ManyToOne(targetEntity="TypePrestataire", cascade={"persist"}, inversedBy="prestataires") * @ORM\ManyToOne(targetEntity="TypePrestataire", cascade={"persist"}, inversedBy="prestataires")
...@@ -206,6 +225,21 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -206,6 +225,21 @@ class Prestataire extends AccountableObject implements AccountableInterface
private $typeprestataire; private $typeprestataire;
/** /**
* @var SelfEvalPrestaQuiz
* @ORM\OneToOne(targetEntity="SelfEvalPrestaQuiz", cascade={"persist"})
* @ORM\JoinColumn(name="selfevalprestaquiz_id", referencedColumnName="id", nullable=true)
*/
protected $selfevalprestaquiz;
public function setSelfEvalPrestaQuiz($var)
{
$this->selfevalprestaquiz = $var;
}
public function getSelfEvalPrestaQuiz()
{
return $this->selfevalprestaquiz;
}
/**
* @var ArrayCollection|Rubrique[] * @var ArrayCollection|Rubrique[]
* @ORM\ManyToMany(targetEntity="Rubrique", mappedBy="prestataires", cascade={"persist"}, fetch="EXTRA_LAZY") * @ORM\ManyToMany(targetEntity="Rubrique", mappedBy="prestataires", cascade={"persist"}, fetch="EXTRA_LAZY")
* @Groups({"read", "write"}) * @Groups({"read", "write"})
...@@ -748,7 +782,7 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -748,7 +782,7 @@ class Prestataire extends AccountableObject implements AccountableInterface
* *
* @return $this * @return $this
*/ */
public function removeUser(User $users) public function removeUser(User $user)
{ {
if ($this->users->contains($user)) { if ($this->users->contains($user)) {
$this->users->removeElement($user); $this->users->removeElement($user);
...@@ -790,7 +824,7 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -790,7 +824,7 @@ class Prestataire extends AccountableObject implements AccountableInterface
* *
* @return $this * @return $this
*/ */
public function removeCaissier(User $caissiers) public function removeCaissier(User $caissier)
{ {
if ($this->caissiers->contains($caissier)) { if ($this->caissiers->contains($caissier)) {
$this->caissiers->removeElement($caissier); $this->caissiers->removeElement($caissier);
......
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity
* @ORM\Table(name="selfevalprestaquiz")
*/
class SelfEvalPrestaQuiz
{
/*
* This class is really just about storing results of a form in a database.
* Attributes are not going to be part of any logic code.
* I opt to set all attributes public to save coding time.
*/
/**
* @var \Ramsey\Uuid\UuidInterface
*
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
* @Groups({"read"})
*/
protected $id;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $accessib_geophy;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $accessib_tempor;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $accessib_edupop;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $accessib_divers;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $accessib_vulner;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $accessib_geophy_comment;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $accessib_tempor_comment;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $accessib_edupop_comment;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $accessib_divers_comment;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $accessib_vulner_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $bienetre_format;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $bienetre_format_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $bienetre_impgou;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $bienetre_impgou_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $bienetre_bienet;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $bienetre_bienet_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $bienetre_recben;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $bienetre_recben_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $transpar_jusrem;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $transpar_jusrem_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $transpar_transp;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $transpar_transp_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $transpar_relpro;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $transpar_relpro_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $disagdur_labels;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $disagdur_labels_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $disagdur_condur;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $disagdur_condur_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_labels;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_labels_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_valbio;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_valbio_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_ecorec;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_ecorec_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_pertes;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_pertes_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_climat;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_climat_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_geneti;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_geneti_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_prosol;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_prosol_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $localite_probru;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $localite_probru_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $localite_protra;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $localite_protra_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $accessib_global;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $accessib_global_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $bienetre_global;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $bienetre_global_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $transpar_global;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $transpar_global_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $disagdur_global;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $disagdur_global_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $proagdur_global;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $proagdur_global_comment;
/**
* @var int|null
* @ORM\Column(type="integer", nullable=true)
*/
public $localite_global;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
public $localite_global_comment;
}
<?php
namespace App\Form\Type;
use App\Entity\Prestataire;
use App\Entity\SelfEvalPrestaQuiz;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class DistributorSelfEvalPrestaQuizType extends SelfEvalPrestaQuizType
{
public function __construct()
{
parent::__construct();
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
/* PARTIE 3 : TRANSPARENCE ET JUSTE REMUNERATION */
$this->opts['label'] = "Juste rémunération : les prix d'achats aux producteurs correspondent-ils au coût de la production (y compris la rémunération) ?";
$this->opts['choices'] = [
$this->frown . " pas connaissance du coût de production des produits achetés" => 0,
$this->meh . " ne correspondent pas toujours mais connaissance du coût de production" => 1,
$this->smile . " oui" => 2,
];
$builder->add('transpar_jusrem', ChoiceType::class, $this->opts);
$builder->add('transpar_jusrem_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Transparence : les consommateurs peuvent-ils accéder à des informations leur permettant de comprendre
comment les prix des produits sont construits ?";
$this->opts['choices'] = [
$this->frown . " aucun moyen d'avoir accès aux informations" => 0,
$this->meh . " au moins via l'équipe en discutant" => 1,
$this->smile . " affichages et en discutant" => 2,
];
$builder->add('transpar_transp', ChoiceType::class, $this->opts);
$builder->add('transpar_transp_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Relation au producteur : sur l'offre alimentaire globale, quels sont les circuits de commercialisation majoritaires ?";
$this->opts['choices'] = [
$this->frown . " plus de 2 intermédiaires connus ou intraçable" => 0,
$this->meh . " 2 intermédiaires connus" => 1,
$this->smile . " 0 ou 1 intermédiaire connu" => 2,
];
$builder->add('transpar_relpro', ChoiceType::class, $this->opts);
$builder->add('transpar_relpro_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Transparence et juste rémunération : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('transpar_global', ChoiceType::class, $this->opts);
$builder->add('transpar_global_comment', TextareaType::class, $this->cmtOpts);
/* PARTIE 4 : PRATIQUES AGRICOLES DURABLES */
$this->opts['label'] = "Détenez-vous des labels ou des certifications (AB, Bio, Nature et Progrès, système de garantie
participatif ou équivalent minimum ?";
$this->opts['choices'] = [
$this->frown . " moins de 50 % des produits" => 0,
$this->meh . " entre 50 et 70% des produits" => 1,
$this->smile . " plus de 70 % des produits" => 2,
];
$builder->add('disagdur_labels', ChoiceType::class, $this->opts);
$builder->add('disagdur_labels_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Le lieu s'assure-t-il que ses produits alimentaires non labellisés mais conventionnables sont issus
de pratiques agricoles durables ?";
$this->opts['choices'] = [
$this->frown . " non" => 0,
$this->meh . " oui pas des échanges avec le producteur ou le revendeur qui connaît les pratiques agricoles du secteur" => 1,
$this->smile . " oui" => 2,
];
$builder->add('disagdur_condur', ChoiceType::class, $this->opts);
$builder->add('disagdur_condur_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Pratiques agricoles durables : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('disagdur_global', ChoiceType::class, $this->opts);
$builder->add('disagdur_global_comment', TextareaType::class, $this->cmtOpts);
/* PARTIE 5 : LOCALITE DES PRODUITS */
$this->opts['label'] = "Quelle est la provenance de l'offre alimentaire globale en produits bruts ?";
$this->opts['choices'] = [
$this->frown . " 0 à 49 % de produits locaux (moins de 250 km à la ronde)" => 0,
$this->meh . " 50 à 79 % de produits locaux (moins de 250 km à la ronde)" => 1,
$this->smile . " plus de 80 % de produits locaux (moins de 250 km à la ronde)" => 2,
];
$builder->add('localite_probru', ChoiceType::class, $this->opts);
$builder->add('localite_probru_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Quelle est la provenance de l'offre alimentaire globale en produits transformés ?";
$this->opts['choices'] = [
$this->frown . " 0 à 24 % de produits locaux (moins de 250 km à la ronde)" => 0,
$this->meh . " 25 à 49 % de produits locaux (moins de 250 km à la ronde)" => 1,
$this->smile . " plus de 50 % de produits locaux (moins de 250 km à la ronde)" => 2,
];
$builder->add('localite_protra', ChoiceType::class, $this->opts);
$builder->add('localite_protra_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Localité des produits : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('localite_global', ChoiceType::class, $this->opts);
$builder->add('localite_global_comment', TextareaType::class, $this->cmtOpts);
}
/**
*
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => SelfEvalPrestaQuiz::class,
]);
}
public function getBlockPrefix(): string
{
return 'formDistributorSelfEvalPrestaQuiz';
}
}
<?php
namespace App\Form\Type;
use App\Entity\Prestataire;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\NotNull;
/**
* Identification questionnaire for prestataire.
*/
class InfosPrestaQuizType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('userFirstName', TextType::class, [
'mapped' => false, //store it into the user
'label' => 'Prénom',
'required' => true,
'constraints' => [new NotNull()],
])
->add('userLastName', TextType::class, [
'mapped' => false, //store it into the user
'label' => 'Nom',
'required' => true,
'constraints' => [new NotNull()],
])
->add('raison', TextType::class, [
'required' => true,
'constraints' => [new NotNull()],
])
->add('responsable', TextType::class, [
'required' => true,
'constraints' => [new NotNull()],
])
->add('metier', TextType::class, [
'label' => 'Métier responsable',
'required' => true,
'constraints' => [new NotNull()],
])
->add('horaires', TextType::class, [
'label' => 'Jours, horaires et périodes de fermeture pour congés :',
'required' => true,
'constraints' => [new NotNull()],
])
->add('geolocs', CollectionType::class, [
'entry_type' => GeolocPrestataireFormType::class,
'entry_options' => ['label' => false, 'with_latlon' => false],
'required' => true,
'allow_add' => false,
'allow_delete' => false,
'by_reference' => false,
'label' => false,
])
->add('marketchannelfunction', ChoiceType::class, [
'label' => 'Fonction dans le circuit de distribution',
'choices' => [
'Distributeur/distributrice' => Prestataire::DISTRIBUTOR,
'Producteur/productrice' => Prestataire::PRODUCER,
],
'required' => true,
'constraints' => [new NotNull()],
])
->add('save', SubmitType::class, ['label' => 'Envoyer'])
;
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Prestataire::class,
]);
}
public function getBlockPrefix(): string
{
return 'formInfosPrestaQuiz';
}
}
<?php
namespace App\Form\Type;
use App\Entity\Prestataire;
use App\Entity\SelfEvalPrestaQuiz;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ProducerSelfEvalPrestaQuizType extends SelfEvalPrestaQuizType
{
public function __construct()
{
parent::__construct();
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
/* PARTIE 4 : PRATIQUES AGRICOLES DURABLES */
$this->opts['label'] = "Détenez-vous des labels ou des certifications (AB Bio, Nature et Progrès, système de garantie participatif ou équivalent minimum) ?";
$this->opts['choices'] = [
$this->frown . " non" => 0,
$this->smile . " oui" => 2,
];
$builder->add('proagdur_labels', ChoiceType::class, $this->opts);
$builder->add('proagdur_labels_comment', TextareaType::class, $this->cmtOpts);
//Jusqu'à la fin
$this->opts['choices'] = $this->stdChoices;
$this->opts['label'] = "Les pratiques agricoles permettent-elles de valoriser la biodiversité ?";
$builder->add('proagdur_valbio', ChoiceType::class, $this->opts);
$builder->add('proagdur_valbio_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Les pratiques agricoles permettent-elles l'économie ou le recyclage de l'énergie, de l'eau, de la matière organique, des nutriments ?";
$builder->add('proagdur_ecorec', ChoiceType::class, $this->opts);
$builder->add('proagdur_ecorec_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Les pratiques agricoles réduisent-elles les pertes agricoles (au champ ou post-récolte) ?";
$builder->add('proagdur_pertes', ChoiceType::class, $this->opts);
$builder->add('proagdur_pertes_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Les pratiques agricoles contribuent-elles à l'atténuation ou à l'adaptation au changement climatique ?";
$builder->add('proagdur_climat', ChoiceType::class, $this->opts);
$builder->add('proagdur_climat_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Les pratiques agricoles permettent-elles de renforcer l'autonomie de la ferme en ressources génétiques (végétales ou animales), en eau, en intrants, en énergie ?";
$builder->add('proagdur_geneti', ChoiceType::class, $this->opts);
$builder->add('proagdur_geneti_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Les pratiques agricoles permettent-elles la protection des sols ?";
$builder->add('proagdur_prosol', ChoiceType::class, $this->opts);
$builder->add('proagdur_prosol_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Pratiques agricoles durables : " . $this->labelEvalGlob . " (cochez vert si vous détenez un label ou une certification)";
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('proagdur_global', ChoiceType::class, $this->opts);
$builder->add('proagdur_global_comment', TextareaType::class, $this->cmtOpts);
}
/**
*
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => SelfEvalPrestaQuiz::class,
]);
}
public function getBlockPrefix(): string
{
return 'formProducerSelfEvalPrestaQuiz';
}
}
<?php
namespace App\Form\Type;
use App\Entity\SelfEvalPrestaQuiz;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\NotNull;
/**
*
* Self-eval prestataire questionnaire base class
* containing useful attributes and buildForm for
* sections that are common to distributors and producers
*/
class SelfEvalPrestaQuizType extends AbstractType
{
protected array $stdChoices;
protected array $opts;
protected array $cmtOpts;
protected string $labelEvalGlob;
protected string $frown;
protected string $meh;
protected string $smile;
public function __construct()
{
$this->frown = '<i class="fas fa-frown text-danger"></i>';
$this->meh = '<i class="fas fa-meh text-warning"></i>';
$this->smile = '<i class="fas fa-smile text-success"></i>';
$this->stdChoices = [
$this->frown . ' non' => 0,
$this->meh . ' moyennement' => 1,
$this->smile . ' oui' => 2,
];
$this->stdGlobalChoices = [
$this->frown => 0,
$this->meh => 1,
$this->smile => 2,
];
$this->opts = [
'label' => '',
'choices' => $this->stdChoices,
'expanded' => true,
"multiple" => false,
'constraints' => [new NotNull()],
];
$this->cmtOpts = [
'attr' => ['placeholder' => 'Commentaires'],
'label' => false,
'required' => false,
];
$this->labelEvalGlob = "évaluation globale";
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
/* PARTIE 1 : ACCESSIBILITE ET INCLUSIVITE */
$this->opts['label'] = "Géographique et physique : le lieu est-il accessible par différents modes de transport ?";
$this->opts['choices'] = [
$this->frown . " 0 mode de transport" => 0,
$this->meh . " 1 mode de transport" => 1,
$this->smile . " plus d'1 mode de transport" => 2,
];
$builder->add('accessib_geophy', ChoiceType::class, $this->opts);
$builder->add('accessib_geophy_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Temporelle : le lieu communique-t-il sur ses plages d'ouvertures ?";
$this->opts['choices'] = [
$this->frown . " 0 mode de communication" => 0,
$this->meh . " 1 mode de communication" => 1,
$this->smile . " plus d'1 mode de communication" => 2,
];
$builder->add('accessib_tempor', ChoiceType::class, $this->opts);
$builder->add('accessib_tempor_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Sociale et inclusivité (1/3) : le lieu mène-t-il des actions de sensibilisation et d'éducation populaire à l'alimentation ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('accessib_edupop', ChoiceType::class, $this->opts);
$builder->add('accessib_edupop_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Sociale et inclusivité (2/3) : le lieu propose-t-il des services spécifiques pour faciliter son accessibilité à une diversité
de profils (pour les personnes agées, les personnes en situation de handicap, les familles ...) ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('accessib_divers', ChoiceType::class, $this->opts);
$builder->add('accessib_divers_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Sociale et inclusivité (3/3) : le lieu mène-t-il des actions spécifiques pour lutter contre la vulnérabilité alimentaire ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('accessib_vulner', ChoiceType::class, $this->opts);
$builder->add('accessib_vulner_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Accessibilité et inclusivité : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('accessib_global', ChoiceType::class, $this->opts);
$builder->add('accessib_global_comment', TextareaType::class, $this->cmtOpts);
/* PARTIE 2 : BIEN-ETRE AU TRAVAIL */
$this->opts['label'] = "Le lieu met-il en place des actions pour faciliter l'accueil, l'intégration et la formation des personnes qui y travaillent ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('bienetre_format', ChoiceType::class, $this->opts);
$builder->add('bienetre_format_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Les travailleurs sont-ils impliqués dans la gouvernance ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('bienetre_impgou', ChoiceType::class, $this->opts);
$builder->add('bienetre_impgou_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Le lieu met-il en place des actions pour améliorer le bien-être des personnes qui y travaillent ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('bienetre_bienet', ChoiceType::class, $this->opts);
$builder->add('bienetre_bienet_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Le lieu met-il en place des actions pour valoriser et reconnaître le travail fourni par les bénévoles ?";
$this->opts['choices'] = $this->stdChoices;
$builder->add('bienetre_recben', ChoiceType::class, $this->opts);
$builder->add('bienetre_recben_comment', TextareaType::class, $this->cmtOpts);
$this->opts['label'] = "Bien-être au travail : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('bienetre_global', ChoiceType::class, $this->opts);
$builder->add('bienetre_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('save', SubmitType::class, ['label' => 'Envoyer'])
;
}
/**
*
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => SelfEvalPrestaQuiz::class,
]);
}
public function getBlockPrefix(): string
{
return 'formSelfEvalPrestaQuiz';
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240214104305 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE selfevalprestaquiz (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', accessib_geophy INT NOT NULL, accessib_tempor INT NOT NULL, accessib_edupop INT NOT NULL, accessib_divers INT NOT NULL, accessib_vulner INT NOT NULL, accessib_geophy_comment LONGTEXT NOT NULL, accessib_tempor_comment LONGTEXT NOT NULL, accessib_edupop_comment LONGTEXT NOT NULL, accessib_divers_comment LONGTEXT NOT NULL, accessib_vulner_comment LONGTEXT NOT NULL, bienetre_format INT NOT NULL, bienetre_format_comment LONGTEXT NOT NULL, bienetre_impgou INT NOT NULL, bienetre_impgou_comment LONGTEXT NOT NULL, bienetre_bienet INT NOT NULL, bienetre_bienet_comment LONGTEXT NOT NULL, bienetre_recben INT NOT NULL, bienetre_recben_comment LONGTEXT NOT NULL, transpar_jusrem INT NOT NULL, transpar_jusrem_comment LONGTEXT NOT NULL, transpar_transp INT NOT NULL, transpar_transp_comment LONGTEXT NOT NULL, transpar_relpro INT NOT NULL, transpar_relpro_comment LONGTEXT NOT NULL, disagdur_labels INT NOT NULL, disagdur_labels_comment LONGTEXT NOT NULL, disagdur_condur INT NOT NULL, disagdur_condur_comment LONGTEXT NOT NULL, proagdur_labels INT NOT NULL, proagdur_labels_comment LONGTEXT NOT NULL, proagdur_valbio INT NOT NULL, proagdur_valbio_comment LONGTEXT NOT NULL, proagdur_ecorec INT NOT NULL, proagdur_ecorec_comment LONGTEXT NOT NULL, proagdur_pertes INT NOT NULL, proagdur_pertes_comment LONGTEXT NOT NULL, proagdur_climat INT NOT NULL, proagdur_climat_comment LONGTEXT NOT NULL, proagdur_geneti INT NOT NULL, proagdur_geneti_comment LONGTEXT NOT NULL, proagdur_prosol INT NOT NULL, proagdur_prosol_comment LONGTEXT NOT NULL, localite_probru INT NOT NULL, localite_probru_comment LONGTEXT NOT NULL, localite_protra INT NOT NULL, localite_protra_comment LONGTEXT NOT NULL, accessib_global INT NOT NULL, accessib_global_comment LONGTEXT NOT NULL, bienetre_global INT NOT NULL, bienetre_global_comment LONGTEXT NOT NULL, transpar_global INT NOT NULL, transpar_global_comment LONGTEXT NOT NULL, disagdur_global INT NOT NULL, disagdur_global_comment LONGTEXT NOT NULL, proagdur_global INT NOT NULL, proagdur_global_comment LONGTEXT NOT NULL, localite_global INT NOT NULL, localite_global_comment LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE prestataire ADD selfevalprestaquiz_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD marketchannelfunction LONGTEXT DEFAULT NULL, CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
$this->addSql('ALTER TABLE prestataire ADD CONSTRAINT FK_60A26480C5DC59A8 FOREIGN KEY (selfevalprestaquiz_id) REFERENCES selfevalprestaquiz (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_60A26480C5DC59A8 ON prestataire (selfevalprestaquiz_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire DROP FOREIGN KEY FK_60A26480C5DC59A8');
$this->addSql('DROP TABLE selfevalprestaquiz');
$this->addSql('DROP INDEX UNIQ_60A26480C5DC59A8 ON prestataire');
$this->addSql('ALTER TABLE prestataire DROP selfevalprestaquiz_id, DROP marketchannelfunction, CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240214152548 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
$this->addSql('ALTER TABLE selfevalprestaquiz CHANGE accessib_geophy_comment accessib_geophy_comment LONGTEXT DEFAULT NULL, CHANGE accessib_tempor_comment accessib_tempor_comment LONGTEXT DEFAULT NULL, CHANGE accessib_edupop_comment accessib_edupop_comment LONGTEXT DEFAULT NULL, CHANGE accessib_divers_comment accessib_divers_comment LONGTEXT DEFAULT NULL, CHANGE accessib_vulner_comment accessib_vulner_comment LONGTEXT DEFAULT NULL, CHANGE bienetre_format_comment bienetre_format_comment LONGTEXT DEFAULT NULL, CHANGE bienetre_impgou_comment bienetre_impgou_comment LONGTEXT DEFAULT NULL, CHANGE bienetre_bienet_comment bienetre_bienet_comment LONGTEXT DEFAULT NULL, CHANGE bienetre_recben_comment bienetre_recben_comment LONGTEXT DEFAULT NULL, CHANGE transpar_jusrem_comment transpar_jusrem_comment LONGTEXT DEFAULT NULL, CHANGE transpar_transp_comment transpar_transp_comment LONGTEXT DEFAULT NULL, CHANGE transpar_relpro_comment transpar_relpro_comment LONGTEXT DEFAULT NULL, CHANGE disagdur_labels_comment disagdur_labels_comment LONGTEXT DEFAULT NULL, CHANGE disagdur_condur_comment disagdur_condur_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_labels_comment proagdur_labels_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_valbio_comment proagdur_valbio_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_ecorec_comment proagdur_ecorec_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_pertes_comment proagdur_pertes_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_climat_comment proagdur_climat_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_geneti_comment proagdur_geneti_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_prosol_comment proagdur_prosol_comment LONGTEXT DEFAULT NULL, CHANGE localite_probru_comment localite_probru_comment LONGTEXT DEFAULT NULL, CHANGE localite_protra_comment localite_protra_comment LONGTEXT DEFAULT NULL, CHANGE accessib_global_comment accessib_global_comment LONGTEXT DEFAULT NULL, CHANGE bienetre_global_comment bienetre_global_comment LONGTEXT DEFAULT NULL, CHANGE transpar_global_comment transpar_global_comment LONGTEXT DEFAULT NULL, CHANGE disagdur_global_comment disagdur_global_comment LONGTEXT DEFAULT NULL, CHANGE proagdur_global_comment proagdur_global_comment LONGTEXT DEFAULT NULL, CHANGE localite_global_comment localite_global_comment LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
$this->addSql('ALTER TABLE selfevalprestaquiz CHANGE accessib_geophy_comment accessib_geophy_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE accessib_tempor_comment accessib_tempor_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE accessib_edupop_comment accessib_edupop_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE accessib_divers_comment accessib_divers_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE accessib_vulner_comment accessib_vulner_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE bienetre_format_comment bienetre_format_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE bienetre_impgou_comment bienetre_impgou_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE bienetre_bienet_comment bienetre_bienet_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE bienetre_recben_comment bienetre_recben_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE transpar_jusrem_comment transpar_jusrem_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE transpar_transp_comment transpar_transp_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE transpar_relpro_comment transpar_relpro_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE disagdur_labels_comment disagdur_labels_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE disagdur_condur_comment disagdur_condur_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_labels_comment proagdur_labels_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_valbio_comment proagdur_valbio_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_ecorec_comment proagdur_ecorec_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_pertes_comment proagdur_pertes_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_climat_comment proagdur_climat_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_geneti_comment proagdur_geneti_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_prosol_comment proagdur_prosol_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE localite_probru_comment localite_probru_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE localite_protra_comment localite_protra_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE accessib_global_comment accessib_global_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE bienetre_global_comment bienetre_global_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE transpar_global_comment transpar_global_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE disagdur_global_comment disagdur_global_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE proagdur_global_comment proagdur_global_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, CHANGE localite_global_comment localite_global_comment LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240214152700 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
$this->addSql('ALTER TABLE selfevalprestaquiz CHANGE accessib_geophy accessib_geophy INT DEFAULT NULL, CHANGE accessib_tempor accessib_tempor INT DEFAULT NULL, CHANGE accessib_edupop accessib_edupop INT DEFAULT NULL, CHANGE accessib_divers accessib_divers INT DEFAULT NULL, CHANGE accessib_vulner accessib_vulner INT DEFAULT NULL, CHANGE bienetre_format bienetre_format INT DEFAULT NULL, CHANGE bienetre_impgou bienetre_impgou INT DEFAULT NULL, CHANGE bienetre_bienet bienetre_bienet INT DEFAULT NULL, CHANGE bienetre_recben bienetre_recben INT DEFAULT NULL, CHANGE transpar_jusrem transpar_jusrem INT DEFAULT NULL, CHANGE transpar_transp transpar_transp INT DEFAULT NULL, CHANGE transpar_relpro transpar_relpro INT DEFAULT NULL, CHANGE disagdur_labels disagdur_labels INT DEFAULT NULL, CHANGE disagdur_condur disagdur_condur INT DEFAULT NULL, CHANGE proagdur_labels proagdur_labels INT DEFAULT NULL, CHANGE proagdur_valbio proagdur_valbio INT DEFAULT NULL, CHANGE proagdur_ecorec proagdur_ecorec INT DEFAULT NULL, CHANGE proagdur_pertes proagdur_pertes INT DEFAULT NULL, CHANGE proagdur_climat proagdur_climat INT DEFAULT NULL, CHANGE proagdur_geneti proagdur_geneti INT DEFAULT NULL, CHANGE proagdur_prosol proagdur_prosol INT DEFAULT NULL, CHANGE localite_probru localite_probru INT DEFAULT NULL, CHANGE localite_protra localite_protra INT DEFAULT NULL, CHANGE accessib_global accessib_global INT DEFAULT NULL, CHANGE bienetre_global bienetre_global INT DEFAULT NULL, CHANGE transpar_global transpar_global INT DEFAULT NULL, CHANGE disagdur_global disagdur_global INT DEFAULT NULL, CHANGE proagdur_global proagdur_global INT DEFAULT NULL, CHANGE localite_global localite_global INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
$this->addSql('ALTER TABLE selfevalprestaquiz CHANGE accessib_geophy accessib_geophy INT NOT NULL, CHANGE accessib_tempor accessib_tempor INT NOT NULL, CHANGE accessib_edupop accessib_edupop INT NOT NULL, CHANGE accessib_divers accessib_divers INT NOT NULL, CHANGE accessib_vulner accessib_vulner INT NOT NULL, CHANGE bienetre_format bienetre_format INT NOT NULL, CHANGE bienetre_impgou bienetre_impgou INT NOT NULL, CHANGE bienetre_bienet bienetre_bienet INT NOT NULL, CHANGE bienetre_recben bienetre_recben INT NOT NULL, CHANGE transpar_jusrem transpar_jusrem INT NOT NULL, CHANGE transpar_transp transpar_transp INT NOT NULL, CHANGE transpar_relpro transpar_relpro INT NOT NULL, CHANGE disagdur_labels disagdur_labels INT NOT NULL, CHANGE disagdur_condur disagdur_condur INT NOT NULL, CHANGE proagdur_labels proagdur_labels INT NOT NULL, CHANGE proagdur_valbio proagdur_valbio INT NOT NULL, CHANGE proagdur_ecorec proagdur_ecorec INT NOT NULL, CHANGE proagdur_pertes proagdur_pertes INT NOT NULL, CHANGE proagdur_climat proagdur_climat INT NOT NULL, CHANGE proagdur_geneti proagdur_geneti INT NOT NULL, CHANGE proagdur_prosol proagdur_prosol INT NOT NULL, CHANGE localite_probru localite_probru INT NOT NULL, CHANGE localite_protra localite_protra INT NOT NULL, CHANGE accessib_global accessib_global INT NOT NULL, CHANGE bienetre_global bienetre_global INT NOT NULL, CHANGE transpar_global transpar_global INT NOT NULL, CHANGE disagdur_global disagdur_global INT NOT NULL, CHANGE proagdur_global proagdur_global INT NOT NULL, CHANGE localite_global localite_global INT NOT NULL');
}
}
{% extends '@kohinos/common/layout.html.twig' %}
{% block content %}
{# Form theme use is mandatory to insert non-text stuff (such as html, icons...) in the choice type choices label. #}
{% form_theme form '@kohinos/tav/prestaquiz_form_theme.html.twig' %}
<h1>Inscription point de vente (2/2) : auto-évaluation</h1>
{{ form_start(form) }}
{# includes twig common to distributors and producers #}
{% include '@kohinos/tav/selfeval_prestaquiz.html.twig' %}
<br/>
<br/>
<br/>
<h2><i class="fas fa-coins"></i> Transparence et juste rémunération</h2>
<div class="container">
<div class="row">
{{ form_label(form.transpar_jusrem) }}
<div class="col">{{ form_widget(form.transpar_jusrem) }}</div>
<div class="col">{{ form_row(form.transpar_jusrem_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.transpar_transp) }}
<div class="col">{{ form_widget(form.transpar_transp) }}</div>
<div class="col">{{ form_row(form.transpar_transp_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.transpar_relpro) }}
<div class="col">{{ form_widget(form.transpar_relpro) }}</div>
<div class="col">{{ form_row(form.transpar_relpro_comment) }}</div>
</div>
</div>
<div class="container global-evaluation-container">
<div class="row">
{{ form_label(form.accessib_global) }}
<div class="col">{{ form_widget(form.transpar_global) }}</div>
<div class="col">{{ form_row(form.transpar_global_comment) }}</div>
</div>
</div>
<br/>
<br/>
<br/>
<h2><i class="fas fa-seedling"></i> Pratiques agricoles durables</h2>
<div class="container">
<div class="row">
{{ form_label(form.disagdur_labels) }}
<div class="col">{{ form_widget(form.disagdur_labels) }}</div>
<div class="col">{{ form_row(form.disagdur_labels_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.disagdur_condur) }}
<div class="col">{{ form_widget(form.disagdur_condur) }}</div>
<div class="col">{{ form_row(form.disagdur_condur_comment) }}</div>
</div>
</div>
<div class="container global-evaluation-container">
<div class="row">
{{ form_label(form.disagdur_global) }}
<div class="col">{{ form_widget(form.disagdur_global) }}</div>
<div class="col">{{ form_row(form.disagdur_global_comment) }}</div>
</div>
</div>
<br/>
<br/>
<br/>
<h2><i class="fas fa-map-marker-alt"></i> Localité des produits</h2>
<div class="container">
<div class="row">
{{ form_label(form.localite_probru) }}
<div class="col">{{ form_widget(form.localite_probru) }}</div>
<div class="col">{{ form_row(form.localite_probru_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.localite_protra) }}
<div class="col">{{ form_widget(form.localite_protra) }}</div>
<div class="col">{{ form_row(form.localite_protra_comment) }}</div>
</div>
</div>
<div class="container global-evaluation-container">
<div class="row">
{{ form_label(form.localite_global) }}
<div class="col">{{ form_widget(form.localite_global) }}</div>
<div class="col">{{ form_row(form.localite_global_comment) }}</div>
</div>
</div>
<br/>
<br/>
{{ form_end(form) }}
{% endblock %}
\ No newline at end of file
{% extends '@kohinos/common/layout.html.twig' %}
{% block content %}
<div class='container' style='max-width: 800px;'>
<h1>Inscription point de vente (1/2) : identification</h1>
{{ form_start(form) }}
{{ form_end(form) }}
</div>
{% endblock %}
\ No newline at end of file
{# Custom form theme based on file : Resources/views/Form/bootstrap_4_layout.html.twig
where unique change is use of filter |raw on line
{{- label is not same as(false) ? (translation_domain is same as(false) ? label|raw : label|trans(label_translation_parameters, translation_domain))|raw -}}
This is to allow use of html in choice type choices label,
as suggested here : https://stackoverflow.com/questions/45562135/html-in-label-choice-form
#}
{% block checkbox_radio_label -%}
{#- Do not display the label if widget is not defined in order to prevent double label rendering -#}
{%- if widget is defined -%}
{% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class or 'switch-custom' in parent_label_class) %}
{% set is_custom = label_attr.class is defined and ('checkbox-custom' in label_attr.class or 'radio-custom' in label_attr.class or 'switch-custom' in label_attr.class) %}
{%- if is_parent_custom or is_custom -%}
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' custom-control-label')|trim}) -%}
{%- else %}
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' form-check-label')|trim}) -%}
{%- endif %}
{%- if not compound -%}
{% set label_attr = label_attr|merge({'for': id}) %}
{%- endif -%}
{%- if required -%}
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) -%}
{%- endif -%}
{%- if label is not same as(false) and label is empty -%}
{%- if label_format is not empty -%}
{%- set label = label_format|replace({
'%name%': name,
'%id%': id,
}) -%}
{%- else -%}
{%- set label = name|humanize -%}
{%- endif -%}
{%- endif -%}
{{ widget|raw }}
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
{{- label is not same as(false) ? (translation_domain is same as(false) ? label|raw : label|trans(label_translation_parameters, translation_domain))|raw -}}
{{- form_errors(form) -}}
</label>
{%- endif -%}
{%- endblock checkbox_radio_label %}
\ No newline at end of file
{% extends '@kohinos/common/layout.html.twig' %}
{% block content %}
<h2>Vous avez terminé votre demande d'inscription, merci !</h2>
<h2>Nous vous contacterons prochainement.</h2>
{% endblock %}
\ No newline at end of file
{% extends '@kohinos/common/layout.html.twig' %}
{% block content %}
{# Form theme use is mandatory to insert non-text stuff (such as html, icons...) in the choice type choices label. #}
{% form_theme form '@kohinos/tav/prestaquiz_form_theme.html.twig' %}
<h1>Inscription point de vente (2/2) : auto-évaluation</h1>
{{ form_start(form) }}
{# includes twig common to distributors and producers #}
{% include '@kohinos/tav/selfeval_prestaquiz.html.twig' %}
<br/>
<br/>
<br/>
<h2><i class="fas fa-seedling"></i> Pratiques agricoles durables</h2>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_labels) }}
<div class="col">{{ form_widget(form.proagdur_labels) }}</div>
<div class="col">{{ form_row(form.proagdur_labels_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_valbio) }}
<div class="col">{{ form_widget(form.proagdur_valbio) }}</div>
<div class="col">{{ form_row(form.proagdur_valbio_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_ecorec) }}
<div class="col">{{ form_widget(form.proagdur_ecorec) }}</div>
<div class="col">{{ form_row(form.proagdur_ecorec_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_pertes) }}
<div class="col">{{ form_widget(form.proagdur_pertes) }}</div>
<div class="col">{{ form_row(form.proagdur_pertes_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_climat) }}
<div class="col">{{ form_widget(form.proagdur_climat) }}</div>
<div class="col">{{ form_row(form.proagdur_climat_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_geneti) }}
<div class="col">{{ form_widget(form.proagdur_geneti) }}</div>
<div class="col">{{ form_row(form.proagdur_geneti_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.proagdur_prosol) }}
<div class="col">{{ form_widget(form.proagdur_prosol) }}</div>
<div class="col">{{ form_row(form.proagdur_prosol_comment) }}</div>
</div>
</div>
<div class="container global-evaluation-container">
<div class="row">
{{ form_label(form.proagdur_global) }}
<div class="col">{{ form_widget(form.proagdur_global) }}</div>
<div class="col">{{ form_row(form.proagdur_global_comment) }}</div>
</div>
</div>
<br/>
<br/>
{{ form_end(form) }}
{% endblock %}
\ No newline at end of file
{# View for prestataire questionnaire sections that are common to distributors and producers #}
<br/>
<br/>
<h2><i class="fas fa-universal-access"></i> Accessibilité et Inclusivité</h2>
<div class="container">
<div class="row">
{{ form_label(form.accessib_geophy) }}
<div class="col">{{ form_widget(form.accessib_geophy) }}</div>
<div class="col">{{ form_row(form.accessib_geophy_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.accessib_tempor) }}
<div class="col">{{ form_widget(form.accessib_tempor) }}</div>
<div class="col">{{ form_row(form.accessib_tempor_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.accessib_edupop) }}
<div class="col">{{ form_widget(form.accessib_edupop) }}</div>
<div class="col">{{ form_row(form.accessib_edupop_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.accessib_divers) }}
<div class="col">{{ form_widget(form.accessib_divers) }}</div>
<div class="col">{{ form_row(form.accessib_divers_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.accessib_vulner) }}
<div class="col">{{ form_widget(form.accessib_vulner) }}</div>
<div class="col">{{ form_row(form.accessib_vulner_comment) }}</div>
</div>
</div>
<div class="container global-evaluation-container">
<div class="row">
{{ form_label(form.accessib_global) }}
<div class="col">{{ form_widget(form.accessib_global) }}</div>
<div class="col">{{ form_row(form.accessib_global_comment) }}</div>
</div>
</div>
<br/>
<br/>
<br/>
<h2><i class="fas fa-heart"></i> Bien-être au travail</h2>
<div class="container">
<div class="row">
{{ form_label(form.bienetre_format) }}
<div class="col">{{ form_widget(form.bienetre_format) }}</div>
<div class="col">{{ form_row(form.bienetre_format_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.bienetre_impgou) }}
<div class="col">{{ form_widget(form.bienetre_impgou) }}</div>
<div class="col">{{ form_row(form.bienetre_impgou_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.bienetre_bienet) }}
<div class="col">{{ form_widget(form.bienetre_bienet) }}</div>
<div class="col">{{ form_row(form.bienetre_bienet_comment) }}</div>
</div>
</div>
<div class="container">
<div class="row">
{{ form_label(form.bienetre_recben) }}
<div class="col">{{ form_widget(form.bienetre_recben) }}</div>
<div class="col">{{ form_row(form.bienetre_recben_comment) }}</div>
</div>
</div>
<div class="container global-evaluation-container">
<div class="row">
{{ form_label(form.bienetre_global) }}
<div class="col">{{ form_widget(form.bienetre_global) }}</div>
<div class="col">{{ form_row(form.bienetre_global_comment) }}</div>
</div>
</div>
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