diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php
index 71bc5c7d6e..450b80aeeb 100755
--- a/main/gradebook/lib/fe/gradebooktable.class.php
+++ b/main/gradebook/lib/fe/gradebooktable.class.php
@@ -117,6 +117,7 @@ class GradebookTable extends SortableTable
$course_code=api_get_course_id();
$status_user=api_get_status_of_user_in_course ($user_id,$course_code);
$data_array = $this->datagen->get_data($sorting, $from, $this->per_page);
+
// generate the data to display
$sortable_data = array();
$weight_total_links = 0;
@@ -197,9 +198,8 @@ class GradebookTable extends SortableTable
'.$scoretotal_display;
//register gradebook certificate
- $current_user_id=api_get_user_id();
- $date_certificate=date('Y-m-d H:i:s',time());
- register_user_info_about_certificate($id,$current_user_id,$my_score_in_gradebook,$date_certificate);
+ $current_user_id=api_get_user_id();
+ register_user_info_about_certificate($id,$current_user_id,$my_score_in_gradebook,api_get_utc_datetime());
} else {
$certificates = '-';
@@ -209,15 +209,14 @@ class GradebookTable extends SortableTable
if ($get_date=='' || is_null($get_date)) {
$row[4]='-';
} else {
- $row[4] = date('d/m/y H:i:s',strtotime($get_date));
+ $row[4] = api_convert_and_format_date($get_date);
}
$row[] = $certificates;
- } elseif ($_GET['selectcat'] == 1) {
+ } else {
if (isset($certificate_min_score) && (int)$item_value >= (int)$certificate_min_score) {
//register gradebook certificate
$current_user_id=api_get_user_id();
- $date_certificate=date('Y-m-d H:i:s',time());
- register_user_info_about_certificate($id,$current_user_id,$my_score_in_gradebook,$date_certificate);
+ register_user_info_about_certificate($_GET['selectcat'],$current_user_id,$my_score_in_gradebook,api_get_utc_datetime());
}
}
@@ -227,8 +226,7 @@ class GradebookTable extends SortableTable
// warning messages
- if (api_is_allowed_to_edit()) {
-
+ if (api_is_allowed_to_edit()) {
if (isset($_GET['selectcat']) && $_GET['selectcat'] > 0 && $_GET['view'] <> 'presence') {
$id_cat = intval($_GET['selectcat']);
$category = Category :: load($id_cat);
diff --git a/main/gradebook/lib/gradebook_data_generator.class.php b/main/gradebook/lib/gradebook_data_generator.class.php
index bc02bbb7d8..bbaa38c6e4 100755
--- a/main/gradebook/lib/gradebook_data_generator.class.php
+++ b/main/gradebook/lib/gradebook_data_generator.class.php
@@ -3,7 +3,7 @@
/**
* Class to select, sort and transform object data into array data,
* used for the general gradebook view
- * @author Bert Stepp�
+ * @author Bert Steppé
*/
class GradebookDataGenerator
{
diff --git a/main/gradebook/lib/gradebook_functions_users.inc.php b/main/gradebook/lib/gradebook_functions_users.inc.php
index 098a73dfe5..c937b689b9 100755
--- a/main/gradebook/lib/gradebook_functions_users.inc.php
+++ b/main/gradebook/lib/gradebook_functions_users.inc.php
@@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Various user related functions
+ * @author Julio Montoya adding security functions
* @package chamilo.gradebook
*/
/**