Skip to content

Commit

Permalink
Merge pull request #558 from compucorp/staging
Browse files Browse the repository at this point in the history
Sync master with staging
  • Loading branch information
davialexandre authored Sep 18, 2018
2 parents d492391 + a41a763 commit 3e5bf12
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 415 deletions.
9 changes: 9 additions & 0 deletions civihr_employee_portal/civihr_employee_portal.install
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,15 @@ function civihr_employee_portal_update_7037() {
features_revert(['civihr_default_permissions' => ['user_permission']]);
}

/**
* Disables the HR Vacancies View
*/
function civihr_employee_portal_update_7038() {
$status = variable_get('views_defaults', []);
$status['hr-vacancies'] = TRUE;
variable_set('views_defaults', $status);
}

/**
* Function to determine whether menu link exists or not.
*
Expand Down
20 changes: 0 additions & 20 deletions civihr_employee_portal/civihr_employee_portal.module
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,6 @@ function _rebuild_appraisal_view() {
}
}

/**
* Rebuilds hrvacancy view.
*/
function _rebuild_hrvacancy_view() {
$extensions = CRM_Core_PseudoConstant::getExtensions();

if (!empty($extensions['org.civicrm.hrrecruitment'])) {
$civi_settings = parse_url(CIVICRM_DSN);
$civi_db_name = trim($civi_settings['path'], '/');

db_query('DROP VIEW IF EXISTS hrvacancy');
db_query("CREATE VIEW hrvacancy AS
SELECT id, start_date, end_date, status_id, description, position, salary, location
FROM {$civi_db_name}.civicrm_hrvacancy
WHERE status_id = 2");

variable_set('rebuild_hrvacancy_view', 'FALSE');
}
}

/**
* Rebuilds Tasks view.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,34 +350,6 @@ function civihr_employee_portal_features_menu_default_menu_links() {
'weight' => 4,
'customized' => 1,
);
// Exported menu link: main-menu_vacancies:hr-vacancies.
$menu_links['main-menu_vacancies:hr-vacancies'] = array(
'menu_name' => 'main-menu',
'link_path' => 'hr-vacancies',
'router_path' => 'hr-vacancies',
'link_title' => 'Vacancies',
'options' => array(
'attributes' => array(
'class' => array(
0 => 'fa',
1 => 'fa-user-plus',
),
),
'item_attributes' => array(
'id' => '',
'class' => '',
'style' => '',
),
'identifier' => 'main-menu_vacancies:hr-vacancies',
),
'module' => 'system',
'hidden' => 0,
'external' => 0,
'has_children' => 0,
'expanded' => 0,
'weight' => 7,
'customized' => 1,
);

// Translatables
// Included for use with string extractors like potx.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ features[menu_links][] = main-menu_my-details:hr-details
features[menu_links][] = main-menu_my-leave:my-leave
features[menu_links][] = main-menu_staff-directory:staff-directory
features[menu_links][] = main-menu_tasks:tasks-and-documents
features[menu_links][] = main-menu_vacancies:hr-vacancies
features[node][] = hr_documents
features[page_manager_pages][] = dashboard
features[page_manager_pages][] = my_details
Expand Down
24 changes: 0 additions & 24 deletions civihr_employee_portal/views/civihr_employee_portal.views.inc
Original file line number Diff line number Diff line change
Expand Up @@ -970,30 +970,6 @@ function civihr_employee_portal_views_post_render(&$view, &$output, &$cache) {
}
}

if ($view->name == 'hr_vacancies') {
_civihr_employee_portal_decode_vacancy_description_html($view, $output);
}
}

/**
* Decodes html entities in description for each vacancy so HTML tags are sent
* to the browser.
*
* @param object $view
* @param string $output
*/
function _civihr_employee_portal_decode_vacancy_description_html(&$view, &$output) {
$replacements = [];
$renderedFields = [];

if (isset($view->style_plugin->rendered_fields)) {
$renderedFields = $view->style_plugin->rendered_fields;
}
foreach ($renderedFields as $vacancy) {
$replacements[$vacancy['description']] = html_entity_decode($vacancy['description']);
}

$output = strtr($output, $replacements);
}

function removeAdditionalCommas($view) {
Expand Down
Loading

0 comments on commit 3e5bf12

Please sign in to comment.