Skip to content

Commit

Permalink
Merge pull request #185 from dbarzin/dev
Browse files Browse the repository at this point in the history
fix invalid accept
  • Loading branch information
dbarzin authored Oct 15, 2024
2 parents 87c0316 + da71ab5 commit f6d93be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/ControlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1555,14 +1555,19 @@ public function accept()

// create a new control
$new_control = $control->replicate();
$new_control->status = 0;
$new_control->observations = null;
$new_control->realisation_date = null;
$new_control->note = null;
$new_control->score = null;
$new_control->plan_date = request('next_date');

// Save new control
$new_control->save();

// Clone measures
$new_control->measures()->sync($control->measures->pluck('id')->toArray());

// Set owners
$new_control->owners()->sync($control->owners->pluck('id')->toArray());

Expand Down
6 changes: 1 addition & 5 deletions database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
$lang = env('LANG', 1);
if ($lang===null)
$lang="en";

DB::table('users')->insert([
'login' => 'admin',
'name' => 'Administrator',
'title' => 'Pirate Captain',
'role' => 1,
'language' => $lang,
'language' => 'en',
'email' => 'admin@admin.localhost',
'password' => bcrypt('admin'),
]);
Expand Down

0 comments on commit f6d93be

Please sign in to comment.