Poll v2
|
|
@ -9,7 +9,7 @@
|
|||
<title xml:lang="ru">Опрос</title>
|
||||
<title xml:lang="zh-TW">投票調查</title>
|
||||
<title xml:lang="tr">Oylama</title>
|
||||
<description xml:lang="ko">설문조사 관리</description>
|
||||
<description xml:lang="ko">설문조사 관리를 위한 모듈입니다.</description>
|
||||
<description xml:lang="zh-CN">管理投票调查的模块。</description>
|
||||
<description xml:lang="jp">アンケート管理モジュール</description>
|
||||
<description xml:lang="en">This module is for managering polls.</description>
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
<description xml:lang="ru">Этот модуль служит для управления опросами.</description>
|
||||
<description xml:lang="zh-TW">管理投票調查的模組。</description>
|
||||
<description xml:lang="tr">Oylamaları düzenlemek için kullanılan modüldür.</description>
|
||||
<version>1.7</version>
|
||||
<date>2013-11-27</date>
|
||||
<version>2.0</version>
|
||||
<date>2015-06-09</date>
|
||||
<category>content</category>
|
||||
|
||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
||||
|
|
@ -33,4 +33,4 @@
|
|||
<name xml:lang="zh-TW">NAVER</name>
|
||||
<name xml:lang="tr">NAVER</name>
|
||||
</author>
|
||||
</module>
|
||||
</module>
|
||||
|
|
@ -9,7 +9,12 @@
|
|||
<action name="getPollGetColorsetList" type="model" />
|
||||
<action name="getPollAdminTarget" type="model" />
|
||||
|
||||
<action name="getPollstatus" type="model" />
|
||||
<action name="getPollinfo" type="model" />
|
||||
<action name="getPollitemInfo" type="model" />
|
||||
<action name="procPollInsert" type="controller" />
|
||||
<action name="procPollInsertItem" type="controller" />
|
||||
<action name="procPollDeleteItem" type="controller" />
|
||||
<action name="procPoll" type="controller" ruleset="poll" />
|
||||
<action name="procPollViewResult" type="controller" />
|
||||
<action name="procPollGetList" type="controller" />
|
||||
|
|
|
|||
|
|
@ -250,4 +250,37 @@
|
|||
<value xml:lang="jp"><![CDATA[選択したアンケート]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已選擇的投票]]></value>
|
||||
</item>
|
||||
<item name="poll_no_poll_srl">
|
||||
<value xml:lang="ko"><![CDATA[Poll srl 값이 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="poll_no_poll_or_deleted_poll">
|
||||
<value xml:lang="ko"><![CDATA[삭제되었거나 잘못된 투표입니다.]]></value>
|
||||
</item>
|
||||
<item name="poll_item_members">
|
||||
<value xml:lang="ko"><![CDATA[%s 항목을 투표한 사용자]]></value>
|
||||
</item>
|
||||
<item name="btn_poll_gotovote">
|
||||
<value xml:lang="ko"><![CDATA[투표 화면으로 가기]]></value>
|
||||
</item>
|
||||
<item name="btn_poll_gotoresult">
|
||||
<value xml:lang="ko"><![CDATA[결과 화면으로 가기]]></value>
|
||||
</item>
|
||||
<item name="msg_cannot_vote">
|
||||
<value xml:lang="ko"><![CDATA[투표할 수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_exceed_max_select">
|
||||
<value xml:lang="ko"><![CDATA[최대 투표 항목수를 초과했습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_cannot_add_item">
|
||||
<value xml:lang="ko"><![CDATA[항목을 추가할 수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_cannot_delete_item">
|
||||
<value xml:lang="ko"><![CDATA[항목을 삭제할 수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_item_title_cannot_empty">
|
||||
<value xml:lang="ko"><![CDATA[항목의 이름은 비어 있을수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_cannot_delete_item_poll_exist">
|
||||
<value xml:lang="ko"><![CDATA[항목 투표수가 0 이상이므로 삭제할 수 없습니다.]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class poll extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 2007.10.17 When deleting posts/comments delete the poll as well
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true;
|
||||
|
|
@ -46,6 +48,21 @@ class poll extends ModuleObject
|
|||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true;
|
||||
|
||||
if(!$oDB->isColumnExists('poll', 'poll_type'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('poll_log','poll_item'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('poll_item','add_user_srl'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -56,6 +73,8 @@ class poll extends ModuleObject
|
|||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 2007.10.17 When deleting posts/comments delete the poll as well
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
|
||||
|
|
@ -71,6 +90,21 @@ class poll extends ModuleObject
|
|||
if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'))
|
||||
$oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
|
||||
|
||||
if(!$oDB->isColumnExists('poll','poll_type'))
|
||||
{
|
||||
$oDB->addColumn('poll', 'poll_type', 'number', 11, 0);
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('poll_log','poll_item'))
|
||||
{
|
||||
$oDB->addColumn('poll_log', 'poll_item', 'varchar', 250, 0);
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('poll_item','add_user_srl'))
|
||||
{
|
||||
$oDB->addColumn('poll_item', 'add_user_srl', 'number', 11, 0);
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
|
|
@ -80,6 +114,16 @@ class poll extends ModuleObject
|
|||
function recompileCache()
|
||||
{
|
||||
}
|
||||
|
||||
function isCangetMemberInfo($type)
|
||||
{
|
||||
return ($type==1 || $type==3);
|
||||
}
|
||||
|
||||
function isCanAddItem($type)
|
||||
{
|
||||
return ($type==2 || $type==3);
|
||||
}
|
||||
}
|
||||
/* End of file poll.class.php */
|
||||
/* Location: ./modules/poll/poll.class.php */
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class pollController extends poll
|
|||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
$args = new stdClass;
|
||||
$tmp_args = array();
|
||||
|
||||
|
|
@ -114,7 +115,10 @@ class pollController extends poll
|
|||
$poll_args->list_order = $poll_srl*-1;
|
||||
$poll_args->stop_date = $args->stop_date;
|
||||
$poll_args->poll_count = 0;
|
||||
$poll_args->poll_type = $vars->show_vote + $vars->add_item;
|
||||
|
||||
$output = executeQuery('poll.insertPoll', $poll_args);
|
||||
debugPrint($output);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
|
|
@ -132,7 +136,7 @@ class pollController extends poll
|
|||
$title_args->poll_count = 0;
|
||||
$title_args->list_order = $title_args->poll_index_srl * -1;
|
||||
$title_args->member_srl = $member_srl;
|
||||
$title_args->upload_target_srl = $upload_target_srl;
|
||||
$title_args->upload_target_srl = $vars->upload_target_srl;
|
||||
$output = executeQuery('poll.insertPollTitle', $title_args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
@ -148,7 +152,7 @@ class pollController extends poll
|
|||
$item_args->poll_index_srl = $title_args->poll_index_srl;
|
||||
$item_args->title = $v;
|
||||
$item_args->poll_count = 0;
|
||||
$item_args->upload_target_srl = $upload_target_srl;
|
||||
$item_args->upload_target_srl = $vars->upload_target_srl;
|
||||
$output = executeQuery('poll.insertPollItem', $item_args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
@ -164,14 +168,125 @@ class pollController extends poll
|
|||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
function procPollInsertItem()
|
||||
{
|
||||
$poll_srl = (int) Context::get('srl');
|
||||
$poll_index_srl = (int) Context::get('index_srl');
|
||||
$poll_item_title = Context::get('title');
|
||||
|
||||
if($poll_item_title=='') return new Object(-1,"msg_item_title_cannot_empty");
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info) return new Object(-1,"msg_cannot_add_item");
|
||||
|
||||
if(!$poll_srl || !$poll_index_srl) return new Object(-1,"msg_invalid_request");
|
||||
|
||||
$args = new stdClass();
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// Get the information related to the survey
|
||||
$columnList = array('poll_type');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new Object(-1,"poll_no_poll_or_deleted_poll");
|
||||
$type = $output->data->poll_type;
|
||||
|
||||
if(!$this->isCanAddItem($type)) return new Object(-1,"msg_cannot_add_item");
|
||||
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
$poll_item_title = htmlspecialchars($poll_item_title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
}
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$item_args = new stdClass;
|
||||
$item_args->poll_srl = $poll_srl;
|
||||
$item_args->poll_index_srl = $poll_index_srl;
|
||||
$item_args->title = $poll_item_title;
|
||||
$item_args->poll_count = 0;
|
||||
$item_args->upload_target_srl = 0;
|
||||
$item_args->add_user_srl = $logged_info->member_srl;
|
||||
$output = executeQuery('poll.insertPollItem', $item_args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function procPollDeleteItem()
|
||||
{
|
||||
$poll_srl = (int) Context::get('srl');
|
||||
$poll_index_srl = (int) Context::get('index_srl');
|
||||
$poll_item_srl = Context::get('item_srl');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info) return new Object(-1,"msg_cannot_delete_item");
|
||||
|
||||
if(!$poll_srl || !$poll_index_srl || !$poll_item_srl) return new Object(-1,"msg_invalid_request");
|
||||
|
||||
$args = new stdClass();
|
||||
$args->poll_srl = $poll_srl;
|
||||
$args->poll_index_srl = $poll_index_srl;
|
||||
$args->poll_item_srl = $poll_item_srl;
|
||||
|
||||
// Get the information related to the survey
|
||||
$columnList = array('add_user_srl','poll_count');
|
||||
$output = executeQuery('poll.getPollItem', $args, $columnList);
|
||||
$add_user_srl = $output->data->add_user_srl;
|
||||
$poll_count = $output->data->poll_count;
|
||||
|
||||
// Get the information related to the survey
|
||||
$columnList = array('member_srl');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new Object(-1,"poll_no_poll_or_deleted_poll");
|
||||
$poll_member_srl = $output->data->member_srl;
|
||||
|
||||
if($add_user_srl!=$logged_info->member_srl && $poll_member_srl!=$logged_info->member_srl) return new Object(-1,"msg_cannot_delete_item");
|
||||
if($poll_count>0) return new Object(-1,"msg_cannot_delete_item_poll_exist");
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$item_args = new stdClass;
|
||||
$item_args->poll_srl = $poll_srl;
|
||||
$item_args->poll_index_srl = $poll_index_srl;
|
||||
$item_args->poll_item_srl = $poll_item_srl;
|
||||
$output = executeQuery('poll.deletePollItem', $item_args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Accept the poll
|
||||
*/
|
||||
function procPoll()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->poll_srl = $poll_srl;
|
||||
// Get the information related to the survey
|
||||
$columnList = array('poll_count', 'stop_date','poll_type');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new Object(-1,"poll_no_poll_or_deleted_poll");
|
||||
|
||||
if($output->data->stop_date < date("Ymd")) return new Object(-1,"msg_cannot_vote");
|
||||
|
||||
$columnList = array('checkcount');
|
||||
$output = executeQuery('poll.getPollTitle', $args, $columnList);
|
||||
if(!$output->data) return;
|
||||
|
||||
$poll_srl_indexes = Context::get('poll_srl_indexes');
|
||||
$tmp_item_srls = explode(',',$poll_srl_indexes);
|
||||
//if(count($tmp_item_srls)-1>(int)$output->data->checkcount) return new Object(-1,"msg_exceed_max_select");
|
||||
for($i=0;$i<count($tmp_item_srls);$i++)
|
||||
{
|
||||
$srl = (int)trim($tmp_item_srls[$i]);
|
||||
|
|
@ -206,9 +321,11 @@ class pollController extends poll
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Log the respondent's information
|
||||
$log_args = new stdClass;
|
||||
$log_args->poll_srl = $poll_srl;
|
||||
$log_args->poll_item = $args->poll_item_srl;
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
|
||||
|
|
@ -216,6 +333,7 @@ class pollController extends poll
|
|||
$log_args->member_srl = $member_srl;
|
||||
$log_args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
$output = executeQuery('poll.insertPollLog', $log_args);
|
||||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
|
|
@ -224,17 +342,18 @@ class pollController extends poll
|
|||
|
||||
$oDB->commit();
|
||||
|
||||
$skin = Context::get('skin');
|
||||
if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
|
||||
//$skin = Context::get('skin');
|
||||
//if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
|
||||
// Get tpl
|
||||
$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
|
||||
//$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
|
||||
|
||||
$this->add('poll_srl', $poll_srl);
|
||||
$this->add('tpl',$tpl);
|
||||
$this->add('poll_item_srl',$item_srls);
|
||||
//$this->add('tpl',$tpl);
|
||||
$this->setMessage('success_poll');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
//$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
|
||||
//$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,6 +14,164 @@ class pollModel extends poll
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief returns poll infomation
|
||||
*/
|
||||
function getPollinfo()
|
||||
{
|
||||
$args = new stdClass;
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!$poll_srl || $poll_srl=='') return new Object(-1,"poll_no_poll_srl");
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
// Get the information related to the survey
|
||||
$columnList = array('poll_count', 'stop_date','poll_type','member_srl');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
$poll_member_srl = $output->data->member_srl;
|
||||
if(!$output->data) return new Object(-1,"poll_no_poll_or_deleted_poll");
|
||||
|
||||
$poll = new stdClass;
|
||||
$poll->is_polled = 0;
|
||||
if($output->data->stop_date < date("Ymd")) $poll->is_polled = 1;
|
||||
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->poll_type = (int)$output->data->poll_type;
|
||||
$poll->stop_date = zdate($output->data->stop_date, "Y-m-d");
|
||||
$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
|
||||
$output = executeQueryArray('poll.getPollTitle', $args, $columnList);
|
||||
if(!$output->data) return;
|
||||
|
||||
$poll->poll = array();
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$poll->poll[$val->poll_index_srl] = new stdClass;
|
||||
$poll->poll[$val->poll_index_srl]->poll_index_srl = $val->poll_index_srl;
|
||||
$poll->poll[$val->poll_index_srl]->title = $val->title;
|
||||
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
|
||||
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
|
||||
}
|
||||
|
||||
$output = executeQueryArray('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
unset($val->upload_target_srl);
|
||||
unset($val->poll_srl);
|
||||
$val->my_item = false;
|
||||
if(($val->add_user_srl==$logged_info->member_srl || $poll_member_srl == $logged_info->member_srl) && $val->add_user_srl!=0) $val->my_item = true;
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
$caniadditem = $this->isCanAddItem($poll->poll_type) && !!$logged_info->member_srl;
|
||||
|
||||
$oPollModel = getModel('poll');
|
||||
if($oPollModel->isPolled($poll_srl)) $poll->is_polled = 1;
|
||||
|
||||
$this->add('poll', $poll);
|
||||
$this->add('caniadditem', $caniadditem);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief returns poll item infomation
|
||||
*/
|
||||
function getPollitemInfo()
|
||||
{
|
||||
$args = new stdClass;
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
$poll_item = Context::get('poll_item');
|
||||
|
||||
if(!$poll_srl || $poll_srl=='') return new Object(-1,"poll_no_poll_srl");
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
$args->poll_item_srl = $poll_item;
|
||||
|
||||
// Get the information related to the survey
|
||||
$columnList = array('poll_type');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new Object(-1,"poll_no_poll_or_deleted_poll");
|
||||
$type = $output->data->poll_type;
|
||||
|
||||
$poll = new stdClass();
|
||||
|
||||
if($this->isCangetMemberInfo($type))
|
||||
{
|
||||
$pollvar = new stdClass;
|
||||
$pollvar->poll_srl = $poll_srl;
|
||||
$pollvar->poll_item = $poll_item;
|
||||
$pollvar->poll_item_srl = $poll_item;
|
||||
$pollvar->page = !!Context::get('page') ? Context::get('page') : 1;
|
||||
$pollvar->list_count = !!Context::get('list_count') ? Context::get('list_count') : 5;
|
||||
|
||||
$output = executeQueryArray('poll.getMemberbyPollitem', $pollvar);
|
||||
$output_item = executeQuery('poll.getPollItem', $args);
|
||||
$poll->title = $output_item->data->title;
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
$poll->member = array();
|
||||
|
||||
$count = 0;
|
||||
|
||||
foreach($output->data as $key=>$value)
|
||||
{
|
||||
$count++;
|
||||
$vars = $oMemberModel->getMemberInfoByMemberSrl($value->member_srl);
|
||||
|
||||
if(!$value->member_srl)
|
||||
{
|
||||
if(Context::get('logged_info')->is_admin === "Y")
|
||||
{
|
||||
$ip = (int) str_replace(".","",$value->ip_address);
|
||||
$poll->member[$ip] = new stdClass();
|
||||
$poll->member[$ip]->member_srl = 0;
|
||||
$poll->member[$ip]->nick_name = $value->ip_address;
|
||||
$poll->member[$ip]->profile_image = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ip = md5(str_replace(".","",$value->ip_address));
|
||||
$poll->member[$ip] = new stdClass();
|
||||
$poll->member[$ip]->member_srl = 0;
|
||||
$poll->member[$ip]->nick_name = "Anonymous";
|
||||
$poll->member[$ip]->profile_image = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$poll->member[$vars->member_srl] = new stdClass();
|
||||
$poll->member[$vars->member_srl]->member_srl = $vars->member_srl;
|
||||
$poll->member[$vars->member_srl]->nick_name = $vars->nick_name;
|
||||
if($vars->profile_image->file!='') $poll->member[$vars->member_srl]->profile_image = $vars->profile_image->file;
|
||||
else $poll->member[$vars->member_srl]->profile_image = "";
|
||||
}
|
||||
}
|
||||
|
||||
$poll->count = $count;
|
||||
}
|
||||
|
||||
$this->add('item', $poll);
|
||||
$this->add("dummy_profile","data:image/gif;base64,R0lGODdhFgAWAPQAAMHBwcDAwPr6+t/f3/v7+9HR0fj4+MrKyvz8/PLy8uvr68/Pz+Li4ubm5vT09ODg4M3Nzdra2uzs7MjIyPDw8N3d3dTU1Pb29sLCwv39/cPDw8bGxv7+/sXFxf///8TExCwAAAAAFgAWAAAF2WDXbWRpnuT3iZ3qvjDMxqpGiyqGrbMGfL6dK+ViiTAHRiLROABaH6KxhVlcPByPx1D4RXFG4MbhyXDO28Nug4NhIlhOxpwdBDTQGKARP6MVGBo2KlN7HghZcR4KKzxTHQEVZXRYHgxPjywaBwZ9WAQLg5kqABYGfhwEERhsPI4jghMSfh4UBwGNbS6CAwJyc2YCA4GuLxgMWqhoHg2BMytvlVrTihUBbBs1BwLSyageAhDFGg9xc1nKWQy4UBoUfenAHgnG2+nKcQQQNh0aBYjLzCXLgKXAjhAAOw==");
|
||||
$this->add("page",$output->page_navigation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief returns poll status
|
||||
* @see this function uses isPolled function below
|
||||
*/
|
||||
function getPollstatus()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
if(!$poll_srl || $poll_srl=='') return new Object(-1,"poll_no_poll_srl");
|
||||
|
||||
$oPollModel = getModel('poll');
|
||||
if($oPollModel->isPolled($poll_srl)) $is_polled = 1;
|
||||
else $is_polled = 0;
|
||||
|
||||
$this->add('is_polled', $is_polled);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The function examines if the user has already been polled
|
||||
*/
|
||||
|
|
@ -39,6 +197,7 @@ class pollModel extends poll
|
|||
/**
|
||||
* @brief Return the HTML data of the survey
|
||||
* Return the result after checking if the poll has responses
|
||||
* @deprecated this function uses poll skin, which will be removed
|
||||
*/
|
||||
function getPollHtml($poll_srl, $style = '', $skin = 'default')
|
||||
{
|
||||
|
|
@ -97,6 +256,7 @@ class pollModel extends poll
|
|||
|
||||
/**
|
||||
* @brief Return the result's HTML
|
||||
* @deprecated this function uses poll skin, which will be removed
|
||||
*/
|
||||
function getPollResultHtml($poll_srl, $skin = 'default')
|
||||
{
|
||||
|
|
@ -107,7 +267,7 @@ class pollModel extends poll
|
|||
if(!$output->data) return '';
|
||||
|
||||
$poll = new stdClass;
|
||||
$poll->style = $style;
|
||||
$poll->style = $skin;
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
|
||||
|
|
@ -144,6 +304,7 @@ class pollModel extends poll
|
|||
}
|
||||
/** [TO REVIEW]
|
||||
* @brief Selected poll - return the colorset of the skin
|
||||
* @deprecated this function uses poll skin, which will be removed
|
||||
*/
|
||||
function getPollGetColorsetList()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" filter="number" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" filter="number" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="poll_item_srl" var="poll_item_srl" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
19
modules/poll/queries/getMemberbyPollitem.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<query id="getMemberbyPollitem" action="select">
|
||||
<tables>
|
||||
<table name="poll_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="member_srl" alias="member_srl" />
|
||||
<column name="ipaddress" alias="ip_address" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" />
|
||||
<condition operation="like" column="poll_item" var="poll_item" pipe="and"/>
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="regdate" order="desc" />
|
||||
<list_count var="list_count" default="5" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" pipe="and" />
|
||||
<condition operation="equal" column="poll_item_srl" var="poll_item_srl" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="poll_item_srl" order="asc" />
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<column name="member_srl" var="member_srl" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="poll_count" var="poll_count" default="0" />
|
||||
<column name="poll_type" var="poll_type" default="0" />
|
||||
<column name="upload_target_srl" default="0" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="list_order" var="list_order" default="0" />
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<column name="poll_index_srl" var="poll_index_srl" filter="number" notnull="notnull" />
|
||||
<column name="poll_count" var="poll_count" default="0" />
|
||||
<column name="upload_target_srl" default="0" />
|
||||
<column name="add_user_srl" filter="number" default="0" />
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -7,5 +7,6 @@
|
|||
<column name="member_srl" var="member_srl" filter="number" default="0" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="poll_item" var="poll_item" default="0" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@
|
|||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
<column name="poll_type" type="number" size="11" notnull="notnull" index="idx_poll_type" />
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
<column name="upload_target_srl" type="number" size="11" notnull="notnull" index="idx_upload_target_srl" />
|
||||
<column name="title" type="varchar" size="250" notnull="notnull" />
|
||||
<column name="poll_count" type="number" size="11" notnull="notnull" />
|
||||
<column name="add_user_srl" type="number" size="11" notnull="notnull" />
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@
|
|||
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
<column name="poll_item" type="varchar" size="250" default="0" />
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@
|
|||
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" default="0" index="idx_list_order" />
|
||||
</table>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 91 B After Width: | Height: | Size: 159 B |
|
Before Width: | Height: | Size: 107 B After Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 88 B After Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 211 B |
|
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 93 B After Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 523 B |
1
modules/poll/tpl/js/poll.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"poll.min.js","sources":["poll.js"],"names":["doPoll","fo_obj","checkcount","Array","item","i","length","obj","nodeName","name","indexOf","t","split","poll_srl_index","parseInt","value","checked","poll_srl_indexes","hasOwnProperty","count","items","alert","poll_alert_lang","join","submit","jQuery","$","click","on_complete","ret","width","$poll","srl","html","skin","cls","this","attr","match","e","exec_xml","poll_srl"],"mappings":"AACA,QAASA,QAAOC,GAKZ,IAAI,GAHAC,GAAa,GAAIC,OACjBC,EAAO,GAAID,OAEPE,EAAE,EAAEA,EAAEJ,EAAOK,OAAOD,IAAK,CAC7B,GAAIE,GAAMN,EAAOI,EACjB,IAAmB,SAAhBE,EAAIC,SAAP,CAEA,GAAIC,GAAOF,EAAIE,IACf,IAAGA,EAAKC,QAAQ,cAAc,GAAI,CAC9B,GAAIC,GAAIF,EAAKG,MAAM,KACfC,EAAiBC,SAASH,EAAE,GAAG,GACnCT,GAAWW,GAAkBN,EAAIQ,MACjCX,EAAKS,GAAkB,GAAIV,WAExB,IAAGM,EAAKC,QAAQ,SAAS,GAAI,CAChC,GAAIC,GAAIF,EAAKG,MAAM,KAEfC,GADWC,SAASH,EAAE,GAAG,IACRG,SAASH,EAAE,GAAG,IACjB,IAAfJ,EAAIS,UAAiBZ,EAAKS,GAAgBT,EAAKS,GAAgBP,QAAUC,EAAIQ,SAIxF,GAAIE,GAAmB,EACvB,KAAI,GAAIJ,KAAkBX,GAC7B,GAAIA,EAAWgB,eAAeL,GAA9B,CACO,GAAIM,GAAQjB,EAAWW,GACnBO,EAAQhB,EAAKS,EACjB,IAAGO,EAAMd,OAAS,GAAKa,EAAQC,EAAMd,OAEjC,MADAe,OAAMC,kBACC,CAGXL,IAAoBG,EAAMG,KAAK,KAAK,IAExCtB,EAAOgB,iBAAiBF,MAAQE,EAEnChB,EAAOuB,SAGRC,OAAO,SAASC,GAEfA,EAAE,iBAAiBC,MAAM,WAWxB,QAASC,GAAYC,GACpB,GAA6BC,GAAzBC,EAAQL,EAAE,SAASM,EAEvBF,GAASC,EAAMD,QACfC,EAAME,KAAKJ,EAAS,KACpBE,EAAMD,MAAMA,GAfb,GAAiCE,GAAKE,EAAlCC,EAAMT,EAAEU,MAAMC,KAAK,QAEvB,KACCL,EAAOG,EAAIG,MAAM,kBAAkB,GACnCJ,EAAOC,EAAIG,MAAM,mBAAmB,GACpC,MAAMC,IAEP,MAAIP,IACAE,IAAMA,EAAO,WAUjBM,SACC,OACA,sBACCC,SAAST,EAAKE,KAAKA,GACpBN,GACC,QAAQ,UAAU,SAGb,IAnBS"}
|
||||
1
modules/poll/tpl/js/poll_admin.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"poll_admin.min.js","sources":["poll_admin.js"],"names":["doDisplaySkinColorset","sel","colorset","skin","options","selectedIndex","value","params","Array","response_tags","exec_xml","completeGetSkinColorset","ret_obj","get_by_id","poll_colorset","length","selected_colorset","i","remove","colorset_list","split","selected_index","tmp","opt","Option","add","doMovePoll","poll_srl","upload_target_srl","completeMovePoll","document_srl","comment_srl","url","request_uri","setQuery","winopen","checkSearch","form","search_target","alert","xe","lang","msg_empty_search_target","search_keyword","msg_empty_search_keyword","jQuery","$","submit","e","cnt","stopPropagation","msg_select_poll","msg","confirm_poll_delete","replace","confirm"],"mappings":"AAOA,QAASA,uBAAsBC,EAAKC,GAChC,GAAIC,GAAOF,EAAIG,QAAQH,EAAII,eAAeC,MAEtCC,EAAS,GAAIC,MACjBD,GAAa,KAAIJ,EACjBI,EAAiB,SAAIL,CAErB,IAAIO,GAAgB,GAAID,OAAM,QAAQ,UAAU,gBAEhDE,UAAS,OAAQ,yBAA0BH,EAAQI,wBAAyBF,EAAeF,GAI/F,QAASI,yBAAwBC,EAASH,EAAeF,GAIrD,IAAI,GAHAN,GAAMY,UAAU,WAAWC,cAC3BC,EAASd,EAAIG,QAAQW,OACrBC,EAAoBT,EAAiB,SACjCU,EAAE,EAAIF,EAAFE,EAASA,IAAKhB,EAAIiB,OAAO,EAIrC,KAAI,GAFAC,GAAgBP,EAAuB,cAAEQ,MAAM,MAC/CC,EAAiB,EACbJ,EAAE,EAAEA,EAAEE,EAAcJ,OAAOE,IAAK,CACpC,GAAIK,GAAMH,EAAcF,GAAGG,MAAM,MAC9BJ,IAAqBA,GAAmBM,EAAI,KAAID,EAAiBJ,EACpE,IAAIM,GAAM,GAAIC,QAAOF,EAAI,GAAIA,EAAI,IAAI,GAAO,EAC5CrB,GAAIG,QAAQqB,IAAIF,GAGpBtB,EAAII,cAAgBgB,EAIxB,QAASK,YAAWC,EAAUC,GAE1B,GAAIrB,GAAS,GAAIC,MACjBD,GAAiB,SAAIoB,EACrBpB,EAA0B,kBAAIqB,CAE9B,IAAInB,GAAgB,GAAID,OAAM,QAAQ,UAAU,eAAe,cAC/DE,UAAS,OAAO,qBAAsBH,EAAQsB,iBAAkBpB,GAGpE,QAASoB,kBAAiBjB,GACtB,GAAIkB,GAAelB,EAAsB,aACrCmB,EAAcnB,EAAqB,YACnCoB,EAAMC,YAAYC,SAAS,eAAgBJ,EAC5CC,KAAaC,EAAMA,EAAI,YAAYD,GACtCI,QAAQH,EAAK,cAGjB,QAASI,aAAYC,GAEpB,MAA+B,IAA5BA,EAAKC,cAAchC,OAErBiC,MAAMC,GAAGC,KAAKC,0BACP,GAEwB,IAA7BL,EAAKM,eAAerC,OAEtBiC,MAAMC,GAAGC,KAAKG,2BACP,GAHR,OAODC,OAAO,SAAUC,GAChBA,EAAE,aAAaC,OAAO,SAASC,GAC9B,GAAIC,GAAMH,EAAE,4BAA4B/B,MACxC,IAAU,GAAPkC,EAIF,MAFAD,GAAEE,kBACFX,MAAMC,GAAGC,KAAKU,kBACP,CAGR,IAAIC,GAAMZ,GAAGC,KAAKY,oBAAoBC,QAAQ,KAAML,EACpD,OAAIM,SAAQH,GAAZ,QAECJ,EAAEE,mBACK"}
|
||||