Get inline attachment viewing for doc/xls/ppt working
This commit is contained in:
parent
e3bb11f27d
commit
67fad4c6ce
@ -262,13 +262,13 @@ function hesk_load_database_functions()
|
|||||||
|
|
||||||
function hesk_load_api_database_functions()
|
function hesk_load_api_database_functions()
|
||||||
{
|
{
|
||||||
require(__DIR__ . '/../api/core/json_error.php');
|
require(__DIR__ . '/../api/Core/json_error.php');
|
||||||
// Preferrably use the MySQLi functions
|
// Preferrably use the MySQLi functions
|
||||||
if (function_exists('mysqli_connect')) {
|
if (function_exists('mysqli_connect')) {
|
||||||
require(__DIR__ . '/../api/core/database_mysqli.inc.php');
|
require(__DIR__ . '/../api/Core/database_mysqli.inc.php');
|
||||||
} // Default to MySQL
|
} // Default to MySQL
|
||||||
else {
|
else {
|
||||||
require(__DIR__ . '/../api/core/database.inc.php');
|
require(__DIR__ . '/../api/Core/database.inc.php');
|
||||||
}
|
}
|
||||||
} // END hesk_load_database_functions()
|
} // END hesk_load_database_functions()
|
||||||
|
|
||||||
|
@ -51,11 +51,12 @@ function mfh_listAttachments($attachments = '', $reply = 0, $is_staff)
|
|||||||
} elseif (in_array($fontAwesomeIcon, array('fa fa-file-word-o', 'fa fa-file-excel-o', 'fa fa-file-powerpoint-o'))) {
|
} elseif (in_array($fontAwesomeIcon, array('fa fa-file-word-o', 'fa fa-file-excel-o', 'fa fa-file-powerpoint-o'))) {
|
||||||
//-- Get the actual image location and display a thumbnail. It will be linked to a modal to view a larger size.
|
//-- Get the actual image location and display a thumbnail. It will be linked to a modal to view a larger size.
|
||||||
$path = mfh_getSavedNameUrlForAttachment($att_id, $is_staff);
|
$path = mfh_getSavedNameUrlForAttachment($att_id, $is_staff);
|
||||||
|
$apiPath = preg_replace('/https?:\/\//i', '', $hesk_settings['hesk_url'] . '/api/index.php/v1/tickets/' . $trackingID . '/attachments/' . $att_id);
|
||||||
|
|
||||||
if ($path == '') {
|
if ($path == '') {
|
||||||
echo '<i class="fa fa-ban fa-4x" data-toggle="tooltip" title="' . $hesklang['attachment_removed'] . '"></i>';
|
echo '<i class="fa fa-ban fa-4x" data-toggle="tooltip" title="' . $hesklang['attachment_removed'] . '"></i>';
|
||||||
} else {
|
} else {
|
||||||
echo '<a class="mfp-iframe" data-toggle="lightbox-item" href="https://view.officeapps.live.com/op/embed.aspx?src=' . $path . '">
|
echo '<a class="mfp-iframe" data-toggle="lightbox-item" href="https://view.officeapps.live.com/op/embed.aspx?src=' . $apiPath . '">
|
||||||
<i class="' . $fontAwesomeIcon . ' fa-4x"></i>
|
<i class="' . $fontAwesomeIcon . ' fa-4x"></i>
|
||||||
</a>';
|
</a>';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user