X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=admin%2Finst_module.php;h=76cb83635f02bdb4b56cc63696389db1190d1616;hb=7e4a25e77c81fb5daabe53f83cc10c147808fd01;hp=5f8e236361d36e44c3b4e8195750f6938cea03a6;hpb=cb8cf10b735342399abfce9384565a7474b92947;p=fa-stable.git
diff --git a/admin/inst_module.php b/admin/inst_module.php
index 5f8e2363..76cb8363 100644
--- a/admin/inst_module.php
+++ b/admin/inst_module.php
@@ -8,6 +8,7 @@ page(_("Install/Update Modules"));
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 . "/modules/installed_modules.php");
include_once($path_to_root . "/includes/ui.inc");
@@ -175,7 +176,7 @@ function write_modules()
function handle_submit()
{
- global $path_to_root, $installed_modules;
+ global $path_to_root, $installed_modules, $db_connections;
if (!check_data())
return false;
@@ -201,6 +202,16 @@ function handle_submit()
}
else
$installed_modules[$id]['filename'] = $_POST['filename'];
+ if (is_uploaded_file($_FILES['uploadfile2']['tmp_name']))
+ {
+ $file1 = $_FILES['uploadfile2']['tmp_name'];
+ $file2 = $directory . "/".$_FILES['uploadfile2']['name'];
+ if (file_exists($file2))
+ unlink($file2);
+ move_uploaded_file($file1, $file2);
+ $db_name = $_SESSION["wa_current_user"]->company;
+ db_import($file2, $db_connections[$db_name]);
+ }
if (!write_modules())
return false;
return true;
@@ -311,6 +322,7 @@ function display_module_edit($selected_id)
text_row_ex(_("Folder"), 'path', 20);
label_row(_("Module File"), "");
+ label_row(_("SQL File"), "");
end_table(0);
display_note(_("Select your module PHP file from your local harddisk."), 0, 1);