Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
b83f0b44b4 | |||
7f88d409f0 | |||
8841fd4d25 | |||
87241c1f87 | |||
2a1607c6d9 | |||
d8fd12a7b9 | |||
e4a04a254d | |||
88b5ce3d2e | |||
f47ded38fa | |||
c63cae6b71 |
@ -477,7 +477,7 @@ display:
|
||||
admin_label: ''
|
||||
empty: true
|
||||
tokenize: false
|
||||
content: "<p>Either there are no cases involving this person, or you do not have access to them.</p> <p>To create a case, use the sidebar menu to the right</p>"
|
||||
content: "<p>Either there are no cases involving this person, or you do not have access to them.</p>\n"
|
||||
plugin_id: text_custom
|
||||
relationships: { }
|
||||
arguments:
|
||||
@ -584,7 +584,7 @@ display:
|
||||
admin_label: ''
|
||||
empty: true
|
||||
tokenize: false
|
||||
content: "<h1>No cases found</h1>\n<p>You do not have access to any existing cases.</p>\n<p>To <b>add a new case</b>, first search for the person you want to create a case for, using the search bar at the top right of the screen. If they are not on the system yet, add them using the <b>Add People</b> tab.</p>\n"
|
||||
content: "<h1>No cases found</h1>\n<p>You do not have access to any existing cases.</p>\n<p>To <b>add a new case</b>, first search for the person you want to add a case to. If they are not on the system yet you can add them using the <b>Add actors</b> menu in the left sidebar.</p>\n"
|
||||
plugin_id: text_custom
|
||||
cache_metadata:
|
||||
max-age: -1
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
function opencase_default_reporting_uninstall() {
|
||||
$configs = [
|
||||
'search_api.index.opencase_reporting_cases',
|
||||
'search_api.index.opencase_reporting_clients',
|
||||
'search_api.index.opencase_reporting_volunteers',
|
||||
// 'search_api.index.opencase_reporting_cases',
|
||||
// 'search_api.index.opencase_reporting_clients',
|
||||
// 'search_api.index.opencase_reporting_volunteers',
|
||||
'block.block.facet_asylum_status',
|
||||
'block.block.facet_created',
|
||||
'block.block.facet_disability',
|
||||
|
@ -1,14 +1,19 @@
|
||||
<?php
|
||||
|
||||
function opencase_entities_update_8016() {
|
||||
$update_manager = \Drupal::entityDefinitionUpdateManager();
|
||||
$definition = $update_manager->getFieldStorageDefinition('activity_date_time', 'oc_activity');
|
||||
$update_manager->updateFieldStorageDefinition($definition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add 'activity_date_time' field to 'oc_activity' entities.
|
||||
*/
|
||||
function opencase_entities_update_8003() {
|
||||
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('datetime')
|
||||
->setLabel(t('Date and time'))
|
||||
->setDescription(t('When the activity started.'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
||||
->setDefaultValueCallback('\Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
||||
->setDisplayOptions('view', [
|
||||
'type' => 'datetime_default',
|
||||
'settings' => [
|
||||
|
@ -86,7 +86,6 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
||||
public static function currentDateTime() {
|
||||
$current_time = DrupalDateTime::createFromTimestamp(time());
|
||||
$formatted = $current_time->format(DateTimeItem::DATETIME_STORAGE_FORMAT);
|
||||
\Drupal::logger("nr_debug")->notice($formatted);
|
||||
return $formatted;
|
||||
}
|
||||
/**
|
||||
@ -220,10 +219,9 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
||||
|
||||
$fields['activity_date_time'] = BaseFieldDefinition::create('datetime')
|
||||
->setLabel(t('Date and time'))
|
||||
->setDescription('')
|
||||
->setRevisionable(TRUE)
|
||||
->setRequired(TRUE)
|
||||
->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
||||
->setDefaultValueCallback('\Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
||||
->setDisplayOptions('view', [
|
||||
'label' => 'above',
|
||||
'type' => 'datetime_default',
|
||||
|
@ -2,7 +2,7 @@ name: 'OpenCase'
|
||||
type: module
|
||||
description: 'Simple Case Management'
|
||||
core: 8.x
|
||||
version: 8.x-1.6
|
||||
version: 8.x-1.6.5
|
||||
package: 'OpenCase'
|
||||
dependencies:
|
||||
- opencase_entities
|
||||
|
@ -9,6 +9,29 @@ use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\opencase\EntityTypeRelationsWidget;
|
||||
|
||||
/**
|
||||
* Implements hook_element_info_alter().
|
||||
*/
|
||||
function opencase_element_info_alter(array &$types) {
|
||||
$types['datetime']['#process'][] = 'opencase_process_element';
|
||||
}
|
||||
|
||||
/**
|
||||
* Element process callback for datetime fields. Removes the seconds part.
|
||||
*/
|
||||
function opencase_process_element($element) {
|
||||
if ($element['#date_time_element'] !== 'none') {
|
||||
$element['#date_time_format'] = 'H:i';
|
||||
}
|
||||
if (!empty($element['time']['#value'])) {
|
||||
$parts = explode(':', $element['time']['#value']);
|
||||
$parts = array_splice($parts, 0, 2);
|
||||
$element['time']['#value'] = implode(':', $parts);
|
||||
}
|
||||
// Remove seconds in browsers that support HTML5 type=date.
|
||||
$element['time']['#attributes']['step'] = 60;
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_block_access
|
||||
|
Reference in New Issue
Block a user