Change the presentation of the task and include the description. #5612

skala
Carlos Vargas 16 years ago
parent 58512801be
commit b44dd8745a
  1. 7
      main/work/work.lib.php
  2. 24
      main/work/work.php

@ -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"');
}
$there_is_a_end_date =false;
if($row['view_properties']=='1') {
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;
$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 {
$form_folder -> addElement('html','<div class="row">
<div class="label">&nbsp;</div>

@ -557,11 +557,12 @@ Display :: display_introduction_section(TOOL_STUDENTPUBLICATION);
//----------------inser into agenda----------------------//
$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('../resourcelinker/resourcelinker.inc.php');
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;
$sql_add_publication = "INSERT INTO " . $work_table . " SET " .
"url = '".Database::escape_string(Security::remove_XSS($dir_name_sql))."',
@ -1132,25 +1133,21 @@ if($is_special > 0):
if (!$not_ends_on) {
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 .= ucfirst(strftime($timeNoSecFormat,strtotime($homework['ends_on'])));
$expires_on = api_ucfirst(format_locale_date($dateFormatLong,strtotime($homework['expires_on']))).' ';
$expires_on .= ucfirst(strftime($timeNoSecFormat,strtotime($homework['expires_on'])));
if($has_ended) {
Display :: display_error_message(get_lang('EndDateAlreadyPassed').' '.$ends_on);
display_action_links($cur_dir_path, $always_show_tool_options,true);
Display :: display_error_message(get_lang('EndDateAlreadyPassed').' '.$ends_on);
} 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 :: display_warning_message(get_lang('ExpiryDateAlreadyPassed').' '.$expires_on);
} else {
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_action_links($cur_dir_path, $always_show_tool_options, $always_show_upload_form);
}
else:
display_action_links($cur_dir_path, $always_show_tool_options, $always_show_upload_form);
@ -1385,8 +1382,9 @@ function draw_date_picker($prefix,$default='') {
$addtext .= '<div id="option3" style="padding:4px;display:none">';
$addtext .= '&nbsp;&nbsp;&nbsp;<div id="msg_error4" style="display:none;color:red"></div>';
$addtext .= draw_date_picker('ends').'<br />';
$addtext .= '&nbsp;&nbsp;'.make_checkbox('add_to_calendar').get_lang('AddToCalendar').'</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>';
$new_folder_text .= '<div class="row">
@ -1477,10 +1475,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 .= '<button type="submit" class="save" value="'.get_lang('FilterAssignments').'">'.get_lang('FilterAssignments').'</button></form>';
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);
}

Loading…
Cancel
Save