phpcms栏目文章添加取消审核+通过审核
phpcms栏目文章添加取消审核+通过审核,和工作流的审核不一样有所区别。在使用PHPCMS的时候发现文章列表没有取消审核通过的状态,在使用中可能碰到需要某篇文章给取消显示,就是所谓的“删除”,但是过几天或一个月又想恢复这个在phpcms发现没有这个小功能。所以自己在使用中增加了这个小小的“取消通过”的功能,废话不多说,直接上流程:
phpcms栏目文章添加取消审核+通过审核,和工作流的审核不一样有所区别
一、修改文件: /phpcms/modules/content/templates/content_list.tpl.php
把 |
替换成(大概17行) |不通过列表|
在
下方新增
在
function confirm_delete(){
if(confirm(' L('selected')));?>')) $('#myform').submit();
}
下方新增
//弹窗
function confirm_changeStatus(){
if(confirm('确定要取消通过吗?')) $('#myform').submit();
}
二、修改文件:/phpcms/modules/content/content.php
在
if(isset($_GET['reject'])) $status = 0;
下方新增(大概66左右)
if(isset($_GET['change_status']) && intval($_GET['change_status'])==1 ) $status = 0; //xj 190326 普通栏目取消审核列表
新增方法:
/**
* dcr 190326 批量取消通过文章
*/
public function change_status() {
if(isset($_GET['dosubmit'])) {
$catid = intval($_GET['catid']);
$status = 0; //文章状态不通过
if(!$catid) showmessage(L('missing_part_parameters'));
$modelid = $this->categorys[$catid]['modelid'];
$this->db->set_model($modelid);
if(empty($_POST['ids'])) showmessage(L('you_do_not_check'));
$idStr = implode(',', array_keys(array_flip($_POST['ids'])) ); //转换成字符串
$this->db->update(array('status'=>$status),"id IN ($idStr)");
showmessage(L('operation_success'));
} else {
showmessage(L('operation_failure'));
}
}
/**
* dcr 190326 普通过审内容
*/
public function pass_change() {
$catid = intval($_GET['catid']);
if(!$catid) showmessage(L('missing_part_parameters'));
if(empty($_POST['ids'])) showmessage(L('you_do_not_check'));
$category = $this->categorys[$catid];
$setting = string2array($category['setting']);
$modelid = $this->categorys[$catid]['modelid'];
$this->db->set_model($modelid);
$html = pc_base::load_app_class('html', 'content');
$this->url = pc_base::load_app_class('url', 'content');
if (isset($_POST['ids']) && !empty($_POST['ids'])) {
if(empty($_POST['ids'])) showmessage(L('you_do_not_check'));
$idStr = implode(',', array_keys(array_flip($_POST['ids'])) ); //转换成字符串
$this->db->update(array('status'=>99),"id IN ($idStr)");
showmessage(L('operation_success'));
}else{
showmessage('Hei HeiKe',HTTP_REFERER);
}
}
Dcr163的博客
http://dcr163.cn/397.html(转载时请注明本文出处及文章链接)
