Improve pull-request
This commit is contained in:
@@ -20,8 +20,8 @@ class File extends Base
|
|||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
|
|
||||||
$this->response->html($this->taskLayout('file/new', array(
|
$this->response->html($this->taskLayout('file/new', array(
|
||||||
'task' => $task,
|
'task' => $task,
|
||||||
'max_size' => ini_get('upload_max_filesize'),
|
'max_size' => ini_get('upload_max_filesize'),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,8 +74,8 @@ class File extends Base
|
|||||||
|
|
||||||
if ($file['task_id'] == $task['id']) {
|
if ($file['task_id'] == $task['id']) {
|
||||||
$this->response->html($this->template->render('file/open', array(
|
$this->response->html($this->template->render('file/open', array(
|
||||||
'file' => $file,
|
'file' => $file,
|
||||||
'task' => $task,
|
'task' => $task,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,29 +102,31 @@ class File extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the file content (work only for images) resized
|
* Return image thumbnails
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function imageThumbnail() {
|
public function thumbnail()
|
||||||
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
||||||
$width_param = $this->request->getIntegerParam('width');
|
$width_param = $this->request->getIntegerParam('width');
|
||||||
$height_param = $this->request->getIntegerParam('height');
|
$height_param = $this->request->getIntegerParam('height');
|
||||||
$filename = FILES_DIR . $file['path'];
|
$filename = FILES_DIR.$file['path'];
|
||||||
|
|
||||||
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
|
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
|
||||||
|
|
||||||
// Get new sizes
|
// Get new sizes
|
||||||
list($width, $height) = getimagesize($filename);
|
list($width, $height) = getimagesize($filename);
|
||||||
|
|
||||||
if ($width_param == 0 && $height_param == 0) {
|
if ($width_param == 0 && $height_param == 0) {
|
||||||
$newwidth = 100;
|
$newwidth = 100;
|
||||||
$newheight = 100;
|
$newheight = 100;
|
||||||
} elseif ($width_param > 0 && $height_param == 0) {
|
} elseif ($width_param > 0 && $height_param == 0) {
|
||||||
$newwidth = $width_param;
|
$newwidth = $width_param;
|
||||||
$newheight = floor($height * ( $width_param / $width ));
|
$newheight = floor($height * ($width_param / $width));
|
||||||
} elseif ($width_param == 0 && $height_param > 0) {
|
} elseif ($width_param == 0 && $height_param > 0) {
|
||||||
$newwidth = floor($width * ( $height_param / $height ));
|
$newwidth = floor($width * ($height_param / $height));
|
||||||
$newheight = $height_param;
|
$newheight = $height_param;
|
||||||
} else {
|
} else {
|
||||||
$newwidth = $width_param;
|
$newwidth = $width_param;
|
||||||
@@ -133,9 +135,7 @@ class File extends Base
|
|||||||
|
|
||||||
// Load
|
// Load
|
||||||
$thumb = imagecreatetruecolor($newwidth, $newheight);
|
$thumb = imagecreatetruecolor($newwidth, $newheight);
|
||||||
|
$extension = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION));
|
||||||
$info = pathinfo($file['name']);
|
|
||||||
$extension = strtolower($info['extension']);
|
|
||||||
|
|
||||||
switch ($extension) {
|
switch ($extension) {
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
@@ -153,17 +153,18 @@ class File extends Base
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize
|
// Resize
|
||||||
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
|
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
|
||||||
|
|
||||||
$metadata = getimagesize($filename);
|
$metadata = getimagesize($filename);
|
||||||
|
|
||||||
if (isset($metadata['mime'])) {
|
if (isset($metadata['mime'])) {
|
||||||
$this->response->contentType($metadata['mime']);
|
$this->response->contentType($metadata['mime']);
|
||||||
imagejpeg($thumb);
|
imagejpeg($thumb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a file
|
* Remove a file
|
||||||
*
|
*
|
||||||
@@ -195,8 +196,8 @@ class File extends Base
|
|||||||
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
||||||
|
|
||||||
$this->response->html($this->taskLayout('file/remove', array(
|
$this->response->html($this->taskLayout('file/remove', array(
|
||||||
'task' => $task,
|
'task' => $task,
|
||||||
'file' => $file,
|
'file' => $file,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -726,4 +726,48 @@ class Helper
|
|||||||
{
|
{
|
||||||
return dt('%A', strtotime('next Monday +'.($day - 1).' days'));
|
return dt('%A', strtotime('next Monday +'.($day - 1).' days'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get file icon
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $filename Filename
|
||||||
|
* @return string Font-Awesome-Icon-Name
|
||||||
|
*/
|
||||||
|
public function getFileIcon($filename){
|
||||||
|
|
||||||
|
$extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||||
|
|
||||||
|
switch ($extension) {
|
||||||
|
case 'jpeg':
|
||||||
|
case 'jpg':
|
||||||
|
case 'png':
|
||||||
|
case 'gif':
|
||||||
|
return 'fa-file-image-o';
|
||||||
|
case 'xls':
|
||||||
|
case 'xlsx':
|
||||||
|
return 'fa-file-excel-o';
|
||||||
|
case 'doc':
|
||||||
|
case 'docx':
|
||||||
|
return 'fa-file-word-o';
|
||||||
|
case 'ppt':
|
||||||
|
case 'pptx':
|
||||||
|
return 'fa-file-powerpoint-o';
|
||||||
|
case 'zip':
|
||||||
|
case 'rar':
|
||||||
|
return 'fa-archive-o';
|
||||||
|
case 'mp3':
|
||||||
|
return 'fa-audio-o';
|
||||||
|
case 'avi':
|
||||||
|
return 'fa-video-o';
|
||||||
|
case 'php':
|
||||||
|
case 'html':
|
||||||
|
case 'css':
|
||||||
|
return 'fa-code-o';
|
||||||
|
case 'pdf':
|
||||||
|
return 'fa-file-pdf-o';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'fa-file-o';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -775,4 +775,6 @@ return array(
|
|||||||
'Remove time slot' => 'Supprimer un créneau horaire',
|
'Remove time slot' => 'Supprimer un créneau horaire',
|
||||||
'Add new time slot' => 'Ajouter un créneau horaire',
|
'Add new time slot' => 'Ajouter un créneau horaire',
|
||||||
'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => 'Ces horaires sont utilisés lorsque la case « Toute la journée » est cochée pour les heures d\'absences ou supplémentaires programmées.',
|
'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => 'Ces horaires sont utilisés lorsque la case « Toute la journée » est cochée pour les heures d\'absences ou supplémentaires programmées.',
|
||||||
|
'Files' => 'Fichiers',
|
||||||
|
'Images' => 'Images',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -773,4 +773,6 @@ return array(
|
|||||||
// 'Remove time slot' => '',
|
// 'Remove time slot' => '',
|
||||||
// 'Add new time slot' => '',
|
// 'Add new time slot' => '',
|
||||||
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
// 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => '',
|
||||||
|
// 'Files' => '',
|
||||||
|
// 'Images' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class File extends Base
|
|||||||
->asc('name')
|
->asc('name')
|
||||||
->findAll();
|
->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all images for a given task
|
* Get all images for a given task
|
||||||
*
|
*
|
||||||
@@ -127,7 +127,7 @@ class File extends Base
|
|||||||
->asc('name')
|
->asc('name')
|
||||||
->findAll();
|
->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all files without images for a given task
|
* Get all files without images for a given task
|
||||||
*
|
*
|
||||||
@@ -153,76 +153,19 @@ class File extends Base
|
|||||||
*/
|
*/
|
||||||
public function isImage($filename)
|
public function isImage($filename)
|
||||||
{
|
{
|
||||||
$info = pathinfo($filename);
|
$extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||||
$extension = strtolower($info['extension']);
|
|
||||||
|
|
||||||
switch ($extension) {
|
switch ($extension) {
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
case 'png':
|
case 'png':
|
||||||
case 'gif':
|
case 'gif':
|
||||||
return true;
|
return true;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* get Font-Awesome Icon for file extension
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $filename Filename
|
|
||||||
* @return string Font-Awesome-Icon-Name
|
|
||||||
*/
|
|
||||||
public function get_icon($filename){
|
|
||||||
$info = pathinfo($filename);
|
|
||||||
$extension = strtolower($info['extension']);
|
|
||||||
switch ($extension) {
|
|
||||||
case 'jpeg':
|
|
||||||
case 'jpg':
|
|
||||||
case 'png':
|
|
||||||
case 'gif':
|
|
||||||
$icon = 'fa-file-image-o';
|
|
||||||
break;
|
|
||||||
case 'xls':
|
|
||||||
case 'xlsx':
|
|
||||||
$icon = 'fa-file-excel-o';
|
|
||||||
break;
|
|
||||||
case 'doc':
|
|
||||||
case 'docx':
|
|
||||||
$icon = 'fa-file-word-o';
|
|
||||||
break;
|
|
||||||
case 'ppt':
|
|
||||||
case 'pptx':
|
|
||||||
$icon = 'fa-file-powerpoint-o';
|
|
||||||
break;
|
|
||||||
case 'zip':
|
|
||||||
case 'rar':
|
|
||||||
$icon = 'fa-archive-o';
|
|
||||||
break;
|
|
||||||
case 'mp3':
|
|
||||||
$icon = 'fa-audio-o';
|
|
||||||
break;
|
|
||||||
case 'avi':
|
|
||||||
$icon = 'fa-video-o';
|
|
||||||
break;
|
|
||||||
case 'php':
|
|
||||||
case 'html':
|
|
||||||
case 'css':
|
|
||||||
$icon = 'fa-code-o';
|
|
||||||
break;
|
|
||||||
case 'pdf':
|
|
||||||
$icon = 'fa-file-pdf-o';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$icon = 'fa-file-o';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the path for a new filename
|
* Generate the path for a new filename
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
<section>
|
<section>
|
||||||
<table>
|
<table>
|
||||||
<?php if (!empty($images)): ?>
|
<?php if (! empty($images)): ?>
|
||||||
<?php foreach ($images as $file): ?>
|
<?php foreach ($images as $file): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="fa fa-file-image-o fa-fw"></i>
|
<td class="column-70">
|
||||||
<?=
|
<i class="fa fa-file-image-o fa-fw"></i>
|
||||||
$this->e($file['name'])
|
<?= $this->e($file['name']) ?>
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||||
<i class="fa fa-eye"></i> <?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
<i class="fa fa-eye"></i> <?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php if (!empty($files)): ?>
|
<?php if (! empty($files)): ?>
|
||||||
<?php foreach ($files as $file): ?>
|
<?php foreach ($files as $file): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="fa <?= $this->file->get_icon($file['name']) ?> fa-fw"></i>
|
<td>
|
||||||
<?=
|
<i class="fa <?= $this->getFileIcon($file['name']) ?> fa-fw"></i>
|
||||||
$this->e($file['name'])
|
<?= $this->e($file['name']) ?>
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||||
|
|||||||
@@ -1,56 +1,48 @@
|
|||||||
<?php if (!empty($files) || !empty($images)): ?>
|
<?php if (! empty($files) || ! empty($images)): ?>
|
||||||
<div id="attachments" class="task-show-section">
|
<div id="attachments" class="task-show-section">
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Attachments') ?></h2>
|
<h2><?= t('Attachments') ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<?php if (!empty($images)): ?>
|
<?php if (!empty($images)): ?>
|
||||||
<h3>
|
<h3><?= t('Images') ?></h3>
|
||||||
<?= t('Images') ?>
|
<ul class="task-show-images">
|
||||||
</h3>
|
<?php foreach ($images as $file): ?>
|
||||||
<ul class="task-show-images">
|
<li>
|
||||||
<?php foreach ($images as $file): ?>
|
<div class="img_container">
|
||||||
<li>
|
<img src="<?= $this->u('file', 'thumbnail', array('width' => 250, 'file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/>
|
||||||
<div class="img_container">
|
</div>
|
||||||
<img src="<?= $this->u('file', 'imageThumbnail', array('width' => 250, 'file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/>
|
<p>
|
||||||
</div>
|
<?= $this->e($file['name']) ?>
|
||||||
<p>
|
</p>
|
||||||
<?= $this->e($file['name']) ?>
|
<span class="task-show-file-actions task-show-image-actions">
|
||||||
</p>
|
<i class="fa fa-eye"></i> <?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||||
<span class="task-show-file-actions task-show-image-actions">
|
<i class="fa fa-trash"></i> <?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||||
<i class="fa fa-eye"></i> <?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<?php if (! empty($files)): ?>
|
||||||
|
<h3><?= t('Files') ?></h3>
|
||||||
|
<table class="task-show-file-table">
|
||||||
|
<?php foreach ($files as $file): ?>
|
||||||
|
<tr>
|
||||||
|
<td><i class="fa <?= $this->getFileIcon($file['name']) ?> fa-fw"></i></td>
|
||||||
|
<td>
|
||||||
|
<?= $this->e($file['name']) ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="task-show-file-actions">
|
||||||
<i class="fa fa-trash"></i> <?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
<i class="fa fa-trash"></i> <?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||||
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</td>
|
||||||
<?php endforeach ?>
|
</tr>
|
||||||
</ul>
|
<?php endforeach ?>
|
||||||
<?php endif
|
</table>
|
||||||
?>
|
<?php endif ?>
|
||||||
<?php if (!empty($files)): ?>
|
</div>
|
||||||
<h3>
|
<?php endif ?>
|
||||||
<?= t('Files') ?>
|
|
||||||
</h3>
|
|
||||||
<table class="task-show-file-table">
|
|
||||||
<?php foreach ($files as $file): ?>
|
|
||||||
<tr>
|
|
||||||
<td><i class="fa <?= $this->file->get_icon($file['name']) ?> fa-fw"></i></td>
|
|
||||||
<td>
|
|
||||||
<?= $this->e($file['name']) ?>
|
|
||||||
</td><td>
|
|
||||||
<span class="task-show-file-actions">
|
|
||||||
<i class="fa fa-trash"></i> <?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
|
||||||
<i class="fa fa-download"></i> <?= $this->a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
|
||||||
</span>
|
|
||||||
</td></tr>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<?php endif
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
endif ?>
|
|
||||||
Reference in New Issue
Block a user