appio-digital/redmine-passage-nette

This package is abandoned and no longer maintained. No replacement package was suggested.

Integration Redmine Passage for Nette Framework

v1.2.0 2018-06-25 12:48 UTC

This package is not auto-updated.

Last update: 2022-12-10 17:24:33 UTC


README

Build Status Coverage Status

Installation

The best way to install AppioDigital/RedminePassageNette is using Composer:

$ composer require appio-digital/redmine-passage-nette

Required classes

This extension need find two implementation of interfaces:

  • Appio\RedmineNette\Security\RedmineResourceProviderInterface: for get api key resource
  • Appio\RedmineNette\Security\RedmineResourceKeyInterface: for get api key

Example class LoggedUserProvider implementing Appio\RedmineNette\Security\RedmineResourceProviderInterface

class LoggedUserProvider implements RedmineResourceProviderInterface
{
    /** @var UserRepo */
    private $userRepository;

    /** @var User */
    private $netteUser;

    /**
     * @param UserRepo $userRepository
     * @param User $netteUser
     */
    public function __construct(UserRepo $userRepository, User $netteUser)
    {
        $this->userRepository = $userRepository;
        $this->netteUser = $netteUser;
    }

    /**
     * @return RedmineResourceKeyInterface|null
     */
    public function getResource(): ?RedmineResourceKeyInterface
    {
        return $this->userRepository->find($this->netteUser->getId());
    }
}

Example class User implementing Appio\RedmineNette\Security\RedmineResourceKeyInterface

class User implements RedmineResourceKeyInterface
{
    /**
     * @var string
     * @ORM\Column(type="string", nullable=true, unique=true)
     */
    private $redmineApiKey;

    /**
     * @return string
     */
    public function getRedmineApiKey(): string
    {
        return $this->redmineApiKey ?? '';
    }
}

Configuration

Minimal configuration

extensions:
    httplug: FreezyBee\Httplug\DI\HttplugExtension
    redmine: Appio\RedmineNette\DI\RedmineExtension


redmine:
    baseUri: 'https://your.redmine.com/api'

Full configuration

redmine:
    baseUri: 'https://your.redmine.com/api'
    defaultProjectId: 10
    defaults:

        # default setting - merged to all another
        default:
            assignedToId: 50 # Project manager
            trackerId: 2 # Feature
            statusId: 1 # New
            params:
                some_filter_param: 1
            customFields:
                # some hidden custom field
                3:
                    type: hidden
                    defaultValue: 1

        # defaults for project with id 1
        1:
            assignedToId: 1 # Super project manager
            customFields:
                # text
                4:
                    type: text
                    label: Custom
                    defaultValue: hello
                    disabledAction: add # input disabled - choices "add,edit,all" default false
                # checkbox
                15:
                    type: checkbox
                    label: Custom
                    defaultValue: hello