From 0f1866eb1920caa7107de430afe4a192439630be Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 14 Mar 2023 15:02:02 -0600 Subject: [PATCH] Home: Fix birthdays lost range option --- api/js/etemplate/Et2Portlet/Et2Portlet.ts | 4 +-- home/inc/class.home_birthday_portlet.inc.php | 4 +-- home/inc/class.home_link_portlet.inc.php | 29 -------------------- home/inc/class.home_ui.inc.php | 2 +- 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/api/js/etemplate/Et2Portlet/Et2Portlet.ts b/api/js/etemplate/Et2Portlet/Et2Portlet.ts index baa9ffe142..e3a74ab5ba 100644 --- a/api/js/etemplate/Et2Portlet/Et2Portlet.ts +++ b/api/js/etemplate/Et2Portlet/Et2Portlet.ts @@ -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]; } diff --git a/home/inc/class.home_birthday_portlet.inc.php b/home/inc/class.home_birthday_portlet.inc.php index 810bbb9b14..9c2d8482df 100644 --- a/home/inc/class.home_birthday_portlet.inc.php +++ b/home/inc/class.home_birthday_portlet.inc.php @@ -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'), diff --git a/home/inc/class.home_link_portlet.inc.php b/home/inc/class.home_link_portlet.inc.php index 83bff2a42c..a252c546b1 100644 --- a/home/inc/class.home_link_portlet.inc.php +++ b/home/inc/class.home_link_portlet.inc.php @@ -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. * diff --git a/home/inc/class.home_ui.inc.php b/home/inc/class.home_ui.inc.php index c7294b4c94..cfa6f68502 100644 --- a/home/inc/class.home_ui.inc.php +++ b/home/inc/class.home_ui.inc.php @@ -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]); }