Procházet zdrojové kódy

Merge branch 'master' of https://github.com/unaio/una

RomanL před 6 roky
rodič
revize
4def6b1bf6

+ 5 - 3
modules/boonex/notifications/classes/BxNtfsCronNotify.php

@@ -90,10 +90,12 @@ class BxNtfsCronNotify extends BxDolCron
         $aSubscribers = $oConnection->getConnectedInitiators($iOwner);
         if(!empty($aSubscribers) && is_array($aSubscribers)) {
             $oOwner = BxDolProfile::getInstance($iOwner);
-            $sSettingType = bx_srv($oOwner->getModule(), 'act_as_profile') ? BX_NTFS_STYPE_FOLLOW_MEMBER : BX_NTFS_STYPE_FOLLOW_CONTEXT;
+            if(!empty($oOwner)) {
+                $sSettingType = bx_srv($oOwner->getModule(), 'act_as_profile') ? BX_NTFS_STYPE_FOLLOW_MEMBER : BX_NTFS_STYPE_FOLLOW_CONTEXT;
 
-            foreach($aSubscribers as $iSubscriber) 
-                $this->_addRecipient($iSubscriber, $sSettingType, $aRecipients);
+                foreach($aSubscribers as $iSubscriber) 
+                    $this->_addRecipient($iSubscriber, $sSettingType, $aRecipients);
+            }
         }
 
         //--- Get recipients: Content owner.

+ 1 - 1
modules/boonex/notifications/template/et_new_event.html

@@ -4,7 +4,7 @@
 			<div style="display: inline-block; vertical-align: middle; width: 48px; height: 48px; background-clip: padding-box; border-radius: 80px; line-height: 48px;text-align: center; overflow: hidden;">
                 <img style="width: 48px; height: 48px; line-height: 48px; border-radius: 80px;" src="__icon_url__" />
 			</div><div style="display: inline-block; vertical-align: middle; min-height: 48px; margin-left: 10px;">
-			    <div style="padding: 5px 0px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">
+			    <div style="padding: 5px 0px; white-space: normal; text-overflow: ellipsis; overflow: hidden;">
                     <p style="margin: 0px;">__content__</p>
                     <p style="margin: 5px 0px 0px 0px;">__date__</p>
                 </div>

+ 12 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -1245,6 +1245,17 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         ));
     }
 
+    public function serviceGetBlockViewsCustom($aParams = array())
+    {
+        $aParams = array_merge(array(
+            'view' => BX_TIMELINE_VIEW_TIMELINE, 
+            'type' => BX_BASE_MOD_NTFS_TYPE_PUBLIC,
+            'owner_id' => 0,
+        ), $aParams);
+
+    	return $this->_serviceGetBlockViews($aParams);
+    }
+
     public function serviceGetBlockViewsTimeline($sType = BX_BASE_MOD_NTFS_TYPE_PUBLIC, $iProfileId = 0, $iStart = -1, $iPerPage = -1, $iTimeline = -1, $sFilter = '', $aModules = array())
     {
         return $this->_serviceGetBlockViews(array(
@@ -2655,6 +2666,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             $iId = $oForm->insert(array(
                 'owner_id' => $iOwnerId,
                 'object_id' => $iUserId,
+                'object_owner_id' => $iUserId,
                 'object_privacy_view' => $iObjectPrivacyView,
                 'content' => serialize($aContent),
                 'title' => $sTitle,

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

@@ -50,6 +50,7 @@ class BxTimelineResponse extends BxBaseModNotificationsResponse
                     'type' => $oAlert->sUnit,
                     'action' => $oAlert->sAction,
                     'object_id' => $oAlert->iObject,
+                    'object_owner_id' => $iObjectAuthorId,
                     'object_privacy_view' => $iObjectPrivacyView,
                     'content' => $sContent,
                     'title' => '',

+ 18 - 7
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -1069,22 +1069,33 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(empty($aResult) || empty($aResult['object_owner_id']) || empty($aResult['content']))
             return false;
 
-        list($sUserName) = $this->getModule()->getUserInfo($aResult['object_owner_id']);
-
         $sSample = !empty($aResult['sample']) ? $aResult['sample'] : '_bx_timeline_txt_sample';
-        if(empty($aEvent['title']) || empty($aEvent['description'])) {
+
+        $aUpdate = array(
+            'object_owner_id' => $aResult['object_owner_id']
+        );
+
+        //--- Update Title if empty.
+        if(empty($aEvent['title'])) {
             $sTitle = !empty($aResult['title']) ? $this->_oConfig->getTitle($aResult['title']) : _t($sSample);
 
+            $aUpdate['title'] = bx_process_input(strip_tags($sTitle));
+        }
+
+        //--- Update Description if empty.
+        if(empty($aEvent['description'])) {
+            list($sUserName) = $this->getModule()->getUserInfo($aResult['object_owner_id']);
+
             $sDescription = !empty($aResult['description']) ? $aResult['description'] : _t('_bx_timeline_txt_user_added_sample', $sUserName, _t($sSample));
             if($sDescription == '' && !empty($aResult['content']['text']))
                 $sDescription = $aResult['content']['text'];
 
-            $this->_oDb->updateEvent(array(
-                'title' => bx_process_input(strip_tags($sTitle)),
-                'description' => bx_process_input(strip_tags($sDescription))
-            ), array('id' => $aEvent['id']));
+            $aUpdate['description'] = bx_process_input(strip_tags($sDescription));
         }
 
+        if(!empty($aUpdate) && is_array($aUpdate)) 
+            $this->_oDb->updateEvent($aUpdate, array('id' => $aEvent['id']));
+
         return $aResult;
     }
 

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

@@ -8,6 +8,7 @@ CREATE TABLE IF NOT EXISTS `bx_timeline_events` (
   `type` varchar(255) NOT NULL,
   `action` varchar(255) NOT NULL,
   `object_id` int(11) NOT NULL default '0',
+  `object_owner_id` int(11) NOT NULL default '0',
   `object_privacy_view` varchar(16) NOT NULL default '3',
   `content` text NOT NULL,
   `title` varchar(255) NOT NULL,