Skip to content
Snippets Groups Projects
Commit b3a30c5c authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

fixes #75

parent 90199f43
No related branches found
No related tags found
No related merge requests found
...@@ -39,25 +39,21 @@ class MarketPlugin extends SimpleORMap { ...@@ -39,25 +39,21 @@ class MarketPlugin extends SimpleORMap {
'on_delete' => 'delete', 'on_delete' => 'delete',
'on_store' => 'store' 'on_store' => 'store'
); );
$config['registered_callbacks']['before_store'][] = 'requestReview';
parent::configure($config); parent::configure($config);
} }
public function __construct($id = null)
{
$this->registerCallback('before_store', 'requestReview');
parent::__construct($id);
}
public function requestReview() { public function requestReview() {
if ($this->content['publiclyvisible'] && !$this->content_db['publiclyvisible'] && !$this['approved']) { if ($this->content['publiclyvisible'] && !$this->content_db['publiclyvisible'] && !$this['approved']) {
$messaging = new messaging(); $messaging = new messaging();
$statement = DBManager::get()->prepare(" $statement = DBManager::get()->prepare("
SELECT roles_user.user_id SELECT roles_user.userid
FROM roles FROM roles
INNER JOIN roles_user ON (roles.roleid = roles_user.roleid) INNER JOIN roles_user ON (roles.roleid = roles_user.roleid)
WHERE roles.rolename = 'Pluginbeauftragter' WHERE roles.rolename = 'Pluginbeauftragter'
"); ");
$statement->execute(); $statement->execute();
foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $beauftragter) { foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $beauftragter) {
$messaging->sendSystemMessage( $messaging->sendSystemMessage(
$beauftragter, $beauftragter,
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</td> </td>
<td class="actions"> <td class="actions">
<a href="<?= $controller->url_for('approving/review/' . $marketplugin->getId()) ?>" data-dialog> <a href="<?= $controller->url_for('approving/review/' . $marketplugin->getId()) ?>" data-dialog>
<?= Icon::create('assessment') ?> <?= Icon::create('assessment', 'clickable')->asImg(20) ?>
</a> </a>
</td> </td>
</tr> </tr>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<td> <td>
<? if ($marketplugin['publiclyvisible'] && !$marketplugin['approved']) : ?> <? if ($marketplugin['publiclyvisible'] && !$marketplugin['approved']) : ?>
<?= Icon::create('exclaim-circle', 'status-red', ['title' => _("Plugin wurde noch nicht von einem Administrator freigeschaltet."), <?= Icon::create('exclaim-circle', 'status-red', ['title' => _("Plugin wurde noch nicht von einem Administrator freigeschaltet."),
'class' => "text-bottom"]) ?> 'class' => "text-bottom"])->asImg(20) ?>
<? endif; ?> <? endif; ?>
<a href="<?= $controller->url_for('presenting/details/' . $marketplugin->getId()) ?>"> <a href="<?= $controller->url_for('presenting/details/' . $marketplugin->getId()) ?>">
<?= htmlReady($marketplugin['name']) ?> <?= htmlReady($marketplugin['name']) ?>
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
</td> </td>
<td class="actions"> <td class="actions">
<a href="<?= $controller->url_for('myplugins/edit/' . $marketplugin->getId()) ?>" data-dialog title="<?= _("Plugin-Info bearbeiten") ?>"> <a href="<?= $controller->url_for('myplugins/edit/' . $marketplugin->getId()) ?>" data-dialog title="<?= _("Plugin-Info bearbeiten") ?>">
<?= Icon::create('edit') ?> <?= Icon::create('edit', 'clickable')->asImg(20) ?>
</a> </a>
<a href="<?= $controller->url_for('myplugins/add_release/' . $marketplugin->getId()) ?>" data-dialog title="<?= _("Neues Release hinzufgen") ?>"> <a href="<?= $controller->url_for('myplugins/add_release/' . $marketplugin->getId()) ?>" data-dialog title="<?= _("Neues Release hinzufgen") ?>">
<?= Icon::create('add') ?> <?= Icon::create('add', 'clickable')->asImg(20) ?>
</a> </a>
</td> </td>
</tr> </tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment