Minor improvements
This commit is contained in:
parent
4fd4180d1c
commit
e155edd1bd
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
namespace Model;
|
||||
|
||||
require 'vendor/SimpleValidator/Validator.php';
|
||||
require 'vendor/SimpleValidator/Base.php';
|
||||
require 'vendor/SimpleValidator/Validators/Required.php';
|
||||
require 'vendor/SimpleValidator/Validators/Unique.php';
|
||||
require 'vendor/SimpleValidator/Validators/MaxLength.php';
|
||||
require 'vendor/SimpleValidator/Validators/MinLength.php';
|
||||
require 'vendor/SimpleValidator/Validators/Integer.php';
|
||||
require 'vendor/SimpleValidator/Validators/Equals.php';
|
||||
require 'vendor/SimpleValidator/Validators/AlphaNumeric.php';
|
||||
require 'vendor/PicoDb/Database.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validator.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Base.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/Required.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/Unique.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/MaxLength.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/MinLength.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/Integer.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/Equals.php';
|
||||
require __DIR__.'/../vendor/SimpleValidator/Validators/AlphaNumeric.php';
|
||||
require __DIR__.'/../vendor/PicoDb/Database.php';
|
||||
require __DIR__.'/schema.php';
|
||||
|
||||
abstract class Base
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<section id="main">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Projects') ?><span id="page-counter"> (<?= $nb_projects ?>)</span></h2>
|
||||
<?php if ($_SESSION['user']['is_admin'] == 1): ?>
|
||||
<ul>
|
||||
<li><a href="?controller=project&action=create"><?= t('New project') ?></a></li>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<section>
|
||||
<?php if (empty($projects)): ?>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Edit user') ?></h2>
|
||||
<ul>
|
||||
<li><a href="?action=users"><?= t('All users') ?></a></li>
|
||||
<li><a href="?controller=user"><?= t('All users') ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<section id="main">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Users') ?><span id="page-counter"> (<?= $nb_users ?>)</span></h2>
|
||||
<?php if ($_SESSION['user']['is_admin'] == 1): ?>
|
||||
<ul>
|
||||
<li><a href="?controller=user&action=create"><?= t('New user') ?></a></li>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<section>
|
||||
<?php if (empty($users)): ?>
|
||||
|
|
@ -14,9 +16,7 @@
|
|||
<th><?= t('Username') ?></th>
|
||||
<th><?= t('Administrator') ?></th>
|
||||
<th><?= t('Default Project') ?></th>
|
||||
<?php if ($_SESSION['user']['is_admin'] == 1): ?>
|
||||
<th><?= t('Actions') ?></th>
|
||||
<?php endif ?>
|
||||
<th><?= t('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($users as $user): ?>
|
||||
<tr>
|
||||
|
|
@ -29,15 +29,17 @@
|
|||
<td>
|
||||
<?= $projects[$user['default_project_id']] ?>
|
||||
</td>
|
||||
<?php if ($_SESSION['user']['is_admin'] == 1): ?>
|
||||
<td>
|
||||
<a href="?controller=user&action=edit&user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
|
||||
<?php if (count($users) > 1): ?>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=user&action=confirm&user_id=<?= $user['id'] ?>"><?= t('remove') ?></a>
|
||||
<?php if ($_SESSION['user']['is_admin'] == 1 || $_SESSION['user']['id'] == $user['id']): ?>
|
||||
<a href="?controller=user&action=edit&user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
|
||||
<?php endif ?>
|
||||
<?php if ($_SESSION['user']['is_admin'] == 1): ?>
|
||||
<?php if (count($users) > 1): ?>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=user&action=confirm&user_id=<?= $user['id'] ?>"><?= t('remove') ?></a>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue