1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

Фикс бэкенда

This commit is contained in:
Denis Shakhov 2014-04-08 18:44:28 +07:00
parent c2b5673539
commit e943edbd54
4 changed files with 31 additions and 31 deletions

View file

@ -877,7 +877,7 @@ class ActionAjax extends Action {
* Получение информации о голосовании за топик * Получение информации о голосовании за топик
*/ */
protected function EventVoteGetInfoTopic() { protected function EventVoteGetInfoTopic() {
if (!($oTopic = $this->Topic_GetTopicById(getRequestStr('id', null, 'post'))) ) { if (!($oTopic = $this->Topic_GetTopicById(getRequestStr('iTargetId', null, 'post'))) ) {
return $this->EventErrorDebug(); return $this->EventErrorDebug();
} }
@ -887,10 +887,10 @@ class ActionAjax extends Action {
$oViewer = $this->Viewer_GetLocalViewer(); $oViewer = $this->Viewer_GetLocalViewer();
$oViewer->Assign('oTopic', $oTopic); $oViewer->Assign('oObject', $oTopic);
$oViewer->Assign('oUserCurrent', $this->oUserCurrent); $oViewer->Assign('oUserCurrent', $this->oUserCurrent);
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("vote.info.tpl")); $this->Viewer_AssignAjax('sText', $oViewer->Fetch("components/vote/vote.info.tpl"));
} }
/** /**
@ -970,7 +970,7 @@ class ActionAjax extends Action {
/** /**
* Комментарий существует? * Комментарий существует?
*/ */
if (!($oComment=$this->Comment_GetCommentById(getRequestStr('idComment',null,'post')))) { if (!($oComment=$this->Comment_GetCommentById(getRequestStr('iTargetId',null,'post')))) {
return $this->EventErrorDebug(); return $this->EventErrorDebug();
} }
/** /**
@ -1046,28 +1046,28 @@ class ActionAjax extends Action {
/** /**
* Топик существует? * Топик существует?
*/ */
if (!($oTopic=$this->Topic_GetTopicById(getRequestStr('idTopic',null,'post')))) { if (!($oTopic=$this->Topic_GetTopicById(getRequestStr('iTargetId',null,'post')))) {
return $this->EventErrorDebug(); return $this->EventErrorDebug();
} }
/** /**
* Голосует автор топика? * Голосует автор топика?
*/ */
if ($oTopic->getUserId()==$this->oUserCurrent->getId()) { if ($oTopic->getUserId()==$this->oUserCurrent->getId()) {
$this->Message_AddErrorSingle($this->Lang_Get('topic_vote_error_self'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_self'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
* Пользователь уже голосовал? * Пользователь уже голосовал?
*/ */
if ($oTopicVote=$this->Vote_GetVote($oTopic->getId(),'topic',$this->oUserCurrent->getId())) { if ($oTopicVote=$this->Vote_GetVote($oTopic->getId(),'topic',$this->oUserCurrent->getId())) {
$this->Message_AddErrorSingle($this->Lang_Get('topic_vote_error_already'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_already_voted'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
* Время голосования истекло? * Время голосования истекло?
*/ */
if (strtotime($oTopic->getDateAdd())<=time()-Config::Get('acl.vote.topic.limit_time')) { if (strtotime($oTopic->getDateAdd())<=time()-Config::Get('acl.vote.topic.limit_time')) {
$this->Message_AddErrorSingle($this->Lang_Get('topic_vote_error_time'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_time'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
@ -1081,7 +1081,7 @@ class ActionAjax extends Action {
* Права на голосование * Права на голосование
*/ */
if (!$this->ACL_CanVoteTopic($this->oUserCurrent,$oTopic) and $iValue) { if (!$this->ACL_CanVoteTopic($this->oUserCurrent,$oTopic) and $iValue) {
$this->Message_AddErrorSingle($this->Lang_Get('topic_vote_error_acl'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_acl'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
@ -1108,9 +1108,9 @@ class ActionAjax extends Action {
} }
if ($this->Vote_AddVote($oTopicVote) and $this->Topic_UpdateTopic($oTopic)) { if ($this->Vote_AddVote($oTopicVote) and $this->Topic_UpdateTopic($oTopic)) {
if ($iValue) { if ($iValue) {
$this->Message_AddNoticeSingle($this->Lang_Get('topic_vote_ok'),$this->Lang_Get('attention')); $this->Message_AddNoticeSingle($this->Lang_Get('vote.notices.success'),$this->Lang_Get('attention'));
} else { } else {
$this->Message_AddNoticeSingle($this->Lang_Get('topic_vote_ok_abstain'),$this->Lang_Get('attention')); $this->Message_AddNoticeSingle($this->Lang_Get('vote.notices.success_abstain'),$this->Lang_Get('attention'));
} }
$this->Viewer_AssignAjax('iRating',$oTopic->getRating()); $this->Viewer_AssignAjax('iRating',$oTopic->getRating());
/** /**
@ -1137,21 +1137,21 @@ class ActionAjax extends Action {
/** /**
* Блог существует? * Блог существует?
*/ */
if (!($oBlog=$this->Blog_GetBlogById(getRequestStr('idBlog',null,'post')))) { if (!($oBlog=$this->Blog_GetBlogById(getRequestStr('iTargetId',null,'post')))) {
return $this->EventErrorDebug(); return $this->EventErrorDebug();
} }
/** /**
* Голосует за свой блог? * Голосует за свой блог?
*/ */
if ($oBlog->getOwnerId()==$this->oUserCurrent->getId()) { if ($oBlog->getOwnerId()==$this->oUserCurrent->getId()) {
$this->Message_AddErrorSingle($this->Lang_Get('blog.vote.notices.error_self'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_self'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
* Уже голосовал? * Уже голосовал?
*/ */
if ($oBlogVote=$this->Vote_GetVote($oBlog->getId(),'blog',$this->oUserCurrent->getId())) { if ($oBlogVote=$this->Vote_GetVote($oBlog->getId(),'blog',$this->oUserCurrent->getId())) {
$this->Message_AddErrorSingle($this->Lang_Get('blog.vote.notices.error_already'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_already_voted'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
@ -1193,7 +1193,7 @@ class ActionAjax extends Action {
default: default:
case ModuleACL::CAN_VOTE_BLOG_FALSE: case ModuleACL::CAN_VOTE_BLOG_FALSE:
$this->Message_AddErrorSingle($this->Lang_Get('blog.vote.notices.error_acl'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_acl'),$this->Lang_Get('attention'));
return; return;
break; break;
} }
@ -1213,28 +1213,28 @@ class ActionAjax extends Action {
/** /**
* Пользователь существует? * Пользователь существует?
*/ */
if (!($oUser=$this->User_GetUserById(getRequestStr('idUser',null,'post')))) { if (!($oUser=$this->User_GetUserById(getRequestStr('iTargetId',null,'post')))) {
return $this->EventErrorDebug(); return $this->EventErrorDebug();
} }
/** /**
* Голосует за себя? * Голосует за себя?
*/ */
if ($oUser->getId()==$this->oUserCurrent->getId()) { if ($oUser->getId()==$this->oUserCurrent->getId()) {
$this->Message_AddErrorSingle($this->Lang_Get('user_vote_error_self'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_self'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
* Уже голосовал? * Уже голосовал?
*/ */
if ($oUserVote=$this->Vote_GetVote($oUser->getId(),'user',$this->oUserCurrent->getId())) { if ($oUserVote=$this->Vote_GetVote($oUser->getId(),'user',$this->oUserCurrent->getId())) {
$this->Message_AddErrorSingle($this->Lang_Get('user_vote_error_already'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_already_voted'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
* Имеет право на голосование? * Имеет право на голосование?
*/ */
if (!$this->ACL_CanVoteUser($this->oUserCurrent,$oUser)) { if (!$this->ACL_CanVoteUser($this->oUserCurrent,$oUser)) {
$this->Message_AddErrorSingle($this->Lang_Get('user_vote_error_acl'),$this->Lang_Get('attention')); $this->Message_AddErrorSingle($this->Lang_Get('vote.notices.error_acl'),$this->Lang_Get('attention'));
return; return;
} }
/** /**
@ -1258,7 +1258,7 @@ class ActionAjax extends Action {
//$oUser->setRating($oUser->getRating()+$iValue); //$oUser->setRating($oUser->getRating()+$iValue);
$oUser->setCountVote($oUser->getCountVote()+1); $oUser->setCountVote($oUser->getCountVote()+1);
if ($this->Vote_AddVote($oUserVote) and $this->User_Update($oUser)) { if ($this->Vote_AddVote($oUserVote) and $this->User_Update($oUser)) {
$this->Message_AddNoticeSingle($this->Lang_Get('user_vote_ok'),$this->Lang_Get('attention')); $this->Message_AddNoticeSingle($this->Lang_Get('vote.notices.success'),$this->Lang_Get('attention'));
$this->Viewer_AssignAjax('iRating',$oUser->getRating()); $this->Viewer_AssignAjax('iRating',$oUser->getRating());
$this->Viewer_AssignAjax('iSkill',$oUser->getSkill()); $this->Viewer_AssignAjax('iSkill',$oUser->getSkill());
$this->Viewer_AssignAjax('iCountVote',$oUser->getCountVote()); $this->Viewer_AssignAjax('iCountVote',$oUser->getCountVote());

View file

@ -283,7 +283,7 @@ class ActionStream extends Action {
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error')); $this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
} }
if ($this->oUserCurrent->getId() == getRequestStr('id')) { if ($this->oUserCurrent->getId() == getRequestStr('id')) {
$this->Message_AddError($this->Lang_Get('stream_error_subscribe_to_yourself'),$this->Lang_Get('error')); $this->Message_AddError($this->Lang_Get('user_list_add.notices.error_self'),$this->Lang_Get('error'));
return; return;
} }
/** /**

View file

@ -760,7 +760,7 @@ class ActionTalk extends Action {
$aResult[]=array( $aResult[]=array(
'bStateError'=>true, 'bStateError'=>true,
'sMsgTitle'=>$this->Lang_Get('error'), 'sMsgTitle'=>$this->Lang_Get('error'),
'sMsg'=>$this->Lang_Get('talk_blacklist_add_self') 'sMsg'=>$this->Lang_Get('user_list_add.notices.error_self')
); );
continue; continue;
} }
@ -799,7 +799,7 @@ class ActionTalk extends Action {
$aResult[]=array( $aResult[]=array(
'bStateError'=>true, 'bStateError'=>true,
'sMsgTitle'=>$this->Lang_Get('error'), 'sMsgTitle'=>$this->Lang_Get('error'),
'sMsg'=>$this->Lang_Get('talk_blacklist_user_already_have',array('login'=>htmlspecialchars($sUser))), 'sMsg'=>$this->Lang_Get('user_list_add.notices.error_already_added',array('login'=>htmlspecialchars($sUser))),
'sUserLogin'=>htmlspecialchars($sUser) 'sUserLogin'=>htmlspecialchars($sUser)
); );
continue; continue;
@ -947,7 +947,7 @@ class ActionTalk extends Action {
} }
$this->Message_AddNoticeSingle( $this->Message_AddNoticeSingle(
$this->Lang_Get( $this->Lang_Get(
'talk_speaker_delete_ok', 'common.success.remove',
array('login'=>$oUserTarget->getLogin()) array('login'=>$oUserTarget->getLogin())
), ),
$this->Lang_Get('attention') $this->Lang_Get('attention')
@ -1021,7 +1021,7 @@ class ActionTalk extends Action {
$aResult[]=array( $aResult[]=array(
'bStateError'=>true, 'bStateError'=>true,
'sMsgTitle'=>$this->Lang_Get('error'), 'sMsgTitle'=>$this->Lang_Get('error'),
'sMsg'=>$this->Lang_Get('talk_speaker_add_self') 'sMsg'=>$this->Lang_Get('user_list_add.notices.error_self')
); );
continue; continue;
} }
@ -1055,7 +1055,7 @@ class ActionTalk extends Action {
$aResult[]=array( $aResult[]=array(
'bStateError'=>false, 'bStateError'=>false,
'sMsgTitle'=>$this->Lang_Get('attention'), 'sMsgTitle'=>$this->Lang_Get('attention'),
'sMsg'=>$this->Lang_Get('talk_speaker_add_ok',array('login',htmlspecialchars($sUser))), 'sMsg'=>$this->Lang_Get('user_list_add.notices.success_add',array('login',htmlspecialchars($sUser))),
'iUserId'=>$oUser->getId(), 'iUserId'=>$oUser->getId(),
'sUserLogin'=>$oUser->getLogin(), 'sUserLogin'=>$oUser->getLogin(),
'sUserLink'=>$oUser->getUserWebPath(), 'sUserLink'=>$oUser->getUserWebPath(),
@ -1079,7 +1079,7 @@ class ActionTalk extends Action {
$aResult[]=array( $aResult[]=array(
'bStateError'=>true, 'bStateError'=>true,
'sMsgTitle'=>$this->Lang_Get('error'), 'sMsgTitle'=>$this->Lang_Get('error'),
'sMsg'=>$this->Lang_Get('talk_speaker_user_already_exist',array('login'=>htmlspecialchars($sUser))) 'sMsg'=>$this->Lang_Get('user_list_add.notices.error_already_added',array('login'=>htmlspecialchars($sUser)))
); );
break; break;
/** /**
@ -1121,7 +1121,7 @@ class ActionTalk extends Action {
$aResult[]=array( $aResult[]=array(
'bStateError'=>false, 'bStateError'=>false,
'sMsgTitle'=>$this->Lang_Get('attention'), 'sMsgTitle'=>$this->Lang_Get('attention'),
'sMsg'=>$this->Lang_Get('talk_speaker_add_ok',array('login',htmlspecialchars($sUser))), 'sMsg'=>$this->Lang_Get('user_list_add.notices.success_add',array('login',htmlspecialchars($sUser))),
'iUserId'=>$oUser->getId(), 'iUserId'=>$oUser->getId(),
'sHtml'=>$oViewer->Fetch("user_list_small_item.message.tpl") 'sHtml'=>$oViewer->Fetch("user_list_small_item.message.tpl")
); );

View file

@ -158,7 +158,7 @@ class ActionUserfeed extends Action {
return; return;
} }
if ($this->oUserCurrent->getId() == getRequestStr('id')) { if ($this->oUserCurrent->getId() == getRequestStr('id')) {
$this->Message_AddError($this->Lang_Get('userfeed_error_subscribe_to_yourself'),$this->Lang_Get('error')); $this->Message_AddError($this->Lang_Get('user_list_add.notices.error_self'),$this->Lang_Get('error'));
return; return;
} }
break; break;
@ -170,7 +170,7 @@ class ActionUserfeed extends Action {
* Подписываем * Подписываем
*/ */
$this->Userfeed_subscribeUser($this->oUserCurrent->getId(), $iType, getRequestStr('id')); $this->Userfeed_subscribeUser($this->oUserCurrent->getId(), $iType, getRequestStr('id'));
$this->Message_AddNotice($this->Lang_Get('userfeed_subscribes_updated'), $this->Lang_Get('attention')); $this->Message_AddNotice($this->Lang_Get('common.success.save'), $this->Lang_Get('attention'));
} }
/** /**
* Подписка на пользвователя по логину * Подписка на пользвователя по логину
@ -275,7 +275,7 @@ class ActionUserfeed extends Action {
* Отписываем пользователя * Отписываем пользователя
*/ */
$this->Userfeed_unsubscribeUser($this->oUserCurrent->getId(), $iType, $sId); $this->Userfeed_unsubscribeUser($this->oUserCurrent->getId(), $iType, $sId);
$this->Message_AddNotice($this->Lang_Get('userfeed_subscribes_updated'), $this->Lang_Get('attention')); $this->Message_AddNotice($this->Lang_Get('common.success.save'), $this->Lang_Get('attention'));
} }
/** /**
* При завершении экшена загружаем в шаблон необходимые переменные * При завершении экшена загружаем в шаблон необходимые переменные