Commit 95aa1579 authored by Thomas Fradet's avatar Thomas Fradet
Browse files

condition fixed

parent 396ff2e4
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018102201; $plugin->version = 2019021903;
$plugin->requires = 2014051200; $plugin->requires = 2014051200;
$plugin->component = 'block_competency_iena'; $plugin->component = 'block_competency_iena';
$plugin->release = 'v1.0'; $plugin->release = 'v1.0';
......
...@@ -520,15 +520,13 @@ class view_competency_iena_user ...@@ -520,15 +520,13 @@ class view_competency_iena_user
$val_asked = $DB->get_record_sql('select * FROM {competency_usercomp} WHERE competencyid = ? AND userid = ?', array($competencyid, $tmpiduser)); $val_asked = $DB->get_record_sql('select * FROM {competency_usercomp} WHERE competencyid = ? AND userid = ?', array($competencyid, $tmpiduser));
if (has_capability('moodle/course:update', if ( has_capability('moodle/course:update',
$context = context_course::instance($COURSE->id), $USER->id)) { $context = context_course::instance($COURSE->id), $USER->id) ) {
if ( $val_asked->status == "1" ) { if ( $val_asked->status == "1" ) {
echo "<div class='alert alert-info'>Validation / Evaluation demandée par l'étudiant</div>"; echo "<div class='alert alert-info'>Validation / Evaluation demandée par l'étudiant</div>";
} }
// var_dump($scale);
echo "<button type=\"button\" echo "<button type=\"button\"
class=\"btn btn-primary\" id='eval-show'>".get_string('evalute_iena', 'block_competency_iena')."</button> class=\"btn btn-primary\" id='eval-show'>".get_string('evalute_iena', 'block_competency_iena')."</button>
<div id='eval-hide'> <div id='eval-hide'>
...@@ -740,7 +738,7 @@ class view_competency_iena_user ...@@ -740,7 +738,7 @@ class view_competency_iena_user
<?php <?php
foreach ($dataSum->evidence as $value) { foreach ($dataSum->evidence as $value) {
// echo "<div class=\"well well-small evidence\" id=\"proof_iena_id_$value->id\"> /*echo "<div class=\"well well-small evidence\" id=\"proof_iena_id_$value->id\">*/
echo "<div class=\"card card-block\" id=\"proof_iena_id_$value->id\"> echo "<div class=\"card card-block\" id=\"proof_iena_id_$value->id\">
<div class=\"card-body\"> <div class=\"card-body\">
<div class=\"pull-xs-right iena-cpt-abs-right\"> <div class=\"pull-xs-right iena-cpt-abs-right\">
...@@ -779,19 +777,19 @@ class view_competency_iena_user ...@@ -779,19 +777,19 @@ class view_competency_iena_user
<h2 class="title_blue"><?php echo get_string('history_comp', 'block_competency_iena') . " (" . $history_size . ")"; ?></h2> <h2 class="title_blue"><?php echo get_string('history_comp', 'block_competency_iena') . " (" . $history_size . ")"; ?></h2>
<?php if ( $usercomp_id != NULL ): ?> <?php if ( $usercomp_id != NULL ): ?>
<a target="_blank" href="http://localhost:8888/moodle35/admin/tool/lp/user_competency.php?id=<?php echo $usercomp_id; ?>" class="btn btn-block btn-default m-y-1">Consulter les informations pour tous les cours</a> <a target="_blank" href="<?php echo $CFG->wwwroot ?>/admin/tool/lp/user_competency.php?id=<?php echo $usercomp_id; ?>" class="btn btn-block btn-default m-y-1">Consulter les informations pour tous les cours</a>
<? endif; ?> <?php endif; ?>
<?php if ($history_size != 0) { ?> <?php if ($history_size != 0): ?>
<!-- height: < ? p h p echo $taille_proof ?>rem; --> <!-- height: < ? p h p echo $taille_proof ?>rem; -->
<div class="block_compet_param commentaire" id="proof_iena" <div class="block_compet_param commentaire" id="proof_iena"
style="max-height: 29rem; overflow: scroll; border: 1px solid #ccc; border-radius: 0.15rem; padding: 1rem; margin-bottom: 1rem;"> style="max-height: 29rem; overflow: scroll; border: 1px solid #ccc; border-radius: 0.15rem; padding: 1rem; margin-bottom: 1rem;">
<div class="entete"> <div class="entete">
<?php <?php
foreach ($data->usercompetencysummary->evidence as $value) { foreach ($data->usercompetencysummary->evidence as $value) {
// echo "<div class=\"well well-small evidence\" id=\"proof_iena_id_$value->id\">
/*echo "<div class=\"well well-small evidence\" id=\"proof_iena_id_$value->id\">*/
echo "<div class=\"card card-block\" id=\"proof_iena_id_$value->id\"> echo "<div class=\"card card-block\" id=\"proof_iena_id_$value->id\">
<div class=\"card-body\"> <div class=\"card-body\">
<div class=\"pull-xs-right iena-cpt-abs-right\"> <div class=\"pull-xs-right iena-cpt-abs-right\">
...@@ -826,60 +824,48 @@ class view_competency_iena_user ...@@ -826,60 +824,48 @@ class view_competency_iena_user
</div> </div>
</div> </div>
<?php /*if ($taille_proof == 25) { ?> <?php endif; ?>
<!--<div class="align_center" id="extand_iena_proof" style="cursor: pointer;"> </section>
<span class="down_caret"> </div>
<i class="fa fa-chevron-down"></i>
</span> </div>
</div> --> </div>
<?php }*/ ?>
<?php } else {
/*try { <script>
// echo "<p style='padding:1rem; '>". get_string('empty', 'block_competency_iena')."</p>";
} catch (coding_exception $e) { function delete_comment(obj) {
}*/ var url = window.location.href;
} ?>
</section> var t = obj.parentNode.parentNode.parentNode.parentNode;
</div> var info = [];
info[0] = "delete";
</div> info[1] = obj.id;
</div>
$.ajax({
type: "POST",
<script> data: {info: info},
url: url,
function delete_comment(obj) { timeout: 10000,
var url = window.location.href; contentType: 'application/x-www-form-urlencoded',
success: function (data, status) {
var t = obj.parentNode.parentNode.parentNode.parentNode; if (status == "success") {
var info = []; console.log(status);
info[0] = "delete"; console.log(data);
info[1] = obj.id; location.reload();
$.ajax({
type: "POST",
data: {info: info},
url: url,
timeout: 10000,
contentType: 'application/x-www-form-urlencoded',
success: function (data, status) {
if (status == "success") {
console.log(status);
console.log(data);
location.reload();
}
},
error: function (xhr, status, error) {
alert(status);
} }
}); },
error: function (xhr, status, error) {
alert(status);
}
});
} }
function toggle_comments() { function toggle_comments() {
if (document.getElementById("comment-list-plancommentarea2").style.display === 'none') { if (document.getElementById("comment-list-plancommentarea2").style.display === 'none') {
document.getElementById("comment-list-plancommentarea2").style.display = 'block'; document.getElementById("comment-list-plancommentarea2").style.display = 'block';
// console.log(document.getElementById("comment-list-plancommentarea2").style.display); // console.log(document.getElementById("comment-list-plancommentarea2").style.display);
} else { } else {
document.getElementById("comment-list-plancommentarea2").style.display = 'none'; document.getElementById("comment-list-plancommentarea2").style.display = 'none';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment