2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
39 // Meeting is used to store customer information.
40 class Meeting extends SugarBean {
45 var $assigned_user_id;
46 var $modified_user_id;
49 var $modified_by_name;
59 var $duration_minutes;
62 var $parent_type_options;
69 var $reminder_checked;
79 var $assigned_user_name;
83 var $update_vcal = true;
87 // when assoc w/ a user/contact:
88 var $minutes_value_default = 15;
89 var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45');
90 var $table_name = "meetings";
91 var $rel_users_table = "meetings_users";
92 var $rel_contacts_table = "meetings_contacts";
93 var $rel_leads_table = "meetings_leads";
94 var $module_dir = "Meetings";
95 var $object_name = "Meeting";
97 var $importable = true;
98 // This is used to retrieve related fields from form posts.
99 var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status');
100 var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case',
101 'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
102 // so you can run get_users() twice and run query only once
103 var $cached_get_users = null;
104 var $new_schema = true;
111 $this->setupCustomFields('Meetings');
112 foreach($this->field_defs as $field) {
113 $this->field_name_map[$field['name']] = $field;
115 // $this->fill_in_additional_detail_fields();
116 if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) {
117 $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals'];
122 * Stub for integration
125 function hasIntegratedMeeting() {
129 // save date_end by calculating user input
130 // this is for calendar
131 function save($check_notify = FALSE) {
133 global $current_user;
135 global $disable_date_format;
137 if(isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes))
139 if(isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes))
141 $td = $timedate->fromDb($this->date_start);
144 $this->date_end = $td->modify("+{$this->duration_hours} hours {$this->duration_minutes} mins")->asDb();
149 $check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
150 if(empty($_REQUEST['send_invites'])) {
151 if(!empty($this->id)) {
152 $old_record = new Meeting();
153 $old_record->retrieve($this->id);
154 $old_assigned_user_id = $old_record->assigned_user_id;
156 if((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) ){
157 $this->special_notification = true;
158 $check_notify = true;
159 if(isset($_REQUEST['assigned_user_name'])) {
160 $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
164 /*nsingh 7/3/08 commenting out as bug #20814 is invalid
165 if($current_user->getPreference('reminder_time')!= -1 && isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0 && $_POST['reminder_time']==-1){
166 $this->reminder_checked = '1';
167 $this->reminder_time = $current_user->getPreference('reminder_time');
170 if (empty($this->status) ) {
171 $this->status = $this->getDefaultStatus();
174 // Do any external API saving
175 // Clear out the old external API stuff if we have changed types
176 if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type ) {
177 $this->join_url = '';
178 $this->host_url = '';
179 $this->external_id = '';
183 if (!empty($this->type) && $this->type != 'Sugar' ) {
184 require_once('include/externalAPI/ExternalAPIFactory.php');
185 $api = ExternalAPIFactory::loadAPI($this->type);
188 if (empty($this->type)) {
189 $this->type = 'Sugar';
192 if ( isset($api) && is_a($api,'WebMeeting') && empty($this->in_relationship_update) ) {
193 // Make sure the API initialized and it supports Web Meetings
194 // Also make suer we have an ID, the external site needs something to reference
195 if ( !isset($this->id) || empty($this->id) ) {
196 $this->id = create_guid();
197 $this->new_with_id = true;
199 $response = $api->scheduleMeeting($this);
200 if ( $response['success'] == TRUE ) {
201 // Need to send out notifications
202 if ( $api->canInvite ) {
203 $notifyList = $this->get_notification_recipients();
204 foreach($notifyList as $person) {
205 $api->inviteAttendee($this,$person,$check_notify);
210 SugarApplication::appendErrorMessage($GLOBALS['app_strings']['ERR_EXTERNAL_API_SAVE_FAIL']);
217 $return_id = parent::save($check_notify);
219 if($this->update_vcal) {
220 vCal::cache_sugar_vcal($current_user);
228 // this is for calendar
229 function mark_deleted($id) {
231 global $current_user;
233 parent::mark_deleted($id);
235 if($this->update_vcal) {
236 vCal::cache_sugar_vcal($current_user);
240 function get_summary_text() {
241 return "$this->name";
244 function create_export_query(&$order_by, &$where, $relate_link_join='')
246 $custom_join = $this->custom_fields->getJOIN(true, true,$where);
248 $custom_join['join'] .= $relate_link_join;
249 $contact_required = stristr($where, "contacts");
251 if($contact_required) {
252 $query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner, users.user_name as assigned_user_name ";
254 $query .= $custom_join['select'];
256 $query .= " FROM contacts, meetings, meetings_contacts ";
257 $where_auto = " meetings_contacts.contact_id = contacts.id AND meetings_contacts.meeting_id = meetings.id AND meetings.deleted=0 AND contacts.deleted=0";
259 $query = 'SELECT meetings.*, users.user_name as assigned_user_name ';
261 $query .= $custom_join['select'];
263 $query .= ' FROM meetings ';
264 $where_auto = "meetings.deleted=0";
266 $query .= " LEFT JOIN users ON meetings.assigned_user_id=users.id ";
269 $query .= $custom_join['join'];
273 $query .= " where $where AND ".$where_auto;
275 $query .= " where ".$where_auto;
277 if($order_by != "") {
278 $query .= " ORDER BY $order_by";
280 $alternate_order_by = $this->process_order_by($order_by, null);
281 if($alternate_order_by != "")
282 $query .= " ORDER BY ". $alternate_order_by;
289 function fill_in_additional_detail_fields() {
291 // Fill in the assigned_user_name
292 $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
294 if (!empty($this->contact_id)) {
295 $query = "SELECT first_name, last_name FROM contacts ";
296 $query .= "WHERE id='$this->contact_id' AND deleted=0";
297 $result = $this->db->limitQuery($query,0,1,true," Error filling in additional detail fields: ");
299 // Get the contact name.
300 $row = $this->db->fetchByAssoc($result);
301 $GLOBALS['log']->info("additional call fields $query");
304 $this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', '');
305 $GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
306 $GLOBALS['log']->debug("Call($this->id): contact_id = $this->contact_id");
312 $this->created_by_name = get_assigned_user_name($this->created_by);
313 $this->modified_by_name = get_assigned_user_name($this->modified_user_id);
314 $this->fill_in_additional_parent_fields();
316 if (!isset($this->time_hour_start)) {
317 $this->time_start_hour = intval(substr($this->time_start, 0, 2));
320 if (isset($this->time_minute_start)) {
321 $time_start_minutes = $this->time_minute_start;
323 $time_start_minutes = substr($this->time_start, 3, 5);
324 if ($time_start_minutes > 0 && $time_start_minutes < 15) {
325 $time_start_minutes = "15";
326 } else if ($time_start_minutes > 15 && $time_start_minutes < 30) {
327 $time_start_minutes = "30";
328 } else if ($time_start_minutes > 30 && $time_start_minutes < 45) {
329 $time_start_minutes = "45";
330 } else if ($time_start_minutes > 45) {
331 $this->time_start_hour += 1;
332 $time_start_minutes = "00";
337 if (isset($this->time_hour_start)) {
338 $time_start_hour = $this->time_hour_start;
340 $time_start_hour = intval(substr($this->time_start, 0, 2));
344 $this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"');
345 $hours_arr = array ();
349 if (empty ($time_meridiem)) {
354 for ($i = $start_at; $i < $num_of_hours; $i ++) {
356 if (strlen($i) == 1) {
362 if (!isset($this->duration_minutes)) {
363 $this->duration_minutes = $this->minutes_value_default;
366 //setting default date and time
367 if (is_null($this->date_start))
368 $this->date_start = $timedate->now();
369 if (is_null($this->time_start))
370 $this->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true);
371 if (is_null($this->duration_hours)) {
372 $this->duration_hours = "0";
374 if (is_null($this->duration_minutes))
375 $this->duration_minutes = "1";
377 global $app_list_strings;
378 $parent_types = $app_list_strings['record_type_display'];
379 $disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
380 foreach($disabled_parent_types as $disabled_parent_type){
381 if($disabled_parent_type != $this->parent_type){
382 unset($parent_types[$disabled_parent_type]);
386 $this->parent_type_options = get_select_options_with_id($parent_types, $this->parent_type);
387 if (empty($this->reminder_time)) {
388 $this->reminder_time = -1;
391 if ( empty($this->id) ) {
392 $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time');
393 if ( isset($reminder_t) )
394 $this->reminder_time = $reminder_t;
396 $this->reminder_checked = $this->reminder_time == -1 ? false : true;
398 if (isset ($_REQUEST['parent_type'])) {
399 $this->parent_type = $_REQUEST['parent_type'];
400 } elseif (is_null($this->parent_type)) {
401 $this->parent_type = $app_list_strings['record_type_default_key'];
406 function get_list_view_data() {
407 $meeting_fields = $this->get_list_view_array();
408 global $app_list_strings, $focus, $action, $currentModule;
409 if(isset($this->parent_type))
410 $meeting_fields['PARENT_MODULE'] = $this->parent_type;
411 if($this->status == "Planned") {
412 //cn: added this if() to deal with sequential Closes in Meetings. this is a hack to a hack(formbase.php->handleRedirect)
415 $setCompleteUrl = "<a onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>";
416 $meeting_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Meetings')." border='0'")."</a>";
419 $today = $timedate->nowDb();
420 $nextday = $timedate->asDbDate($timedate->getNow()->get("+1 day"));
421 $mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']);
422 $date_db = $timedate->to_db($mergeTime);
423 if($date_db < $today ) {
424 $meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
425 }else if($date_db < $nextday) {
426 $meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
428 $meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
430 $this->fill_in_additional_detail_fields();
432 //make sure we grab the localized version of the contact name, if a contact is provided
433 if (!empty($this->contact_id)) {
435 // Bug# 46125 - make first name, last name, salutation and title of Contacts respect field level ACLs
436 $contact_temp = new Contact();
437 $contact_temp->retrieve($this->contact_id);
438 $contact_temp->_create_proper_name_field();
439 $this->contact_name = $contact_temp->full_name;
442 $meeting_fields['CONTACT_ID'] = $this->contact_id;
443 $meeting_fields['CONTACT_NAME'] = $this->contact_name;
445 $meeting_fields['PARENT_NAME'] = $this->parent_name;
447 $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time==-1 ? false : true;
450 return $meeting_fields;
453 function set_notification_body($xtpl, &$meeting) {
454 global $sugar_config;
455 global $app_list_strings;
456 global $current_user;
460 // cn: bug 9494 - passing a contact breaks this call
461 $notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
462 // cn: bug 8078 - fixed call to $timedate
463 if(strtolower(get_class($meeting->current_notify_user)) == 'contact') {
464 $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
465 '/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
466 } elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') {
467 $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
468 '/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
470 $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
471 '/index.php?entryPoint=acceptDecline&module=Meetings&user_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
473 $xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name);
474 $xtpl->assign("MEETING_SUBJECT", trim($meeting->name));
475 $xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:""));
476 $typekey = strtolower($meeting->type);
477 if(isset($meeting->type)) {
478 if(!empty($app_list_strings['eapm_list'][$typekey])) {
479 $typestring = $app_list_strings['eapm_list'][$typekey];
481 $typestring = $app_list_strings['meeting_type_dom'][$meeting->type];
484 $xtpl->assign("MEETING_TYPE", isset($meeting->type)? $typestring:"");
485 $startdate = $timedate->fromDb($meeting->date_start);
486 $xtpl->assign("MEETING_STARTDATE", $timedate->asUser($startdate, $notifyUser)." ".TimeDate::userTimezoneSuffix($startdate, $notifyUser));
487 $xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
488 $xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
489 $xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
490 if ( !empty($meeting->join_url) ) {
491 $xtpl->assign('MEETING_URL', $meeting->join_url);
492 $xtpl->parse('Meeting.Meeting_External_API');
498 function get_meeting_users() {
499 $template = new User();
500 // First, get the list of IDs.
501 $query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.user_id from meetings_users where meetings_users.meeting_id='$this->id' AND meetings_users.deleted=0";
502 $GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
503 $result = $this->db->query($query, true);
506 while($row = $this->db->fetchByAssoc($result)) {
507 $template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one
508 $record = $template->retrieve($row['user_id']);
509 $template->required = $row['required'];
510 $template->accept_status = $row['accept_status'];
512 if($record != null) {
513 // this copies the object into the array
520 function get_invite_meetings(&$user) {
522 // First, get the list of IDs.
523 $GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
524 $query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.meeting_id from meetings_users where meetings_users.user_id='$user->id' AND( meetings_users.accept_status IS NULL OR meetings_users.accept_status='none') AND meetings_users.deleted=0";
525 $result = $this->db->query($query, true);
528 while($row = $this->db->fetchByAssoc($result)) {
529 $record = $template->retrieve($row['meeting_id']);
530 $template->required = $row['required'];
531 $template->accept_status = $row['accept_status'];
536 // this copies the object into the array
544 function set_accept_status(&$user,$status)
546 if($user->object_name == 'User')
548 $relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id);
549 $data_values = array('accept_status'=>$status);
550 $this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values);
551 global $current_user;
553 if($this->update_vcal)
555 vCal::cache_sugar_vcal($user);
558 else if($user->object_name == 'Contact')
560 $relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
561 $data_values = array('accept_status'=>$status);
562 $this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
564 else if($user->object_name == 'Lead')
566 $relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
567 $data_values = array('accept_status'=>$status);
568 $this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values);
573 function get_notification_recipients() {
574 if($this->special_notification) {
575 return parent::get_notification_recipients();
579 if(!is_array($this->contacts_arr)) {
580 $this->contacts_arr = array();
583 if(!is_array($this->users_arr)) {
584 $this->users_arr = array();
587 if(!is_array($this->leads_arr)) {
588 $this->leads_arr = array();
591 foreach($this->users_arr as $user_id) {
592 $notify_user = new User();
593 $notify_user->retrieve($user_id);
594 $notify_user->new_assigned_user_name = $notify_user->full_name;
595 $GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
596 $list[$notify_user->id] = $notify_user;
599 foreach($this->contacts_arr as $contact_id) {
600 $notify_user = new Contact();
601 $notify_user->retrieve($contact_id);
602 $notify_user->new_assigned_user_name = $notify_user->full_name;
603 $GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
604 $list[$notify_user->id] = $notify_user;
607 foreach($this->leads_arr as $lead_id) {
608 $notify_user = new Lead();
609 $notify_user->retrieve($lead_id);
610 $notify_user->new_assigned_user_name = $notify_user->full_name;
611 $GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
612 $list[$notify_user->id] = $notify_user;
619 function bean_implements($interface) {
621 case 'ACL':return true;
626 function listviewACLHelper() {
627 $array_assign = parent::listviewACLHelper();
629 if(!empty($this->parent_name)) {
631 if(!empty($this->parent_name_owner)) {
632 global $current_user;
633 $is_owner = $current_user->id == $this->parent_name_owner;
637 if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
638 $array_assign['PARENT'] = 'a';
640 $array_assign['PARENT'] = 'span';
645 if(!empty($this->contact_name)) {
646 if(!empty($this->contact_name_owner)) {
647 global $current_user;
648 $is_owner = $current_user->id == $this->contact_name_owner;
652 if(ACLController::checkAccess('Contacts', 'view', $is_owner)) {
653 $array_assign['CONTACT'] = 'a';
655 $array_assign['CONTACT'] = 'span';
657 return $array_assign;
661 function save_relationship_changes($is_update) {
663 if(empty($this->in_workflow)) {
664 if(empty($this->in_import)){//if a meeting is being imported then contact_id should not be excluded
665 //if the global soap_server_object variable is not empty (as in from a soap/OPI call), then process the assigned_user_id relationship, otherwise
666 //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship
667 if(!empty($GLOBALS['soap_server_object'])){
668 $exclude = array('contact_id', 'user_id');
670 $exclude = array('contact_id', 'user_id','assigned_user_id');
674 $exclude = array('user_id');
677 parent::save_relationship_changes($is_update, $exclude);
682 * @see SugarBean::afterImportSave()
684 public function afterImportSave()
686 if ( $this->parent_type == 'Contacts' ) {
687 $this->load_relationship('contacts');
688 if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) )
689 $this->contacts->add($this->parent_id);
691 elseif ( $this->parent_type == 'Leads' ) {
692 $this->load_relationship('leads');
693 if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) )
694 $this->leads->add($this->parent_id);
697 parent::afterImportSave();
700 public function getDefaultStatus()
702 $def = $this->field_defs['status'];
703 if (isset($def['default'])) {
704 return $def['default'];
706 $app = return_app_list_strings_language($GLOBALS['current_language']);
707 if (isset($def['options']) && isset($app[$def['options']])) {
708 $keys = array_keys($app[$def['options']]);
716 // External API integration, for the dropdown list of what external API's are available
717 //TODO: do we really need focus, name and view params for this function
718 function getMeetingsExternalApiDropDown($focus = null, $name = null, $value = null, $view = null)
720 global $dictionary, $app_list_strings;
722 $cacheKeyName = 'meetings_type_drop_down';
724 $apiList = sugar_cache_retrieve($cacheKeyName);
725 if ($apiList === null)
727 require_once('include/externalAPI/ExternalAPIFactory.php');
729 $apiList = ExternalAPIFactory::getModuleDropDown('Meetings');
730 $apiList = array_merge(array('Sugar'=>$GLOBALS['app_list_strings']['eapm_list']['Sugar']), $apiList);
731 sugar_cache_put($cacheKeyName, $apiList);
734 if(!empty($value) && empty($apiList[$value]))
736 $apiList[$value] = $value;
738 //bug 46294: adding list of options to dropdown list (if it is not the default list)
739 if ($dictionary['Meeting']['fields']['type']['options'] != "eapm_list")
741 $apiList = array_merge(getMeetingTypeOptions($dictionary, $app_list_strings), $apiList);
748 * Meeting Type Options Array for dropdown list
749 * @param array $dictionary - getting type name
750 * @param array $app_list_strings - getting type options
751 * @return array Meeting Type Options Array for dropdown list
753 function getMeetingTypeOptions($dictionary, $app_list_strings)
757 // getting name of meeting type to fill dropdown list by its values
758 if (isset($dictionary['Meeting']['fields']['type']['options']))
760 $typeName = $dictionary['Meeting']['fields']['type']['options'];
762 if (!empty($app_list_strings[$typeName]))
764 $typeList = $app_list_strings[$typeName];
766 foreach ($typeList as $key => $value)
768 $result[$value] = $value;