@@ -101,8 +101,8 @@ app.controller('CardController', function ($scope, $rootScope, $sce, $location,
|
|||||||
var reg = /\[(X|\s|\_|\-)\]\s(.*)/ig;
|
var reg = /\[(X|\s|\_|\-)\]\s(.*)/ig;
|
||||||
var nth = 0;
|
var nth = 0;
|
||||||
$scope.status.edit.description = $scope.status.edit.description.replace(reg, function (match, i, original) {
|
$scope.status.edit.description = $scope.status.edit.description.replace(reg, function (match, i, original) {
|
||||||
|
var result = match;
|
||||||
if (nth++ === id) {
|
if (nth++ === id) {
|
||||||
var result;
|
|
||||||
if (match.match(/^\[\s\]/i)) {
|
if (match.match(/^\[\s\]/i)) {
|
||||||
result = match.replace(/\[\s\]/i, '[x]');
|
result = match.replace(/\[\s\]/i, '[x]');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
|||||||
|
|
||||||
private $cardMapper;
|
private $cardMapper;
|
||||||
private $userManager;
|
private $userManager;
|
||||||
|
private $qb;
|
||||||
|
|
||||||
public function __construct(IDBConnection $db, CardMapper $cardMapper, IUserManager $userManager) {
|
public function __construct(IDBConnection $db, CardMapper $cardMapper, IUserManager $userManager) {
|
||||||
parent::__construct($db, 'deck_attachment', Attachment::class);
|
parent::__construct($db, 'deck_attachment', Attachment::class);
|
||||||
@@ -111,21 +112,6 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
|||||||
return $entities;
|
return $entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Attachment $attachment
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
public function mapParticipant(Attachment $attachment) {
|
|
||||||
$userManager = $this->userManager;
|
|
||||||
$attachment->resolveRelation('participant', function() use (&$userManager, &$attachment) {
|
|
||||||
$user = $userManager->get($attachment->getParticipant());
|
|
||||||
if ($user !== null) {
|
|
||||||
return new User($user);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if $userId is owner of Entity with $id
|
* Check if $userId is owner of Entity with $id
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class CardService {
|
|||||||
private $permissionService;
|
private $permissionService;
|
||||||
private $boardService;
|
private $boardService;
|
||||||
private $assignedUsersMapper;
|
private $assignedUsersMapper;
|
||||||
|
private $attachmentService;
|
||||||
|
|
||||||
public function __construct(CardMapper $cardMapper, StackMapper $stackMapper, PermissionService $permissionService, BoardService $boardService, AssignedUsersMapper $assignedUsersMapper, AttachmentService $attachmentService) {
|
public function __construct(CardMapper $cardMapper, StackMapper $stackMapper, PermissionService $permissionService, BoardService $boardService, AssignedUsersMapper $assignedUsersMapper, AttachmentService $attachmentService) {
|
||||||
$this->cardMapper = $cardMapper;
|
$this->cardMapper = $cardMapper;
|
||||||
|
|||||||
Reference in New Issue
Block a user