Skip to content

Commit

Permalink
Merge pull request #532 from compucorp/PCHR-3930-Hide-the-recruitment…
Browse files Browse the repository at this point in the history
…-vacancy

PCHR-3930: Uninstall HR-Recruitment Extension
  • Loading branch information
davialexandre authored Sep 18, 2018
2 parents 9da1d00 + df662b2 commit 5565d23
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 416 deletions.
10 changes: 9 additions & 1 deletion civihr_employee_portal/civihr_employee_portal.install
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,17 @@ function civihr_employee_portal_update_7035() {
}

/**
* Removes old 'Help' menu link from main menu
* Disables the HR Vacancies View
*/
function civihr_employee_portal_update_7036() {
$status = variable_get('views_defaults', []);
$status['hr-vacancies'] = TRUE;
variable_set('views_defaults', $status);
}
/**
* Removes old 'Help' menu link from main menu
*/
function civihr_employee_portal_update_7037() {
db_delete('menu_links')
->condition('link_title', 'help')
->condition('menu_name', 'main-menu')
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 5565d23

Please # to comment.