묻고답하기
채용 모듈에서 getApplicationBySrl은 어떻게 사용해야 하는지요?
2014.01.29 00:37
채용 모듈을 튜닝하고 있는데요,
applicant_list.html 스킨 파일은 아래에서
<a href="{getUrl('act','disPaperOpinion','comment_srl',$applicant->comment_srl)}" class="btn_apply"><span>자세히</span></a> </span>로 수정하였습니다. 회원별로만 지원서류를 볼 수 있는 것에서 벗어나서 한 회원이 여러번 지원할 수 있도록 하려고 하는 의도인데요,
<!--@foreach($applicant_list as $key => $applicant)-->
<tr class="bg{$i} applicationRow">
<td class="checkbox" cond="$logged_info->is_admin == 'Y'"><input class="cartCheckBox" type="checkbox" name="cart" value="{$applicant->comment_srl}"/></td>
<td class="author">{$applicant->applicant_name}</td>
<td><a href="mailto:{$applicant->email_address}" class="email_link">{$applicant->email_address}</td>
<td>{$applicant->total}</td>
<td>{zdate($applicant->last_update, 'Y-m-d', false)}</td>
<td>{$applicant->result} </td>
<td style="text-align:right">
<span class="btn">
<!-- <a href="{getUrl('act','disPaperApply','document_srl',$oDocument->document_srl)}" class="btn_apply"><span>자세히</span></a> </span> -->
<a href="{getUrl('act','disPaperOpinion','comment_srl',$applicant->comment_srl)}" class="btn_apply"><span>자세히</span></a> </span>
<!-- $url = sprintf("%s#comment_%s",getUrl('','document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl')); -->
<span class="deleteComment btn"><a href="" onclick="showDeleteApplicant('{$applicant->comment_srl}','delete_applicant', false); return false;">{$lang->cmd_delete}</a></span>
</td>
</tr>
{@$i = ($i+1)%2 ? 1:2;}
!--@end--
recruit.view.php에는 다음과 같은 함수를 추가햇습니다.
function disPaperOpinion()
{
//get job infomation
$oPaperModel = &getModel('paper');
$comment_srl = Context::get('comment_srl');
if(!$comment_srl || !$this->grantInfo->write_comment) {
return $this->dispMessage('msg_not_permitted');
}
// $oCommentModel = &getModel('comment');
// $oComment = $oCommentModel->getComment($comment_srl);
// Context::set('oComment', $oComment);
$logged_info = Context::get('logged_info');
if($logged_info){
$application_info = $oPaperModel->getApplicationBySrl($comment_srl);
Context::set('application_info', $application_info);
}
$oFileModel = &getModel('file');
$file_config = $oFileModel->getFileModuleConfig($this->module_info->module_srl);
if($file_config) Context::set('file_config', $file_config);
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
$this->setTemplateFile('application_form');
}
comment_srl 값을 받아서, getApplicatrionBySrl을 실행시키려고 하는데요,
어디에서 잘못된건지 모르겠습니다.
참고로 recruit.model.php는 다음과 같습니다.
/**
* get application info by srl
*/
function getApplicationBySrl($comment_srl)
{
if(!$comment_srl) return new Object(-1, "msg_invalid_request");
$args->comment_srl = $comment_srl;
$output = executeQuery("paper.getApplicationBySrl", $comment_srl);
// return when no result or error occurance
if(!$output->toBool()||!count($output->data)) return $output;
$comment = $output->data;
unset($_oComment);
$_oComment = new CommentItem(0);
$_oComment->setAttribute($comment);
$file_list = $_oComment->getUploadedFiles();
$applicant_cv = $file_list[0];
$_oComment->cv = $applicant_cv;
// return $_oComment;
return $output;
}
너무 머리가 아프네요.
고수님들 도와주시면 감사하겠습니다. ㅜㅜ
댓글 4
-
가난한법학도
2014.01.29 00:59
아...
전체 모듈 자체를 Paper로 바꿨습니다. 제가 그 얘기를 안했네요. ^^
푸시아님 말씀대로. conf/module.xml 에다가
<action name="disPaperOpinion" type="view" standalone="true" />
등록을 했는데,
Fatal error: __clone method called on non-object in /www/kdfs2013.godohosting.com/classes/db/DB.class.php on line 646
라는 에러 메시지가 나오네요.
이건 왜 발생하는지 모르겠습니다.
에고.. 어렵네용. .ㅜㅜ
-
모듈을 Paper로 바꿨다면 파일명이 paper.view.php / paper.model.php 이와 같은 형식이 되어야 합니다.
이 역시 규칙 위반 입니다.
-
가난한법학도
2014.01.29 01:09
아.. 푸시아님..
제가 본문에.. 'recruit.model.php' 이런 식으로 적어 놔서 혼선을 드린 것 같습니다.
파일명은 paper.view.php 이런 식이 맞습니다.
채용모듈을 튜닝한 것이라서, 사람들이 잘 알듯한 파일명을 적은건데,
오히려 혼선을 드린 것 같습니다. 이 점 죄송합니다.
일단 view 에서 disPaperOpinion() 이런 임의의 함수명 안됩니다.
모듈명이 Recruit이라면 dispRecruitOpinion() 같이 해야 합니다.
그리고 conf/module.xml 파일도 수정해야 합니다.
저도 다 아는건 아니지만 모듈 제작방법을 좀 더 공부하셔야 될 것 같습니다.