Changes for public/js/oscar/dist/WorkpackageUI.js: 2 added lines, 0 removed lines.
Original line number
Diff line number
Diff line
(function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.WorkpackageUI=t():e.WorkpackageUI=t()})("undefined"!=typeofself?self:this,function(){returnfunction(e){functiont(r){if(a[r])returna[r].exports;varn=a[r]={i:r,l:!1,exports:{}};returne[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}vara={};returnt.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){vara=e&&e.__esModule?function(){returne.default}:function(){returne};returnt.d(a,"a",a),a},t.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t){e.exports=function(e,t,a,r,n,o){vars,i=e=e||{},c=typeofe.default;"object"!==c&&"function"!==c||(s=e,i=e.default);varl="function"==typeofi?i.options:i;t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0),a&&(l.functional=!0),n&&(l._scopeId=n);vard;if(o?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof__VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=d):r&&(d=r),d){varu=l.functional,p=u?l.render:l.beforeCreate;u?(l._injectStyles=d,l.render=function(e,t){returnd.call(t),p(e,t)}):l.beforeCreate=p?[].concat(p,d):[d]}return{esModule:s,exports:i,options:l}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={components:{workpackage:a(6).default},data:function(){return{loading:!1,errors:[],workpackages:[],persons:[],editable:!1,isDeclarant:!1,isValidateur:!1,token:"DEFAULT_TKN"}},props:{url:{required:!0},token:{required:!0},isValidateur:{required:!0},editable:{required:!0},Bootbox:{required:!0}},watch:{},computed:{},created:function(){this.fetch()},methods:{handlerWorkPackageCancelNew:function(e){this.workpackages.splice(this.workpackages.indexOf(e),1)},handlerWorkPackageNew:function(){this.workpackages.push({id:-1,code:"Nouveau Lot",label:"",persons:[],description:""})},handlerWorkPackagePersonDelete:function(e){vart=this;this.Bootbox.confirm("Supprimer le déclarant ? ",function(a){a&&t.$http.delete(t.url+"?workpackagepersonid="+e.id).then(function(e){t.fetch()},function(e){t.errors.push("Impossible de supprimer le déclarant : "+e.body)})})},handlerWorkPackageDelete:function(e){vart=this;this.Bootbox.confirm("Souhaitez-vous supprimer ce lot ?",function(a){a&&t.$http.delete(t.url+"?workpackageid="+e.id).then(function(e){t.fetch()},function(e){t.errors.push("Impossible de supprimer le lot : "+e.body)})})},handlerWorkPackageUpdate:function(e){vart=this,a=newFormData;for(varrine)a.append(r,e[r]);e.id>0?(console.log("MAJ du LOT"),a.append("workpackageid",e.id),this.$http.post(this.url,a).then(function(e){t.fetch()},function(e){t.errors.push("Impossible de mettre à jour le lot de travail : "+e.body)})):(console.log("NOUVEAU du LOT"),a.append("workpackageid",-1),this.$http.put(this.url,a).then(function(e){t.fetch()},function(e){t.errors.push("Impossible de créer le lot de travail : "+e.body)}).then(function(e){returnt.fetch()}))},handlerUpdateWorkPackagePerson:function(e,t){vara=this,r=newFormData;r.append("workpackagepersonid",e.id),r.append("duration",t),this.$http.post(this.url,r).then(function(a){e.duration=t},function(e){a.errors.push("Impossible de mettre à jour les heures prévues : "+e.body)})},addperson:function(e,t){vara=this;console.log(arguments);varr=newFormData;r.append("idworkpackage",t),r.append("idperson",e),this.$http.put(this.url,r).then(function(e){a.fetch()},function(e){a.errors.push("Impossible d'ajouter le déclarant : "+e.body)}).then(function(){returna.loading=!1})},fetch:function(){vare=this;this.loading=!0,console.log(this.url),this.$http.get(this.url).then(function(t){e.workpackages=t.body.workpackages,e.persons=t.body.persons,e.editable=t.body.editable,e.isDeclarant=t.body.isDeclarant,e.isValidateur=t.body.isValidateur},function(t){e.errors.push("Impossible de charger les lots de travail : "+t.body)}).then(function(){returne.loading=!1})}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={components:{workpackageperson:a(7).default},data:function(){return{mode:"read",canSave:!1,formData:{id:-1,code:"",label:"",description:""}}},created:function(){console.log("created",this.workpackage.id),this.workpackage.id<0&&(this.mode="edit")},props:{workpackage:null,persons:{default:function(){return[]}},editable:!1,isValidateur:!1},watch:{"person.duration":function(){console.log("Modification de la durée")}},methods:{handlerEditWorkPackage:function(){this.formData=JSON.parse(JSON.stringify(this.workpackage)),this.mode="edit"},handlerCancelEdit:function(){this.workpackage.id<0?this.$emit("workpackagecancelnew",this.workpackage):this.mode="read"},handlerDeleteWorkPackage:function(){this.$emit("workpackagedelete",this.workpackage)},handlerUpdateWorkPackage:function(){this.$emit("workpackageupdate",this.formData),this.mode="read"},handlerUpdate:function(e,t){this.$emit("workpackagepersonupdate",e,t)},handlerDelete:function(e){this.$emit("workpackagepersondelete",e)},roles:function(e){returne.roles.join(",")},tempsPrevu:function(e){return0},tempsDeclare:function(e){return0}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{person:{default:function(){return{}}},editable:!1},computed:{duration:function(){returnthis.person.duration}},data:function(){return{canSave:!1,mode:"read",durationForm:666}},methods:{handlerKeyUp:function(){console.log(arguments)},handlerUpdate:function(){this.$emit("workpackagepersonupdate",this.person,this.durationForm),this.mode="read"},handlerEdit:function(){this.mode="edit",this.durationForm=this.person.duration},handlerCancel:function(){this.mode="read",this.durationForm=this.person.duration},handlerRemove:function(){this.$emit("workpackagepersondelete",this.person)}}}},function(e,t,a){e.exports=a(5)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=a(1),n=a.n(r);for(varoinr)"default"!==o&&function(e){a.d(t,e,function(){returnr[e]})}(o);vars=a(10),i=a(0),c=i(n.a,s.a,!1,null,null,null);t.default=c.exports},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=a(2),n=a.n(r);for(varoinr)"default"!==o&&function(e){a.d(t,e,function(){returnr[e]})}(o);vars=a(9),i=a(0),c=i(n.a,s.a,!1,null,null,null);t.default=c.exports},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=a(3),n=a.n(r);for(varoinr)"default"!==o&&function(e){a.d(t,e,function(){returnr[e]})}(o);vars=a(8),i=a(0),c=i(n.a,s.a,!1,null,null,null);t.default=c.exports},function(e,t,a){"use strict";varr=function(){vare=this,t=e.$createElement,a=e._self._c||t;returna("article",{staticClass:"workpackage-person"},[a("div",{staticClass:"displayname"},[a("strong",[e._v(e._s(e.person.person.displayname))]),e._v(""),e.editable&&"read"==e.mode?a("a",{staticClass:"link",attrs:{href:"#",title:"Supprimer ce déclarant"},on:{click:function(t){t.preventDefault(),e.handlerRemove(e.person)}}},[a("i",{staticClass:"icon-trash"})]):e._e()]),e._v(""),a("div",{staticClass:"tempsdeclare temps"},[e.editable&&"edit"==e.mode?a("div",[e._v("\n Heures prévues :\n"),a("input",{directives:[{name:"model",rawName:"v-model",value:e.durationForm,expression:"durationForm"}],staticStyle:{width:"5em"},attrs:{type:"integer"},domProps:{value:e.durationForm},on:{keyup:function(t){return"button"int||13===t.keyCode?e.handlerUpdate(t):null},input:function(t){t.target.composing||(e.durationForm=t.target.value)}}}),e._v(""),a("a",{attrs:{href:"#",title:"Appliquer la modification des heures prévues"},on:{click:function(t){returnt.preventDefault(),e.handlerUpdate(t)}}},[a("i",{staticClass:"icon-floppy"})]),e._v(""),a("a",{attrs:{href:"#",title:"Annuler la modification des heures prévues"},on:{click:function(t){returnt.preventDefault(),e.handlerCancel(t)}}},[a("i",{staticClass:"icon-cancel-outline"})])]):a("span",[a("strong",{staticClass:"wp-hours"},[a("span",{staticClass:"wp-hour unsend",attrs:{title:"Heure(s) saisie(s)"}},[e._v(e._s(e._f("heures")(e.person.unsend)))]),e._v(""),a("span",{staticClass:"wp-hour validate",attrs:{title:"Heure(s) validée(s)"}},[e._v(e._s(e._f("heures")(e.person.validate)))]),e._v(""),e.person.validating>0?a("span",{staticClass:"wp-hour validating",attrs:{title:"Heure(s) en cours de validation"}},[e._v(e._s(e._f("heures")(e.person.validating)))]):e._e(),e._v(""),e.person.conflicts>0?a("span",{staticClass:"wp-hour conflicts",attrs:{title:"Heure(s) en conflit"}},[e._v(e._s(e._f("heures")(e.person.conflicts)))]):e._e(),e._v(""),a("span",{staticClass:"wp-hour duration",attrs:{title:"Heure(s) à valider"}},[e._v("\n / "+e._s(e.person.duration)+"\n"),e.editable&&"read"==e.mode?a("a",{attrs:{href:"#",title:"Modifier les heures prévues"},on:{click:function(t){returnt.preventDefault(),e.handlerEdit(t)}}},[a("i",{staticClass:"icon-pencil"})]):e._e()])])])])])},n=[],o={render:r,staticRenderFns:n};t.a=o},function(e,t,a){"use strict";varr=function(){vare=this,t=e.$createElement,a=e._self._c||t;returna("article",{staticClass:"workpackage"},["edit"==e.mode?a("form",{attrs:{action:""},on:{submit:function(t){returnt.preventDefault(),e.handlerUpdateWorkPackage(t)}}},[a("h4",[e.workpackage.id>0?a("span",[e._v("Modification du lot")]):a("span",[e._v("Nouveau lot")]),e._v(""+e._s(e.formData.label))]),e._v(""),a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v("Code")]),e._v(""),e._m(0),e._v(""),a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.code,expression:"formData.code"}],staticClass:"form-control",attrs:{type:"text",placeholder:"CODE"},domProps:{value:e.formData.code},on:{input:function(t){t.target.composing||e.$set(e.formData,"code",t.target.value)}}})]),e._v(""),a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v("Intitulé")]),e._v(""),a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.label,expression:"formData.label"}],staticClass:"form-control",attrs:{type:"text",placeholder:"Intitulé"},domProps:{value:e.formData.label},on:{input:function(t){t.target.composing||e.$set(e.formData,"label",t.target.value)}}})]),e._v(""),a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v("Description")]),e._v(""),a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.formData.description,expression:"formData.description"}],staticClass:"form-control",attrs:{type:"text",placeholder:"Description"},domProps:{value:e.formData.description},on:{input:function(t){t.target.composing||e.$set(e.formData,"description",t.target.value)}}})]),e._v(""),a("div",{staticClass:"buttons"},[a("button",{staticClass:"btn btn-default",class:{disabled:!e.formData.code},attrs:{type:"submit"}},[e._v("Enregistrer")]),e._v(""),a("button",{staticClass:"btn btn-default",attrs:{type:"button"},on:{click:e.handlerCancelEdit}},[e._v("Annuler")])])]):e._e(),e._v(""),"read"==e.mode?a("div",[a("h3",[e._v("["+e._s(e.workpackage.code)+"] "+e._s(e.workpackage.label))]),e._v(""),a("p",[e._v(e._s(e.workpackage.description))]),e._v(""),a("section",{staticClass:"workpackage-persons"},[e._m(1),e._v(""),e._l(e.workpackage.persons,function(t){returna("workpackageperson",{key:t.id,attrs:{person:t,editable:e.editable},on:{workpackagepersondelete:e.handlerDelete,workpackagepersonupdate:e.handlerUpdate}})})],2),e._v(""),e.editable&&e.persons.length?a("div",{staticClass:"buttons"},[a("div",{staticClass:"btn-group"},[e._m(2),e._v(""),a("ul",{staticClass:"dropdown-menu"},e._l(e.persons,function(t){returna("li",[a("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),e.$emit("addperson",t.id,e.workpackage.id)}}},[e._v(e._s(t.displayname))])])}))]),e._v(""),a("a",{staticClass:"btn btn-default btn-xs",attrs:{href:"#"},on:{click:function(t){returnt.preventDefault(),e.handlerEditWorkPackage(t)}}},[a("i",{staticClass:"icon-pencil"}),e._v("Modifier")]),e._v(""),a("a",{staticClass:"btn btn-default btn-xs",attrs:{href:"#"},on:{click:function(t){returnt.preventDefault(),e.handlerDeleteWorkPackage(t)}}},[a("i",{staticClass:"icon-trash"}),e._v("Supprimer")])]):e._e(),e._v(""),e.persons.length<=0?a("div",{staticClass:"text-danger"},[e._v("\n Vous n'avez pas encore ajouté de membre à cette activité. "),a("strong",[e._v("Seul les membres d'une activité peuvent être identifiés comme déclarant")]),e._v(".\n")]):e._e()]):e._e()])},n=[function(){vare=this,t=e.$createElement,a=e._self._c||t;returna("p",{staticClass:"text-danger"},[e._v("Le code est "),a("strong",[e._v("utilisé pour l'affichage des créneaux")]),e._v(" simplifiés, utilisez un code de préférence entre 3 et 5 caractères.")])},function(){vare=this,t=e.$createElement,a=e._self._c||t;returna("h4",[a("i",{staticClass:"icon-calendar"}),e._v("Déclarants ")])},function(){vare=this,t=e.$createElement,a=e._self._c||t;returna("button",{staticClass:"btn btn-default btn-xs dropdown-toggle",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[e._v("\n Ajouter un déclarant "),a("span",{staticClass:"caret"})])}],o={render:r,staticRenderFns:n};t.a=o},function(e,t,a){"use strict";varr=function(){vare=this,t=e.$createElement,a=e._self._c||t;returna("section",[a("transition",{attrs:{name:"fade"}},[e.errors.length?a("div",{staticClass:"vue-loader"},e._l(e.errors,function(t,r){returna("div",{staticClass:"alert alert-danger"},[e._v("\n"+e._s(t)+"\n"),a("a",{attrs:{href:""},on:{click:function(t){t.preventDefault(),e.errors.splice(r,1)}}},[a("i",{staticClass:"icon-cancel-outline"})])])})):e._e()]),e._v(""),e.loading?a("div",{staticClass:"vue-loader-component"},[a("span",[e._v("Chargement")])]):e._e(),e._v(""),a("nav",{staticClass:"buttons"},[e.editable?a("a",{staticClass:"btn btn-primary",attrs:{href:""},on:{click:function(t){returnt.preventDefault(),e.handlerWorkPackageNew(t)}}},[e._v("Nouveau lot")]):e._e()]),e._v(""),a("section",{staticClass:"workpackages"},e._l(e.workpackages,function(t){returna("workpackage",{key:t.id,attrs:{workpackage:t,persons:e.persons,editable:e.editable,"is-validateur":e.isValidateur},on:{addperson:e.addperson,workpackageupdate:e.handlerWorkPackageUpdate,workpackagepersonupdate:e.handlerUpdateWorkPackagePerson,workpackagepersondelete:e.handlerWorkPackagePersonDelete,workpackagedelete:e.handlerWorkPackageDelete,workpackagecancelnew:e.handlerWorkPackageCancelNew}})}))],1)},n=[],o={render:r,staticRenderFns:n};t.a=o}])});