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
cdf7ae1e
Commit
cdf7ae1e
authored
Feb 17, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#958 - Активировать формы обратной связи на сайте.
parent
70281151
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
common/modules/bids/models/Bid.php
common/modules/bids/models/Bid.php
+7
-1
frontend/views/layouts/footer-index.php
frontend/views/layouts/footer-index.php
+8
-4
frontend/views/site/contacts.php
frontend/views/site/contacts.php
+1
-1
No files found.
common/modules/bids/models/Bid.php
View file @
cdf7ae1e
...
@@ -67,7 +67,13 @@ class Bid extends \common\components\ActiveRecordModel
...
@@ -67,7 +67,13 @@ class Bid extends \common\components\ActiveRecordModel
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'name'
,
'phone'
,
'email'
],
'required'
,
'on'
=>
self
::
SCENARIO_PROJECT
],
[
'phone'
,
'required'
,
'when'
=>
function
(
$model
)
{
return
!
$model
->
email
;
},
'on'
=>
self
::
SCENARIO_PROJECT
],
[
'email'
,
'required'
,
'when'
=>
function
(
$model
)
{
return
!
$model
->
phone
;
},
'on'
=>
self
::
SCENARIO_PROJECT
],
[[
'email'
],
'email'
],
[[
'email'
],
'email'
],
[[
'name'
,
'phone'
],
'required'
,
'on'
=>
self
::
SCENARIO_CALLBACK
],
[[
'name'
,
'phone'
],
'required'
,
'on'
=>
self
::
SCENARIO_CALLBACK
],
...
...
frontend/views/layouts/footer-index.php
View file @
cdf7ae1e
...
@@ -18,25 +18,29 @@ use common\modules\bids\models\Bid;
...
@@ -18,25 +18,29 @@ use common\modules\bids\models\Bid;
<?php
<?php
$model
=
new
Bid
;
$model
=
new
Bid
;
$model
->
scenario
=
Bid
::
SCENARIO_PROJECT
;
$model
->
scenario
=
Bid
::
SCENARIO_PROJECT
;
$model
->
form
=
Bid
::
FORM_PROJECT
;
$form
=
ActiveForm
::
begin
([
$form
=
ActiveForm
::
begin
([
'id'
=>
'form_foot'
,
'id'
=>
'form_foot'
,
'action'
=>
'/'
,
'action'
=>
'/'
,
'enableClientValidation'
=>
false
,
'options'
=>
[
'options'
=>
[
'class'
=>
'footer_form bids-form'
,
'class'
=>
'footer_form bids-form'
,
'enctype'
=>
'multipart/form-data'
'data-title'
=>
'Рассчитать проект'
,
'data-form'
=>
'Рассчитать проект'
,
'data-tag'
=>
Bid
::
TAG_TREATMENT
],
],
]);
?>
]);
?>
<?php
echo
Html
::
hiddenInput
(
'scenario'
,
$model
->
scenario
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
Html
::
hiddenInput
(
'scenario'
,
$model
->
scenario
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
Html
::
hiddenInput
(
'Bid[form]'
,
Bid
::
FORM_PROJECT
,
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
$form
->
field
(
$model
,
'form'
,
[
'template'
=>
'{input}'
])
->
hiddenInput
(
[
'class'
=>
'not_clear'
]);
?>
<?php
echo
$form
->
field
(
$model
,
'name'
,
[
<?php
echo
$form
->
field
(
$model
,
'name'
,
[
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
'errorOptions'
=>
[]
'errorOptions'
=>
[]
])
->
textInput
([
])
->
textInput
([
'placeholder'
=>
'Ваше имя
*
'
,
'placeholder'
=>
'Ваше имя'
,
'class'
=>
'footer_form__input'
'class'
=>
'footer_form__input'
]);
?>
]);
?>
...
@@ -44,7 +48,7 @@ use common\modules\bids\models\Bid;
...
@@ -44,7 +48,7 @@ use common\modules\bids\models\Bid;
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
'errorOptions'
=>
[]
'errorOptions'
=>
[]
])
->
textInput
([
])
->
textInput
([
'placeholder'
=>
'Телефон
*
'
,
'placeholder'
=>
'Телефон'
,
'class'
=>
'footer_form__input'
'class'
=>
'footer_form__input'
]);
?>
]);
?>
...
...
frontend/views/site/contacts.php
View file @
cdf7ae1e
...
@@ -104,7 +104,7 @@ use \common\modules\bids\models\Bid;
...
@@ -104,7 +104,7 @@ use \common\modules\bids\models\Bid;
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
'template'
=>
'<div class="row"><div class="col-sm-4">{input}</div></div>'
,
'errorOptions'
=>
[]
'errorOptions'
=>
[]
])
->
textInput
([
])
->
textInput
([
'placeholder'
=>
'Ваше имя
*
'
,
'placeholder'
=>
'Ваше имя'
,
'class'
=>
'sect_cont_form__input'
'class'
=>
'sect_cont_form__input'
]);
?>
]);
?>
...
...
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