|
|
|
@ -414,7 +414,6 @@ function _ill_corporate_forms_add_item_type_states(array &$form): void { |
|
|
|
'field_ill_item_title', |
|
|
|
'field_ill_item_title', |
|
|
|
'field_ill_author_editor', |
|
|
|
'field_ill_author_editor', |
|
|
|
'field_ill_isbn', |
|
|
|
'field_ill_isbn', |
|
|
|
'field_ill_publication_date', |
|
|
|
|
|
|
|
'field_ill_edition', |
|
|
|
'field_ill_edition', |
|
|
|
'field_ill_publisher', |
|
|
|
'field_ill_publisher', |
|
|
|
]; |
|
|
|
]; |
|
|
|
@ -438,7 +437,6 @@ function _ill_corporate_forms_add_item_type_states(array &$form): void { |
|
|
|
'field_ill_volume', |
|
|
|
'field_ill_volume', |
|
|
|
'field_ill_issue', |
|
|
|
'field_ill_issue', |
|
|
|
'field_ill_issn', |
|
|
|
'field_ill_issn', |
|
|
|
'field_ill_pages', |
|
|
|
|
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
foreach ($article_fields as $field_name) { |
|
|
|
foreach ($article_fields as $field_name) { |
|
|
|
@ -451,6 +449,27 @@ function _ill_corporate_forms_add_item_type_states(array &$form): void { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Publication date: visible for book, article, and book_chapter. |
|
|
|
|
|
|
|
if (isset($form['field_ill_publication_date'])) { |
|
|
|
|
|
|
|
$form['field_ill_publication_date']['#states'] = [ |
|
|
|
|
|
|
|
'visible' => [ |
|
|
|
|
|
|
|
[$item_type_selector => ['value' => 'book']], |
|
|
|
|
|
|
|
[$item_type_selector => ['value' => 'article']], |
|
|
|
|
|
|
|
[$item_type_selector => ['value' => 'book_chapter']], |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Pages: visible for both article and book_chapter. |
|
|
|
|
|
|
|
if (isset($form['field_ill_pages'])) { |
|
|
|
|
|
|
|
$form['field_ill_pages']['#states'] = [ |
|
|
|
|
|
|
|
'visible' => [ |
|
|
|
|
|
|
|
[$item_type_selector => ['value' => 'article']], |
|
|
|
|
|
|
|
[$item_type_selector => ['value' => 'book_chapter']], |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Book Chapter fields: visible only when item_type is "book_chapter". |
|
|
|
// Book Chapter fields: visible only when item_type is "book_chapter". |
|
|
|
$chapter_fields = [ |
|
|
|
$chapter_fields = [ |
|
|
|
'field_ill_chapter_title', |
|
|
|
'field_ill_chapter_title', |
|
|
|
|