diff --git a/main/work/work.lib.php b/main/work/work.lib.php
index 6f553831b6..69bcf40233 100755
--- a/main/work/work.lib.php
+++ b/main/work/work.lib.php
@@ -26,11 +26,11 @@ function display_action_links($cur_dir_path, $always_show_tool_options, $always_
$display_output = "";
$origin = isset($_GET['origin'])?Security::remove_XSS($_GET['origin']):'';
$curdirpath = isset($_GET['curdirpath'])?Security::remove_XSS($_GET['curdirpath']):empty($curdirpath);
-
+
///why is that here?
//$origin = api_get_tools_lists($origin);
echo '
';
-
+
if (strlen($cur_dir_path) > 0 && $cur_dir_path != '/') {
$parent_dir = dirname($cur_dir_path);
$display_output .= '
'.Display::return_icon('back.png',get_lang('BackToWorksList')).' '.get_lang('BackToWorksList').'';
@@ -67,7 +67,7 @@ function display_action_links($cur_dir_path, $always_show_tool_options, $always_
} else {
$message=get_lang('ConfirmYourChoice');
}
-
+
if (empty($curdirpath) or $curdirpath != '.') {
$display_output .= '
'.Display::return_icon('delete_na.gif', get_lang('Delete')).get_lang('DeleteAllFiles').'';
} else {
@@ -104,8 +104,8 @@ function display_action_links($cur_dir_path, $always_show_tool_options, $always_
$display_output .= "
".
Display::return_icon('check.gif', get_lang('ViewUsersWithTask')).' '.get_lang('ViewUsersWithTask').
"\n";
-
- $_SESSION['token'] = time();
+
+ $_SESSION['token'] = time();
$display_output .= "
".
Display::return_icon('messagebox_warning.gif', get_lang('ReminderMessage')).' '.get_lang('ReminderMessage').
"\n";
@@ -207,7 +207,7 @@ function display_studentsdelete_form()
- addGroup($group_name,'my_group',get_lang('Title'));
$form_folder -> addGroupRule('my_group',get_lang('ThisFieldIsRequired'),'required');
@@ -484,12 +484,12 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$form_folder-> addElement('textarea','description',get_lang('Description'),array('rows'=>5,'cols'=>50));
$qualification_input[] = FormValidator :: createElement('text','qualification');
$form_folder -> addGroup($qualification_input,'qualification',get_lang('QualificationNumberOver'),'size="10"');
-
+
if ($row['weight'] > 0) {
$weight_input[] = FormValidator :: createElement('text','weight');
- $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;
if($row['view_properties']=='1') {
if($homework['expires_on']!='0000-00-00 00:00:00'){
@@ -500,11 +500,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'));
}
-
- if ($there_is_a_expire_date && $there_is_a_end_date) {
- $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','
');
-
+
$form_folder -> addElement('html','');
if(empty($default)) {
$default = date('Y-m-d 12:00:00');
}
-
+
$parts = split(' ',$default);
list($d_year,$d_month,$d_day) = split('-',$parts[0]);
list($d_hour,$d_minute) = split(':',$parts[1]);
@@ -525,8 +525,8 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$form_folder -> addElement('checkbox', 'make_calification', null, get_lang('MakeQualifiable'),'onclick="javascript:if(this.checked==true){document.getElementById(\'option3\').style.display = \'block\';}else{document.getElementById(\'option3\').style.display = \'none\';}"');
$form_folder -> addElement('html','
');
$weight_input2[] = FormValidator :: createElement('text','weight');
- $form_folder -> addGroup($weight_input2,'weight',get_lang('WeightInTheGradebook'),'size="10"');
- $form_folder -> addElement('html','
');
+ $form_folder -> addGroup($weight_input2,'weight',get_lang('WeightInTheGradebook'),'size="10"');
+ $form_folder -> addElement('html','
');
}
if($homework['expires_on']='0000-00-00 00:00:00') {
$homework['expires_on']=date("Y-m-d H:i:s");
@@ -544,22 +544,22 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$form_folder -> addGroup(create_group_date_select(),'ends',get_lang('EndsAt'));
$form_folder -> addElement('html','');
}
-
+
$form_folder -> addRule (array('expires','ends'), get_lang('DateExpiredNotBeLessDeadLine'), 'comparedate');
-
+
$form_folder -> addElement('html','');
}
-
+
$form_folder -> addElement('style_submit_button','submit',get_lang('ModifyDirectory'),'class="save"');
-
+
if($there_is_a_end_date == true) {
$defaults = array_merge($defaults,convert_date_to_array($homework['ends_on'],'ends'));
}
-
+
if($there_is_a_expire_date == true) {
$defaults = array_merge($defaults,convert_date_to_array($homework['expires_on'],'expires'));
}
-
+
if(!empty($row['qualification'])) {
$defaults = array_merge($defaults,array('qualification[qualification]'=>$row['qualification']));
}
@@ -568,7 +568,7 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
}
$form_folder -> setDefaults($defaults);
$display_edit_form=true;
-
+
if($form_folder -> validate()) {
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
if($there_is_a_end_date == true || $there_is_a_expire_date == true) {
@@ -594,24 +594,24 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
Database::query($sql_add_publication, __FILE__, __LINE__);
}
}
-
+
}
//if($_POST['qualification']['qualification']!='')
Database::query('UPDATE '.$work_table.' SET description = '."'".Database::escape_string(Security::remove_XSS($_POST['description']))."'".', qualification = '."'".Database::escape_string($_POST['qualification']['qualification'])."'".',weight = '."'".Database::escape_string($_POST['weight']['weight'])."'".' WHERE id = '."'".$row['id']."'",__FILE__,__LINE__);
Database::query('UPDATE '.Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK).' SET weight = '."'".Database::escape_string($_POST['weight']['weight'])."'".' WHERE course_code = '."'".api_get_course_id()."'".' AND ref_id = '."'".$row['id']."'".'',__FILE__,__LINE__);
-
+
//we are changing the current work and we want add them into gradebook
if(isset($_POST['make_calification']) && $_POST['make_calification']==1) {
require_once('../gradebook/lib/be/gradebookitem.class.php');
require_once('../gradebook/lib/be/evaluation.class.php');
require_once('../gradebook/lib/be/abstractlink.class.php');
require_once('../gradebook/lib/gradebook_functions.inc.php');
-
+
$resource_name = Security::remove_XSS($_POST['dir_name']);
add_resource_to_course_gradebook(api_get_course_id(), 3, $row['id'], Database::escape_string($resource_name),(float)$_POST['weight']['weight'], (float)$_POST['qualification']['qualification'], Database::escape_string($_POST['description']),time(), 1,api_get_session_id());
- }
+ }
Display::display_confirmation_message(get_lang('FolderEdited'));
-
+
$values = $form_folder -> exportValues();
$values = $values['my_group'];
$dir_name = replace_dangerous_char($values['dir_name']);
@@ -620,7 +620,7 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$mydir = $my_sub_dir.$dir_name;
$dir = $dir_name;
$display_edit_form=false;
-
+
// gets calendar_id from student_publication_assigment
$sql = "SELECT add_to_calendar FROM $work_assigment WHERE publication_id ='".$row['id']."'";
$res = Database::query($sql,__FILE__,__LINE__);
@@ -634,8 +634,8 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
WHERE id='".$calendar_id[0]."'";
Database::query($sql,__FILE__,__LINE__);
}
-
-
+
+
}
}
}
@@ -644,7 +644,7 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$class = '';
$row[] = '
'; //image
//$a_count_directory=count_dir($work_dir.'/'.$dir,false);
-
+
$cant_files=0;
$cant_dir = 0;
if(api_is_allowed_to_edit()) {
@@ -671,24 +671,24 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$res_directory = Database::query($sql_directory,__FILE__,__LINE__);
$count_directory = Database::fetch_row($res_directory);
$cant_dir = $count_directory[0];
-
+
$text_file=get_lang('FilesUpload');
$text_dir=get_lang('Directories');
-
+
if ($cant_files==1) {
$text_file=api_strtolower(get_lang('FileUpload'));
}
-
+
if ($cant_dir==1) {
$text_dir=get_lang('directory');
}
-
+
if ($cant_dir!=0) {
$dirtext=' ('.$cant_dir.' '.$text_dir.')';
} else {
$dirtext='';
}
-
+
if (!empty($display_edit_form) && isset($clean_edit_dir) && $clean_edit_dir==$mydir) {
$row[] = ''.$dir.''.$form_folder->toHtml(); // form to edit the directory's name
} else {
@@ -715,7 +715,7 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
if ($count_files!=0) {
$row[] = "";
}
-
+
if ($direc_date!='' && $direc_date!='0000-00-00 00:00:00') {
$my_direc_date = api_ucfirst(format_locale_date($dateFormatShort,strtotime($direc_date))).' ';
$my_direc_date .= ucfirst(strftime($timeNoSecFormat,strtotime($direc_date)));
@@ -723,7 +723,7 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
} else {
$row[]='';
}
-
+
if ($origin != 'learnpath') {
if( $is_allowed_to_edit) {
$action .= '