From: Janusz Dobrowolski Date: Fri, 6 Aug 2010 14:50:32 +0000 (+0000) Subject: Added chart packages installation. X-Git-Tag: v2.4.2~19^2~721 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=0e219ded989a72cbd5eaf21c42970aa777ce770c Added chart packages installation. --- diff --git a/admin/inst_chart.php b/admin/inst_chart.php new file mode 100644 index 00000000..35e76678 --- /dev/null +++ b/admin/inst_chart.php @@ -0,0 +1,98 @@ +. +***********************************************************************/ +$page_security = 'SA_CREATEMODULES'; +$path_to_root=".."; +include_once($path_to_root . "/includes/session.inc"); +include_once($path_to_root."/includes/packages.inc"); + +if ($use_popup_windows) { + $js = get_js_open_window(900, 500); +} +page(_($help_context = "Install Charts of Accounts"), false, false, '', $js); + +include_once($path_to_root . "/includes/date_functions.inc"); +include_once($path_to_root . "/admin/db/company_db.inc"); +include_once($path_to_root . "/admin/db/maintenance_db.inc"); +include_once($path_to_root . "/includes/ui.inc"); + +//--------------------------------------------------------------------------------------------- + +if ($id = find_submit('Delete', false)) +{ + $extensions = get_company_extensions(); + if (($extensions[$id]['type']=='chart') && uninstall_package($extensions[$id]['package'])) { + unset($extensions[$id]); + if (update_extensions($extensions)) { + display_notification(_("Selected chart has been successfully deleted")); + meta_forward($_SERVER['PHP_SELF']); + } + } +} + +if ($id = find_submit('Update', false)) + install_extension($id); + +//--------------------------------------------------------------------------------------------- +start_form(true); + + div_start('ext_tbl'); + start_table(TABLESTYLE); + + $th = array(_("Chart"), _("Installed"), _("Available"), _("Encoding"), "", ""); + table_header($th); + + $k = 0; + $mods = get_charts_list(); + + foreach($mods as $pkg_name => $ext) + { + $available = @$ext['available']; + $installed = @$ext['version']; + $id = @$ext['local_id']; + $encoding = @$ext['encoding']; + + alt_table_row_color($k); + +// label_cell(is_array($ext['Descr']) ? $ext['Descr'][0] : $ext['Descr']); + label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']); + + label_cell($id === null ? _("None") : + ($available && $installed ? $installed : _("Unknown"))); + label_cell($available ? $available : _("None")); + label_cell($encoding ? $encoding : _("Unknown")); + + if ($available && check_pkg_upgrade($installed, $available)) // outdated or not installed theme in repo + button_cell('Update'.$pkg_name, $installed ? _("Update") : _("Install"), + _('Upload and install latest extension package'), ICON_DOWN); + else + label_cell(''); + + if ($id !== null) { + delete_button_cell('Delete'.$id, _('Delete')); + submit_js_confirm('Delete'.$id, + sprintf(_("You are about to remove package \'%s\'.\nDo you want to continue ?"), + $ext['name'])); + } else + label_cell(''); + + end_row(); + } + + end_table(1); + + div_end(); + +//--------------------------------------------------------------------------------------------- +end_form(); + +end_page(); +?> \ No newline at end of file diff --git a/applications/setup.php b/applications/setup.php index 89b095ec..344ee00a 100644 --- a/applications/setup.php +++ b/applications/setup.php @@ -70,7 +70,9 @@ class setup_app extends application $this->add_rapp_function(2, _("Install/Activate &Extensions"), "admin/inst_module.php?", 'SA_CREATEMODULES'); $this->add_rapp_function(2, _("Install/Activate &Themes"), - "admin/inst_theme.php?", 'SA_CREATEMODULES'); + "admin/inst_module.php?", 'SA_CREATEMODULES'); + $this->add_rapp_function(2, _("Install/Activate &Chart of Accounts"), + "admin/inst_chart.php?", 'SA_CREATEMODULES'); $this->add_rapp_function(2, _("Software &Upgrade"), "admin/inst_upgrade.php?", 'SA_SOFTWAREUPGRADE');