Skip to content

Commit

Permalink
fix compatibility issues for 4.0 and 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed May 17, 2018
1 parent ea01200 commit 8aa5229
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions MeetingPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ public function __construct()

if (Navigation::hasItem('/admin/locations')) {
Navigation::addItem('/admin/locations/meetings', $item);
} elseif (Navigation::hasItem('/meetings')) {
} elseif (!Navigation::hasItem('/meetings')) {
Navigation::addItem('/meetings', $item);
}

$item = new Navigation($this->_('Meetings konfigurieren'), PluginEngine::getLink($this, array(), 'admin/index'));
$item->setImage(self::getIcon('chat', 'white'));
if (Navigation::hasItem('/admin/config/meetings')) {
if (!Navigation::hasItem('/admin/config/meetings')) {
Navigation::addItem('/admin/config/meetings', $item);
}
} elseif ($perm->have_perm('dozent')) {
$item = new Navigation($this->_('Meine Meetings'), PluginEngine::getLink($this, array(), 'index/my'));
if (Navigation::hasItem('/profile/meetings')) {
if (!Navigation::hasItem('/profile/meetings')) {
Navigation::addItem('/profile/meetings', $item);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ private function handleDeletion()
$this->_('Wollen Sie wirklich das Meeting "%s" löschen?'),
$meeting->name
),
'approvalLink' => PluginEngine::getLink($this->plugin, array('destination' => Request::get('destination')), 'index/delete/'.$meeting->id.'/'.Request::get('cid'), true),
'approvalLink' => PluginEngine::getLink($this->plugin, array('destination' => Request::get('destination')), 'index/delete/'.$meeting->id .'/'. Request::get('cid') .'?cid='. Request::get('cid'), true),
'disapprovalLink' => PluginEngine::getLink($this->plugin, array(), Request::get('destination')),
);
}
Expand Down
18 changes: 5 additions & 13 deletions migrations/004_create_default_driver_option.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ function description()
function up()
{
$db = DBManager::get();
$db->exec(sprintf(
'INSERT INTO
$db->exec('INSERT INTO
config
SET
config_id = "%s",
field = "VC_DRIVER",
type = "string",
value = "",
mkdate = UNIX_TIMESTAMP(NOW()),
chdate = UNIX_TIMESTAMP(NOW()),
description = "bigbluebutton oder dfnvc"',
\ElanEv\Driver\DriverFactory::DEFAULT_DRIVER_CONFIG_ID
));
description = "bigbluebutton oder dfnvc"'
);

SimpleORMap::expireTableScheme();
}
Expand All @@ -45,13 +43,7 @@ function up()
function down()
{
$db = DBManager::get();
$db->exec(sprintf(
'DELETE FROM
config
WHERE
config_id = "%s"',
\ElanEv\Driver\DriverFactory::DEFAULT_DRIVER_CONFIG_ID
));
$db->exec('DELETE FROM config WHERE field = "VC_DRIVER"');

SimpleORMap::expireTableScheme();
}
Expand Down
18 changes: 13 additions & 5 deletions migrations/018_new_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ public function description()
public function up()
{
try {
$query = "REPLACE INTO `config`
(`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`,
`mkdate`, `chdate`, `description`)
VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'meetings',
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)";
if (StudipVersion::olderThan('4.1')) {
$query = "REPLACE INTO `config`
(`field`, `value`, `type`, `range`, `section`,
`mkdate`, `chdate`, `description`, `comment`)
VALUES (:field, :value, :type, 'global', 'meetings',
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description, '')";
} else {
$query = "REPLACE INTO `config`
(`field`, `value`, `type`, `range`, `section`,
`mkdate`, `chdate`, `description`)
VALUES (:field, :value, :type, 'global', 'meetings',
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)";
}

$statement = DBManager::get()->prepare($query);

Expand Down
2 changes: 1 addition & 1 deletion plugin.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginname=Meetings
pluginclassname=MeetingPlugin
origin=elan-ev
version=1.4.4
version=1.4.5
studipMinVersion=4.0
studipMaxVersion=4.1
description=Virtueller Raum, mit dem Live-Online-Treffen, ***REMOVED***e und Videokonferenzen durchgeführt werden können.
Expand Down

0 comments on commit 8aa5229

Please sign in to comment.