Commit 26726891d9129eae0127e972b6f1291b4215545d
Merge remote-tracking branch 'origin/master'
Showing
234 changed files
with
339 additions
and
423 deletions
Show diff stats
No preview for this file type
console/migrations/m161226_102102_user_data.php
100644 → 100755
console/migrations/m161226_103451_user_passport.php
100644 → 100755
console/migrations/m161226_104633_intellectual_property.php
100644 → 100755
console/migrations/m161226_105932_creative_role.php
100644 → 100755
console/migrations/m161227_115146_add_columns_to_int_property_table.php
100644 → 100755
console/migrations/m161227_163047_alter_columns.php
100644 → 100755
environments/dev/backend/config/main-local.php
100644 → 100755
environments/dev/backend/config/params-local.php
100644 → 100755
environments/dev/backend/config/test-local.php
100644 → 100755
environments/dev/common/config/params-local.php
100644 → 100755
environments/dev/console/config/main-local.php
100644 → 100755
environments/dev/console/config/params-local.php
100644 → 100755
environments/dev/frontend/config/main-local.php
100644 → 100755
environments/dev/frontend/config/params-local.php
100644 → 100755
environments/dev/frontend/config/test-local.php
100644 → 100755
environments/prod/backend/config/main-local.php
100644 → 100755
environments/prod/backend/config/params-local.php
100644 → 100755
environments/prod/common/config/main-local.php
100644 → 100755
environments/prod/common/config/params-local.php
100644 → 100755
environments/prod/console/config/main-local.php
100644 → 100755
environments/prod/console/config/params-local.php
100644 → 100755
environments/prod/frontend/config/main-local.php
100644 → 100755
environments/prod/frontend/config/params-local.php
100644 → 100755
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | namespace frontend\controllers; | 2 | namespace frontend\controllers; |
3 | 3 | ||
4 | use common\models\User; | 4 | use common\models\User; |
5 | + use frontend\models\CreativeRole; | ||
5 | use frontend\models\IntellectualProperty; | 6 | use frontend\models\IntellectualProperty; |
6 | use frontend\models\UserData; | 7 | use frontend\models\UserData; |
7 | use frontend\models\UserPassport; | 8 | use frontend\models\UserPassport; |
@@ -70,7 +71,7 @@ | @@ -70,7 +71,7 @@ | ||
70 | ); | 71 | ); |
71 | } | 72 | } |
72 | 73 | ||
73 | - public function actionSales($id = null) | 74 | + public function actionSales($id = NULL) |
74 | { | 75 | { |
75 | $newRecord = false; | 76 | $newRecord = false; |
76 | if ($id) { | 77 | if ($id) { |
@@ -80,8 +81,13 @@ | @@ -80,8 +81,13 @@ | ||
80 | $newRecord = true; | 81 | $newRecord = true; |
81 | } | 82 | } |
82 | if ($property->load(\Yii::$app->request->post()) && $property->save()) { | 83 | if ($property->load(\Yii::$app->request->post()) && $property->save()) { |
83 | - if($newRecord) { | ||
84 | - return $this->redirect(['cabinet/sales', 'id' => $property->id]); | 84 | + if ($newRecord) { |
85 | + return $this->redirect( | ||
86 | + [ | ||
87 | + 'cabinet/sales', | ||
88 | + 'id' => $property->id, | ||
89 | + ] | ||
90 | + ); | ||
85 | } else { | 91 | } else { |
86 | $response = \Yii::$app->response; | 92 | $response = \Yii::$app->response; |
87 | $response->format = $response::FORMAT_JSON; | 93 | $response->format = $response::FORMAT_JSON; |
@@ -91,29 +97,51 @@ | @@ -91,29 +97,51 @@ | ||
91 | ]; | 97 | ]; |
92 | } | 98 | } |
93 | } | 99 | } |
100 | + | ||
101 | + $table = CreativeRole::find() | ||
102 | + ->where( | ||
103 | + [ | ||
104 | + 'intellectual_property_id' => $id, | ||
105 | + ] | ||
106 | + ) | ||
107 | + ->all(); | ||
108 | + | ||
94 | return $this->render( | 109 | return $this->render( |
95 | 'sales', | 110 | 'sales', |
96 | [ | 111 | [ |
97 | 'property' => $property, | 112 | 'property' => $property, |
113 | + 'table' => $table, | ||
98 | ] | 114 | ] |
99 | ); | 115 | ); |
100 | } | 116 | } |
101 | 117 | ||
102 | public function actionList() | 118 | public function actionList() |
103 | { | 119 | { |
104 | - return $this->render('list'); | 120 | + $table = IntellectualProperty::find() |
121 | + ->where( | ||
122 | + [ | ||
123 | + 'user_id' => \Yii::$app->user->identity->id, | ||
124 | + ] | ||
125 | + ) | ||
126 | + ->all(); | ||
127 | + return $this->render( | ||
128 | + 'list', | ||
129 | + [ | ||
130 | + 'table' => $table, | ||
131 | + ] | ||
132 | + ); | ||
105 | } | 133 | } |
106 | 134 | ||
107 | public function actionArrivals() | 135 | public function actionArrivals() |
108 | { | 136 | { |
109 | return $this->render('arrivals'); | 137 | return $this->render('arrivals'); |
110 | } | 138 | } |
111 | - | 139 | + |
112 | public function actionNotifications() | 140 | public function actionNotifications() |
113 | { | 141 | { |
114 | return $this->render('notifications'); | 142 | return $this->render('notifications'); |
115 | } | 143 | } |
116 | - | 144 | + |
117 | public function actionUsers() | 145 | public function actionUsers() |
118 | { | 146 | { |
119 | return $this->render('users'); | 147 | return $this->render('users'); |
@@ -193,11 +221,86 @@ | @@ -193,11 +221,86 @@ | ||
193 | ]; | 221 | ]; |
194 | } | 222 | } |
195 | } | 223 | } |
224 | + | ||
225 | + public function actionDeleteIntProperty() | ||
226 | + { | ||
227 | + $request = \Yii::$app->request; | ||
228 | + $response = \Yii::$app->response; | ||
229 | + $response->format = $response::FORMAT_JSON; | ||
230 | + | ||
231 | + if (!empty($request->post('id'))) { | ||
232 | + $role = IntellectualProperty::findOne($request->post('id')); | ||
233 | + if ($role->delete()) { | ||
234 | + return [ | ||
235 | + 'success' => true, | ||
236 | + 'message' => 'Данные успешно удалены', | ||
237 | + ]; | ||
238 | + } else { | ||
239 | + return [ | ||
240 | + 'error' => true, | ||
241 | + 'message' => 'Ошибка удаления данных', | ||
242 | + ]; | ||
243 | + } | ||
244 | + } else { | ||
245 | + return [ | ||
246 | + 'error' => true, | ||
247 | + 'message' => 'Элемент не найден', | ||
248 | + ]; | ||
249 | + } | ||
250 | + } | ||
251 | + | ||
252 | + public function actionAddRole() | ||
253 | + { | ||
254 | + $request = \Yii::$app->request; | ||
255 | + $response = \Yii::$app->response; | ||
256 | + $response->format = $response::FORMAT_JSON; | ||
257 | + | ||
258 | + $role = new CreativeRole(); | ||
259 | + | ||
260 | + if ($role->load($request->post()) && $role->save()) { | ||
261 | + return [ | ||
262 | + 'success' => true, | ||
263 | + 'message' => 'Данные успешно сохранены', | ||
264 | + ]; | ||
265 | + } else { | ||
266 | + return [ | ||
267 | + 'error' => true, | ||
268 | + 'message' => 'Ошибка сохранения данных', | ||
269 | + ]; | ||
270 | + } | ||
271 | + } | ||
272 | + | ||
273 | + public function actionDeleteRole() | ||
274 | + { | ||
275 | + $request = \Yii::$app->request; | ||
276 | + $response = \Yii::$app->response; | ||
277 | + $response->format = $response::FORMAT_JSON; | ||
278 | + | ||
279 | + if (!empty($request->post('id'))) { | ||
280 | + $role = CreativeRole::findOne($request->post('id')); | ||
281 | + if ($role->delete()) { | ||
282 | + return [ | ||
283 | + 'success' => true, | ||
284 | + 'message' => 'Данные успешно удалены', | ||
285 | + ]; | ||
286 | + } else { | ||
287 | + return [ | ||
288 | + 'error' => true, | ||
289 | + 'message' => 'Ошибка удаления данных', | ||
290 | + ]; | ||
291 | + } | ||
292 | + } else { | ||
293 | + return [ | ||
294 | + 'error' => true, | ||
295 | + 'message' => 'Роль не найдена', | ||
296 | + ]; | ||
297 | + } | ||
298 | + } | ||
196 | 299 | ||
197 | public function findProperty($id) | 300 | public function findProperty($id) |
198 | { | 301 | { |
199 | $model = IntellectualProperty::findOne($id); | 302 | $model = IntellectualProperty::findOne($id); |
200 | - if (empty( $model )) { | 303 | + if (empty($model)) { |
201 | throw new NotFoundHttpException(); | 304 | throw new NotFoundHttpException(); |
202 | } | 305 | } |
203 | return $model; | 306 | return $model; |
1 | <?php | 1 | <?php |
2 | - | ||
3 | -namespace frontend\models; | ||
4 | - | ||
5 | -/** | ||
6 | - * This is the model class for table "creative_role". | ||
7 | - * | ||
8 | - * @property integer $id | ||
9 | - * @property integer $intellectual_property_id | ||
10 | - * @property string $title | ||
11 | - * @property string $name | ||
12 | - * @property double $part | ||
13 | - * @property string $code | ||
14 | - * @property string $iri | ||
15 | - * @property string $society | ||
16 | - * | ||
17 | - * @property IntellectualProperty $intellectualProperty | ||
18 | - */ | ||
19 | -class CreativeRole extends \yii\db\ActiveRecord | ||
20 | -{ | 2 | + |
3 | + namespace frontend\models; | ||
4 | + | ||
21 | /** | 5 | /** |
22 | - * @inheritdoc | 6 | + * This is the model class for table "creative_role". |
7 | + * | ||
8 | + * @property integer $id | ||
9 | + * @property integer $intellectual_property_id | ||
10 | + * @property string $title | ||
11 | + * @property string $name | ||
12 | + * @property double $part | ||
13 | + * @property string $code | ||
14 | + * @property string $iri | ||
15 | + * @property string $society | ||
16 | + * @property IntellectualProperty $intellectualProperty | ||
23 | */ | 17 | */ |
24 | - public static function tableName() | 18 | + class CreativeRole extends \yii\db\ActiveRecord |
25 | { | 19 | { |
26 | - return 'creative_role'; | 20 | + /** |
21 | + * @inheritdoc | ||
22 | + */ | ||
23 | + public static function tableName() | ||
24 | + { | ||
25 | + return 'creative_role'; | ||
26 | + } | ||
27 | + | ||
28 | + /** | ||
29 | + * @inheritdoc | ||
30 | + */ | ||
31 | + public function rules() | ||
32 | + { | ||
33 | + return [ | ||
34 | + [ | ||
35 | + [ 'intellectual_property_id' ], | ||
36 | + 'integer', | ||
37 | + ], | ||
38 | + [ | ||
39 | + [ 'part' ], | ||
40 | + 'number', | ||
41 | + ], | ||
42 | + [ | ||
43 | + [ | ||
44 | + 'title', | ||
45 | + 'name', | ||
46 | + 'code', | ||
47 | + 'iri', | ||
48 | + 'society', | ||
49 | + ], | ||
50 | + 'string', | ||
51 | + 'max' => 255, | ||
52 | + ], | ||
53 | + [ | ||
54 | + [ 'intellectual_property_id' ], | ||
55 | + 'exist', | ||
56 | + 'skipOnError' => true, | ||
57 | + 'targetClass' => IntellectualProperty::className(), | ||
58 | + 'targetAttribute' => [ 'intellectual_property_id' => 'id' ], | ||
59 | + ], | ||
60 | + ]; | ||
61 | + } | ||
62 | + | ||
63 | + /** | ||
64 | + * @inheritdoc | ||
65 | + */ | ||
66 | + public function attributeLabels() | ||
67 | + { | ||
68 | + return [ | ||
69 | + 'id' => 'ID', | ||
70 | + 'intellectual_property_id' => 'Intellectual Property ID', | ||
71 | + 'title' => 'Творча роль', | ||
72 | + 'name' => 'ПІБ', | ||
73 | + 'part' => 'Доля %', | ||
74 | + 'code' => 'Код', | ||
75 | + 'iri' => 'IPI', | ||
76 | + 'society' => 'Товариство', | ||
77 | + ]; | ||
78 | + } | ||
79 | + | ||
80 | + /** | ||
81 | + * @return \yii\db\ActiveQuery | ||
82 | + */ | ||
83 | + public function getIntellectualProperty() | ||
84 | + { | ||
85 | + return $this->hasOne(IntellectualProperty::className(), [ 'id' => 'intellectual_property_id' ]); | ||
86 | + } | ||
27 | } | 87 | } |
28 | - | ||
29 | - /** | ||
30 | - * @inheritdoc | ||
31 | - */ | ||
32 | - public function rules() | ||
33 | - { | ||
34 | - return [ | ||
35 | - [['intellectual_property_id'], 'integer'], | ||
36 | - [['part'], 'number'], | ||
37 | - [['title', 'name', 'code', 'iri', 'society'], 'string', 'max' => 255], | ||
38 | - [['intellectual_property_id'], 'exist', 'skipOnError' => true, 'targetClass' => IntellectualProperty::className(), 'targetAttribute' => ['intellectual_property_id' => 'id']], | ||
39 | - ]; | ||
40 | - } | ||
41 | - | ||
42 | - /** | ||
43 | - * @inheritdoc | ||
44 | - */ | ||
45 | - public function attributeLabels() | ||
46 | - { | ||
47 | - return [ | ||
48 | - 'id' => 'ID', | ||
49 | - 'intellectual_property_id' => 'Intellectual Property ID', | ||
50 | - 'title' => 'Title', | ||
51 | - 'name' => 'Name', | ||
52 | - 'part' => 'Part', | ||
53 | - 'code' => 'Code', | ||
54 | - 'iri' => 'Iri', | ||
55 | - 'society' => 'Society', | ||
56 | - ]; | ||
57 | - } | ||
58 | - | ||
59 | - /** | ||
60 | - * @return \yii\db\ActiveQuery | ||
61 | - */ | ||
62 | - public function getIntellectualProperty() | ||
63 | - { | ||
64 | - return $this->hasOne(IntellectualProperty::className(), ['id' => 'intellectual_property_id']); | ||
65 | - } | ||
66 | -} |
frontend/tests/unit/models/ContactFormTest.php
100644 → 100755
frontend/tests/unit/models/PasswordResetRequestFormTest.php
100644 → 100755
frontend/tests/unit/models/ResetPasswordFormTest.php
100644 → 100755
1 | <?php | 1 | <?php |
2 | + use frontend\models\IntellectualProperty; | ||
3 | + use yii\helpers\Url; | ||
2 | use yii\web\View; | 4 | use yii\web\View; |
3 | use yii\widgets\ActiveForm; | 5 | use yii\widgets\ActiveForm; |
4 | use yii\widgets\Pjax; | 6 | use yii\widgets\Pjax; |
5 | 7 | ||
6 | /** | 8 | /** |
7 | - * @var View $this | 9 | + * @var View $this |
10 | + * @var IntellectualProperty[] $table | ||
8 | */ | 11 | */ |
9 | ?> | 12 | ?> |
10 | <div class="style cab_content_list"> | 13 | <div class="style cab_content_list"> |
11 | - <div class="cab_content_list-dropdown"> | ||
12 | - <div class="title_forms">Список ОІВ</div> | ||
13 | - <div class="style table-forms-wrapp"> | ||
14 | - <table class="table-1 table-2" cellpadding="0" cellspacing="0" border="0"> | ||
15 | - <tr> | ||
16 | - <td style="width: 213px;">Назва</td> | ||
17 | - <td style="width: 108px;">Дата створення</td> | ||
18 | - <td>Шифр</td> | ||
19 | - <td>Жанр</td> | ||
20 | - <td style="width: 107px;">Дата реєстрації</td> | ||
21 | - <td>Договір</td> | ||
22 | - <td>Тип</td> | ||
23 | - <td class="refactor-td"></td> | ||
24 | - </tr> | ||
25 | - <tr> | ||
26 | - <td>Нью-Йорк</td> | ||
27 | - <td>03.03.2003</td> | ||
28 | - <td>01P22112016</td> | ||
29 | - <td>пісня</td> | ||
30 | - <td>22.11.2016</td> | ||
31 | - <td>договір</td> | ||
32 | - <td>мала форма</td> | ||
33 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
34 | - </tr> | ||
35 | - <tr> | ||
36 | - <td></td> | ||
37 | - <td></td> | ||
38 | - <td></td> | ||
39 | - <td></td> | ||
40 | - <td></td> | ||
41 | - <td></td> | ||
42 | - <td></td> | ||
43 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
44 | - </tr> | ||
45 | - <tr> | ||
46 | - <td></td> | ||
47 | - <td></td> | ||
48 | - <td></td> | ||
49 | - <td></td> | ||
50 | - <td></td> | ||
51 | - <td></td> | ||
52 | - <td></td> | ||
53 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
54 | - </tr> | ||
55 | - <tr> | ||
56 | - <td></td> | ||
57 | - <td></td> | ||
58 | - <td></td> | ||
59 | - <td></td> | ||
60 | - <td></td> | ||
61 | - <td></td> | ||
62 | - <td></td> | ||
63 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
64 | - </tr> | ||
65 | - <tr> | ||
66 | - <td></td> | ||
67 | - <td></td> | ||
68 | - <td></td> | ||
69 | - <td></td> | ||
70 | - <td></td> | ||
71 | - <td></td> | ||
72 | - <td></td> | ||
73 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
74 | - </tr> | ||
75 | - <tr> | ||
76 | - <td></td> | ||
77 | - <td></td> | ||
78 | - <td></td> | ||
79 | - <td></td> | ||
80 | - <td></td> | ||
81 | - <td></td> | ||
82 | - <td></td> | ||
83 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
84 | - </tr> | ||
85 | - <tr> | ||
86 | - <td></td> | ||
87 | - <td></td> | ||
88 | - <td></td> | ||
89 | - <td></td> | ||
90 | - <td></td> | ||
91 | - <td></td> | ||
92 | - <td></td> | ||
93 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
94 | - </tr> | ||
95 | - <tr> | ||
96 | - <td></td> | ||
97 | - <td></td> | ||
98 | - <td></td> | ||
99 | - <td></td> | ||
100 | - <td></td> | ||
101 | - <td></td> | ||
102 | - <td></td> | ||
103 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
104 | - </tr> | ||
105 | - <tr> | ||
106 | - <td></td> | ||
107 | - <td></td> | ||
108 | - <td></td> | ||
109 | - <td></td> | ||
110 | - <td></td> | ||
111 | - <td></td> | ||
112 | - <td></td> | ||
113 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
114 | - </tr> | ||
115 | - <tr> | ||
116 | - <td></td> | ||
117 | - <td></td> | ||
118 | - <td></td> | ||
119 | - <td></td> | ||
120 | - <td></td> | ||
121 | - <td></td> | ||
122 | - <td></td> | ||
123 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
124 | - </tr> | ||
125 | - <tr> | ||
126 | - <td></td> | ||
127 | - <td></td> | ||
128 | - <td></td> | ||
129 | - <td></td> | ||
130 | - <td></td> | ||
131 | - <td></td> | ||
132 | - <td></td> | ||
133 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
134 | - </tr> | ||
135 | - <tr> | ||
136 | - <td></td> | ||
137 | - <td></td> | ||
138 | - <td></td> | ||
139 | - <td></td> | ||
140 | - <td></td> | ||
141 | - <td></td> | ||
142 | - <td></td> | ||
143 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
144 | - </tr> | ||
145 | - <tr> | ||
146 | - <td></td> | ||
147 | - <td></td> | ||
148 | - <td></td> | ||
149 | - <td></td> | ||
150 | - <td></td> | ||
151 | - <td></td> | ||
152 | - <td></td> | ||
153 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
154 | - </tr> | ||
155 | - <tr> | ||
156 | - <td></td> | ||
157 | - <td></td> | ||
158 | - <td></td> | ||
159 | - <td></td> | ||
160 | - <td></td> | ||
161 | - <td></td> | ||
162 | - <td></td> | ||
163 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
164 | - </tr> | ||
165 | - <tr> | ||
166 | - <td></td> | ||
167 | - <td></td> | ||
168 | - <td></td> | ||
169 | - <td></td> | ||
170 | - <td></td> | ||
171 | - <td></td> | ||
172 | - <td></td> | ||
173 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
174 | - </tr> | ||
175 | - <tr> | ||
176 | - <td></td> | ||
177 | - <td></td> | ||
178 | - <td></td> | ||
179 | - <td></td> | ||
180 | - <td></td> | ||
181 | - <td></td> | ||
182 | - <td></td> | ||
183 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a></td> | ||
184 | - </tr> | ||
185 | - </table> | ||
186 | - </div> | 14 | + <div class="cab_content_list-dropdown"> |
15 | + <div class="title_forms">Список ОІВ</div> | ||
16 | + <div class="style table-forms-wrapp"> | ||
17 | + <?php | ||
18 | + Pjax::begin([ | ||
19 | + 'id' => 'int-property-table', | ||
20 | + ]); | ||
21 | + ?> | ||
22 | + <table class="table-1 table-2" cellpadding="0" cellspacing="0" border="0"> | ||
23 | + <tr> | ||
24 | + <td style="width: 213px;">Назва</td> | ||
25 | + <td style="width: 108px;">Дата створення</td> | ||
26 | + <td>Шифр</td> | ||
27 | + <td>Жанр</td> | ||
28 | + <td style="width: 107px;">Дата реєстрації</td> | ||
29 | + <td>Договір</td> | ||
30 | + <td>Тип</td> | ||
31 | + <td class="refactor-td"></td> | ||
32 | + </tr> | ||
33 | + <?php | ||
34 | + foreach ($table as $row) { | ||
35 | + ?> | ||
36 | + <tr> | ||
37 | + <td><?= $row->title ?></td> | ||
38 | + <td><?= $row->creation_date ?></td> | ||
39 | + <td><?= $row->code ?></td> | ||
40 | + <td><?= $row->genre ?></td> | ||
41 | + <td><?= $row->registration_date ?></td> | ||
42 | + <td><?= $row->contract ?></td> | ||
43 | + <td><?= $row->type ?></td> | ||
44 | + <td><a href="<?php echo Url::to( | ||
45 | + [ | ||
46 | + 'sales', | ||
47 | + 'id' => $row->id, | ||
48 | + ] | ||
49 | + ) ?>" class="edit-table"></a><a href="#" class="remove-table remove-int-prop" data-id="<?=$row->id?>"></a></td> | ||
50 | + </tr> | ||
51 | + <?php | ||
52 | + } | ||
53 | + ?> | ||
54 | + </table> | ||
55 | + <?php | ||
56 | + Pjax::end(); | ||
57 | + ?> | ||
187 | </div> | 58 | </div> |
59 | + </div> | ||
188 | </div> | 60 | </div> |
1 | <?php | 1 | <?php |
2 | + use frontend\models\CreativeRole; | ||
2 | use frontend\models\IntellectualProperty; | 3 | use frontend\models\IntellectualProperty; |
3 | use yii\helpers\Html; | 4 | use yii\helpers\Html; |
4 | use yii\web\View; | 5 | use yii\web\View; |
@@ -8,6 +9,7 @@ | @@ -8,6 +9,7 @@ | ||
8 | /** | 9 | /** |
9 | * @var View $this | 10 | * @var View $this |
10 | * @var IntellectualProperty $property | 11 | * @var IntellectualProperty $property |
12 | + * @var CreativeRole[] $table | ||
11 | */ | 13 | */ |
12 | ?> | 14 | ?> |
13 | <div class="style cab_content_list"> | 15 | <div class="style cab_content_list"> |
@@ -139,12 +141,12 @@ | @@ -139,12 +141,12 @@ | ||
139 | 141 | ||
140 | <div class="btn-submit-blue"> | 142 | <div class="btn-submit-blue"> |
141 | <?php echo Html::button( | 143 | <?php echo Html::button( |
142 | - 'Добавить', | 144 | + 'Додати', |
143 | [ | 145 | [ |
144 | 'type' => 'button', | 146 | 'type' => 'button', |
145 | 'class' => 'add-role-button', | 147 | 'class' => 'add-role-button', |
146 | 'data-toggle' => 'modal', | 148 | 'data-toggle' => 'modal', |
147 | - 'data-target' => '#add-composition-modal', | 149 | + 'data-target' => '#add-role-modal', |
148 | ] | 150 | ] |
149 | ) ?> | 151 | ) ?> |
150 | </div> | 152 | </div> |
@@ -152,6 +154,11 @@ | @@ -152,6 +154,11 @@ | ||
152 | <div class="style wrapp-tabs-table"> | 154 | <div class="style wrapp-tabs-table"> |
153 | <div class="style table-wrapp-2"> | 155 | <div class="style table-wrapp-2"> |
154 | <div class="hidden-tables-oiv active-tab-oiv"> | 156 | <div class="hidden-tables-oiv active-tab-oiv"> |
157 | + <?php | ||
158 | + Pjax::begin([ | ||
159 | + 'id' => 'roles-table', | ||
160 | + ]); | ||
161 | + ?> | ||
155 | <table class="table-1 table-2" cellpadding="0" cellspacing="0" border="0"> | 162 | <table class="table-1 table-2" cellpadding="0" cellspacing="0" border="0"> |
156 | <tr> | 163 | <tr> |
157 | <td>Творча роль</td> | 164 | <td>Творча роль</td> |
@@ -162,167 +169,26 @@ | @@ -162,167 +169,26 @@ | ||
162 | <td>Товариство</td> | 169 | <td>Товариство</td> |
163 | <td class="refactor-td"></td> | 170 | <td class="refactor-td"></td> |
164 | </tr> | 171 | </tr> |
172 | + <?php | ||
173 | + foreach ($table as $row) { | ||
174 | + ?> | ||
165 | <tr> | 175 | <tr> |
166 | - <td></td> | ||
167 | - <td></td> | ||
168 | - <td></td> | ||
169 | - <td></td> | ||
170 | - <td></td> | ||
171 | - <td></td> | ||
172 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
173 | - </td> | ||
174 | - </tr> | ||
175 | - <tr> | ||
176 | - <td></td> | ||
177 | - <td></td> | ||
178 | - <td></td> | ||
179 | - <td></td> | ||
180 | - <td></td> | ||
181 | - <td></td> | ||
182 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
183 | - </td> | ||
184 | - </tr> | ||
185 | - <tr> | ||
186 | - <td></td> | ||
187 | - <td></td> | ||
188 | - <td></td> | ||
189 | - <td></td> | ||
190 | - <td></td> | ||
191 | - <td></td> | ||
192 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
193 | - </td> | ||
194 | - </tr> | ||
195 | - <tr> | ||
196 | - <td></td> | ||
197 | - <td></td> | ||
198 | - <td></td> | ||
199 | - <td></td> | ||
200 | - <td></td> | ||
201 | - <td></td> | ||
202 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
203 | - </td> | ||
204 | - </tr> | ||
205 | - <tr> | ||
206 | - <td></td> | ||
207 | - <td></td> | ||
208 | - <td></td> | ||
209 | - <td></td> | ||
210 | - <td></td> | ||
211 | - <td></td> | ||
212 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
213 | - </td> | ||
214 | - </tr> | ||
215 | - <tr> | ||
216 | - <td></td> | ||
217 | - <td></td> | ||
218 | - <td></td> | ||
219 | - <td></td> | ||
220 | - <td></td> | ||
221 | - <td></td> | ||
222 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
223 | - </td> | ||
224 | - </tr> | ||
225 | - <tr> | ||
226 | - <td></td> | ||
227 | - <td></td> | ||
228 | - <td></td> | ||
229 | - <td></td> | ||
230 | - <td></td> | ||
231 | - <td></td> | ||
232 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
233 | - </td> | ||
234 | - </tr> | ||
235 | - <tr> | ||
236 | - <td></td> | ||
237 | - <td></td> | ||
238 | - <td></td> | ||
239 | - <td></td> | ||
240 | - <td></td> | ||
241 | - <td></td> | ||
242 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
243 | - </td> | ||
244 | - </tr> | ||
245 | - <tr> | ||
246 | - <td></td> | ||
247 | - <td></td> | ||
248 | - <td></td> | ||
249 | - <td></td> | ||
250 | - <td></td> | ||
251 | - <td></td> | ||
252 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
253 | - </td> | ||
254 | - </tr> | ||
255 | - <tr> | ||
256 | - <td></td> | ||
257 | - <td></td> | ||
258 | - <td></td> | ||
259 | - <td></td> | ||
260 | - <td></td> | ||
261 | - <td></td> | ||
262 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
263 | - </td> | ||
264 | - </tr> | ||
265 | - <tr> | ||
266 | - <td></td> | ||
267 | - <td></td> | ||
268 | - <td></td> | ||
269 | - <td></td> | ||
270 | - <td></td> | ||
271 | - <td></td> | ||
272 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
273 | - </td> | ||
274 | - </tr> | ||
275 | - <tr> | ||
276 | - <td></td> | ||
277 | - <td></td> | ||
278 | - <td></td> | ||
279 | - <td></td> | ||
280 | - <td></td> | ||
281 | - <td></td> | ||
282 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
283 | - </td> | ||
284 | - </tr> | ||
285 | - <tr> | ||
286 | - <td></td> | ||
287 | - <td></td> | ||
288 | - <td></td> | ||
289 | - <td></td> | ||
290 | - <td></td> | ||
291 | - <td></td> | ||
292 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
293 | - </td> | ||
294 | - </tr> | ||
295 | - <tr> | ||
296 | - <td></td> | ||
297 | - <td></td> | ||
298 | - <td></td> | ||
299 | - <td></td> | ||
300 | - <td></td> | ||
301 | - <td></td> | ||
302 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
303 | - </td> | ||
304 | - </tr> | ||
305 | - <tr> | ||
306 | - <td></td> | ||
307 | - <td></td> | ||
308 | - <td></td> | ||
309 | - <td></td> | ||
310 | - <td></td> | ||
311 | - <td></td> | ||
312 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
313 | - </td> | ||
314 | - </tr> | ||
315 | - <tr> | ||
316 | - <td></td> | ||
317 | - <td></td> | ||
318 | - <td></td> | ||
319 | - <td></td> | ||
320 | - <td></td> | ||
321 | - <td></td> | ||
322 | - <td><a href="#" class="edit-table"></a><a href="#" class="remove-table"></a> | ||
323 | - </td> | 176 | + <td><?= $row->title ?></td> |
177 | + <td><?= $row->name ?></td> | ||
178 | + <td><?= $row->part ?></td> | ||
179 | + <td><?= $row->code ?></td> | ||
180 | + <td><?= $row->iri ?></td> | ||
181 | + <td><?= $row->society ?></td> | ||
182 | + <td><a href="#" class="edit-table"></a><a href="#" class="remove-table delete-role" data-id="<?=$row->id?>"></a> | ||
183 | + </td> | ||
324 | </tr> | 184 | </tr> |
185 | + <?php | ||
186 | + } | ||
187 | + ?> | ||
325 | </table> | 188 | </table> |
189 | + <?php | ||
190 | + Pjax::end(); | ||
191 | + ?> | ||
326 | </div> | 192 | </div> |
327 | </div> | 193 | </div> |
328 | </div> | 194 | </div> |
@@ -340,55 +206,55 @@ | @@ -340,55 +206,55 @@ | ||
340 | </div> | 206 | </div> |
341 | 207 | ||
342 | <!-- Modal --> | 208 | <!-- Modal --> |
343 | -<div class="modal fade" id="add-composition-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | 209 | +<div class="modal fade" id="add-role-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> |
344 | <div class="modal-dialog" role="document"> | 210 | <div class="modal-dialog" role="document"> |
345 | <div class="modal-content"> | 211 | <div class="modal-content"> |
346 | <div class="modal-header"> | 212 | <div class="modal-header"> |
347 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | 213 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
348 | <span aria-hidden="true">×</span></button> | 214 | <span aria-hidden="true">×</span></button> |
349 | - <h4 class="modal-title" id="myModalLabel">Додати твір</h4> | 215 | + <h4 class="modal-title" id="myModalLabel">Додати роль</h4> |
350 | </div> | 216 | </div> |
351 | <?php | 217 | <?php |
352 | $form = ActiveForm::begin( | 218 | $form = ActiveForm::begin( |
353 | [ | 219 | [ |
354 | - 'action' => 'add-int-prop', | ||
355 | - 'id' => 'add-int-prop-form', | 220 | + 'action' => 'add-role', |
221 | + 'id' => 'add-role-form', | ||
356 | ] | 222 | ] |
357 | ); | 223 | ); |
358 | - $addIntProp = new IntellectualProperty(); | 224 | + $addRole = new CreativeRole(); |
359 | ?> | 225 | ?> |
360 | <div class="modal-body forms-cabinet forms-2"> | 226 | <div class="modal-body forms-cabinet forms-2"> |
361 | 227 | ||
362 | 228 | ||
363 | 229 | ||
364 | <?php | 230 | <?php |
365 | - echo $form->field($addIntProp, 'title'); | 231 | + echo $form->field($addRole, 'title'); |
366 | ?> | 232 | ?> |
367 | 233 | ||
368 | <?php | 234 | <?php |
369 | - echo $form->field($addIntProp, 'registration_date')->textInput([ | ||
370 | - 'class' => '_datepicker form-control', | ||
371 | - ]); | 235 | + echo $form->field($addRole, 'name'); |
372 | ?> | 236 | ?> |
373 | 237 | ||
374 | <?php | 238 | <?php |
375 | - echo $form->field($addIntProp, 'genre'); | 239 | + echo $form->field($addRole, 'part'); |
376 | ?> | 240 | ?> |
377 | 241 | ||
378 | <?php | 242 | <?php |
379 | - echo $form->field($addIntProp, 'author_role'); | 243 | + echo $form->field($addRole, 'code'); |
380 | ?> | 244 | ?> |
381 | 245 | ||
382 | <?php | 246 | <?php |
383 | - echo $form->field($addIntProp, 'percent'); | 247 | + echo $form->field($addRole, 'iri'); |
384 | ?> | 248 | ?> |
385 | 249 | ||
386 | <?php | 250 | <?php |
387 | - echo $form->field($addIntProp, 'calculated'); | 251 | + echo $form->field($addRole, 'society'); |
388 | ?> | 252 | ?> |
389 | - | ||
390 | - <?php | ||
391 | - echo $form->field($addIntProp, 'play_count'); | 253 | + |
254 | + <?php | ||
255 | + echo $form->field($addRole, 'intellectual_property_id')->hiddenInput([ | ||
256 | + 'value' => $property->id, | ||
257 | + ])->label(false); | ||
392 | ?> | 258 | ?> |
393 | 259 | ||
394 | </div> | 260 | </div> |
frontend/views/site/requestPasswordResetToken.php
100644 → 100755
@@ -748,12 +748,12 @@ ul.list-cab li.active-li ul li.active-li-drop span.act_bg { | @@ -748,12 +748,12 @@ ul.list-cab li.active-li ul li.active-li-drop span.act_bg { | ||
748 | 748 | ||
749 | 749 | ||
750 | /* Add modal */ | 750 | /* Add modal */ |
751 | -#add-composition-modal .forms-cabinet { | 751 | +#add-composition-modal .forms-cabinet, #add-role-modal .forms-cabinet { |
752 | width: 100%; | 752 | width: 100%; |
753 | margin: 0; | 753 | margin: 0; |
754 | max-width: 1000px; | 754 | max-width: 1000px; |
755 | } | 755 | } |
756 | -#add-composition-modal .modal-footer { | 756 | +#add-composition-modal .modal-footer, #add-role-modal .modal-footer { |
757 | border: 0px solid white; | 757 | border: 0px solid white; |
758 | } | 758 | } |
759 | #myModalLabel { | 759 | #myModalLabel { |
No preview for this file type
@@ -273,6 +273,57 @@ $(document).ready(function(){ | @@ -273,6 +273,57 @@ $(document).ready(function(){ | ||
273 | 273 | ||
274 | return false; | 274 | return false; |
275 | }); | 275 | }); |
276 | + | ||
277 | + $(document).on('beforeSubmit', '#add-role-form', function() { | ||
278 | + $.post($(this).attr('action'), $(this).serialize(), function(data) { | ||
279 | + var type; | ||
280 | + if(data.error) { | ||
281 | + type = 'danger'; | ||
282 | + } else { | ||
283 | + type = 'success'; | ||
284 | + } | ||
285 | + $('#add-role-modal').modal('hide'); | ||
286 | + showStatus(data.message, type); | ||
287 | + $.pjax.reload('#roles-table'); | ||
288 | + document.getElementById('add-role-form').reset(); | ||
289 | + }); | ||
290 | + | ||
291 | + return false; | ||
292 | + }); | ||
293 | + | ||
294 | + $(document).on('click', '.delete-role', function(e) { | ||
295 | + e.preventDefault(); | ||
296 | + confirm('Удалить роль?'); | ||
297 | + $.post('delete-role', { | ||
298 | + id:$(this).attr('data-id') | ||
299 | + }, function(data) { | ||
300 | + var type; | ||
301 | + if(data.error) { | ||
302 | + type = 'danger'; | ||
303 | + } else { | ||
304 | + type = 'success'; | ||
305 | + } | ||
306 | + showStatus(data.message, type); | ||
307 | + $.pjax.reload('#roles-table'); | ||
308 | + }); | ||
309 | + }); | ||
310 | + | ||
311 | + $(document).on('click', '.remove-int-prop', function(e) { | ||
312 | + e.preventDefault(); | ||
313 | + confirm('Удалить элемент?'); | ||
314 | + $.post('delete-int-property', { | ||
315 | + id:$(this).attr('data-id') | ||
316 | + }, function(data) { | ||
317 | + var type; | ||
318 | + if(data.error) { | ||
319 | + type = 'danger'; | ||
320 | + } else { | ||
321 | + type = 'success'; | ||
322 | + } | ||
323 | + showStatus(data.message, type); | ||
324 | + $.pjax.reload('#int-property-table'); | ||
325 | + }); | ||
326 | + }); | ||
276 | }); | 327 | }); |
277 | 328 | ||
278 | 329 |