function getCMSFields() { $fields = parent::getCMSFields(); $HSEAScore = GroupedList::create(Score::get()->sort('ClassName')); $fields->addFieldToTab("Root.Main", new OptionSetField('Status', 'Status', singleton('Project')->dbObject('Status')->enumValues())); $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Check List', $HSEAScore)); $impact = GroupedList::create(Impact::get()->sort('Title')); $fields->addFieldToTab("Root.Main", new CheckboxsetField('Impacts', 'Impact', $impact)); //$FinScore= DataObject::get('Score' ,"ClassName = 'Financial'"); // $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Financial', $FinScore)); // $ServScore= DataObject::get('Score', "ClassName = 'Service'"); // $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Service', $ServScore)); /*$gridFieldConfig = GridFieldConfig::create()->addComponents( new GridFieldToolbarHeader(), new GridFieldAddNewButton('toolbar-header-right'), new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(15), new GridFieldEditButton(), new GridFieldDeleteAction(), new GridFieldDetailForm() ); $gridfield = new GridField("Tasks", "Tasks", $this->Tasks(), $gridFieldConfig); $fields->addFieldToTab('Root.Tasks', $gridfield);*/ $fields->addFieldToTab("Root.Main", $dateField = new DateField("DueDate", "Date Due")); $dateField->setConfig('showcalendar', true); $dateField->setConfig('dateformat', 'dd/MM/YYYY'); return $fields; }
for ($i = 0; $i < count($STATGEOL); $i++) { if (isset($_POST['stat_zonegeo_' . $i])) { $listeCheck .= $i . ','; } } $stat = new Stat(); $stat->SetParam(NULL, $idIncident, $_POST['refchangement'], $_POST['stat_publicationIR'], $_POST['stat_publicationPM'], $_POST['stat_typecause'], $_POST['stat_typecause_second'], $_POST['stat_typologiegts'], $_POST['stat_equipeResp'], $_POST['fournisseurResp'], $_POST['statPowerprod'], $_POST['statLegacy'], $_POST['stat_Composant'], $_POST['Composant_complement'], $listeCheck); $idStat = $stat->Creer(); $_SESSION['flash']['success'] = "Le stat est Bien Ajouté !"; header('Location:modifStat.php?idStat=' . $idStat . '&idIncident=' . $idIncident); } } $incident = new incidents(); $incident->_setUser($userConnected); $incident->chargerIncident($idIncident); $impacte = new Impact(); $impacte->chargerFirstIncident($idIncident); $application = new Application(); $application->SelectAppliById($impacte->getApplicationId()); require_once '../inc/header.inc.php'; ?> <h1>Statistique</h1> <form action="" method="POST"> <div class="bloc"> <?php $link = "Stat"; require_once '../inc/search.inc.php'; ?> <div class="width100 input-group-addon"> <span class="fl-left" style=" line-height:2.5;">Edition de l'incident N° <strong> <?php echo $incident->getIncident();
header('Location:modif.php?id=' . $res[0][0] . '&NumeroIncidentF=' . $_GET['NumeroIncident']); die; } else { $_SESSION['flash']['danger'] = "Le numéro de l'incident <b>" . $idSearch . "</b> n'est pas dans la base!"; header('Location:index.php'); die; } } if (!$numero) { $_SESSION['flash']['danger'] = "Le numéro de l'incident est vide!"; header('Location:index.php'); die; } // Creation de l'objet incident $incident = new incidents(); $impacte = new Impact(); $calendrier = new Calendrier(); $appli = new Application(); //Récupération de contenu du fichier Json $contenu_fichier_json = file_get_contents('../inc/TraceFiche.json'); $tr = json_decode($contenu_fichier_json, true); if (!empty($_POST)) { $errors = array(); $_POST['Incident_risqueAggravation'] = isset($_POST['Incident_risqueAggravation']) ? 1 : 0; $_POST['Incident_dejaApparu'] = isset($_POST['Incident_dejaApparu']) ? 1 : 0; $_POST['Incident_previsible'] = isset($_POST['Incident_previsible']) ? 1 : 0; /* Contrôle des champs obligatoire */ if (empty($_POST['debutincident'])) { $errors['debutincident'] = "Vous devez remplir le champ date début incident!";
} if (!isInteger($_POST['Incident_Impact_jourhommeperdu']) && !empty($_POST['Incident_Impact_jourhommeperdu'])) { $errors['Incident_Impact_jourhommeperdu'] = "Le champ jours homme perdu doit etre numérique !"; } if (empty($_POST['Incident_Impact_datedebut'])) { $errors['Incident_Impact_datedebut'] = "Vous devez remplir le champ début impact!"; } if (!$_POST['Incident_Impact_impactmetier']) { $errors['Incident_Impact_impactmetier'] = "L'Impact métier n'est pas valide!"; } if (empty($_POST['Incident_Impact_description'])) { $errors['Incident_Impact_description'] = "Vous devez remplir le champ Description de l'impact!"; } if (empty($errors)) { // Impacte $impacte = new Impact(); $impacte->setParam($IdImpact, $_POST['IdIncident'], $_POST['IdAppli'], $_POST['Incident_Impact_datedebut'], $_POST['Incident_Impact_datefin'], $_POST['Incident_Impact_dureereelle'], $_POST['Incident_Impact_jourhommeperdu'], $_POST['Incident_Impact_impactmetier'], $_POST['Incident_Impact_impact'], $_POST['Incident_Impact_sla'], $_POST['Incident_Impact_criticite'], $_POST['Incident_Impact_description']); $impacte->modifier(); $_SESSION['flash']['success'] = " L'incident est bien modifié." . $impacte->getIncidentId(); header('Location:ListeImpact.php?idIncident=' . $impacte->getIncidentId()); } } else { $idAppli = $impacte->getApplicationId(); $appli->SelectAppliById($idAppli); if ($impacte->getApplicationId()) { $idAppli = $impacte->getApplicationId(); $calendrier->selectById($idAppli); //debug($calendrier); } } require_once '../inc/header.inc.php';
?> ')" >Comm à chaud</a> <a class="btn btn-danger <?php echo isset($link) && $link == "Supprimer" ? "active focus" : ""; ?> " href="javascript:supprimerIncident('index.php?id=<?php echo $numero; ?> &supprimer')" >Supprimer l'incident</a> <div id="element_to_pop"> <a class="b-close">x</a> <h2>Liste des adresses mail en Cci</h2> <?php $listeBcciBase = $incident->chargerBcci(); $impact = new Impact(); $impact->chargerFirstIncident($numero); $applic = new Application(); $applic->SelectAppliById($impact->getApplicationId()); $listeEnseigne = $applic->getEnseigne(); $ListeFinale = $listeBcciBase != '' ? $listeBcciBase : $listeEnseigne; foreach ($DESTINATAIREBCC as $key => $value) { $selected = strpos($ListeFinale, $key) !== false ? 'checked' : ''; // echo $key.'---'.var_dump(strpos($ListeFinale,$key.',')); ?> <input type="checkbox" id="CCi_<?php echo $key; ?> " <?php echo $selected; ?>
function editProjectForm() { $project = $this->getProject(); $score = Score::get()->map('ID', 'Title'); $impact = Impact::get()->map('ID', 'Title'); $requester = Member::get()->map('ID', 'Title'); DateField::set_default_config('showcalendar', true); DateField::set_default_config('dateformat', 'dd/MM/YYYY'); $fields = new FieldList(new HiddenField('ID', 'aID'), new LiteralField("LiteralField", "<div class='addForm'>"), new LiteralField("LiteralField", "<div class='formleft'>"), new TextField('Title'), new TextField('ShortDescription', 'One Liner'), new DateField('DueDate', 'Due Date'), new DropDownField('RequesterID', 'Requested By', $requester), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='formright'>"), new TextAreaField('Description', 'Description'), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='formleft'>"), new LiteralField("LiteralField", "<div class='checkboxes'>"), new CheckboxSetField('Scores', 'Check Boxes', $score), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='checkboxes'>"), new CheckboxSetField('Impacts', 'Impacts', $impact), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>")); $actions = new FieldList(new LiteralField("LiteralField", "<div class='addForm'>"), new LiteralField("LiteralField", "<div class='formright'>"), new FormAction("dosave", "Save"), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>")); $form = new Form($this, 'editProjectForm', $fields, $actions); $Params = $this->getURLParams(); if (is_numeric($Params['ID']) && ($editproj = DataObject::get_by_id('Project', $Params['ID']))) { $form->loadDataFrom($editproj->data()); } return $form; }
$value = $resultats[$i]; $appli = new Application(); $appli->SelectAppliById($value[2]); $ligne = '<tr><td>' . $value[3] . '</td>'; $ligne .= '<td>' . $value[4] . '</td>'; $ligne .= '<td>' . $appli->getName() . '</td>'; $ligne .= '<td>' . $value[11] . '</td><td>'; $ligne .= $value[8] != '' ? $INCIDENTIMPACTMETIER[$value[8]] : ''; $ligne .= '</td><td><a class="btn btn-success" href="modifImpact.php?IdImpact=' . $value[0] . '">Modifier</a></td>'; $ligne .= '<td>'; if ($supprimer) { $ligne .= '<a class="btn btn-danger" href="modifImpact.php?IdIncident=' . $_GET['idIncident'] . '&action=supprimer&IdImpact=' . $value[0] . '">Supprimer</a>'; } $ligne .= '</td></tr>'; echo $ligne; } ?> </tbody> </table> <br /> <br /> </div> <?php $impacte = new Impact(); $impacte->chargerFirstIncident($numero); $application = new Application(); $application->SelectAppliById($resultats[0][2]); $idIncident = $numero; require_once '../inc/commachaud.inc.php'; require_once '../inc/footer.inc.php';
header('Content-Disposition: attachment; filename=' . basename('commachaud.vbs')); $numero = isset($_GET['idIncident']) ? $_GET['idIncident'] : ''; if (!$numero) { $_SESSION['flash']['erreur'] = "Pas de numéro d'incident passé !"; header('Location:index.php'); die; } require_once '../inc/config.inc.php'; require_once '../inc/fonctions.inc.php'; require_once '../classes/db.php'; require_once '../classes/Impact.php'; require_once '../classes/incidents.php'; require_once '../classes/Application.php'; $incident = new incidents(); $impacte = new Impact(); $incident->chargerIncident($numero); $resultats = $impacte->chargerIncident($numero); $LDescription = ""; $LApplication = ""; for ($i = 0; $i < count($resultats); $i++) { $value = $resultats[$i]; $application = new Application(); $application->SelectAppliById($value[2]); $LDescription .= $value[11] . ', '; $LApplication .= $i == 0 ? '<b>' . $application->getName() . '</b>,' : $application->getName(); } $listeBcci = $incident->chargerBcci(); $BccFinal = ''; foreach ($DESTINATAIREBCC as $key => $value) { $BccFinal .= strpos($listeBcci, $key . ',') !== false ? $value . ';' : '';