1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-25 23:33:02 +01:00

Fix ordinamento checklist

This commit is contained in:
MatteoPistorello 2023-03-08 16:46:57 +01:00
parent 34705f444f
commit 7411c6ea95
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ class Check extends Model
*
* @return self
*/
public static function build(User $user, $structure, $id_record, $content, $parent_id = null)
public static function build(User $user, $structure, $id_record, $content, $parent_id = null, $order = 99)
{
$model = new static();
@ -63,7 +63,7 @@ class Check extends Model
$model->content = $content;
// Ordinamento temporaneo alla creazione
$model->order = 99;
$model->order = $order;
$model->save();

View File

@ -64,7 +64,7 @@ class Checklist extends Model
$child = $checks->shift();
$id_parent = $child->id_parent ? $relations[$child->id_parent] : null;
$check = Check::build($user, $structure, $id_record, $child->content, $id_parent);
$check = Check::build($user, $structure, $id_record, $child->content, $id_parent, $child->order);
$check->setAccess($users, $group_id);
$relations[$child->id] = $check->id;