Skip to content

Conversation

@zonky2
Copy link
Contributor

@zonky2 zonky2 commented Nov 25, 2016

Hotfix hide datepicker is widget readonly and activate picker also for time

$arrFieldDef = parent::getFieldDefinition($arrOverrides);
$arrFieldDef['eval']['rgxp'] = $strDateType;
$arrFieldDef['eval']['datepicker'] = ($strDateType !== 'time');
$arrFieldDef['eval']['datepicker'] = !empty($arrFieldDef['eval']['readonly'])?false:true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to $arrFieldDef['eval']['datepicker'] = empty($arrFieldDef['eval']['readonly']); as the result is already boolean.

Since when is time picker supported? Do we need to bump the minimum version in composer.json along the way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary?
...the attribute timestamp require "contao/core" and this require "contao-components/all" and this require "contao-components/datepicker"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... o.k. separate PR

zonky2 added a commit to zonky2/attribute_timestamp that referenced this pull request Nov 30, 2016
$arrFieldDef['eval']['rgxp'] = $strDateType;
$arrFieldDef['eval']['datepicker'] = !empty($arrFieldDef['eval']['readonly'])?false:true;
$arrFieldDef['eval']['datepicker'] = empty($arrFieldDef['eval']['readonly']);
$arrFieldDef['eval']['tl_class'] .= ' wizard';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this class only be added when there really is a wizard?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we should have this gap at readonly - so we have a chance to add a own diabled button icon per CSS... I don´t find this feature at datepicker plugin

shot297

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fail to see the benefit of adding an icon which will never be clickable at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fail to see the benefit of adding an icon which will never be clickable at all.

it´s "contao standard" - the most icons habe a disabled status as "grey"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we have disabled wizards in Contao? O.o

Copy link
Contributor Author

@zonky2 zonky2 Dec 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not disabled wizards, but icons with status "disabled"

@zonky2
Copy link
Contributor Author

zonky2 commented Jan 4, 2017

@discordier with commit 8059400 should the label "Up for discussion" obsolete... and "we" can merge this...

@discordier discordier changed the base branch from master to hotfix/2.0.0-alpha4 January 6, 2017 15:57
@zonky2 zonky2 force-pushed the Hotfix_hide_datepicker_at_readonly branch 2 times, most recently from 6925cc7 to 05ca89f Compare January 6, 2017 16:56
zonky2 added a commit to zonky2/attribute_timestamp that referenced this pull request Jan 6, 2017
@zonky2 zonky2 force-pushed the Hotfix_hide_datepicker_at_readonly branch from 05ca89f to bfda4ee Compare January 6, 2017 17:31
zonky2 added a commit to zonky2/attribute_timestamp that referenced this pull request Jan 6, 2017
Squashed commit:

[37e87aa] add css class 'wizard'

[7cb826d] fix MetaModels#21 (review) (+1 squashed commits)

Squashed commits:

[251a525] Hotfix hide datepicker is widget readonly
@zonky2 zonky2 force-pushed the Hotfix_hide_datepicker_at_readonly branch from bfda4ee to 3aaceb6 Compare January 6, 2017 17:33
@discordier discordier merged commit 3aaceb6 into MetaModels:hotfix/2.0.0-alpha4 Jan 12, 2017
discordier added a commit that referenced this pull request Jan 12, 2017
@zonky2
Copy link
Contributor Author

zonky2 commented Jan 13, 2017

@discordier
Copy link
Member

?

@zonky2
Copy link
Contributor Author

zonky2 commented Jan 13, 2017

without this its not possible to save a input mask with readonly timestamp

$arrFieldDef = parent::getFieldDefinition($arrOverrides);
$arrFieldDef['eval']['rgxp'] = $strDateType;

if (!empty($arrFieldDef['eval']['readonly'])) {
Copy link
Contributor Author

@zonky2 zonky2 Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false condition :-(

-        if (!empty($arrFieldDef['eval']['readonly'])) {
+        if (empty($arrFieldDef['eval']['readonly'])) {

@discordier
Copy link
Member

Eh, YOU told me it is ok to merge.

@zonky2
Copy link
Contributor Author

zonky2 commented Jan 13, 2017

nobody is perfect :-(

@discordier
Copy link
Member

Ok, we will fix. Need a unit test then. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants