Merge branch 'master' of disposed.de:scattport

This commit is contained in:
Karsten Heiken
2011-09-28 19:19:35 +02:00
3 changed files with 41 additions and 62 deletions

View File

@@ -1,59 +0,0 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
* Copyright (c) 2011 Karsten Heiken, Eike Foken
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
*
* @author Karsten Heiken <karsten@disposed.de>
*/
class Programs extends MY_Controller {
/**
* Constructor.
*/
public function __construct() {
parent::__construct();
$this->load->model('program');
}
/**
* Show a list of all available programs.
*/
public function index() {
$programs = $this->program->getAll();
$tpl['programs'] = $programs;
$this->load->view('program/list', $tpl);
}
/**
* Show detailed information about a program.
*
* @param type $prg_id The program's id
*/
public function detail($prg_id) {
$program = $this->program->getById($prg_id);
$tpl['program'] = $program;
$this->load->view('program/detail', $tpl);
}
}

View File

@@ -50,6 +50,11 @@
<?php <?php
endif; endif;
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()): if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
if (isset($job['id']) && $job['finished_at'] != '0000-00-00 00:00:00'):
?>
<a href="javascript:deleteConfirm('<?=site_url('experiments/delete/' . $experiment['id']);?>');" class="button delete"><?=_('Delete experiment');?></a>
<?php
endif;
?> ?>
<a href="javascript:changeTitle('<?=$experiment['name'];?>', '<?=site_url('ajax/rename_experiment/' . $experiment['id']);?>');" class="button experiment_rename"><?=_('Change title');?></a> <a href="javascript:changeTitle('<?=$experiment['name'];?>', '<?=site_url('ajax/rename_experiment/' . $experiment['id']);?>');" class="button experiment_rename"><?=_('Change title');?></a>
<?php <?php

View File

@@ -39,6 +39,13 @@
<thead> <thead>
<tr> <tr>
<th scope="col"><?=_('Name');?></th> <th scope="col"><?=_('Name');?></th>
<?php
if (count($shares) > 0 || $project['public'] == 1):
?>
<th scope="col"><?=_('Creator');?></th>
<?php
endif;
?>
<th scope="col"><?=_('Jobs');?></th> <th scope="col"><?=_('Jobs');?></th>
<th scope="col"><?=_('Actions');?></th> <th scope="col"><?=_('Actions');?></th>
</tr> </tr>
@@ -63,6 +70,20 @@
?> ?>
<tr> <tr>
<td><a href="<?=site_url('experiments/detail/' . $experiment['id']);?>" title="<?=sprintf(_('Show experiment &quot;%s&quot;'), $experiment['name']);?>"><?=$experiment['name'];?></a></td> <td><a href="<?=site_url('experiments/detail/' . $experiment['id']);?>" title="<?=sprintf(_('Show experiment &quot;%s&quot;'), $experiment['name']);?>"><?=$experiment['name'];?></a></td>
<?php
if (count($shares) > 0 || $project['public'] == 1):
if ($experiment['creator_id'] == $this->access->profile()->id):
?>
<td><?=_('You');?></td>
<?php
else:
$user = $this->user->getById($experiment['creator_id']);
?>
<td><?=anchor('users/profile/' . urlencode($user['username']), $user['firstname'].' '.$user['lastname']);?></td>
<?php
endif;
endif;
?>
<td><span class="<?=$job['css'];?>"><?=$job['status'];?></span></td> <td><span class="<?=$job['css'];?>"><?=$job['status'];?></span></td>
<td> <td>
<?php <?php
@@ -75,10 +96,12 @@
<a href="<?=site_url('experiments/create/' . $project['id'] . '/' . $experiment['id']);?>" title="<?=sprintf(_('Copy experiment &quot;%s&quot;'), $experiment['name']);?>"><?=_('Copy');?></a> <a href="<?=site_url('experiments/create/' . $project['id'] . '/' . $experiment['id']);?>" title="<?=sprintf(_('Copy experiment &quot;%s&quot;'), $experiment['name']);?>"><?=_('Copy');?></a>
<?php <?php
if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()): if ($experiment['creator_id'] == $this->access->profile()->id || $this->access->isAdmin()):
if ($job['css'] == 'closed' || $job['css'] == ''):
?> ?>
| <a href="<?=site_url('experiments/edit/' . $experiment['id']);?>" title="<?=sprintf(_('Edit this experiment'), $experiment['name']);?>"><?=_('Edit');?></a> | <a href="<?=site_url('experiments/edit/' . $experiment['id']);?>" title="<?=sprintf(_('Edit this experiment'), $experiment['name']);?>"><?=_('Edit');?></a>
| <a href="javascript:deleteConfirm('<?=site_url('experiments/delete/' . $experiment['id']);?>');" title="<?=sprintf(_('Delete this experiment'), $experiment['name']);?>"><?=_('Delete');?></a>
<?php <?php
if ($job['css'] == 'closed' || $job['css'] == ''): elseif ($job['css'] == 'active'):
?> ?>
| <a href="javascript:deleteConfirm('<?=site_url('experiments/delete/' . $experiment['id']);?>');" title="<?=sprintf(_('Delete this experiment'), $experiment['name']);?>"><?=_('Delete');?></a> | <a href="javascript:deleteConfirm('<?=site_url('experiments/delete/' . $experiment['id']);?>');" title="<?=sprintf(_('Delete this experiment'), $experiment['name']);?>"><?=_('Delete');?></a>
<?php <?php
@@ -130,8 +153,18 @@
<td><?=$job['name'];?></td> <td><?=$job['name'];?></td>
<td><span class="<?=$job['cssclass'];?>"><?=$job['humanstatus'];?></span></td> <td><span class="<?=$job['cssclass'];?>"><?=$job['humanstatus'];?></span></td>
<td> <td>
<a href="<?=site_url('results/experiment/' . $job['id']);?>" title="<?= sprintf(_('Show results for this experiment'), $job['name']);?>"><?=_('Show results');?></a> | <?php
<a href="<?=site_url('experiments/edit/' . $job['id']);?>" title="<?= sprintf(_('Edit this experiment'), $job['name']);?>"><?=_('Edit');?></td> if ($job['status'] == 'complete'):
?>
<a href="<?=site_url('results/experiment/' . $job['experiment_id']);?>" title="<?= sprintf(_('Show results for this experiment'), $job['name']);?>"><?=_('Show results');?></a>
<?php
else:
?>
-
<?php
endif;
?>
</td>
</tr> </tr>
<?php <?php
endforeach; endforeach;