@@ -40,12 +40,12 @@ public function getCreate()
4040 // Show the page
4141 $ depreciation_list = array ('' => 'Do Not Depreciate ' ) + Depreciation::lists ('name ' , 'id ' );
4242 $ manufacturer_list = array ('' => 'Select One ' ) + Manufacturer::lists ('name ' , 'id ' );
43- $ category_list = array ('' => '' ) + DB ::table ('categories ' )->lists ('name ' , 'id ' );
43+ $ category_list = array ('' => '' ) + DB ::table ('categories ' )->whereNull ( ' deleted_at ' )-> lists ('name ' , 'id ' );
4444 $ view = View::make ('backend/models/edit ' );
4545 $ view ->with ('category_list ' ,$ category_list );
4646 $ view ->with ('depreciation_list ' ,$ depreciation_list );
4747 $ view ->with ('manufacturer_list ' ,$ manufacturer_list );
48- $ view ->with ('model ' ,new Model );
48+ $ view ->with ('model ' ,new Model );
4949 return $ view ;
5050 }
5151
@@ -81,7 +81,7 @@ public function postCreate()
8181 if ($ model ->save ())
8282 {
8383 // Redirect to the new model page
84- return Redirect::to ("assets /models " )->with ('success ' , Lang::get ('admin/models/message.create.success ' ));
84+ return Redirect::to ("hardware /models " )->with ('success ' , Lang::get ('admin/models/message.create.success ' ));
8585 }
8686 }
8787 else
@@ -92,7 +92,7 @@ public function postCreate()
9292 }
9393
9494 // Redirect to the model create page
95- return Redirect::to ('assets /models/create ' )->with ('error ' , Lang::get ('admin/models/message.create.error ' ));
95+ return Redirect::to ('hardware /models/create ' )->with ('error ' , Lang::get ('admin/models/message.create.error ' ));
9696
9797 }
9898
@@ -156,7 +156,7 @@ public function postEdit($modelId = null)
156156 if ($ model ->save ())
157157 {
158158 // Redirect to the new model page
159- return Redirect::to ("assets /models/$ modelId/edit " )->with ('success ' , Lang::get ('admin/models/message.update.success ' ));
159+ return Redirect::to ("hardware /models/$ modelId/edit " )->with ('success ' , Lang::get ('admin/models/message.update.success ' ));
160160 }
161161 }
162162 else
@@ -167,7 +167,7 @@ public function postEdit($modelId = null)
167167 }
168168
169169 // Redirect to the model create page
170- return Redirect::to ("assets /models/$ modelId/edit " )->with ('error ' , Lang::get ('admin/models/message.update.error ' ));
170+ return Redirect::to ("hardware /models/$ modelId/edit " )->with ('error ' , Lang::get ('admin/models/message.update.error ' ));
171171
172172 }
173173
@@ -183,19 +183,19 @@ public function getDelete($modelId)
183183 if (is_null ($ model = Model::find ($ modelId )))
184184 {
185185 // Redirect to the blogs management page
186- return Redirect::to ('assets /models ' )->with ('error ' , Lang::get ('admin/models/message.not_found ' ));
186+ return Redirect::to ('hardware /models ' )->with ('error ' , Lang::get ('admin/models/message.not_found ' ));
187187 }
188188
189189 if ($ model ->assets ->count () > 0 ) {
190190 // Throw an error that this model is associated with assets
191- return Redirect::to ('assets /models ' )->with ('error ' , Lang::get ('admin/models/message.assoc_users ' ));
191+ return Redirect::to ('hardware /models ' )->with ('error ' , Lang::get ('admin/models/message.assoc_users ' ));
192192
193193 } else {
194194 // Delete the model
195195 $ model ->delete ();
196196
197197 // Redirect to the models management page
198- return Redirect::to ('assets /models ' )->with ('success ' , Lang::get ('admin/models/message.delete.success ' ));
198+ return Redirect::to ('hardware /models ' )->with ('success ' , Lang::get ('admin/models/message.delete.success ' ));
199199 }
200200 }
201201
0 commit comments