From b44dd8745a990d5b0a4689bb7bfb9d1a7204147a Mon Sep 17 00:00:00 2001 From: Carlos Vargas Date: Tue, 24 Nov 2009 13:13:21 -0500 Subject: [PATCH] Change the presentation of the task and include the description. #5612 --- main/work/work.lib.php | 7 +++++-- main/work/work.php | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 1853f531d5..e04cc81e34 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.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','
 
diff --git a/main/work/work.php b/main/work/work.php index 55d34a0f03..aaa0663147 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -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=''.$_POST['new_dir'].' - '.$_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 .= ''; $addtext .= '
'; + $addtext .= '

'.get_lang('Agenda').'
'; + $addtext .= '  '.make_checkbox('add_to_calendar').get_lang('AddToCalendar').''; $addtext .= ''; $new_folder_text .= '
@@ -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).'  '; $form_filter .= ''; echo $form_filter; + + } + if(!empty($publication['description'])){ + echo '
'.get_lang('Description').'  '.$publication['description'].'

'; } } display_student_publications_list($base_work_dir . '/' . $my_cur_dir_path, 'work/' . $my_cur_dir_path, $currentCourseRepositoryWeb, $link_target_parameter, $dateFormatLong, $origin,$add_query); + + }