ScoDoc/static/mobile/static/js/main.16dd1ee7.chunk.js

2 lines
36 KiB
JavaScript

(this.webpackJsonpscodocmobile=this.webpackJsonpscodocmobile||[]).push([[0],{101:function(e,t,s){"use strict";s.r(t);var n=s(0),a=s(17),i=s.n(a),c=s(16),r=function(e){e&&e instanceof Function&&s.e(3).then(s.bind(null,118)).then((function(t){var s=t.getCLS,n=t.getFID,a=t.getFCP,i=t.getLCP,c=t.getTTFB;s(e),n(e),a(e),i(e),c(e)}))},o=s(14),l=s(7),d=s(8),h=s(21),u=s(10),j=s(9),p=(s(29),s(114)),b=s(106),m=s(77),O=s(73),f=s(1),x=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={logout:!1},n}return Object(d.a)(s,[{key:"logout",value:function(){var e=this,t=window.$api_url;fetch(t+"acl_users/logout").then((function(t){e.setState({logout:!0})})).catch(console.log)}},{key:"render",value:function(){var e=this;return Object(f.jsxs)(p.a,{bg:"light",expand:"sm",children:[Object(f.jsxs)(b.a,{children:[Object(f.jsxs)(p.a.Brand,{href:window.$api_url+"static/mobile/",children:[Object(f.jsx)("img",{alt:"ScodocLogo",src:"/ScoDoc/static/icons/scologo_img.png",width:"20",height:"30",className:"d-inline-block align-top"})," ","ScoDoc"]}),Object(f.jsx)(p.a.Toggle,{"aria-controls":"basic-navbar-nav"}),Object(f.jsx)(p.a.Collapse,{id:"basic-navbar-nav",children:Object(f.jsxs)(m.a,{className:"ml-auto",children:[Object(f.jsx)(m.a.Link,{href:"/ScoDoc",children:"Version Desktop"}),Object(f.jsx)(O.a,{variant:"primary",onClick:function(){e.logout()},children:"D\xe9connexion"})]})})]}),!0===this.state.logout&&Object(f.jsx)(o.a,{push:!0,to:"/"})]})}}]),s}(n.Component),v=s(74),g=s(107);function w(e){return fetch(e,{method:"GET",verify:!1,credentials:"include"})}function y(e){return w(e).then((function(e){return e.json().then((function(e){return{data:e}})).then((function(e){return e}))}))}function S(e,t){return fetch(e,{method:"POST",verify:!1,credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t})}var C=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={students:[],search_status:0},n.handleChangeSearch=n.handleChangeSearch.bind(Object(h.a)(n)),n.searchStudent=n.searchStudent.bind(Object(h.a)(n)),n}return Object(d.a)(s,[{key:"handleChangeSearch",value:function(e){this.setState({search:e.target.value})}},{key:"searchStudent",value:function(e){var t=this,s=window.location.href.split("/")[7];y(window.$api_url+s+"/Scolarite/Notes/search_etud_by_name?term="+e+"&format=json").then((function(e){t.setState({students:e.data}),0===t.state.students.length?t.setState({search_status:1,toast:!0}):t.setState({search_status:2,toast:!1})})),this.setState({searched:!0})}},{key:"result",value:function(){return!0===this.state.toast?Object(f.jsx)("div",{id:"wrapDept",children:"Aucun \xe9tudiant trouv\xe9"}):2===this.state.search_status?Object(f.jsx)(v.a,{children:this.state.students.map((function(e){return Object(f.jsx)(g.a,{id:"wrapDept",children:Object(f.jsx)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/Etudiant/").concat(e.value),children:Object(f.jsx)("span",{children:e.label})})})}))}):void 0}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{className:"wrapper",children:[Object(f.jsxs)("div",{className:"input-group",children:[Object(f.jsx)("input",{type:"text",id:"search",className:"form-control",onChange:this.handleChangeSearch}),Object(f.jsx)("div",{className:"input-group-append",children:Object(f.jsx)("button",{type:"button",className:"btn waves-effect waves-light btn-primary",onClick:function(){e.searchStudent(e.state.search)},children:"Rechercher"})})]}),this.result()]})}}]),s}(n.Component),k=s(115),D=s(116),_=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).dismissToast=function(){return n.setState({toast:!1})},n.state={semestres:[],students:[],toast:!1},n.dismissToast=n.dismissToast.bind(Object(h.a)(n)),n}return Object(d.a)(s,[{key:"componentWillMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7];y(window.$api_url+t+"/Scolarite/Notes/formsemestre_list?format=json").then((function(t){e.setState({semestres:t.data})}))}},{key:"render",value:function(){return Object(f.jsxs)("div",{children:[Object(f.jsx)(x,{}),Object(f.jsx)("section",{children:Object(f.jsx)("h1",{id:"pageTitle",children:"Scolarit\xe9"})}),Object(f.jsxs)(k.a,{defaultActiveKey:"0",children:[Object(f.jsxs)(D.a,{children:[Object(f.jsx)(D.a.Header,{children:Object(f.jsx)(k.a.Toggle,{as:O.a,variant:"link",eventKey:"0",children:"Semestres en cours"})}),Object(f.jsx)(k.a.Collapse,{eventKey:"0",children:Object(f.jsx)(D.a.Body,{children:Object(f.jsx)("div",{className:"container",children:Object(f.jsx)("div",{className:"row",children:this.state.semestres.map((function(e,t){if("1"===e.etat)return Object(f.jsx)("div",{className:"col-sm",id:"wrapDept",children:Object(f.jsxs)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/").concat(e.formsemestre_id,"/GestionSem"),children:[Object(f.jsxs)("h4",{children:[e.titre," [",e.modalite,"]"]}),Object(f.jsxs)("p",{children:["Semestre ",e.semestre_id," - Ann\xe9e ",e.anneescolaire," [",e.date_debut," - ",e.date_fin,"]"]})]})},t)}))})})})})]}),Object(f.jsxs)(D.a,{children:[Object(f.jsx)(D.a.Header,{children:Object(f.jsx)(k.a.Toggle,{as:O.a,variant:"link",eventKey:"1",children:"Semestres pass\xe9s"})}),Object(f.jsx)(k.a.Collapse,{eventKey:"1",children:Object(f.jsx)(D.a.Body,{children:this.state.semestres.map((function(e,t){if("1"!==e.etat)return Object(f.jsx)("div",{className:"col-12",id:"wrapDept",children:Object(f.jsxs)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/").concat(e.formsemestre_id,"/GestionSem"),children:[Object(f.jsxs)("h3",{children:[e.titre," [",e.modalite,"]"]}),Object(f.jsxs)("p",{children:["Semestre ",e.semestre_id," - Ann\xe9e ",e.anneescolaire," [",e.date_debut," - ",e.date_fin,"]"]})]})},t)}))})})]}),Object(f.jsxs)(D.a,{children:[Object(f.jsx)(D.a.Header,{children:Object(f.jsx)(k.a.Toggle,{as:O.a,variant:"link",eventKey:"2",children:"Recherche \xe9tudiant"})}),Object(f.jsx)(k.a.Collapse,{eventKey:"2",children:Object(f.jsx)(D.a.Body,{children:Object(f.jsx)(C,{})})})]})]})]})}}]),s}(n.Component),N=s(75),M=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={depts:[]},n}return Object(d.a)(s,[{key:"componentWillMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this;y(window.$api_url+"list_depts?format=json").then((function(t){e.setState({depts:t.data})}))}},{key:"render",value:function(){return Object(f.jsxs)("div",{className:"wrapper",children:[Object(f.jsx)("h1",{id:"pageTitle",children:"Choix du d\xe9partement"}),Object(f.jsx)("div",{className:"container",children:Object(f.jsx)("div",{className:"row",children:this.state.depts.map((function(e,t){return Object(f.jsx)("div",{className:"col-sm",id:"wrapDept",children:Object(f.jsxs)(c.c,{to:"/".concat(e,"/Scolarite"),children:["D\xe9partement ",e]})},t)}))})})]})}}]),s}(n.Component),F=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={login:"",pass:"",status:0},n.handleChangeLogin=n.handleChangeLogin.bind(Object(h.a)(n)),n.handleChangePass=n.handleChangePass.bind(Object(h.a)(n)),n.checkCredentials=n.checkCredentials.bind(Object(h.a)(n)),n}return Object(d.a)(s,[{key:"handleChangeLogin",value:function(e){this.setState({login:e.target.value})}},{key:"handleChangePass",value:function(e){this.setState({pass:e.target.value})}},{key:"checkCredentials",value:function(e){var t=this;e.preventDefault();var s=this.state.login,n=this.state.pass;(function(e,t,s){return fetch(e,{method:"GET",verify:!1,credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+btoa(t+":"+s)}})})(window.$api_url,s,n).then((function(e){t.setState({status:e.status})})).catch(console.log)}},{key:"render",value:function(){return Object(f.jsxs)("div",{children:[!N.isMobile&&Object(f.jsx)("span",{}),0!==this.state.status&&200!==this.state.status&&Object(f.jsx)("div",{className:"wrapper",children:Object(f.jsx)("div",{id:"errorMsg",children:Object(f.jsxs)("h2",{id:"loginTitle",children:["\u26a0\ufe0f"," Login ou mot de passe incorrect"]})})}),""===document.cookie&&Object(f.jsx)("div",{className:"wrapper",children:Object(f.jsxs)("div",{id:"formContent",children:[Object(f.jsx)("h2",{id:"loginTitle",children:"Connexion a ScoDoc"}),Object(f.jsxs)("form",{children:[Object(f.jsx)("input",{type:"text",id:"login",placeholder:"Identifiant",onChange:this.handleChangeLogin}),Object(f.jsx)("input",{type:"password",id:"password",placeholder:"Mot de passe",onChange:this.handleChangePass}),Object(f.jsx)("button",{type:"submit",value:"Log In",onClick:this.checkCredentials,children:"Log in"})]})]})}),Object(f.jsxs)("div",{children:[""!==document.cookie&&Object(f.jsx)(x,{}),""!==document.cookie&&Object(f.jsx)(M,{})]})]})}}]),s}(n.Component),T=s(117),A=s(110),I=s(108),L=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={semestre:{},resp:[],loading:!0},n}return Object(d.a)(s,[{key:"componentWillMount",value:function(){this.setState({loading:!0}),this.getData()}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7],s=window.location.href.split("/")[9],n=window.$api_url;y(n+t+"/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id="+s).then((function(s){e.setState({semestre:s.data[0],resp_l:s.data[0].responsables}),s.data[0].responsables.map((function(s){return y(n+t+"/Scolarite/Users/user_info?format=json&user_name="+s).then((function(t){var s=e.state.resp.concat(t.data.nomplogin);e.setState({resp:s,loading:!1})})).catch((function(t){e.setState({resp:e.state.resp_l,loading:!1})}))}))}))}},{key:"render",value:function(){var e=this;return Object(f.jsx)("div",{className:"wrapper",children:!1===this.state.loading?Object(f.jsxs)("h1",{id:"pageTitle",children:[this.state.semestre.titre,Object(f.jsx)("br",{}),"Semestre ",this.state.semestre.semestre_id," en ",this.state.semestre.modalite,Object(f.jsx)("br",{}),1===this.state.resp.length?"Responsable: (":"Responsables (",this.state.resp.map((function(t,s){return s!==e.state.resp.length-1?t+", ":t+")"}))]}):Object(f.jsx)(I.a,{animation:"border"})})}}]),s}(n.Component),P=s(68),E=s(112),B=s(113),G=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).openModal=function(){return n.setState({isOpen:!0})},n.closeModal=function(){return n.setState({isOpen:!1})},n.onFormSubmit=function(e){e.preventDefault();var t=new FormData(e.target),s=Object.fromEntries(t.entries()),a="etudid="+n.state.etudid+"&datedebut=";if(s.hasOwnProperty("dateDebut")&&""!==s.dateDebut){var i=s.dateDebut.split("-");if(a+=i=i[2]+"/"+i[1]+"/"+i[0],s.hasOwnProperty("dateFin")&&""!==s.dateFin){var c=s.dateFin.split("-");a+="&datefin="+(c=c[2]+"/"+c[1]+"/"+c[0])}else a+="&datefin="+i;s.hasOwnProperty("duree")&&(a+="&demijournee="+s.duree),s.hasOwnProperty("estjust")&&s.hasOwnProperty("motif")&&""!==s.motif&&(a+="&estjust=True&description="+s.motif),n.postData(a)}else n.setState({error:!0})},n.state={isOpen:!1,form:{},error:!1,etudid:""},n}return Object(d.a)(s,[{key:"componentDidUpdate",value:function(e){e.open!==this.props.open&&(this.setState({etudid:this.props.etudid}),!0===this.props.open&&this.setState({isOpen:!0}))}},{key:"postData",value:function(e){var t=this,s=window.location.href.split("/")[7];S(window.$api_url+s+"/Scolarite/Absences/doSignaleAbsence",e).then((function(e){200===e.status&&t.closeModal()}))}},{key:"render",value:function(){var e=this;return Object(f.jsx)(f.Fragment,{children:Object(f.jsxs)(E.a,{show:this.state.isOpen,onHide:this.closeModal,children:[Object(f.jsx)(E.a.Header,{closeButton:!0,children:Object(f.jsx)(E.a.Title,{children:"Saisie d'absence"})}),Object(f.jsxs)(E.a.Body,{children:[this.state.error&&Object(f.jsx)("span",{children:"Erreur: La date de d\xe9but ne doit pas \xeatre vide"}),Object(f.jsxs)(B.a,{onSubmit:this.onFormSubmit,children:[Object(f.jsxs)(B.a.Row,{children:[Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"dateDebut",children:[Object(f.jsx)(B.a.Label,{children:"Date d\xe9but"}),Object(f.jsx)(B.a.Control,{type:"date",name:"dateDebut"})]}),Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"dateFin",children:[Object(f.jsx)(B.a.Label,{children:"Date fin (Optionnel)"}),Object(f.jsx)(B.a.Control,{type:"date",name:"dateFin"})]})]}),Object(f.jsx)(B.a.Row,{children:Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"duree",children:[Object(f.jsx)(B.a.Check,{inline:!0,label:"Journ\xe9e(s)",name:"duree",type:"radio",value:"2"}),Object(f.jsx)(B.a.Check,{inline:!0,label:"Matin(s)",name:"duree",type:"radio",value:"1"}),Object(f.jsx)(B.a.Check,{inline:!0,label:"Apr\xe8s-midi",name:"duree",type:"radio",value:"0"})]})}),Object(f.jsx)(B.a.Row,{children:Object(f.jsx)(B.a.Group,{as:v.a,ControlId:"estjust",children:Object(f.jsx)(B.a.Check,{label:"Justifi\xe9e",name:"estjust",type:"checkbox",id:"estjust"})})}),Object(f.jsx)(B.a.Row,{children:Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"motif",children:[Object(f.jsx)(B.a.Label,{children:"Motif"}),Object(f.jsx)(B.a.Control,{as:"textarea",rows:3,name:"motif"})]})}),Object(f.jsx)(B.a.Row,{children:Object(f.jsx)(O.a,{type:"submit",variant:"primary",children:"Sauvegarder"})})]})]}),Object(f.jsx)(E.a.Footer,{children:Object(f.jsx)(O.a,{variant:"secondary",onClick:function(){e.closeModal()},children:"Fermer"})})]})})}}]),s}(n.Component),R=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).openModal=function(){return n.setState({isOpen:!0})},n.closeModal=function(){return n.setState({isOpen:!1})},n.state={isOpen:!1,etudid:""},n}return Object(d.a)(s,[{key:"componentDidUpdate",value:function(e){e.open!==this.props.open&&(this.setState({etudid:this.props.etudid}),!0===this.props.open&&this.setState({isOpen:!0}))}},{key:"postData",value:function(){var e=window.location.href.split("/")[7];S(window.$api_url+e+"/Scolarite/Absences/doAnnuleAbsence","datedebut="+this.props.data.date+"&datefin="+this.props.data.date+"&demijournee="+this.props.data.demijournee+"&etudid="+this.state.etudid),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return Object(f.jsx)(f.Fragment,{children:Object(f.jsxs)(E.a,{show:this.state.isOpen,onHide:this.closeModal,children:[Object(f.jsx)(E.a.Header,{closeButton:!0,children:Object(f.jsx)(E.a.Title,{children:"Suppression d'absence"})}),Object(f.jsx)(E.a.Body,{children:Object(f.jsx)("p",{children:"Etes-vous s\xfbr.e de vouloir supprimer cette absence ?"})}),Object(f.jsxs)(E.a.Footer,{children:[Object(f.jsx)(O.a,{variant:"danger",onClick:function(){e.postData()},children:"Supprimer"}),Object(f.jsx)(O.a,{variant:"secondary",onClick:function(){e.closeModal()},children:"Fermer"})]})]})})}}]),s}(n.Component),$=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).openModal=function(){return n.setState({isOpen:!0})},n.closeModal=function(){return n.setState({isOpen:!1})},n.onFormSubmit=function(e){e.preventDefault();var t=new FormData(e.target),s=Object.fromEntries(t.entries()),a="etudid="+n.state.etudid+"&datedebut="+n.props.data.date;if(s.hasOwnProperty("dateFin")&&""!==s.dateFin){var i=s.dateFin.split("-");a+="&datefin="+(i=i[2]+"/"+i[1]+"/"+i[0])}else a+="&datefin="+n.props.data.date;s.hasOwnProperty("duree")?a+="&demijournee="+s.duree:a+="&demijournee="+n.props.data.demijournee,s.hasOwnProperty("motif")&&""!==s.motif&&(a+="&description="+s.motif),n.postData(a)},n.state={isOpen:!1,etudid:"",date:""},n}return Object(d.a)(s,[{key:"componentDidUpdate",value:function(e){if(e.open!==this.props.open){this.setState({etudid:this.props.etudid}),!0===this.props.open&&this.setState({isOpen:!0});var t=this.props.data.date.split("/");t=(t=new Date(t[2]+"-"+t[1]+"-"+t[0])).toISOString().substr(0,10),this.setState({date:t})}}},{key:"postData",value:function(e){var t=window.location.href.split("/")[7];S(window.$api_url+t+"/Scolarite/Absences/doJustifAbsence",e),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return Object(f.jsx)(f.Fragment,{children:Object(f.jsxs)(E.a,{show:this.state.isOpen,onHide:this.closeModal,children:[Object(f.jsx)(E.a.Header,{closeButton:!0,children:Object(f.jsx)(E.a.Title,{children:"Suppression d'absence"})}),Object(f.jsx)(E.a.Body,{children:Object(f.jsxs)(B.a,{onSubmit:this.onFormSubmit,children:[Object(f.jsxs)(B.a.Row,{children:[Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"dateDebut",children:[Object(f.jsx)(B.a.Label,{children:"Date d\xe9but"}),Object(f.jsx)(B.a.Control,{type:"date",name:"dateDebut",defaultValue:this.state.date,readOnly:!0})]}),Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"dateFin",children:[Object(f.jsx)(B.a.Label,{children:"Date fin (Optionnel)"}),Object(f.jsx)(B.a.Control,{type:"date",name:"dateFin",defaultValue:this.state.date})]})]}),Object(f.jsx)(B.a.Row,{children:Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"duree",children:[Object(f.jsx)(B.a.Check,{inline:!0,label:"Journ\xe9e",name:"duree",type:"radio",value:"2"}),Object(f.jsx)(B.a.Check,{inline:!0,label:"Demie-journ\xe9e",name:"duree",type:"radio",defaultValue:this.props.data.demijournee,checked:!0})]})}),Object(f.jsx)(B.a.Row,{children:Object(f.jsxs)(B.a.Group,{as:v.a,ControlId:"motif",children:[Object(f.jsx)(B.a.Label,{children:"Motif"}),Object(f.jsx)(B.a.Control,{as:"textarea",rows:3,name:"motif"})]})}),Object(f.jsx)(B.a.Row,{children:Object(f.jsx)(O.a,{type:"submit",variant:"primary",children:"Sauvegarder"})})]})}),Object(f.jsx)(E.a.Footer,{children:Object(f.jsx)(O.a,{variant:"secondary",onClick:function(){e.closeModal()},children:"Fermer"})})]})})}}]),s}(n.Component),K=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={isOpen:!1,isDelOpen:!1,isJustOpen:!1,abs:[],absjust:[],data:{},loading:!1},n}return Object(d.a)(s,[{key:"componentDidUpdate",value:function(e){e.id!==this.props.id&&(this.setState({loading:!0}),this.getData())}},{key:"componentDidMount",value:function(){""!==this.props.id&&this.getData()}},{key:"openModal",value:function(e,t){var s=this;this.setState(Object(P.a)({},e,!0),(function(){return setTimeout((function(){s.setState(Object(P.a)({},e,!1))}),500)})),t&&this.setState({data:t})}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7],s=window.$api_url;""!==this.state.id&&(y(s+t+"/Scolarite/Absences/ListeAbsEtud?format=json&absjust_only=0&etudid="+this.props.id).then((function(t){return e.setState({abs:t.data})})),y(s+t+"/Scolarite/Absences/ListeAbsEtud?format=json&absjust_only=1&etudid="+this.props.id).then((function(t){return e.setState({absjust:t.data,loading:!1})})))}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{className:"wrapper",children:[""!==this.props.id&&Object(f.jsx)(G,{open:this.state.isOpen,etudid:this.props.id})," ",""!==this.props.id&&Object(f.jsx)(R,{open:this.state.isDelOpen,etudid:this.props.id,data:this.state.data})," ",""!==this.props.id&&Object(f.jsx)($,{open:this.state.isJustOpen,etudid:this.props.id,data:this.state.data}),Object(f.jsx)("h1",{id:"pageTitle",children:"Gestion des absences"}),""!==this.props.name&&Object(f.jsxs)("div",{className:"col-sm",id:"wrapDept",children:[Object(f.jsxs)("h4",{children:["Absences de ",this.props.name+" ",Object(f.jsx)(O.a,{variant:"primary",size:"sm",style:{"margin-right":"2px"},onClick:function(){return e.openModal("isOpen",null)},children:Object(f.jsx)("span",{children:"+"})}),Object(f.jsx)(O.a,{variant:"secondary",size:"sm",style:{"margin-left":"2px"},onClick:function(){return e.getData()},children:Object(f.jsx)("span",{children:"\ud83d\uddd8"})})]}),!0===this.state.loading&&Object(f.jsx)(I.a,{animation:"border"}),this.state.abs.length+this.state.absjust.length===0&&""!==this.props.name&&!1===this.state.loading&&Object(f.jsx)("h6",{children:"Aucune absence de l'\xe9tudiant.e"}),this.state.abs.map((function(t){return Object(f.jsxs)("div",{className:"col-sm",id:"wrapDept",children:[Object(f.jsxs)(v.a,{children:[Object(f.jsxs)("h5",{children:[t.datedmy," | ",t.matin]}),""!==t.motif&&Object(f.jsxs)("span",{children:["Motif: ",t.motif]})," ",""!==t.exams&&Object(f.jsxs)("span",{children:["Exam a rattraper: ",t.exams]})]}),Object(f.jsxs)(v.a,{children:[""===t.motif&&Object(f.jsx)(O.a,{variant:"primary",size:"sm",style:{"margin-right":"2px"},onClick:function(){return e.openModal("isJustOpen",{date:t.datedmy,demijournee:t.ampm})},children:"Justifier"}),Object(f.jsx)(O.a,{variant:"danger",size:"sm",style:{"margin-left":"2px"},onClick:function(){return e.openModal("isDelOpen",{date:t.datedmy,demijournee:t.ampm})},children:"Supprimer"})]})]})})),this.state.absjust.map((function(t){return Object(f.jsxs)("div",{className:"col-sm",id:"wrapDept",children:[Object(f.jsxs)(v.a,{children:[Object(f.jsxs)("h5",{children:[t.datedmy," | ",t.matin]}),""!==t.motif&&Object(f.jsxs)("span",{children:["Motif: ",t.motif]})," ",""!==t.exams&&Object(f.jsxs)("span",{children:["Exam a rattraper: ",t.exams]})]}),Object(f.jsx)(v.a,{children:Object(f.jsx)(O.a,{variant:"danger",size:"sm",style:{"margin-left":"2px"},onClick:function(){return e.openModal("isDelOpen",{date:t.datedmy,demijournee:t.ampm})},children:"Supprimer"})})]})}))]})]})}}]),s}(n.Component),z=s(76),H=s(59),J={display:"flex",alignItems:"center",justifyContent:"space-between"},U={backgroundColor:"#EBECF0",borderRadius:"2em",color:"#172B4D",display:"inline-block",fontSize:12,fontWeight:"normal",lineHeight:"1",minWidth:1,padding:"0.16666666666667em 0.5em",textAlign:"center"},V=function(e){return Object(f.jsxs)("div",{style:J,children:[Object(f.jsx)("span",{children:e.label}),Object(f.jsx)("span",{style:U,children:e.options.length})]})},W=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={students:[],selectOptions:[{label:"Filtre: Aucun",value:"Default"}],id:"",name:""},n}return Object(d.a)(s,[{key:"componentWillMount",value:function(){this.getData()}},{key:"componentDidUpdate",value:function(e){var t=this;if(e!==this.props&&this.props.students.length&&0===this.state.students.length){var s=this.props.students.map((function(e,s){return s%2===0?t.props.students.slice(s,s+2):null})).filter((function(e){return null!=e}));this.setState({students:s})}}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7],s=window.location.href.split("/")[9];y(window.$api_url+t+"/Scolarite/formsemestre_partition_list?format=json&formsemestre_id="+s).then((function(t){t.data.map((function(t){var s={label:t.partition_name,options:[]};t.group.map((function(e){s.options.push({label:e.group_name,value:e.group_id})}));var n=e.state.selectOptions.concat(s);e.setState({selectOptions:n})}))}))}},{key:"getStudents",value:function(){var e=this,t=window.location.href.split("/")[7],s=this.state.id;y(window.$api_url+t+"/Scolarite/groups_view?with_codes=1&format=json&group_ids="+s).then((function(t){var s=t.data.map((function(e,s){return s%2===0?t.data.slice(s,s+2):null})).filter((function(e){return null!=e}));e.setState({students:s})}))}},{key:"handleSelectChange",value:function(e){var t=this;this.setState({id:e.value,name:e.label},(function(){if("Default"!==t.state.id)t.getStudents();else if(t.props.students.length){var e=t.props.students.map((function(e,s){return s%2===0?t.props.students.slice(s,s+2):null})).filter((function(e){return null!=e}));t.setState({students:e})}}))}},{key:"render",value:function(){return Object(f.jsxs)("div",{className:"wrapper",children:[Object(f.jsx)("h1",{id:"pageTitle",children:"Liste des \xe9tudiants"}),Object(f.jsxs)("div",{className:"container",children:[Object(f.jsx)(H.a,{defaultValue:this.state.selectOptions[0],options:this.state.selectOptions,formatGroupLabel:V,onChange:this.handleSelectChange.bind(this)}),0!==this.state.students.length?this.state.students.map((function(e){return Object(f.jsx)("div",{className:"row justify-content-center",children:e.map((function(e,t){return Object(f.jsx)("div",{className:"col",id:"wrapDept",children:Object(f.jsxs)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/Etudiant/").concat(e.etudid),children:[Object(f.jsx)(z.LazyLoadImage,{alt:"".concat(e.nom_disp," ").concat(e.prenom),src:"/ScoDoc/".concat(window.location.href.split("/")[7],"/Scolarite/Notes/get_photo_image?etudid=").concat(e.etudid),width:"102",height:"128",className:"d-inline-block align-top"})," ",Object(f.jsx)("br",{}),e.nom_disp," ",e.prenom]})},t)}))})})):Object(f.jsx)("div",{className:"row justify-content-center",children:Object(f.jsx)(I.a,{animation:"border"})})]})]})}}]),s}(n.Component),q=s(109),Q=s(111),X=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={bltn:{},datue:{},loaded:!1,loading:!1},n.getData=n.getData.bind(Object(h.a)(n)),n}return Object(d.a)(s,[{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7],s=window.location.href.split("/")[9];y(window.$api_url+t+"/Scolarite/Notes/formsemestre_bulletinetud?formsemestre_id="+s+"&etudid="+this.props.id+"&format=json").then((function(t){e.setState({bltn:t.data},(function(){var t={};for(var s in e.state.bltn.decision_ue)t[(s=e.state.bltn.decision_ue[s]).acronyme]=s.titre;e.setState({datue:t},(function(){e.setState({loaded:!0,loading:!1})}))}))}))}},{key:"getPdf",value:function(){w(window.$api_url+window.location.href.split("/")[7]+"/Scolarite/Notes/formsemestre_bulletinetud?formsemestre_id="+window.location.href.split("/")[9]+"&etudid="+this.props.id+"&format=pdf&version=selectedevals").then((function(e){return e.blob()})).then((function(e){var t=window.URL.createObjectURL(e);window.location.assign(t)}))}},{key:"componentDidUpdate",value:function(e){e.id!==this.props.id&&(this.setState({loading:!0}),this.getData())}},{key:"componentDidMount",value:function(){""!==this.props.id&&this.getData()}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{className:"wrapper",children:[Object(f.jsx)("div",{style:{"margin-bottom":"20px"},children:Object(f.jsx)("h1",{id:"pageTitle",children:"Bulletins de notes"})}),!0===this.state.loading&&!1===this.state.loaded&&Object(f.jsx)(I.a,{animation:"border"}),!0===this.state.loaded&&Object(f.jsxs)("div",{children:[Object(f.jsxs)(q.a,{responsive:"sm",children:[Object(f.jsxs)("thead",{children:[Object(f.jsxs)("tr",{children:[Object(f.jsx)("th",{colSpan:"3"}),Object(f.jsx)("th",{children:"Note/20"})]}),Object(f.jsxs)("tr",{className:"bigRow",children:[Object(f.jsx)("th",{colSpan:"3",children:"Moyenne g\xe9n\xe9rale"}),Object(f.jsx)("th",{children:Object(f.jsxs)(Q.a,{children:[Object(f.jsx)(Q.a.Toggle,{variant:"primary",size:"sm",id:"dropdown-basic",children:this.state.bltn.note.value}),Object(f.jsxs)(Q.a.Menu,{children:[Object(f.jsxs)(Q.a.Item,{href:"#",children:["Min: ",this.state.bltn.note.min]}),Object(f.jsxs)(Q.a.Item,{href:"#",children:["Max: ",this.state.bltn.note.max]}),this.state.bltn.hasOwnProperty("rang")&&Object(f.jsxs)(Q.a.Item,{href:"#",children:["Classement: ",this.state.bltn.rang.value,"/",this.state.bltn.rang.ninscrits]})]})]})})]})]}),this.state.bltn.ue.map((function(t){return Object(f.jsxs)("tbody",{children:[Object(f.jsxs)("tr",{className:"ueRow",children:[Object(f.jsxs)("td",{colSpan:"3",children:[t.acronyme," - ",e.state.datue[t.acronyme]]}),Object(f.jsx)("td",{children:Object(f.jsxs)(Q.a,{children:[Object(f.jsx)(Q.a.Toggle,{variant:"primary",size:"sm",id:t.acronyme,children:t.note.value}),Object(f.jsxs)(Q.a.Menu,{children:[Object(f.jsxs)(Q.a.Item,{href:"#",children:["Min: ",t.note.min]}),Object(f.jsxs)(Q.a.Item,{href:"#",children:["Max: ",t.note.max]}),t.hasOwnProperty("rang")&&Object(f.jsxs)(Q.a.Item,{href:"#",children:["Classement: ",t.rang,"/",e.state.bltn.rang.ninscrits]})]})]})})]}),t.module.map((function(t){return Object(f.jsxs)("tr",{children:[Object(f.jsx)("td",{colSpan:"3",children:t.titre.replace("'","'")}),Object(f.jsx)("td",{children:Object(f.jsxs)(Q.a,{children:[Object(f.jsx)(Q.a.Toggle,{variant:"primary",size:"sm",id:t.code,children:t.note.value}),Object(f.jsxs)(Q.a.Menu,{children:[Object(f.jsxs)(Q.a.Item,{href:"#",children:["Min: ",t.note.min]}),Object(f.jsxs)(Q.a.Item,{href:"#",children:["Max: ",t.note.max]}),t.hasOwnProperty("rang")&&Object(f.jsxs)(Q.a.Item,{href:"#",children:["Classement: ",t.rang.value,"/",e.state.bltn.rang.ninscrits]}),Object(f.jsxs)(Q.a.Item,{href:"#",children:["Coefficient: ",t.coefficient]})]})]})})]})}))]})}))]}),Object(f.jsx)("div",{children:Object(f.jsx)(O.a,{className:"btn-primary",onClick:function(){e.getPdf()},children:"Version PDF"})})]})]})}}]),s}(n.Component),Y=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={selectOptions:[],id:"",name:"",defaulttab:"Accueil",defaultsel:""},n}return Object(d.a)(s,[{key:"componentWillMount",value:function(){var e=this;this.getData(),this.props.location.tab&&this.setState({defaulttab:this.props.location.tab,defaultsel:this.props.location.etudid,id:this.props.location.etudid,name:this.state.selectOptions.find((function(t){return t.value===e.state.id}))})}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7],s=window.location.href.split("/")[9];y(window.$api_url+t+"/Scolarite/Notes/groups_view?with_codes=1&format=json&formsemestre_id="+s).then((function(t){e.setState({students:t.data}),t.data.map((function(t){var s=e.state.selectOptions.concat({label:t.nom_disp+" "+t.prenom,value:t.etudid});e.setState({selectOptions:s})}))}))}},{key:"handleSelectChange",value:function(e){this.setState({id:e.value,name:e.label})}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{children:[Object(f.jsx)(x,{}),Object(f.jsx)("div",{className:"container",children:Object(f.jsx)("div",{className:"row justify-content-center",children:Object(f.jsxs)("div",{className:"col-sm",id:"wrapDept",children:["Choix de l'\xe9tudiant",Object(f.jsx)(H.a,{className:"mySelect",options:this.state.selectOptions,onChange:this.handleSelectChange.bind(this),value:this.state.selectOptions.find((function(t){return t.value===e.state.defaultsel}))})]})})}),Object(f.jsx)("div",{children:Object(f.jsxs)(T.a,{defaultActiveKey:this.state.defaulttab,id:"controlled-tab-example",children:[Object(f.jsx)(A.a,{eventKey:"Accueil",title:"Accueil",children:Object(f.jsx)(L,{})}),Object(f.jsx)(A.a,{eventKey:"Absences",title:"Absences",children:Object(f.jsx)(K,{id:this.state.id,name:this.state.name})}),Object(f.jsx)(A.a,{eventKey:"Bulletin",title:"Bulletin",children:Object(f.jsx)(X,{id:this.state.id,name:this.state.name})}),Object(f.jsx)(A.a,{eventKey:"Etud",title:"Etudiants",children:Object(f.jsx)(W,{students:this.state.students})})]})})]})}}]),s}(n.Component),Z=function(e){Object(u.a)(s,e);var t=Object(j.a)(s);function s(e){var n;return Object(l.a)(this,s),(n=t.call(this,e)).state={etud:{},formation:[],semestres:[],loaded:!1},n}return Object(d.a)(s,[{key:"componentWillMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7],s=window.location.href.split("/")[10],n=window.$api_url;y(n+t+"/Scolarite/Notes/etud_info?format=json&etudid="+s).then((function(s){e.setState({etud:s.data,formation:s.data.insemestre}),s.data.insemestre.map((function(s){y(n+t+"/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id="+s.formsemestre_id).then((function(t){var s=e.state.semestres.concat(t.data[0]);e.setState({semestres:s,loaded:!0})}))}))}))}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{children:[Object(f.jsx)(x,{}),Object(f.jsx)("div",{className:"wrapper",children:Object(f.jsxs)("div",{id:"wrapDept",children:[Object(f.jsx)("h1",{children:this.state.etud.nomprenom}),Object(f.jsx)("img",{alt:"".concat(this.state.etud.nomprenom),src:"/ScoDoc/".concat(window.location.href.split("/")[7],"/Scolarite/Notes/").concat(this.state.etud.photo_url),width:"102",height:"128",className:"d-inline-block align-top"})," ",Object(f.jsxs)("div",{id:"wrapDept",className:"col-sm",children:[Object(f.jsx)("h3",{children:"Informations personnelles"}),""!==this.state.etud.telephone||""!==this.state.etud.telephonemobile||""!==this.state.etud.email||""!==this.state.etud.emailperso?Object(f.jsxs)("div",{className:"col-sm",children:[Object(f.jsx)("h4",{children:"Contact"}),""!==this.state.etud.telephone&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)("a",{href:"tel:"+this.state.etud.telephone,children:["T\xe9l\xe9phone: ",this.state.etud.telephone]}),Object(f.jsx)("br",{})]}),""!==this.state.etud.telephonemobile&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)("a",{href:"tel:"+this.state.etud.telephonemobile,children:["Mobile: ",this.state.etud.telephonemobile]}),Object(f.jsx)("br",{})]}),""!==this.state.etud.email&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)("a",{href:"mailto:"+this.state.etud.email,children:["Mail \xe9tudiant: ",this.state.etud.email]}),Object(f.jsx)("br",{})]}),""!==this.state.etud.emailperso&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)("a",{href:"mailto:"+this.state.etud.emailperso,children:["Mail personnel: ",this.state.etud.emailperso]}),Object(f.jsx)("br",{})]})]}):Object(f.jsx)("div",{className:"col-sm",children:"Aucun contact disponible"}),""!==this.state.etud.domicile||""!==this.state.etud.codepostaldomicile||""!==this.state.etud.villedomicile?Object(f.jsxs)("div",{className:"col-sm",children:[Object(f.jsx)("h4",{children:"Lieu de r\xe9sidence"}),"Domicile: ",this.state.etud.domicile," -"," "+this.state.etud.codepostaldomicile," ",this.state.etud.villedomicile,Object(f.jsx)("br",{})]}):Object(f.jsx)("div",{className:"col-sm",children:"Aucune information de r\xe9sidence disponible"})]}),Object(f.jsxs)("div",{id:"wrapDept",className:"col-sm",children:[""!==this.state.etud.bac||""!==this.state.etud.specialite?Object(f.jsxs)("div",{className:"col-sm",children:[Object(f.jsx)("h4",{children:"Parcours"}),"Bac ",this.state.etud.bac," ",this.state.etud.specialite,""!==this.state.etud.nomlycee||""!==this.state.etud.codepostallycee||""!==this.state.etud.villelycee?Object(f.jsxs)("div",{children:[" "+this.state.etud.nomlycee," (",this.state.etud.codepostallycee," ",this.state.etud.villelycee,")",Object(f.jsx)("br",{})]}):null]}):null,!0===this.state.loaded&&Object(f.jsxs)("div",{className:"col-sm",children:[Object(f.jsx)("h4",{children:"Formation actuelle"}),this.state.semestres.map((function(t,s){return Object(f.jsxs)("div",{children:[Object(f.jsx)("b",{children:t.titreannee}),Object(f.jsx)("br",{}),t.date_debut," - ",t.date_fin,Object(f.jsx)("br",{}),""!==e.state.etud.insemestre[s].groupes&&e.state.etud.insemestre[s].groupes&&"Groupes: "+e.state.etud.insemestre[s].groupes,Object(f.jsx)("h5",{children:"Liens"}),Object(f.jsx)(c.c,{to:{pathname:"/".concat(window.location.href.split("/")[7],"/Scolarite/").concat(t.formsemestre_id,"/GestionSem"),tab:"Absences",etudid:window.location.href.split("/")[10]},children:Object(f.jsx)(O.a,{variant:"primary",style:{"margin-right":"2px"},children:"Vers Absences"})}),Object(f.jsx)(c.c,{to:{pathname:"/".concat(window.location.href.split("/")[7],"/Scolarite/").concat(t.formsemestre_id,"/GestionSem"),tab:"Bulletin",etudid:window.location.href.split("/")[10]},children:Object(f.jsx)(O.a,{variant:"primary",style:{"margin-left":"2px"},children:"Vers bulletin"})})]})}))]})]})]})})]})}}]),s}(n.Component),ee=function(){return Object(f.jsxs)(c.b,{children:[Object(f.jsx)(o.b,{exact:!0,path:"/",component:F}),Object(f.jsx)(o.b,{exact:!0,path:"/:DEPT/Scolarite",component:_}),Object(f.jsx)(o.b,{exact:!0,path:"/:DEPT/Scolarite/Etudiant/:EtudId",component:Z}),Object(f.jsx)(o.b,{exact:!0,path:"/:DEPT/Scolarite/:SEM/GestionSem",component:Y})]})};s(100);window.$api_url="/ScoDoc/",i.a.render(Object(f.jsx)(c.a,{children:Object(f.jsx)(ee,{})}),document.getElementById("root")),r()},29:function(e,t,s){}},[[101,1,2]]]);
//# sourceMappingURL=main.16dd1ee7.chunk.js.map