| @@ 99-105 (lines=7) @@ | ||
| 96 | { |
|
| 97 | $alert = Alert::find($id); |
|
| 98 | $alert->state = $request->input('state'); |
|
| 99 | if ($alert->save()) |
|
| 100 | { |
|
| 101 | return $this->response->array(array('statusText' => 'OK')); |
|
| 102 | } |
|
| 103 | else { |
|
| 104 | return $this->response->errorInternal(); |
|
| 105 | } |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| @@ 50-55 (lines=6) @@ | ||
| 47 | $result = $notification->markSticky(false); |
|
| 48 | } |
|
| 49 | ||
| 50 | if ($result === false) { |
|
| 51 | return $this->response->errorInternal(); |
|
| 52 | } |
|
| 53 | else { |
|
| 54 | return $this->response->array(array('statusText' => 'OK')); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| @@ 70-75 (lines=6) @@ | ||
| 67 | $notification->body = $request->body; |
|
| 68 | $notification->checksum = hash('sha512', $request->user()->user_id.'.LOCAL.'.$request->title); |
|
| 69 | $notification->source = $request->user()->user_id; |
|
| 70 | if ($notification->save()) { |
|
| 71 | return $this->response->array(array('statusText' => 'OK')); |
|
| 72 | } |
|
| 73 | else { |
|
| 74 | return $this->response->errorInternal(); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | } |
|
| @@ 128-134 (lines=7) @@ | ||
| 125 | $dashboard = Dashboard::find($id); |
|
| 126 | $dashboard->dashboard_name = $request->name; |
|
| 127 | $dashboard->access = $request->access; |
|
| 128 | if ($dashboard->save()) |
|
| 129 | { |
|
| 130 | return $this->response->array(array('statusText' => 'OK')); |
|
| 131 | } |
|
| 132 | else { |
|
| 133 | return $this->response->errorInternal(); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | else { |
|
| 137 | $errors = $validation->errors(); |
|
| @@ 152-158 (lines=7) @@ | ||
| 149 | { |
|
| 150 | if (Dashboard::where('user_id', $request->user()->user_id)->where('dashboard_id', $id)->delete()) |
|
| 151 | { |
|
| 152 | if (UsersWidgets::where('dashboard_id', $id)->delete() >= 0) |
|
| 153 | { |
|
| 154 | return $this->response->array(array('statusText' => 'OK')); |
|
| 155 | } |
|
| 156 | else { |
|
| 157 | return $this->response->errorInternal(); |
|
| 158 | } |
|
| 159 | } |
|
| 160 | else { |
|
| 161 | return $this->response->errorInternal(); |
|
| @@ 115-121 (lines=7) @@ | ||
| 112 | $users_widgets->size_y = $request->input('height'); |
|
| 113 | } |
|
| 114 | ||
| 115 | if ($users_widgets->save()) |
|
| 116 | { |
|
| 117 | return $this->response->array(array('statusText' => 'OK')); |
|
| 118 | } |
|
| 119 | else { |
|
| 120 | return $this->response->errorInternal(); |
|
| 121 | } |
|
| 122 | } |
|
| 123 | ||
| 124 | /** |
|
| @@ 60-66 (lines=7) @@ | ||
| 57 | $user_widget->size_y = $request->size_y; |
|
| 58 | $user_widget->title = $request->title; |
|
| 59 | $user_widget->dashboard_id = $request->dashboard_id; |
|
| 60 | if ($user_widget->save()) |
|
| 61 | { |
|
| 62 | return $this->response->array(array('statusText' => 'OK', 'user_widget_id' => $user_widget->user_widget_id)); |
|
| 63 | } |
|
| 64 | else { |
|
| 65 | return $this->response->errorInternal(); |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|