Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
B
bee
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
bee
Commits
b9e30fba
Commit
b9e30fba
authored
May 18, 2018
by
acrollet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide price fields on node creation
parent
61c28f82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
bee.module
bee.module
+10
-2
No files found.
bee.module
View file @
b9e30fba
...
...
@@ -167,7 +167,7 @@ function bee_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if
(
$bee_settings
[
'bookable_type'
]
==
'daily'
)
{
$form
[
'field_price'
][
'#group'
]
=
'payments'
;
$form
[
'field_price'
][
'#title'
]
=
t
(
'Price per day'
);
$form
[
'field_price'
][
'
widget'
][
0
][
'
#title'
]
=
t
(
'Price per day'
);
$form
[
'field_price_frequency'
][
'#access'
]
=
FALSE
;
...
...
@@ -188,7 +188,7 @@ function bee_form_alter(&$form, FormStateInterface $form_state, $form_id) {
}
}
else
{
$form
[
'field_price
'
][
'#access'
]
=
FALSE
;
$form
[
'field_price'
][
'#access'
]
=
FALSE
;
$form
[
'field_price_frequency'
][
'#access'
]
=
FALSE
;
}
...
...
@@ -219,6 +219,14 @@ function bee_form_alter(&$form, FormStateInterface $form_state, $form_id) {
}
}
elseif
(
preg_match
(
'/^node_.*_form$/'
,
$form_id
))
{
if
(
isset
(
$form
[
'field_price'
]))
{
$form
[
'field_price'
][
'#access'
]
=
FALSE
;
}
if
(
isset
(
$form
[
'field_price_frequency'
]))
{
$form
[
'field_price_frequency'
][
'#access'
]
=
FALSE
;
}
if
(
isset
(
$form
[
'field_use_open_hours'
]))
{
$form
[
'field_use_open_hours'
][
'#access'
]
=
FALSE
;
}
...
...
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