pull/2525/head
Nosolored 8 years ago
parent f518a57e0a
commit ccd0f3c573
  1. 3
      main/gradebook/lib/fe/displaygradebook.php
  2. 16
      plugin/customcertificate/resources/js/certificate.js
  3. 13
      plugin/customcertificate/src/CustomCertificatePlugin.php
  4. 4
      plugin/customcertificate/src/index.php
  5. 2
      plugin/customcertificate/src/print_certificate.php

@ -471,7 +471,8 @@ class DisplayGradebook
$my_api_cidreq.'&origin=gradebook&selectcat='.$catobj->get_id().'">'.
Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
$actionsRight .= '<a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?curdirpath=/certificates&'.
$actionsRight .= '<a href="'.api_get_path(WEB_CODE_PATH).
'document/document.php?curdirpath=/certificates&'.
$my_api_cidreq.'&origin=gradebook&selectcat='.$catobj->get_id().'">'.
Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM).'</a>';
}

@ -1,6 +1,6 @@
function dateCertificateSwitchRadioButton2(){
$("#date_start").prop("disabled", true).val('');
$("#date_end").prop("disabled", true).val('');
$("#date_start").prop("disabled", true).val("");
$("#date_end").prop("disabled", true).val("");
}
function dateCertificateSwitchRadioButton1(){
@ -14,21 +14,21 @@ function dateCertificateSwitchRadioButton0(){
}
function typeDateExpedictionSwitchRadioButton(){
$('[name="type_date_expediction"]').each(function( index ) {
if ( $(this).is(':checked') && $(this).val() == "2") {
$("[name=\"type_date_expediction\"]").each(function( index ) {
if ( $(this).is(":checked") && $(this).val() === "2") {
$("#day, #month, #year").prop("disabled", false);
} else {
$("#day, #month, #year").prop('disabled', true);
$("#day, #month, #year").prop("disabled", true);
}
});
}
function contentsTypeSwitchRadioButton(){
$('[name="contents_type"]').each(function( index ) {
if ( $(this).is(':checked') && $(this).val() == "2") {
$("[name=\"contents_type\"]").each(function( index ) {
if ( $(this).is(':checked') && $(this).val() === "2") {
$("#contents").prop("disabled", false);
} else {
$("#contents").prop('disabled', true);
$("#contents").prop("disabled", true);
}
});
}

@ -225,7 +225,15 @@ class CustomCertificatePlugin extends Plugin
return [];
}
/**
* Check if it redirects.
*
* @param certificate $certificate
* @param int $id
*
* @return array
*/
public function redirectCheck($certificate, $certId)
{
$certId = (int) $certId;
@ -247,13 +255,12 @@ class CustomCertificatePlugin extends Plugin
$extraFieldValue->saveFieldValues($params);
}
}
$url = api_get_path(WEB_PLUGIN_PATH).'customcertificate/src/print_certificate.php'.
'?student_id='.$infoCertificate['user_id'].
'&course_code='.$infoCertificate['course_code'].
'&session_id='.$infoCertificate['session_id'];
header('Location: '.$url);
exit;
}
}
}

@ -929,5 +929,5 @@ function checkInstanceImage($certificateId, $imagePath, $field, $path) {
@unlink($path.$imagePath);
}
$sql = "UPDATE $table SET $field = '' WHERE id = $certificateId";
$rs = Database::query($sql);
}
Database::query($sql);
}

@ -6,7 +6,7 @@ use Chamilo\CourseBundle\Entity\CLpCategory;
if (intval($_GET['default']) == 1) {
$cidReset = true;
}
$course_plugin = 'customcertificate';
require_once __DIR__.'/../config.php';

Loading…
Cancel
Save