diff options
author | Fahad Israr | 2019-07-03 13:22:13 +0530 |
---|---|---|
committer | Fahad Israr | 2019-07-03 13:22:13 +0530 |
commit | fd04311179377ce2b4c5697be2ae2a2b51a1b2f3 (patch) | |
tree | 8fd529d45e37612de276b07be5caaa7335114c9a /modules/mansimran/administrative_offices | |
parent | 35646d229739b283da6cf1e0958f1f7d28062442 (diff) | |
parent | 58dbf8fcb04c01c338b9e346b8266690c8b92a2f (diff) | |
download | acadmix_distribution-fd04311179377ce2b4c5697be2ae2a2b51a1b2f3.tar.gz acadmix_distribution-fd04311179377ce2b4c5697be2ae2a2b51a1b2f3.tar.bz2 acadmix_distribution-fd04311179377ce2b4c5697be2ae2a2b51a1b2f3.zip |
Merge branch 'master' of https://github.com/FOSSEE/acadmix_distribution
Diffstat (limited to 'modules/mansimran/administrative_offices')
17 files changed, 823 insertions, 0 deletions
diff --git a/modules/mansimran/administrative_offices/administrative_offices.info.yml b/modules/mansimran/administrative_offices/administrative_offices.info.yml new file mode 100644 index 0000000..6ecbeec --- /dev/null +++ b/modules/mansimran/administrative_offices/administrative_offices.info.yml @@ -0,0 +1,14 @@ +name: 'administrative offices' +type: module +description: 'Administrative offices content type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:paragraphs + - drupal:path + - drupal:text + - drupal:user + - drupal:entity_reference_revisions + - drupal:node + - drupal:menu_ui + diff --git a/modules/mansimran/administrative_offices/administrative_offices.install b/modules/mansimran/administrative_offices/administrative_offices.install new file mode 100644 index 0000000..7985f05 --- /dev/null +++ b/modules/mansimran/administrative_offices/administrative_offices.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function administrative_offices_uninstall() { + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'administrative_offices'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + diff --git a/modules/mansimran/administrative_offices/administrative_offices.module b/modules/mansimran/administrative_offices/administrative_offices.module new file mode 100644 index 0000000..125d9da --- /dev/null +++ b/modules/mansimran/administrative_offices/administrative_offices.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains administrative_offices.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function administrative_offices_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the administrative_offices module. + case 'help.page.administrative_offices': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Administrative offices content type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function administrative_offices_theme() { + return [ + 'administrative_offices' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/mansimran/administrative_offices/composer.json b/modules/mansimran/administrative_offices/composer.json new file mode 100644 index 0000000..cb21bd1 --- /dev/null +++ b/modules/mansimran/administrative_offices/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/administrative_offices", + "type": "drupal-module", + "description": "Administrative offices content type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/administrative_offices", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/administrative_offices", + "source": "http://cgit.drupalcode.org/administrative_offices" + }, + "require": { } +} diff --git a/modules/mansimran/administrative_offices/config/install/core.entity_form_display.node.administrative_offices.default.yml b/modules/mansimran/administrative_offices/config/install/core.entity_form_display.node.administrative_offices.default.yml new file mode 100644 index 0000000..22f494c --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/core.entity_form_display.node.administrative_offices.default.yml @@ -0,0 +1,98 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.administrative_offices.body + - field.field.node.administrative_offices.field_office_ + - node.type.administrative_offices + module: + - paragraphs + - path + - text + enforced: + module: + - administrative_offices +id: node.administrative_offices.default +targetEntityType: node +bundle: administrative_offices +mode: default +content: + body: + type: text_textarea_with_summary + weight: 121 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + third_party_settings: { } + region: content + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_office_: + type: entity_reference_paragraphs + weight: 124 + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + add_mode: dropdown + form_display_mode: default + default_paragraph_type: '' + third_party_settings: { } + region: content + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + settings: + display_label: true + weight: 15 + region: content + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 120 + region: content + third_party_settings: { } + sticky: + type: boolean_checkbox + settings: + display_label: true + weight: 16 + region: content + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + region: content + third_party_settings: { } +hidden: { } diff --git a/modules/mansimran/administrative_offices/config/install/core.entity_view_display.node.administrative_offices.default.yml b/modules/mansimran/administrative_offices/config/install/core.entity_view_display.node.administrative_offices.default.yml new file mode 100644 index 0000000..e042f07 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/core.entity_view_display.node.administrative_offices.default.yml @@ -0,0 +1,42 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.administrative_offices.body + - field.field.node.administrative_offices.field_office_ + - node.type.administrative_offices + module: + - entity_reference_revisions + - text + - user + enforced: + module: + - administrative_offices +id: node.administrative_offices.default +targetEntityType: node +bundle: administrative_offices +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_office_: + type: entity_reference_revisions_entity_view + weight: 104 + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/mansimran/administrative_offices/config/install/core.entity_view_display.node.administrative_offices.teaser.yml b/modules/mansimran/administrative_offices/config/install/core.entity_view_display.node.administrative_offices.teaser.yml new file mode 100644 index 0000000..5057835 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/core.entity_view_display.node.administrative_offices.teaser.yml @@ -0,0 +1,35 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.administrative_offices.body + - field.field.node.administrative_offices.field_office_ + - node.type.administrative_offices + module: + - text + - user + enforced: + module: + - administrative_offices +id: node.administrative_offices.teaser +targetEntityType: node +bundle: administrative_offices +mode: teaser +content: + body: + label: hidden + type: text_summary_or_trimmed + weight: 100 + settings: + trim_length: 600 + third_party_settings: { } + region: content + links: + weight: 101 + region: content + settings: { } + third_party_settings: { } +hidden: + field_office_: true + langcode: true diff --git a/modules/mansimran/administrative_offices/config/install/field.field.node.administrative_offices.body.yml b/modules/mansimran/administrative_offices/config/install/field.field.node.administrative_offices.body.yml new file mode 100644 index 0000000..f2a9a26 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/field.field.node.administrative_offices.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.administrative_offices + module: + - text + enforced: + module: + - administrative_offices +id: node.administrative_offices.body +field_name: body +entity_type: node +bundle: administrative_offices +label: Body +description: 'Description of the office' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/mansimran/administrative_offices/config/install/field.field.node.administrative_offices.field_office_.yml b/modules/mansimran/administrative_offices/config/install/field.field.node.administrative_offices.field_office_.yml new file mode 100644 index 0000000..0c10400 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/field.field.node.administrative_offices.field_office_.yml @@ -0,0 +1,39 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_office_ + - node.type.administrative_offices + - paragraphs.paragraphs_type.office_details + module: + - entity_reference_revisions + enforced: + module: + - administrative_offices +id: node.administrative_offices.field_office_ +field_name: field_office_ +entity_type: node +bundle: administrative_offices +label: 'Office details' +description: 'Office details' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + negate: 0 + target_bundles: + office_details: office_details + target_bundles_drag_drop: + member_details_field: + weight: 4 + enabled: false + office_details: + enabled: true + weight: 5 + r_d_projects: + weight: 6 + enabled: false +field_type: entity_reference_revisions diff --git a/modules/mansimran/administrative_offices/config/install/field.storage.node.field_office_.yml b/modules/mansimran/administrative_offices/config/install/field.storage.node.field_office_.yml new file mode 100644 index 0000000..9622dfa --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/field.storage.node.field_office_.yml @@ -0,0 +1,24 @@ +uuid: a459bc3a-894d-4393-955a-85ecd45061f4 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs + enforced: + module: + - administrative_offices +id: node.field_office_ +field_name: field_office_ +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/administrative_offices/config/install/migrate_plus.migration.admin_para_migration.yml b/modules/mansimran/administrative_offices/config/install/migrate_plus.migration.admin_para_migration.yml new file mode 100644 index 0000000..143e1b5 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/migrate_plus.migration.admin_para_migration.yml @@ -0,0 +1,30 @@ +uuid: b750a99d-9cc8-4c43-9fce-5e75fd128bf8 +langcode: en +status: true +id: admin_para_migration +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - CSV +migration_group: default +label: 'admin content migration' +source: + plugin: csv + path: /home/mansimran/Desktop/mansimran1/adminofficepara.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id +process: + type: + plugin: default_value + default_value: office_details + field_contact_details: Contact + field_location: location +destination: + plugin: entity_reference_revisions:paragraph +migration_dependencies: + required: { } + optional: { }
\ No newline at end of file diff --git a/modules/mansimran/administrative_offices/config/install/migrate_plus.migration.adminoffice_1.yml b/modules/mansimran/administrative_offices/config/install/migrate_plus.migration.adminoffice_1.yml new file mode 100644 index 0000000..8ace16e --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/migrate_plus.migration.adminoffice_1.yml @@ -0,0 +1,57 @@ +uuid: 99d55013-7c47-4b21-9368-572622fd85df +langcode: en +status: true +id: adminoffice_1 +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - CSV +migration_group: default +label: 'admin_office_csv_import_1' +source: + plugin: csv + path: /home/mansimran/Desktop/mansimran1/adminofficenode.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id +process: + type: + plugin: default_value + default_value: administrative_offices + title: title + body/value: body + body/format: + plugin: default_value + default_value: basic_html + field_office_/target_id: + - + plugin: migration_lookup + migration: admin_para_migration + allow_multiple: true + source: id + no_stub: true + - + plugin: extract + index: + - 0 + field_office_/target_revision_id: + - + plugin: migration_lookup + migration: admin_para_migration + allow_multiple: true + source: id + no_stub: true + - + plugin: extract + index: + - 1 +destination: + plugin: 'entity:node' + bundle: administrative_offices +migration_dependencies: + required: + - admin_para_migration + optional: { }
\ No newline at end of file diff --git a/modules/mansimran/administrative_offices/config/install/node.type.administrative_offices.yml b/modules/mansimran/administrative_offices/config/install/node.type.administrative_offices.yml new file mode 100644 index 0000000..95d8940 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/node.type.administrative_offices.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - administrative_offices +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Administrative offices' +type: administrative_offices +description: 'List of administrative offices in VIT' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/mansimran/administrative_offices/config/install/paragraphs.paragraphs_type.office_details.yml b/modules/mansimran/administrative_offices/config/install/paragraphs.paragraphs_type.office_details.yml new file mode 100644 index 0000000..06c2b9a --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/paragraphs.paragraphs_type.office_details.yml @@ -0,0 +1,16 @@ +uuid: af03fad4-b366-424d-bd9e-71b303a68ff3 +langcode: en +status: true +dependencies: + enforced: + module: + - administrative_offices +id: office_details +label: 'Office details' +icon_uuid: null +description: '' +behavior_plugins: { } +dependecies: + enforced: + module: + - administrative_offices diff --git a/modules/mansimran/administrative_offices/config/install/views.view.administrative_offices.yml b/modules/mansimran/administrative_offices/config/install/views.view.administrative_offices.yml new file mode 100644 index 0000000..ccf1804 --- /dev/null +++ b/modules/mansimran/administrative_offices/config/install/views.view.administrative_offices.yml @@ -0,0 +1,301 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.administrative_offices + module: + - node + - text + - user + enforced: + module: + - administrative_offices +id: administrative_offices +label: 'Administrative Offices' +module: views +description: 'List of administrative offices in VIT' +tag: '' +base_table: node_field_data +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: mini + options: + items_per_page: 5 + offset: 0 + id: 0 + total_pages: null + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + tags: + previous: ‹‹ + next: ›› + style: + type: grid + options: + grouping: { } + columns: 3 + automatic_width: true + alignment: horizontal + col_class_default: true + col_class_custom: '' + row_class_default: true + row_class_custom: '' + row: + type: fields + options: + inline: { } + separator: '' + hide_empty: false + default_field_elements: true + fields: + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: false + ellipsis: false + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: h2 + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + entity_type: node + entity_field: title + plugin_id: field + body: + id: body + table: node__body + field: body + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 200 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: true + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: text_default + settings: { } + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + plugin_id: field + filters: + status: + value: '1' + table: node_field_data + field: status + plugin_id: boolean + entity_type: node + entity_field: status + id: status + expose: + operator: '' + group: 1 + type: + id: type + table: node_field_data + field: type + value: + administrative_offices: administrative_offices + entity_type: node + entity_field: type + plugin_id: bundle + sorts: + created: + id: created + table: node_field_data + field: created + order: DESC + entity_type: node + entity_field: created + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exposed: false + expose: + label: '' + granularity: second + title: 'Administrative Offices' + header: + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + relationship: none + group_type: group + admin_label: '' + empty: false + tokenize: false + content: ' VIT was establishded with the aim of providing quality higher education, on par with international standards. It persistently seeks and adopts innovative methods to improve the quality of higher education on a consistent basis. The campus has a cosmopolitan atmosphere with students from all corners of the globe. Experienced and learned teachers are strongly encouraged to nurture the students into well-rounded individuals. The global standards set at VIT in the field of teaching and research spurs us on in our relentless pursuit of excellence. In fact, it has become our way of life. The highly motivated youngsters on the campus are our constant source of pride. Our Memoranda of Understanding with various international universities are our major strength. They provide for an exchange of students and faculty and encourage joint research projects for the mutual benefit of the universities. Many of our students who pursue their research projects in foreign universities have done us proud by bringing quality work and esteem to India. With steady steps, we continue our march forward. We look forward to meeting you here at VIT. ' + plugin_id: text_custom + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.body' + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 1 + display_options: + display_extenders: { } + path: offices + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.body' + diff --git a/modules/mansimran/administrative_offices/templates/administrative-offices.html.twig b/modules/mansimran/administrative_offices/templates/administrative-offices.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/mansimran/administrative_offices/templates/administrative-offices.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/mansimran/administrative_offices/tests/src/Functional/LoadTest.php b/modules/mansimran/administrative_offices/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..2610ff5 --- /dev/null +++ b/modules/mansimran/administrative_offices/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\administrative_offices\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group administrative_offices + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['administrative_offices']; + + /** + * A user with permission to administer site configuration. + * + * @var \Drupal\user\UserInterface + */ + protected $user; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->user = $this->drupalCreateUser(['administer site configuration']); + $this->drupalLogin($this->user); + } + + /** + * Tests that the home page loads with a 200 response. + */ + public function testLoad() { + $this->drupalGet(Url::fromRoute('<front>')); + $this->assertSession()->statusCodeEquals(200); + } + +} |