Beispiel #1
0
 public function update($id)
 {
     $query = Project::where('id', '=', $id)->get();
     foreach ($query as $fetch) {
         $this->vars['user_id'] = $fetch->user_id;
         $this->vars['myId'] = BackendAuth::getUser()->id;
         $this->vars['isAssigned'] = Assign::checkAssigned(BackendAuth::getUser()->id, $fetch->id);
     }
     $this->getClassExtension('Backend.Behaviors.FormController')->update($id);
 }
Beispiel #2
0
 public function index_onDelete()
 {
     if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
         foreach ($checkedIds as $projectId) {
             if (!($project = Project::find($projectId))) {
                 continue;
             }
             Assign::where('project_id', $projectId)->delete();
             $project->delete();
         }
         Flash::success('The selected projects has been deleted successfully.');
     }
     return $this->listRefresh();
 }