storage-updates

This commit is contained in:
Manish Verma
2017-05-15 18:51:58 +05:30
parent bddfd25393
commit f9272f0bb2
2 changed files with 10 additions and 3 deletions

View File

@@ -187,6 +187,7 @@ class StorageController extends Controller {
public function saveAttachments($thread_id, $attachments = []) {
$disposition = 'ATTACHMENT';
$thread = '';
foreach ($attachments as $attachment) {
if (is_object($attachment)) {
if (method_exists($attachment, 'getStructure')) {
@@ -215,11 +216,16 @@ class StorageController extends Controller {
public function updateBody($attachment, $thread_id, $filename) {
$threads = new Ticket_Thread();
$thread = $threads->find($thread_id);
$structure = $attachment->getStructure();
$disposition = 'ATTACHMENT';
if (isset($structure->disposition)) {
$disposition = $structure->disposition;
if (is_object($attachment)) {
if (method_exists($attachment, 'getStructure')) {
$structure = $attachment->getStructure();
if (isset($structure->disposition)) {
$disposition = $structure->disposition;
}
}
}
if ($disposition == 'INLINE' || $disposition == 'inline') {
$id = str_replace('>', '', str_replace('<', '', $structure->id));
$body = $thread->body;

View File

@@ -248,6 +248,7 @@ class FormController extends Controller
return Redirect::back()->withInput($request->except('password'))->with('fails', Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken'));
}
} catch (\Exception $ex) {
dd($ex);
return redirect()->back()->with('fails', $ex->getMessage());
}
// dd($result);