|
@@ -5,11 +5,11 @@
|
|
|
* This file contains class used like library, provides functions for thematic option inside attendance tool. It's also used like model to thematic_controller (MVC pattern)
|
|
|
* Thematic class can be used to instanciate objects or as a library for thematic control
|
|
|
* @author Christian Fasanando <christian1827@gmail.com>
|
|
|
- * @author Julio Montoya <gugli100@gmail.com> SQL fixes
|
|
|
+ * @author Julio Montoya <gugli100@gmail.com> SQL fixes
|
|
|
* @package chamilo.course_progress
|
|
|
*/
|
|
|
class Thematic
|
|
|
-{
|
|
|
+{
|
|
|
private $session_id;
|
|
|
private $thematic_id;
|
|
|
private $thematic_title;
|
|
@@ -17,7 +17,7 @@ class Thematic
|
|
|
private $thematic_plan_id;
|
|
|
private $thematic_plan_title;
|
|
|
private $thematic_plan_description;
|
|
|
- private $thematic_plan_description_type;
|
|
|
+ private $thematic_plan_description_type;
|
|
|
private $thematic_advance_id;
|
|
|
private $attendance_id;
|
|
|
private $thematic_advance_content;
|
|
@@ -27,8 +27,8 @@ class Thematic
|
|
|
|
|
|
public function __construct() {
|
|
|
$this->course_int_id = api_get_course_int_id();
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Get the total number of thematic inside current course and current session
|
|
|
* @see SortableTable#get_total_number_of_items()
|
|
@@ -41,7 +41,7 @@ class Thematic
|
|
|
}
|
|
|
$course_id = api_get_course_int_id();
|
|
|
$sql = "SELECT COUNT(id) AS total_number_of_items FROM $tbl_thematic WHERE c_id = $course_id AND active = 1 $condition_session ";
|
|
|
- $res = Database::query($sql);
|
|
|
+ $res = Database::query($sql);
|
|
|
$obj = Database::fetch_object($res);
|
|
|
return $obj->total_number_of_items;
|
|
|
}
|
|
@@ -57,24 +57,24 @@ class Thematic
|
|
|
public function get_thematic_data($from, $number_of_items, $column, $direction) {
|
|
|
$tbl_thematic = Database :: get_course_table(TABLE_THEMATIC);
|
|
|
$condition_session = '';
|
|
|
- if (!api_get_session_id()) {
|
|
|
+ if (!api_get_session_id()) {
|
|
|
$condition_session = api_get_session_condition(0);
|
|
|
- }
|
|
|
+ }
|
|
|
$column = intval($column);
|
|
|
$from = intval($from);
|
|
|
$number_of_items = intval($number_of_items);
|
|
|
-
|
|
|
+
|
|
|
if (!in_array($direction, array('ASC','DESC'))) {
|
|
|
$direction = 'ASC';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
+
|
|
|
$sql = "SELECT id AS col0, title AS col1, display_order AS col2, session_id FROM $tbl_thematic
|
|
|
WHERE c_id = $course_id AND active = 1 $condition_session
|
|
|
ORDER BY col2 LIMIT $from,$number_of_items ";
|
|
|
$res = Database::query($sql);
|
|
|
-
|
|
|
+
|
|
|
$thematics = array ();
|
|
|
|
|
|
$param_gradebook = '';
|
|
@@ -82,34 +82,34 @@ class Thematic
|
|
|
$param_gradebook = '&gradebook='.$_SESSION['gradebook'];
|
|
|
}
|
|
|
$user_info = api_get_user_info(api_get_user_id());
|
|
|
-
|
|
|
+
|
|
|
while ($thematic = Database::fetch_row($res)) {
|
|
|
$session_star = '';
|
|
|
if (api_get_session_id() == $thematic[3]) {
|
|
|
$session_star = api_get_session_image(api_get_session_id(), $user_info['status']);
|
|
|
- }
|
|
|
- $thematic[1] = '<a href="index.php?'.api_get_cidreq().'&action=thematic_details&thematic_id='.$thematic[0].$param_gradebook.'">'.Security::remove_XSS($thematic[1], STUDENT).$session_star.'</a>';
|
|
|
+ }
|
|
|
+ $thematic[1] = '<a href="index.php?'.api_get_cidreq().'&action=thematic_details&thematic_id='.$thematic[0].$param_gradebook.'">'.Security::remove_XSS($thematic[1], STUDENT).$session_star.'</a>';
|
|
|
if (api_is_allowed_to_edit(null, true)) {
|
|
|
$actions = '';
|
|
|
-
|
|
|
- if (api_get_session_id()) {
|
|
|
+
|
|
|
+ if (api_get_session_id()) {
|
|
|
if (api_get_session_id() == $thematic[3]) {
|
|
|
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a> ';
|
|
|
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a> ';
|
|
|
-
|
|
|
- $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>';
|
|
|
- $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a>';
|
|
|
+
|
|
|
+ $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>';
|
|
|
+ $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a>';
|
|
|
} else {
|
|
|
$actions .= Display::return_icon('lesson_plan_na.png',get_lang('ThematicPlan'),'',22).' ';
|
|
|
$actions .= Display::return_icon('lesson_plan_calendar_na.png',get_lang('ThematicAdvance'),'',22).' ';
|
|
|
$actions .= Display::return_icon('edit_na.png',get_lang('Edit'),'',22);
|
|
|
$actions .= Display::return_icon('delete_na.png',get_lang('Delete'),'',22).' ';
|
|
|
- $actions .= Display::url(Display::return_icon('cd.gif', get_lang('Copy')), 'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$thematic[0].$param_gradebook);
|
|
|
- }
|
|
|
- } else {
|
|
|
+ $actions .= Display::url(Display::return_icon('cd.gif', get_lang('Copy')), 'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$thematic[0].$param_gradebook);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a> ';
|
|
|
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a> ';
|
|
|
-
|
|
|
+
|
|
|
if ($thematic[2] > 1) {
|
|
|
$actions .= '<a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('up.png', get_lang('Up'),'',22).'</a>';
|
|
|
} else {
|
|
@@ -121,7 +121,7 @@ class Thematic
|
|
|
$actions .= Display::return_icon('down_na.png',' ','',22);
|
|
|
}
|
|
|
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>';
|
|
|
- $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a>';
|
|
|
+ $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].$param_gradebook.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a>';
|
|
|
}
|
|
|
$thematics[] = array($thematic[0], $thematic[1], $actions);
|
|
|
}
|
|
@@ -141,10 +141,10 @@ class Thematic
|
|
|
$condition_session = api_get_session_condition($session_id);
|
|
|
} else {
|
|
|
$condition_session = '';
|
|
|
- }
|
|
|
+ }
|
|
|
$course_id = api_get_course_int_id();
|
|
|
$sql = "SELECT MAX(display_order) FROM $tbl_thematic WHERE c_id = $course_id AND active = 1 $condition_session";
|
|
|
- $rs = Database::query($sql);
|
|
|
+ $rs = Database::query($sql);
|
|
|
$row = Database::fetch_array($rs);
|
|
|
return $row[0];
|
|
|
}
|
|
@@ -218,9 +218,9 @@ class Thematic
|
|
|
$tbl_thematic = Database :: get_course_table(TABLE_THEMATIC);
|
|
|
$course_info = api_get_course_info($course_code);
|
|
|
$course_id = $course_info['real_id'];
|
|
|
-
|
|
|
+
|
|
|
if (isset($session_id)) {
|
|
|
- $session_id = intval($session_id);
|
|
|
+ $session_id = intval($session_id);
|
|
|
} else {
|
|
|
$session_id = api_get_session_id();
|
|
|
}
|
|
@@ -238,7 +238,7 @@ class Thematic
|
|
|
$condition = " WHERE active = 1 $condition_session ";
|
|
|
}
|
|
|
$sql = "SELECT * FROM $tbl_thematic $condition AND c_id = $course_id ORDER BY display_order ";
|
|
|
-
|
|
|
+
|
|
|
$res = Database::query($sql);
|
|
|
if (Database::num_rows($res) > 0) {
|
|
|
if (!empty($thematic_id)) {
|
|
@@ -270,10 +270,10 @@ class Thematic
|
|
|
|
|
|
// get the maximum display order of all the glossary items
|
|
|
$max_thematic_item = $this->get_max_thematic_item(false);
|
|
|
-
|
|
|
+
|
|
|
if (empty($id)) {
|
|
|
// insert
|
|
|
- $sql = "INSERT INTO $tbl_thematic (c_id, title, content, active, display_order, session_id)
|
|
|
+ $sql = "INSERT INTO $tbl_thematic (c_id, title, content, active, display_order, session_id)
|
|
|
VALUES ($this->course_int_id, '$title', '$content', 1, ".(intval($max_thematic_item)+1).", $session_id) ";
|
|
|
Database::query($sql);
|
|
|
$last_id = Database::insert_id();
|
|
@@ -306,7 +306,7 @@ class Thematic
|
|
|
$affected_rows = 0;
|
|
|
$user_id = api_get_user_id();
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
+
|
|
|
if (is_array($thematic_id)) {
|
|
|
foreach ($thematic_id as $id) {
|
|
|
$id = intval($id);
|
|
@@ -332,31 +332,31 @@ class Thematic
|
|
|
}
|
|
|
return $affected_rows;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function copy($thematic_id) {
|
|
|
- $thematic = self::get_thematic_list($thematic_id, api_get_course_id(), 0);
|
|
|
+ $thematic = self::get_thematic_list($thematic_id, api_get_course_id(), 0);
|
|
|
$thematic_copy = new Thematic();
|
|
|
$thematic_copy->set_thematic_attributes('', $thematic['title'].' - '.get_lang('Copy'), $thematic['content'], api_get_session_id());
|
|
|
-
|
|
|
+
|
|
|
$new_thematic_id = $thematic_copy->thematic_save();
|
|
|
if (!empty($new_thematic_id)) {
|
|
|
$thematic_advanced = self::get_thematic_advance_by_thematic_id($thematic_id);
|
|
|
if(!empty($thematic_advanced)) {
|
|
|
- foreach($thematic_advanced as $item) {
|
|
|
- $thematic = new Thematic();
|
|
|
- $thematic->set_thematic_advance_attributes(0, $new_thematic_id, 0, $item['content'], $item['start_date'], $item['duration']);
|
|
|
- $thematic->thematic_advance_save();
|
|
|
+ foreach($thematic_advanced as $item) {
|
|
|
+ $thematic = new Thematic();
|
|
|
+ $thematic->set_thematic_advance_attributes(0, $new_thematic_id, 0, $item['content'], $item['start_date'], $item['duration']);
|
|
|
+ $thematic->thematic_advance_save();
|
|
|
}
|
|
|
}
|
|
|
- $thematic_plan = self::get_thematic_plan_data($thematic_id);
|
|
|
+ $thematic_plan = self::get_thematic_plan_data($thematic_id);
|
|
|
if (!empty($thematic_plan)) {
|
|
|
- foreach ($thematic_plan as $item) {
|
|
|
- $thematic = new Thematic();
|
|
|
- $thematic->set_thematic_plan_attributes($new_thematic_id, $item['title'], $item['description'], $item['description_type']);
|
|
|
- $thematic->thematic_plan_save();
|
|
|
+ foreach ($thematic_plan as $item) {
|
|
|
+ $thematic = new Thematic();
|
|
|
+ $thematic->set_thematic_plan_attributes($new_thematic_id, $item['title'], $item['description'], $item['description_type']);
|
|
|
+ $thematic->thematic_plan_save();
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -367,7 +367,7 @@ class Thematic
|
|
|
global $thematic_id;
|
|
|
$tbl_thematic_advance = Database :: get_course_table(TABLE_THEMATIC_ADVANCE);
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
+
|
|
|
$sql = "SELECT COUNT(id) AS total_number_of_items FROM $tbl_thematic_advance WHERE c_id = $course_id AND thematic_id = $thematic_id ";
|
|
|
$res = Database::query($sql);
|
|
|
$res = Database::query($sql);
|
|
@@ -395,33 +395,33 @@ class Thematic
|
|
|
$direction = 'ASC';
|
|
|
}
|
|
|
$data = array();
|
|
|
-
|
|
|
- $course_id = api_get_course_int_id();
|
|
|
-
|
|
|
+
|
|
|
+ $course_id = api_get_course_int_id();
|
|
|
+
|
|
|
if (api_is_allowed_to_edit(null, true)) {
|
|
|
-
|
|
|
+
|
|
|
$sql = "SELECT id AS col0, start_date AS col1, duration AS col2, content AS col3 FROM $tbl_thematic_advance
|
|
|
WHERE c_id = $course_id AND thematic_id = $thematic_id
|
|
|
ORDER BY col$column $direction LIMIT $from,$number_of_items ";
|
|
|
-
|
|
|
+
|
|
|
$list = api_get_item_property_by_tool('thematic_advance', api_get_course_id(), api_get_session_id());
|
|
|
-
|
|
|
+
|
|
|
$elements = array();
|
|
|
foreach ($list as $value) {
|
|
|
$elements[] = $value['ref'];
|
|
|
- }
|
|
|
-
|
|
|
- $res = Database::query($sql);
|
|
|
+ }
|
|
|
+
|
|
|
+ $res = Database::query($sql);
|
|
|
$i = 1;
|
|
|
while ($thematic_advance = Database::fetch_row($res)) {
|
|
|
-
|
|
|
+
|
|
|
if(in_array($thematic_advance[0], $elements)) {
|
|
|
$thematic_advance[1] = api_get_local_time($thematic_advance[1]);
|
|
|
- $thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG);
|
|
|
+ $thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG);
|
|
|
$actions = '';
|
|
|
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>';
|
|
|
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a></center>';
|
|
|
- $data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions);
|
|
|
+ $data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions);
|
|
|
$i++;
|
|
|
}
|
|
|
}
|
|
@@ -436,23 +436,23 @@ class Thematic
|
|
|
* @return array data
|
|
|
*/
|
|
|
public function get_thematic_advance_by_thematic_id($thematic_id, $course_code = null) {
|
|
|
-
|
|
|
+
|
|
|
$course_info = api_get_course_info($course_code);
|
|
|
$course_id = $course_info['real_id'];
|
|
|
-
|
|
|
+
|
|
|
// set current course
|
|
|
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
|
|
|
-
|
|
|
+
|
|
|
$thematic_id = intval($thematic_id);
|
|
|
- $data = array();
|
|
|
+ $data = array();
|
|
|
$sql = "SELECT * FROM $tbl_thematic_advance WHERE c_id = $course_id AND thematic_id = $thematic_id ";
|
|
|
-
|
|
|
+
|
|
|
$elements = array();
|
|
|
$list = api_get_item_property_by_tool('thematic_advance', $course_info['code'], api_get_session_id());
|
|
|
foreach($list as $value) {
|
|
|
$elements[] = $value['ref'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$res = Database::query($sql);
|
|
|
if (Database::num_rows($res) > 0) {
|
|
|
while ($row = Database::fetch_array($res, 'ASSOC')) {
|
|
@@ -463,15 +463,15 @@ class Thematic
|
|
|
}
|
|
|
return $data;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- public function get_thematic_advance_div($data) {
|
|
|
+
|
|
|
+
|
|
|
+ public function get_thematic_advance_div($data) {
|
|
|
$return_array = array();
|
|
|
$uinfo = api_get_user_info();
|
|
|
-
|
|
|
+
|
|
|
foreach ($data as $thematic_id => $thematic_advance_data) {
|
|
|
foreach ($thematic_advance_data as $key => $thematic_advance) {
|
|
|
-
|
|
|
+
|
|
|
$session_star = '';
|
|
|
if (api_is_allowed_to_edit(null, true)) {
|
|
|
if ($thematic_advance['session_id'] !=0) {
|
|
@@ -485,41 +485,41 @@ class Thematic
|
|
|
$thematic_advance_item .= '<div>'.Security::remove_XSS($thematic_advance['content'], STUDENT).'</div>';
|
|
|
$return_array[$thematic_id][$thematic_advance['id']] = $thematic_advance_item;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
return $return_array;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function get_thematic_plan_div($data) {
|
|
|
$final_return = array();
|
|
|
$uinfo = api_get_user_info();
|
|
|
-
|
|
|
+
|
|
|
foreach ($data as $thematic_id => $thematic_plan_data) {
|
|
|
$new_thematic_plan_data = array();
|
|
|
foreach($thematic_plan_data as $thematic_item) {
|
|
|
$thematic_simple_list[] = $thematic_item['description_type'];
|
|
|
$new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
|
|
|
- }
|
|
|
-
|
|
|
- $new_id = ADD_THEMATIC_PLAN;
|
|
|
+ }
|
|
|
+
|
|
|
+ $new_id = ADD_THEMATIC_PLAN;
|
|
|
if (!empty($thematic_simple_list)) {
|
|
|
- foreach($thematic_simple_list as $item) {
|
|
|
+ foreach($thematic_simple_list as $item) {
|
|
|
//if ($item >= ADD_THEMATIC_PLAN) {
|
|
|
//$new_id = $item + 1;
|
|
|
$default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
|
|
|
//}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$no_data = true;
|
|
|
- $session_star = '';
|
|
|
+ $session_star = '';
|
|
|
$return = '<div id="thematic_plan_'.$thematic_id.'">';
|
|
|
if (!empty($default_thematic_plan_title)) {
|
|
|
foreach ($default_thematic_plan_title as $id=>$title) {
|
|
|
$thematic_plan_data_item = '';
|
|
|
//avoid others
|
|
|
if ($title == 'Others' && empty($data[$thematic_id][$id]['description'])) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) {
|
|
|
if (api_is_allowed_to_edit(null, true)) {
|
|
|
if ($data[$thematic_id][$id]['session_id'] !=0) {
|
|
@@ -531,7 +531,7 @@ class Thematic
|
|
|
$no_data = false;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
if ($no_data) {
|
|
|
$return .= '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>';
|
|
|
}
|
|
@@ -540,7 +540,7 @@ class Thematic
|
|
|
}
|
|
|
return $final_return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* get thematic advance list
|
|
|
* @param int Thematic advance id (optional), get data by thematic advance list
|
|
@@ -549,10 +549,10 @@ class Thematic
|
|
|
*/
|
|
|
public function get_thematic_advance_list($thematic_advance_id = null, $course_code = null, $force_session_id = false) { // set current course
|
|
|
$course_info = api_get_course_info($course_code);
|
|
|
-
|
|
|
+
|
|
|
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
|
|
|
$tbl_thematic = Database::get_course_table(TABLE_THEMATIC);
|
|
|
-
|
|
|
+
|
|
|
$data = array();
|
|
|
|
|
|
$condition = '';
|
|
@@ -560,47 +560,47 @@ class Thematic
|
|
|
$thematic_advance_id = intval($thematic_advance_id);
|
|
|
$condition = " AND a.id = $thematic_advance_id ";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$course_id = $course_info['real_id'];
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/*if ($force_session_id) {
|
|
|
$sql = "SELECT a.* FROM $tbl_thematic_advance a INNER JOIN $tbl_thematic t ON t.id = a.thematic_id WHERE 1 $condition AND t.session_id = ".api_get_session_id()." ORDER BY start_date ";
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
$sql = "SELECT * FROM $tbl_thematic_advance a WHERE 1 $condition ORDER BY start_date ";
|
|
|
}*/
|
|
|
-
|
|
|
+
|
|
|
$sql = "SELECT * FROM $tbl_thematic_advance a WHERE c_id = $course_id $condition ORDER BY start_date ";
|
|
|
-
|
|
|
+
|
|
|
$elements = array();
|
|
|
- if ($force_session_id) {
|
|
|
+ if ($force_session_id) {
|
|
|
$list = api_get_item_property_by_tool('thematic_advance', $course_info['code'], api_get_session_id());
|
|
|
foreach($list as $value) {
|
|
|
- $elements[$value['ref']]= $value;
|
|
|
+ $elements[$value['ref']]= $value;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$res = Database::query($sql);
|
|
|
- if (Database::num_rows($res) > 0) {
|
|
|
- if (!empty($thematic_advance_id)) {
|
|
|
+ if (Database::num_rows($res) > 0) {
|
|
|
+ if (!empty($thematic_advance_id)) {
|
|
|
$data = Database::fetch_array($res);
|
|
|
} else {
|
|
|
// group all data group by thematic id
|
|
|
$tmp = array();
|
|
|
- while ($row = Database::fetch_array($res, 'ASSOC')) {
|
|
|
-
|
|
|
+ while ($row = Database::fetch_array($res, 'ASSOC')) {
|
|
|
+
|
|
|
$tmp[] = $row['thematic_id'];
|
|
|
if (in_array($row['thematic_id'], $tmp)) {
|
|
|
if ($force_session_id) {
|
|
|
if (in_array($row['id'], array_keys($elements))) {
|
|
|
$row['session_id'] = $elements[$row['id']]['id_session'];
|
|
|
- $data[$row['thematic_id']][$row['id']] = $row;
|
|
|
+ $data[$row['thematic_id']][$row['id']] = $row;
|
|
|
}
|
|
|
} else {
|
|
|
$data[$row['thematic_id']][$row['id']] = $row;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -627,9 +627,9 @@ class Thematic
|
|
|
$duration = intval($this->duration);
|
|
|
$user_id = api_get_user_id();
|
|
|
|
|
|
- if (empty($id)) {
|
|
|
+ if (empty($id)) {
|
|
|
// Insert
|
|
|
- $sql = "INSERT INTO $tbl_thematic_advance (c_id, thematic_id, attendance_id, content, start_date, duration)
|
|
|
+ $sql = "INSERT INTO $tbl_thematic_advance (c_id, thematic_id, attendance_id, content, start_date, duration)
|
|
|
VALUES ($this->course_int_id, $tematic_id, $attendance_id, '$content', '".api_get_utc_datetime($start_date)."', '$duration') ";
|
|
|
Database::query($sql);
|
|
|
$last_id = Database::insert_id();
|
|
@@ -638,9 +638,9 @@ class Thematic
|
|
|
}
|
|
|
} else {
|
|
|
// update
|
|
|
- $sql = "UPDATE $tbl_thematic_advance SET thematic_id = '$tematic_id', attendance_id = '$attendance_id', content = '$content', start_date = '".api_get_utc_datetime($start_date)."', duration = '$duration'
|
|
|
+ $sql = "UPDATE $tbl_thematic_advance SET thematic_id = '$tematic_id', attendance_id = '$attendance_id', content = '$content', start_date = '".api_get_utc_datetime($start_date)."', duration = '$duration'
|
|
|
WHERE c_id = {$this->course_int_id} AND id = $id ";
|
|
|
- Database::query($sql);
|
|
|
+ Database::query($sql);
|
|
|
if (Database::affected_rows()) {
|
|
|
api_item_property_update($_course, 'thematic_advance', $id, "ThematicAdvanceUpdated", $user_id);
|
|
|
}
|
|
@@ -685,9 +685,9 @@ class Thematic
|
|
|
// definition database table
|
|
|
$tbl_thematic_plan = Database::get_course_table(TABLE_THEMATIC_PLAN);
|
|
|
$tbl_thematic = Database::get_course_table(TABLE_THEMATIC);
|
|
|
-
|
|
|
+
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
+
|
|
|
$data = array();
|
|
|
$condition = '';
|
|
|
if (isset($thematic_id)) {
|
|
@@ -698,53 +698,53 @@ class Thematic
|
|
|
$description_type = intval($description_type);
|
|
|
$condition .= " AND description_type = $description_type ";
|
|
|
}
|
|
|
-
|
|
|
- $items_from_course = api_get_item_property_by_tool('thematic_plan', api_get_course_id(), 0);
|
|
|
+
|
|
|
+ $items_from_course = api_get_item_property_by_tool('thematic_plan', api_get_course_id(), 0);
|
|
|
$items_from_session = api_get_item_property_by_tool('thematic_plan', api_get_course_id(), api_get_session_id());
|
|
|
-
|
|
|
+
|
|
|
$thematic_plan_complete_list = array();
|
|
|
$thematic_plan_id_list = array();
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (!empty($items_from_course)) {
|
|
|
- foreach($items_from_course as $item) {
|
|
|
+ foreach($items_from_course as $item) {
|
|
|
$thematic_plan_id_list[] = $item['ref'];
|
|
|
$thematic_plan_complete_list[$item['ref']] = $item;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!empty($items_from_session)) {
|
|
|
- foreach($items_from_session as $item) {
|
|
|
+ foreach($items_from_session as $item) {
|
|
|
$thematic_plan_id_list[] = $item['ref'];
|
|
|
$thematic_plan_complete_list[$item['ref']] = $item;
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($thematic_plan_id_list)) {
|
|
|
+ if (!empty($thematic_plan_id_list)) {
|
|
|
$sql = "SELECT tp.id, thematic_id, tp.title, description, description_type, t.session_id
|
|
|
- FROM $tbl_thematic_plan tp INNER JOIN $tbl_thematic t ON (t.id=tp.thematic_id)
|
|
|
+ FROM $tbl_thematic_plan tp INNER JOIN $tbl_thematic t ON (t.id=tp.thematic_id)
|
|
|
WHERE t.c_id = $course_id AND tp.c_id = $course_id $condition AND tp.id IN (".implode(', ', $thematic_plan_id_list).") ";
|
|
|
-
|
|
|
+
|
|
|
$rs = Database::query($sql);
|
|
|
-
|
|
|
+
|
|
|
if (Database::num_rows($rs)) {
|
|
|
- if (!isset($thematic_id) && !isset($description_type)) {
|
|
|
+ if (!isset($thematic_id) && !isset($description_type)) {
|
|
|
// group all data group by thematic id
|
|
|
- $tmp = array();
|
|
|
- while ($row = Database::fetch_array($rs,'ASSOC')) {
|
|
|
+ $tmp = array();
|
|
|
+ while ($row = Database::fetch_array($rs,'ASSOC')) {
|
|
|
$tmp[] = $row['thematic_id'];
|
|
|
- if (in_array($row['thematic_id'], $tmp)) {
|
|
|
- $row['session_id'] = $thematic_plan_complete_list[$row['id']];
|
|
|
+ if (in_array($row['thematic_id'], $tmp)) {
|
|
|
+ $row['session_id'] = $thematic_plan_complete_list[$row['id']];
|
|
|
$data[$row['thematic_id']][$row['description_type']] = $row;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
while ($row = Database::fetch_array($rs,'ASSOC')) {
|
|
|
- $row['session_id'] = $thematic_plan_complete_list[$row['id']];
|
|
|
+ $row['session_id'] = $thematic_plan_complete_list[$row['id']];
|
|
|
$data[] = $row;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
@@ -754,19 +754,19 @@ class Thematic
|
|
|
*/
|
|
|
public function thematic_plan_save() {
|
|
|
global $_course;
|
|
|
- // definition database table
|
|
|
+ // definition database table
|
|
|
$tbl_thematic_plan = Database::get_course_table(TABLE_THEMATIC_PLAN);
|
|
|
|
|
|
// protect data
|
|
|
$thematic_id = intval($this->thematic_id);
|
|
|
$title = Database::escape_string($this->thematic_plan_title);
|
|
|
$description = Database::escape_string($this->thematic_plan_description);
|
|
|
- $description_type = intval($this->thematic_plan_description_type);
|
|
|
- $user_id = api_get_user_id();
|
|
|
+ $description_type = intval($this->thematic_plan_description_type);
|
|
|
+ $user_id = api_get_user_id();
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
+
|
|
|
$list = api_get_item_property_by_tool('thematic_plan', api_get_course_id(), api_get_session_id());
|
|
|
-
|
|
|
+
|
|
|
$elements_to_show = array();
|
|
|
foreach($list as $value) {
|
|
|
$elements_to_show[]= $value['ref'];
|
|
@@ -776,23 +776,23 @@ class Thematic
|
|
|
$condition = "AND id IN (".implode(',', $elements_to_show).") ";
|
|
|
}
|
|
|
// check thematic plan type already exists
|
|
|
- $sql = "SELECT id FROM $tbl_thematic_plan WHERE c_id = $course_id AND thematic_id = $thematic_id AND description_type = '$description_type'";
|
|
|
+ $sql = "SELECT id FROM $tbl_thematic_plan WHERE c_id = $course_id AND thematic_id = $thematic_id AND description_type = '$description_type'";
|
|
|
$rs = Database::query($sql);
|
|
|
-
|
|
|
+
|
|
|
$affected_rows = 0;
|
|
|
if (Database::num_rows($rs) > 0) {
|
|
|
//if (!empty($thematic_plan_data)) {
|
|
|
$row_thematic_plan = Database::fetch_array($rs);
|
|
|
$thematic_plan_id = $row_thematic_plan['id'];
|
|
|
-
|
|
|
+
|
|
|
//Checking the session
|
|
|
$thematic_plan_data = api_get_item_property_info(api_get_course_int_id(), 'thematic_plan', $thematic_plan_id);
|
|
|
-
|
|
|
- $update = false;
|
|
|
+
|
|
|
+ $update = false;
|
|
|
if (in_array($thematic_plan_id, $elements_to_show)) {
|
|
|
$update = true;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
if ($update) {
|
|
|
// update
|
|
|
$upd = "UPDATE $tbl_thematic_plan SET title = '$title', description = '$description' WHERE c_id = $course_id AND id = $thematic_plan_id";
|
|
@@ -800,22 +800,22 @@ class Thematic
|
|
|
$affected_rows = Database::affected_rows();
|
|
|
if ($affected_rows) {
|
|
|
api_item_property_update($_course, 'thematic_plan', $thematic_plan_id, "ThematicPlanUpdated", $user_id);
|
|
|
- }
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ } else {
|
|
|
// insert
|
|
|
- $ins = "INSERT INTO $tbl_thematic_plan (c_id, thematic_id, title, description, description_type)
|
|
|
- VALUES ($this->course_int_id, $thematic_id, '$title', '$description', $description_type) ";
|
|
|
+ $ins = "INSERT INTO $tbl_thematic_plan (c_id, thematic_id, title, description, description_type)
|
|
|
+ VALUES ($this->course_int_id, $thematic_id, '$title', '$description', $description_type) ";
|
|
|
Database::query($ins);
|
|
|
$last_id = Database::insert_id();
|
|
|
$affected_rows = Database::affected_rows();
|
|
|
if ($affected_rows) {
|
|
|
api_item_property_update($_course, 'thematic_plan', $last_id,"ThematicPlanAdded", $user_id);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
// insert
|
|
|
- $ins = "INSERT INTO $tbl_thematic_plan (c_id, thematic_id, title, description, description_type)
|
|
|
- VALUES($this->course_int_id, $thematic_id, '$title', '$description', $description_type) ";
|
|
|
+ $ins = "INSERT INTO $tbl_thematic_plan (c_id, thematic_id, title, description, description_type)
|
|
|
+ VALUES($this->course_int_id, $thematic_id, '$title', '$description', $description_type) ";
|
|
|
Database::query($ins);
|
|
|
$last_id = Database::insert_id();
|
|
|
$affected_rows = Database::affected_rows();
|
|
@@ -841,7 +841,7 @@ class Thematic
|
|
|
$thematic_id = intval($thematic_id);
|
|
|
$description_type = intval($description_type);
|
|
|
$user_id = api_get_user_id();
|
|
|
- $course_id = $course_info['real_id'];
|
|
|
+ $course_id = $course_info['real_id'];
|
|
|
|
|
|
// get thematic plan id
|
|
|
$thematic_plan_data = $this->get_thematic_plan_data($thematic_id, $description_type);
|
|
@@ -871,10 +871,10 @@ class Thematic
|
|
|
$thematic_id = intval($thematic_id);
|
|
|
$description_type = intval($description_type);
|
|
|
$next_description_type = 0;
|
|
|
-
|
|
|
+
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
- $sql = "SELECT MAX(description_type) as max FROM $tbl_thematic_plan
|
|
|
+
|
|
|
+ $sql = "SELECT MAX(description_type) as max FROM $tbl_thematic_plan
|
|
|
WHERE c_id = $course_id AND thematic_id = $thematic_id AND description_type >= ".ADD_THEMATIC_PLAN." ";
|
|
|
$rs = Database::query($sql);
|
|
|
$row = Database::fetch_array($rs);
|
|
@@ -903,8 +903,8 @@ class Thematic
|
|
|
|
|
|
$affected_rows = 0;
|
|
|
$user_id = api_get_user_id();
|
|
|
-
|
|
|
- $all = array();
|
|
|
+
|
|
|
+ $all = array();
|
|
|
if (!empty($thematic_data)) {
|
|
|
foreach ($thematic_data as $thematic) {
|
|
|
$thematic_id = $thematic['id'];
|
|
@@ -914,29 +914,29 @@ class Thematic
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- $error = null;
|
|
|
+ }
|
|
|
+ $error = null;
|
|
|
$a_thematic_advance_ids = array();
|
|
|
$course_id = api_get_course_int_id();
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (!empty($thematic_data)) {
|
|
|
foreach ($thematic_data as $thematic) {
|
|
|
$my_affected_rows = 0;
|
|
|
$thematic_id = $thematic['id'];
|
|
|
if (!empty($thematic_advance_data[$thematic['id']])) {
|
|
|
foreach ($thematic_advance_data[$thematic['id']] as $thematic_advance) {
|
|
|
-
|
|
|
+
|
|
|
$item_info = api_get_item_property_info(api_get_course_int_id(), 'thematic_advance', $thematic_advance['id']);
|
|
|
-
|
|
|
+
|
|
|
if ($item_info['id_session'] == api_get_session_id()) {
|
|
|
-
|
|
|
+
|
|
|
$a_thematic_advance_ids[] = $thematic_advance['id'];
|
|
|
-
|
|
|
+
|
|
|
// update done thematic for previous advances ((done_advance = 1))
|
|
|
$upd = "UPDATE $tbl_thematic_advance SET done_advance = 1 WHERE c_id = $course_id AND id = ".$thematic_advance['id']." ";
|
|
|
Database::query($upd);
|
|
|
- $my_affected_rows = Database::affected_rows();
|
|
|
+ $my_affected_rows = Database::affected_rows();
|
|
|
$affected_rows += $my_affected_rows;
|
|
|
//if ($my_affected_rows) {
|
|
|
api_item_property_update($_course, 'thematic_advance', $thematic_advance['id'], "ThematicAdvanceDone", $user_id);
|
|
@@ -949,22 +949,22 @@ class Thematic
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
// Update done thematic for others advances (done_advance = 0)
|
|
|
if (!empty($a_thematic_advance_ids) && count($a_thematic_advance_ids) > 0) {
|
|
|
- $diff = array_diff($all, $a_thematic_advance_ids);
|
|
|
- if (!empty($diff)) {
|
|
|
+ $diff = array_diff($all, $a_thematic_advance_ids);
|
|
|
+ if (!empty($diff)) {
|
|
|
$upd = "UPDATE $tbl_thematic_advance SET done_advance = 0 WHERE c_id = $course_id AND id IN(".implode(',',$diff).") ";
|
|
|
Database::query($upd);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// update item_property
|
|
|
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
|
|
|
$session_id = api_get_session_id();
|
|
|
-
|
|
|
+
|
|
|
// get all thematic advance done
|
|
|
- $rs_thematic_done = Database::query("SELECT ref FROM $tbl_item_property
|
|
|
+ $rs_thematic_done = Database::query("SELECT ref FROM $tbl_item_property
|
|
|
WHERE c_id = $course_id AND tool='thematic_advance' AND lastedit_type='ThematicAdvanceDone' AND id_session = $session_id ");
|
|
|
if (Database::num_rows($rs_thematic_done) > 0) {
|
|
|
while ($row_thematic_done = Database::fetch_array($rs_thematic_done)) {
|
|
@@ -975,7 +975,7 @@ class Thematic
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return $affected_rows;
|
|
|
+ return $affected_rows;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -983,10 +983,10 @@ class Thematic
|
|
|
* @return int Last done thematic advance id
|
|
|
*/
|
|
|
public function get_last_done_thematic_advance() {
|
|
|
- $thematic_data = $this->get_thematic_list();
|
|
|
+ $thematic_data = $this->get_thematic_list();
|
|
|
$thematic_advance_data = $this->get_thematic_advance_list(null, api_get_course_id(), true);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
$a_thematic_advance_ids = array();
|
|
|
$last_done_advance_id = 0;
|
|
|
if (!empty($thematic_data)) {
|
|
@@ -1004,7 +1004,7 @@ class Thematic
|
|
|
if (!empty($a_thematic_advance_ids)) {
|
|
|
$last_done_advance_id = array_pop($a_thematic_advance_ids);
|
|
|
$last_done_advance_id = intval($last_done_advance_id);
|
|
|
- }
|
|
|
+ }
|
|
|
return $last_done_advance_id;
|
|
|
}
|
|
|
|
|
@@ -1052,16 +1052,16 @@ class Thematic
|
|
|
if (api_get_session_id()) {
|
|
|
$thematic_data = $this->get_thematic_list(null, $course_code );
|
|
|
} else {
|
|
|
- $thematic_data = $this->get_thematic_list(null, $course_code, 0);
|
|
|
- }
|
|
|
+ $thematic_data = $this->get_thematic_list(null, $course_code, 0);
|
|
|
+ }
|
|
|
$new_thematic_data = array();
|
|
|
if (!empty($thematic_data)) {
|
|
|
- foreach ($thematic_data as $item) {
|
|
|
- $new_thematic_data[] = $item;
|
|
|
+ foreach ($thematic_data as $item) {
|
|
|
+ $new_thematic_data[] = $item;
|
|
|
}
|
|
|
$thematic_data = $new_thematic_data;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$thematic_advance_data = $this->get_thematic_advance_list(null, $course_code, true);
|
|
|
$a_average_of_advances_by_thematic = array();
|
|
|
$total_average = 0;
|
|
@@ -1077,7 +1077,7 @@ class Thematic
|
|
|
$count_tematics = count($thematic_data);
|
|
|
$score = array_sum($a_average_of_advances_by_thematic);
|
|
|
$total_average = round(($score*100)/($count_tematics*100));
|
|
|
- }
|
|
|
+ }
|
|
|
return $total_average;
|
|
|
}
|
|
|
|
|
@@ -1096,16 +1096,16 @@ class Thematic
|
|
|
// get all done advances by thematic
|
|
|
$advances = array();
|
|
|
$count_done_advances = 0;
|
|
|
- $average = 0;
|
|
|
+ $average = 0;
|
|
|
foreach ($thematic_advance_data as $thematic_advance) {
|
|
|
if ($thematic_advance['done_advance'] == 1) {
|
|
|
- $count_done_advances++;
|
|
|
+ $count_done_advances++;
|
|
|
}
|
|
|
$advances[] = $thematic_advance['done_advance'];
|
|
|
}
|
|
|
// calculate average by thematic
|
|
|
- $count_total_advances = count($advances);
|
|
|
- $average = round(($count_done_advances*100)/$count_total_advances);
|
|
|
+ $count_total_advances = count($advances);
|
|
|
+ $average = round(($count_done_advances*100)/$count_total_advances);
|
|
|
}
|
|
|
|
|
|
return $average;
|
|
@@ -1187,7 +1187,7 @@ class Thematic
|
|
|
$default_thematic_plan_titles[1]= get_lang('Objectives');
|
|
|
$default_thematic_plan_titles[2]= get_lang('SkillToAcquire');
|
|
|
$default_thematic_plan_titles[3]= get_lang('Methodology');
|
|
|
- $default_thematic_plan_titles[4]= get_lang('Infrastructure');
|
|
|
+ $default_thematic_plan_titles[4]= get_lang('Infrastructure');
|
|
|
$default_thematic_plan_titles[5]= get_lang('Assessment');
|
|
|
$default_thematic_plan_titles[6]= get_lang('Others');
|
|
|
return $default_thematic_plan_titles;
|
|
@@ -1228,22 +1228,6 @@ class Thematic
|
|
|
* @return string date and time e.g: '2010-02-10 12:30:00'
|
|
|
*/
|
|
|
public function build_datetime_from_array($array) {
|
|
|
- $year = '0000';
|
|
|
- $month = $day = $hours = $minutes = $seconds = '00';
|
|
|
- if (isset($array['Y']) && isset($array['F']) && isset($array['d']) && isset($array['H']) && isset($array['i'])) {
|
|
|
- $year = $array['Y'];
|
|
|
- $month = $array['F'];
|
|
|
- if (intval($month) < 10 ) $month = '0'.$month;
|
|
|
- $day = $array['d'];
|
|
|
- if (intval($day) < 10 ) $day = '0'.$day;
|
|
|
- $hours = $array['H'];
|
|
|
- if (intval($hours) < 10 ) $hours = '0'.$hours;
|
|
|
- $minutes = $array['i'];
|
|
|
- if (intval($minutes) < 10 ) $minutes = '0'.$minutes;
|
|
|
- }
|
|
|
- if (checkdate($month,$day,$year)) {
|
|
|
- $datetime = $year.'-'.$month.'-'.$day.' '.$hours.':'.$minutes.':'.$seconds;
|
|
|
- }
|
|
|
- return $datetime;
|
|
|
+ return return_datetime_from_array($array);
|
|
|
}
|
|
|
}
|