Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • ActionFormModel
  • ArrayUtil
  • ArrayValidator
  • AssociatedMediaBehavior
  • AuxLib
  • Changelog
  • DetailView
  • EncryptUtilTmp
  • EventsWidgetFieldFormatter
  • FailedLogins
  • FieldFormatter
  • FieldFormatterBase
  • FieldInputRenderer
  • FileFieldBehavior
  • FiltersForm
  • FilterUtil
  • FineDiff
  • FineDiffCopyOp
  • FineDiffDeleteOp
  • FineDiffInsertOp
  • FineDiffOp
  • FineDiffOps
  • FineDiffReplaceOp
  • GlobalCSSFormModel
  • GlobalImportFormModel
  • GoogleAuthenticator
  • JSONFieldsBehavior
  • JSONResponse
  • MediaFieldFormatter
  • MediaSelector
  • MobileActiveRecordFieldFormatter
  • MobileActivityFeed
  • MobileChartDashboard
  • MobileFieldFormatter
  • MobileFieldInputRenderer
  • ModuleModelNameValidator
  • MultiChildNode
  • MultiTypeAutocomplete
  • PasswordUtil
  • ProductFeature
  • ProfileWidgetLayout
  • QueryParamGenerator
  • RecordLimitBehavior
  • RecordView
  • RecordViewWidgetLayout
  • RelationshipsGridModel
  • RelationshipsJoin
  • RepairUserDataCommand
  • RequestUtil
  • RequiredIfNotSetValidator
  • ResponseUtil
  • RunMigrationScriptCommand
  • ServiceWebFormDesigner
  • Settings
  • StringUtil
  • TestEmailAction
  • TestEmailActionForm
  • ThemeGenerator
  • TimerUtil
  • TopicsFieldFormatter
  • TopicsWidgetLayout
  • TransactionalViewFieldFormatter
  • UrlUtil
  • ValidLinkValidator
  • WebFormDesigner
  • WebLeadFormDesigner
  • X2ActiveRecordBehavior
  • X2ActiveRecordFieldFormatter
  • X2ButtonColumn
  • X2ConditionList
  • X2ConsoleCommand
  • X2ControllerBehavior
  • X2DataColumn
  • X2DuplicateBehavior
  • X2Flashes
  • X2GridViewFieldFormatter
  • X2IPAddress
  • X2LeadsDataColumn
  • X2MergeableBehavior
  • X2MessageSource
  • X2MobileControllerBehavior
  • X2MobileProfileControllerBehavior
  • X2MobileQuotesControllerBehavior
  • X2MobileSiteControllerBehavior
  • X2MobileTopicsControllerBehavior
  • X2ModelConversionBehavior
  • X2ModelConversionWidget
  • X2ModelForeignKeyValidator
  • X2ModelUniqueIndexValidator
  • X2NonWebUser
  • X2StaticDropdown
  • X2StaticField
  • X2StaticFieldsBehavior
  • X2UrlManager
  • X2Validator
  • X2WidgetBehavior

Interfaces

  • AdminOwnedCredentials

Exceptions

  • CampaignMailingException
  • CodeExchangeException
  • GetCredentialsException
  • NoRefreshTokenException
  • NoUserIdException
  • StringUtilException

Functions

  • checkCurrency
  • checkDNS
  • checkServerVar
  • checkTimezone
  • decodeQuotes
  • echoIcons
  • encodeQuotes
  • exceptionForError
  • getField
  • getLanguageName
  • getModuleTitle
  • handleReqError
  • handleReqException
  • installer_t
  • installer_tr
  • isAllowedDir
  • mediaMigrationRrmdir
  • migrateMediaDir
  • printGraph
  • printR
  • renderFields
  • reqShutdown
  • RIP
  • translateOptions
  • tryGetRemote
  • Overview
  • Package
  • Function
  • Tree
  1: <?php
  2: /*****************************************************************************************
  3:  * X2Engine Open Source Edition is a customer relationship management program developed by
  4:  * X2Engine, Inc. Copyright (C) 2011-2016 X2Engine Inc.
  5:  * 
  6:  * This program is free software; you can redistribute it and/or modify it under
  7:  * the terms of the GNU Affero General Public License version 3 as published by the
  8:  * Free Software Foundation with the addition of the following permission added
  9:  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 10:  * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 11:  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 12:  * 
 13:  * This program is distributed in the hope that it will be useful, but WITHOUT
 14:  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 15:  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 16:  * details.
 17:  * 
 18:  * You should have received a copy of the GNU Affero General Public License along with
 19:  * this program; if not, see http://www.gnu.org/licenses or write to the Free
 20:  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 21:  * 02110-1301 USA.
 22:  * 
 23:  * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 24:  * California 95067, USA. or at email address contact@x2engine.com.
 25:  * 
 26:  * The interactive user interfaces in modified source and object code versions
 27:  * of this program must display Appropriate Legal Notices, as required under
 28:  * Section 5 of the GNU Affero General Public License version 3.
 29:  * 
 30:  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 31:  * these Appropriate Legal Notices must retain the display of the "Powered by
 32:  * X2Engine" logo. If the display of the logo is not reasonably feasible for
 33:  * technical reasons, the Appropriate Legal Notices must display the words
 34:  * "Powered by X2Engine".
 35:  *****************************************************************************************/
 36: 
 37: Yii::app()->clientScript->registerScriptFile(
 38:     Yii::app()->getBaseUrl().'/js/activityFeed.js', CClientScript::POS_END);
 39: Yii::app()->clientScript->registerScriptFile(
 40:     Yii::app()->getBaseUrl().'/js/EnlargeableImage.js', CClientScript::POS_END);
 41: Yii::app()->clientScript->registerScriptFile(
 42:     Yii::app()->getBaseUrl().'/js/jquery-expander/jquery.expander.js', CClientScript::POS_END);
 43: 
 44: // used for rich editing in new post text field
 45: Yii::app()->clientScript->registerPackage ('emailEditor');
 46: 
 47: 
 48: Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl().'/js/multiselect/js/ui.multiselect.js');
 49: Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl().'/js/lib/moment-with-locales.min.js');
 50: 
 51: 
 52: $groups = Groups::getUserGroups(Yii::app()->user->getId());
 53: $tempUserList = array();
 54: foreach($groups as $groupId){
 55:     $userLinks = GroupToUser::model()->findAllByAttributes(array('groupId'=>$groupId));
 56:     foreach($userLinks as $link){
 57:         $user = User::model()->findByPk($link->userId);
 58:         if(isset($user)){
 59:             $tempUserList[] = $user->username;
 60:         }
 61:     }
 62: }
 63: 
 64: $userList = array_keys(User::getNames());
 65: $tempUserList = array_diff($userList,$tempUserList);
 66: $usersGroups = implode(",",$tempUserList);
 67: 
 68: Yii::app()->clientScript->registerScript('setUpActivityFeedManager', "
 69: 
 70: x2.activityFeed = new x2.ActivityFeed ({
 71:     translations: ".CJSON::encode (array (
 72:         'Unselect All' => Yii::t('app','Unselect All'),
 73:         'Select All' => Yii::t('app','Select All'),
 74:         'Uncheck All' => Yii::t('app','Uncheck All'),
 75:         'Check All' => Yii::t('app','Check All'),
 76:         'Enter text here...' => Yii::t('app','Enter text here...'),
 77:         'Broadcast Event' => Yii::t('app','Broadcast Event'),
 78:         'Make Important' => Yii::t('app','Make Important'),
 79:         'Broadcast' => Yii::t('app','Broadcast'),
 80:         'broadcast error message 1' => Yii::t('app','Select at least one user to broadcast to'),
 81:         'broadcast error message 2' => Yii::t('app','Select at least one broadcast method'),
 82:         'Okay' => Yii::t('app','Okay'),
 83:         'Nevermind' => Yii::t('app','Cancel'),
 84:         'Create' => Yii::t('app','Create'),
 85:         'Cancel' => Yii::t('app','Cancel'),
 86:         'Read more' => Yii::t('app','Read') . '&nbsp;' . Yii::t('app', 'More'),
 87:         'Read less' => Yii::t('app','Read') . '&nbsp;' . Yii::t('app', 'Less'),
 88:     )).",
 89:     usersGroups: '".$usersGroups."',
 90:     minimizeFeed: ".(Yii::app()->params->profile->minimizeFeed==1?'true':'false').",
 91:     commentFlag: false,
 92:     lastEventId: ".(!empty($lastEventId)?$lastEventId:0).",
 93:     lastTimestamp: ".(!empty($lastTimestamp)?$lastTimestamp:0).",
 94:     profileId: ".$profileId.",
 95:     myProfileId: ".Yii::app()->params->profile->id.",
 96:     deletePostUrl: '".$this->createUrl('/profile/deletePost')."'
 97: });
 98: 
 99: ", CClientScript::POS_END);
100: ?>
101: 
102: <div id='activity-feed-container' class='x2-layout-island'>
103: <div id='page-title-container'>
104:     <div class="page-title icon rounded-top activity-feed x2Activity">
105:         <h2><?php echo Yii::t('app','Activity Feed'); ?></h2>
106:         <span title='<?php echo Yii::t('app', 'Feed Settings'); ?>'>
107:         <?php
108:         echo X2Html::settingsButton (Yii::t('app', 'Feed Settings'), 
109:             array ('id' => 'activity-feed-settings-button'));
110:         ?>
111:         </span>
112:         <a href='#' id='feed-filters-button' 
113:          class='filter-button right'>
114:             <span class='fa fa-filter'></span>
115:         </a>
116:         <div id="menu-links" class="title-bar" style='display: none;'>
117:             <?php
118:             echo CHtml::link(
119:                 Yii::t('app','Toggle Comments'),'#',
120:                 array('id'=>'toggle-all-comments','class'=>'x2-button x2-minimal-button right'));
121:             echo CHtml::link(
122:                 Yii::t('app','Restore Posts'),'#',
123:                 array('id'=>'restore-posts','style'=>'display:none;',
124:                     'class'=>'x2-button x2-minimal-button right'));
125:             echo CHtml::link(
126:                 Yii::t('app','Minimize Posts'),
127:                 '#',array('id'=>'min-posts','class'=>'x2-button x2-minimal-button right'));
128:             ?>
129:         </div>
130:     </div>
131: </div>
132: 
133: <?php
134: $this->renderPartial ('_feedFilters');
135: ?>
136: 
137: <div class="form" id="post-form" style="clear:both">
138:     <?php $feed=new Events; ?>
139:     <?php $form = $this->beginWidget('CActiveForm', array(
140:     'id'=>'feed-form',
141:     'enableAjaxValidation'=>false,
142:     'method'=>'post',
143:     )); ?>
144:     <div class="float-row" style='overflow:visible;'>
145:         <?php
146:         echo $form->textArea($feed,'text',array('style'=>'width:99%;height:25px;color:#aaa;display:block;clear:both;'));
147:         echo "<div id='post-buttons' style='display:none;'>";
148:         echo $form->dropDownList($feed,'associationId',$users, 
149:             array (
150:                 'style' => ($isMyProfile ? '' : 'display:none;'),
151:                 'class' => 'x2-select'
152:             )
153:         );
154:         $feed->visibility=1;
155:         echo $form->dropDownList($feed,'visibility',
156:             array(1=>Yii::t('actions','Public'), 0=>Yii::t('actions','Private')),
157:             array ('class' => 'x2-select')
158:         );
159:         function translateOptions($item){
160:             return Yii::t('app',$item);
161:         }
162:         echo $form->dropDownList($feed,'subtype',
163:             array_map(
164:                 'translateOptions',
165:                 Dropdowns::getSocialSubtypes ()),
166:             array ('class' => 'x2-select'));
167:         ?>
168:         <div id='second-row-buttons-container'>
169:             <?php
170:             echo CHtml::submitButton(
171:                 Yii::t('app','Post'),array('class'=>'x2-button','id'=>'save-button'));
172:             if ($isMyProfile) {
173:                 echo CHtml::button(
174:                     Yii::t('app','Attach A File/Photo'),
175:                     array(
176:                         'class'=>'x2-button',
177:                         'onclick'=>"x2.FileUploader.toggle('activity')",
178:                         'id'=>"toggle-attachment-menu-button"));
179:             }
180:             ?>
181:         </div>
182:         </div>
183:         <?php
184:         ?>
185:     </div>
186:     <?php $this->endWidget(); ?>
187: </div>
188: <?php
189: if ($isMyProfile) {
190:     $this->widget ('FileUploader',array(
191:         'id' => 'activity',
192:         'url' => '/site/upload',
193:         'mediaParams' => array(
194:             'profileId' => $profileId, 
195:             'associationType' => 'feed',
196:             'associationId' => Yii::app()->user->getId(),
197:         ),
198:         'viewParams' => array (
199:             'showButton' => false
200:         )
201:     ));
202: }
203: $this->widget('zii.widgets.CListView', array(
204:     'dataProvider'=>$stickyDataProvider,
205:     'itemView'=>'_viewEvent',
206:     'viewData' => array (
207:         'profileId' => $profileId
208:     ),
209:     'id'=>'sticky-feed',
210:     'htmlOptions' => array (
211:         'style' => $stickyDataProvider->itemCount === 0 ? 'display: none;' : '',
212:     ),
213:     'pager' => array(
214:         'class' => 'ext.infiniteScroll.IasPager',
215:         'rowSelector'=>'.view.top-level',
216:         'listViewId' => 'sticky-feed',
217:         'header' => '',
218:         'options'=>array(
219:             'onRenderComplete'=>'js:function(){
220:                 x2.activityFeed.makePostsExpandable ();
221:                 if(x2.activityFeed.minimizeFeed){
222:                     x2.activityFeed.minimizePosts();
223:                 }
224:                 if(x2.activityFeed.commentFlag){
225:                     $(".comment-link").click();
226:                 }
227:             }'
228:         ),
229:     ),
230:     'baseScriptUrl'=>Yii::app()->request->baseUrl.'/themes/'.Yii::app()->theme->name.'/css/listview',
231:     'template'=>'{pager} {items}'
232: ));
233: $this->widget('zii.widgets.CListView', array(
234:     'dataProvider'=>$dataProvider,
235:     'itemView'=>'_viewEvent',
236:     'viewData' => array (
237:         'profileId' => $profileId
238:     ),
239:     'id'=>'activity-feed',
240:     'pager' => array(
241:         'class' => 'ext.infiniteScroll.IasPager',
242:         'rowSelector'=>'.view.top-level',
243:         'listViewId' => 'activity-feed',
244:         'header' => '',
245:         'options'=>array(
246:             'onRenderComplete'=>'js:function(){
247:                 x2.activityFeed.makePostsExpandable ();
248:                 if(x2.activityFeed.minimizeFeed){
249:                     x2.activityFeed.minimizePosts();
250:                 }
251:                 if(x2.activityFeed.commentFlag){
252:                     $(".comment-link").click();
253:                 }
254:                 $.each($(".comment-count"),function(){
255:                     if($(this).attr("val")>0){
256:                         $(this).parent().click();
257:                     }
258:                 });
259:             }'
260:         ),
261:     ),
262:     'baseScriptUrl'=>Yii::app()->request->baseUrl.'/themes/'.Yii::app()->theme->name.'/css/listview',
263:     'template'=>'{pager} {items}',
264: ));
265: 
266: ?>
267: <div id="make-important-dialog" style="display: none;">
268:     <div class='dialog-explanation'>
269:         <?php echo Yii::t('app','Leave colors blank for defaults.');?>
270:     </div>
271:     <div>
272:         <?php
273:             echo CHtml::label(Yii::t('app','What color should the event be?'),'broadcastColor');
274:         ?>
275:         <div class='row'>
276:             <?php echo CHtml::textField('broadcastColor',''); ?>
277:         </div>
278:     </div>
279:     <div>
280:         <?php echo CHtml::label(Yii::t('app','What color should the font be?'),'fontColor'); ?>
281:             <div class='row'>
282:         <?php echo CHtml::textField('fontColor',''); ?>
283:         </div>
284:     </div>
285:     <div>
286:         <?php echo CHtml::label(Yii::t('app','What color should the links be?'),'linkColor'); ?>
287:         <div class='row'>
288:             <?php echo CHtml::textField('linkColor',''); ?>
289:         </div>
290:     </div>
291: </div>
292: <div id="broadcast-dialog" style='display: none;'>
293:     <div class='dialog-explanation'>
294:         <?php echo Yii::t('app', 'Select a group of users to send this event to via email or notification.'); ?>
295:     </div>
296:     <select id='broadcast-dialog-user-select' class='multiselect' multiple='multiple' size='6'>
297:         <?php foreach ($userModels as $user) { ?>
298:         <option value="<?php echo $user->id; ?>"> <?php echo $user->firstName . ' ' . $user->lastName; ?> </option>
299:         <?php } ?>
300:     </select>
301:     <div>
302:         <?php echo CHtml::label(Yii::t('app','Do you want to email selected users?'),'email-users'); ?>
303:         <?php echo CHtml::checkBox('email-users'); ?>
304:     </div>
305:     <div id='notify-users-checkbox-container'>
306:         <?php echo CHtml::label(Yii::t('app','Do you want to notify selected users?'),'notify-users'); ?>
307:         <?php echo CHtml::checkBox('notify-users'); ?>
308:     </div>
309: </div>
310: </div>
311: 
X2CRM Documentation API documentation generated by ApiGen 2.8.0