From b3081bf5a27edf65d3241fe2205f4d221ea8c33a Mon Sep 17 00:00:00 2001 From: Alan B <918773+alanb2718@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:01:11 -0700 Subject: [PATCH] add ability for NAWS to indicate that they have processed a deleted meeting (#426) --- README.md | 1 + .../csv/search_results_csv.php | 25 +++++++--- .../c_comdef_admin_ajax_handler.class.php | 47 ++++++++++++++++++- .../c_comdef_admin_main_console.class.php | 2 + .../lang/de/server_admin_strings.inc.php | 2 + .../lang/dk/server_admin_strings.inc.php | 2 + .../lang/en/server_admin_strings.inc.php | 2 + .../lang/es/server_admin_strings.inc.php | 2 + .../lang/fa/server_admin_strings.inc.php | 2 + .../lang/fr/server_admin_strings.inc.php | 2 + .../lang/it/server_admin_strings.inc.php | 2 + .../lang/pl/server_admin_strings.inc.php | 2 + .../lang/pt/server_admin_strings.inc.php | 2 + .../lang/ru/server_admin_strings.inc.php | 2 + .../lang/sv/server_admin_strings.inc.php | 2 + .../server_admin/server_admin_javascript.js | 8 ++++ .../server/classes/c_comdef_meeting.class.php | 27 ++++++++++- 17 files changed, 122 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 74cc86315..a2ce1d4fa 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ For instructions on installing the root server, see [Installing a New Root Serve - Warning for an in-person meeting if there is information in a virtual meeting field. - Warning for a virtual meeting (pure virtual, not hybrid or VM/TC) if there is a location or an address. - Change default name for TC format from "Temporarily Closed" to "Temporarily Closed Facility" +- Add ability for NAWS to indicate that they have processed a deleted meeting, so that it stops showing up in future NAWS exports. To do this, the spreadsheet with updated World IDs should have a World ID of 'deleted' for deleted meetings they don't need to see again. ***Version 2.16.1* ** *- June 4, 2021* - Require a key for HY, TC, and VM formats for every language, including additional format languages; make sure they have the correct world ID and type; make sure they can't be inadvertently mapped other formats. diff --git a/main_server/client_interface/csv/search_results_csv.php b/main_server/client_interface/csv/search_results_csv.php index b2ebe5a03..c23aadd3b 100755 --- a/main_server/client_interface/csv/search_results_csv.php +++ b/main_server/client_interface/csv/search_results_csv.php @@ -710,9 +710,10 @@ function ReturnNAWSFormatCSV( /** \brief Returns deleted meetings with NAWS IDs. - \description This queries every deleted meeting. The meetings returned are - not restricted to the search parameters, and may repeat from previous dumps. - Only meetings that had World IDs are returned. + \description This queries every deleted meeting. The meetings returned are not restricted to the search parameters, + and may repeat from previous dumps. Only meetings that had World IDs, and that don't have the World ID 'deleted' + in their most recent change record, are returned. (The special World ID 'deleted' indicates a meeting that NAWS + has already processed, and so they don't need to see it again.) \returns An array of World IDs and change dates. These each represent deleted meetings. */ @@ -722,8 +723,10 @@ function ReturnNAWSDeletedMeetings( $in_services ///< Any Service body IDs ) { $ret = null; + $ids_to_ignore = []; // these are the IDs of meetings that NAWS has already processed, and so we don't output them // We start by getting all the meetings that have been deleted (Could be quite a few). + // These are returned in reverse chronological order, with the most recent change first. $changes = $server->GetChangesFromOTypeAndCType('c_comdef_meeting', 'comdef_change_type_delete'); if ($changes instanceof c_comdef_changes) { @@ -747,9 +750,19 @@ function ReturnNAWSDeletedMeetings( } } } - - $value = intval(preg_replace('|\D*?|', '', $b_obj->GetMeetingDataValue('worldid_mixed'))); - + // If the meeting's ID is in $ids_to_ignore, we don't output it (not surprisingly). + // If the world_id for the meeting is 'deleted', that means that NAWS has already processed it, + // and we don't output it either; in addition, we add it to the $ids_to_ignore so that any earlier + // deletion change records for this meeting don't have anything output either. + if (in_array($b_obj->GetID(), $ids_to_ignore)) { + $value = false; + } else if ($b_obj->GetMeetingDataValue('worldid_mixed') === 'deleted') { + array_push($ids_to_ignore, $b_obj->GetID()); + $value = false; + } else { + $value = intval(preg_replace('|\D*?|', '', $b_obj->GetMeetingDataValue('worldid_mixed'))); + } + if ($value && $found) { foreach ($in_transfer_dictionary as $key => $value2) { if (($key != 'Delete')) { diff --git a/main_server/local_server/server_admin/c_comdef_admin_ajax_handler.class.php b/main_server/local_server/server_admin/c_comdef_admin_ajax_handler.class.php index 735eeeeab..f278be806 100755 --- a/main_server/local_server/server_admin/c_comdef_admin_ajax_handler.class.php +++ b/main_server/local_server/server_admin/c_comdef_admin_ajax_handler.class.php @@ -164,7 +164,9 @@ public function HandleMeetingWorldIDsUpdate() 'report' => array( 'updated' => array(), 'not_updated' => array(), - 'not_found' => array() + 'marked' => array(), + 'not_found' => array(), + 'not_marked' => array() ) ); @@ -280,7 +282,15 @@ public function HandleMeetingWorldIDsUpdate() try { foreach ($meetingMap as $bmltId => $newWorldId) { if (!array_key_exists($bmltId, $meetings)) { - $ret['report']['not_found'][] = $bmltId; + if ($newWorldId === 'deleted') { + if ($this->MarkDeletedMeetingAsHandled($bmltId)) { + $ret['report']['marked'][] = $bmltId; + } else { + $ret['report']['not_marked'][] = $bmltId; + } + } else { + $ret['report']['not_found'][] = $bmltId; + } continue; } @@ -305,6 +315,39 @@ public function HandleMeetingWorldIDsUpdate() return json_encode($ret); } + /* Helper method for HandleMeetingWorldIDsUpdate. Mark a deleted meeting as handled, so that NAWS doesn't need to keep seeing + it in future exports. This is done by setting the world_id of the deleted meeting to 'deleted', so that the code that produces + a NAWS export file knows it can skip it (just as it skips deleted meetings with a blank world_id). Note that the deleted meeting + only exists in the changes table. Return true if it succeeded in marking a deleted meeting as handled, and false if not. This + doesn't try to be clever about working around problems: if something is wrong, it just returns false and doesn't make any changes. + This seems reasonable; the deleted meeting will just sit there as unmarked in that case. */ + // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps + private function MarkDeletedMeetingAsHandled($meeting_id) + { + $change_objects = c_comdef_server::GetChangesFromIDAndType('c_comdef_meeting', $meeting_id); + if ($change_objects instanceof c_comdef_changes) { + $obj_array = $change_objects->GetChangesObjects(); + if (is_array($obj_array) && count($obj_array)) { + // The changes are returned in reverse chronological order. Ideally the last change would be a delete; but it seems + // that there can be race conditions in which there are several changes with the same time stamp. So get the + // most recent delete, rather than just $obj_array[0] + foreach ($obj_array as $change) { + if ($change instanceof c_comdef_change and $change->GetChangeType() === 'comdef_change_type_delete' and !$change->GetAfterObject()) { + $meeting = $change->GetBeforeObject(); + if ($meeting->GetWorldID() === 'deleted') { + return false; + } + $meeting->SetWorldID('deleted'); + $meeting->UpdateToDB(); + $meeting->DeleteFromDB(); + return true; + } + } + } + } + return false; + } + /*******************************************************************/ /** \brief diff --git a/main_server/local_server/server_admin/c_comdef_admin_main_console.class.php b/main_server/local_server/server_admin/c_comdef_admin_main_console.class.php index af6f9e50b..27dda583d 100644 --- a/main_server/local_server/server_admin/c_comdef_admin_main_console.class.php +++ b/main_server/local_server/server_admin/c_comdef_admin_main_console.class.php @@ -384,7 +384,9 @@ public function return_main_console_html() $ret .= 'var g_num_meetings_not_updated_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_num_meetings_not_updated']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); $ret .= 'var g_warning_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_warning']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); $ret .= 'var g_errors_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_errors']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); + $ret .= 'var g_deleted_meetings_marked_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_deleted_meetings_marked']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); $ret .= 'var g_meetings_not_found_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_meetings_not_found']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); + $ret .= 'var g_deleted_meetings_not_marked_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_deleted_meetings_not_marked']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); $ret .= 'var g_service_bodies_created_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_service_bodies_created']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); $ret .= 'var g_meetings_created_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_meetings_created']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); $ret .= 'var g_users_created_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_users_created']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : ''); diff --git a/main_server/local_server/server_admin/lang/de/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/de/server_admin_strings.inc.php index ef32b4dd9..5232aa41e 100644 --- a/main_server/local_server/server_admin/lang/de/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/de/server_admin_strings.inc.php @@ -36,7 +36,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/dk/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/dk/server_admin_strings.inc.php index 45f6e3544..463c53af3 100644 --- a/main_server/local_server/server_admin/lang/dk/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/dk/server_admin_strings.inc.php @@ -36,7 +36,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/en/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/en/server_admin_strings.inc.php index b15e739db..366361aa1 100755 --- a/main_server/local_server/server_admin/lang/en/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/en/server_admin_strings.inc.php @@ -36,7 +36,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/es/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/es/server_admin_strings.inc.php index 484e26286..7e764f90d 100755 --- a/main_server/local_server/server_admin/lang/es/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/es/server_admin_strings.inc.php @@ -35,7 +35,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/fa/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/fa/server_admin_strings.inc.php index dff0893fb..4b95ae1b4 100755 --- a/main_server/local_server/server_admin/lang/fa/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/fa/server_admin_strings.inc.php @@ -35,7 +35,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/fr/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/fr/server_admin_strings.inc.php index 4e3aea4d0..9d15da1e6 100755 --- a/main_server/local_server/server_admin/lang/fr/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/fr/server_admin_strings.inc.php @@ -35,7 +35,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/it/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/it/server_admin_strings.inc.php index 5d4fdeda7..347c2c2c0 100644 --- a/main_server/local_server/server_admin/lang/it/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/it/server_admin_strings.inc.php @@ -36,7 +36,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/lang/pl/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/pl/server_admin_strings.inc.php index 44d9b7deb..aabc599ee 100644 --- a/main_server/local_server/server_admin/lang/pl/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/pl/server_admin_strings.inc.php @@ -34,7 +34,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Liczba mityngów nie potrzebujących aktualizacji: ', 'server_admin_ui_errors' => 'Błędy', 'server_admin_ui_warning' => 'OSTRZEŻENIE', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'znaleziono mityngi w arkuszu, które nie istnieją w bazie danych. Może się to zdarzyć, gdy mityng jest usunięty lub niepubliczny. ID brakujących mityngów to: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Utworzone organy służb: ', 'server_admin_ui_meetings_created' => 'Utworzone mityngi: ', 'server_admin_ui_users_created' => 'Utworzeni użytkownicy: ', diff --git a/main_server/local_server/server_admin/lang/pt/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/pt/server_admin_strings.inc.php index b3fac9ca0..0fcb14ca0 100644 --- a/main_server/local_server/server_admin/lang/pt/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/pt/server_admin_strings.inc.php @@ -30,7 +30,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Numero de reuniões que não precisam de atualização: ', 'server_admin_ui_warning' => 'AVISO', 'server_admin_ui_errors' => 'Erro(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'reuniões foram encontradas na planilha que não existiam na base de dados. Isso pode acontecer quando uma reunião é apagada ou não publicada. Os IDs de reunião são: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Corpos de serviço criados: ', 'server_admin_ui_meetings_created' => 'Reuniões criadas: ', 'server_admin_ui_users_created' => 'Usuários criados: ', diff --git a/main_server/local_server/server_admin/lang/ru/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/ru/server_admin_strings.inc.php index cfe10a394..856f2743c 100644 --- a/main_server/local_server/server_admin/lang/ru/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/ru/server_admin_strings.inc.php @@ -35,7 +35,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Номера собраний, которые не нуждались в обновлении: ', 'server_admin_ui_warning' => 'ПРЕДУПРЕЖДЕНИЕ', 'server_admin_ui_errors' => 'Ошибка(и)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'Собрания были найдены в таблице, которой не было в базе данных. Это могло произойти, если собрание удалено или не опубликовано. Не достающие ID собраний : ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Созданы сервисные органы: ', 'server_admin_ui_meetings_created' => 'Собрания созданы: ', 'server_admin_ui_users_created' => 'Пользователи создали: ', diff --git a/main_server/local_server/server_admin/lang/sv/server_admin_strings.inc.php b/main_server/local_server/server_admin/lang/sv/server_admin_strings.inc.php index a657101a5..32d9c108f 100755 --- a/main_server/local_server/server_admin/lang/sv/server_admin_strings.inc.php +++ b/main_server/local_server/server_admin/lang/sv/server_admin_strings.inc.php @@ -37,7 +37,9 @@ 'server_admin_ui_num_meetings_not_updated' => 'Number of meetings that did not need updating: ', 'server_admin_ui_warning' => 'WARNING', 'server_admin_ui_errors' => 'Error(s)', + 'server_admin_ui_deleted_meetings_marked' => 'Number of deleted meetings marked so that they won\'t appear in future NAWS exports: ', 'server_admin_ui_meetings_not_found' => 'meetings were found in the spreadsheet that did not exist in the database. This can happen when a meeting is deleted or unpublished. The missing meeting IDs are: ', + 'server_admin_ui_deleted_meetings_not_marked' => 'tried to mark %d deleted meetings so that they wouldn\'t appear in future NAWS exports, but there was a problem (for example, meeting already marked or change record not found). The problem meeting IDs are: ', 'server_admin_ui_service_bodies_created' => 'Service bodies created: ', 'server_admin_ui_meetings_created' => 'Meetings created: ', 'server_admin_ui_users_created' => 'Users created: ', diff --git a/main_server/local_server/server_admin/server_admin_javascript.js b/main_server/local_server/server_admin/server_admin_javascript.js index 1cbcf1fd5..e2dcf810d 100644 --- a/main_server/local_server/server_admin/server_admin_javascript.js +++ b/main_server/local_server/server_admin/server_admin_javascript.js @@ -418,10 +418,18 @@ function BMLT_Server_Admin() if (result.success) { var report = g_num_meetings_updated_text + result.report.updated.length.toString() + "\n\n"; report += g_num_meetings_not_updated_text + result.report.not_updated.length.toString(); + if (result.report.marked.length) { + report += "\n\n"; + report += g_deleted_meetings_marked_text + result.report.marked.length.toString() + "\n\n"; + } if (result.report.not_found.length) { report += "\n\n"; report += g_warning_text + ": " + result.report.not_found.length.toString() + " " + g_meetings_not_found_text + result.report.not_found.join(", "); } + if (result.report.not_marked.length) { + report += "\n\n"; + report += g_warning_text + ": " + sprintf(g_deleted_meetings_not_marked_text, result.report.not_marked.length) + result.report.not_marked.join(", "); + } alert(report); } else { alert(g_errors_text + ":\n" + result.errors.join("\n")); diff --git a/main_server/server/classes/c_comdef_meeting.class.php b/main_server/server/classes/c_comdef_meeting.class.php index 96e6aeb7f..7b1dfaa78 100755 --- a/main_server/server/classes/c_comdef_meeting.class.php +++ b/main_server/server/classes/c_comdef_meeting.class.php @@ -1197,10 +1197,10 @@ public function GetID() return $ret; } - + /*******************************************************************/ /** \brief Set this meeting's ID. - */ + */ // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps public function SetMeetingID( $in_meeting_id_bigint ///< An integer, with the meeting's new ID. @@ -1208,6 +1208,29 @@ public function SetMeetingID( // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps $this->_my_meeting_data['id_bigint'] = intval($in_meeting_id_bigint); } + + /*******************************************************************/ + /** \brief Get this meeting's world_id. + */ + // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps + public function GetWorldID() + { + if (isset($this->_my_meeting_data['worldid_mixed'])) { + return $this->_my_meeting_data['worldid_mixed']; + } else { + return ''; + } + } + + /*******************************************************************/ + /** \brief Set this meeting's world_id. + */ + // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps + public function SetWorldID( + $new_world_id + ) { + $this->_my_meeting_data['worldid_mixed'] = $new_world_id; + } /*******************************************************************/ /** \brief Get this meeting's Email Contact Address