<div class="icon-container"> <?php echo X2Html::x2icon('service'); ?> </div> <div class="icon-description"> <p> <?php echo CHtml::link(Yii::t('help', 'Services'), array('/services/services/index')); ?> </p> </div> </div> <div class="row"> <div class="icon-container"> <?php echo X2Html::x2icon('funnel'); ?> </div> <div class="icon-description"> <p> <?php echo CHtml::link(Yii::t('workflow', 'Process'), array('/workflow/workflow/index')); ?> </p> </div> </div> </div> </div> <?php Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/css/activityFeed.css'); /* The event icons are assigned in activityFeed.css, so this way reuses the assignments there */
public static function generateFeedEmail($filters, $userId, $range, $limit, $eventId, $deleteKey) { $image = Yii::app()->getAbsoluteBaseUrl(true) . '/images/x2engine.png'; $msg = "<div id='wrap' style='width:6.5in;height:9in;margin-top:auto;margin-left:auto;margin-bottom:auto;margin-right:auto;'><html><body><center>"; $msg .= '<table border="0" cellpadding="0" cellspacing="0" height="100%" id="top-activity" style="background: white; font-family: \'Helvetica Neue\', \'Helvetica\', Helvetica, Arial, sans-serif; font-weight: normal; font-style: normal; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased;background-color:#FAFAFA;height:25% !important; margin:0; padding:0; width:100% !important;" width="100%">' . "<tbody><tr><td align=\"center\" style=\"padding-top:20px;\" valign=\"top\">" . '<table border="0" cellpadding="0" cellspacing="0" id="templateContainer" style="border: 1px solid #DDDDDD;background-color:#FFFFFF;" width="600"><tbody>'; $msg .= '<tr> <td align="center" valign="top"><!-- // Begin Template Header \\ --> <table border="0" cellpadding="0" cellspacing="0" id="templateHeader" width="600"> <tbody> <tr> <td class="headerContent" style="color:#202020;font-weight:bold;line-height:100%;padding:0;text-align:center;vertical-align:middle;font-family: inherit;font-weight: normal;font-size: 14px;margin-bottom: 17px"><img id="headerImage campaign-icon" src="' . $image . '" style="border:0; height:auto; line-height:100%; outline:none; text-decoration:none;max-width:600px;" /></td> </tr> <tr> <td style="color:#202020;font-weight:bold;padding:5px;text-align:center;vertical-align:middle;font-family: inherit;font-weight: normal;font-size: 14px;"><h2>' . Yii::t('profile', 'Activity Feed Report') . '</h2></td> </tr> </tbody> </table> <hr width="60%"></td><!-- // End Template Header \\ --> </tr>'; $msg .= '<tr><td align="center" valign="top"><!-- // Begin Template Body \\ -->' . '<table border="0" cellpadding="0" cellspacing="0" id="templateBody" width="600"><tbody><tr>' . '<td valign="top"><!-- // Begin Module: Standard Content \\ -->' . '<table border="0" cellpadding="20" cellspacing="0" width="100%"><tbody>'; $params = array(); $userRecord = X2Model::model('Profile')->findByPk($userId); $params[':username'] = $userRecord->username; $parsedFilters = Events::parseFilters($filters, $params); $visibilityCondition = $parsedFilters['conditions']['visibility']; $accessCriteria = Events::model()->getAccessCriteria(); $userCondition = $parsedFilters['conditions']['users']; $typeCondition = $parsedFilters['conditions']['types']; $subtypeCondition = $parsedFilters['conditions']['subtypes']; $condition = "type!='comment' AND (type!='action_reminder' " . "OR user=:username) AND " . "(type!='notif' OR user=:username)" . $visibilityCondition . $userCondition . $typeCondition . $subtypeCondition . ' AND (' . $accessCriteria->condition . ')'; switch ($range) { case 'daily': $timeRange = 24 * 60 * 60; break; case 'weekly': $timeRange = 7 * 24 * 60 * 60; break; case 'monthly': $timeRange = 30 * 24 * 60 * 60; break; default: $timeRange = 24 * 60 * 60; break; } $condition .= " AND timestamp BETWEEN " . (time() - $timeRange) . " AND " . time(); $topTypes = Yii::app()->db->createCommand()->select('type, COUNT(type)')->from('x2_events')->where($condition, array_merge($params, $accessCriteria->params))->group('type')->order('COUNT(type) DESC')->limit(5)->queryAll(); $topUsers = Yii::app()->db->createCommand()->select('user, COUNT(user)')->from('x2_events')->where($condition, array_merge($params, $accessCriteria->params))->group('user')->order('COUNT(user) DESC')->limit(5)->queryAll(); $msg .= "<tr><td style='text-align:center;'>"; $msg .= "<div>" . Yii::t('profile', "Here's your {range} update on what's been going on in X2Engine!", array('{range}' => Yii::t('profile', $range))) . "</div><br>" . "<div>Time Range: <em>" . Formatter::formatDateTime(time() - $timeRange) . "</em> to <em>" . Formatter::formatDateTime(time()) . "</em></div>"; $msg .= "</tr></td>"; $msg .= "<tr><td><table width='100%'><tbody>"; $msg .= "<tr><th>" . Yii::t('profile', "Top Activity") . "</th><th>" . Yii::t('profile', "Top Users") . "</th></tr>"; for ($i = 0; $i < 5; $i++) { $msg .= "<tr><td style='text-align:center;'>"; if (isset($topTypes[$i])) { $type = Events::parseType($topTypes[$i]['type']); $count = $topTypes[$i]['COUNT(type)']; $msg .= $count . " " . $type; } $msg .= "</td><td style='text-align:center;'>"; if (isset($topUsers[$i]) && $topUsers[$i]['COUNT(user)'] > 0) { $username = User::getUserLinks($topUsers[$i]['user'], false, true); $count = $topUsers[$i]['COUNT(user)']; $msg .= $count . " " . Yii::t('profile', "events from") . " " . $username . "."; } $msg .= "</td></tr>"; } $msg .= "</tbody></table></td></tr>"; $msg .= "<tr><td style='text-align:center'><hr width='60%'>"; $msg .= "<tr><td style='text-align:center;'>" . Yii::t('profile', "Here's the {limit} most recent items on the Activity Feed.", array('{limit}' => $limit)) . "</td></tr>"; $msg .= "</td></tr>"; $msg .= "<tr><td style='text-align:center'><hr width='60%'><table><tbody>"; $events = new CActiveDataProvider('Events', array('criteria' => array('condition' => $condition, 'order' => 'timestamp DESC', 'params' => array_merge($params, $accessCriteria->params)), 'pagination' => array('pageSize' => $limit))); foreach ($events->getData() as $event) { $msg .= "<tr>"; $avatar = Yii::app()->db->createCommand()->select('avatar')->from('x2_profile')->where('username=:user', array(':user' => $event->user))->queryScalar(); if (!empty($avatar) && file_exists($avatar)) { $avatar = Profile::renderAvatarImage($id, 45, 45); } else { $avatar = X2Html::x2icon('profile-large', array('class' => 'avatar-image default-avatar', 'style' => "font-size: {$dimensionLimit}px")); } $typeFile = $event->type; if (in_array($event->type, array('email_sent', 'email_opened'))) { if (in_array($event->subtype, array('quote', 'invoice'))) { $typeFile .= "_{$event->subtype}"; } } if ($event->type == 'record_create') { switch ($event->subtype) { case 'call': $typeFile = 'voip_call'; break; case 'time': $typeFile = 'log_time'; break; } } $img = $avatar; if (file_exists(Yii::app()->theme->getBasePath() . '/images/eventIcons/' . $typeFile . '.png')) { $imgFile = Yii::app()->getAbsoluteBaseUrl() . '/themes/' . Yii::app()->theme->getName() . '/images/eventIcons/' . $typeFile . '.png'; $img = CHtml::image($imgFile, '', array('style' => 'width:45px;height:45px;float:left;margin-right:5px;')); } $msg .= "<td>" . $img . "</td>"; $msg .= "<td style='text-align:left'><span class='event-text'>" . $event->getText(array('requireAbsoluteUrl' => true), array('style' => 'text-decoration:none;')) . "</span></td>"; $msg .= "</tr>"; } $msg .= "</tbody></table></td></tr>"; $msg .= "<tr><td style='text-align:center'><hr width='60%'><table><tbody>"; $msg .= Yii::t('profile', "To stop receiving this report, ") . CHtml::link(Yii::t('profile', 'click here'), Yii::app()->getAbsoluteBaseUrl() . '/index.php/profile/deleteActivityReport?id=' . $eventId . '&deleteKey=' . $deleteKey); $msg .= "</tbody></table></td></tr>"; $msg .= '</tbody></table></td></tr></tbody></table></td></tr>'; $msg .= "<tbody></table></td></tr></tbody></table></center></body></html></div>"; return $msg; }
/** * Renders the avatar image with max dimension 95x95 * @param int $id the profile id */ public static function renderFullSizeAvatar($id, $dimensionLimit = 95) { $model = Profile::model()->findByPk($id); if (isset($model->avatar) && $model->avatar != '' && file_exists($model->avatar)) { $imgSize = @getimagesize($model->avatar); if (!$imgSize) { $imgSize = array(45, 45); } $maxDimension = max($imgSize[0], $imgSize[1]); $scaleFactor = 1; if ($maxDimension > $dimensionLimit) { $scaleFactor = $dimensionLimit / $maxDimension; } $imgSize[0] = round($imgSize[0] * $scaleFactor); $imgSize[1] = round($imgSize[1] * $scaleFactor); echo '<img id="avatar-image" width="' . $imgSize[0] . '" height="' . $imgSize[1] . '" class="avatar-upload" ' . 'src="' . Yii::app()->request->baseUrl . '/' . $model->avatar . '" />'; } else { echo X2Html::x2icon('profile-large', array('class' => 'avatar-image default-avatar', 'style' => "font-size: {$dimensionLimit}px")); // echo '<img id="avatar-image" width="'.$dimensionLimit.'" height="'.$dimensionLimit.'" src='. // Yii::app()->request->baseUrl."/uploads/default.png".'>'; } }
public function getIcon() { return X2Html::x2icon('quotes'); }
* * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * X2Engine" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by X2Engine". *****************************************************************************************/ Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/css/about-page.css'); $this->layout = '//layouts/column1'; $this->pageTitle = Yii::app()->settings->appName . ' - ' . Yii::t('app', 'About'); $logo = Yii::app()->baseUrl . '/images/x2engine.png'; ?> <div id='icon-container'> <?php if (ThemeGenerator::isThemed()) { echo X2Html::x2icon('x2-logo-square', array('id' => 'x2-about-logo')); } else { echo CHtml::image($logo, ''); } ?> </div> <?php Yii::app()->clientScript->registerScript('loadJqueryVersion', "\$('#jqueryVersion').html(\$().jquery);", CClientScript::POS_READY); ?> <div class='center-column-container form left' > <b><?php echo Yii::t('app', 'Version') . " " . Yii::app()->params->version; ?> </b><br> <b><?php