Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugin/customcertificate/lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
$strings['DateExpediction'] = "Expediction date";
$strings['UseDateEndAccessSession'] = "Use end date of session access";
$strings['UseDateDownloadCertificate'] = "Use certificate download date";
$strings['UseDateGenerationCertificate'] = "Use certificate generation date";
$strings['UseCustomDate'] = "Use custom date";
$strings['LogosSeal'] = "Logos / Seals";
$strings['LogoLeft'] = "Logo left";
Expand Down
1 change: 1 addition & 0 deletions plugin/customcertificate/lang/spanish.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
$strings['DateExpediction'] = "Fecha expedición";
$strings['UseDateEndAccessSession'] = "Usar fecha fin de acceso de la sesión";
$strings['UseDateDownloadCertificate'] = "Usar fecha de descarga del certificado";
$strings['UseDateGenerationCertificate'] = "Usar fecha de generación del certificado";
$strings['UseCustomDate'] = "Usar fechas personalizadas";
$strings['LogosSeal'] = "Logos / Sellos";
$strings['LogoLeft'] = "Logo izquierda";
Expand Down
29 changes: 21 additions & 8 deletions plugin/customcertificate/src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class="form-control-cert text-center datepicker"
);

$group = [];
$option1 = &$form->createElement(
$option = &$form->createElement(
'radio',
'type_date_expediction',
'',
Expand All @@ -466,9 +466,9 @@ class="form-control-cert text-center datepicker"
(($sessionId == 0) ? 'disabled' : ''),
]
);
$group[] = $option1;
$group[] = $option;

$option2 = &$form->createElement(
$option = &$form->createElement(
'radio',
'type_date_expediction',
'',
Expand All @@ -479,9 +479,22 @@ class="form-control-cert text-center datepicker"
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option2;
$group[] = $option;

$option = &$form->createElement(
'radio',
'type_date_expediction',
'',
get_lang('UseDateGenerationCertificate'),
4,
[
'id' => 'type_date_expediction_4',
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option;

$option4 = &$form->createElement(
$option = &$form->createElement(
'radio',
'type_date_expediction',
'',
Expand All @@ -492,9 +505,9 @@ class="form-control-cert text-center datepicker"
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option4;
$group[] = $option;

$option3 = &$form->createElement(
$option = &$form->createElement(
'radio',
'type_date_expediction',
'',
Expand All @@ -505,7 +518,7 @@ class="form-control-cert text-center datepicker"
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option3;
$group[] = $option;

$form->addGroup(
$group,
Expand Down
14 changes: 8 additions & 6 deletions plugin/customcertificate/src/print_certificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ class = "caraA"
$htmlText .= '</tr>';
$htmlText .= '</table>';

$all_user_info = DocumentManager::get_all_info_to_certificate(
$allUserInfo = DocumentManager::get_all_info_to_certificate(
$studentId,
$courseCode,
true
false
);

$myContentHtml = $infoCertificate['content_course'];
$myContentHtml = str_replace(chr(13).chr(10).chr(13).chr(10), chr(13).chr(10), $myContentHtml);
$info_to_be_replaced_in_content_html = $all_user_info[0];
$info_to_replace_in_content_html = $all_user_info[1];
$infoToBeReplacedInContentHtml = $allUserInfo[0];
$infoToReplaceInContentHtml = $allUserInfo[1];
$myContentHtml = str_replace(
$info_to_be_replaced_in_content_html,
$info_to_replace_in_content_html,
$infoToBeReplacedInContentHtml,
$infoToReplaceInContentHtml,
$myContentHtml
);

Expand Down Expand Up @@ -253,6 +253,8 @@ class = "caraA"
'............'
);
}
} elseif ($infoCertificate['type_date_expediction'] == 4) {
$dateExpediction .= $plugin->get_lang('to').$infoToReplaceInContentHtml[9]; //date_certificate_no_time
} else {
if (!empty($sessionInfo)) {
$dateInfo = api_get_local_time($sessionInfo['access_end_date']);
Expand Down