mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-29 09:30:06 +01:00
Fix per api cleanup checklist
This commit is contained in:
parent
c1f86dace3
commit
edda7c38e2
@ -64,6 +64,7 @@ if ($main_check) {
|
||||
|
||||
$.post('<?php echo $rootdir; ?>/modules/checklists/ajax.php', {
|
||||
op: "edit_check",
|
||||
id_module: globals.id_module,
|
||||
id_record: "<?php echo $id_record; ?>",
|
||||
content: input('content_edit').get(),
|
||||
is_titolo: input('is_titolo').get(),
|
||||
|
@ -211,6 +211,8 @@ function delete_check(id){
|
||||
op: "delete_check",
|
||||
id: id,
|
||||
main_check: 1,
|
||||
id_module: globals.id_module,
|
||||
id_record: id,
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
|
@ -162,6 +162,8 @@ function delete_check(id){
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "delete_check",
|
||||
id: id,
|
||||
id_module: globals.id_module,
|
||||
id_record: id,
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
|
@ -90,7 +90,22 @@ class Checklists extends AppResource
|
||||
$da_interventi = array_column($records, 'id');
|
||||
}
|
||||
|
||||
$mancanti = $this->getMissingIDs('zz_checks', 'id', $last_sync_at);
|
||||
$rs_mancanti = database()
|
||||
->table('zz_operations')
|
||||
->select('zz_operations.id_record')
|
||||
->distinct()
|
||||
->join('zz_modules', 'zz_modules.id', '=', 'zz_operations.id_module')
|
||||
->leftJoin('zz_modules_lang', function ($join) {
|
||||
$join->on('zz_modules.id', '=', 'zz_modules_lang.id_record')
|
||||
->where('zz_modules_lang.id_lang', '=', \Models\Locale::getDefault()->id);
|
||||
})
|
||||
->where('zz_modules_lang.name', '=', 'Interventi')
|
||||
->where('zz_operations.op', '=', 'delete_check')
|
||||
->where('zz_operations.created_at', '>', $last_sync_at)
|
||||
->pluck('id_record')
|
||||
->toArray();
|
||||
|
||||
$mancanti = array_column($rs_mancanti, 'id_record');
|
||||
|
||||
$results = array_unique(array_merge($da_interventi, $mancanti));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user