Add Gravatar integration
This commit is contained in:
@@ -44,7 +44,7 @@ class Config extends Base
|
|||||||
$values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'subtask_forecast' => 0);
|
$values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'subtask_forecast' => 0);
|
||||||
}
|
}
|
||||||
else if ($redirect === 'integrations') {
|
else if ($redirect === 'integrations') {
|
||||||
$values += array('integration_slack_webhook' => 0, 'integration_hipchat' => 0);
|
$values += array('integration_slack_webhook' => 0, 'integration_hipchat' => 0, 'integration_gravatar' => 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->config->save($values)) {
|
if ($this->config->save($values)) {
|
||||||
|
|||||||
@@ -770,4 +770,21 @@ class Helper
|
|||||||
|
|
||||||
return 'fa-file-o';
|
return 'fa-file-o';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display gravatar image
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $email
|
||||||
|
* @param string $alt
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function avatar($email, $alt = '')
|
||||||
|
{
|
||||||
|
if (! empty($email) && $this->config->get('integration_gravatar') == 1) {
|
||||||
|
return '<img class="avatar" src="https://www.gravatar.com/avatar/'.md5(strtolower($email)).'?s=25" alt="'.$this->e($alt).'" title="'.$this->e($alt).'">';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -834,4 +834,5 @@ return array(
|
|||||||
'Room API ID or name' => 'Nom ou identifiant du salon de discussion',
|
'Room API ID or name' => 'Nom ou identifiant du salon de discussion',
|
||||||
'Room notification token' => 'Jeton de sécurité du salon de discussion',
|
'Room notification token' => 'Jeton de sécurité du salon de discussion',
|
||||||
'Help on Hipchat integration' => 'Aide sur l\'intégration avec Hipchat',
|
'Help on Hipchat integration' => 'Aide sur l\'intégration avec Hipchat',
|
||||||
|
'Enable Gravatar images' => 'Activer les images Gravatar',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ class Comment extends Base
|
|||||||
self::TABLE.'.user_id',
|
self::TABLE.'.user_id',
|
||||||
self::TABLE.'.comment',
|
self::TABLE.'.comment',
|
||||||
User::TABLE.'.username',
|
User::TABLE.'.username',
|
||||||
User::TABLE.'.name'
|
User::TABLE.'.name',
|
||||||
|
User::TABLE.'.email'
|
||||||
)
|
)
|
||||||
->join(User::TABLE, 'id', 'user_id')
|
->join(User::TABLE, 'id', 'user_id')
|
||||||
->orderBy(self::TABLE.'.date', 'ASC')
|
->orderBy(self::TABLE.'.date', 'ASC')
|
||||||
|
|||||||
@@ -85,18 +85,19 @@ class ProjectActivity extends Base
|
|||||||
->columns(
|
->columns(
|
||||||
self::TABLE.'.*',
|
self::TABLE.'.*',
|
||||||
User::TABLE.'.username AS author_username',
|
User::TABLE.'.username AS author_username',
|
||||||
User::TABLE.'.name AS author_name'
|
User::TABLE.'.name AS author_name',
|
||||||
|
User::TABLE.'.email'
|
||||||
)
|
)
|
||||||
->in('project_id', $project_ids)
|
->in('project_id', $project_ids)
|
||||||
->join(User::TABLE, 'id', 'creator_id')
|
->join(User::TABLE, 'id', 'creator_id')
|
||||||
->desc(self::TABLE.'.id')
|
->desc(self::TABLE.'.id')
|
||||||
->limit($limit);
|
->limit($limit);
|
||||||
|
|
||||||
if(!is_null($start)){
|
if (!is_null($start)){
|
||||||
$query->gte('date_creation', $start);
|
$query->gte('date_creation', $start);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_null($end)){
|
if (!is_null($end)){
|
||||||
$query->lte('date_creation', $end);
|
$query->lte('date_creation', $end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ use PDO;
|
|||||||
use Core\Security;
|
use Core\Security;
|
||||||
use Model\Link;
|
use Model\Link;
|
||||||
|
|
||||||
const VERSION = 59;
|
const VERSION = 60;
|
||||||
|
|
||||||
|
function version_60($pdo)
|
||||||
|
{
|
||||||
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
$rq->execute(array('integration_gravatar', '0'));
|
||||||
|
}
|
||||||
|
|
||||||
function version_59($pdo)
|
function version_59($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ use Model\Link;
|
|||||||
|
|
||||||
const VERSION = 40;
|
const VERSION = 40;
|
||||||
|
|
||||||
|
function version_41($pdo)
|
||||||
|
{
|
||||||
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
$rq->execute(array('integration_gravatar', '0'));
|
||||||
|
}
|
||||||
|
|
||||||
function version_40($pdo)
|
function version_40($pdo)
|
||||||
{
|
{
|
||||||
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ use Core\Security;
|
|||||||
use PDO;
|
use PDO;
|
||||||
use Model\Link;
|
use Model\Link;
|
||||||
|
|
||||||
const VERSION = 58;
|
const VERSION = 59;
|
||||||
|
|
||||||
|
function version_59($pdo)
|
||||||
|
{
|
||||||
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
$rq->execute(array('integration_gravatar', '0'));
|
||||||
|
}
|
||||||
|
|
||||||
function version_58($pdo)
|
function version_58($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
|
<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
|
||||||
|
|
||||||
<p class="comment-title">
|
<p class="comment-title">
|
||||||
|
<?php if (! empty($comment['email'])): ?>
|
||||||
|
<?= $this->avatar($comment['email'], $comment['name'] ?: $comment['username']) ?>
|
||||||
|
<?php endif ?>
|
||||||
<span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date']) ?></span>
|
<span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date']) ?></span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="comment-inner">
|
<div class="comment-inner">
|
||||||
|
|
||||||
<?php if (! isset($preview)): ?>
|
<?php if (! isset($preview)): ?>
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
<?= $this->formCsrf() ?>
|
<?= $this->formCsrf() ?>
|
||||||
|
|
||||||
|
<h3><?= t('Gravatar') ?></h3>
|
||||||
|
<div class="listing">
|
||||||
|
<?= $this->formCheckbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h3><img src="assets/img/hipchat-icon.png"/> <?= t('Hipchat') ?></h3>
|
<h3><img src="assets/img/hipchat-icon.png"/> <?= t('Hipchat') ?></h3>
|
||||||
<div class="listing">
|
<div class="listing">
|
||||||
<?= $this->formCheckbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?>
|
<?= $this->formCheckbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s commented the task %s',
|
<?= e('%s commented the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s updated a comment on the task %s',
|
<?= e('%s updated a comment on the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s created a subtask for the task %s',
|
<?= e('%s created a subtask for the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s updated a subtask for the task %s',
|
<?= e('%s updated a subtask for the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?php $assignee = $task['assignee_name'] ?: $task['assignee_username'] ?>
|
<?php $assignee = $task['assignee_name'] ?: $task['assignee_username'] ?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s closed the task %s',
|
<?= e('%s closed the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s created the task %s',
|
<?= e('%s created the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s moved the task %s to the column "%s"',
|
<?= e('%s moved the task %s to the column "%s"',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s moved the task %s to the position #%d in the column "%s"',
|
<?= e('%s moved the task %s to the position #%d in the column "%s"',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s opened the task %s',
|
<?= e('%s opened the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?= $this->avatar($email, $author) ?>
|
||||||
|
|
||||||
<p class="activity-title">
|
<p class="activity-title">
|
||||||
<?= e('%s updated the task %s',
|
<?= e('%s updated the task %s',
|
||||||
$this->e($author),
|
$this->e($author),
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ hr {
|
|||||||
.chosen-select {
|
.chosen-select {
|
||||||
min-height: 27px; /* Reserve some space to avoid re-layout due to chosen */
|
min-height: 27px; /* Reserve some space to avoid re-layout due to chosen */
|
||||||
}
|
}
|
||||||
/* links */
|
|
||||||
|
.avatar {
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}/* links */
|
||||||
a {
|
a {
|
||||||
color: #3366CC;
|
color: #3366CC;
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@@ -46,3 +46,8 @@ hr {
|
|||||||
.chosen-select {
|
.chosen-select {
|
||||||
min-height: 27px; /* Reserve some space to avoid re-layout due to chosen */
|
min-height: 27px; /* Reserve some space to avoid re-layout due to chosen */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user