function referentiel_affiche_certificat_consolide($separateur1, $separateur2, $liste_code, $ref_referentiel, $bgcolor, $params = NULL) { // cet affichage du certificat fournit des pourcentages par domaine et competence echo referentiel_retourne_certificat_consolide($separateur1, $separateur2, $liste_code, $ref_referentiel, $bgcolor, $params); }
/** * Turns referentiel instance into an html segment * @param referentiel instanceobject * @return string xml segment */ function write_certificat($record) { global $CFG; // initial string; $expout = ""; // add comment and div tags if ($record) { // DEBUG // echo "<br />DEBUG LIGNE 1021<br />\n"; // print_r($referentiel_instance); $id = trim($record->id); if (isset($record->synthese_certificat)) { $synthese_certificat = trim($record->synthese_certificat); } else { $synthese_certificat = ''; } $commentaire_certificat = trim($record->commentaire_certificat); $synthese_certificat = trim($record->synthese_certificat); $competences_certificat = trim($record->competences_certificat); $decision_jury = trim($record->decision_jury); $date_decision = userdate(trim($record->date_decision)); $userid = trim($record->userid); $teacherid = trim($record->teacherid); $ref_referentiel = trim($record->ref_referentiel); $verrou = trim($record->verrou); $valide = trim($record->valide); $evaluation = trim($record->evaluation); $synthese_certificat = trim($record->synthese_certificat); // empreintes //$liste_empreintes=referentiel_purge_dernier_separateur(referentiel_get_liste_empreintes_competence($this->rreferentiel), '/'); // USER if (isset($userid) && $userid > 0) { $record_etudiant = referentiel_get_etudiant_user($userid); if (!$record_etudiant) { // creer l'enregistrement car on en a besoin immediatement if (referentiel_add_etudiant_user($userid)) { $record_etudiant = referentiel_get_etudiant_user($userid); } } if ($record_etudiant) { $expout .= $this->write_etudiant($record_etudiant); } if ($this->export_pedagos) { $expout .= $this->write_pedagogie($record->userid); } $expout .= "<table class=\"certificat\">\n"; $expout .= "<tr valign=\"top\">\n\n<th class=\"certificat\">" . get_string('commentaire_certificat', 'referentiel') . "</th>\n<th class=\"certificat\">" . get_string('synthese_certificat', 'referentiel') . "</th>\n"; if ($this->format_condense != 1) { $expout .= "<th class=\"certificat\">" . get_string('competences_certificat', 'referentiel') . "</th>\n"; } $expout .= "<th class=\"certificat\">" . get_string('decision_jury', 'referentiel') . "</th>\n<th class=\"certificat\">" . get_string('date_decision', 'referentiel') . "</th>\n<th class=\"certificat\">" . get_string('verrou', 'referentiel') . "</th>\n<th class=\"certificat\">" . get_string('evaluation', 'referentiel') . "</th>\n</tr>\n"; $expout .= "<tr valign=\"top\">\n\n<td class=\"certificat\"> {$commentaire_certificat}</td>\n<td class=\"certificat\"> {$synthese_certificat}</td>\n"; if ($this->format_condense != 1) { $expout .= "<td class=\"certificat\">" . $this->certificat_items_valides($competences_certificat, $this->rreferentiel->id) . "</td>\n"; } $expout .= "<td class=\"certificat\"> {$decision_jury}</td>\n<td class=\"certificat\"> {$date_decision}</td>\n<td class=\"certificat\"> {$verrou}</td>\n<td class=\"certificat\"> {$evaluation}</td>\n</tr>\n"; if ($this->format_condense == 1) { // couleur de fond pour le certificat if (isset($verrou) && $verrou != "") { if ($verrou != 0) { $bgcolor = 'verrouille'; } else { $bgcolor = 'deverrouille'; } } else { $bgcolor = 'deverrouille'; } $expout .= "<tr><th class=\"certificat\" colspan=\"6\">" . get_string('competences_certificat', 'referentiel') . "</th></tr>\n"; $expout .= "<tr><td class=\"certificat\" colspan=\"6\">\n"; $expout .= referentiel_retourne_certificat_consolide('/', ':', $competences_certificat, $this->rreferentiel->id, ' class="' . $bgcolor . '"'); $expout .= "</td></tr>\n"; } $expout .= "</table>\n"; } } return $expout; }
/** * Turns referentiel instance into an xml segment * @param referentiel instanceobject * @return string xml segment */ function write_certificat($record) { global $CFG; // initial string; $s1 = ''; $s2 = ''; $nbchamps = 0; $expout = ""; // add comment and div tags if ($record) { // DEBUG // echo "<br />DEBUG LIGNE 1021<br />\n"; // print_r($referentiel_instance); $id = trim($record->id); $commentaire_certificat = trim($record->commentaire_certificat); $synthese_certificat = trim($record->synthese_certificat); $competences_certificat = trim($record->competences_certificat); $competences_activite = trim($record->competences_activite); $decision_jury = trim($record->decision_jury); if ($record->date_decision) { $date_decision = userdate(trim($record->date_decision)); } else { $date_decision = ""; } $userid = trim($record->userid); $teacherid = trim($record->teacherid); if ($teacherid != 0) { $nom_prenom_teacher = referentiel_get_user_info($teacherid); } else { $nom_prenom_teacher = ""; } $ref_referentiel = trim($record->ref_referentiel); $verrou = trim($record->verrou); $valide = trim($record->valide); $evaluation = trim($record->evaluation); $pourcentages = ''; // calcul des pourcentages if ($this->certificat_sel_param->certificat_sel_certificat_pourcent) { if (isset($verrou) && $verrou != "") { if ($verrou != 0) { $bgcolor = 'verrouille'; } else { $bgcolor = 'deverrouille'; } } else { $bgcolor = 'deverrouille'; } // Tableau $pourcentages = referentiel_retourne_certificat_consolide('/', ':', $competences_certificat, $ref_referentiel, ' class="' . $bgcolor . '"'); } // USER if (isset($record->userid) && $record->userid > 0) { $record_etudiant = referentiel_get_etudiant_user($record->userid); if (!$record_etudiant) { // creer l'enregistrement car on en a besoin immediatement if (referentiel_add_etudiant_user($record->userid)) { $record_etudiant = referentiel_get_etudiant_user($record->userid); } } if ($record_etudiant) { $s2 = ''; if ($this->certificat_sel_param->certificat_sel_decision_jury) { $s2 .= "<th class='referentiel'>" . get_string('decision', 'referentiel') . "</th>\n"; $s2 .= "<th class='referentiel'>" . get_string('datedecision', 'referentiel') . "</th>\n"; $nbchamps += 2; } if ($this->certificat_sel_param->certificat_sel_certificat_referents) { $s2 .= "<th class='referentiel'>" . get_string('valide_par', 'referentiel') . "</th>\n"; $nbchamps++; } if ($this->certificat_sel_param->certificat_sel_certificat_detail) { $s2 .= "<th class='referentiel'>" . get_string('verrou', 'referentiel') . "</th>\n"; $s2 .= "<th class='referentiel'>" . get_string('evaluation', 'referentiel') . "</th>\n"; $nbchamps += 2; } if ($this->certificat_sel_param->certificat_sel_commentaire) { $s2 .= "<th class='referentiel'>" . get_string('commentaire', 'referentiel') . "</th>\n"; $s2 .= "<th class='referentiel'>" . get_string('synthese', 'referentiel') . "</th>\n"; $nbchamps += 2; } if ($this->certificat_sel_param->certificat_sel_activite_competences) { $s2 .= "<th class='referentiel'>" . get_string('competences_declare', 'referentiel') . "</th>\n"; $nbchamps++; } if ($this->certificat_sel_param->certificat_sel_certificat_competences) { $s2 .= "<th class='referentiel'>" . get_string('competences_certificat', 'referentiel') . "</th>\n"; $nbchamps++; } $s1 .= "<!-- certification : {$record->id} -->\n"; $s1 .= "<table class='referentiel'>\n"; $s1 .= $this->write_etudiant($record_etudiant, $nbchamps); $s1 .= "<tr class='referentiel'><td class='referentiel' colspan='" . $nbchamps . "'><b>" . get_string('certificat', 'referentiel') . "</b></td></tr>\n"; $s1 .= "<tr class='referentiel'>\n</tr>\n"; $s1 .= $s2; $s1 .= "</tr>\n"; $s2 = ''; if ($this->certificat_sel_param->certificat_sel_decision_jury) { $s2 .= "<td class='referentiel'>{$decision_jury}</td>\n"; if ($date_decision != "") { $s2 .= "<td class='referentiel'>{$date_decision}</td>\n"; } else { $s2 .= "<td class='referentiel'> </td>\n"; } } if ($this->certificat_sel_param->certificat_sel_certificat_referents) { $s2 .= "<td class='referentiel'>" . $nom_prenom_teacher . "</td>\n"; } if ($this->certificat_sel_param->certificat_sel_certificat_detail) { $s2 .= "<td class='referentiel'>{$verrou}</td>\n"; $s2 .= "<td class='referentiel'>{$evaluation}</td>\n"; } if ($this->certificat_sel_param->certificat_sel_commentaire) { $s2 .= "<td class='referentiel'>{$commentaire_certificat} </td>\n"; $s2 .= "<td class='referentiel'>{$synthese_certificat} </td>\n"; } if ($this->certificat_sel_param->certificat_sel_activite_competences) { $s2 .= "<td class='referentiel'>" . referentiel_affiche_competences_certificat('/', ':', $competences_activite, $this->liste_empreintes_competence) . "</td>\n"; } if ($this->certificat_sel_param->certificat_sel_certificat_competences) { $s2 .= "<td class='referentiel'>" . referentiel_affiche_competences_certificat('/', ':', $competences_certificat, $this->liste_empreintes_competence, false) . "</td>\n"; } if ($this->certificat_sel_param->certificat_sel_certificat_competences && $this->certificat_sel_param->certificat_sel_certificat_detail) { $s2 .= "</tr>\n<tr class='referentiel'>\n<th class='referentiel' colspan='" . $nbchamps . "'>\n" . get_string('certificat_sel_certificat_detail', 'referentiel') . "</th></tr>\n"; $s2 .= "<tr class='referentiel'>\n<td class='referentiel' colspan='" . $nbchamps . "'>\n<table class='referentiel'>\n"; $s2 .= '<tr valign="top"><th>' . get_string('code', 'referentiel') . '</th><th>' . get_string('approved', 'referentiel') . '</th><th colspan="3">' . get_string('description_item', 'referentiel') . '</th><th>' . get_string('p_item', 'referentiel') . '</th><th>' . get_string('e_item', 'referentiel') . '</th></tr>' . "\n"; $s2 .= referentiel_affiche_detail_competences('/', ':', $competences_certificat, $this->liste_empreintes_competence, $this->liste_poids_competence) . "</table>\n</td>\n"; } if ($this->certificat_sel_param->certificat_sel_certificat_pourcent) { $s2 .= "</tr>\n<tr class='referentiel'>\n<th class='referentiel' colspan='" . $nbchamps . "'>\n" . get_string('pourcentage', 'referentiel') . "</th></tr>\n"; $s2 .= "<tr class='referentiel'>\n<td class='referentiel' colspan='" . $nbchamps . "'>" . $pourcentages . "</td>\n"; } $s1 .= "<tr class='referentiel'>\n"; $s1 .= $s2; $s1 .= "</tr>\n"; $s1 .= "</table>\n\n"; $expout .= $s1; } } } return $expout; }