diff --git a/amd/build/header.js b/amd/build/header.js index 26243b736c3cfbb0894f09ef68066247745ba0e6..354768fb65c2e25137cdd8ebc4d7c490b9456894 100644 --- a/amd/build/header.js +++ b/amd/build/header.js @@ -27,7 +27,6 @@ define(['jquery', 'core/ajax', 'core/str'], return{ registerHeader:function(){ - console.log("par ici ?"); var heightWrapper= $("#summary-wrapper").css("height"); if(parseInt(heightWrapper, 10) >= 144){ @@ -62,10 +61,17 @@ define(['jquery', 'core/ajax', 'core/str'], $("#button-collapse").hide(); } var menu=$("#drawermenu .nav.navbar"); - url=window.location.search; - console.log(url) - menu.append("<li class='nav-item'><a class='nav-link' href='"+url+"/course/format/iena/suivi_unit.php?courseid=3§ionid=0&groupid=0'><i class='icon fa fa-table fa-fw' title='Notes'></i></a></li>"); - + url=window.location.origin+window.location.pathname; + split=url.split('/'); + fullurl=""; + for(var i=0; i<split.length-1; i++){ + fullurl+=split[i]+"/"; + } + urlParams = new URLSearchParams(window.location.search); + course=urlParams.get('id'); + fullurl+='format/iena/suivi_unit.php?courseid='+course+'§ionid=0&groupid=0'; + menu.append("<li class='nav-item'><a class='nav-link' href='"+fullurl+"'><i class='icon fa fa-tasks fa-fw' title='Suivi global'></i></a></li>"); + $("#drawermenu .nav.navbar .nav-item .nav-link").css('padding', "0.5rem 0.8rem"); } diff --git a/amd/build/suivi-table.js b/amd/build/suivi-table.js index 15ba3a92c0fd16756d43184291a4fd80d863f62b..e43d9b419e92552b6e133660212b4e18177b740a 100644 --- a/amd/build/suivi-table.js +++ b/amd/build/suivi-table.js @@ -41,13 +41,14 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], }, //Si l'option de détails au clic est activée, on register l'événement du clic registerDetailsClick:function(){ - completeUrl="http://localhost/moodle4/moodle/course/format/iena/suivi_unit.php?courseid=3§ionid=7&groupid=0&filter=%E2%89%A50"; + completeUrl=window.location.href; + $(".pointer-help").addClass("hover-details"); $(".pointer-help").on("click", function(e){ e.stopPropagation(); idmodule=$(this).data("module"); idetudiant=$(this).parent().data("userid"); nometudiant=$(this).siblings('.third-column-iena')[0].innerHTML; - console.log(nometudiant); + //$('#myModal').modal('show'); //$('#myModal').modal('hide'); @@ -57,11 +58,8 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], type: 'post', success: function(request) { parsedrequest=JSON.parse(request) - console.log(parsedrequest); parsedrequest["student"]=nometudiant; - //$("#modal-content").html(parsedrequest["completioninfos"]); - //data=calcPercentage(JSON.parse(request)); //On récupère les détails, on va les donner à la modale // templates.render('format_iena/modal-details', parsedrequest) diff --git a/classes/output/courseformat/content/section/header.php b/classes/output/courseformat/content/section/header.php index 0b9cb238543ea612aae88f44ad449aedc59566a7..8c70242c3593b946539ed5ec48c0b2a087f6f499 100644 --- a/classes/output/courseformat/content/section/header.php +++ b/classes/output/courseformat/content/section/header.php @@ -4,6 +4,7 @@ namespace format_iena\output\courseformat\content\section; use core_courseformat\output\local\content\section\header as header_base; use format_iena\entity\course_format_iena_completion; +use pix_icon; use context_course; class header extends header_base{ @@ -64,6 +65,11 @@ class header extends header_base{ else{ $data->progress=$this->get_progress_student($course->id, $section, $course); } + $icon=new pix_icon('bar-progress', 'Progrès global', 'format_iena'); + $data->iconglobalprogress=$icon->export_for_pix(); + error_log("pddu"); + error_log(print_r($data->iconglobalprogress, true)); + return $data; } diff --git a/pix/bar-progress.png b/pix/bar-progress.png new file mode 100644 index 0000000000000000000000000000000000000000..63c8d80467832d3d4291465a1eaf12bbf2f3adfc Binary files /dev/null and b/pix/bar-progress.png differ diff --git a/pix/bar-progress_svg.svg b/pix/bar-progress_svg.svg new file mode 100644 index 0000000000000000000000000000000000000000..289b3af1aac13a0ad4e7940c948ced78af3a1f6e --- /dev/null +++ b/pix/bar-progress_svg.svg @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 512 512"> + <defs> + <style> + .cls-1 { + fill: white; + stroke-width: 0px; + } + </style> + </defs> + <path class="cls-1" d="M448,245v32H192v-32h256ZM48,181c-26.5,0-48,21.5-48,48v64c0,26.5,21.5,48,48,48h416c26.5,0,48-21.5,48-48v-64c0-26.5-21.5-48-48-48H48Z"/> +</svg> \ No newline at end of file diff --git a/styles.css b/styles.css index 43b93a39dc0835b5973e114f0a85cf6f64385ffe..88f3289f6777d29a27446126805a30baa7beda3c 100644 --- a/styles.css +++ b/styles.css @@ -228,6 +228,12 @@ ul.nav.navbar-nav.ml-auto { border-radius: 50px; } +.iena-icon-suivi img{ + margin-right: 0; + width: 13px; + height: 5px; +} + .right_info { margin-left: auto; display: flex; @@ -1200,6 +1206,16 @@ border-bottom: 1px solid #dee2e6; } +.activity-name:hover{ + text-decoration: none; + +} + +.hover-details:hover{ + cursor: pointer!important; + opacity: 0.8; + +} /******************************************************** Paramètres du tableau de suivi ******************************************/ #iena-suivi-edit .form-inline{ diff --git a/suivi_unit.php b/suivi_unit.php index 0c652b3891a4fb01e4ef86c1418feedb3cadcf1c..3deaa00b5e7cd9e81061468e7a6817e1b23c8f4e 100644 --- a/suivi_unit.php +++ b/suivi_unit.php @@ -167,6 +167,10 @@ function get_activities($completion, $activesectionid) { $displayname = format_string($activity->name, true, array('context' => $activity->context)); $module->displayname = strlen($displayname) > 50 ? mb_substr($displayname, 0, 49, 'UTF-8').'…' : $displayname; $module->section = $activity->section; + if($activity->get_url()){ + $module->link=$activity->get_url()->out(); + } + $modules[] = $module; if ($activity->section == $activesectionid || $activesectionid == 0 ) { $module->visible = true; @@ -231,7 +235,7 @@ function set_filters($data, $filters, $symbols, $sections, $groups, $currentuser function set_data($data, $modules, $progress, $groups, $activegroupsids, $activesectionid, $listoptions) { global $COURSE, $USER, $CFG; - $data["modules"] = $modules; + $data["modules"] = $modules;; $countmodules = count($data["modules"]); $data["students"] = format_progress($progress, $modules, $groups, $activegroupsids, $activesectionid); @@ -413,7 +417,6 @@ if (isset($_POST['action']) && $_POST['action'] == "details") { if($lastgradeobject){ $lastgrade["lastgrade"]=$lastgradeobject->str_long_grade; - error_log($lastgrade["lastgrade"]); $lastgrade["datelastgrade"]=$lastgradeobject->dategraded; } @@ -439,6 +442,7 @@ if (isset($_POST['action']) && $_POST['action'] == "details") { $data["completionstate"]=$completiondetails->get_overall_completion(); $data["competiondetails"] = $completiondetails; $data["activityname"]=$cm->name; + echo json_encode($data); } @@ -487,7 +491,7 @@ else if (isset($_POST['action']) && !empty($_POST['action'])) { $msg = $_GET["msg_success"]; $data["msg_success"] = $msg; } - + } diff --git a/templates/courseformat/content/section/header.mustache b/templates/courseformat/content/section/header.mustache index 44bd46dc8eee454d1669b0ec18a85ea99d30f035..2c624e6983cc7d5396eee8468f0613bc9135e872 100644 --- a/templates/courseformat/content/section/header.mustache +++ b/templates/courseformat/content/section/header.mustache @@ -122,7 +122,7 @@ <div class="nb_pers set_height mobile-bouton-suivi"><i class="fa fa-tasks"></i></div> </a> <a href='{{section}}' style='color : white' data-toggle="tooltip" title="Suivi de la section"> - <div style="display:block;" class="nb_pers set_height iena-icon-suivi"><i class="fa fa-table"></i></div> + <div style="display:block;" class="nb_pers set_height iena-icon-suivi">{{#pix}} bar-progress, format_iena, Progrès global{{/pix}}</div> </a> diff --git a/templates/suivi-table.mustache b/templates/suivi-table.mustache index 718e82e622c446f5562f50c32c4505f61a393440..bad84ecebc26b666394869210ef6e8e9460d31e3 100644 --- a/templates/suivi-table.mustache +++ b/templates/suivi-table.mustache @@ -18,7 +18,12 @@ <th class="th-rotate" data-fullname="{{name}}" data-section="{{section}}"> <div> <span> - {{displayname}} + {{#link}} + <a href="{{link}}" class="activity-name" target="_blank">{{displayname}}</a> + {{/link}} + {{^link}} + {{displayname}} + {{/link}} </span> </div> </th>