skala
Juan Carlos Raña 15 years ago
commit e8ec03c617
  1. 2
      main/admin/add_users_to_session.php
  2. 20
      main/auth/profile.php
  3. 20
      main/calendar/agenda.inc.php
  4. 3
      main/inc/lib/database.lib.php
  5. 19
      main/tracking/courseLog.php
  6. 7
      main/work/work.lib.php
  7. 39
      main/work/work.php

@ -373,7 +373,7 @@ if ($ajax_search) {
$order_clause"; $order_clause";
} }
} }
echo $sql;
$result=Database::query($sql,__FILE__,__LINE__); $result=Database::query($sql,__FILE__,__LINE__);
$Users=Database::store_result($result); $Users=Database::store_result($result);
//var_dump($_REQUEST['id_session']); //var_dump($_REQUEST['id_session']);

@ -629,9 +629,23 @@ elseif (isset($_POST['remove_production'])) {
// build SQL query // build SQL query
$sql = "UPDATE $table_user SET"; $sql = "UPDATE $table_user SET";
unset($user_data['api_key_generate']); unset($user_data['api_key_generate']);
foreach ($user_data as $key => $value) { foreach ($user_data as $key => $value) {
if (substr($key, 0, 6) == 'extra_') { //an extra field if (substr($key, 0, 6) == 'extra_') { //an extra field
$extras[substr($key, 6)] = $value; $new_key = substr($key, 6);
// format array date to 'Y-m-d' or date time to 'Y-m-d H:i:s'
if (is_array($value) && isset($value['Y']) && isset($value['F']) && isset($value['d'])) {
if (isset($value['H']) && isset($value['i'])) {
// extra field date time
$time = mktime($value['H'],$value['i'],0,$value['F'],$value['d'],$value['Y']);
$extras[$new_key] = date('Y-m-d H:i:s',$time);
} else {
// extra field date
$time = mktime(0,0,0,$value['F'],$value['d'],$value['Y']);
$extras[$new_key] = date('Y-m-d',$time);
}
} else {
$extras[$new_key] = $value;
}
} else { } else {
$sql .= " $key = '".Database::escape_string($value)."',"; $sql .= " $key = '".Database::escape_string($value)."',";
} }

@ -428,10 +428,17 @@ function display_monthcalendar($month, $year)
if ($month == $month_start_date) { if ($month == $month_start_date) {
$start_time= date("H:i",strtotime($value['start_date'])); $start_time= date("H:i",strtotime($value['start_date']));
$end_time= date("H:i",strtotime($value['end_date'])); $end_time= date("H:i",strtotime($value['end_date']));
$dayheader .= '<br />'.get_lang("StartTimeWindow").'&nbsp;<i>'.$start_time.'</i>&nbsp;-&nbsp;'.get_lang("EndTimeWindow").'&nbsp;<i>'.$end_time.'&nbsp;</i>';
$dayheader .= '<br />'; if ($value['end_date']=='0000-00-00 00:00:00'){
$dayheader .= $value['title']; $dayheader .= '<br />'.get_lang("Work").'<br />';
$dayheader .= '<br/>'; $dayheader .= $value['title'];
$dayheader .= '<br/>';
} else {
$dayheader .= '<br />'.get_lang("StartTimeWindow").'&nbsp;<i>'.$start_time.'</i>&nbsp;-&nbsp;'.get_lang("EndTimeWindow").'&nbsp;<i>'.$end_time.'&nbsp;</i>';
$dayheader .= '<br />';
$dayheader .= $value['title'];
$dayheader .= '<br/>';
}
} }
//$agendaitems = get_global_agenda_items($agendaitems, $curday, $month, $year, $startdayofweek, "month_view"); //$agendaitems = get_global_agenda_items($agendaitems, $curday, $month, $year, $startdayofweek, "month_view");
//echo $agendaitems['title']; //echo $agendaitems['title'];
@ -2119,12 +2126,11 @@ function display_agenda_items()
echo api_ucfirst(strftime($timeNoSecFormat,strtotime($myrow["start_date"]))).""; echo api_ucfirst(strftime($timeNoSecFormat,strtotime($myrow["start_date"])))."";
echo "</td>\n"; echo "</td>\n";
echo "\t\t<td>"; echo "\t\t<td>";
if ($myrow["end_date"]<>"0000-00-00 00:00:00") if ($myrow["end_date"]<>"0000-00-00 00:00:00") {
{
echo get_lang("EndTimeWindow").": "; echo get_lang("EndTimeWindow").": ";
echo api_ucfirst(format_locale_date($dateFormatLong,strtotime($myrow["end_date"])))."&nbsp;&nbsp;&nbsp;"; echo api_ucfirst(format_locale_date($dateFormatLong,strtotime($myrow["end_date"])))."&nbsp;&nbsp;&nbsp;";
echo api_ucfirst(strftime($timeNoSecFormat,strtotime($myrow["end_date"]))).""; echo api_ucfirst(strftime($timeNoSecFormat,strtotime($myrow["end_date"])))."";
} }
echo "</td>\n"; echo "</td>\n";
// attachment list // attachment list

@ -259,8 +259,9 @@ define('TABLE_GLOSSARY', 'glossary');
// Notebook // Notebook
define('TABLE_NOTEBOOK', 'notebook'); define('TABLE_NOTEBOOK', 'notebook');
// Message // Message
define('TABLE_MESSAGE', 'message'); define('TABLE_MESSAGE', 'message');
define('TABLE_MESSAGE_ATTACHMENT', 'message_attachment');
// Metadata // Metadata
define('TABLE_METADATA', 'metadata'); define('TABLE_METADATA', 'metadata');

@ -932,8 +932,8 @@ function get_addtional_profile_information_of_field_by_user($field_id, $users){
WHERE field.field_id=".intval($field_id)." AND user.user_id IN ($users)"; WHERE field.field_id=".intval($field_id)." AND user.user_id IN ($users)";
$result = api_sql_query($sql,__FILE__,__LINE__); $result = api_sql_query($sql,__FILE__,__LINE__);
while($row = Database::fetch_array($result)) { while($row = Database::fetch_array($result)) {
// get option value for field type double select by id
if (!empty($row['field_value'])) { if (!empty($row['field_value'])) {
if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DOUBLE_SELECT) { if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DOUBLE_SELECT) {
$id_double_select = explode(';',$row['field_value']); $id_double_select = explode(';',$row['field_value']);
@ -942,20 +942,9 @@ function get_addtional_profile_information_of_field_by_user($field_id, $users){
$value2 = $result_extra_field['options'][$id_double_select[1]]['option_value']; $value2 = $result_extra_field['options'][$id_double_select[1]]['option_value'];
$row['field_value'] = ($value1.';'.$value2); $row['field_value'] = ($value1.';'.$value2);
} }
} else if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DATE) {
$datetime = explode(';',$row['field_value']);
if (is_array($datetime)) {
$time = mktime(0,0,0,$datetime[1],$datetime[0],$datetime[2]);
$row['field_value'] = date('Y-m-d',$time);
}
} else if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DATETIME) {
$datetime = explode(';',$row['field_value']);
if (is_array($datetime)) {
$time = mktime($datetime[3],$datetime[4],0,$datetime[1],$datetime[0],$datetime[2]);
$row['field_value'] = date('Y-m-d H:i:s',$time);
}
} }
} }
// get other value from extra field
$return[$row['user_id']][] = $row['field_value']; $return[$row['user_id']][] = $row['field_value'];
} }
} }

@ -469,7 +469,6 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$form_folder -> addGroup($weight_input,'weight',get_lang('WeightInTheGradebook'),'size="10"'); $form_folder -> addGroup($weight_input,'weight',get_lang('WeightInTheGradebook'),'size="10"');
} }
$there_is_a_end_date =false; $there_is_a_end_date =false;
if($row['view_properties']=='1') { if($row['view_properties']=='1') {
if($homework['expires_on']!='0000-00-00 00:00:00'){ if($homework['expires_on']!='0000-00-00 00:00:00'){
@ -480,7 +479,11 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$there_is_a_end_date = true; $there_is_a_end_date = true;
$form_folder -> addGroup(create_group_date_select(),'ends',get_lang('EndsAt')); $form_folder -> addGroup(create_group_date_select(),'ends',get_lang('EndsAt'));
} }
$form_folder -> addRule(array('expires','ends'), get_lang('DateExpiredNotBeLessDeadLine'), 'comparedate');
if ($there_is_a_expire_date && $there_is_a_end_date) {
$form_folder -> addRule(array('expires','ends'), get_lang('DateExpiredNotBeLessDeadLine'), 'comparedate');
}
} else { } else {
$form_folder -> addElement('html','<div class="row"> $form_folder -> addElement('html','<div class="row">
<div class="label">&nbsp;</div> <div class="label">&nbsp;</div>

@ -557,11 +557,12 @@ Display :: display_introduction_section(TOOL_STUDENTPUBLICATION);
//----------------inser into agenda----------------------// //----------------inser into agenda----------------------//
$agenda_id = 0; $agenda_id = 0;
if(!empty($_POST['type2']) && isset($_POST['add_to_calendar']) && $_POST['add_to_calendar']==1): if(isset($_POST['add_to_calendar']) && $_POST['add_to_calendar']==1):
include_once('../calendar/agenda.inc.php'); include_once('../calendar/agenda.inc.php');
include_once('../resourcelinker/resourcelinker.inc.php'); include_once('../resourcelinker/resourcelinker.inc.php');
isset($course_info)?$course=$course_info:$course=null; isset($course_info)?$course=$course_info:$course=null;
$agenda_id = agenda_add_item($course,$_POST['new_dir'],$_POST['new_dir'],date('Y-m-d H:i:s'),get_date_from_select('ends'),null,0); $content='<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.substr(Security::remove_XSS($dir_name_sql), 1).'" >'.$_POST['new_dir'].'</a> - '.$_POST['description'];
$agenda_id = agenda_add_item($course,$_POST['new_dir'], $content,date('Y-m-d H:i:s'),'0000-00-00',null,0);
endif; endif;
$sql_add_publication = "INSERT INTO " . $work_table . " SET " . $sql_add_publication = "INSERT INTO " . $work_table . " SET " .
"url = '".Database::escape_string(Security::remove_XSS($dir_name_sql))."', "url = '".Database::escape_string(Security::remove_XSS($dir_name_sql))."',
@ -763,10 +764,19 @@ else {
} }
if ($delete == "all" && api_is_allowed_to_edit(null,true)) { if ($delete == "all" && api_is_allowed_to_edit(null,true)) {
$queryString1 = "SELECT url FROM " . $work_table . ""; $queryString1 = "SELECT url FROM ".$work_table."";
$queryString2 = "DELETE FROM " . $work_table . ""; $queryString2 = "DELETE FROM ".$work_table."";
$queryString3 = "DELETE FROM " . $TSTDPUBASG . ""; $queryString3 = "DELETE FROM ".$TSTDPUBASG. "";
$sql_agenda = "SELECT add_to_calendar FROM ".$TSTDPUBASG." WHERE add_to_calendar <> 0";
$rs_agenda = Database::query($sql_agenda, __FILE__, __LINE__);
$t_agenda = Database::get_course_table(TABLE_AGENDA);
while ($row_agenda=Database::fetch_array($rs_agenda)) {
$deleteagenda = "DELETE FROM ".$t_agenda." WHERE id='".$row_agenda['add_to_calendar']."'";
$rsdeleteagenda = Database::query($deleteagenda, __FILE__, __LINE__);
}
$result1 = Database::query($queryString1, __FILE__, __LINE__); $result1 = Database::query($queryString1, __FILE__, __LINE__);
$result2 = Database::query($queryString2, __FILE__, __LINE__); $result2 = Database::query($queryString2, __FILE__, __LINE__);
$result3 = Database::query($queryString3, __FILE__, __LINE__); $result3 = Database::query($queryString3, __FILE__, __LINE__);
@ -1132,25 +1142,21 @@ if($is_special > 0):
if (!$not_ends_on) { if (!$not_ends_on) {
define('ASSIGNMENT_EXPIRES',$time_expires); define('ASSIGNMENT_EXPIRES',$time_expires);
} }
if(!empty($publication['description'])){
Display :: display_normal_message($publication['description']);
}
$ends_on = api_ucfirst(format_locale_date($dateFormatLong,strtotime($homework['ends_on']))).' '; $ends_on = api_ucfirst(format_locale_date($dateFormatLong,strtotime($homework['ends_on']))).' ';
$ends_on .= ucfirst(strftime($timeNoSecFormat,strtotime($homework['ends_on']))); $ends_on .= ucfirst(strftime($timeNoSecFormat,strtotime($homework['ends_on'])));
$expires_on = api_ucfirst(format_locale_date($dateFormatLong,strtotime($homework['expires_on']))).' '; $expires_on = api_ucfirst(format_locale_date($dateFormatLong,strtotime($homework['expires_on']))).' ';
$expires_on .= ucfirst(strftime($timeNoSecFormat,strtotime($homework['expires_on']))); $expires_on .= ucfirst(strftime($timeNoSecFormat,strtotime($homework['expires_on'])));
if($has_ended) { if($has_ended) {
Display :: display_error_message(get_lang('EndDateAlreadyPassed').' '.$ends_on);
display_action_links($cur_dir_path, $always_show_tool_options,true); display_action_links($cur_dir_path, $always_show_tool_options,true);
Display :: display_error_message(get_lang('EndDateAlreadyPassed').' '.$ends_on);
} elseif($has_expired) { } elseif($has_expired) {
Display :: display_warning_message(get_lang('ExpiryDateAlreadyPassed').' '.$expires_on);
display_action_links($cur_dir_path, $always_show_tool_options,$always_show_upload_form); display_action_links($cur_dir_path, $always_show_tool_options,$always_show_upload_form);
Display :: display_warning_message(get_lang('ExpiryDateAlreadyPassed').' '.$expires_on);
} else { } else {
if (!$not_ends_on) { if (!$not_ends_on) {
display_action_links($cur_dir_path, $always_show_tool_options, $always_show_upload_form);
Display :: display_normal_message(get_lang('ExpiryDateToSendWorkIs').' '.$expires_on); Display :: display_normal_message(get_lang('ExpiryDateToSendWorkIs').' '.$expires_on);
} }
display_action_links($cur_dir_path, $always_show_tool_options, $always_show_upload_form);
} }
else: else:
display_action_links($cur_dir_path, $always_show_tool_options, $always_show_upload_form); display_action_links($cur_dir_path, $always_show_tool_options, $always_show_upload_form);
@ -1385,8 +1391,9 @@ function draw_date_picker($prefix,$default='') {
$addtext .= '<div id="option3" style="padding:4px;display:none">'; $addtext .= '<div id="option3" style="padding:4px;display:none">';
$addtext .= '&nbsp;&nbsp;&nbsp;<div id="msg_error4" style="display:none;color:red"></div>'; $addtext .= '&nbsp;&nbsp;&nbsp;<div id="msg_error4" style="display:none;color:red"></div>';
$addtext .= draw_date_picker('ends').'<br />'; $addtext .= draw_date_picker('ends').'<br />';
$addtext .= '&nbsp;&nbsp;'.make_checkbox('add_to_calendar').get_lang('AddToCalendar').'</div>';
$addtext .= '</div>'; $addtext .= '</div>';
$addtext .= '<br><br><b>'.get_lang('Agenda').'</b><br>';
$addtext .= '&nbsp;&nbsp;'.make_checkbox('add_to_calendar').get_lang('AddToCalendar').'</div>';
$addtext .= '</div>'; $addtext .= '</div>';
$new_folder_text .= '<div class="row"> $new_folder_text .= '<div class="row">
@ -1477,10 +1484,16 @@ if (!$display_upload_form && !$display_tool_options) {
$form_filter .= make_select('filter',array(0=>get_lang('SelectAFilter'),1=>get_lang('FilterByNotRevised'),2=>get_lang('FilterByRevised'),3=>get_lang('FilterByNotExpired')),$filter).'&nbsp&nbsp'; $form_filter .= make_select('filter',array(0=>get_lang('SelectAFilter'),1=>get_lang('FilterByNotRevised'),2=>get_lang('FilterByRevised'),3=>get_lang('FilterByNotExpired')),$filter).'&nbsp&nbsp';
$form_filter .= '<button type="submit" class="save" value="'.get_lang('FilterAssignments').'">'.get_lang('FilterAssignments').'</button></form>'; $form_filter .= '<button type="submit" class="save" value="'.get_lang('FilterAssignments').'">'.get_lang('FilterAssignments').'</button></form>';
echo $form_filter; echo $form_filter;
}
if(!empty($publication['description'])){
echo '<br /><b>'.get_lang('Description').'</b>&nbsp;&nbsp;'.$publication['description'].'<br /><br />';
} }
} }
display_student_publications_list($base_work_dir . '/' . $my_cur_dir_path, 'work/' . $my_cur_dir_path, $currentCourseRepositoryWeb, $link_target_parameter, $dateFormatLong, $origin,$add_query); display_student_publications_list($base_work_dir . '/' . $my_cur_dir_path, 'work/' . $my_cur_dir_path, $currentCourseRepositoryWeb, $link_target_parameter, $dateFormatLong, $origin,$add_query);
} }

Loading…
Cancel
Save