コード例 #1
0
ファイル: projectsection.php プロジェクト: ajb/rfpez
 public function fork($from_project_id, $new_input)
 {
     $section = new ProjectSection(array('section_category' => $this->category, 'title' => $this->title, 'body' => $this->body, 'based_on_project_section_id' => $this->id, 'created_by_project_id' => $from_project_id));
     $section->fill($new_input);
     $section->save();
     $section->project_types()->sync($this->project_types()->lists('id'));
     return $section;
 }
コード例 #2
0
ファイル: factory.php プロジェクト: ajb/rfpez
 public static function section()
 {
     $faker = Faker\Factory::create();
     $s = new ProjectSection(array('section_category' => 'Requirements', 'title' => implode(" ", $faker->words), 'body' => $faker->paragraph, 'public' => rand(0, 8) == 0 ? false : true, 'times_used' => rand(0, 20)));
     $s->save();
     $s->project_types()->sync(ProjectType::lists('id'));
 }
コード例 #3
0
ファイル: projects.php プロジェクト: ajb/rfpez
 public function action_repost_on_fbo_post()
 {
     $project = Config::get('project');
     if (!Auth::officer()->is_role_or_higher(Officer::ROLE_CONTRACTING_OFFICER)) {
         // @todo add instructions for contacting admin to get verified
         Helper::flash_errors('Sorry, you haven\'t been verified as a contracting officer on RFP-EZ yet. Please <a href="mailto:rfpez@gsa.gov">email us</a> to complete verification.');
         return Redirect::to_route('project_repost_on_fbo', array($project->id));
     }
     // send update emails to all bidders
     $project->send_amendment_emails();
     // record amendment text as a section of the post (under the header "Amendments")
     $section_input = Input::get('amendment_description');
     $section = new ProjectSection($section_input);
     $section->body = htmLawed($section->body, array('safe' => true));
     $section->created_by_project_id = $project->id;
     $section->save();
     // do we want this too? unclear
     $section->project_types()->attach($project->project_type_id);
     $project->add_section($section->id);
     // turn off "amending" state toggle
     $project->end_amending();
     // update post date
     $project->posted_to_fbo_at = new \DateTime();
     // ... or add a new column "last_amended_at"?
     $project->save();
     return Redirect::to_route('project', array($project->id));
 }