recette2
cherif 2024-10-15 14:08:41 +02:00
parent 1bc8417f9c
commit 8e2d53633c
12 changed files with 496 additions and 292 deletions

View File

@ -4101,7 +4101,7 @@ const AddClassManual = (props) => {
</div>
<div className="row_block zone_gestion_admin">
<Button variant="contained" color="success" className="bton_gestion_admin"
{/* <Button variant="contained" color="success" className="bton_gestion_admin"
onClick={(e) => {
e.preventDefault();
@ -4113,7 +4113,7 @@ const AddClassManual = (props) => {
}}>
GESTION ADMINISTRATIVE &nbsp; <GrUserAdmin />
</Button>
</Button>*/}
</div>

View File

@ -4837,7 +4837,6 @@ const Apprenant = (props) => {
function CustomToolbar(props) {
console.log(" my props = ", props);
return (
<GridToolbarContainer {...props}>

View File

@ -1614,6 +1614,55 @@ const DisplayPartnerSession = (props) => {
}
// lorsqu'on rentre dans ce fichier avec une formation, il faut aller chercher toutes sessions de la formation zzz
const [Getall_TrainingSession_For_Given_Class_api, setGetall_TrainingSession_For_Given_Class_api] = useState();
const [Getall_TrainingSession_For_Given_Class_message, setGetall_TrainingSession_For_Given_Class_message] = useState();
const [Getall_TrainingSession_For_Given_Class_result, setGetall_TrainingSession_For_Given_Class_result] = useState();
function Getall_TrainingSession_For_Given_Class(props_class_internal_url) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
// Recuperation des parametres
var filtre1 = "class_internal_url"
var filtre1_value = props_class_internal_url;
form.append(filtre1, filtre1_value);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List_filter_like/";
setLoading(true);
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_TrainingSession_For_Given_Class res.data.status = " + res.data.status);
// console.log(" In Getall_TrainingSession_For_Given_Class res.data.message r_class = " + res.data.message);
setGetall_TrainingSession_For_Given_Class_api("true");
setGetall_TrainingSession_For_Given_Class_result(res.data.message);
setRows(res.data.message);
}
else {
setGetall_TrainingSession_For_Given_Class_api("false");
setGetall_TrainingSession_For_Given_Class_message(res.data.message);
alert(res.data.message)
}
setLoading(false);
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_TrainingSession_For_Given_Class = ', error);
setGetall_TrainingSession_For_Given_Class_api("false");
alert("Impossible de lancer la recherche");
//setmyApimyApiMessage("")
})
}
const [New_Get_List_Partner_Clients_result, setNew_Get_List_Partner_Clients_result] = useState([]);
const [Get_List_Partner_Clients_api, setGet_List_Partner_Clients_api] = useState();
@ -1979,13 +2028,9 @@ const DisplayPartnerSession = (props) => {
Get_Partner_Object_Specific_Fields("session_formation");
Getall_Training_Employee_No_Filter();
Getall_Training_Materiel_No_Filter();
Get_List_Partner_Financeurs();
Getall_Parter_OR_Default_Session_Steps();
GetCurrentPartnerClass();
Getall_TrainingSession();
GetAttestation_Certif();
Get_List_Partner_Clients();
Getall_Partner_Site_Formation();
@ -1995,13 +2040,24 @@ const DisplayPartnerSession = (props) => {
setdatagrid_columns_size_model2(50);
}
if (props.object_key && String(props.object_key).length > 3) {
if (props.object_key && String(props.object_key).length > 2) {
setLoading(true);
GetCurrentSession(props.object_key, props.class_internal_url);
Display_session_From_Props(props.object_key, props.class_internal_url);
let text = String(props.object_key);
if (props.object_key === "class") {
Getall_TrainingSession_For_Given_Class(props.class_internal_url);
} else {
Getall_TrainingSession();
GetCurrentSession(props.object_key, props.class_internal_url);
Display_session_From_Props(props.object_key, props.class_internal_url);
}
setLoading(false);
} else {
Getall_TrainingSession();
window.scrollTo({
top: 0,
behavior: "smooth",

View File

@ -6557,7 +6557,6 @@ const DisplayPartnerStagiaires = (props) => {
function CustomToolbar(props) {
console.log(" my props = ", props);
return (
<GridToolbarContainer {...props}>

View File

@ -51,7 +51,7 @@ import {
GridPreferencePanelsValue,
} from '@mui/x-data-grid';
import * as XLSX from 'xlsx';
import * as XLSX from 'xlsx';
const DistplayPartnerTraningsPage = (props) => {
@ -408,7 +408,7 @@ const DistplayPartnerTraningsPage = (props) => {
const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(120);
const columns = [
{ field: 'id', headerName: 'id', hide: true, maxWidth: 1, disableExport: true,},
{ field: 'id', headerName: 'id', hide: true, maxWidth: 1, disableExport: true, },
{ field: '_id', headerName: '_id', hide: true, maxWidth: 1, disableExport: true, },
{ field: 'lms_class_code', headerName: 'lms_class_code', hide: true, Width: 0, },
{ field: 'duration', headerName: 'duration', hide: true, Width: 0, },
@ -429,7 +429,52 @@ const DistplayPartnerTraningsPage = (props) => {
{ field: 'categorie', headerName: 'Catégorie', minWidth: 100, flex: 1, maxWidth: 200, hideable: true, hide: true, editable: false, renderCell: (params) => <Display_Colunm_text {...params} />, },
{ field: 'nb_session_formation', headerName: 'Nb Session', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", renderCell: (params) => <Display_Colunm_text {...params} />, },
{
field: 'nb_session_formation', headerName: 'Nb Session', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center",
renderCell: (cellValues) => {
return (
<nav style={{ width: '100%', 'textAlign': 'center' }}>
{String(cellValues.row.nb_session_formation).length > 0 && parseInt(String(cellValues.row.nb_session_formation)) <= 0 && <div>
{cellValues.row.nb_session_formation}
</div>}
{String(cellValues.row.nb_session_formation).length > 0 && parseInt(String(cellValues.row.nb_session_formation)) > 0 &&
<nav>
<Button
onClick={(event) => {
window.open(
process.env.REACT_APP_FRONT_URL + "Partner/mes_sessions/class/"+String(cellValues.row.internal_url),
'_blank'
);
}}
variant="outlined"
>
{cellValues.row.nb_session_formation}
</Button>
</nav>}
</nav>
);
},
},
{ field: 'url', headerName: 'lien', minWidth: 20, hideable: true, hide: true, editable: false, },
{ field: 'description', headerName: 'Description', hide: true, resizable: true, minWidth: 250, maxWidth: 300, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
@ -454,7 +499,7 @@ const DistplayPartnerTraningsPage = (props) => {
);
},
},
{
/*{
field: "management", headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100,
renderCell: (cellValues) => {
return (
@ -471,7 +516,7 @@ const DistplayPartnerTraningsPage = (props) => {
);
}
},
},*/
{
field: "visual", headerName: 'Visualiser', minWidth: 50, flex: 1, maxWidth: 100, disableExport: true,
renderCell: (cellValues) => {
@ -1766,116 +1811,116 @@ const DistplayPartnerTraningsPage = (props) => {
]
// DEBUT EXPORT EXCEL DATAGRID
// DEBUT EXPORT EXCEL DATAGRID
function CustomToolbar(props) {
console.log(" my props = ", props);
return (
<GridToolbarContainer {...props}>
<GridToolbarColumnsButton />
<GridToolbarFilterButton />
<GridToolbarDensitySelector
slotProps={{ tooltip: { title: 'Change density' } }}
/>
<Box sx={{ flexGrow: 1 }} />
<ExportButton data_colums={props.data_colums} />
function CustomToolbar(props) {
</GridToolbarContainer>
);
}
function getExcelData(apiRef) {
// Select rows and columns
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
return (
<GridToolbarContainer {...props}>
// Format the data. Here we only keep the value
const data = filteredSortedRowIds.map((id) => {
const row = {};
visibleColumnsField.forEach((field) => {
row[field] = apiRef.current.getCellParams(id, field).value;
<GridToolbarColumnsButton />
<GridToolbarFilterButton />
<GridToolbarDensitySelector
slotProps={{ tooltip: { title: 'Change density' } }}
/>
<Box sx={{ flexGrow: 1 }} />
<ExportButton data_colums={props.data_colums} />
</GridToolbarContainer>
);
}
function getExcelData(apiRef) {
// Select rows and columns
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
// Format the data. Here we only keep the value
const data = filteredSortedRowIds.map((id) => {
const row = {};
visibleColumnsField.forEach((field) => {
row[field] = apiRef.current.getCellParams(id, field).value;
});
return row;
});
return row;
});
return data;
}
return data;
}
function ExportButton(props) {
return (
<GridToolbarExportContainer {...props}>
<ExportMenuItem data_colums={props.data_colums} />
</GridToolbarExportContainer>
);
}
function ExportButton(props) {
return (
<GridToolbarExportContainer {...props}>
<ExportMenuItem data_colums={props.data_colums} />
</GridToolbarExportContainer>
);
}
function handleExport(apiRef, data_colums) {
const data = getExcelData(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
function handleExport(apiRef, data_colums) {
const data = getExcelData(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
const local_config = {
keys: visibleColumnsField,
const local_config = {
keys: visibleColumnsField,
columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
if (mydata.headerName) {
return mydata.headerName;
columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
if (mydata.headerName) {
return mydata.headerName;
}
}
}),
fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
local_config.columnNames = local_config.columnNames.filter(function (element) {
return element !== undefined;
});
const rows = data.map((row) => {
const mRow = {};
for (const key of local_config.keys) {
mRow[key] = row[key];
}
return mRow;
});
}),
const worksheet = XLSX.utils.json_to_sheet(rows);
XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
origin: 'A1',
});
fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
XLSX.writeFile(workbook, local_config.fileName, { compression: true });
}
local_config.columnNames = local_config.columnNames.filter(function( element ) {
return element !== undefined;
});
function ExportMenuItem(props) {
const apiRef = useGridApiContext();
const { hideMenu } = props;
return (
<MenuItem
onClick={() => {
handleExport(apiRef, props.data_colums);
// Hide the export menu after the export
hideMenu?.();
}}
>
Export Excel
</MenuItem>
);
}
const rows = data.map((row) => {
const mRow = {};
for (const key of local_config.keys) {
mRow[key] = row[key];
}
return mRow;
});
const worksheet = XLSX.utils.json_to_sheet(rows);
XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
origin: 'A1',
});
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
XLSX.writeFile(workbook, local_config.fileName, { compression: true });
}
function ExportMenuItem(props) {
const apiRef = useGridApiContext();
const { hideMenu } = props;
return (
<MenuItem
onClick={() => {
handleExport(apiRef, props.data_colums);
// Hide the export menu after the export
hideMenu?.();
}}
>
Export Excel
</MenuItem>
);
}
// FIN EXPORT EXCEL DATAGRID
// FIN EXPORT EXCEL DATAGRID
return (
@ -2407,124 +2452,124 @@ function ExportMenuItem(props) {
}}
>
{New_Get_List_Domaines_result &&
New_Get_List_Metiers_result &&
New_Get_List_Categorie_result &&
New_Get_List_Domaines_result.length > 0 &&
New_Get_List_Metiers_result.length > 0 &&
New_Get_List_Categorie_result.length > 0 &&
New_Get_List_Metiers_result &&
New_Get_List_Categorie_result &&
New_Get_List_Domaines_result.length > 0 &&
New_Get_List_Metiers_result.length > 0 &&
New_Get_List_Categorie_result.length > 0 &&
<DataGrid
checkboxSelection
components={{
Toolbar: CustomToolbar
}}
componentsProps={{ toolbar: { data_colums: columns } }}
<DataGrid
checkboxSelection
components={{
Toolbar: CustomToolbar
}}
componentsProps={{ toolbar: { data_colums: columns } }}
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
//console.log("ch selected--" + newSelectionModel);
}}
selectionModel={selectionModel}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={rowss.map((item, index) => (
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
//console.log("ch selected--" + newSelectionModel);
}}
selectionModel={selectionModel}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={rowss.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
internal_url: JSON.parse(item).internal_url,
zone_diffusion: JSON.parse(item).zone_diffusion_str,
external_code: JSON.parse(item).external_code,
title: parse((JSON.parse(item).title).replace(/(<([^>]+)>)/ig, '')),
{
id: index,
_id: JSON.parse(item)._id,
internal_url: JSON.parse(item).internal_url,
zone_diffusion: JSON.parse(item).zone_diffusion_str,
external_code: JSON.parse(item).external_code,
title: parse((JSON.parse(item).title).replace(/(<([^>]+)>)/ig, '')),
domain: New_Get_List_Domaines_result.filter((data) => (data)._id === String(JSON.parse(item).domaine))[0].label,
domain: New_Get_List_Domaines_result.filter((data) => (data)._id === String(JSON.parse(item).domaine))[0].label,
metier: New_Get_List_Metiers_result.filter((data) => (data)._id === String(JSON.parse(item).metier))[0].label,
metier: New_Get_List_Metiers_result.filter((data) => (data)._id === String(JSON.parse(item).metier))[0].label,
categorie: New_Get_List_Categorie_result.filter((data) => (data)._id === String(JSON.parse(item).categorie))[0].label,
categorie: New_Get_List_Categorie_result.filter((data) => (data)._id === String(JSON.parse(item).categorie))[0].label,
url: JSON.parse(item).url,
url: JSON.parse(item).url,
price: JSON.parse(item).price,
description: parse((JSON.parse(item).description).replace(/(<([^>]+)>)/ig, '')),
published: JSON.parse(item).published,
lms_class_code: JSON.parse(item).lms_class_code,
duration: JSON.parse(item).duration,
duration_unit: JSON.parse(item).duration_unit,
duration_in_hour: JSON.parse(item).duration_in_hour,
presentiel: JSON.parse(item).presentiel.presentiel,
distanciel: JSON.parse(item).presentiel.distantiel,
cible: JSON.parse(item).pourqui,
currency: JSON.parse(item).currecny,
price: JSON.parse(item).price,
description: parse((JSON.parse(item).description).replace(/(<([^>]+)>)/ig, '')),
published: JSON.parse(item).published,
lms_class_code: JSON.parse(item).lms_class_code,
duration: JSON.parse(item).duration,
duration_unit: JSON.parse(item).duration_unit,
duration_in_hour: JSON.parse(item).duration_in_hour,
presentiel: JSON.parse(item).presentiel.presentiel,
distanciel: JSON.parse(item).presentiel.distantiel,
cible: JSON.parse(item).pourqui,
currency: JSON.parse(item).currecny,
version: JSON.parse(item).version,
version: JSON.parse(item).version,
nb_session_formation: JSON.parse(item).nb_session_formation,
nb_session_formation: JSON.parse(item).nb_session_formation,
}
))}
columns={columns}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
setgridline_id(newSelectionModel.row.id);
Closecreatetraining();
closeTrainingForm();
var al = JSON.parse(rowss[newSelectionModel.row.id])
setselected_row_data_json(JSON.parse(rowss[newSelectionModel.row.id]));
setclassidtrainingtoupdate(newSelectionModel.row._id);
setreftrainingtoupdate(newSelectionModel.row.internal_url);
setexternalcodetraining_toupdate(newSelectionModel.row.external_code);
setDialog_formation_open(true);
}
))}
columns={columns}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
setgridline_id(newSelectionModel.row.id);
Closecreatetraining();
closeTrainingForm();
var al = JSON.parse(rowss[newSelectionModel.row.id])
setselected_row_data_json(JSON.parse(rowss[newSelectionModel.row.id]));
setclassidtrainingtoupdate(newSelectionModel.row._id);
setreftrainingtoupdate(newSelectionModel.row.internal_url);
setexternalcodetraining_toupdate(newSelectionModel.row.external_code);
setDialog_formation_open(true);
}
}
rowsPerPageOptions={[10]}
disableSelectionOnClick
/* components={{
Toolbar: GridToolbar,
}}*/
getCellClassName={(params) => {
if (params.field === 'published' && String(params.value) === "1") {
return 'cell--published';
}
if (params.field === "published" && String(params.value) !== "1") {
return 'cell--unpublished'
}
rowsPerPageOptions={[10]}
disableSelectionOnClick
/* components={{
Toolbar: GridToolbar,
}}*/
}}
getRowClassName={(params) => {
getCellClassName={(params) => {
if (params.field === 'published' && String(params.value) === "1") {
return 'cell--published';
}
// Pour la gestion de la couleur de zone double cliquée
if (String(params.row.id) === String(gridline_id)) {
return 'line--statut--selected';
}
if (params.field === "published" && String(params.value) !== "1") {
return 'cell--unpublished'
}
if (String(params.row.published) === "1") {
return 'line--published';
}
}}
getRowClassName={(params) => {
if (String(params.row.published) !== "1") {
return 'line--unpublished';
}
// Pour la gestion de la couleur de zone double cliquée
if (String(params.row.id) === String(gridline_id)) {
return 'line--statut--selected';
}
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
if (String(params.row.published) === "1") {
return 'line--published';
}
sx={datagridSx}
if (String(params.row.published) !== "1") {
return 'line--unpublished';
}
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
sx={datagridSx}
/>}
/>}
</Box>
</div>
</div>

View File

@ -2177,7 +2177,6 @@ const Groupe_Apprenant = (props) => {
function CustomToolbar(props) {
console.log(" my props = ", props);
return (
<GridToolbarContainer {...props}>

View File

@ -162,7 +162,7 @@ const Module_Historique_Action = (props) => {
</DialogActions>
</Dialog>
<div className="div_row" id="div_header" style={{border:"none"}}>
<nav style={{fontSize:"calc(1.275rem + .3vw)", color:"rgb(10, 42, 77)"}}> Historique des actions </nav>
<nav style={{fontSize:"calc(1.1rem + .3vw)", color:"rgb(10, 42, 77)"}}> Historique des actions </nav>
</div>
<Timeline

View File

@ -200,26 +200,26 @@ const Partner = (props) => {
}));
const StyledBadge_mysy_color1 = styled(Badge)(({ }) => ({
const StyledBadge_mysy_color1 = styled(Badge)(({ }) => ({
'& .MuiBadge-badge': {
right: 0,
top: 0,
border: '2px solid #ffffff',
padding: '0 4px',
background:'#6a329f',
color:"#ffffff"
background: '#6a329f',
color: "#ffffff"
},
}));
const StyledBadge_mysy_red = styled(Badge)(({ }) => ({
const StyledBadge_mysy_red = styled(Badge)(({ }) => ({
'& .MuiBadge-badge': {
right: 0,
top: 0,
border: '2px solid ',
padding: '0 4px',
background:'#f44336',
color:"#ffffff",
background: '#f44336',
color: "#ffffff",
},
}));
@ -1677,7 +1677,7 @@ const Partner = (props) => {
<b> {parntername}&nbsp;-&nbsp;{String(partnerPackService).toUpperCase()} ({parnternbformation})</b> &nbsp; &nbsp;
{GetPartnerNameFromToken_api_result && conntected_employee_activite_retard && parseFloat(conntected_employee_activite_retard) > 0 &&
<StyledBadge_mysy_red badgeContent={String(parseFloat(conntected_employee_activite_retard))} style={{ "cursor": "pointer" }}
<StyledBadge_mysy_red badgeContent={String(parseFloat(conntected_employee_activite_retard))} style={{ "cursor": "pointer" }}
onClick={(event) => {
monactivite_func();
@ -1710,7 +1710,7 @@ const Partner = (props) => {
{parnter_user_employee}
{!parntername && <b> Utilisateur </b>} &nbsp; &nbsp;
{GetPartnerNameFromToken_api_result && conntected_employee_activite_retard && parseFloat(conntected_employee_activite_retard) > 0 &&
<StyledBadge_mysy_red badgeContent={conntected_employee_activite_retard} style={{ "cursor": "pointer" }}
<StyledBadge_mysy_red badgeContent={conntected_employee_activite_retard} style={{ "cursor": "pointer" }}
onClick={(event) => {
monactivite_func();
@ -1721,7 +1721,7 @@ const Partner = (props) => {
</StyledBadge_mysy_red>} &nbsp; &nbsp;
{GetPartnerNameFromToken_api_result && conntected_employee_activite_new && parseFloat(conntected_employee_activite_new) > 0 &&
<StyledBadge_mysy_color1 badgeContent={conntected_employee_activite_new} style={{ "cursor": "pointer" }}
<StyledBadge_mysy_color1 badgeContent={conntected_employee_activite_new} style={{ "cursor": "pointer" }}
onClick={(event) => {
monactivite_func();
@ -2086,7 +2086,7 @@ const Partner = (props) => {
<PartnerTranings ispending={partnerstatus} currentpack={partnerPackService} conntected_employee_id={conntected_employee_id}
class_external_code={orderid} class_internal_url={packs} formation_initiale={formation_initiale}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -2294,7 +2294,9 @@ const Partner = (props) => {
{String(menu) === "mes_sessions" &&
<div className="div_droite">
<DisplayPartnerSession conntected_employee_id={conntected_employee_id} object_key={orderid} class_internal_url={packs}
<DisplayPartnerSession conntected_employee_id={conntected_employee_id}
object_key={orderid}
class_internal_url={packs}
read_access={check_user_acces_right("session", "read")} write_access={check_user_acces_right("session", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
@ -2303,15 +2305,15 @@ const Partner = (props) => {
{String(menu) === "mes_employes" &&
<div className="div_droite">
<Employes conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("employe", "read")} write_access={check_user_acces_right("employe", "write")}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}
{String(menu) === "factures_client" &&
<div className="div_droite">
<Factures_Client conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("facture_client", "read")}
write_access={check_user_acces_right("facture_client", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("facture_client", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -2325,8 +2327,8 @@ const Partner = (props) => {
{String(menu) === "mon_materiel" &&
<div className="div_droite">
<Materiels conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("materiel", "read")}
write_access={check_user_acces_right("materiel", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("materiel", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -2351,8 +2353,8 @@ const Partner = (props) => {
{String(menu) === "mes_cmd" &&
<div className="div_droite">
<Partner_Commande conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("commande", "read")}
write_access={check_user_acces_right("commande", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("commande", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -2360,8 +2362,8 @@ const Partner = (props) => {
{String(menu) === "facture" && <div className="div_droite">
<Facture currentpack={partnerPackService} conntected_employee_id={conntected_employee_id}
read_access={check_user_acces_right("compte_partner", "read")} write_access={check_user_acces_right("compte_partner", "write")}
check_user_acces_right={check_user_acces_right}/>
read_access={check_user_acces_right("compte_partner", "read")} write_access={check_user_acces_right("compte_partner", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -2376,7 +2378,7 @@ const Partner = (props) => {
<Apprenant conntected_employee_id={conntected_employee_id} object_key={orderid} subdata={packs}
read_access={check_user_acces_right("stagiaire", "read")} write_access={check_user_acces_right("stagiaire", "write")}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -2385,7 +2387,7 @@ const Partner = (props) => {
<DisplayPartnerStagiaires conntected_employee_id={conntected_employee_id} object_key={orderid} subdata={packs}
read_access={check_user_acces_right("stagiaire", "read")} write_access={check_user_acces_right("stagiaire", "write")}
formation_initiale={formation_initiale}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3019,23 +3021,23 @@ const Partner = (props) => {
<DisplayPartnerSession conntected_employee_id={conntected_employee_id} object_key={orderid} class_internal_url={packs}
read_access={check_user_acces_right("session", "read")} write_access={check_user_acces_right("session", "write")}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}
{String(menu) === "mes_employes" &&
<div className="div_droite div_droite_ralonge">
<Employes conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("employe", "read")}
write_access={check_user_acces_right("employe", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("employe", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
{String(menu) === "factures_client" &&
<div className="div_droite div_droite_ralonge">
<Factures_Client conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("facture_client", "read")}
write_access={check_user_acces_right("facture_client", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("facture_client", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3049,8 +3051,8 @@ const Partner = (props) => {
{String(menu) === "mon_materiel" &&
<div className="div_droite div_droite_ralonge">
<Materiels conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("materiel", "read")}
write_access={check_user_acces_right("materiel", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("materiel", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3058,8 +3060,8 @@ const Partner = (props) => {
{String(menu) === "mes_salles" &&
<div className="div_droite div_droite_ralonge">
<Materiel_Salle conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("materiel", "read")}
write_access={check_user_acces_right("materiel", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("materiel", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3073,8 +3075,8 @@ const Partner = (props) => {
{String(menu) === "mes_cmd" &&
<div className="div_droite div_droite_ralonge">
<Partner_Commande conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("commande", "read")}
write_access={check_user_acces_right("commande", "write")}
check_user_acces_right={check_user_acces_right}/>
write_access={check_user_acces_right("commande", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3082,8 +3084,8 @@ const Partner = (props) => {
{String(menu) === "facture" && <div className="div_droite div_droite_ralonge">
<Facture currentpack={partnerPackService} conntected_employee_id={conntected_employee_id}
read_access={check_user_acces_right("compte_partner", "read")} write_access={check_user_acces_right("compte_partner", "write")}
check_user_acces_right={check_user_acces_right}/>
read_access={check_user_acces_right("compte_partner", "read")} write_access={check_user_acces_right("compte_partner", "write")}
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3097,7 +3099,7 @@ const Partner = (props) => {
<Apprenant conntected_employee_id={conntected_employee_id} object_key={orderid} subdata={packs}
read_access={check_user_acces_right("stagiaire", "read")} write_access={check_user_acces_right("stagiaire", "write")}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3105,7 +3107,7 @@ const Partner = (props) => {
<DisplayPartnerStagiaires conntected_employee_id={conntected_employee_id} object_key={orderid} subdata={packs}
read_access={check_user_acces_right("stagiaire", "read")} write_access={check_user_acces_right("stagiaire", "write")}
formation_initiale={formation_initiale} check_user_acces_right={check_user_acces_right}/>
formation_initiale={formation_initiale} check_user_acces_right={check_user_acces_right} />
</div>
}
@ -3125,7 +3127,7 @@ const Partner = (props) => {
<Partner_Client conntected_employee_id={conntected_employee_id} object_key={orderid}
read_access={check_user_acces_right("client", "read")} write_access={check_user_acces_right("client", "write")}
check_user_acces_right={check_user_acces_right}/>
check_user_acces_right={check_user_acces_right} />
</div>
}

View File

@ -37,7 +37,7 @@ import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import Module_Historique_Action from "./Module_Historique_Action";
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { Global } from "recharts";
import { FcAddDatabase } from "react-icons/fc";
@ -156,8 +156,8 @@ const Partner_Commande = (props) => {
}
const columns = [
{ field: '_id', headerName: '_id', hide: true , disableExport: true,},
{ field: 'id', headerName: 'id', hide: true , disableExport: true,},
{ field: '_id', headerName: '_id', hide: true, disableExport: true, },
{ field: 'id', headerName: 'id', hide: true, disableExport: true, },
{ field: 'order_header_ref_interne', headerName: 'Reference', maxWidth: 200, minWidth: 180, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_type', headerName: 'Type', width: 100, hide: false, editable: false },
{
@ -197,9 +197,9 @@ const Partner_Commande = (props) => {
},
{ field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false , disableExport: true,},
{ field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false, disableExport: true, },
{ field: 'order_header_client_nom', headerName: 'Nom Client', minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_vendeur_id', headerName: 'Vendeur Id', width: 0, hide: true, editable: false , disableExport: true,},
{ field: 'order_header_vendeur_id', headerName: 'Vendeur Id', width: 0, hide: true, editable: false, disableExport: true, },
{ field: 'order_header_vendeur_nom_prenom', headerName: 'Vendeur', width: 150, flex: 1, editable: false, flex: 1 },
{ field: 'order_header_date_cmd', headerName: 'Date', minWidth: 150, hide: false, editable: false, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_date_expiration', headerName: 'Date Expiration', minWidth: 150, hide: false, editable: false },
@ -988,9 +988,12 @@ const Partner_Commande = (props) => {
}
const [history_securite_read, sethistory_securite_read] = useState("");
useEffect(() => {
sethistory_securite_read(props.check_user_acces_right("historique", "read"))
Get_List_Partner_Clients();
Getall_Training_Employee_No_Filter();
GetCurrentPartnerClass();
@ -1000,7 +1003,7 @@ const Partner_Commande = (props) => {
Getall_Partner_Digital_Sign_Status();
Getall_Partner_Product_Service();
console.log(" ~### mes facture props action, orderid = ", action, orderid);
if (orderid && String(orderid).length > 3) {
/*
@ -3410,6 +3413,8 @@ const Partner_Commande = (props) => {
}
}
async function order_header_submenu_facturation() {
setheader_submenu("facturation");
submenu_color_management("order_header_facturation");
@ -3464,8 +3469,23 @@ const Partner_Commande = (props) => {
}
}
async function order_header_submenu_historique() {
/* setheader_submenu("historique");
submenu_color_management("historique");
await sleep(5);
if (String(order_data_edit_mode) !== "1") {
disable_Order_Header_DetailFields();
}*/
setDialog_order_history_open(true)
}
function submenu_color_management(current_menu) {
const list_sous_menu = ["order_header_facturation", "order_header_detail", "order_header_main", "order_header_relance",]
const list_sous_menu = ["order_header_facturation", "order_header_detail", "order_header_main",
"order_header_relance", "historique"]
for (let i = 0; i < list_sous_menu.length; i++) {
@ -4609,7 +4629,6 @@ const Partner_Commande = (props) => {
function CustomToolbar(props) {
console.log(" my props = ", props);
return (
<GridToolbarContainer {...props}>
@ -4674,9 +4693,9 @@ const Partner_Commande = (props) => {
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
local_config.columnNames = local_config.columnNames.filter(function( element ) {
local_config.columnNames = local_config.columnNames.filter(function (element) {
return element !== undefined;
});
});
const rows = data.map((row) => {
@ -4714,6 +4733,29 @@ const Partner_Commande = (props) => {
}
// FIN EXPORT EXCEL DATAGRID
const [Dialog_order_history_message, setDialog_order_history_message] = React.useState(false);
const [Dialog_order_history_open, setDialog_order_history_open] = React.useState(false);
function Dialog_order_history_handle_change_participant_session(message) {
setDialog_order_history_message(message);
setDialog_order_history_open(true);
}
const Dialog_order_history_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_order_history_handleClose_buton = () => {
setDialog_order_history_open(false);
if (document.getElementsByName("order_history_bton") && document.getElementsByName("order_history_bton")[0]) {
document.getElementsByName("order_history_bton")[0].style.backgroundColor = "#d8edfc";
document.getElementsByName("order_history_bton")[0].style.color = "#3b3e40";
}
};
return (
<div className="partner_commande">
@ -4722,6 +4764,55 @@ const Partner_Commande = (props) => {
</div>}
{/* Dialog affichage historique commande/devis */}
<Dialog
open={Dialog_order_history_open}
// onClose={Dialog_order_history_handleClose}
className="displaypartnersession"
static
onClose={() => null} >
<DialogTitle>MySy Information</DialogTitle>
<DialogContent className="DialogContent_width_700px" style={{ "minHeight": "20rem", width:'60rem' }}>
<div>
<div>
<div className="div_row" style={{ "border": "None", "background": '#F8F9F9', "padding": '5px' }}>
<Module_Historique_Action related_collection="partner_order_header"
related_collection_recid={selected_id}
read_access={"1"}
write_access={"1"} />
</div>
</div>
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
&nbsp;
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_order_history_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
{/* FIN Dialog affichage historique commande/devis */}
{/****** Dialog pour créer une session depuis un devis */}
<Dialog
@ -5188,7 +5279,7 @@ const Partner_Commande = (props) => {
{(!selected_order_line_id || String(selected_order_line_id).length < 3) &&
<div className="session_caract_Dialog" > Type Article
<div className="session_caract_Dialog" > <b>Type Article</b>
<Autocomplete
disablePortal
@ -5226,7 +5317,7 @@ const Partner_Commande = (props) => {
<div>
{New_GetCurrentPartnerClass_result && New_GetCurrentPartnerClass_result.length > 0 &&
(p_add_line_item || String(p_add_line_item) === "") && String(p_detail_header_statut_label).toLowerCase() !== "facturé" &&
<div className="session_caract_Dialog" > Formation
<div className="session_caract_Dialog" > <b> Formation </b>
<Autocomplete
disablePortal
name="ref_article"
@ -5301,7 +5392,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > Article
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > <b>Article </b>
<TextField
autoFocus
@ -5318,7 +5409,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > Quantité
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > <b>Quantité </b>
<TextField
@ -5337,7 +5428,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > Quantité
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > <b> Quantité </b>
<TextField
required
@ -5360,7 +5451,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > Prix Unitaire
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > <b> Prix Unitaire </b>
<TextField
required
margin="dense"
@ -5382,7 +5473,7 @@ const Partner_Commande = (props) => {
/>
</div>}
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > Prix Unitaire
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > <b> Prix Unitaire </b>
<TextField
margin="dense"
@ -5507,7 +5598,7 @@ const Partner_Commande = (props) => {
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > Article
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > <b>Article </b>
<TextField
autoFocus
@ -5524,7 +5615,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > Quantité
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" ><b> Quantité </b>
<TextField
@ -5543,7 +5634,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > Quantité
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > <b>Quantité </b>
<TextField
required
@ -5566,7 +5657,7 @@ const Partner_Commande = (props) => {
</div>}
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > Prix Unitaire
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > <b>Prix Unitaire </b>
<TextField
required
margin="dense"
@ -5588,7 +5679,7 @@ const Partner_Commande = (props) => {
/>
</div>}
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > Prix Unitaire
{String(p_detail_header_statut_label).toLowerCase() === "facturé" && <div className="session_caract_Dialog" > <b>Prix Unitaire </b>
<TextField
margin="dense"
@ -5844,7 +5935,7 @@ const Partner_Commande = (props) => {
<DialogTitle>{Dialog_1_message}</DialogTitle>
<DialogContent>
<div className="session_caract_Dialog" > Client
<div className="session_caract_Dialog" > <b>Client </b>
<Autocomplete
disablePortal
id="ref_client"
@ -6524,9 +6615,9 @@ const Partner_Commande = (props) => {
rowsPerPageOptions={[10]}
//disableSelectionOnClick
/* components={{
Toolbar: GridToolbar,
}}*/
/* components={{
Toolbar: GridToolbar,
}}*/
//sx={datagridSx}
getCellClassName={(params) => {
@ -6625,6 +6716,8 @@ const Partner_Commande = (props) => {
{selected_order_header_type && String(selected_order_header_type) !== "devis" && <Button variant="outlined" onClick={order_header_submenu_facturation} className="detail_class_submenu" id='order_header_facturation' name='order_header_facturation'>Menu Facturation </Button>}
{selected_order_header_type && String(selected_order_header_type) === "devis" && <Button variant="outlined" onClick={order_header_submenu_relance} className="detail_class_submenu" id='order_header_relance' name='order_header_relance'> Relance auto. </Button>}
{String(history_securite_read) === "1" && <Button variant="outlined" onClick={order_header_submenu_historique} className="detail_class_submenu" id='historique' name='historique'>Historique </Button>}
</div>
<div style={{ "width": "100%", "float": "left" }}>
@ -7747,6 +7840,15 @@ const Partner_Commande = (props) => {
</div>}
{String(header_submenu) === "historique" && <div style={{ "border": "None", "background": '#F8F9F9', "padding": '5px' }}>
<Module_Historique_Action related_collection="partner_order_header"
related_collection_recid={selected_id}
read_access={props.read_access}
write_access={props.write_access} />
</div>}
</div>
<div style={{ "width": "23%", "float": "left", "textAlign": "right", "paddingTop": "2rem" }}>

View File

@ -2495,7 +2495,6 @@ const Partner_Facture = (props) => {
function CustomToolbar(props) {
// console.log(" my props = ", props);
return (
<GridToolbarContainer {...props}>

View File

@ -2686,6 +2686,9 @@
}
.DialogContent_width_700px{
width: 700px !important;
}
// end media

View File

@ -107,7 +107,7 @@
border: 1px solid #9cf;
color: #3b3e40;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
font-size: small;
font-size: 11px;
letter-spacing: 0.1rem;
font-weight: normal;
width: 100%;
@ -689,7 +689,7 @@
border: 1px solid #9cf;
color: #3b3e40;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
font-size: small;
font-size: 11px;
letter-spacing: 0.1rem;
font-weight: normal;
height: 2rem !important;
@ -1310,7 +1310,7 @@
border: 1px solid #9cf;
color: #3b3e40;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
font-size: small;
font-size: 11px;
letter-spacing: 0.1rem;
font-weight: normal;
height: 2rem !important;
@ -1810,7 +1810,7 @@
border: 1px solid #9cf;
color: #3b3e40;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
font-size: small;
font-size: 11px;
letter-spacing: 0.1rem;
font-weight: normal;
height: 2rem !important;