$date_modif_info = ''; } // MODIF JF 27/10/2009 $date_modif_student = $record->date_modif_student; if ($date_modif_student != 0) { $date_modif_student_info = userdate($date_modif_student); } else { $date_modif_student_info = ''; } $link_documents = referentiel_get_liens_documents($activite_id, $userid, $context); if ($link_documents) { echo '<br />' . "\n"; } // preparer les variables globales pour Overlib referentiel_initialise_data_referentiel($ref_referentiel); $jauge_activite_declarees = referentiel_print_jauge_activite($userid, $ref_referentiel); if ($jauge_activite_declarees) { print_string('competences_declarees', 'referentiel', referentiel_get_user_info($userid)); //echo '<br />DEBUT DEBUG'."\n"; echo $jauge_activite_declarees . "\n"; //echo '<br />FIN DEBUG'."\n"; } echo '<div class="ref_saisie1"> <form name="form" method="post" action="' . s("activite.php?id={$cm->id}") . '"> <span class="bold">' . get_string('id', 'referentiel') . '</span>'; echo $activite_id; echo '<span class="bold">' . get_string('type_activite', 'referentiel') . '</span>' . s($type_activite) . ' <br /><span class="bold">' . get_string('auteur', 'referentiel') . '</span>' . s($user_info); echo ' <span class="bold">' . get_string('date_creation', 'referentiel') . '</span>' . s($date_creation_info); echo '<br />' . "\n"; if (isset($approved) && $approved) {
function definition() { $mform =& $this->_form; $arguments = $this->_customdata; // arguments if (isset($arguments['options'])) { $options = $arguments['options']; } else { $option = NULL; } if (isset($arguments['context'])) { $this->context = $arguments['context']; } else { $this->context = NULL; } if (isset($arguments['userid'])) { $this->userid = $arguments['userid']; } else { $this->userid = 0; } if (isset($arguments['instanceid'])) { $this->instanceid = $arguments['instanceid']; } else { $this->instanceid = 0; } if (isset($arguments['occurrenceid'])) { $this->occurrenceid = $arguments['occurrenceid']; } else { $this->occurrenceid = 0; } if (isset($arguments['activite'])) { $this->activiteid = $arguments['activite']; } else { $this->activite = NULL; } if (!empty($this->activite)) { if (isset($this->activite->id)) { $activite_id = $this->activite->id; } else { $activite_id = 0; } if (isset($this->activite->type_activite)) { $type_activite = $this->activite->type_activite; } else { $type_activite = ''; } if (isset($this->activite->description_activite)) { $description_activite = $this->activite->description_activite; } else { $description_activite = ''; } if (isset($this->activite->competences_activite)) { $competences_activite = $this->activite->competences_activite; } else { $competences_activite = ''; // referentiel_get_liste_codes_competence($this->occurrenceid); } $old_liste_competences = $competences_activite; if (isset($this->activite->commentaire_activite)) { $commentaire_activite = $this->activite->commentaire_activite; } else { $commentaire_activite = ''; } if (isset($this->activite->userid)) { $userid = $this->activite->userid; } else { $userid = $this->userid; } if (isset($this->activite->teacherid)) { $teacherid = $this->activite->teacherid; } else { $teacherid = 0; } if (isset($this->activite->approved)) { $approved = $this->activite->approved; } else { $approved = 0; } if (isset($this->activite->ref_task)) { $ref_task = $this->activite->ref_task; } else { $ref_task = 0; } } else { $activite_id = 0; $type_activite = ''; $description_activite = ''; $competences_activite = ''; // referentiel_get_liste_codes_competence($this->occurrenceid); $old_liste_competences = ''; $commentaire_activite = ''; $userid = $this->userid; $teacherid = 0; $approved = 0; $ref_task = 0; } if (isset($option->mode)) { $mode = $option->mode; } else { $mode = ''; } if (isset($option->modulename)) { $modulename = $option->modulename; } else { $modulename = ''; } if (isset($option->select_acc)) { $select_acc = $option->select_acc; } else { $select_acc = 0; } if (isset($option->data_filtre)) { $data_filtre = $option->data_filtre; } else { $data_filtre = NULL; } if (isset($arguments['action'])) { $action = $arguments['action']; } else { $action = 'addactivity'; } // visible elements $mform->addElement('header', 'general', $arguments['msg']); $mform->addHelpButton('general', 'creer_activiteh', 'referentiel'); // preparer les variables globales pour Overlib referentiel_initialise_data_referentiel($this->occurrenceid); if (has_capability('mod/referentiel:managecertif', $this->context)) { // enseignant $mform->addElement('html', '<p><i>' . get_string('creer_activite_teacher', 'referentiel') . '</i></p>' . "\n"); } $jauge_activite_declarees = referentiel_print_jauge_activite($userid, $this->occurrenceid); if ($jauge_activite_declarees) { $jauge_activite_declarees = get_string('competences_declarees', 'referentiel', referentiel_get_user_info($userid)) . ' ' . $jauge_activite_declarees . "\n"; $mform->addElement('html', '<div class="qheader">' . $jauge_activite_declarees . '</div>'); } $mform->addElement('text', 'type_activite', get_string('type_activite', 'referentiel'), array('size' => '40')); $mform->setType('type_activite', PARAM_ALPHA); $mform->addRule('type_activite', get_string('missingtype', 'referentiel'), 'required', null, 'server'); $mform->setDefault('type_activite', $type_activite); $mform->addElement('editor', 'description_activite', get_string('description', 'referentiel')); $mform->setType('description_activite', PARAM_TEXT); $mform->addRule('description_activite', get_string('missingdescription', 'referentiel'), 'required', null, 'server'); $mform->setDefault('description_activite', $description_activite); //if (isteacher($this->userid)){ if (has_capability('mod/referentiel:approve', $this->context)) { $mform->addElement('textarea', 'commentaire_activite', get_string('commentaire', 'referentiel'), 'wrap="virtual" cols="80" rows="5"'); $mform->setType('commentaire_activite', PARAM_TEXT); $mform->setDefault('commentaire_activite', $commentaire_activite); } else { //echo get_string('commentaire','referentiel').': '.$commentaire_activite."\n"; $mform->addElement('hidden', 'commentaire_activite', $commentaire_activite); $mform->setType('commentaire_activite', PARAM_TEXT); } // $saisie_competences=referentiel_modifier_selection_codes_item_hierarchique($this->occurrenceid, $competences_activite, $ref_task, $activite_id, '', 1); // $saisie_competences=referentiel_modifier_selection_codes_item_hierarchique($this->occurrenceid, '', $ref_task, $activite_id, '', 1); // Cette approche ne fonctionne pas // $mform->addElement('html', "\n".'<br /><div class="qheader">'.$saisie_competences.'</div><br />'."\n"); $this->modifier_selection_codes_item_hierarchique($mform, $this->occurrenceid, '', $ref_task, $activite_id, '', 1); /* echo '<br />'."\n"; referentiel_selection_liste_codes_item_hierarchique($this->occurrenceid); echo '<br />'."\n"; */ $radioarray = array(); $radioarray[] = $mform->createElement('radio', 'depot_document', '', get_string('yes'), 1, NULL); $radioarray[] = $mform->createElement('radio', 'depot_document', '', get_string('no'), 0, NULL); $mform->addGroup($radioarray, 'depot_document', get_string('depot_document', 'referentiel'), array(' '), false); $mform->setDefault('depot_document', 0); //echo get_string('notification_activite','referentiel'); $radioarray = array(); $radioarray[] = $mform->createElement('radio', 'mailnow', '', get_string('yes'), 1, NULL); $radioarray[] = $mform->createElement('radio', 'mailnow', '', get_string('no'), 0, NULL); $mform->addGroup($radioarray, 'mailnow', get_string('notification_activite', 'referentiel'), array(' '), false); $mform->setDefault('mailnow', 0); // echo get_string('validation','referentiel').': '."\n"; if (has_capability('mod/referentiel:approve', $this->context)) { $radioarray = array(); $radioarray[] = $mform->createElement('radio', 'approved', '', get_string('yes'), 1, NULL); $radioarray[] = $mform->createElement('radio', 'approved', '', get_string('no'), 0, NULL); $mform->addGroup($radioarray, 'approved', get_string('approved', 'referentiel'), array(' '), false); $mform->setDefault('approved', $approved); } else { /* if ($approved){ echo get_string('approved','referentiel'); } else{ echo get_string('not_approved','referentiel'); } */ $mform->addElement('hidden', 'approved', $approved); $mform->setType('approved', PARAM_INT); } /* //$mform->addElement('filemanager', 'newfile', get_string('uploadafile')); //$mform->addElement('filemanager', 'referentiel_file', get_string('uploadafile'), null, $arguments['options']); // pour une importation puis suppression $mform->addElement('filepicker', 'referentiel_file', get_string('uploadafile'), null, $arguments['options']); */ // hidden params $mform->addElement('hidden', 'activite_id', $activite_id); $mform->setType('activite_id', PARAM_INT); $mform->addElement('hidden', 'ref_task', $ref_task); $mform->setType('ref_task', PARAM_INT); $mform->addElement('hidden', 'old_liste_competences', $old_liste_competences); $mform->setType('old_liste_competences', PARAM_TEXT); $mform->addElement('hidden', 'userid', $userid); $mform->setType('userid', PARAM_INT); $mform->addElement('hidden', 'teacherid', $teacherid); $mform->setType('teacherid', PARAM_INT); $mform->addElement('hidden', 'd', $this->instanceid); $mform->setType('d', PARAM_INT); $mform->addElement('hidden', 'contextid', $this->context->id); $mform->setType('contextid', PARAM_INT); $mform->addElement('hidden', 'ref_referentiel', $this->occurrenceid); $mform->setType('ref_referentiel', PARAM_INT); $mform->addElement('hidden', 'course', $this->courseid); $mform->setType('course', PARAM_INT); $mform->addElement('hidden', 'ref_instance', $this->instanceid); $mform->setType('ref_instance', PARAM_INT); $mform->addElement('hidden', 'instance', $this->instanceid); // ??? résidu d'ancienne version ?? $mform->setType('instance', PARAM_INT); $mform->addElement('hidden', 'modulename', $modulename); $mform->setType('modulename', PARAM_TEXT); $mform->addElement('hidden', 'mode', $mode); $mform->setType('mode', PARAM_TEXT); $mform->addElement('hidden', 'sesskey', sesskey()); $mform->setType('sesskey', PARAM_TEXT); // Ajout pour les filtres $mform->addElement('hidden', 'select_acc', $select_acc); $mform->setType('select_acc', PARAM_INT); if (!empty($data_filtre)) { $mform->addElement('hidden', 'filtre_auteur', $data_filtre->filtre_auteur); $mform->setType('filtre_auteur', PARAM_INT); $mform->addElement('hidden', 'filtre_validation', $data_filtre->filtre_validation); $mform->setType('filtre_validation', PARAM_INT); $mform->addElement('hidden', 'filtre_referent', $data_filtre->filtre_referent); $mform->setType('filtre_referent', PARAM_INT); $mform->addElement('hidden', 'filtre_date_modif', $data_filtre->filtre_date_modif); $mform->setType('filtre_date_modif', PARAM_INT); $mform->addElement('hidden', 'filtre_date_modif_student', $data_filtre->filtre_date_modif_student); $mform->setType('filtre_date_modif_student', PARAM_INT); } $mform->addElement('hidden', 'action', $action); $mform->setType('action', PARAM_ALPHA); // buttons $this->add_action_buttons(true); }
if ($user_nb_activities_displayed == 0) { // Afficher les predecesseurs sans activite avant d'afficher les declarations de celui-ci $s_no_activity = ''; $k = $index_user - 1; // rechercher le successeur sans activite while ($k > 0 && $t_users_count[$k] == 0) { $s_no_activity = '<div align="center" class="grise">' . referentiel_print_aucune_activite_user($t_users[$k]) . '</div>' . "\n" . $s_no_activity; $k--; } if (!empty($s_no_activity)) { echo $s_no_activity; } } $first_activity = 0; } echo '<div align="center">' . get_string('competences_declarees', 'referentiel', '<span class="bold">' . referentiel_get_user_info($record_a->userid) . '</span>') . "\n" . referentiel_print_jauge_activite($record_a->userid, $referentiel_referentiel->id) . '</div>' . "\n"; if ($modeaff == 2) { // if ($index_user >= 0 && isset($t_users_count[$index_user]) && $t_users_count[$index_user] > 0) { // nb activites echo '<div align="center"><i>' . get_string('activitynumber', 'referentiel', $t_users_count[$index_user]) . '</i></div>' . "\n"; } } } referentiel_print_activite_detail($bareme, $record_a, $context, $modeaff == 1); if ($record_a->ref_course == $course->id) { referentiel_menu_activite($cm, $context, $record_a->id, $record_a->userid, $referentiel->id, $record_a->approved, $selacc, $modeaff == 1, $mode); if (!$record_a->approved) { echo '<div align="center">' . referentiel_ajout_document($record_a, $mode, $selacc) . "</div>\n"; } } else {
function referentiel_activite_id($context, $mode, $cm, $instance, $activite_id, $bareme, $select_acc = 0, $detail = true) { global $COURSE; // Specifique car on a l'id de l'activite if ($activite_id) { $record_a = referentiel_get_activite($activite_id); if (!empty($record_a)) { echo '<div align="center">' . get_string('competences_declarees', 'referentiel', '<span class="bold">' . referentiel_get_user_info($record_a->userid) . '</span>') . "\n" . referentiel_print_jauge_activite($record_a->userid, $instance->ref_referentiel) . '</div>' . "\n"; referentiel_print_activite_detail($bareme, $record_a, $context, true, 0); if (!$record_a->approved) { echo '<div align="center">' . referentiel_ajout_document($record_a, $mode, $select_acc) . "</div>\n"; } // afficher le menu si on l'activité est affichee dans son propre cours de création if ($record_a->ref_course == $COURSE->id) { referentiel_menu_activite($cm, $context, $record_a->id, $record_a->userid, $instance->id, $record_a->approved, 0, $detail, $mode); } else { echo '<div align="center">' . get_string('activite_exterieure', 'referentiel') . '</div>' . "\n"; } } } }
$form->modulename = 'referentiel'; } if (!isset($form->instance)) { $form->instance = $referentiel->id; } // preparer les variables globales pour Overlib referentiel_initialise_data_referentiel($referentiel_referentiel->id); ?> <?php if (has_capability('mod/referentiel:managecertif', $context)) { // enseignant echo '<p><i>' . get_string('creer_activite_teacher', 'referentiel') . '</i></p>' . "\n"; } $jauge_activite_declarees = referentiel_print_jauge_activite($USER->id, $referentiel_referentiel->id); if ($jauge_activite_declarees) { print_string('competences_declarees', 'referentiel', referentiel_get_user_info($USER->id)); //echo '<br />DEBUT DEBUG'."\n"; echo $jauge_activite_declarees . "\n"; //echo '<br />FIN DEBUG'."\n"; } echo '<form name="form" method="post" action="activite.php?d=' . $referentiel->id . '"> ' . "\n"; echo '<h3 align="center"><br />' . get_string('declarer_activite', 'referentiel') . '</h3>' . "\n"; echo '<div class="ref_saisie1">' . "\n"; echo '<span class="bold">' . get_string('type_activite', 'referentiel') . '</span>'; echo '<br /><input type="text" name="type_activite" size="80" maxlength="80" value="' . $form->type_activite . '" /> '; echo '<br />' . "\n"; echo '<span class="bold">' . get_string('description', 'referentiel') . '</span>'; echo '<br /> '; echo '<textarea cols="100" rows="10" name="description_activite">' . s($form->description_activite) . '</textarea>';