@@ -26,7 +26,6 @@ namespace OCA\Deck\AppInfo;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use OC\EventDispatcher\SymfonyAdapter;
|
||||
use OC\Share20\ProviderFactory;
|
||||
use OCA\Deck\Activity\CommentEventHandler;
|
||||
use OCA\Deck\Capabilities;
|
||||
use OCA\Deck\Collaboration\Resources\ResourceProvider;
|
||||
@@ -66,7 +65,6 @@ use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Notification\IManager as NotificationManager;
|
||||
use OCP\Share\IManager;
|
||||
use OCP\Share\IProviderFactory;
|
||||
use OCP\Util;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
|
||||
@@ -34,16 +34,11 @@ use OCA\Deck\Db\ChangeHelper;
|
||||
use OCA\Deck\InvalidAttachmentType;
|
||||
use OCA\Deck\NoPermissionException;
|
||||
use OCA\Deck\NotFoundException;
|
||||
use OCA\Deck\Sharing\DeckShareProvider;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\ICache;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
use OCP\IPreview;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class AttachmentService {
|
||||
private $attachmentMapper;
|
||||
@@ -63,7 +58,7 @@ class AttachmentService {
|
||||
/** @var ChangeHelper */
|
||||
private $changeHelper;
|
||||
|
||||
public function __construct(AttachmentMapper $attachmentMapper, CardMapper $cardMapper, ChangeHelper $changeHelper, PermissionService $permissionService, Application $application, ICacheFactory $cacheFactory, $userId, IL10N $l10n, ActivityManager $activityManager, DeckShareProvider $shareProvider) {
|
||||
public function __construct(AttachmentMapper $attachmentMapper, CardMapper $cardMapper, ChangeHelper $changeHelper, PermissionService $permissionService, Application $application, ICacheFactory $cacheFactory, $userId, IL10N $l10n, ActivityManager $activityManager) {
|
||||
$this->attachmentMapper = $attachmentMapper;
|
||||
$this->cardMapper = $cardMapper;
|
||||
$this->permissionService = $permissionService;
|
||||
@@ -156,7 +151,7 @@ class AttachmentService {
|
||||
foreach (array_keys($this->services) as $attachmentType) {
|
||||
$service = $this->getService($attachmentType);
|
||||
if ($service instanceof ICustomAttachmentService) {
|
||||
$count += $service->getAttachmentCount($cardId);
|
||||
$count += $service->getAttachmentCount($cardId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +207,6 @@ class AttachmentService {
|
||||
}
|
||||
|
||||
$service->extendData($attachment);
|
||||
|
||||
} catch (InvalidAttachmentType $e) {
|
||||
// just store the data
|
||||
}
|
||||
@@ -259,7 +253,6 @@ class AttachmentService {
|
||||
} catch (\Exception $e) {
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -324,7 +324,7 @@ class BoardService {
|
||||
'PERMISSION_MANAGE' => $permissions[Acl::PERMISSION_MANAGE] ?? false,
|
||||
'PERMISSION_SHARE' => $permissions[Acl::PERMISSION_SHARE] ?? false
|
||||
]);
|
||||
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_BOARD, $new_board, ActivityManager::SUBJECT_BOARD_CREATE);
|
||||
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_BOARD, $new_board, ActivityManager::SUBJECT_BOARD_CREATE, [], $userId);
|
||||
$this->changeHelper->boardChanged($new_board->getId());
|
||||
|
||||
$this->eventDispatcher->dispatch(
|
||||
|
||||
@@ -133,7 +133,7 @@ class CardService {
|
||||
return $this->cardMapper->searchRaw($boardIds, $term, $limit, $offset);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param $cardId
|
||||
* @return \OCA\Deck\Db\RelationalEntity
|
||||
* @throws \OCA\Deck\NoPermissionException
|
||||
|
||||
@@ -40,7 +40,6 @@ use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
use OCP\IRequest;
|
||||
use OCP\Share\IManager;
|
||||
|
||||
class FileService implements IAttachmentService {
|
||||
private $l10n;
|
||||
@@ -58,8 +57,7 @@ class FileService implements IAttachmentService {
|
||||
ILogger $logger,
|
||||
IRootFolder $rootFolder,
|
||||
IConfig $config,
|
||||
AttachmentMapper $attachmentMapper,
|
||||
IManager $shareManager
|
||||
AttachmentMapper $attachmentMapper
|
||||
) {
|
||||
$this->l10n = $l10n;
|
||||
$this->appData = $appData;
|
||||
@@ -68,7 +66,6 @@ class FileService implements IAttachmentService {
|
||||
$this->rootFolder = $rootFolder;
|
||||
$this->config = $config;
|
||||
$this->attachmentMapper = $attachmentMapper;
|
||||
$this->shareManager = $shareManager;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,25 +24,17 @@
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCA\Deck\Db\AttachmentMapper;
|
||||
use OCA\Deck\Sharing\DeckShareProvider;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCA\Deck\Exceptions\ConflictException;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
use OCP\AppFramework\Http\FileDisplayResponse;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\AppFramework\Http\StreamResponse;
|
||||
use OCP\Constants;
|
||||
use OCP\Files\IAppData;
|
||||
use OCP\Files\IRootFolder;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\Files\NotPermittedException;
|
||||
use OCP\Files\SimpleFS\ISimpleFile;
|
||||
use OCP\Files\SimpleFS\ISimpleFolder;
|
||||
use OCP\IConfig;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
use OCP\IPreview;
|
||||
use OCP\IRequest;
|
||||
use OCP\Share;
|
||||
@@ -50,7 +42,6 @@ use OCP\Share\IManager;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class FilesAppService implements IAttachmentService, ICustomAttachmentService {
|
||||
|
||||
private $request;
|
||||
private $rootFolder;
|
||||
private $shareProvider;
|
||||
@@ -100,7 +91,7 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
|
||||
}, $shares);
|
||||
}
|
||||
|
||||
function getAttachmentCount(int $cardId): int {
|
||||
public function getAttachmentCount(int $cardId): int {
|
||||
/** @var IDBConnection $qb */
|
||||
$db = \OC::$server->getDatabaseConnection();
|
||||
$qb = $db->getQueryBuilder();
|
||||
@@ -247,7 +238,6 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function allowUndo() {
|
||||
|
||||
@@ -26,7 +26,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
/**
|
||||
* Interface to implement in case attachments are handled by a different backend than
|
||||
* then oc_deck_attachments table, e.g. for file sharing. When this interface is used
|
||||
@@ -34,9 +33,7 @@ namespace OCA\Deck\Service;
|
||||
* table and it is up to the implementation to track attachment to card relation.
|
||||
*/
|
||||
interface ICustomAttachmentService {
|
||||
|
||||
public function listAttachments(int $cardId): array;
|
||||
|
||||
public function getAttachmentCount(int $cardId): int;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Sharing;
|
||||
|
||||
|
||||
use OC\Files\Cache\Cache;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\Board;
|
||||
@@ -60,7 +59,6 @@ interface IShareProviderBackend {
|
||||
}
|
||||
|
||||
class DeckShareProvider implements \OCP\Share\IShareProvider {
|
||||
|
||||
public const DECK_FOLDER = '/Deck';
|
||||
public const DECK_FOLDER_PLACEHOLDER = '/{DECK_PLACEHOLDER}';
|
||||
|
||||
@@ -117,7 +115,7 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
|
||||
try {
|
||||
$board = $this->boardMapper->find($boardId);
|
||||
$valid &= !$board->getArchived();
|
||||
} catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
|
||||
} catch (DoesNotExistException | MultipleObjectsReturnedException $e) {
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
@@ -901,7 +899,7 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
|
||||
|
||||
$types = [IShare::TYPE_DECK];
|
||||
if ($currentAccess) {
|
||||
$types[] = self::SHARE_TYPE_DECK_USER;
|
||||
$types[] = self::SHARE_TYPE_DECK_USER;
|
||||
}
|
||||
|
||||
$qb->select('id', 'parent', 'share_type', 'share_with', 'file_source', 'file_target', 'permissions')
|
||||
|
||||
@@ -26,7 +26,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Sharing;
|
||||
|
||||
|
||||
use OC\Files\Filesystem;
|
||||
use OCA\Deck\Service\ConfigService;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
|
||||
@@ -26,7 +26,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Sharing;
|
||||
|
||||
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\NoPermissionException;
|
||||
@@ -37,7 +36,6 @@ use OCP\IURLGenerator;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class ShareAPIHelper {
|
||||
|
||||
private $urlGenerator;
|
||||
private $timeFactory;
|
||||
private $cardMapper;
|
||||
|
||||
Reference in New Issue
Block a user