1
0
forked from ScoDoc/ScoDoc
ScoDoc/app/static/mobile/static/js/main.1a008285.chunk.js

2 lines
31 KiB
JavaScript

(this.webpackJsonpscodocmobile=this.webpackJsonpscodocmobile||[]).push([[0],{101:function(e,t,s){"use strict";s.r(t);var n=s(0),a=s(16),i=s.n(a),c=s(17),r=function(e){e&&e instanceof Function&&s.e(3).then(s.bind(null,117)).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),d=s(7),l=s(8),j=s(21),h=s(10),u=s(9),b=(s(28),s(113)),p=s(106),m=s(77),O=s(72),x=s(1),f=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={logout:!1},n}return Object(l.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(x.jsxs)(b.a,{bg:"light",expand:"sm",children:[Object(x.jsxs)(p.a,{children:[Object(x.jsxs)(b.a.Brand,{href:window.$api_url+"static/mobile/",children:[Object(x.jsx)("img",{alt:"ScodocLogo",src:"/ScoDoc/static/icons/scologo_img.png",width:"20",height:"30",className:"d-inline-block align-top"})," ","ScoDoc"]}),Object(x.jsx)(b.a.Toggle,{"aria-controls":"basic-navbar-nav"}),Object(x.jsx)(b.a.Collapse,{id:"basic-navbar-nav",children:Object(x.jsxs)(m.a,{className:"ml-auto",children:[Object(x.jsx)(m.a.Link,{href:"/ScoDoc",children:"Version Desktop"}),Object(x.jsx)(O.a,{variant:"primary",onClick:function(){e.logout()},children:"D\xe9connexion"})]})})]}),!0===this.state.logout&&Object(x.jsx)(o.a,{push:!0,to:"/"})]})}}]),s}(n.Component),v=s(73),w=s(107);function g(e){return fetch(e,{method:"GET",verify:!1,credentials:"include"})}function y(e){return g(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(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={students:[],search_status:0},n.handleChangeSearch=n.handleChangeSearch.bind(Object(j.a)(n)),n.searchStudent=n.searchStudent.bind(Object(j.a)(n)),n}return Object(l.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(x.jsx)("div",{id:"wrapDept",children:"Aucun \xe9tudiant trouv\xe9"}):2===this.state.search_status?Object(x.jsx)(v.a,{children:this.state.students.map((function(e){return Object(x.jsx)(w.a,{id:"wrapDept",children:Object(x.jsx)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/Etudiant/").concat(e.value),children:Object(x.jsx)("span",{children:e.label})})})}))}):void 0}},{key:"render",value:function(){var e=this;return Object(x.jsxs)("div",{className:"wrapper",children:[Object(x.jsxs)("div",{className:"input-group",children:[Object(x.jsx)("input",{type:"text",id:"search",className:"form-control",onChange:this.handleChangeSearch}),Object(x.jsx)("div",{className:"input-group-append",children:Object(x.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(114),D=s(115),_=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.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(j.a)(n)),n}return Object(l.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(x.jsxs)("div",{children:[Object(x.jsx)(f,{}),Object(x.jsx)("section",{children:Object(x.jsx)("h1",{id:"pageTitle",children:"Scolarit\xe9"})}),Object(x.jsxs)(k.a,{defaultActiveKey:"0",children:[Object(x.jsxs)(D.a,{children:[Object(x.jsx)(D.a.Header,{children:Object(x.jsx)(k.a.Toggle,{as:O.a,variant:"link",eventKey:"0",children:"Semestres en cours"})}),Object(x.jsx)(k.a.Collapse,{eventKey:"0",children:Object(x.jsx)(D.a.Body,{children:Object(x.jsx)("div",{className:"container",children:Object(x.jsx)("div",{className:"row",children:this.state.semestres.map((function(e,t){if("1"===e.etat)return Object(x.jsx)("div",{className:"col-sm",id:"wrapDept",children:Object(x.jsxs)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/").concat(e.formsemestre_id,"/GestionSem"),children:[Object(x.jsxs)("h4",{children:[e.titre," [",e.modalite,"]"]}),Object(x.jsxs)("p",{children:["Semestre ",e.semestre_id," - Ann\xe9e ",e.anneescolaire," [",e.date_debut," - ",e.date_fin,"]"]})]})},t)}))})})})})]}),Object(x.jsxs)(D.a,{children:[Object(x.jsx)(D.a.Header,{children:Object(x.jsx)(k.a.Toggle,{as:O.a,variant:"link",eventKey:"1",children:"Semestres pass\xe9s"})}),Object(x.jsx)(k.a.Collapse,{eventKey:"1",children:Object(x.jsx)(D.a.Body,{children:this.state.semestres.map((function(e,t){if("1"!==e.etat)return Object(x.jsx)("div",{className:"col-12",id:"wrapDept",children:Object(x.jsxs)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/").concat(e.formsemestre_id,"/GestionSem"),children:[Object(x.jsxs)("h3",{children:[e.titre," [",e.modalite,"]"]}),Object(x.jsxs)("p",{children:["Semestre ",e.semestre_id," - Ann\xe9e ",e.anneescolaire," [",e.date_debut," - ",e.date_fin,"]"]})]})},t)}))})})]}),Object(x.jsxs)(D.a,{children:[Object(x.jsx)(D.a.Header,{children:Object(x.jsx)(k.a.Toggle,{as:O.a,variant:"link",eventKey:"2",children:"Recherche \xe9tudiant"})}),Object(x.jsx)(k.a.Collapse,{eventKey:"2",children:Object(x.jsx)(D.a.Body,{children:Object(x.jsx)(C,{})})})]})]})]})}}]),s}(n.Component),N=s(74),M=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={depts:[]},n}return Object(l.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(x.jsxs)("div",{className:"wrapper",children:[Object(x.jsx)("h1",{id:"pageTitle",children:"Choix du d\xe9partement"}),Object(x.jsx)("div",{className:"container",children:Object(x.jsx)("div",{className:"row",children:this.state.depts.map((function(e,t){return Object(x.jsx)("div",{className:"col-sm",id:"wrapDept",children:Object(x.jsxs)(c.c,{to:"/".concat(e,"/Scolarite"),children:["D\xe9partement ",e]})},t)}))})})]})}}]),s}(n.Component),T=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={login:"",pass:"",status:0},n.handleChangeLogin=n.handleChangeLogin.bind(Object(j.a)(n)),n.handleChangePass=n.handleChangePass.bind(Object(j.a)(n)),n.checkCredentials=n.checkCredentials.bind(Object(j.a)(n)),n}return Object(l.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(x.jsxs)("div",{children:[!N.isMobile&&Object(x.jsx)("span",{}),0!==this.state.status&&200!==this.state.status&&Object(x.jsx)("div",{className:"wrapper",children:Object(x.jsx)("div",{id:"errorMsg",children:Object(x.jsxs)("h2",{id:"loginTitle",children:["\u26a0\ufe0f"," Login ou mot de passe incorrect"]})})}),""===document.cookie&&Object(x.jsx)("div",{className:"wrapper",children:Object(x.jsxs)("div",{id:"formContent",children:[Object(x.jsx)("h2",{id:"loginTitle",children:"Connexion a ScoDoc"}),Object(x.jsxs)("form",{children:[Object(x.jsx)("input",{type:"text",id:"login",placeholder:"Identifiant",onChange:this.handleChangeLogin}),Object(x.jsx)("input",{type:"password",id:"password",placeholder:"Mot de passe",onChange:this.handleChangePass}),Object(x.jsx)("button",{type:"submit",value:"Log In",onClick:this.checkCredentials,children:"Log in"})]})]})}),Object(x.jsxs)("div",{children:[""!==document.cookie&&Object(x.jsx)(f,{}),""!==document.cookie&&Object(x.jsx)(M,{})]})]})}}]),s}(n.Component),F=s(116),A=s(109),I=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={semestre:{}},n}return Object(l.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("/")[9];y(window.$api_url+t+"/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id="+s).then((function(t){e.setState({semestre:t.data[0]})}))}},{key:"render",value:function(){return Object(x.jsx)("div",{className:"wrapper",children:Object(x.jsxs)("h1",{id:"pageTitle",children:[this.state.semestre.titre,Object(x.jsx)("br",{}),"Semestre ",this.state.semestre.semestre_id," en ",this.state.semestre.modalite,Object(x.jsx)("br",{}),"(Responsable: ",this.state.semestre.responsables,")"]})})}}]),s}(n.Component),L=s(67),P=s(111),E=s(112),B=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.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(l.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(x.jsx)(x.Fragment,{children:Object(x.jsxs)(P.a,{show:this.state.isOpen,onHide:this.closeModal,children:[Object(x.jsx)(P.a.Header,{closeButton:!0,children:Object(x.jsx)(P.a.Title,{children:"Saisie d'absence"})}),Object(x.jsxs)(P.a.Body,{children:[this.state.error&&Object(x.jsx)("span",{children:"Erreur: La date de d\xe9but ne doit pas \xeatre vide"}),Object(x.jsxs)(E.a,{onSubmit:this.onFormSubmit,children:[Object(x.jsxs)(E.a.Row,{children:[Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"dateDebut",children:[Object(x.jsx)(E.a.Label,{children:"Date d\xe9but"}),Object(x.jsx)(E.a.Control,{type:"date",name:"dateDebut"})]}),Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"dateFin",children:[Object(x.jsx)(E.a.Label,{children:"Date fin (Optionnel)"}),Object(x.jsx)(E.a.Control,{type:"date",name:"dateFin"})]})]}),Object(x.jsx)(E.a.Row,{children:Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"duree",children:[Object(x.jsx)(E.a.Check,{inline:!0,label:"Journ\xe9e(s)",name:"duree",type:"radio",value:"2"}),Object(x.jsx)(E.a.Check,{inline:!0,label:"Matin(s)",name:"duree",type:"radio",value:"1"}),Object(x.jsx)(E.a.Check,{inline:!0,label:"Apr\xe8s-midi",name:"duree",type:"radio",value:"0"})]})}),Object(x.jsx)(E.a.Row,{children:Object(x.jsx)(E.a.Group,{as:v.a,ControlId:"estjust",children:Object(x.jsx)(E.a.Check,{label:"Justifi\xe9e",name:"estjust",type:"checkbox",id:"estjust"})})}),Object(x.jsx)(E.a.Row,{children:Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"motif",children:[Object(x.jsx)(E.a.Label,{children:"Motif"}),Object(x.jsx)(E.a.Control,{as:"textarea",rows:3,name:"motif"})]})}),Object(x.jsx)(E.a.Row,{children:Object(x.jsx)(O.a,{type:"submit",variant:"primary",children:"Sauvegarder"})})]})]}),Object(x.jsx)(P.a.Footer,{children:Object(x.jsx)(O.a,{variant:"secondary",onClick:function(){e.closeModal()},children:"Fermer"})})]})})}}]),s}(n.Component),$=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.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(l.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(x.jsx)(x.Fragment,{children:Object(x.jsxs)(P.a,{show:this.state.isOpen,onHide:this.closeModal,children:[Object(x.jsx)(P.a.Header,{closeButton:!0,children:Object(x.jsx)(P.a.Title,{children:"Suppression d'absence"})}),Object(x.jsx)(P.a.Body,{children:Object(x.jsx)("p",{children:"Etes-vous s\xfbr.e de vouloir supprimer cette absence ?"})}),Object(x.jsxs)(P.a.Footer,{children:[Object(x.jsx)(O.a,{variant:"danger",onClick:function(){e.postData()},children:"Supprimer"}),Object(x.jsx)(O.a,{variant:"secondary",onClick:function(){e.closeModal()},children:"Fermer"})]})]})})}}]),s}(n.Component),R=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.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(l.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(x.jsx)(x.Fragment,{children:Object(x.jsxs)(P.a,{show:this.state.isOpen,onHide:this.closeModal,children:[Object(x.jsx)(P.a.Header,{closeButton:!0,children:Object(x.jsx)(P.a.Title,{children:"Suppression d'absence"})}),Object(x.jsx)(P.a.Body,{children:Object(x.jsxs)(E.a,{onSubmit:this.onFormSubmit,children:[Object(x.jsxs)(E.a.Row,{children:[Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"dateDebut",children:[Object(x.jsx)(E.a.Label,{children:"Date d\xe9but"}),Object(x.jsx)(E.a.Control,{type:"date",name:"dateDebut",defaultValue:this.state.date,readOnly:!0})]}),Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"dateFin",children:[Object(x.jsx)(E.a.Label,{children:"Date fin (Optionnel)"}),Object(x.jsx)(E.a.Control,{type:"date",name:"dateFin",defaultValue:this.state.date})]})]}),Object(x.jsx)(E.a.Row,{children:Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"duree",children:[Object(x.jsx)(E.a.Check,{inline:!0,label:"Journ\xe9e",name:"duree",type:"radio",value:"2"}),Object(x.jsx)(E.a.Check,{inline:!0,label:"Demie-journ\xe9e",name:"duree",type:"radio",defaultValue:this.props.data.demijournee,checked:!0})]})}),Object(x.jsx)(E.a.Row,{children:Object(x.jsxs)(E.a.Group,{as:v.a,ControlId:"motif",children:[Object(x.jsx)(E.a.Label,{children:"Motif"}),Object(x.jsx)(E.a.Control,{as:"textarea",rows:3,name:"motif"})]})}),Object(x.jsx)(E.a.Row,{children:Object(x.jsx)(O.a,{type:"submit",variant:"primary",children:"Sauvegarder"})})]})}),Object(x.jsx)(P.a.Footer,{children:Object(x.jsx)(O.a,{variant:"secondary",onClick:function(){e.closeModal()},children:"Fermer"})})]})})}}]),s}(n.Component),G=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={isOpen:!1,isDelOpen:!1,isJustOpen:!1,abs:[],absjust:[],data:{}},n}return Object(l.a)(s,[{key:"componentDidUpdate",value:function(e){e.id!==this.props.id&&this.getData()}},{key:"componentDidMount",value:function(){""!==this.props.id&&this.getData()}},{key:"openModal",value:function(e,t){var s=this;this.setState(Object(L.a)({},e,!0),(function(){return setTimeout((function(){s.setState(Object(L.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})})))}},{key:"render",value:function(){var e=this;return Object(x.jsxs)("div",{className:"wrapper",children:[""!==this.props.id&&Object(x.jsx)(B,{open:this.state.isOpen,etudid:this.props.id})," ",""!==this.props.id&&Object(x.jsx)($,{open:this.state.isDelOpen,etudid:this.props.id,data:this.state.data})," ",""!==this.props.id&&Object(x.jsx)(R,{open:this.state.isJustOpen,etudid:this.props.id,data:this.state.data}),Object(x.jsx)("h1",{id:"pageTitle",children:"Gestion des absences"}),""!==this.props.name&&Object(x.jsxs)("div",{className:"col-sm",id:"wrapDept",children:[Object(x.jsxs)("h4",{children:["Absences de ",this.props.name+" ",Object(x.jsx)(O.a,{variant:"primary",size:"sm",style:{"margin-right":"2px"},onClick:function(){return e.openModal("isOpen",null)},children:Object(x.jsx)("span",{children:"+"})}),Object(x.jsx)(O.a,{variant:"secondary",size:"sm",style:{"margin-left":"2px"},onClick:function(){return e.getData()},children:Object(x.jsx)("span",{children:"\ud83d\uddd8"})})]}),0===this.state.abs.length&&0===this.state.absjust.length&&""!==this.props.name&&Object(x.jsx)("h6",{children:"Aucune absence de l'\xe9tudiant.e"}),this.state.abs.map((function(t){return Object(x.jsxs)("div",{className:"col-sm",id:"wrapDept",children:[Object(x.jsxs)(v.a,{children:[Object(x.jsxs)("h5",{children:[t.datedmy," | ",t.matin]}),""!==t.motif&&Object(x.jsxs)("span",{children:["Motif: ",t.motif]})," ",""!==t.exams&&Object(x.jsxs)("span",{children:["Exam a rattraper: ",t.exams]})]}),Object(x.jsxs)(v.a,{children:[""===t.motif&&Object(x.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(x.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(x.jsxs)("div",{className:"col-sm",id:"wrapDept",children:[Object(x.jsxs)(v.a,{children:[Object(x.jsxs)("h5",{children:[t.datedmy," | ",t.matin]}),""!==t.motif&&Object(x.jsxs)("span",{children:["Motif: ",t.motif]})," ",""!==t.exams&&Object(x.jsxs)("span",{children:["Exam a rattraper: ",t.exams]})]}),Object(x.jsx)(v.a,{children:Object(x.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),K=s(75),z=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={students:[]},n}return Object(l.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("/")[9];y(window.$api_url+t+"/Scolarite/Notes/groups_view?with_codes=1&format=json&formsemestre_id="+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:"render",value:function(){return Object(x.jsxs)("div",{className:"wrapper",children:[Object(x.jsx)("h1",{id:"pageTitle",children:"Liste des \xe9tudiants"}),Object(x.jsx)("div",{className:"container",children:this.state.students.map((function(e){return Object(x.jsx)("div",{className:"row justify-content-center",children:e.map((function(e,t){return Object(x.jsx)("div",{className:"col",id:"wrapDept",children:Object(x.jsxs)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/Etudiant/").concat(e.etudid),children:[Object(x.jsx)(K.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(x.jsx)("br",{}),e.nom_disp," ",e.prenom]})},t)}))})}))})]})}}]),s}(n.Component),J=s(108),H=s(110),U=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={bltn:{},datue:{},loaded:!1},n.getData=n.getData.bind(Object(j.a)(n)),n}return Object(l.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})}))}))}))}},{key:"getPdf",value:function(){g(window.$api_url+window.location.href.split("/")[6]+"/Scolarite/Notes/formsemestre_bulletinetud?formsemestre_id="+window.location.href.split("/")[8]+"&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.getData()}},{key:"componentDidMount",value:function(){""!==this.props.id&&this.getData()}},{key:"render",value:function(){var e=this;return Object(x.jsxs)("div",{className:"wrapper",children:[Object(x.jsx)("div",{style:{"margin-bottom":"20px"},children:Object(x.jsx)("h1",{id:"pageTitle",children:"Bulletins de notes"})}),!0===this.state.loaded&&Object(x.jsxs)("div",{children:[Object(x.jsxs)(J.a,{responsive:"sm",children:[Object(x.jsxs)("thead",{children:[Object(x.jsxs)("tr",{children:[Object(x.jsx)("th",{colSpan:"3"}),Object(x.jsx)("th",{children:"Note/20"})]}),Object(x.jsxs)("tr",{className:"bigRow",children:[Object(x.jsx)("th",{colSpan:"3",children:"Moyenne g\xe9n\xe9rale"}),Object(x.jsx)("th",{children:Object(x.jsxs)(H.a,{children:[Object(x.jsx)(H.a.Toggle,{variant:"primary",size:"sm",id:"dropdown-basic",children:this.state.bltn.note.value}),Object(x.jsxs)(H.a.Menu,{children:[Object(x.jsxs)(H.a.Item,{href:"#",children:["Min: ",this.state.bltn.note.min]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Max: ",this.state.bltn.note.max]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Classement: ",this.state.bltn.rang.value,"/",this.state.bltn.rang.ninscrits]})]})]})})]})]}),this.state.bltn.ue.map((function(t){return Object(x.jsxs)("tbody",{children:[Object(x.jsxs)("tr",{className:"ueRow",children:[Object(x.jsxs)("td",{colSpan:"3",children:[t.acronyme," - ",e.state.datue[t.acronyme]]}),Object(x.jsx)("td",{children:Object(x.jsxs)(H.a,{children:[Object(x.jsx)(H.a.Toggle,{variant:"primary",size:"sm",id:t.acronyme,children:t.note.value}),Object(x.jsxs)(H.a.Menu,{children:[Object(x.jsxs)(H.a.Item,{href:"#",children:["Min: ",t.note.min]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Max: ",t.note.max]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Classement: ",t.rang,"/",e.state.bltn.rang.ninscrits]})]})]})})]}),t.module.map((function(t){return Object(x.jsxs)("tr",{children:[Object(x.jsx)("td",{colSpan:"3",children:t.titre.replace("'","'")}),Object(x.jsx)("td",{children:Object(x.jsxs)(H.a,{children:[Object(x.jsx)(H.a.Toggle,{variant:"primary",size:"sm",id:t.code,children:t.note.value}),Object(x.jsxs)(H.a.Menu,{children:[Object(x.jsxs)(H.a.Item,{href:"#",children:["Min: ",t.note.min]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Max: ",t.note.max]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Classement: ",t.rang.value,"/",e.state.bltn.rang.ninscrits]}),Object(x.jsxs)(H.a.Item,{href:"#",children:["Coefficient: ",t.coefficient]})]})]})})]})}))]})}))]}),Object(x.jsx)("div",{children:Object(x.jsx)(O.a,{className:"btn-primary",onClick:function(){e.getPdf()},children:"Version PDF"})})]})]})}}]),s}(n.Component),W=s(76),V=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={selectOptions:[],id:"",name:""},n}return Object(l.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("/")[9];y(window.$api_url+t+"/Scolarite/Notes/groups_view?with_codes=1&format=json&formsemestre_id="+s).then((function(t){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(){return Object(x.jsxs)("div",{children:[Object(x.jsx)(f,{}),Object(x.jsx)("div",{className:"container",children:Object(x.jsx)("div",{className:"row justify-content-center",children:Object(x.jsxs)("div",{className:"col-sm",id:"wrapDept",children:["Choix de l'\xe9tudiant",Object(x.jsx)(W.a,{className:"mySelect",options:this.state.selectOptions,onChange:this.handleSelectChange.bind(this)})]})})}),Object(x.jsx)("div",{children:Object(x.jsxs)(F.a,{defaultActiveKey:"Accueil",id:"controlled-tab-example",children:[Object(x.jsx)(A.a,{eventKey:"Accueil",title:"Accueil",children:Object(x.jsx)(I,{})}),Object(x.jsx)(A.a,{eventKey:"Absences",title:"Absences",children:Object(x.jsx)(G,{id:this.state.id,name:this.state.name})}),Object(x.jsx)(A.a,{eventKey:"Bulletin",title:"Bulletins",children:Object(x.jsx)(U,{id:this.state.id,name:this.state.name})}),Object(x.jsx)(A.a,{eventKey:"Etud",title:"Etudiants",children:Object(x.jsx)(z,{})})]})})]})}}]),s}(n.Component),q=function(e){Object(h.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={etud:{},formation:[],semestres:[],loaded:!1},n}return Object(l.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(){return Object(x.jsxs)("div",{children:[Object(x.jsx)(f,{}),Object(x.jsx)("div",{className:"wrapper",children:Object(x.jsxs)("div",{id:"wrapDept",children:[Object(x.jsx)("h1",{children:this.state.etud.nomprenom}),Object(x.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(x.jsxs)("div",{id:"wrapDept",className:"col-sm",children:[Object(x.jsx)("h3",{children:"Informations personnelles"}),""!==this.state.etud.telephone||""!==this.state.etud.telephonemobile||""!==this.state.etud.email||""!==this.state.etud.emailperso?Object(x.jsxs)("div",{className:"col-sm",children:[Object(x.jsx)("h4",{children:"Contact"}),""!==this.state.etud.telephone&&Object(x.jsxs)("a",{href:"tel:"+this.state.etud.telephone,children:["T\xe9l\xe9phone: ",this.state.etud.telephone]}),Object(x.jsx)("br",{}),""!==this.state.etud.telephonemobile&&Object(x.jsxs)("a",{href:"tel:"+this.state.etud.telephonemobile,children:["Mobile: ",this.state.etud.telephonemobile]}),Object(x.jsx)("br",{}),""!==this.state.etud.email&&Object(x.jsxs)("a",{href:"mailto:"+this.state.etud.email,children:["Mail \xe9tudiant: ",this.state.etud.email]}),Object(x.jsx)("br",{}),""!==this.state.etud.emailperso&&Object(x.jsxs)("a",{href:"mailto:"+this.state.etud.emailperso,children:["Mail personnel: ",this.state.etud.emailperso]}),Object(x.jsx)("br",{})]}):Object(x.jsx)("div",{className:"col-sm",children:"Aucun contact disponible"}),""!==this.state.etud.domicile||""!==this.state.etud.codepostaldomicile||""!==this.state.etud.villedomicile?Object(x.jsxs)("div",{className:"col-sm",children:[Object(x.jsx)("h4",{children:"Lieu de r\xe9sidence"}),"Domicile: ",this.state.etud.domicile," -"," "+this.state.etud.codepostaldomicile," ",this.state.etud.villedomicile,Object(x.jsx)("br",{})]}):Object(x.jsx)("div",{className:"col-sm",children:"Aucune information de r\xe9sidence disponible"})]}),Object(x.jsxs)("div",{id:"wrapDept",className:"col-sm",children:[""!==this.state.etud.bac||""!==this.state.etud.specialite?Object(x.jsxs)("div",{className:"col-sm",children:[Object(x.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(x.jsxs)("div",{children:[" "+this.state.etud.nomlycee," (",this.state.etud.codepostallycee," ",this.state.etud.villelycee,")",Object(x.jsx)("br",{})]}):null]}):null,!0===this.state.loaded&&Object(x.jsxs)("div",{className:"col-sm",children:[Object(x.jsx)("h4",{children:"Formation actuelle"}),this.state.semestres.map((function(e){return Object(x.jsxs)("div",{children:[Object(x.jsx)("b",{children:e.titreannee}),Object(x.jsx)("br",{}),e.date_debut," - ",e.date_fin]})}))]})]})]})})]})}}]),s}(n.Component),Q=function(){return Object(x.jsxs)(c.b,{children:[Object(x.jsx)(o.b,{exact:!0,path:"/",component:T}),Object(x.jsx)(o.b,{exact:!0,path:"/:DEPT/Scolarite",component:_}),Object(x.jsx)(o.b,{exact:!0,path:"/:DEPT/Scolarite/Etudiant/:EtudId",component:q}),Object(x.jsx)(o.b,{exact:!0,path:"/:DEPT/Scolarite/:SEM/GestionSem",component:V})]})};s(100);window.$api_url="/ScoDoc/",i.a.render(Object(x.jsx)(c.a,{children:Object(x.jsx)(Q,{})}),document.getElementById("root")),r()},28:function(e,t,s){}},[[101,1,2]]]);
//# sourceMappingURL=main.1a008285.chunk.js.map