enable web-components for all date and select (without tags or search attribute)

also reverting unnecessary explicit changes to et2-* in infolog.edit
This commit is contained in:
ralf 2022-02-16 10:38:28 +02:00
parent f29da5e613
commit a7ba4c0727
2 changed files with 17 additions and 13 deletions

View File

@ -87,9 +87,15 @@ function send_template()
// add et2-prefix for <select-* or <date-* readonly="true"
if (isset($attrs['readonly']) && !in_array($attrs['readonly'], ['false', '0']) ||
// also add it for untyped/simple <select without search or tags attribute
$matches[1] === 'select' && empty($matches[2]) && !isset($attrs['type']) && !isset($attrs['search']) && !isset($attrs['tags']))
// also add it for <date* and <select* without search or tags attribute
$matches[1] === 'date' || $matches[1] === 'select' && !isset($attrs['search']) && !isset($attrs['tags']))
{
// type attribute need to go in widget type <select type="select-account" --> <et2-select-account
if (empty($matches[2]) && isset($attrs['type']))
{
$matches[1] = $attrs['type'];
$matches[3] = str_replace('type="'.$attrs['type'].'"', '', $matches[3]);
}
return '<et2-'.$matches[1].$matches[2].' '.$matches[3].'></et2-'.$matches[1].$matches[2].'>';
}
return $matches[0];

View File

@ -3,7 +3,7 @@
<!-- $Id$ -->
<overlay>
<template id="infolog.edit.description" template="" lang="" group="0" version="1.6.001">
<et2-textarea id="info_des" no_lang="1"/>
<textbox id="info_des" no_lang="1" multiline="true"/>
<checkbox id="clean_history"/>
</template>
<template id="infolog.edit.links" template="" lang="" group="0" version="1.3.001">
@ -154,7 +154,7 @@
<rows>
<row class="dialogHeader">
<description value="Title" for="info_subject"/>
<et2-textbox statustext="a short subject for the entry" id="info_subject" class="et2_fullWidth et2_required" maxlength="255" span="4" tabindex="1"></et2-textbox>
<textbox statustext="a short subject for the entry" id="info_subject" class="et2_fullWidth et2_required" maxlength="255" span="4" tabindex="1"></textbox>
<textbox type="integer" id="info_number" readonly="true"/>
<appicon src="infolog" for="info_number"/>
</row>
@ -165,10 +165,8 @@
</menulist>
<description/>
<description value="Startdate" for="info_startdate"/>
<date-time
statustext="when should the ToDo or Phonecall be started, it shows up from that date in the filter open or own open (startpage)"
id="info_startdate" class="et2_fullWidth">
</date-time>
<date-time id="info_startdate" class="et2_fullWidth"
statustext="when should the ToDo or Phonecall be started, it shows up from that date in the filter open or own open (startpage)"/>
</row>
<row class="dialogHeader3">
<description value="Contact"/>
@ -220,16 +218,16 @@
</row>
<row disabled="!@info_owner" class="dialogOperators">
<description value="Owner"/>
<et2-hbox>
<hbox>
<select-account id="info_owner" readonly="true"/>
<date-time id="info_created" readonly="true" align="right"/>
</et2-hbox>
</hbox>
<description/>
<description value="Last modified"/>
<et2-hbox>
<hbox>
<select-account id="info_modifier" readonly="true"/>
<date-time id="info_datemodified" readonly="true" align="right"/>
</et2-hbox>
</hbox>
</row>
<row class="dialogFooterToolbar">
<hbox span="all">
@ -251,4 +249,4 @@
</rows>
</grid>
</template>
</overlay>
</overlay>