커스텀 알림의 타입리스트를 확인하고 해당 알림을 삭제할 수 있도록 개선

This commit is contained in:
BJRambo 2017-05-02 02:50:32 +09:00
parent de7213bb22
commit f702b6c7d6
9 changed files with 138 additions and 0 deletions

View file

@ -18,11 +18,13 @@
<action name="dispNcenterliteAdminSkinsetting" type="view" menu_name="ncenterlite" />
<action name="dispNcenterliteAdminTest" type="view" menu_name="ncenterlite" />
<action name="dispNcenterliteAdminList" type="view" menu_name="ncenterlite" />
<action name="dispNcenterliteAdminCustomList" type="view" menu_name="ncenterlite" />
<action name="procNcenterliteAdminInsertConfig" type="controller" ruleset="insertConfig" />
<action name="procNcenterliteAdminInsertDummyData" type="controller" />
<action name="procNcenterliteAdminInsertPushData" type="controller" />
<action name="procNcenterliteAdminDeleteNofity" type="controller" />
<action name="procNcenterliteAdminDeleteCustom" type="controller" />
</actions>
<menus>
<menu name="ncenterlite" type="all">

View file

@ -134,3 +134,9 @@ $lang->cmd_web_notify = '웹 알림';
$lang->cmd_mail_notify = '메일 알림';
$lang->cmd_sms_notify = '문자 알림';
$lang->cmd_push_notify = '푸시 알림';
$lang->ncenterlite_type_id = '알림 타입 아이디';
$lang->ncenterlite_type_objects = '알림 타입 변수값';
$lang->ncenterlite_type_content = '알림 타입 내용';
$lang->ncenterlite_notify_type = '알림 타입 리스트';
$lang->msg_do_not_notify_type = '생성한 알림타입이 존재하지 않습니다.';
$lang->ncenterlite_custom_list = '커스텀 리스트';

View file

@ -172,4 +172,32 @@ class ncenterliteAdminController extends ncenterlite
return;
}
}
/**
* @brief 알림센터에 생성된 커스텀 알림을 삭제하는 기능.
*/
function procNcenterliteAdminDeleteCustom()
{
$obj = Context::getRequestVars();
$args = new stdClass();
$args->notify_type_srl = $obj->notify_type_srl;
$output = executeQuery('ncenterlite.deleteNotifyType', $args);
if(!$output->toBool())
{
return $output;
}
$this->setMessage("success_deleted");
if(Context::get('success_return_url'))
{
$this->setRedirectUrl(Context::get('success_return_url'));
}
else
{
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNcenterliteAdminCustomList'));
}
}
}

View file

@ -31,4 +31,15 @@ class ncenterliteAdminModel extends ncenterlite
$output->data = $list;
return $output;
}
/**
* Get notify type list.
* @return object
*/
function getNotifyType()
{
$output = executeQueryArray('ncenterlite.getNotifyTypeAdminList');
return $output;
}
}

View file

@ -111,4 +111,16 @@ class ncenterliteAdminView extends ncenterlite
{
}
function dispNcenterliteAdminCustomList()
{
$oNcenterliteAdminModel = getAdminModel('ncenterlite');
$output = $oNcenterliteAdminModel->getNotifyType();
Context::set('total_count', $output->page_navigation->total_count);
Context::set('total_page', $output->page_navigation->total_page);
Context::set('page', $output->page);
Context::set('type_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
}
}

View file

@ -0,0 +1,8 @@
<query id="deleteNotifyType" action="delete">
<tables>
<table name="ncenterlite_notify_type" />
</tables>
<conditions>
<condition operation="equal" column="notify_type_srl" var="notify_type_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,15 @@
<query id="getNotifyTypeAdminList" action="select">
<tables>
<table name="ncenterlite_notify_type" />
</tables>
<columns>
<column name="*" />
</columns>
<navigation>
<index default="notify_type_srl" var="list_order" order="desc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -0,0 +1,55 @@
<load target="css/ncenter_admin.css" />
<include target="header.html" />
<section class="section">
<h1>{$lang->ncenterlite_notify_type}</h1>
<p class="x_well x_well-small" cond="!$type_list">{$lang->msg_do_not_notify_type}</p>
<block cond="$type_list">
<table class="x_table x_table-striped x_table-hover" style="margin-top:20px;">
<thead>
<tr>
<th scope="col" class="nowr" style="width:100px;">{$lang->no}</th>
<th scope="col" >{$lang->ncenterlite_type_id}</th>
<th scope="col" >{$lang->ncenterlite_type_objects}</th>
<th scope="col" style="width:500px;">{$lang->ncenterlite_type_content}</th>
<th scope="col" style="">삭제하기</th>
</tr>
</thead>
<tbody>
<!--@foreach($type_list as $no => $val)-->
<tr>
<td>{$val->notify_type_srl}</td>
<td>{$val->notify_type_id}</td>
<td>{$val->notify_type_args}</td>
<td>{$val->notify_string}</td>
<td>
<form class="x_inline" action="{Context::getRequestUri()}" method="post">
<input type="hidden" name="module" value="ncenterlite" />
<input type="hidden" name="act" value="procNcenterliteAdminDeleteCustom" />
<input type="hidden" name="notify_type_srl" value="{$val->notify_type_srl}" />
<input type="hidden" name="xe_validator_id" value="modules/ncenterlite/tpl/customlist/1" />
<button class="x_btn X_Btn-mini" type="submit">삭제하기</button>
</form>
</td>
</tr>
<!--@endforeach-->
</tbody>
</table>
<div class="x_pagination">
<ul>
<li><a href="{getUrl('page','')}" class="prevEnd">{$lang->first_page}</a></li>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<li class="x_active"><a href="{getUrl('page',$page_no)}">{$page_no}</a></li>
<!--@else-->
<li><a href="{getUrl('page',$page_no)}">{$page_no}</a></li>
<!--@endif-->
<!--@end-->
<li><a href="{getUrl('page',$page_navigation->last_page)}" class="nextEnd">{$lang->last_page}</a></li>
</ul>
</div>
</block>
</section>

View file

@ -10,6 +10,7 @@
<li class="x_active"|cond="$act=='dispNcenterliteAdminSkinsetting'"><a href="{getUrl('act','dispNcenterliteAdminSkinsetting')}">{$lang->ncenterlite_skin_settings}</a></li>
<li class="x_active"|cond="$act=='dispNcenterliteAdminTest'"><a href="{getUrl('act','dispNcenterliteAdminTest')}">{$lang->ncenterlite_test}</a></li>
<li class="x_active"|cond="$act=='dispNcenterliteAdminList'"><a href="{getUrl('act','dispNcenterliteAdminList')}">{$lang->ncenterlite_notice_list}</a></li>
<li class="x_active"|cond="$act=='dispNcenterliteAdminCustomList'"><a href="{getUrl('act','dispNcenterliteAdminCustomList')}">{$lang->ncenterlite_custom_list}</a></li>
</ul>
</div>