Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * Turns referentiel instance into an xml segment
  * @param referentiel instanceobject
  * @return string xml segment
  */
 function write_liste_etudiants()
 {
     global $CFG;
     // initial string;
     $expout = "";
     if ($this->ireferentiel) {
         // ETUDIANTS
         if (isset($this->ireferentiel->course) && $this->ireferentiel->course > 0) {
             // ETUDIANTS
             $records_all_students = referentiel_get_students_course($this->ireferentiel->course);
             if ($records_all_students) {
                 foreach ($records_all_students as $record) {
                     // USER
                     if (isset($record->userid) && $record->userid > 0) {
                         $record_etudiant = referentiel_get_etudiant_user($record->userid);
                         if ($record_etudiant) {
                             $expout .= $this->write_etudiant($record_etudiant);
                         }
                     }
                 }
             }
         }
     }
     return $expout;
 }
Ejemplo n.º 3
0
 /**
  * Turns referentiel instance into an xml segment
  * @param referentiel instanceobject
  * @return string xml segment
  */
 function write_liste_etudiants()
 {
     global $CFG;
     // initial string;
     $expout = "";
     $id = $this->ireferentiel->id;
     // add comment and div tags
     // $expout .= "<!-- etudiants :  $this->ireferentiel->id  name: $this->ireferentiel->name -->\n";
     // $expout .= "<div class=\"referentiel\">\n";
     // add header
     // $expout .= "<h2>$this->ireferentiel->name</h2>\n";
     //
     // $expout .= "<ul>\n";
     //
     if ($this->ireferentiel) {
         $id = $this->ireferentiel->id;
         $name = trim($this->ireferentiel->name);
         $description = trim($this->ireferentiel->description_instance);
         $label_domaine = trim($this->ireferentiel->label_domaine);
         $label_competence = trim($this->ireferentiel->label_competence);
         $label_item = trim($this->ireferentiel->label_item);
         $date_instance = $this->ireferentiel->date_instance;
         $course = $this->ireferentiel->course;
         $ref_referentiel = $this->ireferentiel->ref_referentiel;
         $visible = $this->ireferentiel->visible;
         /*
         			$expout .= " <li><b>".get_string('id','referentiel')."</b> : $id</li>\n";
         			$expout .= " <li><b>".get_string('name','referentiel')."</b> : $name</li>\n";
         			$expout .= " <li><b>".get_string('description','referentiel')."</b> : $description</li>\n";   
                     $expout .= " <li><b>".get_string('label_domaine','referentiel')."</b> : $label_domaine</li>\n";
                     $expout .= " <li><b>".get_string('label_competence','referentiel')."</b> : $label_competence</li>\n";
                     $expout .= " <li><b>".get_string('label_item','referentiel')."</b> : $label_item</li>\n";			
                     $expout .= " <li><b>".get_string('date_instance','referentiel')."</b> : ".date("Y-m-d H:i:s",$date_instance)."</li>\n";
                     $expout .= " <li><b>".get_string('course')."</b> : $course</li>\n";
                     $expout .= " <li><b>".get_string('ref_referentiel','referentiel')."</b> : $ref_referentiel</li>\n";
                     $expout .= " <li><b>".get_string('visible','referentiel')."</b> : $visible</li>\n";
         */
         // ETUDIANTS
         if (isset($this->ireferentiel->course) && $this->ireferentiel->course > 0) {
             // ETUDIANTS
             $records_all_students = referentiel_get_students_course($this->ireferentiel->course);
             if ($records_all_students) {
                 foreach ($records_all_students as $record) {
                     // 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) {
                             $expout .= $this->write_etudiant($record_etudiant);
                         }
                     }
                 }
             }
         }
     }
     /*
     	    $expout .= " </ul>\n";
     		$expout .= "</div>\n";
     */
     return $expout;
 }
Ejemplo n.º 4
0
function referentiel_etudiant_set_etablissement($userid, $etablissement_id)
{
    // mise a jour de l'etablisssement
    global $DB;
    if ($userid && $etablissement_id) {
        $record = referentiel_get_etudiant_user($userid);
        $record->lieu_naissance = $record->lieu_naissance;
        $record->departement_naissance = $record->departement_naissance;
        $record->adresse_etudiant = $record->adresse_etudiant;
        $record->ref_etablissement = $etablissement_id;
        if ($DB->update_record("referentiel_etudiant", $record)) {
            return true;
        }
    }
    return false;
}
Ejemplo n.º 5
0
/**
 * Turns referentiel instance into an xml segment
 * @param referentiel instanceobject
 * @return string xml segment
 */
function ooffice_write_certificat($record, $referentiel_instance, $referentiel_referentiel, $liste_empreintes, $liste_poids, $param)
{
    global $CFG;
    global $odt;
    // add comment and div tags
    if ($record) {
        // DEBUG
        // echo "DEBUG LIGNE 1021";
        // print_r($referentiel_instance);
        $id = trim($record->id);
        $commentaire_certificat = recode_utf8_vers_latin1(trim($record->commentaire_certificat));
        $synthese_certificat = recode_utf8_vers_latin1(trim($record->synthese_certificat));
        $competences_activite = recode_utf8_vers_latin1(trim($record->competences_activite));
        $competences_certificat = recode_utf8_vers_latin1(trim($record->competences_certificat));
        $decision_jury = recode_utf8_vers_latin1(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 = recode_utf8_vers_latin1(referentiel_get_user_info($teacherid));
        } else {
            $nom_prenom_teacher = "";
        }
        $ref_referentiel = trim($record->ref_referentiel);
        // $ref_referentiel=$referentiel_id;
        $verrou = trim($record->verrou);
        $valide = trim($record->valide);
        $evaluation = trim($record->evaluation);
        // USER
        if (isset($record->userid) && $record->userid > 0) {
            $record_etudiant = referentiel_get_etudiant_user($record->userid);
            if ($record_etudiant) {
                $odt->SetLeftMargin(15);
                ooffice_write_referentiel($referentiel_instance, $referentiel_referentiel, $param);
                ooffice_write_etudiant($record_etudiant, $param);
                $odt->SetFont('Arial', '', 12);
                if ($param->certificat_sel_decision_jury) {
                    if ($date_decision != "" && $decision_jury != "") {
                        $odt->Write(1, $decision_jury);
                    }
                    $odt->Ln(1);
                }
                // $odt->SetFont('Arial','B',10);
                // $odt->Write(1,"ID : ");
                // $odt->SetFont('Arial','',10);
                // $odt->Write(1,"$id");
                // $odt->Ln(1);
                $odt->SetFont('Arial', 'B', 12);
                $odt->Write(1, recode_utf8_vers_latin1(get_string('competences', 'referentiel')) . ": ");
                $odt->Ln(1);
                if ($param->certificat_sel_activite_competences) {
                    $odt->SetFont('Arial', 'B', 9);
                    $odt->Write(1, recode_utf8_vers_latin1(get_string('competences_activite', 'referentiel')) . ": ");
                    $odt->Ln(1);
                    ooffice_liste_competences_certificat($ref_referentiel, '/', ':', $competences_activite, $liste_empreintes, 0, 9, 8);
                    $odt->Ln(1);
                }
                if ($param->certificat_sel_certificat_competences) {
                    $odt->SetFont('Arial', 'B', 10);
                    $odt->Write(1, recode_utf8_vers_latin1(get_string('competences_certificat', 'referentiel')) . ": ");
                    $odt->Ln(1);
                    ooffice_liste_competences_certificat($ref_referentiel, '/', ':', $competences_certificat, $liste_empreintes, 0, 10, 9);
                    $odt->Ln(1);
                }
                if ($param->certificat_sel_certificat_competences && $param->certificat_sel_certificat_detail) {
                    ooffice_referentiel_affiche_detail_competences('/', ':', $competences_certificat, $liste_empreintes, $liste_poids);
                }
                if ($param->certificat_sel_certificat_pourcent) {
                    // $odt->SetFont('Arial','B',10);
                    // $odt->Write(1,recode_utf8_vers_latin1(get_string('pourcentage','referentiel'))." :");
                    // $odt->Ln(1);
                    ooffice_referentiel_affiche_certificat_consolide($ref_referentiel, '/', ':', $competences_certificat, 10, 9, 8);
                }
                if ($param->certificat_sel_commentaire) {
                    $odt->SetFont('Arial', 'B', 10);
                    $odt->Write(1, recode_utf8_vers_latin1(get_string('commentaire', 'referentiel')) . ": ");
                    $odt->SetFont('Arial', '', 10);
                    $odt->Write(1, "{$commentaire_certificat} ");
                    $odt->Ln(1);
                    $odt->SetFont('Arial', 'B', 10);
                    $odt->Write(1, recode_utf8_vers_latin1(get_string('synthese_certificat', 'referentiel')) . ": ");
                    $odt->SetFont('Arial', '', 10);
                    $odt->Write(1, "{$synthese_certificat} ");
                    $odt->Ln(1);
                }
                if ($param->certificat_sel_decision_jury) {
                    $odt->SetFont('Arial', 'B', 10);
                    $odt->Write(1, recode_utf8_vers_latin1(get_string('decision', 'referentiel')) . " : ");
                    $odt->SetFont('Arial', '', 10);
                    $odt->Write(1, "{$decision_jury}");
                    $odt->Ln(1);
                }
                if ($param->certificat_sel_certificat_referents) {
                    $odt->SetFont('Arial', 'B', 10);
                    $odt->Write(1, recode_utf8_vers_latin1(get_string('enseignant', 'referentiel')) . " : ");
                    $odt->SetFont('Arial', '', 10);
                    $odt->Write(1, $nom_prenom_teacher);
                    $odt->Ln(1);
                }
                /*
                $odt->Write(1," R�f�rentiel : $ref_referentiel");
                $odt->Ln(1);
                		            $odt->Write(1," Verrou : $verrou, Valide : $valide, Evaluation : $evaluation");
                $odt->Ln(1);
                */
                $odt->Ln(20);
                $odt->Writeparagraphe(1, get_string('date_signature', 'referentiel', date("d/m/Y")));
                $odt->AddPage();
            }
        }
    }
    return "";
}
Ejemplo n.º 6
0
 /**
  * Turns referentiel instance into an xml segment
  * @param referentiel instanceobject
  * @return string xml segment
  */
 function write_certificat($record)
 {
     global $CFG;
     // initial string;
     $s1 = '';
     $s2 = '';
     $s3 = '';
     $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';
             }
             // ligne des certificat
             $pourcentages = $this->affiche_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) {
                 // ligne de presentation des champs etudiant
                 $s3 = '';
                 $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes('#' . get_string('etudiant', 'referentiel'))))) . ";\n";
                 $s3 .= "#id;";
                 if ($this->certificat_sel_param->certificat_sel_etudiant_nom_prenom) {
                     $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('lastname'))) . ";" . $this->purge_sep(stripslashes(get_string('firstname'))))) . ";";
                 }
                 if ($this->certificat_sel_param->certificat_sel_etudiant_numero) {
                     $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('num_etudiant', 'referentiel'))))) . ";";
                 }
                 if ($this->certificat_sel_param->certificat_sel_etudiant_ddn) {
                     $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('ddn_etudiant', 'referentiel'))))) . ";";
                 }
                 if ($this->certificat_sel_param->certificat_sel_etudiant_lieu_naissance) {
                     $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('lieu_naissance', 'referentiel'))))) . ";";
                     $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('departement_naissance', 'referentiel'))))) . ";";
                 }
                 if ($this->certificat_sel_param->certificat_sel_etudiant_adresse) {
                     $s3 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('adresse_etudiant', 'referentiel'))))) . ";";
                 }
                 $s3 .= "\n";
                 $s1 .= $s3;
                 // fin ligne presentation
                 $s1 .= $this->write_etudiant($record_etudiant, $nbchamps);
                 $s1 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes('#' . get_string('certificat', 'referentiel'))))) . ";\n";
                 $s2 = '';
                 if ($this->certificat_sel_param->certificat_sel_decision_jury) {
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('decision', 'referentiel')))) . ";";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep(get_string('datedecision', 'referentiel')))) . ";";
                     $s2 .= "\n";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($decision_jury)))) . ";";
                     if ($date_decision != "") {
                         $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($date_decision)))) . ";";
                     } else {
                         $s2 .= ";";
                     }
                     $s2 .= "\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_certificat_referents) {
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('valide_par', 'referentiel')))) . ";";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($nom_prenom_teacher)))) . ";\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_certificat_detail) {
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('verrou', 'referentiel')))) . ";";
                     $s2 .= $verrou . ";";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep(get_string('evaluation', 'referentiel')))) . ";";
                     $s2 .= $evaluation . ";";
                     $s2 .= "\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_commentaire) {
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('commentaire', 'referentiel')))) . ";\n";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($commentaire_certificat)))) . ";\n";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('synthese_certificat', 'referentiel')))) . ";\n";
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep(stripslashes($synthese_certificat)))) . ";\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_activite_competences) {
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('competences_declare', 'referentiel')))) . ";\n";
                     $s2 .= $this->output_codage_caractere($this->affiche_competences_certificat('/', ':', $competences_activite, $this->liste_empreintes_competence, true)) . ";\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_certificat_competences) {
                     $s2 .= $this->output_codage_caractere(trim($this->purge_sep('#' . get_string('competences_certificat', 'referentiel')))) . ";\n";
                     $s2 .= $this->output_codage_caractere($this->affiche_competences_certificat('/', ':', $competences_certificat, $this->liste_empreintes_competence, true)) . ";\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_certificat_competences && $this->certificat_sel_param->certificat_sel_certificat_detail) {
                     $s2 .= "\n#" . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('certificat_sel_certificat_detail', 'referentiel'))))) . ";\n";
                     $s2 .= "#" . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('code', 'referentiel'))))) . ';' . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('approved', 'referentiel'))))) . ';' . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('description_item', 'referentiel'))))) . ';' . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('p_item', 'referentiel'))))) . ';' . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('e_item', 'referentiel'))))) . ';' . "\n";
                     $s2 .= $this->output_codage_caractere($this->affiche_detail_competences('/', ':', $competences_certificat, $this->liste_empreintes_competence, $this->liste_poids_competence)) . ";\n";
                 }
                 if ($this->certificat_sel_param->certificat_sel_certificat_pourcent) {
                     $s2 .= "\n#" . $this->output_codage_caractere(trim($this->purge_sep(stripslashes(get_string('pourcentage', 'referentiel'))))) . ";\n";
                     $s2 .= $pourcentages . ";\n";
                 }
                 $s1 .= $s2;
                 $s1 .= "\n\n";
                 $expout .= $s1;
             }
         }
     }
     return $expout;
 }
Ejemplo n.º 7
0
 /**
  * Turns referentiel instance into an xml segment
  * @param referentiel instanceobject
  * @return string xml segment
  */
 function write_certificat($record)
 {
     global $CFG;
     // initial string;
     $expout = "";
     // add comment
     // $expout .= "\n\n<!-- certificat : $record->id  -->\n";
     //
     if ($record) {
         // DEBUG
         // echo "<br />DEBUG LIGNE 1298<br />\n";
         // print_r($record);
         $id = $this->writeraw($record->id);
         $commentaire_certificat = $this->writetext(trim($record->commentaire_certificat));
         $competences_certificat = $this->writeraw(trim($record->competences_certificat));
         $competences_activite = $this->writeraw(trim($record->competences_activite));
         $decision_jury = $this->writeraw(trim($record->decision_jury));
         $date_decision = $this->writeraw(userdate(trim($record->date_decision)));
         $userid = $this->writeraw($record->userid);
         $teacherid = $this->writeraw($record->teacherid);
         $ref_referentiel = $this->writeraw($record->ref_referentiel);
         $verrou = $this->writeraw($record->verrou);
         $valide = $this->writeraw($record->valide);
         $evaluation = $this->writeraw($record->evaluation);
         $synthese_certificat = $this->writetext(trim($record->synthese_certificat));
         // DEBUG
         // echo "<br />DEBUG LIGNE 1314<br />\n";
         // echo htmlentities ($expout, ENT_QUOTES, 'UTF-8')  ;
         // 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) {
                 $expout .= $this->write_etudiant($record_etudiant);
                 if ($this->export_pedagos) {
                     $expout .= $this->write_pedagogie($record->userid);
                 }
                 $expout .= "<certificat>\n";
                 // la totale
                 if ($this->format_condense != 1) {
                     $expout .= "<competences_certificat>" . $this->certificat_items_binaire($competences_certificat, $this->rreferentiel->id) . "</competences_certificat>\n";
                 } else {
                     $expout .= "<competences_certificat>" . $this->certificat_pourcentage($competences_certificat, $this->rreferentiel->id) . "</competences_certificat>";
                 }
                 $expout .= "<competences_activite>{$competences_certificat}</competences_activite>\n";
                 $expout .= "<synthese>\n{$synthese_certificat}</synthese>\n";
                 $expout .= "<commentaire_certificat>\n{$commentaire_certificat}</commentaire_certificat>\n";
                 $expout .= "<decision_jury>{$decision_jury}</decision_jury>\n";
                 $expout .= "<date_decision>{$date_decision}</date_decision>\n";
                 $expout .= "<ref_referentiel>{$ref_referentiel}</ref_referentiel>\n";
                 $expout .= "<verrou>{$verrou}</verrou>\n";
                 $expout .= "<valide>{$valide}</valide>\n";
                 $expout .= "<evaluation>{$evaluation}</evaluation>\n";
                 $expout .= "</certificat>\n";
             }
         }
     }
     // DEBUG
     // echo "<br />DEBUG LIGNE 1330<br />\n";
     // echo htmlentities ($expout, ENT_QUOTES, 'UTF-8')  ;
     return $expout;
 }
Ejemplo n.º 8
0
 /**
  * Turns referentiel instance into an xml segment
  * @param referentiel instanceobject
  * @return string xml segment
  */
 function write_liste_etudiants()
 {
     global $CFG;
     // initial string;
     $expout = "";
     $id = $this->ireferentiel->id;
     // add comment and div tags
     //    	$expout .= "<!-- etudiants :  $this->ireferentiel->id  name: $this->ireferentiel->name -->\n";
     // add header
     $expout .= "<h2>" . get_string('etudiant', 'referentiel') . "</h2>\n";
     //
     $expout .= "<table class=\"referentiel\">\n";
     $expout .= "<tr>\n";
     //
     if ($this->ireferentiel) {
         $id = $this->ireferentiel->id;
         $name = trim($this->ireferentiel->name);
         $description = trim($this->ireferentiel->description_instance);
         $label_domaine = trim($this->ireferentiel->label_domaine);
         $label_competence = trim($this->ireferentiel->label_competence);
         $label_item = trim($this->ireferentiel->label_item);
         $date_instance = $this->ireferentiel->date_instance;
         $course = $this->ireferentiel->course;
         $ref_referentiel = $this->ireferentiel->ref_referentiel;
         $visible = $this->ireferentiel->visible;
         /*
                             $expout .= " <td><b>".get_string('id','referentiel')."</b></td><td> $id</td>\n";
                             $expout .= " <td><b>".get_string('name','referentiel')."</b></td><td> $name</td>\n";
                             $expout .= " <td><b>".get_string('description','referentiel')."</b></td><td> $description</td>\n";   
                             $expout .= " <td><b>".get_string('label_domaine','referentiel')."</b></td><td> $label_domaine</td>\n";
                             $expout .= " <td><b>".get_string('label_competence','referentiel')."</b></td><td> $label_competence</td>\n";
                             $expout .= " <td><b>".get_string('label_item','referentiel')."</b></td><td> $label_item</td>\n";                    
                             $expout .= " <td><b>".get_string('date_instance','referentiel')."</b></td><td>".date("Y-m-d H:i:s",$date_instance)."</td>\n";
                             $expout .= " <td><b>".get_string('course')."</b></td><td> $course</td>\n";
                             $expout .= " <td><b>".get_string('ref_referentiel','referentiel')."</b></td><td> $ref_referentiel</td>\n";
                             $expout .= " <td><b>".get_string('visible','referentiel')."</b></td><td> $visible</td>\n";
         */
         // ETUDIANTS
         if (isset($this->ireferentiel->course) && $this->ireferentiel->course > 0) {
             // ETUDIANTS
             $records_all_students = referentiel_get_students_course($this->ireferentiel->course);
             if ($records_all_students) {
                 $expout .= "<table class=\"referentiel\">\n";
                 // $expout .= "<h4>".get_string('etudiant','referentiel')."</h4>\n";
                 $expout .= "<tr>\n";
                 //
                 $expout .= "<th>" . get_string('id', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('userid', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('nom_prenom', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('num_etudiant', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('ddn_etudiant', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('lieu_naissance', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('departement_naissance', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('adresse_etudiant', 'referentiel') . "</th>\n";
                 $expout .= " <th>" . get_string('ref_etablissement', 'referentiel') . "</th>\n";
                 $expout .= " </tr>\n";
                 foreach ($records_all_students as $record) {
                     // 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) {
                             $expout .= $this->write_etudiant($record_etudiant);
                         }
                     }
                 }
                 $expout .= "</table>\n\n";
                 //
             }
         }
     }
     $expout .= " </tr>\n";
     $expout .= "</table>\n";
     return $expout;
 }
function referentiel_print_etudiant_2($userid, $referentiel_id, $context, $appli)
{
    //	fusion de referentiel_print_etudiant($record) et de referentiel_menu_etudiant($context, $record->id, $referentiel_instance->id, $record->approved);
    global $CFG;
    global $USER;
    global $OUTPUT;
    $s = "";
    if ($userid) {
        $record = referentiel_get_etudiant_user($userid);
        if ($record) {
            $s .= '<tr bgcolor="white">';
            $s .= '<td>' . referentiel_get_user_login($userid);
            $s .= '</td><td>' . referentiel_get_user_info($record->userid);
            $s .= '</td><td>';
            if ($record->num_etudiant == 'l_inconnu') {
                $s .= get_string('l_inconnu', 'referentiel');
            } else {
                $s .= stripslashes($record->num_etudiant);
            }
            $s .= '</td><td>';
            if ($record->ddn_etudiant == 'l_inconnu') {
                $s .= get_string('l_inconnu', 'referentiel');
            } else {
                $s .= stripslashes($record->ddn_etudiant);
            }
            $s .= '</td><td>';
            if ($record->lieu_naissance == 'l_inconnu') {
                $s .= get_string('l_inconnu', 'referentiel');
            } else {
                $s .= stripslashes($record->lieu_naissance);
            }
            $s .= '</td><td>';
            if ($record->departement_naissance == 'l_inconnu') {
                $s .= get_string('l_inconnu', 'referentiel');
            } else {
                $s .= stripslashes($record->departement_naissance);
            }
            $s .= '</td><td>';
            if ($record->adresse_etudiant == 'l_inconnu') {
                $s .= get_string('l_inconnu', 'referentiel');
            } else {
                $s .= stripslashes($record->adresse_etudiant);
            }
            $s .= '</td><td>';
            $s .= referentiel_select_etablissement($record->userid, $record->ref_etablissement, $appli);
            $s .= '</td><td>';
            // menu
            if (has_capability('mod/referentiel:managecertif', $context) or $USER->id == $record->userid) {
                $s .= '&nbsp; <a href="' . $CFG->wwwroot . '/mod/referentiel/etudiant.php?d=' . $referentiel_id . '&amp;userid=' . $record->userid . '&amp;mode=updateetudiant&amp;sesskey=' . sesskey() . '"><img src="' . $OUTPUT->pix_url('/t/edit') . '" alt="' . get_string('edit') . '" title="' . get_string('edit') . '" /></a>' . "\n";
            }
            if (has_capability('mod/referentiel:managecertif', $context)) {
                $s .= '&nbsp; <a href="' . $CFG->wwwroot . '/mod/referentiel/etudiant.php?d=' . $referentiel_id . '&amp;userid=' . $record->userid . '&amp;mode=deleteetudiant&amp;sesskey=' . sesskey() . '"><img src="' . $OUTPUT->pix_url('/t/delete') . '" alt="' . get_string('delete') . '" title="' . get_string('delete') . '" /></a>' . "\n";
            }
            $s .= '</td></tr>' . "\n";
        }
    }
    return $s;
}
Ejemplo n.º 10
0
 /**
  * Turns referentiel instance into an xml segment
  * @param referentiel instanceobject
  * @return string xml segment
  */
 function write_liste_etudiants()
 {
     global $CFG;
     // initial string;
     $expout = "";
     if ($this->ireferentiel) {
         $id = $this->ireferentiel->id;
         $name = $this->output_codage_caractere(trim($this->ireferentiel->name));
         $description_instance = $this->output_codage_caractere($this->purge_sep($this->ireferentiel->description_instance));
         $label_domaine = $this->output_codage_caractere(trim($this->ireferentiel->label_domaine));
         $label_competence = $this->output_codage_caractere(trim($this->ireferentiel->label_competence));
         $label_item = $this->output_codage_caractere(trim($this->ireferentiel->label_item));
         $date_instance = $this->ireferentiel->date_instance;
         $course = $this->ireferentiel->course;
         $ref_referentiel = $this->ireferentiel->ref_referentiel;
         $visible = $this->ireferentiel->visible;
         //			$expout .= "Instance de referentiel : $this->ireferentiel->name\n";
         //			$expout .= "id;name;description_instance;label_domaine;label_competence;label_item;date_instance;course;ref_referentiel;visible\n";
         //			$expout .= "$id;$name;$description_instance;$label_domaine;$label_competence;$label_item;$date_instance;$course;$ref_referentiel;$visible\n";
         if (isset($this->ireferentiel->course) && $this->ireferentiel->course > 0) {
             // ETUDIANTS
             $records_all_students = referentiel_get_students_course($this->ireferentiel->course);
             if ($records_all_students) {
                 $expout .= "#id_etudiant;user_id;login;Prenom;NOM;num_etudiant;ddn_etudiant;lieu_naissance;departement_naissance;adresse_etudiant;ref_etablissement\n";
                 foreach ($records_all_students as $record) {
                     // USER
                     if (isset($record->userid) && $record->userid > 0) {
                         $record_etudiant = referentiel_get_etudiant_user($record->userid);
                         if ($record_etudiant) {
                             $expout .= $this->write_etudiant($record_etudiant);
                         }
                     }
                 }
             }
         }
     }
     return $expout;
 }
Ejemplo n.º 11
0
 /**
  * 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'>&nbsp;</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} &nbsp;</td>\n";
                     $s2 .= "<td class='referentiel'>{$synthese_certificat} &nbsp;</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;
 }