trinion_mrp-1.0.x-dev/trinion_mrp.install

trinion_mrp.install
<?php
/**
 * Implements hook_install().
 */
function trinion_mrp_install($is_syncing) {
  $role_object = \Drupal\user\Entity\Role::load('trinion_mrp');

  $role_object->grantPermission('create zapis_mrp content');
  $role_object->grantPermission('delete any zapis_mrp content');
  $role_object->grantPermission('edit any zapis_mrp content');

  $role_object->grantPermission('create mrp_specifikaciya content');
  $role_object->grantPermission('delete any mrp_specifikaciya content');
  $role_object->grantPermission('edit any mrp_specifikaciya content');

  $role_object->grantPermission('create mrp_zakaz_na_proizvodstvo content');
  $role_object->grantPermission('delete any mrp_zakaz_na_proizvodstvo content');
  $role_object->grantPermission('edit any mrp_zakaz_na_proizvodstvo content');

  $role_object->grantPermission('create mrp_rabochiy_centr content');
  $role_object->grantPermission('delete any mrp_rabochiy_centr content');
  $role_object->grantPermission('edit any mrp_rabochiy_centr content');

  $role_object->grantPermission('create mrp_rabochee_podrazdelenie content');
  $role_object->grantPermission('delete any mrp_rabochee_podrazdelenie content');
  $role_object->grantPermission('edit any mrp_rabochee_podrazdelenie content');

  $role_object->grantPermission('create mps content');
  $role_object->grantPermission('delete any mps content');
  $role_object->grantPermission('edit any mps content');

  $role_object->grantPermission('trinion_mrp zapis mrp');
  $role_object->grantPermission('trinion_mrp specificatiya mrp');
  $role_object->grantPermission('trinion_mrp proizvodstvenniy kalendar');
  $role_object->grantPermission('trinion_mrp rabochiy_centr');
  $role_object->grantPermission('trinion_mrp zakaz_na_proizvodstvo');
  $role_object->grantPermission('trinion_mrp rabochee_podrazdelenie');
  $role_object->grantPermission('trinion_mrp mps');

  $role_object->save();
}

function trinion_mrp_update_8001(&$sandbox) {
  $prefixes = [
    'node.type.mps',
    'core.base_field_override.node.mps.title',
    'core.base_field_override.node.mps.promote',
    'field.field.node.mps.field_tb_shablon_pechatnoy_formi',
    'field.field.node.mps.field_mrp_period_length_days',
    'field.field.node.mps.field_mrp_kolichestvo_periodov',
    'field.field.node.mps.field_tp_stroki',
    'field.field.node.mps.field_tp_data',
    'core.entity_form_display.node.mps.default',
    'core.entity_view_display.node.mps.teaser',
    'core.entity_view_display.node.mps.default',
    'views.view.crm_list_of_mps',
    'field.field.node.zapis_mrp.field_mrp_source_document',
    'core.entity_form_display.node.mrp_zakaz_na_proizvodstvo.default',
    'views.view.crm_list_of_mrp_reports',
    'views.view.crm_list_of_production_orders',
  ];
  $msg = trinion_base_common_update_operations($sandbox, $prefixes, __DIR__);

  return $msg;
}

function trinion_mrp_update_8002(&$sandbox) {
  $role_object = \Drupal\user\Entity\Role::load('trinion_mrp');
  $role_object->grantPermission('create mps content');
  $role_object->grantPermission('delete any mps content');
  $role_object->grantPermission('edit any mps content');
  $role_object->grantPermission('trinion_mrp mps');
  $role_object->save();
  return 'grant access';
}

function trinion_mrp_update_8003(&$sandbox) {
  $prefixes = [
    'views.view.crm_list_of_mps',
    'views.view.crm_list_of_mrp_reports',
  ];
  $msg = trinion_base_common_update_operations($sandbox, $prefixes, __DIR__);

  return $msg;
}

function trinion_mrp_update_8004(&$sandbox) {
  $prefixes = [
    'views.view.crm_list_of_mrp_reports',
  ];
  $msg = trinion_base_common_update_operations($sandbox, $prefixes, __DIR__);

  return $msg;
}

function trinion_mrp_update_8005(&$sandbox) {
  $prefixes = [
    'field.field.node.mps.field_tp_data',
  ];
  $msg = trinion_base_common_update_operations($sandbox, $prefixes, __DIR__);

  return $msg;
}

function trinion_mrp_update_8006(&$sandbox) {
  $prefixes = [
    'core.entity_view_display.node.zapis_mrp.default',
  ];
  $msg = trinion_base_common_update_operations($sandbox, $prefixes, __DIR__);

  return $msg;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc