Files
OMS/app/desktop/lib/finder/builder/dorecycle.php
2025-12-28 23:13:25 +08:00

44 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class desktop_finder_builder_dorecycle extends desktop_finder_builder_prototype{
function main(){
$this->controller->begin();
$o = $this->app->model($this->object->table_name());
$o->filter_use_like = true;
$this->dbschema = $this->object->get_schema();
$pkey = $this->dbschema['idColumn'];
$pkey_value = $_POST[$pkey];
$filter = array($pkey=>$pkey_value);
if( $_POST['isSelectedAll']=='_ALL_') //edit by 矫雷 (点此选择全部) 分开写的应该统一函数处理
$filter = null;
if($_GET['view']){
$views = $this->get_views();
$filter = array_merge((array)$views[$_GET['view']]['filter'],(array)$filter);
}
$recycle = kernel::single('desktop_system_recycle');
$result = $recycle->dorecycle(get_class($this->object),$filter);
if($result){
$this->controller->end(true,app::get('desktop')->_('删除成功'),'javascript:finderGroup["'.$_GET['finder_id'].'"].unselectAll();finderGroup["'.$_GET['finder_id'].'"].refresh();');
}else{
$this->controller->end(false,$o->recycle_msg?$o->recycle_msg:app::get('desktop')->_('删除失败!'));
}
}
}