AntonLV 13 лет назад
Родитель
Сommit
a25601df3c

+ 1 - 1
inc/classes/BxDolVote.php

@@ -112,7 +112,7 @@ CREATE TABLE IF NOT EXISTS `sample_votes` (
 CREATE TABLE IF NOT EXISTS `sample_votes_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
-  `author_nip` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
   `value` tinyint(4) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `vote` (`object_id`, `author_nip`)

+ 6 - 25
inc/js/classes/BxDolVote.js

@@ -12,7 +12,8 @@ function BxDolVote(options)
     this._iObjId = options.iObjId; // this object id comments
     this._iLikeMode = undefined == options.iLikeMode ? 0 : options.iLikeMode;
 
-    this._sActionsUrl = options.sRootUrl + 'vote.php'; // actions url address
+    this._sActionsUri = 'vote.php';
+    this._sActionsUrl = options.sRootUrl + this._sActionsUri; // actions url address
 
     this._sAnimationEffect = 'fade';
     this._iAnimationSpeed = 'slow';
@@ -38,30 +39,10 @@ BxDolVote.prototype.toggleByPopup = function(oLink) {
     var oData = this._getDefaultParams();
     oData['action'] = 'GetVotedBy';
 
-    var oPopup = $(".bx-popup-applied:visible");
-    if(oPopup.length) {
-    	oPopup.dolPopupHide();
-    	return;
-    }
-
-	this._loadingInButton(oLink, true);
-
-	jQuery.post (
-		this._sActionsUrl,
-        oData,
-        function (s) {
-			$this._loadingInButton(oLink, false);
-
-			var oPopup = $(s).hide(); 
-
-	    	$('#' + oPopup.attr('id')).remove();
-	        oPopup.prependTo('body').dolPopup({
-	        	pointer:{
-	    			el:$(oLink)
-	    		}
-	        });
-        }
-	);
+	$(oLink).dolPopupAjax({
+		id: this._aHtmlIds['by_popup'], 
+		url: bx_append_url_params(this._sActionsUri, oData)
+	});
 };
 
 BxDolVote.prototype.over = function (oLink)

+ 1 - 1
modules/boonex/notes/install/sql/install.sql

@@ -90,7 +90,7 @@ CREATE TABLE IF NOT EXISTS `bx_notes_votes` (
 CREATE TABLE IF NOT EXISTS `bx_notes_votes_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
-  `author_nip` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
   `value` tinyint(4) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `vote` (`object_id`, `author_nip`)

+ 1 - 0
modules/boonex/timeline/classes/BxTimelineMenuItem.php

@@ -61,6 +61,7 @@ class BxTimelineMenuItem extends BxTemplMenu {
 		}
 
     	$this->addMarkers(array(
+    		'content_id' => $aEvent['id'],
     		'share_onclick' => $this->_oModule->serviceGetShareOnclick($iOwnerId, $sType, $sAction, $iObjectId),
     		'comment_onclick' => $this->_oModule->_oConfig->getJsObject('view') . ".commentItem(this, '" . $sCommentsSystem . "', " . $aEvent['id'] . ")",
     		'vote_onclick' => $sVotesOnclick

+ 3 - 3
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -184,9 +184,9 @@ class BxTimelineModule extends BxDolModule
     		return;
     	}
 
-    	$sContent = $this->_oTemplate->getViewItemPopup($iItemId);
-
-    	$this->_echoResultJson(array('popup' => $sContent));
+    	$this->_echoResultJson(array(
+    		'popup' => $this->_oTemplate->getViewItemPopup($iItemId)
+    	));
     }
 
     function actionRss($iOwnerId)

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -113,7 +113,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     public function getViewItemPopup($iId)
     {
     	bx_import('BxTemplFunctions');
-    	return BxTemplFunctions::getInstance()->transBox('bx-timeline-item-popup-' + $iId, $this->getViewItemBlock($iId));
+    	return BxTemplFunctions::getInstance()->transBox('bx-timeline-item-popup-' . $iId, $this->getViewItemBlock($iId));
     }
 
     public function getPost(&$aEvent, $aBrowseParams = array())

+ 3 - 3
modules/boonex/timeline/install/sql/enable.sql

@@ -52,9 +52,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_timeline_menu_item_actions', 'bx_timeline', '_bx_timeline_menu_set_title_item_actions', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', '', 2147483647, 1, 0, 0),
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '_bx_timeline_menu_item_title_item_vote', 'javascript:void(0)', 'javascript:{vote_onclick})', '_self', 'plus', '', 2147483647, 1, 0, 0),
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'javascript:{share_onclick}', '_self', 'share-square-o', '', 2147483647, 1, 0, 0);
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', '', 2147483647, 1, 0, 1),
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '_bx_timeline_menu_item_title_item_vote', 'javascript:void(0)', 'javascript:{vote_onclick}', '_self', 'plus', '', 2147483647, 1, 0, 2),
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'javascript:{share_onclick}', '_self', 'share-square-o', '', 2147483647, 1, 0, 3);
 
 -- MENU: Account Settings
 SET @iMIOrder = (SELECT MAX(`order`) FROM `sys_menu_items` WHERE `set_name`='sys_account_settings' LIMIT 1);

+ 1 - 1
modules/boonex/timeline/install/sql/install.sql

@@ -118,7 +118,7 @@ CREATE TABLE IF NOT EXISTS `bx_timeline_votes` (
 CREATE TABLE IF NOT EXISTS `bx_timeline_votes_track` (
   `object_id` int(11) NOT NULL default '0',
   `author_id` int(11) NOT NULL default '0',
-  `author_nip` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
   `value` tinyint(4) NOT NULL default '0',
   `date` int(11) NOT NULL default '0',
   KEY `vote` (`object_id`, `author_nip`)

+ 4 - 4
modules/boonex/timeline/js/view.js

@@ -95,7 +95,7 @@ BxTimelineView.prototype.showItem = function(oLink, iId) {
 	if(oLink)
     	this.loadingInItem(oLink, true);
 
-	jQuery.post (
+	jQuery.get (
 		this._sActionsUrl + 'get_post_popup',
 	    oData,
 	    function(oData) {
@@ -105,7 +105,7 @@ BxTimelineView.prototype.showItem = function(oLink, iId) {
 			if(!oData.popup)
 				return;
 
-			var oPopup = $(oData.popup).hide(); 
+			var oPopup = $(oData.popup).addClass('bx-popup-width bx-tl-item-popup').hide(); 
 
 	        $('#' + oPopup.attr('id')).remove();
 	        oPopup.prependTo('body').bxTime().dolPopup({
@@ -139,7 +139,7 @@ BxTimelineView.prototype.commentItem = function(oLink, sSystem, iId) {
     if(oLink)
     	this.loadingInItem(oLink, true);
 
-    jQuery.post (
+    jQuery.get (
         this._sActionsUrl + 'get_comments',
         oData,
         function(oData) {
@@ -199,7 +199,7 @@ BxTimelineView.prototype._getPosts = function(oElement, sAction) {
 			break;
 	}
 
-    jQuery.post(
+    jQuery.get(
         this._sActionsUrl + 'get_posts/',
         this._getDefaultData(),
         function(oData) {

+ 2 - 11
template/scripts/BxBaseVoteView.php

@@ -250,19 +250,10 @@ class BxBaseVoteView extends BxDolVote
 		if(empty($aTmplUsers))
 			$aTmplUsers = MsgBox(_t('_Empty'));
 
-    	$oTemplate = BxDolTemplate::getInstance();
-
-    	bx_import('BxTemplStudioFunctions');
-        $sContent = BxTemplStudioFunctions::getInstance()->transBox($oTemplate->parseHtmlByName('vote_by_list.html', array(
+    	return BxDolTemplate::getInstance()->parseHtmlByName('vote_by_list.html', array(
     		'style_prefix' => $this->_sStylePrefix,
     		'bx_repeat:list' => $aTmplUsers
-    	)));
-
-        return $oTemplate->parseHtmlByName('vote_by.html', array(
-        	'style_prefix' => $this->_sStylePrefix,
-        	'id' => $this->_aHtmlIds['by_popup'],
-        	'content' => $sContent
-        ));
+    	));
     }
 
 	protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)