Home: Fix birthdays lost range option

This commit is contained in:
nathan 2023-03-14 15:02:02 -06:00
parent 10fc2390f6
commit 0f1866eb19
4 changed files with 5 additions and 34 deletions

View File

@ -417,10 +417,10 @@ export class Et2Portlet extends Et2Widget(SlCard)
{
let content = this.portletProperties;
// Add values, but skip any lingering properties
// Add values, but skip any duplicate properties
Object.keys(this.settings).forEach(k =>
{
if(typeof k == "string" && isNaN(parseInt(k)))
if(typeof k == "string" && isNaN(parseInt(k)) || content.filter(v => v.name == this.settings[k].name).length == 0)
{
content[k] = this.settings[k];
}

View File

@ -177,8 +177,8 @@ use EGroupware\Api\Etemplate;
$properties[] = array(
'name' => 'days',
'type' => 'et2-selectbox',
'label' => '',
'type' => 'et2-select',
'label' => 'Birthdays',
'default' => 3,
'select_options' => array(
1 => lang('Yes, for today and tomorrow'),

View File

@ -189,35 +189,6 @@ class home_link_portlet extends home_portlet
$etemplate->exec('home.home_link_portlet.exec',$content);
}
/**
* Return a list of settings to customize the portlet.
*
* Settings should be in the same style as for preferences. It is OK to return an empty array
* for no customizable settings.
*
* These should be already translated, no further Api\Translation will be done.
*
* @see preferences/inc/class.preferences_settings.inc.php
* @return Array of settings. Each setting should have the following keys:
* - name: Internal reference
* - type: Widget type for editing
* - label: Human name
* - help: Description of the setting, and what it does
* - default: Default value, for when it's not set yet
*/
public function get_properties()
{
$properties = parent::get_properties();
$properties[] = array(
'name' => 'entry',
'type' => 'link-entry',
'label' => lang('Entry'),
'size' => ''
);
return $properties;
}
/**
* Return a list of allowable actions for the portlet.
*

View File

@ -200,7 +200,7 @@ class home_ui
$settings = $portlet->get_properties();
foreach($settings as $key => $setting)
{
if(is_array($setting) && !array_key_exists('type', $setting) || is_numeric($key))
if(is_array($setting) && !array_key_exists('type', $setting))
{
unset($settings[$key]);
}