Skip to content

Commit

Permalink
Merge pull request #117 from grp-attestoodle/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mleconte authored Jul 8, 2019
2 parents a78ba39 + 954ae8e commit fb73115
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 41 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ In the administration, training managers have to set a time for each milestone w

When certificates are generated, times of completed milestones are aggregated for each student, for the selected period, and printed on their certificate.

Project leaders : University of Caen and University of Mans
Project leaders : Universities of Le Mans and Caen

Compatibility : Moodle 3.3, 3.4
Compatibility : Moodle 3.3, 3.6, 3.7

Plugin type : admin tool

Site : [sciencesconf](https://attestoodle.sciencesconf.org/)
Site :
[Attestoodle](https://attestoodle.univ-lemans.fr/)
[sciencesconf](https://attestoodle.sciencesconf.org/)

Others plugins :
[Save and Restore Attestoodle](https://github.com/grp-attestoodle/moodle-tool_save_attestoodle)
[Web service Attestoodle](https://github.com/grp-attestoodle/moodle-local_wsattestoodle)

5 changes: 5 additions & 0 deletions classes/certificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ public function get_pdf_informations() {
$certificateinfos = new \stdClass();
$certificateinfos->learnername = $this->learner->get_fullname();
$certificateinfos->learnerid = $this->learner->get_id();
// Add cumul of validate time since begin !!
$certificateinfos->cumulminutes = $this->learner->get_total_milestones(
$this->training->get_categoryid(),
null,
$this->enddate);
$certificateinfos->trainingname = $trainingname;
$certificateinfos->totalminutes = $totalminutes;
$certificateinfos->period = $period;
Expand Down
3 changes: 3 additions & 0 deletions classes/gabarit/attestation_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ protected function definition() {
$totminutegroup = $this->create_line('totminute');
$mform->addGroup($totminutegroup, 'totalminute', get_string('totalminute', 'tool_attestoodle'), ' ', false);

$cumulminutesgroup = $this->create_line('cumulminutes');
$mform->addGroup($cumulminutesgroup, 'cumulminutes', get_string('cumulminutes', 'tool_attestoodle'), ' ', false);

$activitiesgroup = $this->create_line('activities');
$mform->addGroup($activitiesgroup, 'activities', get_string('tabactivities', 'tool_attestoodle'), ' ', false);

Expand Down
5 changes: 5 additions & 0 deletions classes/gabarit/attestation_pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,11 @@ protected function handle_type($type) {
$text = parse_minutes_to_hours($this->certificateinfos->totalminutes);
}
break;
case "cumulminutes" :
if (isset($this->certificateinfos->cumulminutes)) {
$text = parse_minutes_to_hours($this->certificateinfos->cumulminutes);
}
break;
}
return $text;
}
Expand Down
10 changes: 10 additions & 0 deletions classes/gabarit/sitecertificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@
$datas->totminutelib);
}

if (trim($datas->cumulminutesPosx) != '') {
$nvxtuples[] = data_to_structure($idtemplate, "cumulminutes", $datas->cumulminutesFontFamily,
$datas->cumulminutesEmphasis, $datas->cumulminutesFontSize,
$datas->cumulminutesPosx, $datas->cumulminutesPosy, $datas->cumulminutesAlign,
$datas->cumulminuteslib);
}

if (trim($datas->activitiesPosx) != '') {
$nvxtuples[] = data_to_structure($idtemplate, "activities", $datas->activitiesFontFamily, $datas->activitiesEmphasis,
$datas->activitiesFontSize, $datas->activitiesPosx, $datas->activitiesPosy, $datas->activitiesAlign,
Expand Down Expand Up @@ -246,6 +253,9 @@
case "totalminutes" :
add_values_from_json($valdefault, "totminute", $obj);
break;
case "cumulminutes" :
add_values_from_json($valdefault, "cumulminutes", $obj);
break;
case "activities" :
add_values_from_json($valdefault, "activities", $obj);
break;
Expand Down
3 changes: 2 additions & 1 deletion classes/gabarit/view_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ function create_debordement_test() {
$certificateinfos = new \stdClass();
$certificateinfos->trainingname = "UN TITRE DE FORMATION EXTREMEMENT LONG POUR DECLENCHER UN CHANGEMENT " .
"DE LIGNE VOIR PLUSIEURS RETOURS A LA LIGNE EN ESPERANT QUE CELA SUFFISE";
$certificateinfos->learnername = "MyFisrtname MyLastname";
$certificateinfos->learnername = "MyFirstname MyLastname";
$certificateinfos->totalminutes = 550;
$certificateinfos->cumulminutes = 950;
$certificateinfos->period = "Du 01/07/2018 au 31/07/2018";
$activitiesstructured = array();
$activitiesstructured[15] = array(
Expand Down
5 changes: 5 additions & 0 deletions classes/training/select_learners.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@

echo $OUTPUT->header();
// Add help here.
if (get_string_manager()->string_exists('UrlHlpTo_selectlearners', 'tool_attestoodle')) {
$urlhlp = get_string('UrlHlpTo_selectlearners', 'tool_attestoodle');
echo "<a href='" . $urlhlp . "' target='aide' title='" . get_string('help') .
"'><i class='fa fa-question-circle-o' aria-hidden='true'></i></a>";
}

// Table.
$baseurl = new moodle_url('/admin/tool/attestoodle/classes/training/select_learners.php', array(
Expand Down
2 changes: 2 additions & 0 deletions lang/en/tool_attestoodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
$string['training'] = 'Designation of the formation';
$string['period'] = 'Period';
$string['totalminute'] = 'Total time validated over the period';
$string['cumulminutes'] = 'Total time validated';
$string['tabactivities'] = 'Table of activities';
$string['font'] = 'Font :';
$string['emphasis'] = 'Emphasis :';
Expand Down Expand Up @@ -267,6 +268,7 @@
$string['UrlHlpTo_detailled_report'] = 'https://github.com/grp-attestoodle/moodle-tool_attestoodle/wiki/detailled_report';
$string['UrlHlpTo_global_report'] = 'https://github.com/grp-attestoodle/moodle-tool_attestoodle/wiki/global_report';
$string['UrlHlpTo_manage_milestones'] = 'https://github.com/grp-attestoodle/moodle-tool_attestoodle/wiki/manage_milestones';
$string['UrlHlpTo_selectlearners'] = 'https://github.com/grp-attestoodle/moodle-tool_attestoodle/wiki/manage_learners';
// Privacy.
$string['privacy:metadata:core_files'] = 'Attestoodle stores generated attestation files, per learner-training-interval of time';
$string['privacy:metadata:tool_attestoodle_launch_log'] = 'Log of certificate generation launches';
Expand Down
1 change: 1 addition & 0 deletions lang/fr/tool_attestoodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
$string['training'] = 'Désignation de la formation';
$string['period'] = 'Période';
$string['totalminute'] = 'Temps total validé sur la période';
$string['cumulminutes'] = 'Temps total validé';
$string['tabactivities'] = 'Tableau des activités';
$string['font'] = 'Fonte :';
$string['emphasis'] = 'Emphase :';
Expand Down
35 changes: 0 additions & 35 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,6 @@
* @copyright 2018 Pole de Ressource Numerique de l'Université du Mans
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/* Not displaying the milestone time (default) */
span.tps_jalon {
display: none;
}

/* Displaying milestone time while editing activity description inside Moodle */
div.editor_atto_content > span.tps_jalon {
display: block;
color: red;
border: 1px solid red;
background: yellow;
text-align: center;
text-overflow: '...';
overflow: hidden;
white-space: nowrap;
margin-right: auto;
margin-top: 0.5em;
margin-left: auto;
margin-bottom: 1.5em;
padding: 0.5em;
width: 30em;
font-weight: bold;
}
div.editor_atto_content > span.tps_jalon::before {
content: "\023f0\0020 Jalon, valeur : ";
visibility: visible;
font-weight: normal;
}
div.editor_atto_content > span.tps_jalon::after {
content: " min. (\26a0\0020Ne pas supprimer cet encadré !)";
visibility: visible;
font-weight: normal;
}

.attestoodle-button {
display: inline-block;
}
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->release = 'v1.6.0'; // The current plugin release
$plugin->version = 2019062601; // The current plugin version (Date: YYYYMMDDXX).10
$plugin->release = 'v1.7.0'; // The current plugin release
$plugin->version = 2019070801; // The current plugin version (Date: YYYYMMDDXX).10
$plugin->requires = 2012112900; // Requires this Moodle version.
$plugin->component = 'tool_attestoodle'; // Full name of the plugin (used for diagnostics).

0 comments on commit fb73115

Please sign in to comment.