04/09/2023 - 20h45
parent
34cea2748c
commit
bc10ed1215
|
@ -3062,6 +3062,12 @@ const DisplayPartnerSession = (props) => {
|
||||||
|
|
||||||
function close_edit_form() {
|
function close_edit_form() {
|
||||||
setEdite_session("0");
|
setEdite_session("0");
|
||||||
|
setaddOneSession("");
|
||||||
|
setEdite_session("");
|
||||||
|
submenu_detail_session();
|
||||||
|
setedit_session_form(false);
|
||||||
|
setsubmenu("");
|
||||||
|
setSelectionModel([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,10 @@ import fileDownload from 'js-file-download'
|
||||||
import { RichTextEditor } from '@mantine/rte';
|
import { RichTextEditor } from '@mantine/rte';
|
||||||
import { Editor } from '@tinymce/tinymce-react';
|
import { Editor } from '@tinymce/tinymce-react';
|
||||||
import Button from '@mui/material/Button';
|
import Button from '@mui/material/Button';
|
||||||
|
import TextField from '@mui/material/TextField';
|
||||||
|
import MenuItem from '@mui/material/MenuItem';
|
||||||
|
import { getCookie, setCookie } from 'react-use-cookie';
|
||||||
|
import { useHistory } from "react-router-dom";
|
||||||
|
|
||||||
const TestUrl_New = (props) => {
|
const TestUrl_New = (props) => {
|
||||||
|
|
||||||
|
@ -30,7 +33,83 @@ const TestUrl_New = (props) => {
|
||||||
function add_text() {
|
function add_text() {
|
||||||
console.log(" Ajouter un texte ");
|
console.log(" Ajouter un texte ");
|
||||||
editorRef_programme.current.insertContent("<i> OKKK </i> ");
|
editorRef_programme.current.insertContent("<i> OKKK </i> ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add_nom() {
|
||||||
|
editorRef_programme.current.insertContent(" <i>{{nom}}</i> ");
|
||||||
|
}
|
||||||
|
|
||||||
|
function add_prenom() {
|
||||||
|
editorRef_programme.current.insertContent(" <i>{{prenom}}</i> ");
|
||||||
|
}
|
||||||
|
|
||||||
|
function add_document() {
|
||||||
|
var programme = editorRef_programme.current.getContent();
|
||||||
|
console.log(" doc text = ", programme);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_document() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const [p_filtre1, setp_filtre1] = useState();
|
||||||
|
const [p_filtre1_value, setp_filtre1_value] = useState();
|
||||||
|
|
||||||
|
const [p_champ_table, setp_champ_table] = useState();
|
||||||
|
const [p_collection, setp_collection] = useState();
|
||||||
|
|
||||||
|
|
||||||
|
const [p_champ_table_bis, setp_champ_table_bis] = useState();
|
||||||
|
|
||||||
|
const [Get_Personnalisable_Collection_and_Fields_api, setGet_Personnalisable_Collection_and_Fields_api] = useState();
|
||||||
|
const [Get_Personnalisable_Collection_and_Fields_message, setGet_Personnalisable_Collection_and_Fields_message] = useState();
|
||||||
|
const [Get_Personnalisable_Collection_and_Fields_result, setGet_Personnalisable_Collection_and_Fields_result] = useState();
|
||||||
|
const [Get_Personnalisable_Collection_and_Fields_result_line, setGet_Personnalisable_Collection_and_Fields_result_line] = useState();
|
||||||
|
function Get_Personnalisable_Collection_and_Fields() {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Personnalisable_Collection/";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
console.log(" In Get_Personnalisable_Collection_and_Fields res.data.status = " + res.data.status);
|
||||||
|
console.log(" In Get_Personnalisable_Collection_and_Fields res.data.message r_class = " + res.data.message);
|
||||||
|
|
||||||
|
setGet_Personnalisable_Collection_and_Fields_api("true");
|
||||||
|
setGet_Personnalisable_Collection_and_Fields_result(res.data.message);
|
||||||
|
setGet_Personnalisable_Collection_and_Fields_result_line(res.data.message.fieldss);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setGet_Personnalisable_Collection_and_Fields_api("false");
|
||||||
|
setGet_Personnalisable_Collection_and_Fields_message(res.data.message);
|
||||||
|
alert(res.data.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.warn('Not good man :( Get_Personnalisable_Collection_and_Fields = ', error);
|
||||||
|
setGet_Personnalisable_Collection_and_Fields_api("false");
|
||||||
|
alert(" Impossible de recuperer la liste des collection et champs personnalisables");
|
||||||
|
//setmyApimyApiMessage("")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Get_Personnalisable_Collection_and_Fields();
|
||||||
|
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="testurl_new">
|
<div className="testurl_new">
|
||||||
|
@ -46,6 +125,29 @@ const TestUrl_New = (props) => {
|
||||||
<h3> Page de test * testurl_new </h3>
|
<h3> Page de test * testurl_new </h3>
|
||||||
parametres courseid = {courseid}, tabid = {tabid}
|
parametres courseid = {courseid}, tabid = {tabid}
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
<div className="div_row_gauche texte_area_filter" >
|
||||||
|
<TextField
|
||||||
|
name="filtre1"
|
||||||
|
label="Choisir un document"
|
||||||
|
select
|
||||||
|
sx={{ m: 1, width: '100%' }}
|
||||||
|
value={p_filtre1}
|
||||||
|
onChange={(e) => {
|
||||||
|
setp_filtre1(e.target.value);
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MenuItem value="convocation" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Convocation </MenuItem>
|
||||||
|
<MenuItem value="document2" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Document 2 </MenuItem>
|
||||||
|
<MenuItem value="document3" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Document 3 </MenuItem>
|
||||||
|
<MenuItem value="document4" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Document 4 </MenuItem>
|
||||||
|
|
||||||
|
|
||||||
|
</TextField>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="div_row">
|
<div className="div_row">
|
||||||
<div style={{ "width": "48%", "marginLeft": "1rem", "float": "left" }}>
|
<div style={{ "width": "48%", "marginLeft": "1rem", "float": "left" }}>
|
||||||
<div className="titre_training_text"> Programme (max 1000 caractères) </div>
|
<div className="titre_training_text"> Programme (max 1000 caractères) </div>
|
||||||
|
@ -63,25 +165,135 @@ const TestUrl_New = (props) => {
|
||||||
}}
|
}}
|
||||||
init={{
|
init={{
|
||||||
resize: false,
|
resize: false,
|
||||||
height: 300,
|
height: 500,
|
||||||
menubar: false,
|
menubar: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
'advlist autolink lists link image charmap print preview anchor',
|
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
|
||||||
'searchreplace visualblocks code fullscreen',
|
'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
|
||||||
'insertdatetime media table paste code help wordcount'
|
'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
|
||||||
|
|
||||||
],
|
],
|
||||||
|
toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
|
||||||
|
'alignleft aligncenter alignright alignjustify | ' +
|
||||||
|
'bullist numlist checklist outdent indent | removeformat | a11ycheck code table help',
|
||||||
|
|
||||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px; }'
|
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px; }'
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<Button className="bton_enreg" onClick={add_document} style={{ "margin": "1rem" }}
|
||||||
|
>Ajouter
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
|
<Button className="bton_suppr" onClick={delete_document} style={{ "margin": "1rem" }}
|
||||||
|
> Supprimer
|
||||||
|
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div style={{ "width": "48%", "marginLeft": "1rem", "float": "left" }}>
|
<div style={{ "width": "48%", "marginLeft": "1rem", "float": "left" }}>
|
||||||
<div className="titre1"> Action </div>
|
<div className="titre1"> Action </div>
|
||||||
<Button className="bton_enreg" onClick={add_text}
|
|
||||||
|
|
||||||
|
<div className="div_row">
|
||||||
|
|
||||||
|
<div className="session_caract"> Choisir un objet <br />
|
||||||
|
<TextField
|
||||||
|
name="collection"
|
||||||
|
id="collection"
|
||||||
|
select
|
||||||
|
InputLabelProps={{
|
||||||
|
shrink: true,
|
||||||
|
}}
|
||||||
|
disabled={false}
|
||||||
|
className="disabled_style enable_style"
|
||||||
|
//value={p_collection}
|
||||||
|
onChange={(e) => {
|
||||||
|
const div1 = document.getElementById("pave_mysy_label");
|
||||||
|
const mysy_label = div1.getAttribute('mysy_label');
|
||||||
|
console.log(" ### mysy_label= ", mysy_label);
|
||||||
|
setp_collection(mysy_label);
|
||||||
|
|
||||||
|
setp_champ_table_bis(e.target.value);
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
{Get_Personnalisable_Collection_and_Fields_result &&
|
||||||
|
Get_Personnalisable_Collection_and_Fields_result.map((mycollection) => (
|
||||||
|
<MenuItem key={JSON.parse(mycollection).fields}
|
||||||
|
value={JSON.parse(mycollection).fields}
|
||||||
|
mysy_label={JSON.parse(mycollection).collection_fonctional_name}
|
||||||
|
id="pave_mysy_label"
|
||||||
|
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||||
|
{JSON.parse(mycollection).collection_fonctional_name}
|
||||||
|
|
||||||
|
</MenuItem>
|
||||||
|
))}
|
||||||
|
|
||||||
|
|
||||||
|
</TextField>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
p_champ_table = {p_champ_table} <br/>
|
||||||
|
{<div className="session_caract"> Choisir un champ <br />
|
||||||
|
<TextField
|
||||||
|
name="champ_table"
|
||||||
|
id="champ_table"
|
||||||
|
select
|
||||||
|
InputLabelProps={{
|
||||||
|
shrink: true,
|
||||||
|
}}
|
||||||
|
disabled={false}
|
||||||
|
className="disabled_style enable_style"
|
||||||
|
//value={p_champ_table}
|
||||||
|
onChange={(e) => {
|
||||||
|
setp_champ_table(e.target.value);
|
||||||
|
console.log(" ### e.target.value = ", e.target.value)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
{p_champ_table_bis &&
|
||||||
|
p_champ_table_bis.map((mycollection) => (
|
||||||
|
|
||||||
|
<MenuItem value={mycollection.field_technical_name}
|
||||||
|
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||||
|
{mycollection.field_fonctional_name}
|
||||||
|
|
||||||
|
</MenuItem>
|
||||||
|
|
||||||
|
))}
|
||||||
|
|
||||||
|
</TextField>
|
||||||
|
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Button className="bton_enreg" onClick={add_text} style={{ "margin": "1rem" }}
|
||||||
>Ajouter text 'OKKK'
|
>Ajouter text 'OKKK'
|
||||||
|
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Button className="bton_enreg" onClick={add_nom} style={{ "margin": "1rem" }}
|
||||||
|
>Ajouter Nom
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button className="bton_enreg" onClick={add_prenom} style={{ "margin": "1rem" }}
|
||||||
|
>Ajouter Prenom
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue