Add Gravatar integration
This commit is contained in:
parent
b17f4b28ca
commit
01f9ee3410
|
|
@ -44,7 +44,7 @@ class Config extends Base
|
|||
$values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'subtask_forecast' => 0);
|
||||
}
|
||||
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)) {
|
||||
|
|
|
|||
|
|
@ -770,4 +770,21 @@ class Helper
|
|||
|
||||
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 notification token' => 'Jeton de sécurité du salon de discussion',
|
||||
'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.'.comment',
|
||||
User::TABLE.'.username',
|
||||
User::TABLE.'.name'
|
||||
User::TABLE.'.name',
|
||||
User::TABLE.'.email'
|
||||
)
|
||||
->join(User::TABLE, 'id', 'user_id')
|
||||
->orderBy(self::TABLE.'.date', 'ASC')
|
||||
|
|
|
|||
|
|
@ -85,18 +85,19 @@ class ProjectActivity extends Base
|
|||
->columns(
|
||||
self::TABLE.'.*',
|
||||
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)
|
||||
->join(User::TABLE, 'id', 'creator_id')
|
||||
->desc(self::TABLE.'.id')
|
||||
->limit($limit);
|
||||
|
||||
if(!is_null($start)){
|
||||
if (!is_null($start)){
|
||||
$query->gte('date_creation', $start);
|
||||
}
|
||||
|
||||
if(!is_null($end)){
|
||||
if (!is_null($end)){
|
||||
$query->lte('date_creation', $end);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@ use PDO;
|
|||
use Core\Security;
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,12 @@ use Model\Link;
|
|||
|
||||
const VERSION = 40;
|
||||
|
||||
function version_41($pdo)
|
||||
{
|
||||
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||
$rq->execute(array('integration_gravatar', '0'));
|
||||
}
|
||||
|
||||
function version_40($pdo)
|
||||
{
|
||||
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@ use Core\Security;
|
|||
use PDO;
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
|
||||
|
||||
<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>
|
||||
</p>
|
||||
|
||||
<div class="comment-inner">
|
||||
|
||||
<?php if (! isset($preview)): ?>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
<?= $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>
|
||||
<div class="listing">
|
||||
<?= $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">
|
||||
<?= e('%s commented the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s updated a comment on the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s created a subtask for the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s updated a subtask for the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?php $assignee = $task['assignee_name'] ?: $task['assignee_username'] ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s closed the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s created the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s moved the task %s to the column "%s"',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s moved the task %s to the position #%d in the column "%s"',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s opened the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?= $this->avatar($email, $author) ?>
|
||||
|
||||
<p class="activity-title">
|
||||
<?= e('%s updated the task %s',
|
||||
$this->e($author),
|
||||
|
|
|
|||
|
|
@ -62,7 +62,11 @@ hr {
|
|||
.chosen-select {
|
||||
min-height: 27px; /* Reserve some space to avoid re-layout due to chosen */
|
||||
}
|
||||
/* links */
|
||||
|
||||
.avatar {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}/* links */
|
||||
a {
|
||||
color: #3366CC;
|
||||
border: none;
|
||||
|
|
|
|||
|
|
@ -46,3 +46,8 @@ hr {
|
|||
.chosen-select {
|
||||
min-height: 27px; /* Reserve some space to avoid re-layout due to chosen */
|
||||
}
|
||||
|
||||
.avatar {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
Loading…
Reference in New Issue