From 360cc3cdd305c485963ecb12cac86994f5e34ef0 Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 15 Apr 2024 19:17:09 -0600 Subject: [PATCH] Upgrade: Rework Source Code option to be more flexible. --- core/upgrade/app_languages.php | 69 +++++++++++++++++------- core/upgrade/index.php | 95 ++++++++++++++++++++-------------- 2 files changed, 105 insertions(+), 59 deletions(-) diff --git a/core/upgrade/app_languages.php b/core/upgrade/app_languages.php index d246ff44b7..14be493a79 100644 --- a/core/upgrade/app_languages.php +++ b/core/upgrade/app_languages.php @@ -925,26 +925,55 @@ $text['description-upgrade_source']['zh-cn'] = "从存储库更新FusionPBX源 $text['description-upgrade_source']['ja-jp'] = "FusionPBXソースファイルをリポジトリから更新します。"; $text['description-upgrade_source']['ko-kr'] = "저장소에서 Fusionpbx 소스 파일을 업데이트합니다."; -$text['description-update_apps']['en-us'] = "Updates optional app source files from the respository."; -$text['description-update_apps']['en-gb'] = "Updates optional app source files from the respository."; -$text['description-update_apps']['ar-eg'] = ""; -$text['description-update_apps']['de-at'] = "Aktualisiert den Quellcode aus dem Repository"; //copied from de-de -$text['description-update_apps']['de-ch'] = "Aktualisiert den Quellcode aus dem Repository"; //copied from de-de -$text['description-update_apps']['de-de'] = "Aktualisiert den Quellcode aus dem Repository"; -$text['description-update_apps']['es-cl'] = "Archivos de origen Actualizaciones del repositorio."; -$text['description-update_apps']['es-mx'] = "Archivos de origen Actualizaciones del repositorio."; //copied from es-cl -$text['description-update_apps']['fr-ca'] = "Mise à jour du code source de depuis le dépôt."; //copied from fr-fr -$text['description-update_apps']['fr-fr'] = "Mise à jour du code source de depuis le dépôt."; -$text['description-update_apps']['he-il'] = ""; -$text['description-update_apps']['it-it'] = "Aggiorna il files sorgente di dal repository."; -$text['description-update_apps']['nl-nl'] = ""; -$text['description-update_apps']['pl-pl'] = "Uaktualnia pliki źródłowe z przechowalni."; -$text['description-update_apps']['pt-br'] = "Atualiza o a partir dos arquivos de código fonte do repositório."; -$text['description-update_apps']['pt-pt'] = "Arquivos de origem Atualizações do repositório."; -$text['description-update_apps']['ro-ro'] = ""; -$text['description-update_apps']['ru-ru'] = "Обновляет исходные файлы из репозитория."; -$text['description-update_apps']['sv-se'] = "Uppdaterar källfiler från respository."; -$text['description-update_apps']['uk-ua'] = "Оновлення вихідних файлів з репозиторію Subversion ."; +// $text['description-update_apps']['en-us'] = "Updates optional app source files from the respository."; +// $text['description-update_apps']['en-gb'] = "Updates optional app source files from the respository."; +// $text['description-update_apps']['ar-eg'] = "يقوم بتحديث ملفات مصدر التطبيق الاختيارية من المستودع."; +// $text['description-update_apps']['de-at'] = "Aktualisiert den Quellcode aus dem Repository"; //copied from de-de +// $text['description-update_apps']['de-ch'] = "Aktualisiert den Quellcode aus dem Repository"; //copied from de-de +// $text['description-update_apps']['de-de'] = "Aktualisiert den Quellcode aus dem Repository"; +// $text['description-update_apps']['el-gr'] = "Ενημερώνει τα προαιρετικά αρχεία προέλευσης εφαρμογών από το αποθετήριο."; +// $text['description-update_apps']['es-cl'] = "Archivos de origen Actualizaciones del repositorio."; +// $text['description-update_apps']['es-mx'] = "Archivos de origen Actualizaciones del repositorio."; //copied from es-cl +// $text['description-update_apps']['fr-ca'] = "Mise à jour du code source de depuis le dépôt."; //copied from fr-fr +// $text['description-update_apps']['fr-fr'] = "Mise à jour du code source de depuis le dépôt."; +// $text['description-update_apps']['he-il'] = "מעדכן קבצי מקור אפליקציה אופציונליים מהמאגר."; +// $text['description-update_apps']['it-it'] = "Aggiorna il files sorgente di dal repository."; +// $text['description-update_apps']['nl-nl'] = "Werkt optionele app-bronbestanden bij vanuit de repository."; +// $text['description-update_apps']['pl-pl'] = "Uaktualnia pliki źródłowe z przechowalni."; +// $text['description-update_apps']['pt-br'] = "Atualiza o a partir dos arquivos de código fonte do repositório."; +// $text['description-update_apps']['pt-pt'] = "Arquivos de origem Atualizações do repositório."; +// $text['description-update_apps']['ro-ro'] = "Actualizează fișierele sursă opționale ale aplicației din depozit."; +// $text['description-update_apps']['ru-ru'] = "Обновляет исходные файлы из репозитория."; +// $text['description-update_apps']['sv-se'] = "Uppdaterar källfiler från respository."; +// $text['description-update_apps']['uk-ua'] = "Оновлення вихідних файлів з репозиторію Subversion ."; +// $text['description-update_apps']['zh-cn'] = "从存储库更新可选应用程序源文件。"; +// $text['description-update_apps']['ja-jp'] = "オプションのアプリのソース ファイルをリポジトリから更新します。"; +// $text['description-update_apps']['ko-kr'] = "리포지토리에서 선택적 앱 소스 파일을 업데이트합니다."; + +$text['description-all_applications']['en-us'] = "All Applications"; +$text['description-all_applications']['en-gb'] = "All Applications"; +$text['description-all_applications']['ar-eg'] = "جميع التطبيقات"; +$text['description-all_applications']['de-at'] = "Alle Anwendungen"; +$text['description-all_applications']['de-ch'] = "Alle Anwendungen"; +$text['description-all_applications']['de-de'] = "Alle Anwendungen"; +$text['description-all_applications']['el-gr'] = "Όλες οι Εφαρμογές"; +$text['description-all_applications']['es-cl'] = "Todas las aplicaciones"; +$text['description-all_applications']['es-mx'] = "Todas las aplicaciones"; +$text['description-all_applications']['fr-ca'] = "Toutes les candidatures"; +$text['description-all_applications']['fr-fr'] = "Toutes les candidatures"; +$text['description-all_applications']['he-il'] = "כל היישומים"; +$text['description-all_applications']['it-it'] = "Tutte le applicazioni"; +$text['description-all_applications']['nl-nl'] = "Alle toepassingen"; +$text['description-all_applications']['pl-pl'] = "Wszystkie aplikacje"; +$text['description-all_applications']['pt-br'] = "Todos os aplicativos"; +$text['description-all_applications']['pt-pt'] = "Todos os aplicativos"; +$text['description-all_applications']['ro-ro'] = "Toate aplicațiile"; +$text['description-all_applications']['ru-ru'] = "Все приложения"; +$text['description-all_applications']['sv-se'] = "Alla applikationer"; +$text['description-all_applications']['uk-ua'] = "Усі додатки"; +$text['description-all_applications']['zh-cn'] = "所有应用程序"; +$text['description-all_applications']['ja-jp'] = "すべてのアプリケーション"; +$text['description-all_applications']['ko-kr'] = "모든 애플리케이션"; $text['description-upgrade_schema']['en-us'] = "Checks to ensure table and field integrity in the database."; $text['description-upgrade_schema']['en-gb'] = "Checks to ensure table and field integrity in the database."; diff --git a/core/upgrade/index.php b/core/upgrade/index.php index f4f535c825..024be475e8 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -140,6 +140,21 @@ } +//find optional apps with repos + $updateable_repos = git_find_repos($_SERVER["PROJECT_ROOT"]."/app"); + if (!empty($updateable_repos) && is_array($updateable_repos) && @sizeof($updateable_repos) != 0) { + foreach ($updateable_repos as $app_path => $repo) { + $x = 0; + include $app_path.'/app_config.php'; + $updateable_repos[$app_path]['app'] = $repo[0]; + $updateable_repos[$app_path]['name'] = $apps[$x]['name']; + $updateable_repos[$app_path]['uuid'] = $apps[$x]['uuid']; + $updateable_repos[$app_path]['version'] = $apps[$x]['version']; + $updateable_repos[$app_path]['description'] = $apps[$x]['description'][$_SESSION['domain']['language']['code']]; + unset($apps, $updateable_repos[$app_path][0]); + } + } + //adjust color and initialize step counter $step = 1; $step_color = isset($_SESSION['theme']['upgrade_step_color']['text']) ? $_SESSION['theme']['upgrade_step_color']['text'] : color_adjust((!empty($_SESSION['theme']['form_table_label_background_color']['text']) ? $_SESSION['theme']['form_table_label_background_color']['text'] : '#e5e9f0'), -0.1); @@ -166,13 +181,17 @@ if (permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx") && is_writeable($_SERVER["PROJECT_ROOT"]."/.git")) { echo "\n"; - echo "\n"; + echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
\n"; echo "
".$step."
"; echo "
".$text['label-upgrade_source']."
\n"; echo "
\n"; - echo "  ".$text['description-upgrade_source']."
\n"; + echo "
\n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + echo "   ".$text['description-upgrade_source']." \n"; //show current git version info chdir($_SERVER["PROJECT_ROOT"]); exec("git rev-parse --abbrev-ref HEAD 2>&1", $git_current_branch, $branch_return_value); @@ -180,52 +199,50 @@ exec("git log --pretty=format:'%H' -n 1 2>&1", $git_current_commit, $commit_return_value); $git_current_commit = $git_current_commit[0]; if (!is_numeric($git_current_branch)) { - echo " ".software::version()." \n"; + echo " ".software::version()." \n"; } if ($branch_return_value == 0 && $commit_return_value == 0) { - echo " ".$git_current_branch.""; + echo " ".$git_current_branch.""; + } + echo "
\n"; + if (!empty($updateable_repos)) { + echo "
\n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + echo "   ".$text['description-all_applications']." (".@sizeof($updateable_repos).")\n"; + echo "
\n"; } echo "
\n"; - //find and show optional apps with repos - $updateable_repos = git_find_repos($_SERVER["PROJECT_ROOT"]."/app"); - if (!empty($updateable_repos) && is_array($updateable_repos) && @sizeof($updateable_repos) != 0) { - foreach ($updateable_repos as $app_path => $repo) { - $x = 0; - include $app_path.'/app_config.php'; - $updateable_repos[$app_path]['app'] = $repo[0]; - $updateable_repos[$app_path]['name'] = $apps[$x]['name']; - $updateable_repos[$app_path]['uuid'] = $apps[$x]['uuid']; - $updateable_repos[$app_path]['version'] = $apps[$x]['version']; - $updateable_repos[$app_path]['description'] = $apps[$x]['description'][$_SESSION['domain']['language']['code']]; - unset($apps, $updateable_repos[$app_path][0]); + //show optional apps with repos + if (!empty($updateable_repos)) { + echo "\n"; } - echo "\n"; $step++; }