1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 00:06:14 +01:00

Fix creazione categorie in gestione documentale

This commit is contained in:
Luca 2019-12-19 13:37:10 +01:00
parent 7e1e27bec7
commit c63c94c137

View File

@ -19,7 +19,13 @@ class Categoria extends Model
$model->save();
$gruppi = database()->fetchArray('SELECT `id` FROM `zz_groups`');
$model->syncPermessi($gruppi);
foreach($gruppi as $array) {
foreach($array as $k=>$v) {
$newArray[$k] = $v;
}
}
$model->syncPermessi($newArray);
return $model;
}
@ -27,7 +33,7 @@ class Categoria extends Model
public function syncPermessi(array $groups)
{
$groups[] = 1;
$database = database();
$database->sync('do_permessi', ['id_categoria' => $this->id], [
'id_gruppo' => $groups,