Skip to content

Commit

Permalink
Merge pull request #457 from compucorp/staging
Browse files Browse the repository at this point in the history
Sync master with staging
  • Loading branch information
davialexandre authored Mar 26, 2018
2 parents 3101218 + 3b57b12 commit 3ac8371
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 16 deletions.
5 changes: 4 additions & 1 deletion civihr_employee_portal/civihr_employee_portal.module
Original file line number Diff line number Diff line change
Expand Up @@ -6095,7 +6095,10 @@ function _is_hrreports_data_table_view($viewName) {
* @return boolean
*/
function _is_scrollable_table_view_with_results($viewName) {
$viewsList = ['users_list'];
$viewsList = [
'civihr_staff_directory',
'users_list'
];

return in_array($viewName, $viewsList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,14 @@ function civihr_employee_portal_features_views_default_views() {
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'views_data_export_csv';
$handler->display->display_options['style_options']['provide_file'] = 1;
$handler->display->display_options['style_options']['parent_sort'] = 0;
$handler->display->display_options['style_options']['quote'] = 1;
$handler->display->display_options['style_options']['trim'] = 0;
$handler->display->display_options['style_options']['replace_newlines'] = 0;
$handler->display->display_options['style_options']['newline_token'] = '1';
$handler->display->display_options['style_options']['header'] = 1;
$handler->display->display_options['style_options']['keep_html'] = 0;
$handler->display->display_options['path'] = 'civihr_report_export_leave_and_absence';
$translatables['civihr_report_leave_and_absence'] = array(
t('Master'),
Expand Down Expand Up @@ -1867,6 +1875,14 @@ return date(\'Y-m-d\');';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'views_data_export_csv';
$handler->display->display_options['style_options']['provide_file'] = 1;
$handler->display->display_options['style_options']['parent_sort'] = 0;
$handler->display->display_options['style_options']['quote'] = 1;
$handler->display->display_options['style_options']['trim'] = 0;
$handler->display->display_options['style_options']['replace_newlines'] = 0;
$handler->display->display_options['style_options']['newline_token'] = '1';
$handler->display->display_options['style_options']['header'] = 1;
$handler->display->display_options['style_options']['keep_html'] = 0;
$handler->display->display_options['path'] = 'civihr_report_export_people';
$translatables['civihr_report_people'] = array(
t('Master'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="chr_search-result__header">
<div class="chr_search-result__total">
Results
<span class="chr_search-result__total__count"><?php echo count($rows); ?></span>
<span class="chr_search-result__total__count"><?php echo $view->total_rows; ?></span>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,7 @@ function civihr_employee_portal_views_query_alter(&$view, &$query) {
*/
function civihr_employee_portal_views_pre_view(&$view, &$display_id, &$args) {
// Custom configuration start for items per page
if (($view->name == 'civihr_staff_directory' && $display_id == 'page') ||
($view->name == 'hr_documents' && $display_id == 'hr_resources')) {
if ($view->name == 'hr_documents' && $display_id == 'hr_resources') {

// Set the custom header
$view->set_item_option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ class civihr_employee_portal_handler_aggregated_address extends views_handler_fi

return sprintf(
$format,
ArrayHelper::value('street_address', $address),
ArrayHelper::value('supplemental_address_1', $address),
ArrayHelper::value('city', $address),
ArrayHelper::value('state_province_id.name', $address),
ArrayHelper::value('postal_code', $address),
ArrayHelper::value('country_id.name', $address)
filter_xss(ArrayHelper::value('street_address', $address)),
filter_xss(ArrayHelper::value('supplemental_address_1', $address)),
filter_xss(ArrayHelper::value('city', $address)),
filter_xss(ArrayHelper::value('state_province_id.name', $address)),
filter_xss(ArrayHelper::value('postal_code', $address)),
filter_xss(ArrayHelper::value('country_id.name', $address))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class civihr_employee_portal_handler_emergency_contact_aggregated_address extend
$query = sprintf($format, $selectFields, $table, $id);
$result = CRM_Core_DAO::executeQuery($query);
$result = current($result->fetchAll());
foreach ($result as $i => $value) {
$result[$i] = filter_xss($value);
}

return array_filter($result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,14 @@ $handler = $view->new_display('views_data_export', 'Data export', 'views_data_ex
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'views_data_export_csv';
$handler->display->display_options['style_options']['provide_file'] = 1;
$handler->display->display_options['style_options']['parent_sort'] = 0;
$handler->display->display_options['style_options']['quote'] = 1;
$handler->display->display_options['style_options']['trim'] = 0;
$handler->display->display_options['style_options']['replace_newlines'] = 0;
$handler->display->display_options['style_options']['newline_token'] = '1';
$handler->display->display_options['style_options']['header'] = 1;
$handler->display->display_options['style_options']['keep_html'] = 0;
$handler->display->display_options['path'] = 'civihr_report_export_leave_and_absence';
$translatables['civihr_report_leave_and_absence'] = array(
t('Master'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,14 @@ $handler = $view->new_display('views_data_export', 'Data export', 'views_data_ex
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'views_data_export_csv';
$handler->display->display_options['style_options']['provide_file'] = 1;
$handler->display->display_options['style_options']['parent_sort'] = 0;
$handler->display->display_options['style_options']['quote'] = 1;
$handler->display->display_options['style_options']['trim'] = 0;
$handler->display->display_options['style_options']['replace_newlines'] = 0;
$handler->display->display_options['style_options']['newline_token'] = '1';
$handler->display->display_options['style_options']['header'] = 1;
$handler->display->display_options['style_options']['keep_html'] = 0;
$handler->display->display_options['path'] = 'civihr_report_export_people';
$translatables['civihr_report_people'] = array(
t('Master'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ $handler->display->display_options['style_options']['info'] = array(
'empty_column' => 0,
),
);
/* Header: Global: Result summary */
$handler->display->display_options['header']['result']['id'] = 'result';
$handler->display->display_options['header']['result']['table'] = 'views';
$handler->display->display_options['header']['result']['field'] = 'result';
$handler->display->display_options['header']['result']['content'] = '@total';
/* Footer: Global: Unfiltered text */
$handler->display->display_options['footer']['area_text_custom']['id'] = 'area_text_custom';
$handler->display->display_options['footer']['area_text_custom']['table'] = 'views';
Expand Down Expand Up @@ -772,7 +767,6 @@ $translatables['civihr_staff_directory'] = array(
t('‹ previous'),
t('next ›'),
t('last »'),
t('@total'),
t('HRJobContract Revision entity'),
t('HRJobContract Details entity'),
t('HRJobContract Role entity'),
Expand Down

0 comments on commit 3ac8371

Please sign in to comment.