Fix UI when uploading work corrections.

1.10.x
Julio Montoya 10 years ago
parent fe790acee7
commit 46d10842f9
  1. 18
      app/Resources/public/css/base.css
  2. BIN
      main/img/icons/32/file_upload.png
  3. 6
      main/inc/ajax/model.ajax.php
  4. 44
      main/work/work.lib.php
  5. 142
      main/work/work_list_all.php

@ -159,8 +159,6 @@ ul#navigation .report a {
width: auto;
}
/* END CSS BASE */
.button-load{
@ -168,6 +166,22 @@ ul#navigation .report a {
padding-top: 70px;
}
/* work correction upload */
#results .file_upload_highlight {
background: #F4D364;
}
.work_correction_file_upload .button-load {
position: absolute;
top: -60px;
left: -30px;
font-size: 10px;
width: 100px;
padding-top: 0px;
background: none;
}
/* END COURSE PROGRESS*/
/* IMPRESS JS */
.impress-content{

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

@ -747,23 +747,25 @@ switch ($action) {
case 'get_work_user_list_all':
if (isset($_GET['type']) && $_GET['type'] == 'simple') {
$columns = array(
'type',
//'type',
'firstname',
'lastname',
'title',
'qualification',
'sent_date',
'qualificator_id',
'correction',
'actions'
);
} else {
$columns = array(
'type',
//'type',
'firstname',
'lastname',
'title',
'qualification',
'sent_date',
'correction',
'actions'
);
}

@ -2044,47 +2044,53 @@ function get_work_user_list(
$work['sent_date'] = date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . '<br />' . $work_date;
// Actions.
$correction = '';
$action = '';
if (api_is_allowed_to_edit()) {
$action .= $item_id.'<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
$action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a> ';
if ($unoconv && empty($work['contains_file'])) {
$action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
Display::return_icon('export_doc.png', get_lang('ExportToDoc'),array(), ICON_SIZE_SMALL).'</a> ';
}
$action .= '
$correction = '
<form
id="file_upload_'.$item_id.'"
class="work_correction_upload file_upload file_upload_small"
action="'.api_get_path(WEB_AJAX_PATH).'work.ajax.php?'.api_get_cidreq().'&a=upload_correction_file&item_id='.$item_id.'" method="POST" enctype="multipart/form-data">
class="work_correction_file_upload file_upload_small"
action="'.api_get_path(WEB_AJAX_PATH).'work.ajax.php?'.api_get_cidreq().'&a=upload_correction_file&item_id='.$item_id.'" method="POST" enctype="multipart/form-data"
>
<div class="button-load">
'.get_lang('ClickOrDropFilesHere').'
</div>
<input type="file" name="file" multiple>
<button type="submit">Upload</button>
<button type="submit"></button>
</form>
';
$action .= "
$correction .= "
<script>
$(document).ready(function() {
$('#file_upload_".$item_id."').fileUploadUI({
uploadTable: $('.files'),
downloadTable: $('.files'),
buildUploadRow: function (files, index) {
$('.files').show();
return $('<tr><td>' + files[index].name + '<\/td>' +
$('#file_upload_".$item_id."').fileUploadUI({
uploadTable: $('.files'),
downloadTable: $('.files'),
buildUploadRow: function (files, index) {
$('.files').show();
return
$('<tr><td>' + files[index].name + '<\/td>' +
'<td class=\"file_upload_progress\"><div><\/div><\/td>' +
'<td class=\"file_upload_cancel\">' +
'<button class=\"ui-state-default ui-corner-all\" title=\"".get_lang('Cancel')."\">' +
'<span class=\"ui-icon ui-icon-cancel\">".get_lang('Cancel')."<\/span>' +'<\/button>'+
'<\/td><\/tr>');
},
buildDownloadRow: function (file) {
return $('<tr><td>' + file.name + '<\/td> <td> ' + file.size + ' <\/td> <td>&nbsp;' + file.result + ' <\/td> <\/tr>');
}
});
},
buildDownloadRow: function (file) {
return $('<tr><td>' + file.name + '<\/td> <td> ' + file.size + ' <\/td> <td>&nbsp;' + file.result + ' <\/td> <\/tr>');
}
});
});
</script>
";
@ -2155,9 +2161,11 @@ function get_work_user_list(
}
$work['qualificator_id'] = $qualificator_id;
$work['actions'] = $send_to.$link_to_download.$action;
$work['correction'] = $correction;
$works[] = $work;
}
}
return $works;
}
}

@ -207,46 +207,155 @@ if (!empty($work_data['enable_qualification']) &&
$type = 'simple';
$columns = array(
get_lang('Type'),
//get_lang('Type'),
get_lang('FirstName'),
get_lang('LastName'),
get_lang('Title'),
get_lang('Feedback'),
get_lang('Date'),
get_lang('Status'),
get_lang('UploadCorrection'),
get_lang('Actions')
);
$column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'25', 'align'=>'left', 'search' => 'true'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'30', 'align'=>'left', 'search' => 'false', 'sortable'=>'false', )
/*array(
'name' => 'type',
'index' => 'file',
'width' => '8',
'align' => 'left',
'search' => 'false',
'sortable' => 'false',
),*/
array(
'name' => 'firstname',
'index' => 'firstname',
'width' => '35',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'lastname',
'index' => 'lastname',
'width' => '35',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'title',
'index' => 'title',
'width' => '40',
'align' => 'left',
'search' => 'false',
'wrap_cell' => 'true',
),
array(
'name' => 'qualification',
'index' => 'qualification',
'width' => '20',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'sent_date',
'index' => 'sent_date',
'width' => '40',
'align' => 'left',
'search' => 'true',
'wrap_cell' => 'true',
),
array(
'name' => 'qualificator_id',
'index' => 'qualificator_id',
'width' => '25',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'correction',
'index' => 'correction',
'width' => '30',
'align' => 'left',
'search' => 'false',
'sortable' => 'false',
),
array(
'name' => 'actions',
'index' => 'actions',
'width' => '30',
'align' => 'left',
'search' => 'false',
'sortable' => 'false',
),
);
} else {
$type = 'complex';
$columns = array(
get_lang('Type'),
//get_lang('Type'),
get_lang('FirstName'),
get_lang('LastName'),
get_lang('Title'),
get_lang('Feedback'),
get_lang('Date'),
get_lang('UploadCorrection'),
get_lang('Actions')
);
$column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'25', 'align'=>'left', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
/*array(
'name' => 'type',
'index' => 'file',
'width' => '8',
'align' => 'left',
'search' => 'false',
'sortable' => 'false',
),*/
array(
'name' => 'firstname',
'index' => 'firstname',
'width' => '35',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'lastname',
'index' => 'lastname',
'width' => '35',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'title',
'index' => 'title',
'width' => '40',
'align' => 'left',
'search' => 'false',
'wrap_cell' => "true",
),
array(
'name' => 'qualification',
'index' => 'qualification',
'width' => '25',
'align' => 'left',
'search' => 'true',
),
array(
'name' => 'sent_date',
'index' => 'sent_date',
'width' => '30',
'align' => 'left',
'search' => 'true',
'wrap_cell' => 'true',
),
array(
'name' => 'correction',
'index' => 'correction',
'width' => '30',
'align' => 'left',
'search' => 'false',
'sortable' => 'false',
),
array(
'name' => 'actions',
'index' => 'actions',
@ -256,7 +365,6 @@ if (!empty($work_data['enable_qualification']) &&
'sortable' => 'false'
//'wrap_cell' => 'true',
)
);
}

Loading…
Cancel
Save