@@ -5,5 +5,5 @@ |
||
5 | 5 | class SdChangetypes extends Model |
6 | 6 | { |
7 | 7 | protected $table = 'sd_change_types'; |
8 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
8 | + protected $fillable = ['id', 'name', 'created_at', 'updated_at']; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | class SdChangepriorities extends Model |
6 | 6 | { |
7 | 7 | protected $table = 'sd_change_priorities'; |
8 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
8 | + protected $fillable = ['id', 'name', 'created_at', 'updated_at']; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | class SdImpacttypes extends Model |
6 | 6 | { |
7 | 7 | protected $table = 'sd_impact_types'; |
8 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
8 | + protected $fillable = ['id', 'name', 'created_at', 'updated_at']; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -7,5 +7,5 @@ |
||
7 | 7 | { |
8 | 8 | protected $table = 'sd_release_priorities'; |
9 | 9 | |
10 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
10 | + protected $fillable = ['id','name','created_at','updated_at']; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -7,5 +7,5 @@ |
||
7 | 7 | { |
8 | 8 | protected $table = 'sd_release_priorities'; |
9 | 9 | |
10 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
10 | + protected $fillable = ['id', 'name', 'created_at', 'updated_at']; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -7,5 +7,5 @@ |
||
7 | 7 | { |
8 | 8 | protected $table = 'sd_release_status'; |
9 | 9 | |
10 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
10 | + protected $fillable = ['id','name','created_at','updated_at']; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -7,5 +7,5 @@ |
||
7 | 7 | { |
8 | 8 | protected $table = 'sd_release_status'; |
9 | 9 | |
10 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
10 | + protected $fillable = ['id', 'name', 'created_at', 'updated_at']; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -6,5 +6,5 @@ |
||
6 | 6 | class SdLocations extends Model |
7 | 7 | { |
8 | 8 | protected $table = 'sd_locations'; |
9 | - protected $fillable = ['id','location_category_id','title','email','phone','address','all_department_access','departments','status','created_at','updated_at']; |
|
9 | + protected $fillable = ['id', 'location_category_id', 'title', 'email', 'phone', 'address', 'all_department_access', 'departments', 'status', 'created_at', 'updated_at']; |
|
10 | 10 | } |
11 | 11 | \ No newline at end of file |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | return $this->belongsTo('App\Plugins\ServiceDesk\Model\Releases\SdReleasepriorities','priority_id'); |
81 | 81 | } |
82 | 82 | |
83 | - /** |
|
84 | - * get the priority name |
|
85 | - * @return string |
|
86 | - */ |
|
83 | + /** |
|
84 | + * get the priority name |
|
85 | + * @return string |
|
86 | + */ |
|
87 | 87 | public function priorities() { |
88 | 88 | $value = "--"; |
89 | 89 | $attr = $this->attributes['priority_id']; |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | return ucfirst($value); |
113 | 113 | } |
114 | 114 | |
115 | - /** |
|
116 | - * get the description of this model |
|
117 | - * @return string |
|
118 | - */ |
|
115 | + /** |
|
116 | + * get the description of this model |
|
117 | + * @return string |
|
118 | + */ |
|
119 | 119 | public function descriptions() { |
120 | 120 | $value = "--"; |
121 | 121 | $attr = $this->attributes['description']; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return ucfirst($value); |
57 | 57 | } |
58 | 58 | |
59 | - public function status(){ |
|
59 | + public function status() { |
|
60 | 60 | return $this->belongsTo('App\Plugins\ServiceDesk\Model\Releases\SdReleasestatus', 'status_id'); |
61 | 61 | } |
62 | 62 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | return ucfirst($value); |
77 | 77 | } |
78 | 78 | |
79 | - public function priority(){ |
|
80 | - return $this->belongsTo('App\Plugins\ServiceDesk\Model\Releases\SdReleasepriorities','priority_id'); |
|
79 | + public function priority() { |
|
80 | + return $this->belongsTo('App\Plugins\ServiceDesk\Model\Releases\SdReleasepriorities', 'priority_id'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | return ucfirst($value); |
97 | 97 | } |
98 | 98 | |
99 | - public function releaseType(){ |
|
100 | - return $this->belongsTo('App\Plugins\ServiceDesk\Model\Releases\SdReleasetypes','release_type_id'); |
|
99 | + public function releaseType() { |
|
100 | + return $this->belongsTo('App\Plugins\ServiceDesk\Model\Releases\SdReleasetypes', 'release_type_id'); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | public function releaseTypes() { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $value = str_limit($attr, 10); |
124 | 124 | } |
125 | 125 | if (strlen($value) > 10) { |
126 | - $value .=" <a href=# id='show-description'>Show</a>"; |
|
126 | + $value .= " <a href=# id='show-description'>Show</a>"; |
|
127 | 127 | } |
128 | 128 | return ucfirst($value); |
129 | 129 | } |
@@ -138,29 +138,29 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | - public function assets(){ |
|
141 | + public function assets() { |
|
142 | 142 | $table = $this->table; |
143 | 143 | $id = $this->attributes['id']; |
144 | 144 | $owner = "$table:$id"; |
145 | 145 | $ids = []; |
146 | 146 | $relations = new \App\Plugins\ServiceDesk\Model\Common\AssetRelation(); |
147 | - $relation = $relations->where('owner',$owner)->first(); |
|
148 | - if($relation){ |
|
147 | + $relation = $relations->where('owner', $owner)->first(); |
|
148 | + if ($relation) { |
|
149 | 149 | $ids = $relation->asset_ids; |
150 | 150 | } |
151 | 151 | return $ids; |
152 | 152 | } |
153 | 153 | |
154 | - public function getAssets(){ |
|
154 | + public function getAssets() { |
|
155 | 155 | $ids = $this->assets(); |
156 | 156 | $asset = new \App\Plugins\ServiceDesk\Model\Assets\SdAssets(); |
157 | 157 | $assets = ""; |
158 | - if(count($ids)>0){ |
|
159 | - foreach($ids as $id){ |
|
158 | + if (count($ids) > 0) { |
|
159 | + foreach ($ids as $id) { |
|
160 | 160 | $ass = $asset->find($id); |
161 | - if($ass){ |
|
161 | + if ($ass) { |
|
162 | 162 | $value = "<a href=".url('service-desk/assets/'.$id.'/show').">".ucfirst($ass->name)."</a>"; |
163 | - $assets .=$value."</br>"; |
|
163 | + $assets .= $value."</br>"; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
@@ -188,29 +188,29 @@ discard block |
||
188 | 188 | $this->detachRelation($id); |
189 | 189 | parent::delete(); |
190 | 190 | } |
191 | - public function table(){ |
|
191 | + public function table() { |
|
192 | 192 | return $this->table; |
193 | 193 | } |
194 | - public function generalAttachments($identifier){ |
|
194 | + public function generalAttachments($identifier) { |
|
195 | 195 | $table = $this->table; |
196 | 196 | $id = $this->attributes['id']; |
197 | 197 | //$identifier = "root-cause"; |
198 | 198 | $owner = "$table:$identifier:$id"; |
199 | 199 | $attachment = new \App\Plugins\ServiceDesk\Model\Common\Attachments(); |
200 | - $attachments = $attachment->where('owner',$owner)->get(); |
|
200 | + $attachments = $attachment->where('owner', $owner)->get(); |
|
201 | 201 | return $attachments; |
202 | 202 | } |
203 | - public function getGeneralByIdentifier($identifier){ |
|
203 | + public function getGeneralByIdentifier($identifier) { |
|
204 | 204 | $table = $this->table; |
205 | 205 | $id = $this->attributes['id']; |
206 | 206 | $owner = "$table:$id"; |
207 | 207 | $generals = new \App\Plugins\ServiceDesk\Model\Common\GeneralInfo(); |
208 | - $general = $generals->where('owner',$owner)->where('key',$identifier)->first(); |
|
208 | + $general = $generals->where('owner', $owner)->where('key', $identifier)->first(); |
|
209 | 209 | return $general; |
210 | 210 | |
211 | 211 | } |
212 | 212 | |
213 | - public function subject(){ |
|
213 | + public function subject() { |
|
214 | 214 | $id = $this->attributes['id']; |
215 | 215 | $title = $this->attributes['subject']; |
216 | 216 | $subject = "<a href=".url('service-desk/releases/'.$id.'/show').">".$title."</a>"; |
@@ -7,5 +7,5 @@ |
||
7 | 7 | { |
8 | 8 | protected $table = 'sd_release_types'; |
9 | 9 | |
10 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
10 | + protected $fillable = ['id','name','created_at','updated_at']; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -7,5 +7,5 @@ |
||
7 | 7 | { |
8 | 8 | protected $table = 'sd_release_types'; |
9 | 9 | |
10 | - protected $fillable = ['id','name','created_at','updated_at']; |
|
10 | + protected $fillable = ['id', 'name', 'created_at', 'updated_at']; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -5,7 +5,7 @@ |
||
5 | 5 | class GeneralInfo extends Model |
6 | 6 | { |
7 | 7 | protected $table = 'sd_gerneral'; |
8 | - protected $fillable = ['owner','key','value']; |
|
8 | + protected $fillable = ['owner', 'key', 'value']; |
|
9 | 9 | |
10 | 10 | |
11 | 11 | } |
12 | 12 | \ No newline at end of file |