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:
parent
34705f444f
commit
7411c6ea95
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user