Only need to list each user or resource once

This commit is contained in:
Nathan Gray 2016-04-11 16:08:48 +00:00
parent fd3ae9f899
commit fd5ccdbf63

View File

@ -155,7 +155,7 @@ class module_calendar_planner extends Module
asort($groups); asort($groups);
asort($users); asort($users);
// concat users and groups to the option array. // concat users and groups to the option array.
$this->arguments['owner']['options'] = $groups + $users; $this->arguments['owner']['options'] = array_unique($groups + $users);
if (count($this->arguments['owner']['options']) > 10) if (count($this->arguments['owner']['options']) > 10)
{ {
$this->arguments['owner']['multiple'] = 10; $this->arguments['owner']['multiple'] = 10;
@ -181,6 +181,7 @@ class module_calendar_planner extends Module
$this->arguments['resources']['options'][$type.$key] = $value; $this->arguments['resources']['options'][$type.$key] = $value;
} }
} }
$this->arguments['resources']['options'] = array_unique($this->arguments['resources']['options']);
$this->arguments['resources']['multiple'] = count($this->arguments['resources']['options']) ? 4 : 0; $this->arguments['resources']['multiple'] = count($this->arguments['resources']['options']) ? 4 : 0;
return parent::get_user_interface(); return parent::get_user_interface();