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 = []) { public function saveAttachments($thread_id, $attachments = []) {
$disposition = 'ATTACHMENT'; $disposition = 'ATTACHMENT';
$thread = '';
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
if (is_object($attachment)) { if (is_object($attachment)) {
if (method_exists($attachment, 'getStructure')) { if (method_exists($attachment, 'getStructure')) {
@@ -215,11 +216,16 @@ class StorageController extends Controller {
public function updateBody($attachment, $thread_id, $filename) { public function updateBody($attachment, $thread_id, $filename) {
$threads = new Ticket_Thread(); $threads = new Ticket_Thread();
$thread = $threads->find($thread_id); $thread = $threads->find($thread_id);
$structure = $attachment->getStructure();
$disposition = 'ATTACHMENT'; $disposition = 'ATTACHMENT';
if (isset($structure->disposition)) { if (is_object($attachment)) {
$disposition = $structure->disposition; if (method_exists($attachment, 'getStructure')) {
$structure = $attachment->getStructure();
if (isset($structure->disposition)) {
$disposition = $structure->disposition;
}
}
} }
if ($disposition == 'INLINE' || $disposition == 'inline') { if ($disposition == 'INLINE' || $disposition == 'inline') {
$id = str_replace('>', '', str_replace('<', '', $structure->id)); $id = str_replace('>', '', str_replace('<', '', $structure->id));
$body = $thread->body; $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')); 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) { } catch (\Exception $ex) {
dd($ex);
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
} }
// dd($result); // dd($result);