Minor - partial merge with 1.11.x

pull/2487/merge
Julio Montoya 6 years ago
parent 042b3e2793
commit f96d30f89a
  1. 86
      main/cron/request_removal_reminder.php
  2. 11
      main/inc/lib/javascript/iframe-js-loader.js
  3. BIN
      plugin/bbb/resources/img/128/videoconference_flash.png
  4. BIN
      plugin/bbb/resources/img/128/videoconference_html5.png
  5. BIN
      plugin/bbb/resources/img/64/videoconference_flash.png
  6. BIN
      plugin/bbb/resources/img/64/videoconference_html5.png
  7. 282
      plugin/bbb/resources/img/svg/videoconference_flash.svg
  8. 327
      plugin/bbb/resources/img/svg/videoconference_html5.svg
  9. 48
      plugin/bbb/view/admin.tpl
  10. 176
      plugin/bbb/view/listing.tpl
  11. 26
      plugin/customcertificate/README.md
  12. 10
      plugin/customcertificate/config.php
  13. 68
      plugin/customcertificate/database.php
  14. 3
      plugin/customcertificate/index.php
  15. 15
      plugin/customcertificate/install.php
  16. 72
      plugin/customcertificate/lang/english.php
  17. 74
      plugin/customcertificate/lang/spanish.php
  18. 16
      plugin/customcertificate/plugin.php
  19. 11
      plugin/customcertificate/resources/css/certificate.css
  20. 18
      plugin/customcertificate/resources/css/form.css
  21. BIN
      plugin/customcertificate/resources/img/22/customcertificate.png
  22. BIN
      plugin/customcertificate/resources/img/64/customcertificate.png
  23. BIN
      plugin/customcertificate/resources/img/64/customcertificate_na.png
  24. 38
      plugin/customcertificate/resources/js/certificate.js
  25. 281
      plugin/customcertificate/src/CustomCertificatePlugin.php
  26. 951
      plugin/customcertificate/src/index.php
  27. 497
      plugin/customcertificate/src/print_certificate.php
  28. 34
      plugin/customcertificate/start.php
  29. 12
      plugin/customcertificate/uninstall.php
  30. 14
      plugin/customcertificate/update.php
  31. 1161
      plugin/learning_calendar/LearningCalendarPlugin.php
  32. 2
      plugin/learning_calendar/README.md
  33. 43
      plugin/learning_calendar/ajax.php
  34. 50
      plugin/learning_calendar/calendar.php
  35. 108
      plugin/learning_calendar/calendar_users.php
  36. 8
      plugin/learning_calendar/install.php
  37. 22
      plugin/learning_calendar/lang/english.php
  38. 14
      plugin/learning_calendar/lang/french.php
  39. 7
      plugin/learning_calendar/lang/spanish.php
  40. 4
      plugin/learning_calendar/plugin.php
  41. 191
      plugin/learning_calendar/start.php
  42. 4
      plugin/learning_calendar/uninstall.php
  43. 102
      plugin/learning_calendar/view/calendar.tpl
  44. 3
      plugin/learning_calendar/view/start.tpl

@ -0,0 +1,86 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php';
if (PHP_SAPI != 'cli') {
exit('Run this script through the command line or comment this line in the code');
}
$urlList = UrlManager::get_url_data();
$defaultSenderId = 1;
// Loop all portals
foreach ($urlList as $url) {
// Set access_url in order to get the correct url links and admins
$_configuration['access_url'] = $url['id'];
$sql = '';
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
$sql .= "SELECT u.id, v.updated_at FROM $user_table u";
// adding the filter to see the user's only of the current access_url
if (api_get_multiple_access_url()) {
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql .= " INNER JOIN $access_url_rel_user_table url_rel_user
ON (u.id = url_rel_user.user_id)";
}
$extraFields = UserManager::createDataPrivacyExtraFields();
$extraFieldId = $extraFields['delete_legal'];
$extraFieldIdDeleteAccount = $extraFields['delete_account_extra_field'];
$extraFieldValue = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$sql .= " INNER JOIN $extraFieldValue v
ON (
u.id = v.item_id AND
(field_id = $extraFieldId OR field_id = $extraFieldIdDeleteAccount) AND
v.value = 1
) ";
$sql .= " WHERE 1 = 1 ";
if (api_get_multiple_access_url()) {
$sql .= " AND url_rel_user.access_url_id = ".api_get_current_access_url_id();
}
$numberOfDays = 7;
$date = new DateTime();
$date->sub(new \DateInterval('P'.$numberOfDays.'D'));
$dateToString = $date->format('Y-m-d h:i:s');
$sql .= " AND v.updated_at < '$dateToString'";
$url = api_get_path(WEB_CODE_PATH).'admin/user_list_consent.php';
$link = Display::url($url, $url);
$subject = get_lang('UserRequestWaitingForAction');
$email = api_get_configuration_value('data_protection_officer_email');
$message = 'Checking requests from '.strip_tags(Display::dateToStringAgoAndLongDate($dateToString))."\n";
$result = Database::query($sql);
while ($user = Database::fetch_array($result, 'ASSOC')) {
$userId = $user['id'];
$userInfo = api_get_user_info($userId);
if ($userInfo) {
$content = sprintf(
get_lang('TheUserXIsWaitingForAnActionGoHereX'),
$userInfo['complete_name'],
$link
);
if (!empty($email)) {
api_mail_html('', $email, $subject, $content);
} else {
MessageManager::sendMessageToAllAdminUsers($defaultSenderId, $subject, $content);
}
$date = strip_tags(Display::dateToStringAgoAndLongDate($user['updated_at']));
$message .= "User ".$userInfo['complete_name_with_username']." is waiting for an action since $date \n";
}
}
echo $message;
}

@ -0,0 +1,11 @@
$(document).ready(function() {
//get the path to mediaelement plugins
var scripts = document.getElementsByTagName('script');
var scriptPath = scripts[scripts.length-1].src;
var basePath = scriptPath.substring(0, scriptPath.indexOf('/main/')+1) + 'web/assets/mediaelement/build/';
$('video:not(.skip), audio:not(.skip)').mediaelementplayer({
pluginPath: basePath,
shimScriptAccess: 'always'
// more configuration
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -0,0 +1,282 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (unknown)"
sodipodi:docname="videoconference_flash.svg">
<defs
id="defs2">
<linearGradient
inkscape:collect="always"
id="linearGradient1680">
<stop
style="stop-color:#ffe88e;stop-opacity:1;"
offset="0"
id="stop1676" />
<stop
style="stop-color:#ffe88e;stop-opacity:0;"
offset="1"
id="stop1678" />
</linearGradient>
<linearGradient
id="linearGradient1668"
inkscape:collect="always">
<stop
id="stop1664"
offset="0"
style="stop-color:#ad0000;stop-opacity:1" />
<stop
id="stop1666"
offset="1"
style="stop-color:#f03737;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2460">
<stop
style="stop-color:#bb0000;stop-opacity:1"
offset="0"
id="stop2456" />
<stop
style="stop-color:#ec3232;stop-opacity:1"
offset="1"
id="stop2458" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1668"
id="linearGradient2462"
x1="16.727715"
y1="284.77112"
x2="16.727715"
y2="266.64716"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2460"
id="linearGradient2470"
x1="28.580872"
y1="287.96329"
x2="28.580872"
y2="277.84299"
gradientUnits="userSpaceOnUse" />
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter2519"
x="-0.020552492"
width="1.041105"
y="-0.0289836"
height="1.0579672">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.25927001"
id="feGaussianBlur2521" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1680"
id="linearGradient1682"
x1="-0.63847286"
y1="271.38345"
x2="7.0625629"
y2="283.27271"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="137.28651"
inkscape:cy="31.290536"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<rect
style="opacity:0;fill:#abfaff;fill-opacity:1;stroke:none;stroke-width:0.71147865;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect2553"
width="33.866665"
height="33.866665"
x="3.1582752e-09"
y="263.13333"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/64/videoconference_flash.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48" />
<g
id="g1984"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/64/videoconference_flash.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48">
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
style="opacity:0.5;fill:#333333;filter:url(#filter2519)"
transform="matrix(1.033576,0,0,1.0310555,-0.27797462,-8.5225467)"
id="g2489">
<path
inkscape:connector-curvature="0"
id="path2485"
d="m 25.935038,279.09892 5.855173,-3.90345 v 15.61379 l -5.855173,-3.90345 z"
style="fill:#333333;fill-opacity:1;stroke-width:0.97586221" />
<path
inkscape:connector-curvature="0"
id="path2487"
d="m 24.934867,279.09892 v 7.80689 c 0,2.15568 -1.747769,3.90345 -3.903449,3.90345 H 5.4176225 c -2.1556796,0 -3.9034489,-1.74777 -3.9034489,-3.90345 v -7.80689 c 0,-2.15568 1.7477693,-3.90345 3.9034489,-3.90345 h 9.7586225 c 0,-1.07833 0.873397,-1.95173 1.951724,-1.95173 v -1.95172 H 6.3934848 c -0.5396519,0 -0.9758623,-0.43621 -0.9758623,-0.97586 0,-0.53966 0.4362104,-0.97587 0.9758623,-0.97587 H 18.103832 c 0.539651,0 0.975862,0.43621 0.975862,0.97587 v 2.92758 c 1.078328,0 1.951724,0.8734 1.951724,1.95173 2.15568,0 3.903449,1.74777 3.903449,3.90345 z"
style="fill:#333333;fill-opacity:1;stroke-width:0.97586221" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
transform="matrix(1.033576,0,0,1.033576,-0.51968757,-9.9364024)"
id="g2477">
<path
style="fill:url(#linearGradient2470);fill-opacity:1;stroke-width:0.97586221"
d="m 25.935038,279.09892 5.855173,-3.90345 v 15.61379 l -5.855173,-3.90345 z"
id="path2263"
inkscape:connector-curvature="0" />
<path
style="fill:url(#linearGradient2462);fill-opacity:1;stroke-width:0.97586221"
d="m 24.934867,279.09892 v 7.80689 c 0,2.15568 -1.747769,3.90345 -3.903449,3.90345 H 5.4176225 c -2.1556796,0 -3.9034489,-1.74777 -3.9034489,-3.90345 v -7.80689 c 0,-2.15568 1.7477693,-3.90345 3.9034489,-3.90345 h 9.7586225 c 0,-1.07833 0.873397,-1.95173 1.951724,-1.95173 v -1.95172 H 6.3934848 c -0.5396519,0 -0.9758623,-0.43621 -0.9758623,-0.97586 0,-0.53966 0.4362104,-0.97587 0.9758623,-0.97587 H 18.103832 c 0.539651,0 0.975862,0.43621 0.975862,0.97587 v 2.92758 c 1.078328,0 1.951724,0.8734 1.951724,1.95173 2.15568,0 3.903449,1.74777 3.903449,3.90345 z"
id="path2261"
inkscape:connector-curvature="0" />
</g>
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
sodipodi:nodetypes="csscc"
inkscape:connector-curvature="0"
style="opacity:0.7;fill:#9c1300;fill-opacity:1;stroke-width:1.00862777"
d="m 25.252393,278.53354 v 8.06902 c 0,2.22806 -1.806453,4.03451 -4.034512,4.03451 H 5.079837 c 11.391015,-1.7019 17.402266,-2.12976 20.172556,-12.10353 z"
id="path2356" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
inkscape:connector-curvature="0"
style="fill:#ab0a01;fill-opacity:1;stroke-width:1.00862777"
d="m 21.389761,279.89888 c 0,-0.55777 -0.450856,-1.00863 -1.008628,-1.00863 h -4.034511 c -0.557771,0 -1.008627,0.45086 -1.008627,1.00863 0,0.55777 0.450856,1.00862 1.008627,1.00862 h 4.034511 c 0.557772,0 1.008628,-0.45085 1.008628,-1.00862 z"
id="path2434" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
id="path2207"
d="m 21.217881,279.54217 c 0,-0.55777 -0.450856,-1.00863 -1.008627,-1.00863 h -4.034511 c -0.557772,0 -1.008628,0.45086 -1.008628,1.00863 0,0.55777 0.450856,1.00862 1.008628,1.00862 h 4.034511 c 0.557771,0 1.008627,-0.45085 1.008627,-1.00862 z"
style="fill:#ffffff;stroke-width:1.00862777"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path2430"
d="m 26.291487,284.38104 6.050875,3.79017 8.96e-4,2.468 -6.051766,-4.03451 z"
style="opacity:0.7;fill:#a20d00;fill-opacity:1;stroke:none;stroke-width:0.27346697px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
sodipodi:nodetypes="ccsc"
inkscape:connector-curvature="0"
id="path2432"
d="m 16.141917,274.71969 h 4.20274 c 0.0129,-0.99533 -1.095516,-1.3931 -2.138799,-1.39021 -1.40938,0.004 -2.038277,0.59352 -2.063941,1.39021 z"
style="opacity:0.6;fill:#ac0b02;fill-opacity:1;stroke:none;stroke-width:0.24197747px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
inkscape:connector-curvature="0"
id="rect2451"
d="m 5.2273919,269.72519 c 0.2058204,0.52195 0.5953864,0.73877 0.8213089,0.73877 H 17.426583 v -0.73877 z"
style="opacity:0.6;fill:#ad0c03;fill-opacity:1;stroke:none;stroke-width:1.04796004;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
inkscape:connector-curvature="0"
id="path2479"
d="m 32.611328,273.98828 -6.599609,4.39844 v 0.14648 8.21485 l 6.599609,4.40039 z m -0.546875,1.02149 v 15.11718 l -5.503906,-3.66992 v -7.77734 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#9c1300;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.54693401;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
id="path1674"
d="m 1.0453253,286.60256 v -8.06902 c 0,-2.22806 1.806453,-4.03451 4.034512,-4.03451 H 21.217881 c -11.3910147,1.7019 -17.4022657,2.12976 -20.1725557,12.10353 z"
style="opacity:0.5;fill:url(#linearGradient1682);fill-opacity:1;stroke-width:1.00862777"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csscc" />
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
inkscape:connector-curvature="0"
id="path2481"
d="m 6.0878906,268.17383 c -0.7051347,0 -1.28125,0.5761 -1.28125,1.28125 0,0.70513 0.5761121,1.2832 1.28125,1.2832 H 16.910156 v 1.58399 c -1.010704,0.1395 -1.761677,0.89199 -1.902344,1.90234 H 5.0800781 c -2.3758718,0 -4.30859372,1.93272 -4.30859372,4.30859 v 8.07032 c 0,2.37587 1.93272192,4.30664 4.30859372,4.30664 H 21.21875 c 2.375872,0 4.306641,-1.93077 4.306641,-4.30664 v -8.07032 c 0,-2.3142 -1.842033,-4.17671 -4.132813,-4.27343 -0.124647,-1.02913 -0.894024,-1.79603 -1.917969,-1.9375 v -2.86719 c 0,-0.70515 -0.578069,-1.28125 -1.283203,-1.28125 z m 0,0.54687 H 18.191406 c 0.410407,0 0.736328,0.32396 0.736328,0.73438 v 3.30078 h 0.273438 c 0.96687,0 1.74414,0.77726 1.74414,1.74414 v 0.27344 h 0.273438 c 2.080246,0 3.759766,1.67952 3.759766,3.75976 v 8.07032 c 0,2.08024 -1.67952,3.75976 -3.759766,3.75976 H 5.0800781 c -2.0802456,0 -3.7617187,-1.67952 -3.7617187,-3.75976 v -8.07032 c 0,-2.08024 1.6814731,-3.75976 3.7617187,-3.75976 H 15.439453 V 274.5 c 0,-0.96688 0.777271,-1.74414 1.744141,-1.74414 h 0.273437 v -2.56445 H 6.0878906 c -0.4104046,0 -0.734375,-0.32593 -0.734375,-0.73633 0,-0.41042 0.3239671,-0.73438 0.734375,-0.73438 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#9c1300;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.54693401;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_flash.png"
transform="matrix(0.03254278,0,0,0.03254278,-6.6373643e-5,274.37654)"
style="enable-background:new"
id="形状_1_2_">
<g
id="形状_1_1_">
<g
id="g1935">
<path
id="path1933"
style="clip-rule:evenodd;fill:#ffffff;fill-rule:evenodd"
d="M 360.478,162.082 V 115.396 C 208.547,119.891 254.603,335.028 144.275,340.232 v 46.685 c 72.696,-2.188 101.252,-54.152 124.335,-112.438 h 63.695 v -46.642 h -46.02 c 16.378,-33.651 30.595,-63.699 74.193,-65.755 z"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (unknown)"
sodipodi:docname="videoconference_html5.svg">
<defs
id="defs2">
<linearGradient
inkscape:collect="always"
id="linearGradient1680">
<stop
style="stop-color:#ffe88e;stop-opacity:1;"
offset="0"
id="stop1676" />
<stop
style="stop-color:#ffe88e;stop-opacity:0;"
offset="1"
id="stop1678" />
</linearGradient>
<linearGradient
id="linearGradient1668"
inkscape:collect="always">
<stop
id="stop1664"
offset="0"
style="stop-color:#f16529;stop-opacity:1;" />
<stop
id="stop1666"
offset="1"
style="stop-color:#ff9f00;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2460">
<stop
style="stop-color:#f16529;stop-opacity:1;"
offset="0"
id="stop2456" />
<stop
style="stop-color:#ff9e00;stop-opacity:1"
offset="1"
id="stop2458" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1668"
id="linearGradient2462"
x1="16.727715"
y1="284.77112"
x2="16.727715"
y2="266.64716"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2460"
id="linearGradient2470"
x1="28.580872"
y1="287.96329"
x2="28.580872"
y2="277.84299"
gradientUnits="userSpaceOnUse" />
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter2519"
x="-0.020552492"
width="1.041105"
y="-0.0289836"
height="1.0579672">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.25927001"
id="feGaussianBlur2521" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1680"
id="linearGradient1682"
x1="-0.63847286"
y1="271.38345"
x2="7.0625629"
y2="283.27271"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="301.31637"
inkscape:cy="27.83582"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<rect
style="opacity:0;fill:#abfaff;fill-opacity:1;stroke:none;stroke-width:0.71147865;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect2553"
width="33.866665"
height="33.866665"
x="3.8077737e-09"
y="263.13333"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<g
id="g2489"
transform="matrix(1.033576,0,0,1.0310555,-0.27797462,-8.5225467)"
style="opacity:0.5;fill:#333333;filter:url(#filter2519)"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<path
style="fill:#333333;fill-opacity:1;stroke-width:0.97586221"
d="m 25.935038,279.09892 5.855173,-3.90345 v 15.61379 l -5.855173,-3.90345 z"
id="path2485"
inkscape:connector-curvature="0" />
<path
style="fill:#333333;fill-opacity:1;stroke-width:0.97586221"
d="m 24.934867,279.09892 v 7.80689 c 0,2.15568 -1.747769,3.90345 -3.903449,3.90345 H 5.4176225 c -2.1556796,0 -3.9034489,-1.74777 -3.9034489,-3.90345 v -7.80689 c 0,-2.15568 1.7477693,-3.90345 3.9034489,-3.90345 h 9.7586225 c 0,-1.07833 0.873397,-1.95173 1.951724,-1.95173 v -1.95172 H 6.3934848 c -0.5396519,0 -0.9758623,-0.43621 -0.9758623,-0.97586 0,-0.53966 0.4362104,-0.97587 0.9758623,-0.97587 H 18.103832 c 0.539651,0 0.975862,0.43621 0.975862,0.97587 v 2.92758 c 1.078328,0 1.951724,0.8734 1.951724,1.95173 2.15568,0 3.903449,1.74777 3.903449,3.90345 z"
id="path2487"
inkscape:connector-curvature="0" />
</g>
<g
id="g2477"
transform="matrix(1.033576,0,0,1.033576,-0.51968757,-9.9364024)"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<path
inkscape:connector-curvature="0"
id="path2263"
d="m 25.935038,279.09892 5.855173,-3.90345 v 15.61379 l -5.855173,-3.90345 z"
style="fill:url(#linearGradient2470);fill-opacity:1;stroke-width:0.97586221" />
<path
inkscape:connector-curvature="0"
id="path2261"
d="m 24.934867,279.09892 v 7.80689 c 0,2.15568 -1.747769,3.90345 -3.903449,3.90345 H 5.4176225 c -2.1556796,0 -3.9034489,-1.74777 -3.9034489,-3.90345 v -7.80689 c 0,-2.15568 1.7477693,-3.90345 3.9034489,-3.90345 h 9.7586225 c 0,-1.07833 0.873397,-1.95173 1.951724,-1.95173 v -1.95172 H 6.3934848 c -0.5396519,0 -0.9758623,-0.43621 -0.9758623,-0.97586 0,-0.53966 0.4362104,-0.97587 0.9758623,-0.97587 H 18.103832 c 0.539651,0 0.975862,0.43621 0.975862,0.97587 v 2.92758 c 1.078328,0 1.951724,0.8734 1.951724,1.95173 2.15568,0 3.903449,1.74777 3.903449,3.90345 z"
style="fill:url(#linearGradient2462);fill-opacity:1;stroke-width:0.97586221" />
</g>
<path
id="path2356"
d="m 25.252393,278.53354 v 8.06902 c 0,2.22806 -1.806453,4.03451 -4.034512,4.03451 H 5.079837 c 11.391015,-1.7019 17.402266,-2.12976 20.172556,-12.10353 z"
style="opacity:0.7;fill:#e44d26;fill-opacity:1;stroke-width:1.00862777"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csscc"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
id="path2434"
d="m 21.389761,279.89888 c 0,-0.55777 -0.450856,-1.00863 -1.008628,-1.00863 h -4.034511 c -0.557771,0 -1.008627,0.45086 -1.008627,1.00863 0,0.55777 0.450856,1.00862 1.008627,1.00862 h 4.034511 c 0.557772,0 1.008628,-0.45085 1.008628,-1.00862 z"
style="fill:#cf411b;fill-opacity:1;stroke-width:1.00862777"
inkscape:connector-curvature="0"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
inkscape:connector-curvature="0"
style="fill:#ffffff;stroke-width:1.00862777"
d="m 21.217881,279.54217 c 0,-0.55777 -0.450856,-1.00863 -1.008627,-1.00863 h -4.034511 c -0.557772,0 -1.008628,0.45086 -1.008628,1.00863 0,0.55777 0.450856,1.00862 1.008628,1.00862 h 4.034511 c 0.557771,0 1.008627,-0.45085 1.008627,-1.00862 z"
id="path2207"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<g
id="g2402"
style="fill:#cf411b;fill-opacity:1"
transform="matrix(0.98483395,0,0,0.98483395,13.502964,4.0896839)"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<polygon
style="fill:#cf411b;fill-opacity:1"
points="354.668,398.63 376.684,152.138 135.317,152.138 157.294,398.619 255.94,426 "
id="polygon2377"
transform="matrix(0.03238923,0,0,0.03238923,-13.225862,275.14988)" />
<polygon
style="fill:#cf411b;fill-opacity:1"
points="172.827,101.188 172.827,86 157.462,86 157.462,131.97 172.827,131.97 172.827,116.572 186.877,116.572 186.877,131.97 202.254,131.97 202.254,86 186.877,86 186.877,101.188 "
id="polygon2379"
transform="matrix(0.03238923,0,0,0.03238923,-13.225862,275.14988)" />
<polygon
style="fill:#cf411b;fill-opacity:1"
points="251.334,101.249 251.334,86 208.934,86 208.934,101.249 222.448,101.249 222.448,131.97 237.819,131.97 237.819,101.249 "
id="polygon2381"
transform="matrix(0.03238923,0,0,0.03238923,-13.225862,275.14988)" />
<polygon
style="fill:#cf411b;fill-opacity:1"
points="294.514,131.97 309.823,131.97 309.823,86 293.793,86 283.944,102.177 274.096,86 258.081,86 258.081,131.97 273.105,131.97 273.105,109.195 283.688,125.528 283.944,125.528 294.514,109.195 "
id="polygon2383"
transform="matrix(0.03238923,0,0,0.03238923,-13.225862,275.14988)" />
<polygon
style="fill:#cf411b;fill-opacity:1"
points="332.829,116.782 332.829,86 317.463,86 317.463,131.97 354.437,131.97 354.437,116.782 "
id="polygon2385"
transform="matrix(0.03238923,0,0,0.03238923,-13.225862,275.14988)" />
</g>
<g
id="g2354"
transform="matrix(0.45852162,0,0,0.45852162,22.902026,168.84098)"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<polygon
transform="matrix(0.06956708,0,0,0.06956708,-49.576762,231.22172)"
id="polygon2309"
points="135.317,152.138 157.294,398.619 255.94,426 354.668,398.63 376.684,152.138 "
style="fill:#ffffff" />
<polygon
transform="matrix(0.06956708,0,0,0.06956708,-49.576762,231.22172)"
id="polygon2311"
points="172.827,131.97 172.827,116.572 186.877,116.572 186.877,131.97 202.254,131.97 202.254,86 186.877,86 186.877,101.188 172.827,101.188 172.827,86 157.462,86 157.462,131.97 "
style="fill:#ffffff" />
<polygon
transform="matrix(0.06956708,0,0,0.06956708,-49.576762,231.22172)"
id="polygon2313"
points="251.334,101.249 251.334,86 208.934,86 208.934,101.249 222.448,101.249 222.448,131.97 237.819,131.97 237.819,101.249 "
style="fill:#ffffff" />
<polygon
transform="matrix(0.06956708,0,0,0.06956708,-49.576762,231.22172)"
id="polygon2315"
points="274.096,86 258.081,86 258.081,131.97 273.105,131.97 273.105,109.195 283.688,125.528 283.944,125.528 294.514,109.195 294.514,131.97 309.823,131.97 309.823,86 293.793,86 283.944,102.177 "
style="fill:#ffffff" />
<polygon
transform="matrix(0.06956708,0,0,0.06956708,-49.576762,231.22172)"
id="polygon2317"
points="354.437,131.97 354.437,116.782 332.829,116.782 332.829,86 317.463,86 317.463,131.97 "
style="fill:#ffffff" />
<polygon
transform="matrix(0.06956708,0,0,0.06956708,-49.576762,231.22172)"
id="polygon2319"
points="220.043,307.984 222.292,333.174 255.96,342.271 256.009,342.258 289.709,333.16 293.22,293.949 256.009,293.949 188.448,293.949 180.285,202.532 256.001,202.532 331.703,202.532 329.009,232.743 256.001,232.743 213.323,232.743 216.081,263.702 256.001,263.702 326.263,263.702 317.973,356.543 256.001,373.709 255.953,373.723 194.022,356.543 189.702,307.984 "
style="fill:#f16629;fill-opacity:1" />
</g>
<path
style="opacity:0.7;fill:#e44d26;fill-opacity:1;stroke:none;stroke-width:0.27346697px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 26.291487,284.38104 6.050875,3.79017 8.96e-4,2.468 -6.051766,-4.03451 z"
id="path2430"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="opacity:0.6;fill:#f14329;fill-opacity:1;stroke:none;stroke-width:0.24197747px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 16.141917,274.71969 h 4.20274 c 0.0129,-0.99533 -1.095516,-1.3931 -2.138799,-1.39021 -1.40938,0.004 -2.038277,0.59352 -2.063941,1.39021 z"
id="path2432"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccsc"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="opacity:0.6;fill:#f14329;fill-opacity:1;stroke:none;stroke-width:1.04796004;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 5.2273919,269.72519 c 0.2058204,0.52195 0.5953864,0.73877 0.8213089,0.73877 H 17.426583 v -0.73877 z"
id="rect2451"
inkscape:connector-curvature="0"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e36e00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.54693401;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 32.611328,273.98828 -6.599609,4.39844 v 0.14648 8.21485 l 6.599609,4.40039 z m -0.546875,1.02149 v 15.11718 l -5.503906,-3.66992 v -7.77734 z"
id="path2479"
inkscape:connector-curvature="0"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
sodipodi:nodetypes="csscc"
inkscape:connector-curvature="0"
style="opacity:0.5;fill:url(#linearGradient1682);fill-opacity:1;stroke-width:1.00862777"
d="m 1.0453253,286.60256 v -8.06902 c 0,-2.22806 1.806453,-4.03451 4.034512,-4.03451 H 21.217881 c -11.3910147,1.7019 -17.4022657,2.12976 -20.1725557,12.10353 z"
id="path1674"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e36e00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.54693401;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 6.0878906,268.17383 c -0.7051347,0 -1.28125,0.5761 -1.28125,1.28125 0,0.70513 0.5761121,1.2832 1.28125,1.2832 H 16.910156 v 1.58399 c -1.010704,0.1395 -1.761677,0.89199 -1.902344,1.90234 H 5.0800781 c -2.3758718,0 -4.30859372,1.93272 -4.30859372,4.30859 v 8.07032 c 0,2.37587 1.93272192,4.30664 4.30859372,4.30664 H 21.21875 c 2.375872,0 4.306641,-1.93077 4.306641,-4.30664 v -8.07032 c 0,-2.3142 -1.842033,-4.17671 -4.132813,-4.27343 -0.124647,-1.02913 -0.894024,-1.79603 -1.917969,-1.9375 v -2.86719 c 0,-0.70515 -0.578069,-1.28125 -1.283203,-1.28125 z m 0,0.54687 H 18.191406 c 0.410407,0 0.736328,0.32396 0.736328,0.73438 v 3.30078 h 0.273438 c 0.96687,0 1.74414,0.77726 1.74414,1.74414 v 0.27344 h 0.273438 c 2.080246,0 3.759766,1.67952 3.759766,3.75976 v 8.07032 c 0,2.08024 -1.67952,3.75976 -3.759766,3.75976 H 5.0800781 c -2.0802456,0 -3.7617187,-1.67952 -3.7617187,-3.75976 v -8.07032 c 0,-2.08024 1.6814731,-3.75976 3.7617187,-3.75976 H 15.439453 V 274.5 c 0,-0.96688 0.777271,-1.74414 1.744141,-1.74414 h 0.273437 v -2.56445 H 6.0878906 c -0.4104046,0 -0.734375,-0.32593 -0.734375,-0.73633 0,-0.41042 0.3239671,-0.73438 0.734375,-0.73438 z"
id="path2481"
inkscape:connector-curvature="0"
inkscape:export-filename="/var/www/chamilo11/plugin/bbb/resources/img/128/videoconference_html5.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

@ -0,0 +1,48 @@
{{ search_form }}
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ 'CreatedAt'|get_lang }}</th>
<th>{{ 'Status'|get_lang }}</th>
<th>{{ 'Records'|get_plugin_lang('BBBPlugin') }}</th>
<th>{{ 'Course'|get_lang }}</th>
<th>{{ 'Session'|get_lang }}</th>
<th>{{ 'Participants'|get_lang }}</th>
<th>{{ 'Actions'|get_lang }}</th>
</tr>
</thead>
<tbody>
{% for meeting in meetings %}
<tr id="meeting-{{ meeting.id }}">
{% if meeting.visibility == 0 %}
<td class="muted">{{ meeting.created_at }}</td>
{% else %}
<td>{{ meeting.created_at }}</td>
{% endif %}
<td>
{% if meeting.status == 1 %}
<span class="label label-success">{{ 'MeetingOpened'|get_plugin_lang('BBBPlugin') }}</span>
{% else %}
<span class="label label-info">{{ 'MeetingClosed'|get_plugin_lang('BBBPlugin') }}</span>
{% endif %}
</td>
<td>
{% if meeting.record == 1 %}
{# Record list #}
{{ meeting.show_links }}
{% else %}
{{ 'NoRecording'|get_plugin_lang('BBBPlugin') }}
{% endif %}
</td>
<td>{{ meeting.course ?: '-' }}</td>
<td>{{ meeting.session ?: '-' }}</td>
<td>
{{ meeting.participants ? meeting.participants|join('<br>') : '-' }}
</td>
<td>
{{ meeting.action_links }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

@ -0,0 +1,176 @@
<style type="text/css">
.conference .url{
padding: 5px;
margin-bottom: 5px;
}
.conference .share{
padding: 10px;
margin-top: 5px;
margin-bottom: 5px;
font-weight: bold;
}
</style>
<div class ="row">
{% if bbb_status == true %}
<div class ="col-md-12" style="text-align:center">
{{ form }}
{% if show_join_button == true %}
{% if show_client_options %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default conference">
<div class="panel-body">
<div class="url">
<a class="btn btn-default" href="{{ enter_conference_links.0.url }}">
<img src="{{ enter_conference_links.0.icon }}" /><br>
{{ enter_conference_links.0.text }}
</a>
</div>
<div class="share">
{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}
</div>
<div class="form-inline">
<div class="form-group">
<input id="share_button_flash" type="text"
style="width:300px"
class="form-control" readonly value="{{ conference_url }}&inteface=0">
<button onclick="copyTextToClipBoard('share_button_flash');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default conference">
<div class="panel-body">
<div class="url">
<a class="btn btn-default" href="{{ enter_conference_links.1.url }}">
<img src="{{ enter_conference_links.1.icon }}" /><br>
{{ enter_conference_links.1.text }}
</a>
</div>
<div class="share">
{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}
</div>
<div class="form-inline">
<div class="form-group">
<input id="share_button_html" type="text"
style="width:300px"
class="form-control" readonly value="{{ conference_url }}&inteface=1">
<button onclick="copyTextToClipBoard('share_button_html');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
{% else %}
{{ enter_conference_links.0 }}
<br />
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
<div class="well">
<div class="form-inline">
<div class="form-group">
<input id="share_button"
type="text"
style="width:600px"
class="form-control" readonly value="{{ conference_url }}">
<button onclick="copyTextToClipBoard('share_button');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
</div>
</div>
{% endif %}
<p>
<span id="users_online" class="label label-warning">
{{ 'XUsersOnLine'| get_plugin_lang('BBBPlugin') | format(users_online) }}
</span>
</p>
{{ warning_inteface_msg }}
{% if max_users_limit > 0 %}
{% if conference_manager == true %}
<p>{{ 'MaxXUsersWarning' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>
{% elseif users_online >= max_users_limit/2 %}
<p>{{ 'MaxXUsersWarning' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>
{% endif %}
{% endif %}
</div>
{% elseif max_users_limit > 0 %}
{% if conference_manager == true %}
<p>{{ 'MaxXUsersReachedManager' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>
{% elseif users_online > 0 %}
<p>{{ 'MaxXUsersReached' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>
{% endif %}
{% endif %}
</div>
<div class ="col-md-12">
<div class="page-header">
<h2>{{ 'RecordList'| get_plugin_lang('BBBPlugin') }}</h2>
</div>
<table class="table">
<tr>
<!-- th>#</th -->
<th>{{ 'CreatedAt'| get_plugin_lang('BBBPlugin') }}</th>
<th>{{ 'Status'| get_lang }}</th>
<th>{{ 'Records'| get_plugin_lang('BBBPlugin') }}</th>
{% if allow_to_edit %}
<th>{{ 'Actions'| get_lang }}</th>
{% endif %}
</tr>
{% for meeting in meetings %}
<tr>
<!-- td>{{ meeting.id }}</td -->
{% if meeting.visibility == 0 %}
<td class="muted">{{ meeting.created_at }}</td>
{% else %}
<td>{{ meeting.created_at }}</td>
{% endif %}
<td>
{% if meeting.status == 1 %}
<span class="label label-success">{{ 'MeetingOpened'|get_plugin_lang('BBBPlugin') }}</span>
{% else %}
<span class="label label-info">{{ 'MeetingClosed'|get_plugin_lang('BBBPlugin') }}</span>
{% endif %}
</td>
<td>
{% if meeting.record == 1 %}
{# Record list #}
{{ meeting.show_links }}
{% else %}
{{ 'NoRecording'|get_plugin_lang('BBBPlugin') }}
{% endif %}
</td>
{% if allow_to_edit %}
<td>
{% if meeting.status == 1 %}
<a class="btn btn-default" href="{{ meeting.end_url }} ">
{{ 'CloseMeeting'|get_plugin_lang('BBBPlugin') }}
</a>
{% else %}
{{ meeting.action_links }}
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
{% else %}
<div class ="col-md-12" style="text-align:center">
{{ 'ServerIsNotRunning' | get_plugin_lang('BBBPlugin') | return_message('warning') }}
</div>
{% endif %}
</div>

@ -0,0 +1,26 @@
CustomCertificate plugin
===============
Este plugin da la posibilidad al administrador de disponer de una herramienta de certificados alternativa
a la que tiene por defecto la plataforma Chamilo.
**Instrucciones de puesta en funcionamiento**
- Habilitar el plugin en la administraci&oacute;n de Chamilo.
- Indicar 'menu_administrator' en la configuración de la región del plugin.
**accesos a la herramienta**
- Desde la pantalla de Administración para configurar el certificado por defecto.
- Desde las herramientas del curso, para la configuración del diploma especifico.
**Importante a tener en cuenta**
Por defecto los certificados utilizados serán los de la plataforma chamilo. Para habilitar el certificado alternativo
en un curso se debe entrar en la configuración del curso y habilitar en la pestaña de "certificados personalizado" la
casilla de verificación de "Habilitar en el curso el certificado alternativo".
Si se desea usar el certificado por defecto se deberá mostrar la segunda casilla de verificación.
Credits
-------
Contributed by [Nosolored](https://www.nosolored.com/).

@ -0,0 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Config the plugin.
*
* @package chamilo.plugin.customcertificate
*
* @author Jose Angel Ruiz <desarrollo@nosolored.com>
*/
require_once __DIR__.'/../../main/inc/global.inc.php';

@ -0,0 +1,68 @@
<?php
/* For license terms, see /license.txt */
use Doctrine\DBAL\Types\Type;
/**
* Plugin database installation script. Can only be executed if included
* inside another script loading global.inc.php.
*
* @package chamilo.plugin.customcertificate
*/
/**
* Check if script can be called.
*/
if (!function_exists('api_get_path')) {
die('This script must be loaded through the Chamilo plugin installer sequence');
}
$entityManager = Database::getManager();
$pluginSchema = new \Doctrine\DBAL\Schema\Schema();
$connection = $entityManager->getConnection();
$platform = $connection->getDatabasePlatform();
if ($pluginSchema->hasTable(CustomCertificatePlugin::TABLE_CUSTOMCERTIFICATE)) {
return;
}
//Create tables
$certificateTable = $pluginSchema->createTable(CustomCertificatePlugin::TABLE_CUSTOMCERTIFICATE);
$certificateTable->addColumn('id', Type::INTEGER, ['autoincrement' => true, 'unsigned' => true]);
$certificateTable->addColumn('access_url_id', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('c_id', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('session_id', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('content_course', Type::TEXT);
$certificateTable->addColumn('contents_type', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('contents', Type::TEXT);
$certificateTable->addColumn('date_change', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('date_start', Type::DATETIME);
$certificateTable->addColumn('date_end', Type::DATETIME);
$certificateTable->addColumn('type_date_expediction', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('place', Type::STRING);
$certificateTable->addColumn('day', Type::STRING, ['notnull' => false]);
$certificateTable->addColumn('month', Type::STRING, ['notnull' => false]);
$certificateTable->addColumn('year', Type::STRING, ['notnull' => false]);
$certificateTable->addColumn('logo_left', Type::STRING);
$certificateTable->addColumn('logo_center', Type::STRING);
$certificateTable->addColumn('logo_right', Type::STRING);
$certificateTable->addColumn('seal', Type::STRING);
$certificateTable->addColumn('signature1', Type::STRING);
$certificateTable->addColumn('signature2', Type::STRING);
$certificateTable->addColumn('signature3', Type::STRING);
$certificateTable->addColumn('signature4', Type::STRING);
$certificateTable->addColumn('signature_text1', Type::STRING);
$certificateTable->addColumn('signature_text2', Type::STRING);
$certificateTable->addColumn('signature_text3', Type::STRING);
$certificateTable->addColumn('signature_text4', Type::STRING);
$certificateTable->addColumn('background', Type::STRING);
$certificateTable->addColumn('margin_left', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('margin_right', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addColumn('certificate_default', Type::INTEGER, ['unsigned' => true]);
$certificateTable->addIndex(['c_id', 'session_id']);
$certificateTable->setPrimaryKey(['id']);
$queries = $pluginSchema->toSql($platform);
foreach ($queries as $query) {
Database::query($query);
}

@ -0,0 +1,3 @@
<?php
/* For license terms, see /license.txt */
require_once 'config.php';

@ -0,0 +1,15 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table).
*
* @package chamilo.plugin.customcertificate
*/
require_once __DIR__.'/config.php';
if (!api_is_platform_admin()) {
die('You must have admin permissions to install plugins');
}
CustomCertificatePlugin::create()->install();

@ -0,0 +1,72 @@
<?php
$strings['plugin_title'] = "Custom certificate";
$strings['plugin_comment'] = "This plugin allows you to create custom certificates for each course.";
$strings['enable_plugin_customcertificate'] = "Enable plugin";
$strings['customcertificate_course_enable'] = "Custom certificate enable in course";
$strings['use_certificate_default'] = "Use default custom certificate";
$strings['ToolDisabled'] = "The tool is disabled from the administration";
$strings['OnlyAdminPlatform'] = "Tool only for administrators";
$strings['OnlyAdminPlatformOrTeacher'] = "Tool only for administrators and teachers";
$strings['TrainingEntity'] = "Training entity";
$strings['DescriptionFront'] = "Description front";
$strings['DescriptionRear'] = "Description rear";
$strings['Certify'] = "Certify";
$strings['CertificateType'] = "Certificate type";
$strings['CertifyThat'] = "CERTIFY THAT";
$strings['StudentCourseInfo'] = 'Student and Course data';
$strings['StudentData'] = "Student data";
$strings['CourseData'] = "Course data";
$strings['Modality'] = "Modality";
$strings['Contents'] = "Contents";
$strings['ContentsToShow'] = "Contents to show";
$strings['ContentsCourseDescription'] = 'Use section "Course description"> "Contents"';
$strings['ContentsIndexLearnpath'] = "Use learnpath index";
$strings['ContentsCustom'] = "Use custom content";
$strings['ContentsHide'] = "No show contents";
$strings['Dates'] = "Dates";
$strings['CourseDeliveryDates'] = "Course delivery dates";
$strings['Custom'] = "Custom";
$strings['UseDateSessionAccess'] = "Use access dates to the session";
$strings['ExpectionPlace'] = "Expection place";
$strings['DateExpediction'] = "Expediction date";
$strings['UseDateEndAccessSession'] = "Use end date of session access";
$strings['UseDateDownloadCertificate'] = "Use certificate download date";
$strings['UseCustomDate'] = "Use custom date";
$strings['LogosSeal'] = "Logos / Seals";
$strings['LogoLeft'] = "Logo left";
$strings['LogoCenter'] = "Logo center";
$strings['LogoRight'] = "Logo right";
$strings['Seal'] = "Seal";
$strings['Signature1'] = "Signature 1";
$strings['Signature2'] = "Signature 2";
$strings['Signature3'] = "Signature 3";
$strings['Signature4'] = "Signature 4";
$strings['SignatureText1'] = "Signature text 1";
$strings['SignatureText2'] = "Signature text 2";
$strings['SignatureText3'] = "Signature text 3";
$strings['SignatureText4'] = "Signature text 4";
$strings['OtherOptions'] = "Others options";
$strings['MarginRight'] = "Margin right";
$strings['MarginLeft'] = "Margin left";
$strings['SetDefaultTemplate'] = "Set template by default";
$strings['MessageDefaultTemplate'] = "Save this default customization for courses and sessions without
defined certificates";
$strings['None'] = "None";
$strings['ErrorTemplateCertificate'] = "There is no template defined for the certificate.
There is no template by default.";
$strings['DateStartEnd'] = "With Start date and End date: ";
$strings['ExpedictionIn'] = "Expediction in";
$strings['Signatures'] = "Signatures";
$strings['BackgroundCertificate'] = "Background image of the certificate";
$strings['Background'] = "Background";
$strings['CertificateSetting'] = "Certificate setting";
$strings['ToolDisabledCourse'] = "Tool disabled in course setting";
$strings['ToolUseDefaultSettingCourse'] = "Tool configured to use the default certificate. <br>
You can edit it from the Administration screen -> Plugins -> Custom Certificate. <br>
Or if you want you can disable the option to use certificate by default in the plugin configuration in the course";
$strings['CertificateSettingDefault'] = "Default certificate settings";
$strings['InfoFromDefaultCertificate'] = "The content of the certificate is based on the default certificate.
The modifications you make will not affect the default certificate.";
$strings['to'] = " to ";
$strings['formatDownloadDate'] = " to %sth %s, %s";
$strings['PrintCertificate'] = "Print certificate";

@ -0,0 +1,74 @@
<?php
$strings['plugin_title'] = "Certificado personalizado";
$strings['plugin_comment'] = "Este plugin permite crear certificados personalizados por curso.";
$strings['enable_plugin_customcertificate'] = "Activar plugin";
$strings['customcertificate_course_enable'] = "Habilitar en el curso el certificado alternativo";
$strings['use_certificate_default'] = "Usar el certificado personalizado por defecto";
$strings['ToolDisabled'] = "La herramienta está deshabilitada desde la administración";
$strings['OnlyAdminPlatform'] = "Herramienta exclusiva para administradores";
$strings['OnlyAdminPlatformOrTeacher'] = "Herramienta para administradores y profesores";
$strings['TrainingEntity'] = "Entidad formadora";
$strings['DescriptionFront'] = "Descripción principal";
$strings['DescriptionRear'] = "Descripción trasera";
$strings['Certify'] = "Certifica";
$strings['CertificateType'] = "Tipo certificado";
$strings['CertifyThat'] = "CERTIFICA QUE";
$strings['StudentCourseInfo'] = 'Datos del alumno y curso';
$strings['StudentData'] = "Datos estudiante";
$strings['CourseData'] = "Datos curso";
$strings['Modality'] = "Modalidad";
$strings['Contents'] = "Contenidos";
$strings['ContentsToShow'] = "Contenidos a mostrar";
$strings['ContentsCourseDescription'] = 'Usar apartado "Descripcion del curso" > "Contenidos"';
$strings['ContentsIndexLearnpath'] = "Usar indice de lecciones";
$strings['ContentsCustom'] = "Usar contenido personalizado";
$strings['ContentsHide'] = "No mostrar contenidos";
$strings['Dates'] = "Fechas";
$strings['CourseDeliveryDates'] = "Fechas de impartición del curso";
$strings['Custom'] = "Personalizado";
$strings['UseDateSessionAccess'] = "Usar fechas de acceso a la sesión";
$strings['ExpectionPlace'] = "Lugar expedición";
$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['UseCustomDate'] = "Usar fechas personalizadas";
$strings['LogosSeal'] = "Logos / Sellos";
$strings['LogoLeft'] = "Logo izquierda";
$strings['LogoCenter'] = "Logo central";
$strings['LogoRight'] = "Logo derecha";
$strings['Seal'] = "Sello";
$strings['Signature1'] = "Firma 1";
$strings['Signature2'] = "Firma 2";
$strings['Signature3'] = "Firma 3";
$strings['Signature4'] = "Firma 4";
$strings['SignatureText1'] = "Texto firma 1";
$strings['SignatureText2'] = "Texto firma 2";
$strings['SignatureText3'] = "Texto firma 3";
$strings['SignatureText4'] = "Texto firma 4";
$strings['OtherOptions'] = "Otras opciones";
$strings['MarginRight'] = "Margen derecho";
$strings['MarginLeft'] = "Margen izquierdo";
$strings['SetDefaultTemplate'] = "Establecer plantilla por defecto";
$strings['MessageDefaultTemplate'] = "Guardar esta personalización por defecto para cursos y
sesiones sin certificados definidos";
$strings['None'] = "Ninguno";
$strings['ErrorTemplateCertificate'] = "No hay una plantilla definida para el certificado.
No existe plantilla por defecto.";
$strings['DateStartEnd'] = "Con Fecha de inicio y Fecha fin: ";
$strings['ExpedictionIn'] = "Expedido en";
$strings['Signatures'] = "Firmas";
$strings['BackgroundCertificate'] = "Imagen de fondo del certificado";
$strings['Background'] = "Fondo";
$strings['CertificateSetting'] = "Configuración Certificado";
$strings['ToolDisabledCourse'] = "Herramienta desabilitada en el curso";
$strings['ToolUseDefaultSettingCourse'] = "Herramienta configurada para usar el certificado por defecto.<br>
Podrá editarlo desde la pantalla de Administración -> Plugins -> Certificado personalizado.<br>
O si lo desea puede desactivar la opción de usar certificado por defecto en la configuración del
plugin en el curso";
$strings['CertificateSettingDefault'] = "Configuración del certificado por defecto";
$strings['InfoFromDefaultCertificate'] = "El contenido del certificado está basado en el certificado por defecto.
Las modificaciones que realice no afectará al certificado por defecto.";
$strings['to'] = " a ";
$strings['formatDownloadDate'] = " a %s de %s de %s";
$strings['MessageUpdate'] = "El proceso de actualización ha terminado";
$strings['PrintCertificate'] = "Imprimir certificado";

@ -0,0 +1,16 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is a configuration file for the date plugin.
* You can use it as a master for other platform plugins (course plugins are slightly different).
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins).
*
* @package chamilo.plugin.customcertificate
*/
/**
* Plugin details (must be present).
*/
require_once __DIR__.'/config.php';
$plugin_info = CustomCertificatePlugin::create()->get_info();

@ -0,0 +1,11 @@
body {background-repeat:no-repeat; margin:0; padding: 0;}
td { font-family:arial, sans-serif; font-size:18px; }
.logo {height: 150px; vertical-align: middle; }
.seals { font-size: 16px; text-align:center;}
.logo-seals { height: 100px; text-align:center; vertical-align: middle;}
@page caraA { height: 210mm; margin:0; padding:0; page-break-before:always;}
.caraA {box-decoration-break: slice; page: caraA}
@page caraB { background:#FFFFFF; }
.caraB {box-decoration-break: slice; page: caraB}
.contents-learnpath td {background: #FFFFFF; font-size: 12px; height: 160mm; vertical-align: top;}
ol {margin: 0; padding:0;}

@ -0,0 +1,18 @@
.form-control-cert {
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
color: #555;
font-size: 14px;
line-height: 1.42857143;
padding: 6px 12px;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
.certificado-text-label {
font-weight: 700;
margin: 0 10px 0 10px;
}
input:disabled { background: #eee; }
label { font-size: 13px; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -0,0 +1,38 @@
function dateCertificateSwitchRadioButton2(){
$("#date_start").prop("disabled", true).val("");
$("#date_end").prop("disabled", true).val("");
}
function dateCertificateSwitchRadioButton1(){
$("#date_start").prop("disabled", false);
$("#date_end").prop("disabled", false);
}
function dateCertificateSwitchRadioButton0(){
$("#date_start").prop("disabled", true).val("");
$("#date_end").prop("disabled", true).val("");
}
function typeDateExpedictionSwitchRadioButton(){
$("[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);
}
});
}
function contentsTypeSwitchRadioButton(){
$("[name=\"contents_type\"]").each(function( index ) {
if ( $(this).is(":checked") && $(this).val() === "2") {
$("#contents").prop("disabled", false);
} else {
$("#contents").prop("disabled", true);
}
});
}
$(document).ready(function() {
$( ".datepicker" ).datepicker();
});

@ -0,0 +1,281 @@
<?php
/* For license terms, see /license.txt */
/**
* Plugin class for the CustomCertificate plugin.
*
* @package chamilo.plugin.customcertificate
*
* @author Jose Angel Ruiz <desarrollo@nosolored.com>
*/
class CustomCertificatePlugin extends Plugin
{
const TABLE_CUSTOMCERTIFICATE = 'plugin_customcertificate';
public $isCoursePlugin = true;
// When creating a new course this settings are added to the course
public $course_settings = [
[
'name' => 'customcertificate_course_enable',
'type' => 'checkbox',
],
[
'name' => 'use_certificate_default',
'type' => 'checkbox',
],
];
/**
* Constructor.
*/
protected function __construct()
{
parent::__construct(
'1.0',
'Jose Angel Ruiz - NoSoloRed (original author), Julio Montoya',
[
'enable_plugin_customcertificate' => 'boolean',
]
);
$this->isAdminPlugin = true;
}
/**
* Instance the plugin.
*
* @staticvar null $result
*
* @return CustomCertificatePlugin
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
/**
* This method creates the tables required to this plugin.
*/
public function install()
{
//Installing course settings
$this->install_course_fields_in_all_courses();
$tablesToBeCompared = [self::TABLE_CUSTOMCERTIFICATE];
$em = Database::getManager();
$cn = $em->getConnection();
$sm = $cn->getSchemaManager();
$tables = $sm->tablesExist($tablesToBeCompared);
if ($tables) {
return false;
}
require_once api_get_path(SYS_PLUGIN_PATH).'customcertificate/database.php';
}
/**
* This method drops the plugin tables.
*/
public function uninstall()
{
// Deleting course settings.
$this->uninstall_course_fields_in_all_courses();
$tablesToBeDeleted = [self::TABLE_CUSTOMCERTIFICATE];
foreach ($tablesToBeDeleted as $tableToBeDeleted) {
$table = Database::get_main_table($tableToBeDeleted);
$sql = "DROP TABLE IF EXISTS $table";
Database::query($sql);
}
$this->manageTab(false);
}
/**
* This method update the previous plugin tables.
*/
public function update()
{
$oldCertificateTable = 'gradebook_certificate_alternative';
$base = api_get_path(WEB_UPLOAD_PATH);
if (Database::num_rows(Database::query("SHOW TABLES LIKE '$oldCertificateTable'")) == 1) {
$sql = "SELECT * FROM $oldCertificateTable";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$pathOrigin = $base.'certificates/'.$row['id'].'/';
$params = [
'access_url_id' => api_get_current_access_url_id(),
'c_id' => $row['c_id'],
'session_id' => $row['session_id'],
'content_course' => $row['content_course'],
'contents_type' => intval($row['contents_type']),
'contents' => $row['contents'],
'date_change' => intval($row['date_change']),
'date_start' => $row['date_start'],
'date_end' => $row['date_end'],
'place' => $row['place'],
'type_date_expediction' => intval($row['type_date_expediction']),
'day' => $row['day'],
'month' => $row['month'],
'year' => $row['year'],
'logo_left' => $row['logo_left'],
'logo_center' => $row['logo_center'],
'logo_right' => $row['logo_right'],
'seal' => $row['seal'],
'signature1' => $row['signature1'],
'signature2' => $row['signature2'],
'signature3' => $row['signature3'],
'signature4' => $row['signature4'],
'signature_text1' => $row['signature_text1'],
'signature_text2' => $row['signature_text2'],
'signature_text3' => $row['signature_text3'],
'signature_text4' => $row['signature_text4'],
'background' => $row['background'],
'margin_left' => intval($row['margin']),
'margin_right' => 0,
'certificate_default' => 0,
];
$certificateId = Database::insert(self::TABLE_CUSTOMCERTIFICATE, $params);
// Image manager
$pathDestiny = $base.'certificates/'.$certificateId.'/';
if (!file_exists($pathDestiny)) {
mkdir($pathDestiny, api_get_permissions_for_new_directories(), true);
}
$imgList = [
'logo_left',
'logo_center',
'logo_right',
'seal',
'signature1',
'signature2',
'signature3',
'signature4',
'background',
];
foreach ($imgList as $value) {
if (!empty($row[$value])) {
copy(
$pathOrigin.$row[$value],
$pathDestiny.$row[$value]
);
}
}
if ($row['certificate_default'] == 1) {
$params['c_id'] = 0;
$params['session_id'] = 0;
$params['certificate_default'] = 1;
$certificateId = Database::insert(self::TABLE_CUSTOMCERTIFICATE, $params);
$pathOrigin = $base.'certificates/default/';
$pathDestiny = $base.'certificates/'.$certificateId.'/';
foreach ($imgList as $value) {
if (!empty($row[$value])) {
copy(
$pathOrigin.$row[$value],
$pathDestiny.$row[$value]
);
}
}
}
}
$sql = "DROP TABLE IF EXISTS $oldCertificateTable";
Database::query($sql);
echo get_lang('MessageUpdate');
}
}
/**
* By default new icon is invisible.
*
* @return bool
*/
public function isIconVisibleByDefault()
{
return false;
}
/**
* Get certificate data.
*
* @param int $id The certificate
*
* @return array
*/
public static function getCertificateData($id)
{
$id = (int) $id;
if (empty($id)) {
return [];
}
$certificateTable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
$categoryTable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$sql = "SELECT cer.user_id AS user_id, cat.session_id AS session_id, cat.course_code AS course_code
FROM $certificateTable cer
INNER JOIN $categoryTable cat
ON (cer.cat_id = cat.id)
WHERE cer.id = $id";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
$row = Database::fetch_assoc($rs);
$courseCode = $row['course_code'];
$sessionId = $row['session_id'];
$userId = $row['user_id'];
if (api_get_course_setting('customcertificate_course_enable', $courseCode) == 1) {
return [
'course_code' => $courseCode,
'session_id' => $sessionId,
'user_id' => $userId,
];
}
}
return [];
}
/**
* Check if it redirects.
*
* @param certificate $certificate
* @param int $certId
*/
public static function redirectCheck($certificate, $certId)
{
$certId = (int) $certId;
if (api_get_plugin_setting('customcertificate', 'enable_plugin_customcertificate') == 'true') {
$infoCertificate = CustomCertificatePlugin::getCertificateData($certId);
if (!empty($infoCertificate)) {
if ($certificate->user_id == api_get_user_id() && !empty($certificate->certificate_data)) {
$certificateId = $certificate->certificate_data['id'];
$extraFieldValue = new ExtraFieldValue('user_certificate');
$value = $extraFieldValue->get_values_by_handler_and_field_variable(
$certificateId,
'downloaded_at'
);
if (empty($value)) {
$params = [
'item_id' => $certificate->certificate_data['id'],
'extra_downloaded_at' => api_get_utc_datetime(),
];
$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;
}
}
}
}

@ -0,0 +1,951 @@
<?php
/* For licensing terms, see /license.txt */
if (intval($_GET['default']) == 1) {
$cidReset = true;
}
$course_plugin = 'customcertificate';
require_once __DIR__.'/../config.php';
$_setting['student_view_enabled'] = 'false';
$userId = api_get_user_id();
$plugin = CustomCertificatePlugin::create();
$nameTools = $plugin->get_lang('CertificateSetting');
$enable = $plugin->get('enable_plugin_customcertificate') == 'true';
$accessUrlId = api_get_current_access_url_id();
$course_info = api_get_course_info();
if (intval($_GET['default']) == 1) {
$courseId = 0;
$courseCode = '';
$sessionId = 0;
$enableCourse = false;
$useDefault = true;
$defaultCertificate = 1;
$nameTools = $plugin->get_lang('CertificateSettingDefault');
$urlParams = '?default=1';
} else {
$courseId = api_get_course_int_id();
$courseCode = api_get_course_id();
$sessionId = api_get_session_id();
$enableCourse = api_get_course_setting('customcertificate_course_enable', $courseCode) == 1 ? true : false;
$useDefault = api_get_course_setting('use_certificate_default', $courseCode) == 1 ? true : false;
$defaultCertificate = 0;
$urlParams = '?'.api_get_cidreq();
}
if (!$enable) {
api_not_allowed(true, $plugin->get_lang('ToolDisabled'));
}
if (!$enableCourse && !$useDefault) {
api_not_allowed(true, $plugin->get_lang('ToolDisabledCourse'));
}
if ($enableCourse && $useDefault) {
api_not_allowed(true, $plugin->get_lang('ToolUseDefaultSettingCourse'));
}
$allow = api_is_platform_admin() || api_is_teacher();
if (!$allow) {
api_not_allowed(true);
}
$table = Database::get_main_table(CustomCertificatePlugin::TABLE_CUSTOMCERTIFICATE);
$htmlHeadXtra[] = api_get_js_simple(
api_get_path(WEB_PLUGIN_PATH).'customcertificate/resources/js/certificate.js'
);
$htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
$htmlHeadXtra[] = api_get_asset('cropper/dist/cropper.min.js');
$htmlHeadXtra[] = api_get_css(
api_get_path(WEB_PLUGIN_PATH).'customcertificate/resources/css/form.css'
);
// Get info certificate
$infoCertificate = Database::select(
'*',
$table,
['where' => [
'access_url_id = ? AND c_id = ? AND session_id = ?' => [$accessUrlId, $courseId, $sessionId], ],
],
'first'
);
if (!is_array($infoCertificate)) {
$infoCertificate = [
'type_date_expediction' => '',
'year' => '',
'month' => '',
'day' => '',
'date_change' => '',
];
}
$form = new FormValidator(
'formEdit',
'post',
api_get_self().$urlParams,
null,
['class' => 'form-vertical']
);
if ($form->validate()) {
$formValues = $form->getSubmitValues();
if (empty($formValues['contents'])) {
$contents = '';
} else {
$contents = $formValues['contents'];
}
$check = Security::check_token('post');
if ($check) {
$date_start = str_replace('/', '-', $formValues['date_start']);
$date_end = str_replace('/', '-', $formValues['date_end']);
$params = [
'access_url_id' => api_get_current_access_url_id(),
'c_id' => $formValues['c_id'],
'session_id' => $formValues['session_id'],
'content_course' => $formValues['content_course'],
'contents_type' => intval($formValues['contents_type']),
'contents' => $contents,
'date_change' => intval($formValues['date_change']),
'date_start' => date("Y-m-d", strtotime($date_start)),
'date_end' => date("Y-m-d", strtotime($date_end)),
'place' => $formValues['place'],
'type_date_expediction' => intval($formValues['type_date_expediction']),
'day' => $formValues['day'],
'month' => $formValues['month'],
'year' => $formValues['year'],
'signature_text1' => $formValues['signature_text1'],
'signature_text2' => $formValues['signature_text2'],
'signature_text3' => $formValues['signature_text3'],
'signature_text4' => $formValues['signature_text4'],
'margin_left' => intval($formValues['margin_left']),
'margin_right' => intval($formValues['margin_right']),
'certificate_default' => 0,
];
if (intval($formValues['default_certificate'] == 1)) {
$params['certificate_default'] = 1;
}
// Insert or Update
if ($infoCertificate['id'] > 0) {
$certificateId = $infoCertificate['id'];
Database::update($table, $params, ['id = ?' => $certificateId]);
} else {
$certificateId = Database::insert($table, $params);
}
// Image manager
$fieldList = [
'logo_left',
'logo_center',
'logo_right',
'seal',
'signature1',
'signature2',
'signature3',
'signature4',
'background',
];
foreach ($fieldList as $field) {
$checkLogo[$field] = false;
if (!empty($formValues['remove_'.$field]) || $_FILES[$field]['size']) {
checkInstanceImage(
$certificateId,
$infoCertificate[$field],
$field
);
}
if ($_FILES[$field]['size']) {
$newPicture = api_upload_file(
'certificates',
$_FILES[$field],
$certificateId,
$formValues[$field.'_crop_result']
);
if ($newPicture) {
$sql = "UPDATE $table
SET $field = '".$newPicture['path_to_save']."'
WHERE id = $certificateId";
Database::query($sql);
$checkLogo[$field] = true;
}
}
}
// Certificate Default
if (intval($formValues['use_default'] == 1)) {
$infoCertificateDefault = Database::select(
'*',
$table,
['where' => ['certificate_default = ? ' => 1]],
'first'
);
if (!empty($infoCertificateDefault)) {
foreach ($fieldList as $field) {
if (!empty($infoCertificateDefault[$field]) && !$checkLogo[$field]) {
$sql = "UPDATE $table
SET $field = '".$infoCertificateDefault[$field]."'
WHERE id = $certificateId";
Database::query($sql);
}
}
}
}
Display::addFlash(Display::return_message(get_lang('Saved')));
Security::clear_token();
header('Location: '.api_get_self().$urlParams);
exit;
}
}
if (empty($infoCertificate)) {
$infoCertificate = Database::select(
'*',
$table,
['where' => ['access_url_id = ? AND certificate_default = ? ' => [$accessUrlId, 1]]],
'first'
);
if (!is_array($infoCertificate)) {
$infoCertificate = [];
}
if (!empty($infoCertificate)) {
$useDefault = true;
}
}
// Display the header
Display::display_header($nameTools);
$actionsLeft = Display::url(
Display::return_icon('certificate.png', get_lang('Certificate'), '', ICON_SIZE_MEDIUM),
'print_certificate.php'.$urlParams
);
echo Display::toolbarAction(
'toolbar-document',
[$actionsLeft]
);
if ($useDefault && $courseId > 0) {
echo Display::return_message(get_lang('InfoFromDefaultCertificate'), 'info');
}
// Student and course section
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang('StudentCourseInfo')).'</legend>');
$form->addHtml('<div class="col-sm-8">');
$dir = '/';
$courseInfo = api_get_course_info();
$isAllowedToEdit = api_is_allowed_to_edit(null, true);
$editorConfig = [
'ToolbarSet' => ($isAllowedToEdit ? 'Documents' : 'DocumentsStudent'),
'Width' => '100%',
'Height' => '300',
'cols-size' => [0, 12, 0],
'FullPage' => true,
'InDocument' => true,
'CreateDocumentDir' => api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/',
'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/',
'BaseHref' => api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$dir,
];
$form->addHtmlEditor(
'content_course',
'',
false,
true,
$editorConfig,
true
);
$form->addHtml('</div>');
$form->addHtml('<div class="col-sm-4">');
$strInfo = '((user_firstname))<br />';
$strInfo .= '((user_lastname))<br />';
$strInfo .= '((gradebook_institution))<br />';
$strInfo .= '((gradebook_sitename))<br />';
$strInfo .= '((teacher_firstname))<br />';
$strInfo .= '((teacher_lastname))<br />';
$strInfo .= '((official_code))<br />';
$strInfo .= '((date_certificate))<br />';
$strInfo .= '((date_certificate_no_time))<br />';
$strInfo .= '((course_code))<br />';
$strInfo .= '((course_title))<br />';
$strInfo .= '((gradebook_grade))<br />';
$strInfo .= '((external_style))<br />';
$strInfo .= '((start_date))<br />';
$strInfo .= '((end_date))<br />';
$strInfo .= '((date_expediction))';
$createCertificate = get_lang('CreateCertificateWithTags');
$form->addElement(
'html',
Display::return_message($createCertificate.': <br />'.$strInfo, 'normal', false)
);
$form->addHtml('</div>');
$form->addHtml('</fieldset>');
$form->addHtml('<div class="clearfix"></div>');
// Contents section
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang('Contents')).'</legend>');
$extra = '';
if (empty($infoCertificate['contents_type'])) {
$infoCertificate['contents_type'] = 0;
$extra = 'disabled';
}
$group = [];
$element = &$form->createElement(
'radio',
'contents_type',
'',
get_lang('ContentsCourseDescription'),
0,
['id' => 'contents_type_0', 'onclick' => 'javascript: contentsTypeSwitchRadioButton();']
);
$group[] = $element;
$element = &$form->createElement(
'radio',
'contents_type',
'',
get_lang('ContentsIndexLearnpath'),
1,
['id' => 'contents_type_1', 'onclick' => 'javascript: contentsTypeSwitchRadioButton();']
);
$group[] = $element;
$element = &$form->createElement(
'radio',
'contents_type',
'',
get_lang('ContentsHide'),
3,
['id' => 'contents_type_3', 'onclick' => 'javascript: contentsTypeSwitchRadioButton();']
);
$group[] = $element;
$element = &$form->createElement(
'radio',
'contents_type',
'',
get_lang('ContentsCustom'),
2,
['id' => 'contents_type_2', 'onclick' => 'javascript: contentsTypeSwitchRadioButton();']
);
$group[] = $element;
$form->addGroup(
$group,
'contents_type',
get_lang('ContentsToShow'),
null,
false
);
$form->addHtml('<div id="contents-section">');
$editorConfig = [
'ToolbarSet' => ($isAllowedToEdit ? 'Documents' : 'DocumentsStudent'),
'Width' => '100%',
'Height' => '200',
'cols-size' => [2, 10, 0],
'FullPage' => true,
'InDocument' => true,
'CreateDocumentDir' => api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/',
'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/',
'BaseHref' => api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$dir,
'id' => 'contents',
$extra,
];
$form->addHtmlEditor(
'contents',
get_lang('Contents'),
false,
true,
$editorConfig,
true
);
$form->addHtml('</div>');
// Dates section
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang("Dates")).'</legend>');
$group = [];
$option1 = &$form->createElement(
'radio',
'date_change',
'',
get_lang('UseDateSessionAccess'),
0,
['id' => 'date_change_0', 'onclick' => 'javascript: dateCertificateSwitchRadioButton0();']
);
$group[] = $option1;
$option2 = &$form->createElement(
'radio',
'date_change',
'',
get_lang('None'),
2,
['id' => 'date_change_2', 'onclick' => 'javascript: dateCertificateSwitchRadioButton2();']
);
$group[] = $option2;
$option3 = &$form->createElement(
'radio',
'date_change',
'',
get_lang('Custom'),
1,
['id' => 'date_change_1', 'onclick' => 'javascript: dateCertificateSwitchRadioButton1();']
);
$group[] = $option3;
$form->addGroup(
$group,
'date_change',
get_lang('CourseDeliveryDates'),
null,
false
);
$form->addHtml('<div class="form-group" style="padding-top: 10px;">
<label for="date_certificate" class="col-sm-2 control-label">&nbsp;</label>
<div class="col-sm-10">
<div class="radio" style="margin-top: -25px;">
<span style="margin: 0 10px; font-style: italic;">'.get_lang('From').'</span>
<input
size="20"
autofocus="autofocus"
class="form-control-cert text-center datepicker"
name="date_start"
id="date_start"
type="text"
value="'.(($infoCertificate['date_change'] == '1')
? date("d/m/Y", strtotime($infoCertificate['date_start']))
: '').'"
'.(($infoCertificate['date_change'] == '') ? 'disabled' : '').'
>
<span style="margin: 0 10px; font-style: italic;">'.get_lang('Until').'</span>
<input
size="20"
class="form-control-cert text-center datepicker"
name="date_end"
id="date_end"
type="text"
value="'.(($infoCertificate['date_change'] == '1')
? date("d/m/Y", strtotime($infoCertificate['date_end']))
: '').'"
'.(($infoCertificate['date_change'] == "0") ? 'disabled' : '').'
>
</div>
</div>
</div>');
$form->addText(
'place',
get_lang('ExpectionPlace'),
false,
['id' => 'place', 'cols-size' => [2, 5, 5], 'autofocus']
);
$group = [];
$option1 = &$form->createElement(
'radio',
'type_date_expediction',
'',
get_lang('UseDateEndAccessSession'),
0,
[
'id' => 'type_date_expediction_0',
'onclick' => 'javascript: dateCertificateSwitchRadioButton0();',
(($sessionId == 0) ? 'disabled' : ''),
]
);
$group[] = $option1;
$option2 = &$form->createElement(
'radio',
'type_date_expediction',
'',
get_lang('UseDateDownloadCertificate'),
1,
[
'id' => 'type_date_expediction_1',
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option2;
$option4 = &$form->createElement(
'radio',
'type_date_expediction',
'',
get_lang('None'),
3,
[
'id' => 'type_date_expediction_3',
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option4;
$option3 = &$form->createElement(
'radio',
'type_date_expediction',
'',
get_lang('UseCustomDate'),
2,
[
'id' => 'type_date_expediction_2',
'onclick' => 'javascript: typeDateExpedictionSwitchRadioButton();',
]
);
$group[] = $option3;
$form->addGroup(
$group,
'type_date_expediction',
get_lang('DateExpediction'),
null,
false
);
$form->addHtml(
'<div class="form-group" style="padding-top: 10px;">
<label for="date_certificate" class="col-sm-2 control-label">&nbsp;</label>
<div class="col-sm-10">
<div class="radio" style="margin-top: -25px;">
<span class="certificado-text-label">a</span>
<input
size="4"
autofocus="autofocus"
class="form-control-cert text-center"
name="day"
id="day"
type="text"
value="'.$infoCertificate['day'].'"
'.(($infoCertificate['type_date_expediction'] != '2') ? 'disabled' : '').'
>
<span class="certificado-text-label">de</span>
<input
size="10"
autofocus="autofocus"
class="form-control-cert text-center"
name="month"
id="month"
type="text"
value="'.$infoCertificate['month'].'"
'.(($infoCertificate['type_date_expediction'] != '2') ? 'disabled' : '').'
>
<span class="certificado-text-label">de</span>
<input
size="4"
autofocus="autofocus"
class="form-control-cert text-center"
name="year"
id="year"
type="text"
value="'.$infoCertificate['year'].'"
'.(($infoCertificate['type_date_expediction'] != '2') ? 'disabled' : '').'
>
</div>
</div>
</div>'
);
$form->addHtml('</fieldset>');
// Signature section
$base = api_get_path(WEB_UPLOAD_PATH);
$path = $base.'certificates/';
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang('LogosSeal')).'</legend>');
// Logo 1
$form->addHtml('<div class="col-sm-6">');
$form->addFile(
'logo_left',
get_lang('LogoLeft'),
[
'id' => 'logo_left',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['logo_left'])) {
$form->addElement('checkbox', 'remove_logo_left', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['logo_left'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'logo_left',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div>');
// Logo 2
$form->addHtml('<div class="col-sm-6">');
$form->addFile(
'logo_center',
get_lang('LogoCenter'),
[
'id' => 'logo_center',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['logo_center'])) {
$form->addElement('checkbox', 'remove_logo_center', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['logo_center'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'logo_center',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div><div class="clearfix"></div>');
// Logo 3
$form->addHtml('<div class="col-sm-6">');
$form->addFile(
'logo_right',
get_lang('LogoRight'),
[
'id' => 'logo_right',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['logo_right'])) {
$form->addElement('checkbox', 'remove_logo_right', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['logo_right'].'" width="100" />
<br><br>'
);
}
$tblProperty = api_get_supported_image_extensions(false);
$form->addRule(
'logo_right',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div>');
$form->addHtml('<div class="col-sm-6">');
$form->addFile(
'seal',
get_lang('Seal'),
[
'id' => 'seal',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['seal'])) {
$form->addElement('checkbox', 'remove_seal', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['seal'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'seal',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div><div class="clearfix"></div>');
$form->addHtml('</fieldset>');
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang('Signatures')).'</legend>');
// signature 1
$form->addHtml('<div class="col-sm-6">');
$form->addText(
'signature_text1',
get_lang('SignatureText1'),
false,
['cols-size' => [2, 10, 0], 'autofocus']
);
$form->addFile(
'signature1',
get_lang('Signature1'),
[
'id' => 'signature1',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['signature1'])) {
$form->addElement('checkbox', 'remove_signature1', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['signature1'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'signature1',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div>');
// signature 2
$form->addHtml('<div class="col-sm-6">');
$form->addText(
'signature_text2',
get_lang('SignatureText2'),
false,
['cols-size' => [2, 10, 0], 'autofocus']
);
$form->addFile(
'signature2',
get_lang('Signature2'),
[
'id' => 'signature2',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['signature2'])) {
$form->addElement('checkbox', 'remove_signature2', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['signature2'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'signature2',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div><div class="clearfix"></div>');
// signature 3
$form->addHtml('<div class="col-sm-6">');
$form->addText(
'signature_text3',
get_lang('SignatureText3'),
false,
['cols-size' => [2, 10, 0], 'autofocus']
);
$form->addFile(
'signature3',
get_lang('Signature3'),
[
'id' => 'signature3',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['signature3'])) {
$form->addElement('checkbox', 'remove_signature3', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['signature3'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'signature3',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div>');
// signature 4
$form->addHtml('<div class="col-sm-6">');
$form->addText(
'signature_text4',
get_lang('SignatureText4'),
false,
['cols-size' => [2, 10, 0], 'autofocus']
);
$form->addFile(
'signature4',
get_lang('Signature4'),
[
'id' => 'signature4',
'class' => 'picture-form',
'crop_image' => true,
'crop_scalable' => 'true',
]
);
$form->addProgress();
if (!empty($infoCertificate['signature4'])) {
$form->addElement('checkbox', 'remove_signature4', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['signature4'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'signature4',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</div><div class="clearfix"></div>');
$form->addHtml('</fieldset><br>');
$form->addHtml('<div class="col-sm-6">');
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang('BackgroundCertificate')).'</legend>');
// background
$form->addFile(
'background',
get_lang('Background'),
[
'id' => 'background',
'class' => 'picture-form',
'crop_image' => true,
'crop_ratio' => '297 / 210',
]
);
$form->addProgress();
if (!empty($infoCertificate['background'])) {
$form->addElement('checkbox', 'remove_background', null, get_lang('DelImage'));
$form->addElement(
'html',
'<label class="col-sm-2">&nbsp;</label>
<img src="'.$path.$infoCertificate['background'].'" width="100" />
<br><br>'
);
}
$allowedPictureTypes = api_get_supported_image_extensions(false);
$form->addRule(
'background',
get_lang('OnlyImagesAllowed').' ('.implode(', ', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addHtml('</fieldset>');
$form->addHtml('</div>');
$form->addHtml('<div class="col-sm-6">');
$form->addHtml('<fieldset><legend>'.strtoupper(get_lang('OtherOptions')).'</legend>');
$marginOptions = [];
$i = 0;
while ($i < 298) {
$marginOptions[$i] = $i.' mm';
$i++;
}
$form->addElement(
'select',
'margin_left',
get_lang('MarginLeft'),
$marginOptions,
['cols-size' => [4, 8, 0]]
);
$form->addElement(
'select',
'margin_right',
get_lang('MarginRight'),
$marginOptions,
['cols-size' => [4, 8, 0]]
);
$form->addHtml('</fieldset>');
$form->addHtml('</div>');
$form->addHtml('<div class="clearfix"></div>');
$form->addButton(
'submit',
get_lang('SaveCertificate'),
'check',
'primary',
null,
null,
['cols-size' => [5, 2, 5]],
false
);
$form->addElement('hidden', 'formSent');
$infoCertificate['formSent'] = 1;
$form->setDefaults($infoCertificate);
$token = Security::get_token();
$form->addElement('hidden', 'sec_token');
$form->addElement('hidden', 'use_default');
$form->addElement('hidden', 'default_certificate');
$form->addElement('hidden', 'c_id');
$form->addElement('hidden', 'session_id');
$form->setConstants(
[
'sec_token' => $token,
'use_default' => $useDefault,
'default_certificate' => $defaultCertificate,
'c_id' => $courseId,
'session_id' => $sessionId,
]
);
echo '<div class="page-create">';
echo '<div class="row" style="overflow:hidden">';
echo '<div id="doc_form" class="col-md-12">';
echo $form->returnForm();
echo '</div>';
echo '</div>';
echo '</div>';
Display::display_footer();
/**
* Delete the file if there is only one instance.
*
* @param int $certificateId
* @param string $imagePath
* @param string $field
* @param string $type
*/
function checkInstanceImage($certificateId, $imagePath, $field, $type = 'certificates')
{
$table = Database::get_main_table(CustomCertificatePlugin::TABLE_CUSTOMCERTIFICATE);
$imagePath = Database::escape_string($imagePath);
$field = Database::escape_string($field);
$sql = "SELECT * FROM $table WHERE $field = '$imagePath'";
$res = Database::query($sql);
if (Database::num_rows($res) == 1) {
api_remove_uploaded_file($type, $imagePath);
}
$sql = "UPDATE $table SET $field = '' WHERE id = $certificateId";
Database::query($sql);
}

@ -0,0 +1,497 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CLpCategory;
if (intval($_GET['default']) == 1) {
$cidReset = true;
}
$course_plugin = 'customcertificate';
require_once __DIR__.'/../config.php';
api_block_anonymous_users();
$plugin = CustomCertificatePlugin::create();
$enable = $plugin->get('enable_plugin_customcertificate') == 'true';
$tblProperty = Database::get_course_table(TABLE_ITEM_PROPERTY);
if (!$enable) {
api_not_allowed(true, $plugin->get_lang('ToolDisabled'));
}
if (intval($_GET['default']) == 1) {
$courseId = 0;
$courseCode = '';
$sessionId = 0;
$enableCourse = false;
$useDefault = true;
} else {
$courseId = api_get_course_int_id();
$courseCode = api_get_course_id();
$sessionId = api_get_session_id();
$enableCourse = api_get_course_setting('customcertificate_course_enable', $courseCode) == 1 ? true : false;
$useDefault = api_get_course_setting('use_certificate_default', $courseCode) == 1 ? true : false;
}
$accessUrlId = api_get_current_access_url_id();
$userList = [];
if (empty($_GET['export_all'])) {
if (!isset($_GET['student_id'])) {
$studentId = api_get_user_id();
} else {
$studentId = intval($_GET['student_id']);
}
$userList[] = api_get_user_info($studentId);
} else {
$certificateTable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
$categoryTable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$sql = "SELECT cer.user_id AS user_id
FROM $certificateTable cer
INNER JOIN $categoryTable cat
ON (cer.cat_id = cat.id)
WHERE cat.course_code = '$courseCode' AND cat.session_id = $sessionId";
$rs = Database::query($sql);
while ($row = Database::fetch_assoc($rs)) {
$userList[] = api_get_user_info($row['user_id']);
}
}
$sessionInfo = [];
if ($sessionId > 0) {
$sessionInfo = SessionManager::fetch($sessionId);
}
$table = Database::get_main_table(CustomCertificatePlugin::TABLE_CUSTOMCERTIFICATE);
$useDefault = false;
$path = api_get_path(SYS_UPLOAD_PATH).'certificates/';
// Get info certificate
$infoCertificate = Database::select(
'*',
$table,
['where' => ['access_url_id = ? AND c_id = ? AND session_id = ?' => [$accessUrlId, $courseId, $sessionId]]],
'first'
);
if (!is_array($infoCertificate)) {
$infoCertificate = [];
}
if (empty($infoCertificate)) {
$infoCertificate = Database::select(
'*',
Database::get_main_table(CustomCertificatePlugin::TABLE_CUSTOMCERTIFICATE),
['where' => ['access_url_id = ? AND certificate_default = ? ' => [$accessUrlId, 1]]],
'first'
);
if (!is_array($infoCertificate)) {
$infoCertificate = [];
}
if (empty($infoCertificate)) {
Display::display_header($plugin->get_lang('PrintCertificate'));
echo Display::return_message($plugin->get_lang('ErrorTemplateCertificate'), 'error');
Display::display_footer();
exit;
} else {
$useDefault = true;
}
}
$workSpace = intval(297 - $infoCertificate['margin_left'] - $infoCertificate['margin_right']);
$widthCell = intval($workSpace / 6);
$htmlText = '<html>';
$htmlText .= '
<link rel="stylesheet"
type="text/css"
href="'.api_get_path(WEB_PLUGIN_PATH).'customcertificate/resources/css/certificate.css">';
$htmlText .= '
<link rel="stylesheet"
type="text/css"
href="'.api_get_path(WEB_CSS_PATH).'document.css">';
$htmlText .= '<body>';
foreach ($userList as $userInfo) {
$studentId = $userInfo['user_id'];
if (empty($infoCertificate['background'])) {
$htmlText .= '<div class="caraA" style="page-break-before:always; margin:0px; padding:0px;">';
} else {
$urlBackground = $path.$infoCertificate['background'];
$htmlText .= ' <div
class = "caraA"
style = "background-image:url('.$urlBackground.') no-repeat; background-image-resize:6; margin:0px; padding:0px;">';
}
if (!empty($infoCertificate['logo_left'])) {
$logoLeft = '
<img
style="max-height: 150px; max-width: '.(2 * $widthCell).'mm;"
src="'.$path.$infoCertificate['logo_left'].'" />';
} else {
$logoLeft = '';
}
$logoCenter = '';
if (!empty($infoCertificate['logo_center'])) {
$logoCenter = '
<img
style="max-height: 150px; max-width: '.intval($workSpace - (2 * $widthCell)).'mm;"
src="'.$path.$infoCertificate['logo_center'].'" />';
}
$logoRight = '';
if (!empty($infoCertificate['logo_right'])) {
$logoRight = '
<img
style="max-height: 150px; max-width: '.(2 * $widthCell).'mm;"
src="'.$path.$infoCertificate['logo_right'].'" />';
}
$htmlText .= '<table
width="'.$workSpace.'mm"
style="
margin-left:'.$infoCertificate['margin_left'].'mm;
margin-right:'.$infoCertificate['margin_right'].'mm;
"
border="0">';
$htmlText .= '<tr>';
$htmlText .= '<td style="width:'.intval($workSpace / 3).'mm" class="logo">'.$logoLeft.'</td>';
$htmlText .= '<td style="width:'.intval($workSpace / 3).'mm; text-align:center;" class="logo">'.$logoCenter.'</td>';
$htmlText .= '<td style="width:'.intval($workSpace / 3).'mm; text-align:right;" class="logo">'.$logoRight.'</td>';
$htmlText .= '</tr>';
$htmlText .= '</table>';
$all_user_info = DocumentManager::get_all_info_to_certificate(
$studentId,
$courseCode,
true
);
$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];
$myContentHtml = str_replace(
$info_to_be_replaced_in_content_html,
$info_to_replace_in_content_html,
$myContentHtml
);
$startDate = '';
$endDate = '';
switch ($infoCertificate['date_change']) {
case 0:
if (!empty($sessionInfo['access_start_date'])) {
$startDate = date("d/m/Y", strtotime(api_get_local_time($sessionInfo['access_start_date'])));
}
if (!empty($sessionInfo['access_end_date'])) {
$endDate = date("d/m/Y", strtotime(api_get_local_time($sessionInfo['access_end_date'])));
}
break;
case 1:
$startDate = date("d/m/Y", strtotime($infoCertificate['date_start']));
$endDate = date("d/m/Y", strtotime($infoCertificate['date_end']));
break;
}
$myContentHtml = str_replace(
'((start_date))',
$startDate,
$myContentHtml
);
$myContentHtml = str_replace(
'((end_date))',
$endDate,
$myContentHtml
);
$dateExpediction = '';
if ($infoCertificate['type_date_expediction'] != 3) {
$dateExpediction .= $plugin->get_lang('ExpedictionIn').' '.$infoCertificate['place'];
if ($infoCertificate['type_date_expediction'] == 1) {
$dateExpediction .= $plugin->get_lang('to').api_format_date(time(), DATE_FORMAT_LONG);
} elseif ($infoCertificate['type_date_expediction'] == 2) {
$dateFormat = $plugin->get_lang('formatDownloadDate');
if (!empty($infoCertificate['day']) &&
!empty($infoCertificate['month']) &&
!empty($infoCertificate['year'])
) {
$dateExpediction .= sprintf(
$dateFormat,
$infoCertificate['day'],
$infoCertificate['month'],
$infoCertificate['year']
);
} else {
$dateExpediction .= sprintf(
$dateFormat,
'......',
'....................',
'............'
);
}
} else {
$dateInfo = api_get_local_time($sessionInfo['access_end_date']);
$dateExpediction .= $plugin->get_lang('to').api_format_date($dateInfo, DATE_FORMAT_LONG);
}
}
$myContentHtml = str_replace(
'((date_expediction))',
$dateExpediction,
$myContentHtml
);
$myContentHtml = strip_tags(
$myContentHtml,
'<p><b><strong><table><tr><td><th><tbody><span><i><li><ol><ul>
<dd><dt><dl><br><hr><img><a><div><h1><h2><h3><h4><h5><h6>'
);
$htmlText .= '<div style="
height: 480px;
width:'.$workSpace.'mm;
margin-left:'.$infoCertificate['margin_left'].'mm;
margin-right:'.$infoCertificate['margin_right'].'mm;
">';
$htmlText .= $myContentHtml;
$htmlText .= '</div>';
$htmlText .= '<table
width="'.$workSpace.'mm"
style="
margin-left:'.$infoCertificate['margin_left'].'mm;
margin-right:'.$infoCertificate['margin_right'].'mm;
"
border="0">';
$htmlText .= '<tr>';
$htmlText .= '<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature_text1'])) ? $infoCertificate['signature_text1'] : '').
'</td>
<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature_text2'])) ? $infoCertificate['signature_text2'] : '').
'</td>
<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature_text3'])) ? $infoCertificate['signature_text3'] : '').
'</td>
<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature_text4'])) ? $infoCertificate['signature_text4'] : '').
'</td>
<td colspan="4" class="seals" style="width:'.(2 * $widthCell).'mm">
'.((!empty($infoCertificate['seal'])) ? $plugin->get_lang('Seal') : '').
'</td>';
$htmlText .= '</tr>';
$htmlText .= '<tr>';
$htmlText .= '<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature1']))
? '<img style="max-height: 100px; max-width: '.$widthCell.'mm;"
src="'.$path.$infoCertificate['signature1'].'" />'
: '').
'</td>
<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature2']))
? '<img style="max-height: 100px; '.$widthCell.'mm;"
src="'.$path.$infoCertificate['signature2'].'" />'
: '').
'</td>
<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature3']))
? '<img style="max-height: 100px; '.$widthCell.'mm;"
src="'.$path.$infoCertificate['signature3'].'" />'
: '').
'</td>
<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'.
((!empty($infoCertificate['signature4']))
? '<img style="max-height: 100px; '.$widthCell.'mm;"
src="'.$path.$infoCertificate['signature4'].'" />'
: '').
'</td>
<td colspan="4" class="logo-seals" style="width:'.(2 * $widthCell).'mm">'.
((!empty($infoCertificate['seal']))
? '<img style="max-height: 100px; '.(2 * $widthCell).'mm;"
src="'.$path.$infoCertificate['seal'].'" />'
: '').
'</td>';
$htmlText .= '</tr>';
$htmlText .= '</table>';
$htmlText .= '</div>';
// Rear certificate
if ($infoCertificate['contents_type'] != 3) {
$htmlText .= '<div class="caraB" style="page-break-before:always; margin:0px; padding:0px;">';
if ($infoCertificate['contents_type'] == 0) {
$courseDescription = new CourseDescription();
$contentDescription = $courseDescription->get_data_by_description_type(3, $courseId, 0);
$domd = new DOMDocument();
libxml_use_internal_errors(true);
if (isset($contentDescription['description_content'])) {
$domd->loadHTML($contentDescription['description_content']);
}
libxml_use_internal_errors(false);
$domx = new DOMXPath($domd);
$items = $domx->query("//li[@style]");
foreach ($items as $item) {
$item->removeAttribute("style");
}
$items = $domx->query("//span[@style]");
foreach ($items as $item) {
$item->removeAttribute("style");
}
$output = $domd->saveHTML();
$htmlText .= getIndexFiltered($output);
}
if ($infoCertificate['contents_type'] == 1) {
$items = [];
$categoriesTempList = learnpath::getCategories($courseId);
$categoryTest = new CLpCategory();
$categoryTest->setId(0);
$categoryTest->setName($plugin->get_lang('WithOutCategory'));
$categoryTest->setPosition(0);
$categories = [$categoryTest];
if (!empty($categoriesTempList)) {
$categories = array_merge($categories, $categoriesTempList);
}
foreach ($categories as $item) {
$categoryId = $item->getId();
if (!learnpath::categoryIsVisibleForStudent($item, api_get_user_entity($studentId))) {
continue;
}
$sql = "SELECT 1
FROM $tblProperty
WHERE tool = 'learnpath_category'
AND ref = $categoryId
AND visibility = 0
AND (session_id = $sessionId OR session_id IS NULL)";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
continue;
}
$list = new LearnpathList(
$studentId,
$courseCode,
$sessionId,
null,
false,
$categoryId
);
$flat_list = $list->get_flat_list();
if (empty($flat_list)) {
continue;
}
if (count($categories) > 1 && count($flat_list) > 0) {
if ($item->getName() != $plugin->get_lang('WithOutCategory')) {
$items[] = '<h4 style="margin:0">'.$item->getName().'</h4>';
}
}
foreach ($flat_list as $learnpath) {
$lpId = $learnpath['lp_old_id'];
$sql = "SELECT 1
FROM $tblProperty
WHERE tool = 'learnpath'
AND ref = $lpId AND visibility = 0
AND (session_id = $sessionId OR session_id IS NULL)";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
continue;
}
$lpName = $learnpath['lp_name'];
$items[] = $lpName.'<br>';
}
$items[] = '<br>';
}
if (count($items) > 0) {
$htmlText .= '<table width="100%" class="contents-learnpath">';
$htmlText .= '<tr>';
$htmlText .= '<td>';
$i = 0;
foreach ($items as $value) {
if ($i == 50) {
$htmlText .= '</td><td>';
}
$htmlText .= $value;
$i++;
}
$htmlText .= '</td>';
$htmlText .= '</tr>';
$htmlText .= '</table>';
}
$htmlText .= '</td></table>';
}
if ($infoCertificate['contents_type'] == 2) {
$htmlText .= '<table width="100%" class="contents-learnpath">';
$htmlText .= '<tr>';
$htmlText .= '<td>';
$myContentHtml = strip_tags(
$infoCertificate['contents'],
'<p><b><strong><table><tr><td><th><span><i><li><ol><ul>'.
'<dd><dt><dl><br><hr><img><a><div><h1><h2><h3><h4><h5><h6>'
);
$htmlText .= $myContentHtml;
$htmlText .= '</td>';
$htmlText .= '</tr>';
$htmlText .= '</table>';
}
$htmlText .= '</div>';
}
}
$htmlText .= '</body></html>';
$fileName = 'certificate_'.date("Ymd_His");
$params = [
'filename' => $fileName,
'pdf_title' => "Certificate",
'pdf_description' => '',
'format' => 'A4-L',
'orientation' => 'L',
'left' => 15,
'top' => 15,
'bottom' => 0,
];
$pdf = new PDF($params['format'], $params['orientation'], $params);
$pdf->content_to_pdf($htmlText, '', $fileName, null, 'D', false, null, false, false, false);
exit;
function getIndexFiltered($index)
{
$txt = strip_tags($index, "<b><strong><i>");
$txt = str_replace(chr(13).chr(10).chr(13).chr(10), chr(13).chr(10), $txt);
$lines = explode(chr(13).chr(10), $txt);
$text1 = '';
for ($x = 0; $x < 47; $x++) {
$text1 .= $lines[$x].chr(13).chr(10);
}
$text2 = '';
for ($x = 47; $x < 94; $x++) {
$text2 .= $lines[$x].chr(13).chr(10);
}
$showLeft = str_replace(chr(13).chr(10), "<br/>", $text1);
$showRight = str_replace(chr(13).chr(10), "<br/>", $text2);
$result = '<table width="100%">';
$result .= '<tr>';
$result .= '<td style="width:50%;vertical-align:top;padding-left:15px; font-size:12px;">'.$showLeft.'</td>';
$result .= '<td style="vertical-align:top; font-size:12px;">'.$showRight.'</td>';
$result .= '<tr>';
$result .= '</table>';
return $result;
}

@ -0,0 +1,34 @@
<?php
/**
* This script initiates a customcertificate plugin.
*
* @package chamilo.plugin.customcertificate
*/
$course_plugin = 'customcertificate';
require_once __DIR__.'/config.php';
$plugin = CustomCertificatePlugin::create();
$enable = $plugin->get('enable_plugin_customcertificate') == 'true';
if ($enable) {
if (api_is_platform_admin() || api_is_teacher()) {
$url = 'src/index.php?';
$url .= (isset($_GET['cidReq']) ? api_get_cidreq() : 'default=1');
header('Location: '.$url);
exit;
} else {
$session = api_get_session_entity(api_get_session_id());
$_course = api_get_course_info();
$webCoursePath = api_get_path(WEB_COURSE_PATH);
$url = $webCoursePath.$_course['path'].'/index.php'.($session ? '?id_session='.$session->getId() : '');
Display::addFlash(
Display::return_message($plugin->get_lang('OnlyAdminPlatform'))
);
header('Location: '.$url);
exit;
}
} else {
api_not_allowed(true, $plugin->get_lang('ToolDisabled'));
}

@ -0,0 +1,12 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables.
*
* @package chamilo.plugin.customcertificate
*/
require_once __DIR__.'/config.php';
CustomCertificatePlugin::create()->uninstall();

@ -0,0 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script is meant to update previous version the plugin.
*
* @package chamilo.plugin.customcertificate
*/
require_once __DIR__.'/config.php';
if (!api_is_platform_admin()) {
die('You must have admin permissions to install plugins');
}
CustomCertificatePlugin::create()->update();

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
## Learning calendar

@ -0,0 +1,43 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
$calendarId = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$plugin = LearningCalendarPlugin::create();
$item = $plugin->getCalendar($calendarId);
$plugin->protectCalendar($item);
switch ($action) {
case 'toggle_day':
$startDate = isset($_REQUEST['start_date']) ? $_REQUEST['start_date'] : '';
if (empty($startDate)) {
exit;
}
$endDate = isset($_REQUEST['end_date']) ? $_REQUEST['end_date'] : '';
if ($startDate == $endDate) {
// One day
$plugin->toogleDayType($calendarId, $startDate);
} else {
// A list of days
$startDateTime = new DateTime($startDate);
$endDateTime = new DateTime($endDate);
$diff = $startDateTime->diff($endDateTime);
$countDays = $diff->format('%a');
$dayList[] = $startDate;
for ($i = 0; $i < $countDays; $i++) {
$startDateTime->modify('+1 day');
$dayList[] = $startDateTime->format('Y-m-d');
}
foreach ($dayList as $day) {
$plugin->toogleDayType($calendarId, $day);
}
}
break;
case 'get_events':
$list = $plugin->getEvents($calendarId);
echo json_encode($list);
break;
}

@ -0,0 +1,50 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
$calendarId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$plugin = LearningCalendarPlugin::create();
$item = $plugin->getCalendar($calendarId);
$plugin->protectCalendar($item);
$isoCode = api_get_language_isocode();
$htmlHeadXtra[] = api_get_asset('bootstrap-year-calendar/js/bootstrap-year-calendar.js');
$calendarLanguage = 'en';
if ($isoCode !== 'en') {
$file = 'bootstrap-year-calendar/js/languages/bootstrap-year-calendar.'.$isoCode.'.js';
$path = api_get_path(SYS_PUBLIC_PATH).'assets/'.$file;
if (file_exists($path)) {
$htmlHeadXtra[] = api_get_asset($file);
$calendarLanguage = $isoCode;
}
}
$htmlHeadXtra[] = api_get_css_asset('bootstrap-year-calendar/css/bootstrap-year-calendar.css');
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$formToString = '';
$template = new Template();
$actionLeft = Display::url(
Display::return_icon(
'back.png',
get_lang('Add'),
null,
ICON_SIZE_MEDIUM
),
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php'
);
$actions = Display::toolbarAction('toolbar-forum', [$actionLeft]);
$eventList = $plugin->getEventTypeList();
$template->assign('events', $eventList);
$template->assign('calendar_language', $calendarLanguage);
$template->assign('ajax_url', api_get_path(WEB_PLUGIN_PATH).'learning_calendar/ajax.php?id='.$calendarId);
$template->assign('header', $item['title']);
$content = $template->fetch('learning_calendar/view/calendar.tpl');
$template->assign('actions', $actions);
$template->assign('content', $content);
$template->display_one_col_template();

@ -0,0 +1,108 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
$calendarId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$plugin = LearningCalendarPlugin::create();
$plugin->protectCalendar($calendarId);
$item = $plugin->getCalendar($calendarId);
if (empty($item)) {
api_not_allowed(true);
}
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$formToString = '';
$template = new Template();
$actionLeft = Display::url(
Display::return_icon(
'back.png',
get_lang('Add'),
null,
ICON_SIZE_MEDIUM
),
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php'
);
$actions = Display::toolbarAction('toolbar-forum', [$actionLeft]);
// jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_calendar_users&id='.$calendarId;
// The order is important you need to check the the $column variable in the model.ajax.php file
$columns = [
get_lang('FirstName'),
get_lang('LastName'),
get_lang('Exam'),
];
// Column config
$column_model = [
['name' => 'firstname', 'index' => 'firstname', 'width' => '35', 'align' => 'left', 'sortable' => 'false'],
['name' => 'lastname', 'index' => 'lastname', 'width' => '35', 'align' => 'left', 'sortable' => 'false'],
[
'name' => 'exam',
'index' => 'exam',
'width' => '20',
'align' => 'center',
'sortable' => 'false',
],
];
// Autowidth
$extraParams['autowidth'] = 'true';
// height auto
$extraParams['height'] = 'auto';
$extraParams['sortname'] = 'name';
$extraParams['sortorder'] = 'desc';
$extraParams['multiselect'] = true;
$deleteIcon = Display::return_icon('delete.png', get_lang('Delete'), null, ICON_SIZE_SMALL);
$urlStats = api_get_path(WEB_CODE_PATH);
$action_links = '';
$deleteUrl = '';
// Add the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();
Display::display_header();
?>
<script>
$(function() {
<?php
// grid definition see the $usergroup>display() function
echo Display::grid_js(
'usergroups',
$url,
$columns,
$column_model,
$extraParams,
[],
$action_links,
true
);
?>
$("#usergroups").jqGrid(
"navGrid",
"#usergroups_pager",
{ edit: false, add: false, del: true, search: false},
{ height:280, reloadAfterSubmit:false }, // edit options
{ height:280, reloadAfterSubmit:false }, // add options
{ reloadAfterSubmit:false, url: "<?php echo $deleteUrl; ?>" }, // del options
{ width:500 } // search options
);
});
</script>
<?php
// action links
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/usergroup_users.php?id='.$calendarId.'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', '32').
'</a>';
echo '</div>';
echo Display::grid_html('usergroups');
Display::display_footer();

@ -0,0 +1,8 @@
<?php
/* For license terms, see /license.txt */
if (!api_is_platform_admin()) {
die('You must have admin permissions to install plugins');
}
LearningCalendarPlugin::create()->install();

@ -0,0 +1,22 @@
<?php
/* For license terms, see /license.txt */
$strings['plugin_title'] = 'Learning calendar';
$strings['plugin_comment'] = '';
$strings['enabled'] = 'Enabled';
$strings['LearningCalendar'] = 'Learning calendar';
$strings['NumberDaysAccumulatedInCalendar'] = 'Number of days accumulated in the calendar: ';
$strings['NumberDaysAccumulatedInLp'] = 'Number of days accumulated in the LP: ';
$strings['NumberDaysInRetard'] = 'Number of days in retard: ';
$strings['DifferenceOfDaysAndCalendar'] = 'Difference of days and calendar';
$strings['EventTypeTaken'] = 'Taken';
$strings['EventTypeExam'] = 'Exam';
$strings['EventTypeFree'] = 'Free';
$strings['CourseHoursDuration'] = 'Course hours duration';
$strings['LearningCalendarOneDayMarker'] = 'Learning calendar one day marker';
$strings['ControlPointAdded'] = 'Control point added';
$strings['NumberOfDays'] = 'Number of days';
$strings['Date'] = 'Date';
$strings['AddMultipleUsersToCalendar'] = 'Add multiple users to a calendar';
$strings['UpdateCalendar'] = 'Update calendar';

@ -0,0 +1,14 @@
<?php
/* For license terms, see /license.txt */
$strings['plugin_title'] = 'Learning calendar';
$strings['plugin_comment'] = '';
$strings['enabled'] = 'Enabled';
$strings['LearningCalendar'] = 'Learning calendar';
$strings['NumberDaysAccumulatedInCalendar'] = 'Nombre de jours cumulés dans le calendrier: ';
$strings['NumberDaysAccumulatedInLp'] = 'Nombre de jours cumulés dans les parcours réalisés: ';
$strings['NumberDaysInRetard'] = "Nombre de jour de retard ou d'avance à la date d'aujourd'hui: ";
$strings['DifferenceOfDaysAndCalendar'] = 'Différence de nombre de jours avec le plan issu du learning_calendar';
$strings['EventTypeTaken'] = 'Occupé';
$strings['EventTypeExam'] = 'Examen';
$strings['EventTypeFree'] = 'Libre';

@ -0,0 +1,7 @@
<?php
/* For license terms, see /license.txt */
$strings['plugin_title'] = 'Learning calendar';
$strings['plugin_comment'] = '';
$strings['enabled'] = 'Activado';
$strings['LearningCalendar'] = 'Learning calendar';

@ -0,0 +1,4 @@
<?php
/* For license terms, see /license.txt */
$plugin_info = LearningCalendarPlugin::create()->get_info();

@ -0,0 +1,191 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
$allow = api_is_platform_admin() || api_is_teacher();
if (!$allow) {
api_not_allowed(true);
}
$plugin = LearningCalendarPlugin::create();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$calendarId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$formToString = '';
switch ($action) {
case 'add':
$form = new FormValidator('calendar', 'post', api_get_self().'?action=add');
$plugin->getForm($form);
$form->addButtonSave(get_lang('Save'));
$formToString = $form->returnForm();
if ($form->validate()) {
$values = $form->getSubmitValues();
$params = [
'title' => $values['title'],
'total_hours' => $values['total_hours'],
'minutes_per_day' => $values['minutes_per_day'],
'description' => $values['description'],
'author_id' => api_get_user_id(),
];
Database::insert('learning_calendar', $params);
Display::addFlash(Display::return_message(get_lang('Saved')));
header('Location: start.php');
exit;
}
break;
case 'edit':
$form = new FormValidator('calendar', 'post', api_get_self().'?action=edit&id='.$calendarId);
$plugin->getForm($form);
$form->addButtonSave(get_lang('Update'));
$item = $plugin->getCalendar($calendarId);
$plugin->protectCalendar($item);
if (empty($item)) {
api_not_allowed(true);
}
$form->setDefaults($item);
$formToString = $form->returnForm();
if ($form->validate()) {
$values = $form->getSubmitValues();
$params = [
'title' => $values['title'],
'total_hours' => $values['total_hours'],
'minutes_per_day' => $values['minutes_per_day'],
'description' => $values['description'],
];
Database::update('learning_calendar', $params, ['id = ?' => $calendarId]);
Display::addFlash(Display::return_message(get_lang('Updated')));
header('Location: start.php');
exit;
}
break;
case 'copy':
$result = $plugin->copyCalendar($calendarId);
if ($result) {
Display::addFlash(Display::return_message(get_lang('Saved')));
}
header('Location: start.php');
exit;
break;
case 'delete':
$result = $plugin->deleteCalendar($calendarId);
if ($result) {
Display::addFlash(Display::return_message(get_lang('Deleted')));
}
header('Location: start.php');
exit;
break;
case 'toggle_visibility':
$itemId = isset($_REQUEST['lp_item_id']) ? $_REQUEST['lp_item_id'] : 0;
$lpId = isset($_REQUEST['lp_id']) ? $_REQUEST['lp_id'] : 0;
$plugin->toggleVisibility($itemId);
Display::addFlash(Display::return_message(get_lang('Updated')));
$url = api_get_path(WEB_CODE_PATH).
'lp/lp_controller.php?action=add_item&type=step&lp_id='.$lpId.'&'.api_get_cidreq();
header("Location: $url");
exit;
break;
}
$htmlHeadXtra[] = api_get_jqgrid_js();
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_learning_path_calendars';
$columns = [
get_lang('Title'),
get_lang('TotalHours'),
get_lang('MinutesPerDay'),
get_lang('Actions'),
];
$columnModel = [
[
'name' => 'title',
'index' => 'title',
'width' => '300',
'align' => 'left',
'sortable' => 'false',
],
[
'name' => 'total_hours',
'index' => 'total_hours',
'width' => '100',
'align' => 'left',
'sortable' => 'false',
],
[
'name' => 'minutes_per_day',
'index' => 'minutes_per_day',
'width' => '100',
'align' => 'left',
'sortable' => 'false',
],
[
'name' => 'actions',
'index' => 'actions',
'width' => '150',
'align' => 'left',
//'formatter' => 'action_formatter',
'sortable' => 'false',
],
];
$extraParams = [];
$extraParams['autowidth'] = 'true';
// height auto
$extraParams['height'] = 'auto';
$template = new Template();
if (in_array($action, ['add', 'edit'])) {
$actionLeft = Display::url(
Display::return_icon(
'back.png',
get_lang('Back'),
null,
ICON_SIZE_MEDIUM
),
api_get_self().'?'.api_get_cidreq()
);
} else {
$actionLeft = Display::url(
Display::return_icon(
'add.png',
get_lang('Add'),
null,
ICON_SIZE_MEDIUM
),
api_get_self().'?'.api_get_cidreq().'&action=add'
);
$content = '<script>
$(function() {'.
Display::grid_js(
'calendars',
$url,
$columns,
$columnModel,
$extraParams,
[],
'',
true
).'
});
</script>';
$content .= Display::grid_html('calendars');
$template->assign('grid', $content);
}
$template->assign('form', $formToString);
$actions = Display::toolbarAction('toolbar-calendar', [$actionLeft]);
$content = $template->fetch('learning_calendar/view/start.tpl');
$template->assign('content', $content);
$template->assign('actions', $actions);
$template->display_one_col_template();

@ -0,0 +1,4 @@
<?php
/* For license terms, see /license.txt */
LearningCalendarPlugin::create()->uninstall();

@ -0,0 +1,102 @@
<script>
function getEvents(e) {
var myData = [];
$.ajax({
dataType: "json",
url: "{{ ajax_url }}&a=get_events",
success: function(response) {
for (var i = 0; i < response.length; i++) {
myData.push({
id: response[i].id,
title: response[i].title,
startDate: new Date(response[i].start_date),
endDate: new Date(response[i].end_date),
color: response[i].color
});
}
$(e.target).data('calendar').setDataSource(myData);
}
});
}
$(document).ready(function() {
$('#calendar').calendar({
style:'background',
language : '{{ calendar_language }}',
enableRangeSelection: true,
enableContextMenu: true,
/*contextMenuItems:[
{
text: 'Update',
//click: editEvent
},
{
text: 'Delete',
click: deleteEvent
}
],*/
customDayRenderer: function(e) {
$(e).parent().css('background-color', 'green');
},
{#clickDay: function(e) {#}
{#var dateString = moment(e.date).format("YYYY-MM-DD");#}
{#$.ajax({#}
{#type: "GET",#}
{#url: "{{ ajax_url }}&a=toggle_day&start_date="+dateString+"&end_date=",#}
{#success: function(returnValue) {#}
{#getEvents(e);#}
{#}#}
{#});#}
{#},#}
selectRange: function(e) {
var startString = moment(e.startDate).format("YYYY-MM-DD");
var endString = moment(e.endDate).format("YYYY-MM-DD");
$.ajax({
type: "GET",
url: "{{ ajax_url }}&a=toggle_day&start_date="+startString+"&end_date=" + endString,
success: function(returnValue) {
getEvents(e);
}
});
},
yearChanged: function(e) {
e.preventRendering = true;
$(e.target).append('<div style="text-align:center"><i class="fa fa-spinner fa-spin fa-2x"></i></div>');
getEvents(e);
},
});
});
</script>
<style>
#calendar {
overflow: visible;
}
.calendar table.month tr td .day-content {
height: 24px;
}
</style>
<div class="row">
<div class="col-xs-12 col-md-12">
<div id="calendar"></div>
</div>
</div>
<br />
<br />
<div class="row">
<div class="col-xs-12 col-md-12">
<table>
{% for event in events %}
<tr>
<td>
{{ event.name }}:
</td>
<td>
<span style="display:block;height:20px;width:100px; background-color: {{ event.color }}"></span>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>

@ -0,0 +1,3 @@
{{ form }}
{{ grid }}
Loading…
Cancel
Save