mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-04-02 04:20:23 +02: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', {
|
$.post('<?php echo $rootdir; ?>/modules/checklists/ajax.php', {
|
||||||
op: "edit_check",
|
op: "edit_check",
|
||||||
|
id_module: globals.id_module,
|
||||||
id_record: "<?php echo $id_record; ?>",
|
id_record: "<?php echo $id_record; ?>",
|
||||||
content: input('content_edit').get(),
|
content: input('content_edit').get(),
|
||||||
is_titolo: input('is_titolo').get(),
|
is_titolo: input('is_titolo').get(),
|
||||||
|
@ -211,6 +211,8 @@ function delete_check(id){
|
|||||||
op: "delete_check",
|
op: "delete_check",
|
||||||
id: id,
|
id: id,
|
||||||
main_check: 1,
|
main_check: 1,
|
||||||
|
id_module: globals.id_module,
|
||||||
|
id_record: id,
|
||||||
}, function(){
|
}, function(){
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
|
@ -162,6 +162,8 @@ function delete_check(id){
|
|||||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||||
op: "delete_check",
|
op: "delete_check",
|
||||||
id: id,
|
id: id,
|
||||||
|
id_module: globals.id_module,
|
||||||
|
id_record: id,
|
||||||
}, function(){
|
}, function(){
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
|
@ -90,7 +90,22 @@ class Checklists extends AppResource
|
|||||||
$da_interventi = array_column($records, 'id');
|
$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));
|
$results = array_unique(array_merge($da_interventi, $mancanti));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user