Skip to content

Commit

Permalink
Merge pull request #271 from compucorp/staging
Browse files Browse the repository at this point in the history
Sync master with staging
  • Loading branch information
AkA84 authored Feb 10, 2017
2 parents ce4fdee + 9b93a31 commit ab00055
Show file tree
Hide file tree
Showing 9 changed files with 461 additions and 327 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
CiviHR employee portal custom Drupal modules
======================

DEMO site available here:
http://178.79.132.53/welcome-page
CiviHR demo site is available at:

http://demo.civihrhosting.co.uk/

For more information about CiviHR see:

http://civihr.org/

======================

Installation instructions - CiviHR 1.5
Installation instructions - CiviHR 1.6+
======================

- Install the hr15 profile with civicrm_buildkit (https://github.com/civicrm/civicrm-buildkit)
- Example command to install CiviHR: civibuild create hr15 --civi-ver 4.5 --url http://localhost:8900
- CiviHR is currently most easily installed by using CiviCRM Buildkit. Build kit can be downloaded from the following link:

https://github.com/civicrm/civicrm-buildkit

Optionally:
- search for civihr_staff -> set absence entitlement for holidays, maternity etc
- put the leave approver for the civihr_staff, for example put leave approver as civihr_manager, after requesting a leave as staff, the civihr_manager will need to approve that leave.
- Install the hr16 profile with civicrm_buildkit
- Example command to install CiviHR: civibuild create hr16 --civi-ver 4.7 --url http://localhost:8900
26 changes: 26 additions & 0 deletions civihr_employee_portal/civihr_employee_portal.module
Original file line number Diff line number Diff line change
Expand Up @@ -7431,3 +7431,29 @@ function civihr_employee_portal_html_head_alter(&$head_elements) {

$head_elements[$default_favicon_element]['#attributes']['href'] = "{$base_url}/{$icoPath}";
}

/**
* Return current version of Civihr.
*/
function get_civihr_version() {
$civihrVersion = &drupal_static(__FUNCTION__);

if (!isset($civihrVersion)) {
if ($cache = cache_get('civihr_version')) {
$civihrVersion = $cache->data;
} else {
try {
// Civi init
civicrm_initialize();
$result = civicrm_api3('HRCoreInfo', 'getversion', array('sequential' => 1));
$civihrVersion = $result['values'];
} catch (CiviCRM_API3_Exception $e) {
$error = $e->getMessage();
}

cache_set('civihr_version', $civihrVersion, 'cache', time() + 86400);
}
}

return $civihrVersion;
}
24 changes: 24 additions & 0 deletions civihr_employee_portal/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,27 @@ span.appraisals-employee-legend {
vertical-align: middle;
padding-left: 10px;
}

#footer {
height: 250px;
color: #727e8a;
padding-top: 85px;
font-size: 13px;
line-height: 2;
}

#footer a {
color: #42afcb;
}

#footer a:hover {
color: #42afcb;
}

#footer a:visited {
color: #42afcb;
}

.footer-logo {
margin-top: 25px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -629,137 +629,176 @@ function civihr_employee_portal_features_default_page_manager_pages() {
$display->cache = array();
$display->title = '<none>';
$display->uuid = '65fa22bb-05c5-4318-b3eb-20181449dc7a';
$display->storage_type = 'page_manager';
$display->storage_id = 'page_welcome_page_panel_context';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-3f0db58e-4030-419c-add3-07e0e6e8c7e0';
$pane->panel = 'column2';
$pane->type = 'custom';
$pane->subtype = 'custom';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'admin_title' => '',
'title' => '',
'body' => '<div id="block-header-welcome">
<div class="row">
<div class="col-xs-12 text-center">
<div class="logo-rect-wrapper">
<img src="sites/all/modules/civihr-custom/civihr_employee_portal/images/logo.png">
</div>
<h1>CiviHR DEMO</h1>
<h2>Self Service Portal</h2>
</div>
</div>
</div>',
'format' => 'full_html',
'substitute' => TRUE,
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '3f0db58e-4030-419c-add3-07e0e6e8c7e0';
$display->content['new-3f0db58e-4030-419c-add3-07e0e6e8c7e0'] = $pane;
$display->panels['column2'][0] = 'new-3f0db58e-4030-419c-add3-07e0e6e8c7e0';
$pane = new stdClass();
$pane->pid = 'new-f122256d-6524-48e1-a630-60a24dfb412e';
$pane->panel = 'column2';
$pane->type = 'block';
$pane->subtype = 'user-login';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 1,
'override_title_text' => 'Login:',
'override_title_heading' => 'h2',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = 'f122256d-6524-48e1-a630-60a24dfb412e';
$display->content['new-f122256d-6524-48e1-a630-60a24dfb412e'] = $pane;
$display->panels['column2'][1] = 'new-f122256d-6524-48e1-a630-60a24dfb412e';
$pane = new stdClass();
$pane->pid = 'new-c1e74a5e-1513-4ae2-bd55-e097b00d3575';
$pane->panel = 'column2';
$pane->type = 'custom';
$pane->subtype = 'custom';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'admin_title' => '',
'title' => '',
'body' => '<p class="text-center">Don\'t have a login?
<a href="/request_new_account/nojs" class="ctools-use-modal ctools-modal-civihr-default-style ctools-use-modal-processed" title="Request new account">Click here to request one from your HR administrator</a></p>',
'format' => 'full_html',
'substitute' => TRUE,
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 2;
$pane->locks = array();
$pane->uuid = 'c1e74a5e-1513-4ae2-bd55-e097b00d3575';
$display->content['new-c1e74a5e-1513-4ae2-bd55-e097b00d3575'] = $pane;
$display->panels['column2'][2] = 'new-c1e74a5e-1513-4ae2-bd55-e097b00d3575';
$pane = new stdClass();
$pane->pid = 'new-34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2';
$pane->panel = 'header';
$pane->type = 'node';
$pane->subtype = 'node';
$pane->shown = TRUE;
$pane->access = array(
'plugins' => array(
0 => array(
'name' => 'role',
'settings' => array(
'rids' => array(
0 => 30037204,
),
$pane = new stdClass();
$pane->pid = 'new-889a60ef-1b56-4330-85cf-d3c0f25fcc01';
$pane->panel = 'column2';
$pane->type = 'page_logo';
$pane->subtype = 'page_logo';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array(
'css_id' => 'block-welcome-logo',
'css_class' => '',
);
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '889a60ef-1b56-4330-85cf-d3c0f25fcc01';
$display->content['new-889a60ef-1b56-4330-85cf-d3c0f25fcc01'] = $pane;
$display->panels['column2'][0] = 'new-889a60ef-1b56-4330-85cf-d3c0f25fcc01';
$pane = new stdClass();
$pane->pid = 'new-3b43f2a1-c244-4018-adcc-ee092c4fa9d8';
$pane->panel = 'column2';
$pane->type = 'page_site_name';
$pane->subtype = 'page_site_name';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'linked' => 0,
'override_title' => 0,
'override_title_text' => '',
'override_title_heading' => 'h2',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array(
'css_id' => 'block-welcome-sitename',
'css_class' => '',
);
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$pane->uuid = '3b43f2a1-c244-4018-adcc-ee092c4fa9d8';
$display->content['new-3b43f2a1-c244-4018-adcc-ee092c4fa9d8'] = $pane;
$display->panels['column2'][1] = 'new-3b43f2a1-c244-4018-adcc-ee092c4fa9d8';
$pane = new stdClass();
$pane->pid = 'new-6f7f063d-ef96-4a44-8e20-921039687b30';
$pane->panel = 'column2';
$pane->type = 'page_slogan';
$pane->subtype = 'page_slogan';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array(
'css_id' => 'block-welcome-slogan',
'css_class' => '',
);
$pane->extras = array();
$pane->position = 2;
$pane->locks = array();
$pane->uuid = '6f7f063d-ef96-4a44-8e20-921039687b30';
$display->content['new-6f7f063d-ef96-4a44-8e20-921039687b30'] = $pane;
$display->panels['column2'][2] = 'new-6f7f063d-ef96-4a44-8e20-921039687b30';
$pane = new stdClass();
$pane->pid = 'new-f122256d-6524-48e1-a630-60a24dfb412e';
$pane->panel = 'column2';
$pane->type = 'block';
$pane->subtype = 'user-login';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 1,
'override_title_text' => 'Login:',
'override_title_heading' => 'h2',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 3;
$pane->locks = array();
$pane->uuid = 'f122256d-6524-48e1-a630-60a24dfb412e';
$display->content['new-f122256d-6524-48e1-a630-60a24dfb412e'] = $pane;
$display->panels['column2'][3] = 'new-f122256d-6524-48e1-a630-60a24dfb412e';
$pane = new stdClass();
$pane->pid = 'new-c1e74a5e-1513-4ae2-bd55-e097b00d3575';
$pane->panel = 'column2';
$pane->type = 'custom';
$pane->subtype = 'custom';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'admin_title' => '',
'title' => '',
'body' => '<p class="text-center">Don\'t have a login?
<a href="/request_new_account/nojs" class="ctools-use-modal ctools-modal-civihr-default-style ctools-use-modal-processed" title="Request new account">Click here to request one from your HR administrator</a></p>',
'format' => 'full_html',
'substitute' => TRUE,
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 4;
$pane->locks = array();
$pane->uuid = 'c1e74a5e-1513-4ae2-bd55-e097b00d3575';
$display->content['new-c1e74a5e-1513-4ae2-bd55-e097b00d3575'] = $pane;
$display->panels['column2'][4] = 'new-c1e74a5e-1513-4ae2-bd55-e097b00d3575';
$pane = new stdClass();
$pane->pid = 'new-34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2';
$pane->panel = 'header';
$pane->type = 'node';
$pane->subtype = 'node';
$pane->shown = TRUE;
$pane->access = array(
'plugins' => array(
0 => array(
'name' => 'role',
'settings' => array(
'rids' => array(
0 => 30037204,
),
'context' => 'logged-in-user',
'not' => FALSE,
),
'context' => 'logged-in-user',
'not' => FALSE,
),
);
$pane->configuration = array(
'nid' => '1',
'links' => 1,
'leave_node_title' => 0,
'identifier' => '',
'build_mode' => 'full',
'link_node_title' => 0,
'override_title' => 1,
'override_title_text' => '<none>',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2';
$display->content['new-34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2'] = $pane;
$display->panels['header'][0] = 'new-34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2';
),
);
$pane->configuration = array(
'nid' => '1',
'links' => 1,
'leave_node_title' => 0,
'identifier' => '',
'build_mode' => 'full',
'link_node_title' => 0,
'override_title' => 1,
'override_title_text' => '<none>',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$pane->uuid = '34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2';
$display->content['new-34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2'] = $pane;
$display->panels['header'][0] = 'new-34a8c3b9-acb5-4419-ba57-7ebfc1f3e8f2';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = '0';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;

$pages['welcome_page'] = $page;

return $pages;
Expand Down
Loading

0 comments on commit ab00055

Please sign in to comment.