Skip to content

Commit

Permalink
Fix custom certificate UI see BT#16347
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Jan 14, 2020
1 parent 05bc6cb commit 76dd99d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 8 additions & 3 deletions main/inc/lib/certificate.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public function updateUserCertificateInfo(
) {
$table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
$now = api_get_utc_datetime();
$sql = 'UPDATE '.$table.' SET
$sql = 'UPDATE '.$table.' SET
path_certificate="'.Database::escape_string($path_certificate).'",
created_at = "'.$now.'"
WHERE cat_id = "'.$categoryId.'" AND user_id="'.$user_id.'" ';
Expand Down Expand Up @@ -787,7 +787,9 @@ public function generateCustomCertificate()
null,
null,
false,
false
false,
false,
'd-m-Y'
)
);
$tplContent->assign(
Expand All @@ -797,14 +799,17 @@ public function generateCustomCertificate()
null,
null,
false,
false
false,
false,
'd-m-Y'
)
);
$tplContent->assign('skills', $skills);
$tplContent->assign('sessions', $sessionsApproved);
$tplContent->assign('courses', $coursesApproved);
$tplContent->assign('time_spent_in_lps', api_time_to_hms($totalTimeInLearningPaths));
$tplContent->assign('time_spent_in_lps_in_hours', round($totalTimeInLearningPaths / 3600, 1));

$layoutContent = $tplContent->get_template('gradebook/custom_certificate.tpl');
$content = $tplContent->fetch($layoutContent);

Expand Down
12 changes: 7 additions & 5 deletions main/template/default/gradebook/custom_certificate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@
</ul>
{% endif %}
<br />
<h4 style="color: #672290; font-size: 16px;">{{ complete_name }}</h4>
<p style="color:#40ad49; font-size: 16px;">{{ 'SkillsValidated' | get_lang }}:</p>

{% if skills %}
<h4 style="color: #672290; font-size: 16px;">{{ complete_name }}</h4>
<p style="color:#40ad49; font-size: 16px;">{{ 'SkillsValidated' | get_lang }}:</p>
<ul style="color: #672290; font-size: 16px;">
{% for skill in skills %}
<li>{{ skill.name }}</li>
{% endfor %}
</ul>
<br />
{% endif %}

<p style="color:#40ad49; font-size: 16px;">Berlin/Paris, {{ 'The' | get_lang }} <span style="font-weight: bold; color: #672290;">{{ certificate_generated_date_no_time }}</span><br />
{{ 'ThePlatformTeam' | get_lang }}</p>
<br />
<p style="color:#40ad49; font-size: 16px;">Berlin/Paris, {{ 'The' | get_lang }} <span style="font-weight: bold; color: #672290;">{{ certificate_generated_date_no_time }}</span><br />
{{ 'ThePlatformTeam' | get_lang }}</p>
<br />
</td>
<td height=755 bgcolor="#92c647">
<img src="{{ _p.web_css_theme }}images/lado-b.png" style="display:block;">
Expand Down

0 comments on commit 76dd99d

Please sign in to comment.