WIP vchamilo - disable 1.9.x import

pull/2487/head
jmontoyaa 9 years ago
parent 5415454f06
commit 7681724d61
  1. 6
      plugin/vchamilo/lib/Virtual.php
  2. 17
      plugin/vchamilo/views/import.php

@ -975,8 +975,9 @@ class Virtual
/** /**
* @param stdClass $data * @param stdClass $data
* @param string $fromVersion
*/ */
public static function importInstance($data) public static function importInstance($data, $fromVersion)
{ {
if (isset($data->what)) { if (isset($data->what)) {
unset($data->what); unset($data->what);
@ -1069,6 +1070,7 @@ class Virtual
} }
if (!$id) { if (!$id) {
var_dump($data);
throw new Exception('Was not registered'); throw new Exception('Was not registered');
} }
@ -1128,7 +1130,7 @@ class Virtual
$outputStream = new \Symfony\Component\Console\Output\BufferedOutput($tmpFile); $outputStream = new \Symfony\Component\Console\Output\BufferedOutput($tmpFile);
$arguments = array( $arguments = array(
'from-version' => '1.10.0', // @todo change value 'from-version' => $fromVersion, // @todo change value
'to-version' => '1.11.x', 'to-version' => '1.11.x',
'host' => $newDatabase->db_host, 'host' => $newDatabase->db_host,
'username' => $newDatabase->db_user, 'username' => $newDatabase->db_user,

@ -53,6 +53,21 @@ $form->addSelect(
$encryptList $encryptList
); );
$encryptList = Virtual::getEncryptList();
$versionList = [
'1.11.x',
'1.10.x',
//'1.9.x'
];
$form->addSelect(
'version',
get_lang('FromVersion'),
array_combine($versionList, $versionList)
);
$form->addText( $form->addText(
'course_path', 'course_path',
[ [
@ -153,7 +168,7 @@ if ($form->validate()) {
$vchamilo->upload_path = $values['upload_path']; $vchamilo->upload_path = $values['upload_path'];
$vchamilo->password_encryption = $values['password_encryption']; $vchamilo->password_encryption = $values['password_encryption'];
Virtual::importInstance($vchamilo); Virtual::importInstance($vchamilo, $values['version']);
Virtual::redirect(api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php'); Virtual::redirect(api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php');
} }

Loading…
Cancel
Save