Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
1590e296
Commit
1590e296
authored
Apr 04, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Перенаправили добавление записи на подписку в другой экшн (аналогичный)
parent
bdae6efc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
1 deletion
+57
-1
common/modules/bids/controllers/BidController.php
common/modules/bids/controllers/BidController.php
+56
-0
common/modules/blog/views/post/_subscribe.php
common/modules/blog/views/post/_subscribe.php
+1
-1
No files found.
common/modules/bids/controllers/BidController.php
View file @
1590e296
...
@@ -21,6 +21,7 @@ class BidController extends \common\components\BaseController
...
@@ -21,6 +21,7 @@ class BidController extends \common\components\BaseController
{
{
return
[
return
[
'Add'
=>
'Добавление заявки'
,
'Add'
=>
'Добавление заявки'
,
'BlogAdd'
=>
'Добавление заявки в блог'
,
'Upload-files'
=>
'Загрузка файлов'
,
'Upload-files'
=>
'Загрузка файлов'
,
];
];
}
}
...
@@ -79,6 +80,61 @@ class BidController extends \common\components\BaseController
...
@@ -79,6 +80,61 @@ class BidController extends \common\components\BaseController
}
}
}
}
/**
* @return array
* @throws \Exception
* @throws \yii\web\NotFoundHttpException
*/
public
function
actionBlogAdd
()
{
Yii
::
$app
->
response
->
format
=
Response
::
FORMAT_JSON
;
$model
=
new
Bid
;
$model
->
scenario
=
Yii
::
$app
->
request
->
post
(
'scenario'
);
if
(
Yii
::
$app
->
request
->
isAjax
&&
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
$transaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
if
(
$model
->
save
())
{
// Yii::$app->user->identity->afterSubscribe(12);
if
(
$model
->
file
)
{
foreach
(
$model
->
file
as
$filename
)
{
$file
=
new
BidFile
;
$file
->
bid_id
=
$model
->
id
;
$file
->
filename
=
$filename
;
$file
->
save
();
}
}
$model
->
send
();
$transaction
->
commit
();
return
[
'success'
=>
true
];
}
else
{
return
ActiveForm
::
validate
(
$model
);
}
}
catch
(
Exception
$e
)
{
$transaction
->
rollBack
();
throw
$e
;
}
}
else
{
throw
new
NotFoundHttpException
(
'The requested page does not exist.'
);
}
}
public
function
actionUploadFiles
()
public
function
actionUploadFiles
()
{
{
...
...
common/modules/blog/views/post/_subscribe.php
View file @
1590e296
...
@@ -15,7 +15,7 @@ use common\modules\bids\models\Bid;
...
@@ -15,7 +15,7 @@ use common\modules\bids\models\Bid;
$model
->
form
=
Bid
::
FORM_SUBSCRIBE
;
$model
->
form
=
Bid
::
FORM_SUBSCRIBE
;
$form
=
ActiveForm
::
begin
([
$form
=
ActiveForm
::
begin
([
'action'
=>
'/bids/bid/
a
dd'
,
'action'
=>
'/bids/bid/
blogA
dd'
,
'enableClientValidation'
=>
false
,
'enableClientValidation'
=>
false
,
'options'
=>
[
'options'
=>
[
'class'
=>
'subsc_blog_form bids-form'
,
'class'
=>
'subsc_blog_form bids-form'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment