Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Released v1.115
Browse files Browse the repository at this point in the history
  • Loading branch information
doo-project committed May 24, 2018
1 parent ddea708 commit 22ca03b
Show file tree
Hide file tree
Showing 85 changed files with 503 additions and 370 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# University of Helsinki Courses v1.115
Päiväys: 24.05.2018

## Lisäykset
- DOO-3469: Google event tracking: Opinnot-sivun välilehdet.

## Muutokset
- DOO-3509: Google Analytics: IP-osoitteiden anonymisointi.
- DOO-3467: Moodle-alueen luontipainikkeen tekstimuutoksia.
- DOO-3554: Rajatut sisällöt näkyviin vain vahvistetusti ilmoittautuneille
käytettäessä automaattista vahvistamista.
- DOO-3404: Kurssihierarkian esittämisen visuaalisia muutoksia.
- DOO-3553: Moodle-alueen luonnin käyttökokemusparannuksia.

## Korjaukset
- DOO-3477: Opetuskiel(i)en visuaalisia korjauksia.
- DOO-3473: Palautettiin luetteloiden muotoilu jakso- ja toteutussivuilla.

## Päivitykset
- DOO-3059: Styleguiden päivittäminen uusimpaan versioon.
- DOO-3542: Kielivalinta kurssiupotuksille.


# University of Helsinki Courses v1.114
Päiväys: 25.04.2018

Expand Down
4 changes: 2 additions & 2 deletions build-uh_coursepages.make
Original file line number Diff line number Diff line change
Expand Up @@ -336,5 +336,5 @@ projects[hy_cookie_consent][download][revision] = 909f20821c323240142962df38fb40
projects[uh_courses_embed][type] = module
projects[uh_courses_embed][download][type] = git
projects[uh_courses_embed][download][url] = "git://github.com/UH-StudentServices/uh_courses_embed.git"
projects[uh_courses_embed][download][branch] = master
projects[uh_courses_embed][download][revision] = 1d0b22cfa68127248842ee2438af3412bd644897
projects[uh_courses_embed][download][branch] = drupal7
projects[uh_courses_embed][download][revision] = ee5124a54f083953c08a557f6dc3e120e86b6ac8
2 changes: 1 addition & 1 deletion modules/uhc_activemq_connector/uhc_activemq_connector.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name = UHC ActiveMQ Connector
description = This module is deprecated.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_activemq_connector
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Analytics and Tracking
description = Specifies statistics/analytics for portal.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_analytics_and_tracking
dependencies[] = ctools
dependencies[] = facetapi
Expand All @@ -19,5 +19,6 @@ features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[variable][] = google_analytics_reports_api_cache_length
features[variable][] = googleanalytics_pages
features[variable][] = googleanalytics_tracker_anonymizeip
features[views_view][] = uhc_google_analytics_reports_page
files[] = plugins/uhc_google_analytics_reports_plugin_argument_default_google_analytics_reports_path.inc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,24 @@ function uhc_analytics_and_tracking_google_analytics_et_api() {
'action' => 'click',
);

// Horizontal tabs on studies landing page: Course catalogue.
$selectors[] = array(
'event' => 'click',
'selector' => '.node-type-studies-landing-page #course-catalogue + .horizontal-tabs a',
'category' => 'Studies landing page: Course catalogue tabs',
'label' => '!text',
'action' => 'click',
);

// Horizontal tabs on studies landing page: Summer course catalogue.
$selectors[] = array(
'event' => 'click',
'selector' => '.node-type-studies-landing-page #course-catalogue-summer ~ .clearfix .horizontal-tabs a',
'category' => 'Studies landing page: Summer course catalogue tabs',
'label' => '!text',
'action' => 'click',
);

return $selectors;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ node/add*
user/*/*';
$export['googleanalytics_pages'] = $strongarm;

$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'googleanalytics_tracker_anonymizeip';
$strongarm->value = 1;
$export['googleanalytics_tracker_anonymizeip'] = $strongarm;

$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ function uhc_analytics_and_tracking_views_default_views() {
'empty_column' => 0,
),
);
/* Field: Page tracking calculated metrics: Avg. Time on Page */
/* Field: Page Tracking: Avg. Time on Page */
$handler->display->display_options['fields']['avgTimeOnPage']['id'] = 'avgTimeOnPage';
$handler->display->display_options['fields']['avgTimeOnPage']['table'] = 'google_analytics';
$handler->display->display_options['fields']['avgTimeOnPage']['field'] = 'avgTimeOnPage';
$handler->display->display_options['fields']['avgTimeOnPage']['date_format'] = 'long';
$handler->display->display_options['fields']['avgTimeOnPage']['second_date_format'] = 'long';
/* Contextual filter: Page tracking dimensions: Page */
/* Contextual filter: Page Tracking: Page */
$handler->display->display_options['arguments']['pagePath']['id'] = 'pagePath';
$handler->display->display_options['arguments']['pagePath']['table'] = 'google_analytics';
$handler->display->display_options['arguments']['pagePath']['field'] = 'pagePath';
Expand Down Expand Up @@ -116,20 +116,20 @@ function uhc_analytics_and_tracking_views_default_views() {
$handler->display->display_options['empty']['area_text_custom']['empty'] = TRUE;
$handler->display->display_options['empty']['area_text_custom']['content'] = 'Page doesn\'t have any statistics.';
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Page tracking metrics: Pageviews */
/* Field: Page Tracking: Pageviews */
$handler->display->display_options['fields']['pageviews']['id'] = 'pageviews';
$handler->display->display_options['fields']['pageviews']['table'] = 'google_analytics';
$handler->display->display_options['fields']['pageviews']['field'] = 'pageviews';
$handler->display->display_options['fields']['pageviews']['precision'] = '0';
$handler->display->display_options['fields']['pageviews']['separator'] = '';
/* Field: Page tracking metrics: Unique Pageviews */
/* Field: Page Tracking: Unique Pageviews */
$handler->display->display_options['fields']['uniquePageviews']['id'] = 'uniquePageviews';
$handler->display->display_options['fields']['uniquePageviews']['table'] = 'google_analytics';
$handler->display->display_options['fields']['uniquePageviews']['field'] = 'uniquePageviews';
$handler->display->display_options['fields']['uniquePageviews']['label'] = 'Unique pageviews';
$handler->display->display_options['fields']['uniquePageviews']['precision'] = '0';
$handler->display->display_options['fields']['uniquePageviews']['separator'] = '';
/* Field: Page tracking calculated metrics: Avg. Time on Page */
/* Field: Page Tracking: Avg. Time on Page */
$handler->display->display_options['fields']['avgTimeOnPage']['id'] = 'avgTimeOnPage';
$handler->display->display_options['fields']['avgTimeOnPage']['table'] = 'google_analytics';
$handler->display->display_options['fields']['avgTimeOnPage']['field'] = 'avgTimeOnPage';
Expand All @@ -138,7 +138,7 @@ function uhc_analytics_and_tracking_views_default_views() {
$handler->display->display_options['fields']['avgTimeOnPage']['custom_date_format'] = 'i:s';
$handler->display->display_options['fields']['avgTimeOnPage']['second_date_format'] = 'long';
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Page tracking dimensions: Page */
/* Contextual filter: Page Tracking: Page */
$handler->display->display_options['arguments']['pagePath']['id'] = 'pagePath';
$handler->display->display_options['arguments']['pagePath']['table'] = 'google_analytics';
$handler->display->display_options['arguments']['pagePath']['field'] = 'pagePath';
Expand Down
2 changes: 1 addition & 1 deletion modules/uhc_autofill_metadata/uhc_autofill_metadata.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Autofill Metadata
description = Fetches user metadata from Shibboleth integration.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_autofill_metadata
dependencies[] = ctools
dependencies[] = features
Expand Down
68 changes: 38 additions & 30 deletions modules/uhc_autofill_metadata/uhc_autofill_metadata.module
Original file line number Diff line number Diff line change
Expand Up @@ -252,27 +252,61 @@ function uhc_autofill_metadata_get_enrollments($personal_unique_code) {
if (isset($enrollment_data['status']) && $enrollment_data['status'] == 200 && !empty($enrollment_data['data'])) {
foreach ($enrollment_data['data'] as $enrollment) {
if (isset($enrollment['course_id'])) {
$enrollments[] = $enrollment['course_id'];
if (uhc_autofill_metadata_is_enrollment_confirmed($enrollment)) {
$enrollments[] = $enrollment['course_id'];
}
}
}
}

return $enrollments;
}

/**
* An enrollment is considered confirmed if automatic confirmation is not
* enabled or automatic confirmation is enabled and the confirmation time is in
* the past.
*
* @param array $enrollment
* @return bool Is the enrollment confirmed?
*/
function uhc_autofill_metadata_is_enrollment_confirmed($enrollment) {
return empty($enrollment['automatic_enabled'])
|| $enrollment['automatic_enabled'] != 'true'
|| uhc_autofill_metadata_has_enrollment_confirmation_time_passed($enrollment);
}

/**
* Parses enrollment confirmation end time and returns whether it has passed.
*
* @param array $enrollment
* @return bool Has the enrollment confirmation time passed?
*/
function uhc_autofill_metadata_has_enrollment_confirmation_time_passed($enrollment) {
$end_date = !empty($enrollment['automatic_end_date']) ? date_create($enrollment['automatic_end_date']) : NULL;
$end_time = !empty($enrollment['automatic_end_time']) ? $enrollment['automatic_end_time'] : NULL;
$end_time_hours_minutes_seconds = isset($end_time) ? str_split($end_time, 2) : NULL;

if (isset($end_date, $end_time_hours_minutes_seconds)) {
date_add($end_date, date_interval_create_from_date_string("$end_time_hours_minutes_seconds[0] hours"));
date_add($end_date, date_interval_create_from_date_string("$end_time_hours_minutes_seconds[1] minutes"));
date_add($end_date, date_interval_create_from_date_string("$end_time_hours_minutes_seconds[2] seconds"));
}

return isset($end_date) && $end_date->getTimestamp() <= REQUEST_TIME;
}

/**
* Returns enrollment information for the given user identified by personal
* unique code.
*
* @param string $personal_unique_code
* Personal unique code, typically student number.
* @param bool $filter_relevant_only
* If TRUE, filters enrollments that are relevant for students.
* @return array|NULL
* Enrollment information (if found), NULL if not found or empty array if an error
* occured.
*/
function uhc_autofill_metadata_get_enrollment_data($personal_unique_code, $filter_relevant_only = FALSE) {
function uhc_autofill_metadata_get_enrollment_data($personal_unique_code) {

// For easier debugging, we can fake our enrollment response by using this
// Drupal variable (if it's set).
Expand Down Expand Up @@ -308,35 +342,9 @@ function uhc_autofill_metadata_get_enrollment_data($personal_unique_code, $filte
}
}

// When enrollment data is available and we want to filter relevant courses
if ($filter_relevant_only === TRUE && !empty($enrollment_data)) {
$enrollment_data = uhc_autofill_metadata_get_enrollment_filtered($enrollment_data);
}

return $enrollment_data;
}

/**
* Fiters non-relevant enrollments out and returns relevant courses.
*
* @param array $enrollments
* @return array
* Returns $enrollments without non-relevant courses.
*/
function uhc_autofill_metadata_get_enrollment_filtered(array $enrollments) {
$return = $enrollments;
$return['data'] = array();
for ($i = 0; $i < count($enrollments['data']); $i++) {
if (!empty($enrollments['data'][$i]['end_date'])) {
if (strtotime($enrollments['data'][$i]['end_date']) > REQUEST_TIME) {
// When end date is in the future, append enrollment to unfiltered list
$return['data'][] = $enrollments['data'][$i];
}
}
}
return $return;
}

function uhc_autofill_metadata_set_enrollments($account, $enrollments) {
if ($enrollments !== FALSE) {
$account->field_enrollments[LANGUAGE_NONE] = array();
Expand Down
2 changes: 1 addition & 1 deletion modules/uhc_autologin/uhc_autologin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name = UHC Autologin
description = Provides autologin services.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_autologin
dependencies[] = shib_auth
2 changes: 1 addition & 1 deletion modules/uhc_avatar/uhc_avatar.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name = UHC Avatar
description = Provides avatar (user image) related functionality
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_avatar
2 changes: 1 addition & 1 deletion modules/uhc_cache_warmer/uhc_cache_warmer.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name = UHC Cache Warmer
description = Provides a drush command for generating a hub pages file for the cache_warmer module.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_cache_warmer
2 changes: 1 addition & 1 deletion modules/uhc_comment/uhc_comment.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Comment
description = Configures comments for this portal.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_comment
dependencies[] = comment
dependencies[] = ctools
Expand Down
2 changes: 1 addition & 1 deletion modules/uhc_contact_card/uhc_contact_card.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Contact card
description = Provides Contact Card content type
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_contact_card
dependencies[] = ctools
dependencies[] = email
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = UHC Content Administration
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_content_administration_feature
dependencies[] = actions_permissions
dependencies[] = admin_menu
Expand Down
2 changes: 1 addition & 1 deletion modules/uhc_course/uhc_course.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = UHC Course
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course
dependencies[] = ctools
dependencies[] = entity_token
Expand Down
2 changes: 1 addition & 1 deletion modules/uhc_course/uhc_course.module
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function theme_oodi_field($variables) {
if (empty($variables['value'])) {
return NULL;
}
return '<div class="tube"><h3>' . $variables['title'] . '</h3><div class="oodi-field">' . $variables['value'] . '</div></div>';
return '<div class="tube"><h3>' . $variables['title'] . '</h3><div class="oodi-field textarea">' . $variables['value'] . '</div></div>';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Course Collaboration
description = Organic Groups for course implementation nodes
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course_collaboration
dependencies[] = ctools
dependencies[] = features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Course Collaboration Private
description = Extends collaboration by providing option to share content privately.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course_collaboration_private
dependencies[] = comment_og
dependencies[] = conditional_fields
Expand Down
2 changes: 1 addition & 1 deletion modules/uhc_course_hierarchy/uhc_course_hierarchy.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Course Hierarchy
description = Shows the hierarchy for users in course implementation pages.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course_hierarchy
php = 5.4
dependencies[] = uhc_autofill_metadata
Expand Down
3 changes: 2 additions & 1 deletion modules/uhc_course_hierarchy/uhc_course_hierarchy.module
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ function uhc_course_hierarchy_get_course_children(stdClass $node) {
// Second loop, we generate link items. Use children path if user has
// access, otherwise use previously defined fallback path.
$items = array();
$link_options = array('attributes' => array('class' => array('button--action-before', 'icon--arrow-right', 'theme-transparent')));
foreach ($children as $child) {
// If user has no rights to path and it does not contain grandchildren,
// then do not render an link item. See DOO-2338.
Expand All @@ -212,7 +213,7 @@ function uhc_course_hierarchy_get_course_children(stdClass $node) {
// CSS styling for grouping reasons.
$path = $access ? $child['uri']['path'] : $fallback_path;
$items[] = array(
'data' => l($child['label'], $path),
'data' => l($child['label'], $path, $link_options),
'class' => uhc_course_hierarchy_get_attributes($child['node']),
'children' => $grandchildren,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Course implementation
description = This feature provides content type for course implementations
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course_implementation
dependencies[] = ctools
dependencies[] = date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Course Implementation Activity
description = Tracks activity of course implementation.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course_implementation_activity
dependencies[] = comment
dependencies[] = ctools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = UHC Course Implementation Activity MECE
description = Sends all activity notifications to Message Center.
core = 7.x
package = UHC
version = 7.x-1.114
version = 7.x-1.115
project = uhc_course_implementation_activity_mece
dependencies[] = uh_mece_notifications
dependencies[] = uhc_course_implementation
Expand Down
Loading

0 comments on commit 22ca03b

Please sign in to comment.