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. 24
      main/work/work.lib.php
  5. 142
      main/work/work_list_all.php

@ -159,8 +159,6 @@ ul#navigation .report a {
width: auto; width: auto;
} }
/* END CSS BASE */ /* END CSS BASE */
.button-load{ .button-load{
@ -168,6 +166,22 @@ ul#navigation .report a {
padding-top: 70px; 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*/ /* END COURSE PROGRESS*/
/* IMPRESS JS */ /* IMPRESS JS */
.impress-content{ .impress-content{

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

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

@ -2044,27 +2044,33 @@ function get_work_user_list(
$work['sent_date'] = date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . '<br />' . $work_date; $work['sent_date'] = date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . '<br />' . $work_date;
// Actions. // Actions.
$correction = '';
$action = ''; $action = '';
if (api_is_allowed_to_edit()) { 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> '; Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a> ';
if ($unoconv && empty($work['contains_file'])) { 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').'" >'. $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> '; Display::return_icon('export_doc.png', get_lang('ExportToDoc'),array(), ICON_SIZE_SMALL).'</a> ';
} }
$action .= '
$correction = '
<form <form
id="file_upload_'.$item_id.'" id="file_upload_'.$item_id.'"
class="work_correction_upload file_upload file_upload_small" 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"> 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> <input type="file" name="file" multiple>
<button type="submit">Upload</button> <button type="submit"></button>
</form> </form>
'; ';
$action .= " $correction .= "
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#file_upload_".$item_id."').fileUploadUI({ $('#file_upload_".$item_id."').fileUploadUI({
@ -2072,7 +2078,8 @@ function get_work_user_list(
downloadTable: $('.files'), downloadTable: $('.files'),
buildUploadRow: function (files, index) { buildUploadRow: function (files, index) {
$('.files').show(); $('.files').show();
return $('<tr><td>' + files[index].name + '<\/td>' + return
$('<tr><td>' + files[index].name + '<\/td>' +
'<td class=\"file_upload_progress\"><div><\/div><\/td>' + '<td class=\"file_upload_progress\"><div><\/div><\/td>' +
'<td class=\"file_upload_cancel\">' + '<td class=\"file_upload_cancel\">' +
'<button class=\"ui-state-default ui-corner-all\" title=\"".get_lang('Cancel')."\">' + '<button class=\"ui-state-default ui-corner-all\" title=\"".get_lang('Cancel')."\">' +
@ -2084,7 +2091,6 @@ function get_work_user_list(
} }
}); });
}); });
</script> </script>
"; ";
@ -2155,9 +2161,11 @@ function get_work_user_list(
} }
$work['qualificator_id'] = $qualificator_id; $work['qualificator_id'] = $qualificator_id;
$work['actions'] = $send_to.$link_to_download.$action; $work['actions'] = $send_to.$link_to_download.$action;
$work['correction'] = $correction;
$works[] = $work; $works[] = $work;
} }
} }
return $works; return $works;
} }
} }

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

Loading…
Cancel
Save