AmosEen.php 4.68 KB
Newer Older
Daniele Draganti's avatar
Daniele Draganti committed
1
2
<?php

Daniele Draganti's avatar
Daniele Draganti committed
3
namespace arter\amos\een;
Daniele Draganti's avatar
Daniele Draganti committed
4

Daniele Draganti's avatar
Daniele Draganti committed
5
6
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface;
Daniele Draganti's avatar
Daniele Draganti committed
7
8
use yii\console\Application;
use yii\helpers\FileHelper;
Daniele Draganti's avatar
Daniele Draganti committed
9
use arter\amos\core\interfaces\SearchModuleInterface;
Daniele Draganti's avatar
Daniele Draganti committed
10
11
12

/**
 * Class AmosEen
Daniele Draganti's avatar
Daniele Draganti committed
13
 * @package arter\amos\een
Daniele Draganti's avatar
Daniele Draganti committed
14
15
16
17
18
19
20
21
 */
class AmosEen extends AmosModule implements ModuleInterface, SearchModuleInterface
{
    const MAX_LAST_PARTNERSHIP_ON_DASHBOARD = 3;

    /**
     * @inheritdoc
     */
Daniele Draganti's avatar
Daniele Draganti committed
22
    public $controllerNamespace       = 'arter\amos\een\controllers';
Daniele Draganti's avatar
Daniele Draganti committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    public $name                      = 'een';
    public $wsdl                      = null; //'http://een.ec.europa.eu/tools/services/podv6/QueryService.svc?wsdl';
    public $findAllAccessPoint        = null; //'GetProfilesSOAP';
    public $findAllAccessPointRequest = null;
    public $mailToSendInterest        = null;

    /**
     *
     * @var array
     */
    public $tagsEenEnabled = ['makets', 'tecnologies', 'naces'];

    /**
     *
     * @var array
     */
    public $book_ids       = ['markets' => 1,
        'tecnologies' => 16,
        'naces' => 4];

    /**
     * Root id for the platform TAG
     * @var integer
     */
    public $root_id = 3;

    /**
     *
     * @var type
     */
    public $enableCreateEen = true;

    /**
     *
     * @var boolean
     */
    public $enableConversionTag = false;

    /**
     * @var array
     */
    public $viewPathEmailContentSubtitle = [
Daniele Draganti's avatar
Daniele Draganti committed
65
        'arter\amos\een\models\EenPartnershipProposal' => '@vendor/arter/amos-proposte-collaborazione-een/src/views/email/notify_email_content'
Daniele Draganti's avatar
Daniele Draganti committed
66
67
68
69
70
71
    ];

    /**
     * @var array
     */
    public $viewPathEmailSummary        = [
Daniele Draganti's avatar
Daniele Draganti committed
72
        'arter\amos\een\models\EenPartnershipProposal' => '@vendor/arter/amos-proposte-collaborazione-een/src/views/email/notify_summary'
Daniele Draganti's avatar
Daniele Draganti committed
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    ];
    public $viewPathEmailSummaryNetwork = [];

    /**
     * @return string
     */
    public static function getModuleName()
    {
        return 'een';
    }

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();

Daniele Draganti's avatar
Daniele Draganti committed
91
        \Yii::setAlias('@arter/amos/'.static::getModuleName().'/commands/controllers',
Daniele Draganti's avatar
Daniele Draganti committed
92
93
94
95
96
            __DIR__.'/commands/controllers');
        // custom initialization code goes here
        \Yii::configure($this, require(__DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'));

        if (\Yii::$app instanceof Application) {
Daniele Draganti's avatar
Daniele Draganti committed
97
            $this->controllerNamespace = 'arter\amos\een\commands\controllers';
Daniele Draganti's avatar
Daniele Draganti committed
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
            if (!defined('LOG_DIR')) {
                define('LOG_DIR',
                    \Yii::getAlias("@runtime").DIRECTORY_SEPARATOR."een".DIRECTORY_SEPARATOR."calls".DIRECTORY_SEPARATOR);
            }
            FileHelper::createDirectory(LOG_DIR, 0777);
        }
    }

    /**
     * @inheritdoc
     */
    public function getWidgetGraphics()
    {
        return null;
    }

    /**
     * @inheritdoc
     */
    public function getWidgetIcons()
    {
        return [
Daniele Draganti's avatar
Daniele Draganti committed
120
121
122
123
            \arter\amos\een\widgets\icons\WidgetIconEenDashboard::className(),
            \arter\amos\een\widgets\icons\WidgetIconEen::className(),
            \arter\amos\een\widgets\icons\WidgetIconEenAll::className(),
            \arter\amos\een\widgets\icons\WidgetIconEenArchived::className()
Daniele Draganti's avatar
Daniele Draganti committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
        ];
    }

    /**
     * @inheritdoc
     */
    protected function getDefaultModels()
    {
         return [
            'EenPartnershipProposal' => __NAMESPACE__.'\\'.'models\EenPartnershipProposal',
            'EenExprOfInterest' => __NAMESPACE__.'\\'.'models\EenExprOfInterest',
            'EenNetworkNode' => __NAMESPACE__.'\\'.'models\EenNetworkNode',
            'EenStaff' => __NAMESPACE__.'\\'.'models\EenStaff',
            'EenTagEen' => __NAMESPACE__.'\\'.'models\EenTagEen',
            'EenTagS3TagEenMm' => __NAMESPACE__.'\\'.'models\EenTagS3TagEenMm',
            'InfoReqModel' => __NAMESPACE__.'\\'.'models\InfoReqModel',
            'ProposalForm' => __NAMESPACE__.'\\'.'models\ProposalForm',
            'EenExprOfInterestHistory' => __NAMESPACE__.'\\'.'models\EenExprOfInterestHistory',
            'EenExprOfInterestSearch' => __NAMESPACE__.'\\'.'models\search\EenExprOfInterestSearch',
            'EenPartnershipProposalSearch' => __NAMESPACE__.'\\'.'models\search\EenPartnershipProposalSearch',
            'EenTagEenSearch' => __NAMESPACE__.'\\'.'models\search\EenTagEenSearch',
            'EenTagS3TagEenMmSearch' => __NAMESPACE__.'\\'.'models\search\EenTagS3TagEenMmSearch',
        ];
    }

    /**
     * @inheritdoc
     */
    public static function getModelSearchClassName()
    {
        return AmosEen::instance()->model('NewsSearch');
    }

    /**
     * @inheritdoc
     */
    public static function getModuleIconName()
    {
        return 'proposte-een';
    }
}