Skip to content
Snippets Groups Projects
Commit e7903262 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

Fin ajout activités

parent 99e7f2e9
Branches
Tags
No related merge requests found
......@@ -12,17 +12,18 @@
require_once('view/view_competency_iena_competencies_mgmt.php');
global $COURSE, $DB, $CFG;
echo "COURSE ID";
echo $COURSE->id;
global $COURSE, $DB, $CFG, $USER;
$courseid = required_param('courseid', PARAM_INT);
$editmode = optional_param('editmode', false, PARAM_BOOL);
$url = new moodle_url('/blocks/competency_iena/competency_iena_competencies_mgmt.php', array('courseid' => $courseid));
//$requete = $DB->get_record_sql('SELECT course FROM {block_competency_iena} WHERE id = ?', array($courseid));
$PAGE->set_url($url);
if(!has_capability('moodle/course:update', $context = context_course::instance($courseid), $USER->id)){
$editmode=false;
}
if ($_POST) {
if ($_POST['info'][0] == "delete_cpt") {
......@@ -292,11 +293,12 @@
$data['sections_matrix']=$sections_matrix;
$data['frameworks']=array_values($frameworks);
$data['ordered_competencies']=$ordered_competencies;
var_dump($ordered_competencies);
$data['form_link']= $CFG->wwwroot . "/blocks/competency_iena/competency_iena_competency_mgmt.php?courseid=" . $COURSE->id;
$data['update_link']=$CFG->wwwroot . '/blocks/competency_iena/competency_iena_competencies_api.php?courseid=' . $COURSE->id;
$data['edit_link']=$CFG->wwwroot . '/blocks/competency_iena/competency_iena_competencies_mgmt.php?courseid=' . $COURSE->id;
$data['courseid']=$COURSE->id;
$data['edit']=$editmode;
//$link = $CFG->wwwroot . '/blocks/competency_iena/competency_iena_competency_mgmt.php?courseid=' . $COURSE->id;
......
This diff is collapsed.
......@@ -83,4 +83,6 @@
$string['count_activities']=" activities/resources selected";
$string['add_activities']="Add activities/resources";
$string['select_act'] = 'Activities selector';
$string['manage_matrix'] = 'Edit matrix';
$string['manage_matrix_end'] = 'Exit edit mode';
?>
\ No newline at end of file
......@@ -82,6 +82,8 @@
$string['count_activities']=" activité(s)/ressource(s) sélectionnée(s)";
$string['add_activities']="Ajouter les activités/ressources";
$string['select_act'] = 'Sélecteur d\'activités';
$string['manage_matrix'] = 'Modifier la matrice';
$string['manage_matrix_end'] = 'Quitter le mode édition';
......
......@@ -186,3 +186,12 @@
}
}
div.dataTables_wrapper {
width: 100%;
margin: 0 auto;
}
table.dataTable{
border-collapse: collapse !important;
}
\ No newline at end of file
<h3>{{# str }} manage_comp, block_competency_iena{{/ str }}</h3>
<p>{{# str }} add_comment, block_competency_iena{{/ str }}</p>
<table id="tab_mgmt" class="table-bordered display dataTable" style="width:100%" >
<table id="tab_mgmt" class="table-bordered display dataTable" >
<thead>
<tr>
<th></th>
<th>Activités</th>
{{#competencies}}
<th style="max-width: 70px; overflow: hidden;"">
<i class="fa fa-remove icon-red-iena" style="font-size:24px;color:#dc493a" onclick='supprimer_lien_cpt({{id}})'></i>
<th style="max-width: 170px; overflow: hidden;">
{{#edit}}<i class="fa fa-remove icon-red-iena" style="font-size:24px;color:#dc493a" onclick='supprimer_lien_cpt({{id}})'></i>{{/edit}}
<a href='{{link}}' style='color: black;'>
<p style="word-wrap: break-word;">{{#shortentext}} 45, {{shortname}}{{/shortentext}}</p>
</a>
......@@ -17,7 +17,7 @@
</thead>
<tbody>
{{#sections_matrix}}
<tr>
<tr class="bg-primary">
<td class="bg-primary text-white">
{{name}}
</td>
......@@ -33,19 +33,22 @@
{{#module_ruleoutcomestring}}
<span style="display:inline" id="divmodule{{moduleid}}-competency{{id}}">
<p style="margin:0">{{module_ruleoutcomestring}}</p>
{{#edit}}
<i class="fa fa-remove icon-red-iena" style="font-size:24px;color:#dc493a" onclick='supprimer_lien(this)'></i>
{{/edit}}
</span>
{{/module_ruleoutcomestring}}
{{^module_ruleoutcomestring}}
<span style="display:none" id="divmodule{{moduleid}}-competency{{id}}">
<p style="margin:0">{{module_ruleoutcomestring}}</p>
{{#edit}}
<i class="fa fa-remove icon-red-iena" style="font-size:24px;color:#dc493a" onclick='supprimer_lien(this)'></i>
{{/edit}}
</span>
{{/module_ruleoutcomestring}}
{{#edit}}
<div style="display:none">
<select id="selmodule{{moduleid}}-competence{{id}}"">
<option value="0">{{# str }} nothing, block_competency_iena{{/ str }}</option>
......@@ -57,6 +60,7 @@
<i class="fa fa-check icon-green-iena" onclick='select_update(this)'></i>
</div>
<i class="fa fa-edit icon-blue-iena" data-edit='editOff' onclick='showFilter(this)'></i>
{{/edit}}
</td>
{{/mcompetencies}}
......@@ -66,8 +70,27 @@
</tbody>
</table>
{{#edit}}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#cpt-modal">{{# str }} add_comp, block_competency_iena {{/ str }}</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#activities-modal">{{# str }} add_activities, block_competency_iena {{/ str }}</button>
{{> block_competency_iena/modal_competencies}}
{{> block_competency_iena/modal_activities}}
<form method="post" action="{{edit_link}}&editmode=false">
<button type="submit" class="btn btn-primary">{{# str }} manage_matrix_end, block_competency_iena {{/ str }}</button>
</form>
{{> block_competency_iena/modal_competencies}}
{{> block_competency_iena/modal_activities}}
{{/edit}}
{{^edit}}
<form method="post" action="{{edit_link}}&editmode=true">
<button type="submit" class="btn btn-primary">{{# str }} manage_matrix, block_competency_iena {{/ str }}</button>
</form>
{{/edit}}
......@@ -28,7 +28,7 @@
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021070501;
$plugin->version = 2021070600;
$plugin->requires = 2014051200;
$plugin->component = 'block_competency_iena';
$plugin->release = 'v1.0';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment