mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
issue 1971 deleted a poll when deleted a poll title.
git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@11175 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
48cb160b99
commit
9db28e2db4
2 changed files with 47 additions and 1 deletions
|
|
@ -80,12 +80,19 @@
|
|||
/**
|
||||
* @brief Delete the poll (when several questions are registered in one poll, delete this question)
|
||||
**/
|
||||
function deletePollTitle($poll_index_srl) {
|
||||
function deletePollTitle($poll_index_srl)
|
||||
{
|
||||
$args->poll_index_srl = $poll_index_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = executeQueryArray('poll.getPollByDeletePollTitle', $args);
|
||||
if($output->toBool() && $output->data && $output->data[0]->count == 1)
|
||||
{
|
||||
$dargs->poll_srl = $output->data[0]->poll_srl;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
|
|
@ -98,6 +105,20 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
if($dargs->poll_srl)
|
||||
{
|
||||
$output = executeQuery('poll.deletePoll', $dargs);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.deletePollLog', $dargs);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
|
|
|
|||
25
modules/poll/queries/getPollByDeletePollTitle.xml
Normal file
25
modules/poll/queries/getPollByDeletePollTitle.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<query id="getPollByDeletePollTitle" action="select">
|
||||
<tables>
|
||||
<table name="poll_title" alias="PT"/>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_srl" />
|
||||
<column name="count(poll_index_srl)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<query operation="equal" column="PT.poll_srl" notnull="notnull" alias="getPollSrl">
|
||||
<tables>
|
||||
<table name="poll_title" alias="SPT"/>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_srl" alias="poll_srl" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="SPT.poll_index_srl" var="poll_index_srl" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="poll_srl" />
|
||||
</groups>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue