Merge pull request #166 from ygresil/3.8

3.8
This commit is contained in:
Romain Neutron
2012-07-18 08:31:45 -07:00
29 changed files with 2837 additions and 2183 deletions

View File

@@ -14,6 +14,7 @@ rewrite ^/admin/description/.*$ /admin/router.php last;
rewrite ^/admin/subdefs/.*$ /admin/router.php last;
rewrite ^/admin/publications/.*$ /admin/router.php last;
rewrite ^/admin/typeahead/.*$ /admin/router.php last;
rewrite ^/admin/connected-users/.*$ /admin/router.php last;
rewrite ^/prod/records/edit/.*$ /prod/router.php last;

View File

@@ -26,6 +26,7 @@ return call_user_func(
$app['Core'] = \bootstrap::getCore();
$app->mount('/', new Controller\Root());
$app->mount('/connected-users', new Controller\ConnectedUsers());
$app->mount('/publications', new Controller\Publications());
$app->mount('/users', new Controller\Users());
$app->mount('/fields', new Controller\Fields());

View File

@@ -0,0 +1,68 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2012 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Controller\Admin;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Silex\ControllerCollection;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class ConnectedUsers implements ControllerProviderInterface
{
public function connect(Application $app)
{
$controllers = $app['controllers_factory'];
$controllers->get('/', function(Application $app, Request $request) {
$app['Core']['Twig']->addFilter('AppName', new \Twig_Filter_Function(__CLASS__ . '::appName'));
return new Response(
$app['Core']['Twig']->render(
'admin/connected-users.html.twig', array('datas' => \Session_Handler::get_active_sessions()
)
)
);
});
return $controllers;
}
public function appName($appId)
{
$appRef = array(
'0' => _('admin::monitor: module inconnu')
, '1' => _('admin::monitor: module production')
, '2' => _('admin::monitor: module client')
, '3' => _('admin::monitor: module admin')
, '4' => _('admin::monitor: module report')
, '5' => _('admin::monitor: module thesaurus')
, '6' => _('admin::monitor: module comparateur')
, '7' => _('admin::monitor: module validation')
, '8' => _('admin::monitor: module upload')
);
return isset($appRef[$appId]) ? $appRef[$appId] : $appRef['0'];
}
}

View File

@@ -652,11 +652,43 @@ class Session_Handler
$geonames = new geonames();
foreach ($rs as $k => $row) {
$rs[$k]['created_on'] = new DateTime($row['created_on']);
$rs[$k]['lastaccess'] = new DateTime($row['lastaccess']);
$rs[$k]['token'] = ! ! $row['token'];
$rs[$k]['usr_id'] = User_Adapter::getInstance($row['usr_id'], appbox::get_instance(\bootstrap::getCore()));
$ret = array(
'sessions' => array(),
'applications' => array(
'0' => 0,
'1' => 0,
'2' => 0,
'3' => 0,
'4' => 0,
'5' => 0,
'6' => 0,
'7' => 0,
'8' => 0,
)
);
foreach ($rs as $row) {
$session = array();
$session['browser'] = $row['browser'];
$session['browser_version'] = $row['browser_version'];
$session['session_id'] = $row['session_id'];
$session['user_agent'] = $row['user_agent'];
$session['ip'] = $row['ip'];
$session['screen'] = $row['screen'];
$session['platform'] = $row['platform'];
$session['created_on'] = new DateTime($row['created_on']);
$session['lastaccess'] = new DateTime($row['lastaccess']);
$session['token'] = ! ! $row['token'];
$session['user'] = User_Adapter::getInstance($row['usr_id'], appbox::get_instance(\bootstrap::getCore()));
$session["app"] = (array) unserialize($row["app"]);
foreach ($session["app"] as $app) {
if (isset($ret['applications'][$app])) {
$ret['applications'][$app] ++;
}
}
$datas = $geonames->find_geoname_from_ip($row['ip']);
@@ -670,10 +702,12 @@ class Session_Handler
$infos = '';
}
$rs[$k]['ip_infos'] = $infos;
$session['ip_infos'] = $infos;
$ret['sessions'][] = $session;
}
return $rs;
return $ret;
}
}

View File

@@ -292,116 +292,6 @@ class setup
);
}
public function check_mod_auth_token()
{
$registry = registry::get_instance();
if ($registry->get('GV_h264_streaming') !== true) {
return;
}
?>
<h1>mod_auth_token configuration </h1>
<ul class="setup">
<?php
$fileName = $registry->get('GV_mod_auth_token_directory_path') . '/test_mod_auth_token.txt'; // The file to access
touch($fileName);
$url = $registry->get('GV_ServerName') . p4file::apache_tokenize($fileName);
if (http_query::getHttpCodeFromUrl($url) == 200)
echo '<li>' . _('mod_auth_token correctement configure') . '</li>';
else
echo '<li class="blocker">' . _('mod_auth_token mal configure') . '</li>';
?>
</ul>
<?php
}
public function check_apache()
{
$registry = registry::get_instance();
?>
<h1>Apache Server mods avalaibility</h1>
<div style="position:relative;float:left;">
<?php
echo _('Attention, seul le test de l\'activation des mods est effectue, leur bon fonctionnement ne l\'est pas ')
?>
</div>
<ul id="apache_mods_checker" class="setup">
<li class="blocker">
<a href="#" onclick="check_apache_mod(this,'rewrite');return false;">mod_rewrite (required)</a>
</li>
<li class="blocker">
<a href="#" onclick="check_apache_mod(this,'xsendfile');return false;">mod_xsendfile (optionnal)</a>
<?php
if ($registry->get('GV_modxsendfile')) {
?>
<div class="infos"><img style="vertical-align:middle" src="/skins/icons/alert.png"/> <?php echo _('Attention, veuillez verifier la configuration xsendfile, actuellement activee dans le setup'); ?></div>
<?php } ?>
</li>
<li class="blocker">
<a href="#" onclick="check_apache_mod(this,'authtoken');return false;">mod_auth_token (optionnal)</a>
<?php
if ($registry->get('GV_h264_streaming')) {
?>
<div class="infos"><img style="vertical-align:middle" src="/skins/icons/alert.png"/> <?php echo _('Attention, veuillez verifier la configuration h264_streaming, actuellement activee dans le setup'); ?></div>
<?php } ?>
</li>
<li class="blocker">
<a href="#" onclick="check_apache_mod(this,'h264');return false;">mod_h264_streaming (optionnal)</a>
<?php
if ($registry->get('GV_h264_streaming')) {
?>
<div class="infos"><img style="vertical-align:middle" src="/skins/icons/alert.png"/> <?php echo _('Attention, veuillez verifier la configuration h264_streaming, actuellement activee dans le setup'); ?></div>
<?php } ?>
</li>
<style type="text/css">
#apache_mods_checker div.infos{
display:none;
}
#apache_mods_checker .blocker div.infos{
display:block;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$('#apache_mods_checker a').trigger('click');
});
function check_apache_mod(el,mod)
{
var url = '/admin/test-';
switch (mod) {
case 'rewrite':
url += 'rewrite';
break;
case 'xsendfile':
url += 'xsendfile';
break;
case 'authtoken':
url += 'authtoken';
break;
case 'h264':
url += 'h264';
break;
}
$.get(url, function(data) {
if(data == '1')
$(el).closest('li').removeClass('blocker');
else
$(el).closest('li').addClass('blocker');
});
}
</script>
<?php
echo '</ul>';
}
public static function check_phrasea()
{
@@ -481,20 +371,6 @@ class setup
return $php_constraints;
}
function check_mail_form()
{
echo '<h1>' . _('setup::Tests d\'envois d\'emails') . '</h1>';
?>
<form method="post" action="/admin/sitestruct.php" target="_self">
<label>Email : </label><input name="email" type="text" />
<input type="submit" value="<?php echo _('boutton::valider'); ?>"/>
</form>
<?php
return;
}
/**
*
*/
@@ -555,31 +431,6 @@ class setup
return new Setup_ConstraintsIterator($constraints);
}
function check_cache_memcache()
{
$Core = \bootstrap::getCore();
echo '<h1>' . _('setup:: Serveur Memcached') . '</h1>';
echo '<ul class="setup">';
$registry = registry::get_instance();
if ($Core->getCache()->isServer()) {
$stats = $Core->getCache()->getStats();
echo '<li>' . sprintf(_('setup::Serveur actif sur %s'), $registry->get('GV_cache_server_host') . ':' . $registry->get('GV_cache_server_port')) . '</li>';
echo "<table>";
foreach ($stats as $name => $stat) {
echo "<tr class='even'><td>" . $name . "</td><td> " . $stat . "</td></tr>";
}
echo "</table>";
} else {
echo '<li class="non-blocker">' . sprintf(_('setup::Aucun serveur memcached rattache.')) . '</li>';
}
echo '</ul>';
}
public static function check_cache_opcode()
{
@@ -651,28 +502,6 @@ class setup
return new Setup_ConstraintsIterator($constraints);
}
public static function check_sphinx_search()
{
$registry = registry::get_instance();
try {
$engine = new searchEngine_adapter($registry);
$status = $engine->get_status();
echo '<h1>' . _('setup::Etat du moteur de recherche') . '</h1>';
echo '<ul class="setup">';
foreach ($status as $value) {
echo '<li>' . sprintf('%s : %s', $value[0], $value[1]) . '</li>';
}
echo '</ul>';
} catch (Exception $e) {
echo '<h1>' . _('setup::Sphinx confguration') . '</h1>';
echo '<ul class="setup">';
echo '<li class="blocker">' . $e->getMessage() . '</li>';
echo '</ul>';
}
}
/**
*

View File

@@ -0,0 +1,132 @@
{% macro tooltip_connected_users(row) %}
<span id="tooltip-usr">
<table id="tabledescexp" cellpadding="0" cellspacing="0">
<tr>
<td class="tooltip-title" colspan="2" valign="center" >usr_id : {{ row['user'].get_id() }}</td>
</tr>
<tr>
<td colspan="2" style="height: 10px;"></td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur nom' | trans }} : </strong>{{ row['user'].get_display_name() }}</td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur societe' | trans }} : </strong>{{ row['user'].get_company() }}</td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur telephone' | trans }} : </strong>{{ row['user'].get_tel() }}</td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur email' | trans }} : </strong>{{ row['user'].get_email() }}</td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::monitor: bases sur lesquelles l\'utilisateur est connecte : ' | trans }} :</strong></td>
</tr>
{% for databox in row['user'].ACL().get_granted_sbas() %}
<tr>
<td colspan="2" style="overflow:hidden;" >{{ databox.get_viewname() }}</td>
</tr>
{% endfor %}
<tr>
<td colspan="2" valign="center" >
<strong>{{ row['platform'] }} / {{ row['browser'] }} - {{ row['browser_version'] }}</strong><br/>
{% if row['token'] %}
{{ 'Session persistente' | trans }}
{%endif%}
</td>
</tr>
</table>
</span>
{% endmacro %}
<div class="tableTitle">{{ 'admin::utilisateurs: utilisateurs connectes' | trans }}</div>
<div class="center">
<table class="whoisTable" >
<tr>
<td class="colTitle" nowrap >{{ 'admin::monitor: module production' | trans }}</td>
<td class="colValue" nowrap >{{ datas['applications'][1] }}</td>
</tr>
<tr>
<td class="colTitle" nowrap >{{ 'admin::monitor: module client' | trans }}</td>
<td class="colValue" >{{ datas['applications'][2] }}</td>
</tr>
<tr>
<td class="colTitle" >{{ 'admin::monitor: module admin' | trans }}</td>
<td class="colValue" >{{ datas['applications'][3] }}</td>
</tr>
<tr>
<td class="colTitle" >{{ 'admin::monitor: module report' | trans }}</td>
<td class="colValue" >{{ datas['applications'][4] }}</td>
</tr>
<tr>
<td class="colTitle" >{{ 'admin::monitor: module thesaurus' | trans }}</td>
<td class="colValue" >{{ datas['applications'][5] }}</td>
</tr>
<tr>
<td class="colTitle" >{{ 'admin::monitor: module comparateur' | trans }}</td>
<td class="colValue" >{{ datas['applications'][6] }}</td>
</tr>
<tr>
<td class="colTitle" >{{ 'admin::monitor: module validation' | trans }}</td>
<td class="colValue" >{{ datas['applications'][7] }}</td>
</tr>
{% if datas['applications'][0] != 0 %}
<tr>
<td class="colTitle" >{{ 'admin::monitor: total des utilisateurs uniques : ' | trans }}</td>
<td class="colValue" >{{ datas['applications'][0] }}</td>
</tr>
{% endif %}
</table>
</div>
<hr class="spacehr">
<div class="center">
<table class='admintable'>
<thead>
<tr>
<th style="width:140px;" >{{ 'admin::monitor: utilisateur' | trans }}</th>
<th style="width:100px;" >{{ 'admin::monitor: modules' | trans }}</th>
<th style="width:120px;" >{{ 'phraseanet:: adresse' | trans }}</th>
<th style="width:140px;" >{{ 'admin::monitor: date de connexion' | trans }}</th>
<th style="width:140px;" >{{ 'admin::monitor: dernier access' | trans }}</th>
</tr>
</thead>
<tbody>
{% for row in datas['sessions'] %}
<tr title="{{ _self.tooltip_connected_users(row) | e }}" class="{% if loop.index is odd %}odd{% else %}even{% endif %} usrTips" id="TREXP_{{ row["session_id"]}}">
{% if row["session_id"] == session.get_ses_id() %}
<td style="color:#ff0000"><i>{{ row['user'].get_display_name() }}</i></td>
{% else %}
<td>{{ row['user'].get_display_name() }}</td>
{% endif %}
<td>
{% for app in row["app"] %}
{% if app != 0 %}
{{ app | AppName }}<br>
{% endif %}
{% endfor %}
</td>
<td>{{ row["ip"] }}<br/>{{ row["ip_infos"] }}</td>
<td>{{ row['created_on'] | getDate }}</td>
<td>{{ row['lastaccess'] | prettyString }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready(
function(){
$('.usrTips').tooltip();
}
);
</script>

View File

@@ -0,0 +1,198 @@
{% macro board_sub_section(sub_section_title, constraints_type) %}
<h2>{{ sub_section_title }}</h2>
<ul class="setup">
{% for constraint in constraints_type %}
<li class="{% if not constraint.is_ok() %}{% if constraint.is_blocker() %}blocker{% else %}non-blocker{% endif %}{% else %}good-enough{% endif %}">
{{ constraint.get_message() }}
</li>
{% endfor %}
</ul>
{% endmacro %}
<style type="text/css">
.ui-autocomplete {
max-height: 200px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 200px;
}
.ui-autocomplete-loading { background: white url('/skins/icons/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(document).ready(function(){
var container = $('#right-ajax');
$( ".admin_adder", container ).autocomplete({
source: "/admin/users/typeahead/search/",
minLength: 2,
select: function( event, ui ) {
var form = $('#admin_adder');
$('input.new[name="admins[]"]', form).val(ui.item.id);
form.submit();
}
}).data( "autocomplete" )._renderItem = function( ul, item ) {
var email = item.email ? '<br/>'+item.email : '';
var login = item.login != item.name ? " ("+ item.login +")" : '';
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.name + login + email + "</a>" )
.appendTo( ul );
};
});
</script>
{% if cache_flushed %}
<div>
{% trans 'all caches services have been flushed' %}
</div>
{% endif %}
<div class="board_section">
<h1>{% trans 'setup:: administrateurs de l\'application' %}</h1>
<form id="admin_adder" action="sitestruct.php" method="post">
<ul>
{% for usr_id, usr_login in admins %}
<li>
<label class="checkbox" for="adm_{{ usr_id }}">
<input type="checkbox" id="adm_{{ usr_id }}" name="admins[]" value="{{ usr_id }}" checked />
{{ usr_login }}
</label>
</li>
{% endfor %}
</ul>
<label>{% trans 'setup:: ajouter un administrateur de l\'application' %} :</label>
<input class="admin_adder input-large" />
<input type="hidden" class="new" name="admins[]" />
<input type="submit" class="btn btn-warning" value="{% trans 'boutton::valider' %}" />
</form>
<h2>{% trans 'setup:: Reinitialisation des droits admins' %}</h2>
<form id="admin_reset" action="sitestruct.php" method="post">
<input type="hidden" name="sudo" value="1" />
<input type="submit" class="btn btn-warning" value="{% trans 'boutton::reinitialiser' %}" />
</form>
</div>
<div class="board_section">
<h1 style="margin-bottom: 0;">{% trans 'setup:: Reglages generaux' %}</h1>
<h2 style="margin-top: 0; font-style: italic;">{% trans 'setup::Votre configuration' %}</h2>
<div class="section_left">
<h2>{% trans 'setup::Tests d\'envois d\'emails' %}</h2>
<form id="mail_checker" method="post" action="/admin/sitestruct.php" target="_self">
<label>Email : </label><input name="email" type="text" />
<input type="submit" class="btn btn-warning" value="{% trans 'boutton::valider' %}"/>
{% if email_status %}
<p>{% trans 'result : ' %}{{ email_status }}</p>
{% endif %}
</form>
{% for constraint in php_version_constraints %}
<h2>{{ constraint.get_name() }}</h2>
<ul class="setup">
<li class="{% if constraint.is_ok() %}good-enough{% else %}blocker{% endif %}">
{{ constraint.get_message() }}
</li>
</ul>
{% endfor %}
{% set sub_section_title %}
{% trans 'setup::Filesystem configuration' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, writability_constraints) }}
{% set sub_section_title %}
{% trans 'setup::Executables' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, binaries_constraints) }}
{% set sub_section_title %}
{% trans 'setup::PHP extensions' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, php_extension_constraints) }}
{% set sub_section_title %}
{% trans 'setup::Serveur de cache' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, cache_constraints) }}
</div>
<div class="section_right">
{% set sub_section_title %}
{% trans 'Phrasea Module' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, phrasea_constraints) }}
{% set sub_section_title %}
{% trans 'setup::Serveur de cache' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, cache_opcode_constraints) }}
<h2>{% trans 'setup:: Serveur Memcached' %}</h2>
<ul class="setup">
{% if core.getCache().isServer() %}
{% set stats = core.getCache().getStats() %}
<li>{% trans 'setup::Serveur actif sur %s' %} {{registry.get('GV_cache_server_host')}} : {{registry.get('GV_cache_server_port')}}</li>
<table>
{% for name, stat in stats%}
<tr class="even"><td>{{ name }}</td><td> {{ stat }}</td></tr>
{% endfor %}
</table>
{% else %}
<li class="non-blocker">{% trans 'setup::Aucun serveur memcached rattache.' %}</li>
{% endif %}
</ul>
{% if core.getCache().isServer() %}
<form id="cache_flusher" method="post" action="sitestruct.php">
<input type="hidden" name="flush_cache" value="1"/>
<input type="submit" id="flush_button" class="btn btn-warning" value="Flush All Caches" />
</form>
{% endif %}
<h2>{% trans 'OPCode cache' %}</h2>
<ul class="setup">
{% if core['OpcodeCache'].getName() == 'array' %}
<li class="non-blocker">{% trans 'Array opcode cache is activated, but phrasea strongly recommand the use of APC or Xcache in production' %}</li>
{% else %}
<li>{{ core['OpcodeCache'].getName() }}</li>
{% endif %}
</ul>
{% if search_engine_status %}
<h2>{% trans 'setup::Etat du moteur de recherche' %}</h2>
<ul class="setup">
{% for value in search_engine_status %}
<li>{{ value[0] }} : {{ value[1] }}</li>
{% endfor %}
</ul>
{% else %}
<h2>{% trans 'setup::Sphinx confguration' %}</h2>
<ul class="setup">
<li class="blocker">{% trans 'Search Engine not available' %}</li>
</ul>
{% endif %}
{% set sub_section_title %}
{% trans 'PHP Configuration' %}
{% endset %}
{{ _self.board_sub_section(sub_section_title, php_configuration_constraints) }}
</div>
</div>

View File

@@ -3,7 +3,7 @@
{% if selected_field.is_on_error() %}
{% set disabled = 'disabled="disabled"' %}
{% endif %}
<select class="metafield_{{ selected_field.get_id() }} dces_selector" {{ disabled }} name="dces_{{ selected_field.get_id() }}">
<select class="metafield_{{ selected_field.get_id() }} dces_selector input-medium" {{ disabled }} name="dces_{{ selected_field.get_id() }}">
<option value="">{% trans 'choisir' %}</option>
{% for field in available_dc_sources %}
<option value="{{ field.get_label() }}" {% if selected_field.get_dces_element() != null and selected_field.get_dces_element().get_label() == field.get_label() %}selected="selected"{% endif %}>
@@ -22,45 +22,38 @@
<option value="ar" {% if title == 'ar' %}selected="selected"{% endif %}>{% trans 'Arabe' %}</option>
{% endmacro %}
<div id="warning_dialog" style="display:none" title="{% trans 'Attention !' %}" >
<div id="warning_dialog" class="alert alert-error" style="display:none" title="{% trans 'Attention !' %}" ></div>
<div style="display:none;" id="field_changer">
<input type="text" id="field_chooser" class="input-medium" value="" />
<input type="text" id="current_field_label" class="input-medium" readonly value="" />
<button id="tag_remover" class="btn">{% trans 'Delete' %}</button>
<input type="hidden" name="field_id" value="" />
</div>
<div style="display:none" id="field_changer">
<input id="field_chooser" type="text" value="">
<input type="text" readonly value="" id="current_field_label"/>
<button id="tag_remover">{% trans 'Delete' %}</button>
<input name="field_id" type="hidden" value=""/>
</div>
<div style="display:none" id="field_adder" title="{% trans 'Add a field' %}">
<div>
<label for="input_new_field_name">
<input name="newfield_name" type="text" id="input_new_field_name"/>
{% trans 'New field name' %}
</label>
</div>
<div>
<div style="display:none;" id="field_adder" title="{% trans 'Add a field' %}">
<label for="input_new_field_name">{% trans 'New field name' %} :</label>
<input type="text" id="input_new_field_name" name="newfield_name" class="input-large" />
<p class="help-block">
<label class="checkbox" for="input_new_field_multi">
<input type="checkbox" name="newfield_multi" value="1" type="text" id="input_new_field_multi"/>
<input type="checkbox" id="input_new_field_multi" name="newfield_multi" value="1" />
{% trans 'This field is multi-valued' %} *
</label>
</div>
<br/>
</p>
<blockquote>* {% trans 'This can not be changed' %}</blockquote>
</div>
<div>
<button class="field_adder">
{% trans 'boutton::ajouter' %}
</button>
<button class="struct_saver">Submit</button>
<div class="btn-toolbar">
<button class="field_adder btn btn-warning">{% trans 'boutton::ajouter' %}</button>
<button class="struct_saver btn btn-warning">{% trans 'Valider' %}</button>
</div>
<form action="/admin/description/{{ databox.get_sbas_id() }}/" method="post" target="_self" id="form_struct">
<form id="form_struct" action="/admin/description/{{ databox.get_sbas_id() }}/" method="post" target="_self">
<input name="newfield" id="newfield" type="hidden" />
<input name="newfield_multi" id="newfield_multi" type="hidden" />
<input name="newfield_multi" id="newfield_multi" type="hidden" />
<table class="admintable">
<thead>
<tr>
<th></th>
<th>{% trans 'Nom' %}</th>
<th>{% trans 'Source' %}Source</th>
<th>{% trans 'Source' %}</th>
<th><span title="{% trans 'DublinCore Element Set' %}">DCES</span></th>
<th>{% trans 'Multivalue' %}</th>
<th>{% trans 'Indexable' %}</th>
@@ -83,111 +76,109 @@
{% set disabled = 'disabled="disabled"' %}
{% endif %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}">
<td>
<td class="centered" style="min-width: 22px;">
<a class="meta_deleter">
<input type="hidden" value="{{ field.get_id() }}"/>
<input type="hidden" value="{{ field.get_id() }}" />
<img src="/skins/icons/delete.png">
</a>
<input type="hidden" name="field_ids[]" value="{{ field.get_id() }}" />
</td>
<td>
<input style="width:100px;" class="meta_namer metafield_{{ field.get_id() }}" {{ disabled }} type="text" name="name_{{ field.get_id() }}" value="{{ field.get_name () }}" />
<input type="text" class="meta_namer metafield_{{ field.get_id() }} input-medium" {{ disabled }} name="name_{{ field.get_id() }}" value="{{ field.get_name () }}" />
</td>
<td>
<span id="display_value_{{ field.get_id() }}">{% if field.is_on_error() %}Error{% elseif field.get_tag().getTagname() != '' %}{{ field.get_tag().getTagname() }}{% else %}No source{% endif %}</span> <a href="#" class="field_change">{% trans 'boutton::modifier' %}<input type="hidden" value="{{ field.get_id() }}"/></a>
<input class="meta_src" type="hidden" name="src_{{ field.get_id() }}" value="{{ field.get_tag().getTagname() }}"/>
<span id="display_value_{{ field.get_id() }}">{{ field.get_tag().getGroupName() }}:{{ field.get_tag().getName() }}</span>
<a href="#" class="field_change">change<input type="hidden" value="{{ field.get_id() }}"/></a>
<input type="hidden" class="meta_src" name="src_{{ field.get_id() }}" value="{{ field.get_tag().getTagname() }}"/>
</td>
<td>
<td class="centered">
{{ _self.dces_selector(available_dc_fields, field) }}
</td>
<td style="text-align:center;" class="multi_{{ field.get_id() }}">
<td class="multi_{{ field.get_id() }} centered">
{% if field.is_multi() %}<img src="/skins/icons/ok.png"/>{% endif %}
<img class="alert alertTips alert_not_multi" src="/skins/icons/alert.png" title="{% trans 'Attention, la source descriptive selectionne n\'est pas multivaluee' %}" style="display:none;" />
<img class="alert alertTips alert_is_multi" src="/skins/icons/alert.png" title="{% trans 'Attention, la source descriptive selectionne est multivaluee' %}" style="display:none;" />
</td>
<td>
<input class="metafield_{{ field.get_id() }}" {{ disabled }} name="indexable_{{ field.get_id() }}" type="checkbox" {% if field.is_indexable() %}checked="checked"{% endif %}/>
<td class="centered">
<input type="checkbox" class="metafield_{{ field.get_id() }}" {{ disabled }} name="indexable_{{ field.get_id() }}" {% if field.is_indexable() %}checked="checked"{% endif %} />
</td>
<td>
<td class="centered">
{% if field.is_multi() %}
<select class="metafield_{{ field.get_id() }}" {{ disabled }} name="vocabulary_{{ field.get_id() }}">
<option value=""></option>
{% for vocabulary in vocabularies %}
<option {% if field.getVocabularyControl() and field.getVocabularyControl().getType() == vocabulary.getType() %}selected="selected"{% endif %} value="{{ vocabulary.getType() }}">{{ vocabulary.getName() }}</option>
{% endfor %}
</select>
<select class="metafield_{{ field.get_id() }} input-medium" {{ disabled }} name="vocabulary_{{ field.get_id() }}">
<option value=""></option>
{% for vocabulary in vocabularies %}
<option {% if field.getVocabularyControl() and field.getVocabularyControl().getType() == vocabulary.getType() %}selected="selected"{% endif %} value="{{ vocabulary.getType() }}">{{ vocabulary.getName() }}</option>
{% endfor %}
</select>
{% endif %}
</td>
<td>
<input class="metafield_{{ field.get_id() }}" {{ disabled }} name="vocabularyrestricted_{{ field.get_id() }}" type="checkbox" {% if field.isVocabularyRestricted() %}checked="checked"{% endif %}/>
<td class="centered">
<input type="checkbox" class="metafield_{{ field.get_id() }}" {{ disabled }} name="vocabularyrestricted_{{ field.get_id() }}" {% if field.isVocabularyRestricted() %}checked="checked"{% endif %}/>
</td>
<td>
<input class="metafield_{{ field.get_id() }}" {{ disabled }} name="required_{{ field.get_id() }}" type="checkbox" {% if field.is_required() %}checked="checked"{% endif %}/>
<td class="centered">
<input type="checkbox" class="metafield_{{ field.get_id() }}" {{ disabled }} name="required_{{ field.get_id() }}" {% if field.is_required() %}checked="checked"{% endif %}/>
</td>
<td>
<input class="meta_readonly metafield_{{ field.get_id() }}" {{ disabled }} name="readonly_{{ field.get_id() }}" type="checkbox" {% if field.is_readonly() %}checked="checked"{% endif %}/>
<td class="centered">
<input type="checkbox" class="meta_readonly metafield_{{ field.get_id() }}" {{ disabled }} name="readonly_{{ field.get_id() }}" {% if field.is_readonly() %}checked="checked"{% endif %}/>
<img class="alert alertTips alert_not_readonly" src="/skins/icons/alert.png" title="{% trans 'Attention, la source descriptive selectionne n\'est pas en lecture seule, vous devriez decocher cette case' %}" style="display:none;" />
<img class="alert alertTips alert_is_readonly" src="/skins/icons/alert.png" title="{% trans 'Attention, la source descriptive selectionne est en lecture seule, vous devriez cocher cette case' %}" style="display:none;" />
</td>
<td>
<select class="metafield_{{ field.get_id() }}" {{ disabled }} name="type_{{ field.get_id() }}">
<option value=""></option>
<option {% if field.get_type() == 'string' %}selected{% endif %} value="string">string</option>
<option {% if field.get_type() == 'text' %}selected{% endif %} value="text">text</option>
<option {% if field.get_type() == 'number' %}selected{% endif %} value="number">number</option>
<option {% if field.get_type() == 'date' %}selected{% endif %} value="date">date</option>
<td class="centered">
<select class="metafield_{{ field.get_id() }} input-small" {{ disabled }} name="type_{{ field.get_id() }}">
<option value=""></option>
<option {% if field.get_type() == 'string' %}selected{% endif %} value="string">{% trans 'string' %}</option>
<option {% if field.get_type() == 'text' %}selected{% endif %} value="text">{% trans 'text' %}</option>
<option {% if field.get_type() == 'number' %}selected{% endif %} value="number">{% trans 'number' %}</option>
<option {% if field.get_type() == 'date' %}selected{% endif %} value="date">{% trans 'date' %}</option>
</select>
</td>
<td>
<input size="2" class="metafield_{{ field.get_id() }}" {{ disabled }} value="{{ field.get_separator() }}" name="separator_{{ field.get_id() }}" type="text"/>
<td class="centered">
<input type="text" size="2" class="metafield_{{ field.get_id() }} input-small" {{ disabled }} value="{{ field.get_separator() }}" name="separator_{{ field.get_id() }}" />
</td>
<td>
<input style="width:100px;" class="metafield_{{ field.get_id() }}" {{ disabled }} name="tbranch_{{ field.get_id() }}" type="text" value="{{ field.get_tbranch() }}"/>
<td class="centered">
<input type="text" class="metafield_{{ field.get_id() }} input-small" {{ disabled }} name="tbranch_{{ field.get_id() }}" value="{{ field.get_tbranch() }}"/>
</td>
<td>
<input class="metafield_{{ field.get_id() }}" {{ disabled }} name="report_{{ field.get_id() }}" type="checkbox" {% if field.is_report() %}checked="checked"{% endif %}/>
<td class="centered">
<input type="checkbox" class="metafield_{{ field.get_id() }}" {{ disabled }} name="report_{{ field.get_id() }}" {% if field.is_report() %}checked="checked"{% endif %}/>
</td>
<td>
<select class="thumbtitle metafield_{{ field.get_id() }}" {{ disabled }} name="thumbtitle_{{ field.get_id() }}">
{{ _self.thumbtitle_selector(field.get_thumbtitle()) }}
<td class="centered">
<select class="metafield_{{ field.get_id() }} input-small" {{ disabled }} name="thumbtitle_{{ field.get_id() }}">
{{ _self.thumbtitle_selector(field.get_thumbtitle()) }}
</select>
</td>
<td>
<input class="business metafield_{{ field.get_id() }}" {{ disabled }} name="business_{{ field.get_id() }}" type="checkbox" {% if field.isBusiness() %}checked="checked"{% endif %}/>
<td class="centered">
<input type="checkbox" class="metafield_{{ field.get_id() }}" {{ disabled }} name="business_{{ field.get_id() }}" {% if field.isBusiness() %}checked="checked"{% endif %}/>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<button type="submit">Submit</button>
<button type="submit" class="btn btn-warning">{% trans 'Valider' %}</button>
</form>
<style>
body{
font-size:12px;
}
.ui-autocomplete {
max-height: 200px;
max-width: 400px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
max-height: 200px;
max-width: 400px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}
/** IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 200px;
height: 200px;
}
.ui-autocomplete-loading { background: white url('/skins/icons/ui-anim_basic_16x16.gif') right center no-repeat; }
.alertTips{
cursor:help;
.ui-autocomplete-loading {
background: white url('/skins/icons/ui-anim_basic_16x16.gif') right center no-repeat; }
.alertTips {
cursor:help;
}
.alert{
vertical-align: baseline;
.alert {
vertical-align: baseline;
}
</style>
<script type="text/javascript">
@@ -302,10 +293,7 @@
$('#form_struct').submit();
});
$('.field_adder', container).bind('click', function(){
var buttons = {};
buttons['{% trans 'boutton::annuler' %}'] = function(){
@@ -338,7 +326,6 @@
}
});
$('.dces_selector', container).bind('change', function(event){
if($.trim($(this).val()) === '') {
return;
@@ -389,7 +376,6 @@
});
$('.meta_readonly, .meta_src', container).bind('change', function(){
var id = $(this).attr('name').split('_').pop();
@@ -419,4 +405,4 @@
});
});
</script>
</script>

View File

@@ -8,31 +8,14 @@
{% endblock %}
{% block stylesheet %}
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/yui2.8/build/reset/reset.css,include/jslibs/jquery-ui-1.8.17/css/ui-lightness/jquery-ui-1.8.17.custom.css,include/jslibs/jquery-treeview/jquery.treeview.css,skins/common/main.css,skins/admin/admincolor.css,login/geonames.css,include/jslibs/jquery.contextmenu.css" />
<style>
li.selected, div.selected{
background-color:#f0ad30;
color:white;
}
li.selected a, div.selected a{
background-color:#f0ad30;
color:white;
}
#right-ajax.loading{
background-image: url(/skins/icons/loaderFFF.gif);
background-position: center center;
background-repeat: no-repeat;
}
</style>
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/yui2.8/build/reset/reset.css,include/jslibs/jquery-treeview/jquery.treeview.css,include/jslibs/jquery.contextmenu.css,login/geonames.css,skins/common/main.css,skins/admin/css/Main.css,skins/admin/css/Bases.css,skins/admin/css/Tables.css" />
{% endblock %}
{% block javascript %}
<script type="text/javascript" src="/include/jslibs/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery.validate.js"></script>
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery.validate.password.js"></script>
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="/include/vendor/javascript-load-image/load-image.min.js"></script>
<script type="text/javascript" src="/include/minify/g=admin"></script>
@@ -107,6 +90,32 @@
$.each($('#tree a[target=right]'),function(){
var dest = $(this).attr('href');
function enableForms(forms) {
forms.bind('submit', function(){
var method = $(this).attr('method');
var url = $(this).attr('action');
var datas = $(this).serializeArray();
if(!method) {
method = 'GET';
}
$('#right-ajax').empty().addClass('loading');
if(url) {
$.ajax({
type: method,
url: url,
data: datas,
success: function(datas){
$('#right-ajax').removeClass('loading').html(datas);
enableForms($('#right-ajax form:not(.no-ajax)'));
return;
}
});
}
});
}
$(this).bind('click',function(){
if($(this).hasClass('ajax'))
{
@@ -114,6 +123,7 @@
$('#right').hide();
$.get(dest, function(data) {
$('#right-ajax').removeClass('loading').html(data);
enableForms($('#right-ajax form:not(.no-ajax)'));
});
}
else
@@ -173,7 +183,7 @@
return;
}
})
});
}
</script>
@@ -182,31 +192,30 @@
{% block content %}
<div id="left" class="PNB" style="width:250px;right:auto;">
<div class="PNB10" style="right:0">
<div id="FNDR">
<div class="PNB10" style="right:0">
<div id="FNDR">
{% include 'admin/tree.html.twig' %}
</div>
</div>
</div>
</div>
</div>
{% if notice %}
<div class="right PNB10 notice" style="left:260px;">
{% if notice == "install_success" %}
{% trans %}Successful install{% endtrans %}
{% endif %}
</div>
{% endif %}
{% if notice %}
<div class="right PNB10 notice" style="left:260px;">
{% if notice == "install_success" %}
{% trans %}Successful install{% endtrans %}
{% endif %}
</div>
{% endif %}
<iframe class="right PNB10" src="about:blank;" name="right" id="right" frameborder="1" border="0" framespacing="0" style="left:260px;border:none;right:0;{{ notice ? "top:30px" : "top:0" }}"></iframe>
<div class="right PNB" style="left:250px;overflow:auto;">
<div id="right-ajax" class="PNB10"></div>
</div>
<div id="quotas_dialog"></div>
<div id="masks_dialog"></div>
<div id="time_dialog"></div>
<div id="user_add_dialog" title="{% trans 'Ajouter un nouvel utilisateur' %}">
<form>
<iframe class="right PNB10" src="about:blank;" name="right" id="right" frameborder="1" border="0" framespacing="0" style="left:260px;border:none;right:0;{{ notice ? "top:30px" : "top:0" }}"></iframe>
<div class="right PNB" style="left:250px;overflow:auto;">
<div id="right-ajax" class="PNB10"></div>
</div>
<div id="quotas_dialog"></div>
<div id="masks_dialog"></div>
<div id="time_dialog"></div>
<div id="user_add_dialog" title="{% trans 'Ajouter un nouvel utilisateur' %}">
<form>
<label for="new_user_mail">{% trans 'Adresse email du nouvel utilisateur' %}</label>
<input id="new_user_mail" type="text" name="value" />
<label class="checkbox" for="send_credentials">
@@ -218,14 +227,14 @@
{% trans "Require email validation to activate the account" %}
</label>
<img src="/skins/icons/loaderFFF.gif" class="new_user_loader" style="display:none;"/>
</form>
</div>
<div id="template_add_dialog" title="{% trans 'Creer un modele' %}">
<form>
</form>
</div>
<div id="template_add_dialog" title="{% trans 'Creer un modele' %}">
<form>
<label>{% trans 'Nom du nouveau modele' %}</label>
<input type="text" name="value" />
<img src="/skins/icons/loaderFFF.gif" class="new_user_loader" style="display:none;"/>
</form>
</div>
<div id="DIALOG" style="color:white;"></div>
</form>
</div>
<div id="DIALOG" style="color:white;"></div>
{% endblock %}

View File

@@ -1,26 +1,27 @@
{% extends 'admin/publications/wrapper.html' %}
{% block content %}
<div>
{% if error %}
<div class="error">{{error}}</div>
{% endif %}
{% if feed.is_owner(user) %}
<h2>{% trans 'Edition' %}</h2>
<div>
<div id="pub_icon" style="border:1px solid #ccc;width:42px;height:42px;float:left">
<div class="thumb_wrapper" style="width:32px;margin:5px auto">
<img id="img_before"src="{{ feed.get_icon_url() }}" style="width:32px;height:32px;"/>
<div>
{% if error %}
<div class="error alert alert-error">{{ error }}</div>
{% endif %}
{% if feed.is_owner(user) %}
<h2>{% trans 'Edition' %}</h2>
<div class="control-group">
<div id="pub_icon">
<div class="thumb_wrapper">
<img id="img_before" src="{{ feed.get_icon_url() }}" />
</div>
</div>
<div id="pub_fileupload">
<input id="fileupload-feed" type="file" name="files[]" accept="image/*" data-url="/admin/publications/feed/{{ feed.get_id() }}/iconupload/">
</div>
</div>
<div style='float:left;height: 42px;padding-top: 10px;'>
<input id="fileupload-feed" type="file" name="files[]" accept="image/*" data-url="/admin/publications/feed/{{ feed.get_id() }}/iconupload/">
</div>
</div>
<br style='clear:both' />
<div id='upload-error' style='color:red'></div>
<script>
<div class="clear"></div>
<div id='upload-error' style="color: #B94A48;"></div>
<script>
$(function () {
$('#fileupload-feed').fileupload({
dataType: 'json',
@@ -76,123 +77,142 @@
return false;
});
});
</script>
<form class="form_publication" name="form_publication" enctype="multipart/form-data" method="post" action="/admin/publications/feed/{{ feed.get_id() }}/update/">
<div>
<label for="edit_pub_titre">{% trans 'Titre' %}</label>
<input class="required_text" id="edit_pub_titre" size="30" maxlength="128" name="title" type="text" value="{{ feed.get_title() }}" />
</div>
<div>
<label for="edit_pub_subtitre">{% trans 'Sous-titre' %}</label>
<input placeholder="{% trans 'Short description' %}" id="edit_pub_subtitre" size="30" maxlength="512" name="subtitle" type="text" value="{{ feed.get_subtitle() }}" />
</div>
<div>
<label for="edit_pub_base_id">{% trans 'Etendue de la publication' %}</label>
<select id="edit_pub_base_id" name="base_id" {% if feed.is_public() %}disabled="disabled"{% endif %}>
<option value="">{% trans 'Non-Restreinte (publique)' %}</option>
{% for databox in user.ACL().get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_viewname() }}">
{% for collection in databox.get_collections() %}
<option {% if feed.get_collection() and feed.get_collection().get_base_id() == collection.get_base_id() %}selected="selected"{% endif %} value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
</div>
<div>
<label for="edit_pub_public">{% trans 'Publique' %}</label>
<input id="edit_pub_public" name="public" type="checkbox" value="1" {% if feed.is_public() %}checked="checked"{% endif %} />
</div>
<div>
<button type="submit">{% trans 'boutton::valider' %}</button>
<a href="/admin/publications/list/">{% trans 'boutton::annuler' %}</a>
</div>
</form>
<div style="width:400px;">
<h3>{% trans 'Liste des personnes habilitees a publier sur ce fil' %}</h3>
<table class="admintable">
<thead>
<tr>
<th>{% trans 'Id' %}</th>
<th></th>
<th>{% trans 'Email' %}</th>
<th>{% trans 'Owner' %}</th>
</tr>
</thead>
<tbody>
{% for publisher in feed.get_publishers() %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}">
<td>
{{ publisher.get_user().get_id() }}
</td>
<td>
{{ publisher.get_user().get_display_name() }}
</td>
<td>
{{ publisher.get_user().get_email() }}
</td>
<td>
{% if publisher.is_owner() == true %}
X
{% else %}
<form class="form_publication" method="post" action="/admin/publications/feed/{{ feed.get_id() }}/removepublisher/">
<input type="hidden" value="{{ publisher.get_id() }}" name="publisher_id"/>
<button>{% trans 'boutton::supprimer' %}</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div>
<form class="form_publication" id="publisher_adder" method="post" action="/admin/publications/feed/{{ feed.get_id() }}/addpublisher/">
<label>{% trans 'Ajouter un publisher' %}</label>
<input placeholder="{% trans 'Name or email' %}" class="publish_adder"/>
<input type="hidden" name="usr_id"/>
</form>
</div>
</div>
<style>
.ui-autocomplete {
max-height: 200px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 200px;
}
.ui-autocomplete-loading { background: white url('/skins/icons/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(document).ready(function(){
$( ".publish_adder" ).autocomplete({
source: "/admin/users/typeahead/search/?filter_rights[]=bas_chupub",
minLength: 2,
select: function( event, ui ) {
var form = $('#publisher_adder');
$('input[name="usr_id"]', form).val(ui.item.id);
form.submit();
}
}).data( "autocomplete" )._renderItem = function( ul, item ) {
var email = item.email ? '<br/>'+item.email : '';
var login = item.login != item.name ? " ("+ item.login +")" : '';
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.name + login + email + "</a>" )
.appendTo( ul );
};
});
</script>
{% else %}
{% trans 'You are not the feed owner' %}
<a href="/admin/publications/list/">{% trans 'boutton::retour' %}</a>
{% endif %}
</script>
<form class="no-ajax form_publication form-vertical" name="form_publication" enctype="multipart/form-data" method="post" action="/admin/publications/feed/{{ feed.get_id() }}/update/">
<div class="control-group">
<label class="control-label" for="edit_pub_titre">{% trans 'Titre' %} :</label>
<div class="controls">
<input id="edit_pub_titre" class="required_text input-large" maxlength="128" name="title" type="text" value="{{ feed.get_title() }}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="edit_pub_subtitre">{% trans 'Sous-titre' %} :</label>
<div class="controls">
<input placeholder="{% trans 'Short description' %}" id="edit_pub_subtitre" class="input-large" maxlength="512" name="subtitle" type="text" value="{{ feed.get_subtitle() }}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="edit_pub_base_id">{% trans 'Etendue de la publication' %} :</label>
<div class="controls">
<select id="edit_pub_base_id" class="input-large" name="base_id" {% if feed.is_public() %}disabled="disabled"{% endif %}>
<option value="">{% trans 'Non-Restreinte (publique)' %}</option>
{% for databox in user.ACL().get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_viewname() }}">
{% for collection in databox.get_collections() %}
<option {% if feed.get_collection() and feed.get_collection().get_base_id() == collection.get_base_id() %}selected="selected"{% endif %} value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox" for="edit_pub_public">
<input type="checkbox" id="edit_pub_public" class="input-large" name="public" value="1" {% if feed.is_public() %}checked="checked"{% endif %} />
{% trans 'Publique' %}
</label>
</div>
</div>
<div>
<button class="btn btn-warning" type="submit">{% trans 'boutton::valider' %}</button>
<a href="/admin/publications/list/" class="btn" style="text-decoration:none;">{% trans 'boutton::annuler' %}</a>
</div>
</form>
<br />
<div style="width: 500px;">
<h2>{% trans 'Liste des personnes habilitees a publier sur ce fil' %}</h2>
<table class="admintable">
<thead>
<tr>
<th>{% trans 'Id' %}</th>
<th></th>
<th>{% trans 'Email' %}</th>
<th>{% trans 'Owner' %}</th>
</tr>
</thead>
<tbody>
{% for publisher in feed.get_publishers() %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}">
<td>
{{ publisher.get_user().get_id() }}
</td>
<td>
{{ publisher.get_user().get_display_name() }}
</td>
<td>
{{ publisher.get_user().get_email() }}
</td>
<td style="text-align: center;">
{% if publisher.is_owner() == true %}
X
{% else %}
<form class="no-ajax form_publication" method="post" action="/admin/publications/feed/{{ feed.get_id() }}/removepublisher/">
<input type="hidden" value="{{ publisher.get_id() }}" name="publisher_id"/>
<button class="btn btn-mini">{% trans 'boutton::supprimer' %}</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div>
<form class="no-ajax form_publication" id="publisher_adder" method="post" action="/admin/publications/feed/{{ feed.get_id() }}/addpublisher/">
<div class="control-group">
<label class="control-label">{% trans 'Ajouter un publisher' %} :</label>
<div class="controls">
<input placeholder="{% trans 'Name or email' %}" class="publish_adder"/>
<input type="hidden" name="usr_id"/>
</div>
</div>
</form>
</div>
</div>
<style>
.ui-autocomplete {
max-height: 200px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 200px;
}
.ui-autocomplete-loading { background: white url('/skins/icons/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(document).ready(function(){
$( ".publish_adder" ).autocomplete({
source: "/admin/users/typeahead/search/?filter_rights[]=bas_chupub",
minLength: 2,
select: function( event, ui ) {
var form = $('#publisher_adder');
$('input[name="usr_id"]', form).val(ui.item.id);
form.submit();
}
}).data( "autocomplete" )._renderItem = function( ul, item ) {
var email = item.email ? '<br/>'+item.email : '';
var login = item.login != item.name ? " ("+ item.login +")" : '';
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.name + login + email + "</a>" )
.appendTo( ul );
};
});
</script>
{% else %}
{% trans 'You are not the feed owner' %}
<a href="/admin/publications/list/">{% trans 'boutton::retour' %}</a>
{% endif %}
</div>
{% endblock %}
{% endblock %}

View File

@@ -1,93 +1,97 @@
{% extends 'admin/publications/wrapper.html' %}
{% block content %}
<style type="text/css">
.error{
border-color:red;
}
</style>
<form class="form_publication" method="post" action="/admin/publications/create/">
<h2>{% trans 'Ajouter une publication' %}</h2>
<div>
<input placeholder="{% trans 'Feed name' %}" class="required_text" id="add_pub_titre" size="30" maxlength="128" name="title" type="text" />
<label for="add_pub_titre">{% trans 'Titre' %}</label>
</div>
<div>
<input placeholder="{% trans 'Short description' %}" id="add_pub_subtitre" size="30" maxlength="512" name="subtitle" type="text" />
<label for="add_pub_subtitre">{% trans 'Sous-titre' %}</label>
</div>
<div>
<select id="add_pub_base_id" name="base_id">
<option value="">{% trans 'Non-Restreinte (publique)' %}</option>
{% for databox in user.ACL().get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_viewname() }}">
{% for collection in databox.get_collections() %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
<label for="add_pub_base_id">{% trans 'Etendue de la publication' %}</label>
</div>
<div>
<input type="checkbox" id="add_pub_public" name="public" value="1" />
<label for="add_pub_public">{% trans 'Publique' %}</label>
</div>
<div>
<button type="submit">{% trans 'boutton::valider' %}</button>
</div>
<form class="no-ajax form_publication form-vertical" method="post" action="/admin/publications/create/">
<h2>{% trans 'Ajouter une publication' %}</h2>
<div class="control-group">
<label class="control-label" for="add_pub_titre">{% trans 'Titre' %} :</label>
<div class="controls">
<input type="text" id="add_pub_titre" class="required_text input-large" placeholder="{% trans 'Feed name' %}" maxlength="128" name="title" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="add_pub_subtitre">{% trans 'Sous-titre' %} :</label>
<div class="controls">
<input type="text" id="add_pub_subtitre" class="input-large" placeholder="{% trans 'Short description' %}" maxlength="512" name="subtitle" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="add_pub_base_id">{% trans 'Etendue de la publication' %} :</label>
<div class="controls">
<select id="add_pub_base_id" class="input-large" name="base_id">
<option value="">{% trans 'Non-Restreinte (publique)' %}</option>
{% for databox in user.ACL().get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_viewname() }}">
{% for collection in databox.get_collections() %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox" for="add_pub_public">
<input type="checkbox" id="add_pub_public" name="public" value="1" />
{% trans 'Publique' %}
</label>
</div>
</div>
<button type="submit" class="btn btn-warning">{% trans 'boutton::valider' %}</button>
</form>
<table class="admintable" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th style="width:40px;"></th>
<th>{% trans 'Titre' %}</th>
<th style="width:150px;">{% trans 'Date Creation' %}</th>
<th style="width:220px;">{% trans 'Restriction' %}</th>
<th style="width:80px;">{% trans 'Public' %}</th>
<th style="width:80px;"></th>
</tr>
</thead>
<tbody>
{% for feed in feeds.get_feeds %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}">
<td>
<div style="border:1px solid #ccc;width:22px;height:22px;margin:2px">
<a href="/admin/publications/feed/{{ feed.get_id() }}/">
<img src="{{feed.get_icon_url() ~ '?' ~ random(1000) }}" style="margin:3px;width:16px;height:16px;" id="pub_icon"/>
</a>
</div>
</td>
<td><a href="/admin/publications/feed/{{ feed.get_id() }}/">{{ feed.get_title() }}</a></td>
<td>{{ feed.get_created_on()| formatDate }}</td>
<td>
{% if feed.get_collection() != null %}
{{ feed.get_collection().get_databox().get_viewname() }} /
{{ feed.get_collection().get_name() }}
{% endif %}
</td>
<td style="text-align:center;">
{% if feed.is_public() %}
<img src="/skins/icons/ligth-on.png" title="{% trans 'This feed is public' %}"/>
{% endif %}
</td>
<td>
{% if feed.is_owner(user) %}
<form class="form_publication" action="/admin/publications/feed/{{feed.get_id()}}/delete/" method="post">
<button class="feed_remover">{% trans 'boutton::supprimer' %}</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<thead>
<tr>
<th style="width:40px;"></th>
<th>{% trans 'Titre' %}</th>
<th style="width:150px; text-align: center;">{% trans 'Date Creation' %}</th>
<th style="width:220px; text-align: center;">{% trans 'Restriction' %}</th>
<th style="width:80px; text-align: center;">{% trans 'Public' %}</th>
<th style="width:80px;"></th>
</tr>
</thead>
<tbody>
{% for feed in feeds.get_feeds %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}">
<td>
<div style="border:1px solid #ccc; width:22px; height:22px; margin:2px;">
<a href="/admin/publications/feed/{{ feed.get_id() }}/">
<img src="{{feed.get_icon_url() ~ '?' ~ random(1000) }}" id="pub_icon" style="margin:3px; width:16px; height:16px;"/>
</a>
</div>
</td>
<td>
<a href="/admin/publications/feed/{{ feed.get_id() }}/">{{ feed.get_title() }}</a>
</td>
<td style="text-align: center;">
{{ feed.get_created_on()|formatdate }}
</td>
<td style="text-align: center;">
{% if feed.get_collection() != null %}
{{ feed.get_collection().get_databox().get_viewname() }} /
{{ feed.get_collection().get_name() }}
{% endif %}
</td>
<td style="text-align: center;">
{% if feed.is_public() %}
<img src="/skins/icons/ligth-on.png" title="{% trans 'This feed is public' %}"/>
{% endif %}
</td>
<td style="text-align: center;">
{% if feed.is_owner(user) %}
<form class="no-ajax form_publication" action="/admin/publications/feed/{{feed.get_id()}}/delete/" method="post">
<button class="feed_remover btn btn-mini">{% trans 'boutton::supprimer' %}</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('button.feed_remover').bind('click', function(event){
@@ -111,4 +115,5 @@
});
});
</script>
{% endblock %}
{% endblock %}

View File

@@ -1,17 +1,17 @@
<h1>{% trans 'Publications' %}</h1>
<div>
{% block content %}{% endblock %}
{% block content %}{% endblock %}
</div>
<script type="text/javascript">
$(document).ready(function(){
var $forms = $('form.form_publication');
$forms.each(function(i, form){
var $form = $(form);
$form.bind('submit', function(){
var error = false;
$('.required_text', form).each(function(i, el){
@@ -21,16 +21,16 @@
error = true;
}
});
if(error === true)
{
alert('{% trans 'Vous devez remplir les champs requis' %}');
return false;
}
var action = $form.attr('action');
var datas = $form.serializeArray();
$('#right-ajax').empty().addClass('loading');
$.ajax({
type: 'POST',
@@ -42,9 +42,9 @@
});
return false;
});
});
});
$('#right-ajax a').bind('click', function(){
var $this = $(this);
$('#right-ajax').empty().addClass('loading');
@@ -57,7 +57,7 @@
});
return false;
});
$('#edit_pub_public').bind('change', function(){
if($(this).attr('checked') === true)
$('#edit_pub_base_id').attr('disabled', 'disabled');

View File

@@ -4,37 +4,37 @@
{% if user.is_admin() %}
<li>
<a target="right" href="sitestruct.php">
<a target="right" href="sitestruct.php" class="ajax">
<img src="/skins/admin/Dashboard.png" />
{% trans 'Tableau de bord' %}
<span>{% trans 'Tableau de bord' %}</span>
</a>
</li>
{% else %}
<li>
{{ registry.get('GV_ServerName') }}
<span>{{ registry.get('GV_ServerName') }}</span>
</li>
{% endif %}
{% if user.is_admin() %}
<li>
<a target="right" href="/admin/global_values.php">
<a target="right" href="/admin/global_values.php" class="ajax">
<img src="/skins/admin/Setup.png" />
Setup
<span>Setup</span>
</a>
</li>
{% if registry.get('GV_sphinx') %}
<li>
<a target="right" href="/admin/sphinxconf.php">
Sphinx Conf
<span>Sphinx Conf</span>
</a>
</li>
{% endif %}
{% endif %}
<li class="{% if feature == 'connected' %}selected{% endif %}">
<a target="right" href="sessionwhois.php" class="ajax zone_online_users">
<a target="right" href="/admin/connected-users/" class="ajax zone_online_users">
<img src="/skins/admin/Connected.png" />
{% trans 'admin::utilisateurs: utilisateurs connectes' %}
<span>{% trans 'admin::utilisateurs: utilisateurs connectes' %}</span>
</a>
</li>
@@ -42,13 +42,13 @@
<li class="{% if feature == 'users' %}selected{% endif %}">
<a target="right" href="/admin/users/search/" class="ajax zone_editusers">
<img src="/skins/admin/Users.png" />
{% trans 'admin::utilisateurs: utilisateurs' %}
<span>{% trans 'admin::utilisateurs: utilisateurs' %}</span>
</a>
</li>
<li class="{% if feature == 'registrations' %}selected{% endif %}">
<a target="right" href="demand.php?act=LISTUSERS">
<img src="/skins/admin/Demandes.png" />
{% trans 'admin::utilisateurs: demandes en cours' %}
<span>{% trans 'admin::utilisateurs: demandes en cours' %}</span>
</a>
</li>
{% endif %}
@@ -57,7 +57,7 @@
<li class="">
<a target="right" href="/admin/publications/list/" class="ajax">
<img src="/skins/icons/rss16.png" />
{% trans 'Publications' %}
<span>{% trans 'Publications' %}</span>
</a>
</li>
{% endif %}
@@ -66,16 +66,16 @@
<li class="{% if feature == 'taskmanager' %}selected{% endif %}">
<a target="right" href="taskmanager.php">
<img src="/skins/admin/TaskManager.png" />
{% trans 'admin::utilisateurs: gestionnaire de taches' %}
<span>{% trans 'admin::utilisateurs: gestionnaire de taches' %}</span>
</a>
</li>
{% endif %}
<li class="open">
<div class="{% if feature == 'bases' %}selected{% endif %}" style="padding:0 0 2px 0;">
<a id="TREE_DATABASES" target="right" href="databases.php">
<a id="TREE_DATABASES" target="right" href="databases.php" class="ajax">
<img src="/skins/admin/DatabasesAvailable.png" />
{% trans 'admin::utilisateurs: bases de donnees' %}
<span>{% trans 'admin::utilisateurs: bases de donnees' %}</span>
</a>
</div>
<ul>
@@ -98,9 +98,9 @@
<li class="{% if this_is_open %}open{% endif %}">
<div style="padding:0 0 2px 0;" class="{% if this_is_selected %}selected{% endif %}">
<a target="right" href="database.php?p0={{ sbas_id }}">
<a target="right" href="database.php?p0={{ sbas_id }}" class="ajax">
<img src="/skins/admin/Database.png"/>
{{ databox.get_viewname() }}
<span>{{ databox.get_viewname() }}</span>
</a>
</div>
<ul>
@@ -109,36 +109,36 @@
<li>
<a target="right" href="structure.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
{% trans 'admin::structure: reglage de la structure' %}
<span>{% trans 'admin::structure: reglage de la structure' %}</span>
</a>
</li>
<li>
<a target="right" href="/admin/description/{{ sbas_id }}/" class="ajax">
<img src="/skins/icons/miniadjust01.gif"/>
{% trans 'CHAMPS' %}
<span>{% trans 'CHAMPS' %}</span>
</a>
</li>
<li>
<a target="right" href="/admin/subdefs/{{ sbas_id }}/">
<img src="/skins/icons/miniadjust01.gif"/>
{% trans 'SUBDEFS' %}
<span>{% trans 'SUBDEFS' %}</span>
</a>
</li>
<li>
<a target="right" href="statbits.php?act=STATBITS&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust02.gif"/>
{% trans 'admin::status: reglage des status' %}
<span>{% trans 'admin::status: reglage des status' %}</span>
</a>
</li>
<li>
<a target="right" href="cgus.php?p0={{ sbas_id }}">
{% trans 'admin:: CGUs' %}
<span>{% trans 'admin:: CGUs' %}</span>
</a>
</li>
<li>
<a target="right" href="collorder.php?p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust03.gif"/>
{% trans 'admin::collection: ordre des collections' %}
<span>{% trans 'admin::collection: ordre des collections' %}</span>
</a>
</li>
{% endif %}
@@ -155,7 +155,7 @@
<li>
<a target="right" href="/admin/users/search/?sbas_id[]={{ sbas_id }}" class="ajax">
<img src="/skins/admin/Users.png"/>
{% trans 'admin::utilisateurs: utilisateurs' %}
<span>{% trans 'admin::utilisateurs: utilisateurs' %}</span>
</a>
</li>
{% endif %}
@@ -168,7 +168,7 @@
<li>
<div style="padding:0 0 2px 0;">
<a target="right" href="collection.php?act=COLLECTION&p0={{ sbas_id }}&p1={{ collection.get_base_id() }}">
{{ collection.get_name() }}
<span>{{ collection.get_name() }}</span>
</a>
</div>
<ul>
@@ -177,7 +177,7 @@
<li>
<a target="right" href="sugval.php?p0={{ sbas_id }}&p1={{ collection.get_base_id() }}">
<img src="/skins/icons/foldph20open_0.gif"/>
{% trans 'admin::base: preferences de collection' %}
<span>{% trans 'admin::base: preferences de collection' %}</span>
</a>
</li>
{% endif %}
@@ -189,7 +189,7 @@
<li>
<a target="right" href="/admin/users/search/?base_id[]={{ collection.get_base_id() }}" class="ajax">
<img src="/skins/admin/Users.png"/>
{% trans 'admin::utilisateurs: utilisateurs' %}
<span>{% trans 'admin::utilisateurs: utilisateurs' %}</span>
</a>
</li>
{% endif %}

View File

@@ -4,282 +4,228 @@
{% block content %}
<div id="users_page">
<h1>{% trans 'Users' %}</h1>
<p class="admin_head_opts">
<a class="user_adder" href="#">
<span>
{% trans 'admin::user: nouvel utilisateur' %}
</span>
</a>
<a class="template_adder" href="#">
<span>
{% trans 'admin::user: nouveau template' %}
</span>
</a>
<h1>{% trans 'Users' %}</h1>
<p class="admin_head_opts">
<a class="user_adder" href="#">{% trans 'admin::user: nouvel utilisateur' %}</a>
<a class="template_adder" href="#">{% trans 'admin::user: nouveau template' %}</a>
<a href="javascript:void();return(false);" onclick="importlist();return(false);">{% trans 'admin::user: import d\'utilisateurs' %}</a> /
<a href="javascript:void();return(false);" onclick="exportlist();return(false);">{% trans 'admin::user: export d\'utilisateurs' %}</a>
<a class="invite_modifier" href="#">{% trans 'Reglages:: reglages d acces guest' %}</a>
<input type="hidden" value="{{invite_user.get_id()}}" name="invite_user_id"/>
<a class="autoregister_modifier" href="#">{% trans 'Reglages:: reglages d inscitpition automatisee' %}</a>
<input type="hidden" value="{{autoregister_user.get_id()}}" name="autoregister_user_id"/>
</p>
<a href="javascript:void();return(false);" onclick="importlist();return(false);">
<span>
{% trans 'admin::user: import d\'utilisateurs' %}
</span>
</a> /
<a href="javascript:void();return(false);" onclick="exportlist();return(false);">
<span>
{% trans 'admin::user: export d\'utilisateurs' %}
</span>
</a>
<form id="users_page_search" method="post" action="/admin/users/search/" target="_self">
<p class="admin_head_opts">
<span>{% trans 'Filter' %}</span>
<select name="like_field" class="input-medium">
<option {% if parm['like_field'] == "usr_login" %}selected="selected"{% endif %} value="usr_login">{% trans 'Push::filter on login' %}</option>
<option {% if parm['like_field'] == "name" %}selected="selected"{% endif %} value="name">{% trans 'Push::filter on name' %}</option>
<option {% if parm['like_field'] == "pays" %}selected="selected"{% endif %} value="pays">{% trans 'Push::filter on countries' %}</option>
<option {% if parm['like_field'] == "societe" %}selected="selected"{% endif %} value="societe">{% trans 'Push::filter on companies' %}</option>
<option {% if parm['like_field'] == "usr_mail" %}selected="selected"{% endif %} value="usr_mail">{% trans 'Push::filter on emails' %}</option>
<option {% if parm['like_field'] == "lastModel" %}selected="selected"{% endif %} value="lastModel">{% trans 'Push::filter on templates' %}</option>
</select>
<span>{% trans 'Push::filter starts' %}</span>
<input type="text" value="{{parm['like_value']}}" name="like_value" class="input-medium">
<button type="submit" class="btn">{% trans 'boutton::chercher' %}</button>
</p>
</form>
<a class="invite_modifier" href="#">
<span>
{% trans 'Reglages:: reglages d acces guest' %}
</span>
</a>
<input type="hidden" value="{{invite_user.get_id()}}" name="invite_user_id"/>
<form id="users_apply_template" method="post" action="/admin/users/apply_template/" target="_self" style="float:left">
<p class="admin_head_opts">
<span>{% trans 'Apply a template' %}</span>
<select name="template_chooser" class="input-medium">
<option value="">{% trans 'boutton::choisir' %}</option>
{% for template in templates %}
<option value="{{ template.get_id() }}">{{ template.get_display_name() }}</option>
{% endfor %}
</select>
<button type="submit" class="btn">{% trans 'boutton::appliquer' %}</button>
</p>
</form>
<a class="autoregister_modifier" href="#">
<span>
{% trans 'Reglages:: reglages d inscitpition automatisee' %}
</span>
</a>
<input type="hidden" value="{{autoregister_user.get_id()}}" name="autoregister_user_id"/>
</p>
<form id="users_page_search" method="post" action="/admin/users/search/" target="_self">
<p class="admin_head_opts">
<span>{% trans 'Filter' %}</span>
<select name="like_field">
<option {% if parm['like_field'] == "usr_login" %}selected="selected"{% endif %} value="usr_login">{% trans 'Push::filter on login' %}</option>
<option {% if parm['like_field'] == "name" %}selected="selected"{% endif %} value="name">{% trans 'Push::filter on name' %}</option>
<option {% if parm['like_field'] == "pays" %}selected="selected"{% endif %} value="pays">{% trans 'Push::filter on countries' %}</option>
<option {% if parm['like_field'] == "societe" %}selected="selected"{% endif %} value="societe">{% trans 'Push::filter on companies' %}</option>
<option {% if parm['like_field'] == "usr_mail" %}selected="selected"{% endif %} value="usr_mail">{% trans 'Push::filter on emails' %}</option>
<option {% if parm['like_field'] == "lastModel" %}selected="selected"{% endif %} value="lastModel">{% trans 'Push::filter on templates' %}</option>
</select>
<form id="users_reset_rights" method="post" action="/admin/users/rights/reset/" target="_self" style="float:right">
<input type="hidden" value="" name="users">
<button type='button' class="btn btn-warning">{% trans 'reset users rights' %}</button>
</form>
{% trans 'Push::filter starts' %}
<input type="text" value="{{parm['like_value']}}" name="like_value">
<button type="submit">{% trans 'boutton::chercher' %}</button>
</p>
</form>
<form id="users_apply_template" method="post" action="/admin/users/apply_template/" target="_self" style="float:left">
<p class="admin_head_opts">
{% trans 'Apply a template' %}
<select name="template_chooser">
<option value="">{% trans 'boutton::choisir' %}</option>
{% for template in templates %}
<option value="{{ template.get_id() }}">{{ template.get_display_name() }}</option>
{% endfor %}
</select>
<button type="submit">{% trans 'boutton::appliquer' %}</button>
</p>
</form>
<table id="users" cellspacing="0" cellpadding="0" border="0" class="admintable">
<thead>
<tr>
<th style="text-align: center;" class="sortable {{ parm.srt == 'usr_id' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur id utilisateur' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="usr_id" />
</th>
<th class="sortable {{ parm.srt == 'usr_login' ? 'sorted' : '' }} ">
<span>{% trans 'admin::compte-utilisateur identifiant' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="usr_login" />
</th>
<th class="sortable {{ parm.srt == 'usr_nom' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur nom/prenom' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="usr_nom" />
</th>
<th class="sortable {{ parm.srt == 'societe' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur societe' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="societe" />
</th>
<th class="sortable {{ parm.srt == 'usr_mail' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur email' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="usr_mail" />
</th>
<th class="sortable {{ parm.srt == 'pays' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur pays' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="pays" />
</th>
<th class="sortable {{ parm.srt == 'lastModel' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur dernier modele applique' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="lastModel" />
</th>
<th class="sortable {{ parm.srt == 'usr_creationdate' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>{% trans 'admin::compte-utilisateur date de creation' %}</span>
<span class="ord_notifier">{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}</span>
<input type="hidden" name="srt" value="usr_creationdate" />
</th>
</tr>
</thead>
<tbody>
{% for usr in users.get_results %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}" id="user_{{usr.get_id()}}">
<td style="text-align: center;">
{% if usr.is_template() %}
<img title="{% trans 'This is a template' %}" src="/skins/icons/template.png"/>
{% else %}
{% if usr.ACL().is_phantom() %}
<img title="{% trans 'This user has no rights' %}" src="/skins/admin/ghost.png"/>
{% endif %}
{{usr.get_id()}}
{% endif %}
</td>
<td>
{{usr.get_login()}}
</td>
<td>
{{usr.get_firstname()}} {{usr.get_lastname()}}
</td>
<td>
{{usr.get_company()}}
</td>
<td>
{{usr.get_email()}}
</td>
<td>
{{usr.get_country()}}
</td>
<td>
{{usr.get_applied_template()}}
</td>
<td>
{{usr.get_creation_date()|getDate}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form id="users_reset_rights" method="post" action="/admin/users/rights/reset/" target="_self" style="float:right">
<input type="hidden" value="" name="users">
<button type='button'>{% trans 'reset users rights' %}</button>
</form>
<form id="export_form" method="post" target="exportwindow" action="/admin/users/search/export/">
<input name="srt" value="{{parm['srt']}}" type="hidden" />
<input name="ord" value="{{parm.ord}}" type="hidden" />
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
{% if parm['usr_ids'] is defined %}
<input name="usr_ids" value="{{parm.usr_ids}}" type="hidden" />
{% endif %}
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<input name="inactives" value="{{parm.inactives}}" type="hidden" />
</form>
<table id="users" cellspacing="0" cellpadding="0" border="0" class="admintable">
<thead>
<tr>
<th style="text-align: center;" class="sortable {{ parm.srt == 'usr_id' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
{% trans 'admin::compte-utilisateur id utilisateur' %}
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="usr_id" />
</th>
<th class="sortable {{ parm.srt == 'usr_login' ? 'sorted' : '' }} ">
<span>
{% trans 'admin::compte-utilisateur identifiant' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="usr_login" />
</th>
<th class="sortable {{ parm.srt == 'usr_nom' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>
{% trans 'admin::compte-utilisateur nom/prenom' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="usr_nom" />
</th>
<th class="sortable {{ parm.srt == 'societe' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>
{% trans 'admin::compte-utilisateur societe' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="societe" />
</th>
<th class="sortable {{ parm.srt == 'usr_mail' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>
{% trans 'admin::compte-utilisateur email' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="usr_mail" />
</th>
<th class="sortable {{ parm.srt == 'pays' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>
{% trans 'admin::compte-utilisateur pays' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="pays" />
</th>
<th class="sortable {{ parm.srt == 'lastModel' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>
{% trans 'admin::compte-utilisateur dernier modele applique' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="lastModel" />
</th>
<th class="sortable {{ parm.srt == 'usr_creationdate' ? 'sorted' : '' }} {{ parm.ord == 'asc' ? 'sort_asc' : 'sort_desc' }}">
<span>
{% trans 'admin::compte-utilisateur date de creation' %}
</span>
<span class="ord_notifier">
{{ parm.ord == 'asc' ? '&#x25bc;' : '&#x25B2;' }}
</span>
<input type="hidden" name="srt" value="usr_creationdate" />
</th>
</tr>
</thead>
<tbody>
{% for usr in users.get_results %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}" id="user_{{usr.get_id()}}">
<td style="text-align: center;">
{% if usr.is_template() %}
<img title="{% trans 'This is a template' %}" src="/skins/icons/template.png"/>
{% else %}
{% if usr.ACL().is_phantom() %}
<img title="{% trans 'This user has no rights' %}" src="/skins/admin/ghost.png"/>
{% endif %}
{{usr.get_id()}}
{% endif %}
</td>
<td>
{{usr.get_login()}}
</td>
<td>
{{usr.get_firstname()}} {{usr.get_lastname()}}
</td>
<td>
{{usr.get_company()}}
</td>
<td>
{{usr.get_email()}}
</td>
<td>
{{usr.get_country()}}
</td>
<td>
{{usr.get_applied_template()}}
</td>
<td>
{{usr.get_creation_date() | formatDate}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form id="users_page_form" method="post" target="_self" action="/admin/users/search/">
<p>
<span>{{users.get_total}} resultats,</span>
{% set pages = users.get_total() / parm['per_page'] %}
{% set modulo = users.get_total() % parm['per_page'] %}
<form id="export_form" method="post" target="exportwindow" action="/admin/users/search/export/">
<input name="srt" value="{{parm['srt']}}" type="hidden" />
<input name="ord" value="{{parm.ord}}" type="hidden" />
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
{% if parm['usr_ids'] is defined %}
<input name="usr_ids" value="{{parm.usr_ids}}" type="hidden" />
{% endif %}
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<input name="inactives" value="{{parm.inactives}}" type="hidden" />
</form>
{% if modulo > 0 %}{% set pages = pages + 1 %}{% endif %}
<span>{{pages|floor}} pages</span>
<form id="users_page_form" method="post" target="_self" action="/admin/users/search/">
{{users.get_total}} resultats
{% if users.get_page > 2 %}
<button class="pager first btn"><<</button>
{% endif %}
{% if users.get_page > 1 %}
<button class="pager prev btn"><</button>
{% endif %}
<input type="text" value="{{users.get_page}}" class="input-mini"/>
{% if users.get_page < pages -1 %}
<button class="pager next btn">></button>
{% endif %}
{% if users.get_page < pages - 2 %}
<button class="pager last btn">>></button>
{% endif %}
<select name="per_page" class="input-medium">
{% set n_par_page = 10 %}
<option value="10" {% if parm['per_page'] == 10%}selected="selected"{% endif %}>{% trans %}{{n_par_page}} par page {% endtrans %}</option>
{% set n_par_page = 20 %}
<option value="20" {% if parm['per_page'] == 20%}selected="selected"{% endif %}>{% trans %}{{n_par_page}} par page {% endtrans %}</option>
{% set n_par_page = 50 %}
<option value="50" {% if parm['per_page'] == 50%}selected="selected"{% endif %}>{% trans %}{{n_par_page}} par page {% endtrans %}</option>
</select>
<button class="user_modifier btn">{% trans 'boutton::modifier' %}</button>
<button class="user_deleter btn">{% trans 'Supprimer' %}</button>
{% set pages = users.get_total() / parm['per_page'] %}
{% set modulo = users.get_total() % parm['per_page'] %}
<input type="hidden" name="total_results" value="{{users.get_total()}}"/>
<input type="hidden" name="page" value="{{users.get_page()}}"/>
<input name="srt" value="{{parm['srt']}}" type="hidden" />
<input name="ord" value="{{parm.ord}}" type="hidden" />
{% if parm['act'] is defined %}
<input name="act" value="{{parm.act}}" type="hidden" />
{% endif %}
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
{% if parm['usr_ids'] is defined %}
<input name="usr_ids" value="{{parm.usr_ids}}" type="hidden" />
{% endif %}
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<input name="inactives" value="{{parm.inactives}}" type="hidden" />
<input name="offset_start" value="{{parm.offset_start}}" type="hidden" />
</p>
</form>
{% if modulo > 0 %}{% set pages = pages + 1 %}{% endif %}
{{pages|floor}} pages
{% if users.get_page > 2 %}
<button class="pager first"><<</button>
{% endif %}
{% if users.get_page > 1 %}
<button class="pager prev"><</button>
{% endif %}
<input type="text" value="{{users.get_page}}" />
{% if users.get_page < pages -1 %}
<button class="pager next">></button>
{% endif %}
{% if users.get_page < pages - 2 %}
<button class="pager last">>></button>
{% endif %}
<select name="per_page">
{% set n_par_page = 10 %}
<option value="10" {% if parm['per_page'] == 10%}selected="selected"{% endif %}>{% trans %}{{n_par_page}} par page {% endtrans %}</option>
{% set n_par_page = 20 %}
<option value="20" {% if parm['per_page'] == 20%}selected="selected"{% endif %}>{% trans %}{{n_par_page}} par page {% endtrans %}</option>
{% set n_par_page = 50 %}
<option value="50" {% if parm['per_page'] == 50%}selected="selected"{% endif %}>{% trans %}{{n_par_page}} par page {% endtrans %}</option>
</select>
<button class="user_modifier">{% trans 'boutton::modifier' %}</button>
<button class="user_deleter">{% trans 'Supprimer' %}</button>
<form target="_blank" method="post" action="/admin/users/export/csv/">
{% if parm.base_id is not empty %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
{% endif %}
{% if parm.sbas_id is not empty %}
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% endif %}
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<button class="btn btn-warning">{% trans 'boutton::exporter' %}</button>
</form>
<input type="hidden" name="total_results" value="{{users.get_total()}}"/>
<input type="hidden" name="page" value="{{users.get_page()}}"/>
<input name="srt" value="{{parm['srt']}}" type="hidden" />
<input name="ord" value="{{parm.ord}}" type="hidden" />
{% if parm['act'] is defined %}
<input name="act" value="{{parm.act}}" type="hidden" />
{% endif %}
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
{% if parm['usr_ids'] is defined %}
<input name="usr_ids" value="{{parm.usr_ids}}" type="hidden" />
{% endif %}
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<input name="inactives" value="{{parm.inactives}}" type="hidden" />
<input name="offset_start" value="{{parm.offset_start}}" type="hidden" />
</form>
<form target="_blank" method="post" action="/admin/users/export/csv/">
{% if parm.base_id is not empty %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
{% endif %}
{% if parm.sbas_id is not empty %}
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% endif %}
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<button>{% trans 'boutton::exporter' %}</button>
</form>
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function(){
$.each(p4.users.sel, function(i,n){
var el = $('#user_'+n);
@@ -345,6 +291,7 @@
$('#export_form').submit();
}
</script>
</script>
</div>
{% endblock %}
{% endblock %}

View File

@@ -10,7 +10,8 @@
RewriteRule ^register-confirm=([a-zA-Z0-9]+)$ /login/register-confirm.php?code=$1 [L]
RewriteRule ^admin/$ /admin/router.php [L]
RewriteRule ^admin/description/.*$ /admin/router.php [L]
RewriteRule ^admin/description/.*$ /admin/router.php [L]
RewriteRule ^admin/connected-users/.*$ /admin/router.php [L]
RewriteRule ^admin/users/.*$ /admin/router.php [L]
RewriteRule ^admin/tests/.*$ /admin/router.php [L]
RewriteRule ^admin/fields/.*$ /admin/router.php [L]

View File

@@ -92,29 +92,53 @@ if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
}
}
?>
<html lang="<?php echo $session->get_I18n(); ?>">
<head>
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/common/main.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/admin/admincolor.css" />
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
<script type="text/javascript">
<?php
if ($parm['act']) {
print("parent.reloadTree('base:" . $parm['p0'] . "');");
print("reloadTree('base:" . $parm['p0'] . "');");
}
?>
function sendLogopdf()
{
document.forms["flpdf"].target = "";
document.forms["flpdf"].act.value = "SENDLOGOPDF";
document.forms["flpdf"].submit();
}
function sendLogopdf()
{
document.forms["flpdf"].target = "";
document.forms["flpdf"].act.value = "SENDLOGOPDF";
document.forms["flpdf"].submit();
}
function deleteLogoPdf()
{
if(confirm("<?php echo _('admin::base: Supprimer le logo pour impression') ?>"))
function deleteLogoPdf()
{
if(confirm("<?php echo _('admin::base: Supprimer le logo pour impression') ?>"))
{
$.ajax({
type: "POST",
url: "/admin/adminFeedback.php",
dataType: 'json',
data: { action:"DELLOGOPDF", p0:<?php echo $sbas_id ?>},
success: function(data){
$("#printLogoDIV_OK").hide();
$("#printLogoDIV_NONE").show();
}
});
}
}
function reindex()
{
if(confirm('<?php echo str_replace("'", "\'", _('Confirmez-vous la re-indexation de la base ?')); ?>'))
{
$.ajax({
type: "POST",
url: "/admin/adminFeedback.php",
dataType: 'json',
data: { action:"REINDEX", sbas_id:<?php echo $sbas_id ?>},
success: function(data){
}
});
}
}
function makeIndexable(el)
{
$.ajax({
type: "POST",
@@ -185,46 +209,20 @@ if ($parm['act']) {
}
});
}
}
function refreshContent()
{
$.ajax({
type: "POST",
url: "/admin/adminFeedback.php",
dataType: 'json',
data: { action:"P_BAR_INFO", sbas_id:"<?php echo $sbas_id ?>"},
success: function(data){
__viewname = data.viewname; // global
if(data.viewname == '')
$("#viewname").html("<i><?php echo(_('admin::base: aucun alias')) ?></i>");
else
$("#viewname").html("<b>"+data.viewname+"</b>");
$("#nrecords").text(data.records);
$("#is_indexable").attr('checked', data.indexable);
$("#xml_indexed").text(data.xml_indexed);
$("#thesaurus_indexed").text(data.thesaurus_indexed);
if(data.records > 0)
{
var p;
p = 100*data.xml_indexed/data.records;
$("#xml_indexed_bar").width(Math.round(2*p)); // 0..200px
$("#xml_indexed_percent").text((Math.round(p*100)/100)+" %");
p = 100*data.thesaurus_indexed/data.records;
$("#thesaurus_indexed_bar").width(Math.round(2*p));
$("#thesaurus_indexed_percent").text((Math.round(p*100)/100)+" %");
}
if(data.printLogoURL)
{
$("#printLogo").attr("src", data.printLogoURL);
$("#printLogoDIV_NONE").hide();
$("#printLogoDIV_OK").show();
}
else
{
$("#printLogoDIV_OK").hide();
$("#printLogoDIV_NONE").show();
}
function clearAllLog()
{
if(confirm("<?php echo _('admin::base: Confirmer la suppression de tous les logs') ?>"))
{
$.ajax({
type: "POST",
url: "/admin/adminFeedback.php",
dataType: 'json',
data: { action:"CLEARALLLOG", sbas_id:<?php echo $sbas_id ?>
},
success: function(data){
}
});
}
});
setTimeout("refreshContent();", 6000);
@@ -299,75 +297,42 @@ if ($parm['act']) {
{
if(confirm("<?php echo _('admin::base: Confirmer vous l\'arret de la publication de la base') ?>"))
{
$.ajax({
type: "POST",
url: "/admin/adminFeedback.php",
dataType: 'json',
data: { action:"UNMOUNTBASE", sbas_id:<?php echo $sbas_id ?>
},
success: function(data){
parent.$("#TREE_DATABASES").trigger('click');
}
});
document.forms["manageDatabase"].target = "";
document.forms["manageDatabase"].act.value = "";
document.forms["manageDatabase"].sta.value = sta;
document.forms["manageDatabase"].submit();
}
}
function showDetails(sta)
{
document.forms["manageDatabase"].target = "";
document.forms["manageDatabase"].act.value = "";
document.forms["manageDatabase"].sta.value = sta;
document.forms["manageDatabase"].submit();
}
function chgOrd(srt)
{
document.forms["manageDatabase"].target = "";
document.forms["manageDatabase"].act.value = "";
document.forms["manageDatabase"].sta.value = "1";
document.forms["manageDatabase"].srt.value = srt;
document.forms["manageDatabase"].submit();
}
$(document).ready(function(){
refreshContent();
});
function chgOrd(srt)
{
document.forms["manageDatabase"].target = "";
document.forms["manageDatabase"].act.value = "";
document.forms["manageDatabase"].sta.value = "1";
document.forms["manageDatabase"].srt.value = srt;
document.forms["manageDatabase"].submit();
}
$(document).ready(function(){
refreshContent();
});
</script>
<style type="text/css">
.logo_boxes
{
margin:5px 5px 5px 10px;
padding-top:5px;
border-top:2px solid black;
}
a:link,a:visited{
text-decoration:none;
color:#666;
}
a:hover{
text-decoration:underline;
color:black;
}
</style>
</head>
<body>
<?php
$out = "";
?>
<div style='margin:3px 0 3px 10px;'>
<h2>
<?php echo $databox->get_serialized_server_info(); ?>
</h2>
</div>
<div style='margin:3px 0 3px 10px;'>
ID : <?php echo($sbas_id) ?>
</div>
<div style='margin:3px 0 3px 10px;'>
<?php echo(_('admin::base: Alias')) ?> : <span id="viewname"></span>
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
<div class="db_box">
<h2><?php echo $databox->get_serialized_server_info(); ?></h2>
<p>ID : <?php echo($sbas_id) ?></p>
<p>
<?php echo(_("admin::base: Alias")) ?> : <span id="viewname"></span>
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, "bas_manage")) {
?>
<img src="/skins/icons/edit_0.gif" onclick="chgViewName();return(false);" />
<?php
}
?>
<img src='/skins/icons/edit_0.gif' onclick="chgViewName();return(false);" style='vertical-align:middle'/>
</p>
<?php
}
?>
@@ -375,30 +340,29 @@ $out = "";
<?php
$nrecords = $databox->get_record_amount();
// stats sur la base distante
$out .= "<div style='margin:3px 0 3px 10px;'>";
$out .= _('admin::base: nombre d\'enregistrements sur la base :') . '<span id="nrecords"></span> ';
$out .= "<p>";
// stats sur la base distante
$out .= _('admin::base: nombre d\'enregistrements sur la base :') . ' ' . '<span id="nrecords"></span> ';
if ((int) $parm["sta"] < 1) {
$out .= " (<a href=\"javascript:void(0);\" onclick=\"showDetails(1);return(false);\">" . _('phraseanet:: details') . "</a>)";
} else {
$unique_keywords = $databox->get_unique_keywords();
$out .= ", &nbsp;&nbsp;";
$out .= _('admin::base: nombre de mots uniques sur la base : ') . ' ' . $unique_keywords;
$out .= ", &nbsp;";
$out .= _('admin::base: nombre de mots uniques sur la base : ') . ' ' . $unique_keywords;
$indexes = $databox->get_index_amount();
$out .= ", &nbsp;&nbsp;";
$out .= _('admin::base: nombre de mots indexes sur la base') . ' ' . $indexes;
$out .= ", &nbsp;";
$out .= _('admin::base: nombre de mots indexes sur la base') . ' ' . $indexes;
if ($registry->get('GV_thesaurus')) {
$thits = $databox->get_thesaurus_hits();
$out .= ", &nbsp;&nbsp;";
$out .= _('admin::base: nombre de termes de Thesaurus indexes :') . ' ' . $thits;
}
$out .= ", &nbsp;";
$out .= _('admin::base: nombre de termes de Thesaurus indexes :') . ' ' . $thits;
}
$out .= " (<a href=\"javascript:void(0);\" onclick=\"showDetails(0);return(false);\">" . _('admin::base: masquer les details') . "</a>)<br />\n";
@@ -489,232 +453,194 @@ $out = "";
$out .= "<td style=\"text-align:right; TEXT-DECORATION:overline\">&nbsp;" . sprintf("%.2f", $mega) . "&nbsp;</td>\n";
$out .= "<td style=\"text-align:right; TEXT-DECORATION:overline\">&nbsp;" . sprintf("%.2f", $giga) . "&nbsp;</td>\n";
$out .= "</tr>\n";
$out .= "<tr><td colspan=\"5\"><hr /></td></tr>\n";
}
$out .= "<tr>\n";
$out .= "<td colspan=\"2\" style=\"text-align:right\"><b>" . _('report:: total') . "</b></td>\n";
$out .= "<td style=\"text-align:right;\">&nbsp;<b>" . $totobj . "</b>&nbsp;</td>\n";
if (extension_loaded("bcmath"))
$mega = bcdiv($totsiz, 1024 * 1024, 5);
else
$mega = $totsiz / (1024 * 1024);
if (extension_loaded("bcmath"))
$giga = bcdiv($totsiz, 1024 * 1024 * 1024, 5);
else
$giga = $totsiz / (1024 * 1024 * 1024);
$out .= "<td style=\"text-align:right;\">&nbsp;<b>" . sprintf("%.2f", $mega) . "</b>&nbsp;</td>\n";
$out .= "<td style=\"text-align:right;\">&nbsp;<b>" . sprintf("%.2f", $giga) . "</b>&nbsp;</td>\n";
$out .= "</tr>\n";
$out .= "</tbody></table>";
}
$out .= "</div>";
$out .= "</tbody></table>";
$out .= "</p>";
}
print($out);
?>
<div style='margin:3px 0 3px 10px;'>
<div id='INDEX_P_BAR'>
<div style='height:30px;'>
<div>
<?php echo(_('admin::base: document indexes en utilisant la fiche xml')); ?> :
<span id='xml_indexed'></span>
</div>
<div id='xml_indexed_bar' style='position:absolute;width:0px;height:15px;background:#d4d0c9;z-index:6;'>
</div>
<div id='xml_indexed_percent' style='position:absolute;width:198px;height:13px;text-align:center;border:1px solid black;z-index:10;'>
</div>
<div id="INDEX_P_BAR">
<div style="height: 35px;">
<p>
<?php echo(_("admin::base: document indexes en utilisant la fiche xml")); ?> :
<span id="xml_indexed"></span>
</p>
<div id="xml_indexed_bar"></div>
<div id="xml_indexed_percent"></div>
</div>
<div style='height:30px;'>
<div>
<?php echo(_('admin::base: document indexes en utilisant le thesaurus')); ?> :
<span id='thesaurus_indexed'></span>
</div>
<div id='thesaurus_indexed_bar' style='position:absolute;width:0px;height:15px;background:#d4d0c9;z-index:6;'>
</div>
<div id='thesaurus_indexed_percent' style='position:absolute;width:198px;height:13px;text-align:center;border:1px solid black;z-index:10;'>
</div>
<div style="height: 35px;">
<p>
<?php echo(_("admin::base: document indexes en utilisant le thesaurus")); ?> :
<span id="thesaurus_indexed"></span>
</p>
<div id="thesaurus_indexed_bar"></div>
<div id="thesaurus_indexed_percent"></div>
</div>
</div>
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
?>
<div style='margin:15px 5px 0px 0px;'>
<input type='checkbox' id='is_indexable' onclick='makeIndexable(this)'/>
<label for='is_indexable<?php echo($parm["p0"]); ?>'>
<?php echo(_('admin::base: Cette base est indexable')); ?>
</label>
<div style='display:none' id='make_indexable_ajax_status'>&nbsp;</div>
</div>
<div>
<a href="javascript:void(0);return(false);" onclick="reindex();return(false);">
<?php echo(_('base:: re-indexer')); ?>
</a>
</div>
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, "bas_manage")) {
?>
<div style="margin: 9px 0;">
<label class="checkbox" for="is_indexable<?php echo($parm["p0"]); ?>">
<input type="checkbox" id="is_indexable" onclick="makeIndexable(this)" />
<?php echo(_("admin::base: Cette base est indexable")); ?>
</label>
<div id="make_indexable_ajax_status" style="display:none">&nbsp;</div>
</div>
<div style='margin:20px 0 3px 10px;'>
<a href="newcoll.php?act=GETNAME&p0=<?php echo($parm["p0"]); ?>">
<img src='/skins/icons/create_coll.png' style='vertical-align:middle'/>
<?php echo(_('admin::base:collection: Creer une collection')); ?>
<p>
<a href="javascript:void(0);return(false);" onclick="reindex();return(false);">
<?php echo(_("base:: re-indexer")); ?>
</a>
</div>
<?php
$mountable_colls = $databox->get_mountable_colls();
if (count($mountable_colls) > 0) {
?>
<div style='margin:20px 0 3px 10px;'>
</p>
<br />
<p>
<a href="newcoll.php?act=GETNAME&p0=<?php echo($parm["p0"]); ?>">
<img src="/skins/icons/create_coll.png" style="vertical-align:middle"/>
<?php echo(_("admin::base:collection: Creer une collection")); ?>
</a>
</p>
<?php
$mountable_colls = $databox->get_mountable_colls();
if (count($mountable_colls) > 0) {
?>
<p>
<a href="#" onclick="mountColl();">
<img src='/skins/icons/create_coll.png' style='vertical-align:middle'/>
<?php echo(_('admin::base:collection: Monter une collection')); ?>
<img src="/skins/icons/create_coll.png" style="vertical-align:middle" />
<?php echo(_("admin::base:collection: Monter une collection")); ?>
</a>
</div>
</p>
<div id="mount_coll" style="display:none;">
<form method="post" action="database.php" target="_self">
<select name="coll_id">
<?php
foreach ($mountable_colls as $coll_id => $name) {
?>
<?php
foreach ($mountable_colls as $coll_id => $name) {
?>
<option value="<?php echo $coll_id ?>"><?php echo $name ?></option>
<?php
}
?>
</select>
<?php
$colls = $user->ACL()->get_granted_base(array('canadmin'));
if (count($colls) > 0) {
?>
<span>
<?php echo _('admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces ') ?>
</span>
<select name="othcollsel" >
<option><?php echo _('choisir') ?></option>
<?php
foreach ($colls as $base_id => $collection)
echo "<option value='" . $base_id . "'>" . $collection->get_name() . '</option>';
?>
</select>
<?php
}
<?php
$colls = $user->ACL()->get_granted_base(array("canadmin"));
if (count($colls) > 0) {
?>
<input type="hidden" name="p0" value="<?php echo $sbas_id; ?>"/>
<input type="hidden" name="act" value="MOUNT"/>
<button type="submit"><?php echo _('Monter'); ?></button>
<p><?php echo _("admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces ") ?></p>
<select name="othcollsel" >
<option><?php echo _("choisir") ?></option>
<?php
foreach ($colls as $base_id => $collection)
echo "<option value='" . $base_id . "'>" . $collection->get_name() . '</option>';
?>
</select>
<?php
}
?>
<input type="hidden" name="p0" value="<?php echo $sbas_id; ?>" />
<input type="hidden" name="act" value="MOUNT" />
<button type="submit" class="btn"><?php echo _("Monter"); ?></button>
</form>
</div>
<?php
}
<?php
}
$activable_colls = $databox->get_activable_colls();
if (count($activable_colls) > 0) {
?>
<div style='margin:20px 0 3px 10px;'>
$activable_colls = $databox->get_activable_colls();
if (count($activable_colls) > 0) {
?>
<p>
<a href="#" onclick="activateColl();">
<img src='/skins/icons/create_coll.png' style='vertical-align:middle'/>
<?php echo(_('Activer une collection')); ?>
<img src="/skins/icons/create_coll.png" style="vertical-align:middle"/>
<?php echo(_("Activer une collection")); ?>
</a>
</div>
</p>
<div id="activate_coll" style="display:none;">
<form method="post" action="database.php" target="_self">
<select name="base_id">
<?php
foreach ($activable_colls as $base_id) {
?>
<option value="<?php echo $base_id ?>"><?php echo phrasea::bas_names($base_id) ?></option>
<?php
}
<?php
foreach ($activable_colls as $base_id) {
?>
<option value="<?php echo $base_id ?>"><?php echo phrasea::bas_names($base_id) ?></option>
<?php
}
?>
</select>
<input type="hidden" name="p0" value="<?php echo $sbas_id; ?>"/>
<input type="hidden" name="act" value="ACTIVATE"/>
<button type="submit"><?php echo _('Activer'); ?></button>
<button type="submit"><?php echo _("Activer"); ?></button>
</form>
</div>
<?php
}
?>
<div style='margin:20px 0 3px 10px;'>
<?php
}
?>
<p>
<a href="javascript:void(0);return(false);" onclick="clearAllLog();return(false);">
<img src='/skins/icons/clearLogs.png' style='vertical-align:middle'/>
<?php echo(_('admin::base: supprimer tous les logs')); ?>
<img src="/skins/icons/clearLogs.png" style="vertical-align:middle"/>
<?php echo(_("admin::base: supprimer tous les logs")); ?>
</a>
</div>
<div style='margin:20px 0 13px 10px;'>
</p>
<p>
<a href="javascript:void(0);return(false);" onclick="umountBase();return(false);">
<img src='/skins/icons/db-remove.png' style='vertical-align:middle'/>
<?php echo(_('admin::base: arreter la publication de la base')); ?>
<img src="/skins/icons/db-remove.png" style="vertical-align:middle"/>
<?php echo(_("admin::base: arreter la publication de la base")); ?>
</a>
</div>
<div style='margin:3px 0 3px 10px;'>
</p>
<p>
<a href="javascript:void(0);return(false);" onclick="emptyBase();return(false);">
<img src='/skins/icons/trash.png' style='vertical-align:middle'/>
<?php echo(_('admin::base: vider la base')); ?>
<img src="/skins/icons/trash.png" style="vertical-align:middle"/>
<?php echo(_("admin::base: vider la base")); ?>
</a>
</div>
<div style='margin:3px 0 3px 10px;'>
</p>
<p>
<a href="javascript:void(0);return(false);" onclick="deleteBase();return(false);">
<img src='/skins/icons/delete.gif' style='vertical-align:middle'/>
<?php echo(_('admin::base: supprimer la base')); ?>
<img src="/skins/icons/delete.gif" style="vertical-align:middle"/>
<?php echo(_("admin::base: supprimer la base")); ?>
</a>
</div>
<?php
}
?>
</p>
<?php
}
?>
</div><!-- /db_box -->
<!-- minilogo pour print pdf -->
<div class='logo_boxes'>
<div style="font-size:11px;font-weight:bold;margin:0px 3px 10px 0px;">
<?php echo(_('admin::base: logo impression PDF')) ?>
</div>
<?php echo($printLogoUploadMsg) ?>
<div id='printLogoDIV_OK' style='margin:0 0 5px 0; display:none'>
<img id='printLogo' src="/print/<?php echo $sbas_id ?>" />
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
?>
<a href="javascript:void();return(false);" onclick="deleteLogoPdf();return(false);">
<?php echo(_('admin::base:collection: supprimer le logo')) ?>
</a>
<?php
}
<div class="logo_box">
<hr>
<h4><?php echo(_("admin::base: logo impression PDF")) ?></h4>
<?php echo($printLogoUploadMsg) ?>
<div id="printLogoDIV_OK">
<img id="printLogo" src="/print/<?php echo $sbas_id ?>" />
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, "bas_manage")) {
?>
<a href="javascript:void();return(false);" onclick="deleteLogoPdf();return(false);">
<?php echo(_("admin::base:collection: supprimer le logo")) ?>
</a>
<?php
}
?>
</div>
<div id='printLogoDIV_NONE' style='margin:0 0 5px 0; display:none'>
<?php
if ( ! file_exists($registry->get('GV_RootPath') . 'config/minilogos/logopdf_' . $databox->get_sbas_id())) {
echo(_('admin::base:collection: aucun fichier (minilogo, watermark ...)'));
} else {
echo '<img style="margin:5px;" src="/custom/minilogos/logopdf_1"/>';
}
?>
<div id="printLogoDIV_NONE">
<?php echo(_("admin::base:collection: aucun fichier (minilogo, watermark ...)")) ?>
<form method="post" name="flpdf" action="./database.php" target="???" onsubmit="return(false);" ENCTYPE="multipart/form-data">
<input type="hidden" name="p0" value="<?php echo($parm["p0"]); ?>" />
<input type="hidden" name="sta" value="\" />
<input type="hidden" name="srt" value="" />
<input type="hidden" name="act" value="" />
<input type="hidden" name="sta" value="" />
<input type="hidden" name="srt" value="" />
<input type="hidden" name="act" value="" />
<input type="hidden" name="tid" value="" />
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
?>
<?php
if ($user->ACL()->has_right_on_sbas($sbas_id, "bas_manage")) {
?>
<input name="newLogoPdf" type="file" />
<input type='button' value='<?php echo(_('boutton::envoyer')); ?>' onclick='sendLogopdf();'/>
<br/>
<?php echo(_('admin::base: envoyer un logo (jpeg 35px de hauteur max)')); ?>
<?php
}
?>
<input type="button" class="btn" value="<?php echo(_("boutton::envoyer")); ?>" onclick="sendLogopdf();" />
<br />
<?php echo(_("admin::base: envoyer un logo (jpeg 35px de hauteur max)"));
}
?>
</form>
</div>
</div>
<form method="post" name="manageDatabase" action="./database.php" target="???" onsubmit="return(false);">
<input type="hidden" name="p0" value="<?php echo($parm["p0"]) ?>" />
<input type="hidden" name="sta" value="0" />
@@ -722,5 +648,3 @@ if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
<input type="hidden" name="act" value="???" />
<input type="hidden" name="tid" value="???" />
</form>
</body>
</html>

View File

@@ -27,226 +27,210 @@ $error = array();
$Core = bootstrap::getCore();
phrasea::headers();
?>
<html lang="<?php echo $session->get_I18n(); ?>">
<head>
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/common/main.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/admin/admincolor.css" />
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
<style type="text/css">
blockquote{
margin:0 15px;
padding:5px 10px;
border:3px dotted black;
background-color:#DEDEDE;
}
</style>
</head>
<body>
<?php
if ($request->has_post_datas() && $user_obj->is_admin() === true) {
$parm = $request->get_parms('upgrade');
if ( ! is_null($parm['upgrade'])) {
$checks = phrasea::is_scheduler_started();
if ($checks !== true) {
$appbox = appbox::get_instance(\bootstrap::getCore());
try {
$upgrader = new Setup_Upgrade($appbox);
$advices = $appbox->forceUpgrade($upgrader);
<?php
if ($request->has_post_datas() && $user_obj->is_admin() === true) {
$parm = $request->get_parms('upgrade');
if ( ! is_null($parm['upgrade'])) {
$checks = phrasea::is_scheduler_started();
if ($checks !== true) {
$appbox = appbox::get_instance(\bootstrap::getCore());
try {
$upgrader = new Setup_Upgrade($appbox);
$advices = $appbox->forceUpgrade($upgrader);
$code = '';
foreach ($advices as $advice) {
$code .= $advice['sql'] . '<br/>';
}
$code = '';
foreach ($advices as $advice) {
$code .= $advice['sql'] . '<br />';
}
$recommendations = $upgrader->getRecommendations();
$recommendations = $upgrader->getRecommendations();
if($code) {
$code = _('Propositions de modifications des tables')
. '<blockquote>' . $code . '</blockquote>';
if($code) {
$code = _('Propositions de modifications des tables')
. '<blockquote>' . $code . '</blockquote>';
?>
<pre>
<?php echo $code; ?>
</pre>
<?php
}
if ($recommendations) {
foreach($recommendations as $recommendation) {
list($message, $command) = $recommendation;
?>
<p><?php echo $message; ?></p>
<pre>
<?php echo $code; ?>
<blockquote><?php echo $command; ?></blockquote>
</pre>
<?php
}
if ($recommendations) {
foreach($recommendations as $recommendation) {
list($message, $command) = $recommendation;
?>
<p><?php echo $message; ?></p>
<pre>
<blockquote><?php echo $command; ?></blockquote>
</pre>
<?php
}
}
?>
<div style="color:black;font-weight:bold;background-color:green;">
<?php echo _('N\'oubliez pas de redemarrer le planificateur de taches'); ?>
</div>
<?php
} catch (\Exception_Setup_UpgradeAlreadyStarted $e) {
?>
<div style="margin-top:10px;color:black;font-weight:bold;background-color:yellow;">
<?php echo _('The upgrade is already started'); ?>
</div>
<?php
}catch(\Exception_Setup_FixBadEmailAddresses $e){
?>
<div style="margin-top:10px;color:black;font-weight:bold;background-color:yellow;">
<?php echo _('Please fix the database before starting'); ?>
</div>
<?php
}catch(\Exception $e){
?>
<div style="margin-top:10px;color:black;font-weight:bold;background-color:yellow;">
<?php echo _('An error occured'); ?>
</div>
<?php
}
} else {
?>
<div style="color:black;font-weight:bold;background-color:red;"><?php echo _('Veuillez arreter le planificateur avant la mise a jour'); ?></div>
<?php
}
?>
<div class="db_recommand" style="background-color: #32CD32;">
<?php echo _('N\'oubliez pas de redemarrer le planificateur de taches'); ?>
</div>
<?php
} catch (\Exception_Setup_UpgradeAlreadyStarted $e) {
?>
<div class="db_recommand db_exception">
<?php echo _('The upgrade is already started'); ?>
</div>
<?php
}catch(\Exception_Setup_FixBadEmailAddresses $e){
?>
<div class="db_recommand">
<?php echo _('Please fix the database before starting'); ?>
</div>
<?php
}catch(\Exception $e){
?>
<div class="db_recommand">
<?php echo _('An error occured'); ?>
</div>
<?php
}
} else {
?>
<div class="db_recommand" style=" background-color: #F00;"><?php echo _('Veuillez arreter le planificateur avant la mise a jour'); ?></div>
<?php
}
}
$parm = $request->get_parms('mount_base', 'new_settings', 'new_dbname', 'new_data_template', 'new_hostname', 'new_port', 'new_user', 'new_user', 'new_password', 'new_dbname', 'new_data_template');
if ( ! $parm['mount_base']) {
if ( ! $parm['new_settings'] && $parm['new_dbname'] && $parm['new_data_template']) {
if (p4string::hasAccent($parm['new_dbname'])) {
$error[] = _('Database name can not contains special characters');
}
if (count($error) === 0) {
try {
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
$choosenConnexion = $configuration->getPhraseanet()->get('database');
$connexion = $configuration->getConnexion($choosenConnexion);
$hostname = $connexion->get('host');
$port = $connexion->get('port');
$user = $connexion->get('user');
$password = $connexion->get('password');
$data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$connbas = new connection_pdo('databox_creation', $hostname, $port, $user, $password, $parm['new_dbname'], array(), $appbox->get_registry());
try {
$base = databox::create($appbox, $connbas, $data_template, $registry);
$base->registerAdmin($user_obj);
$createBase = $sbas_id = $base->get_sbas_id();
} catch (Exception $e) {
$error[] = $e->getMessage();
}
} catch (Exception $e) {
$error[] = _('Database does not exists or can not be accessed');
}
}
$parm = $request->get_parms('mount_base', 'new_settings', 'new_dbname', 'new_data_template', 'new_hostname', 'new_port', 'new_user', 'new_user', 'new_password', 'new_dbname', 'new_data_template');
if ( ! $parm['mount_base']) {
if ( ! $parm['new_settings'] && $parm['new_dbname'] && $parm['new_data_template']) {
if (p4string::hasAccent($parm['new_dbname'])) {
$error[] = _('Database name can not contains special characters');
}
} elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port']
&& $parm['new_user'] && $parm['new_password']
&& $parm['new_dbname'] && $parm['new_data_template']) {
if (count($error) === 0) {
try {
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
if (p4string::hasAccent($parm['new_dbname'])) {
$error[] = _('Database name can not contains special characters');
}
$choosenConnexion = $configuration->getPhraseanet()->get('database');
if (count($error) === 0) {
$connexion = $configuration->getConnexion($choosenConnexion);
$hostname = $connexion->get('host');
$port = $connexion->get('port');
$user = $connexion->get('user');
$password = $connexion->get('password');
$data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$connbas = new connection_pdo('databox_creation', $hostname, $port, $user, $password, $parm['new_dbname'], array(), $appbox->get_registry());
try {
$base = databox::create($appbox, $connbas, $data_template, $registry);
$base->registerAdmin($user_obj);
$createBase = $sbas_id = $base->get_sbas_id();
} catch (Exception $e) {
$error[] = $e->getMessage();
}
} catch (Exception $e) {
$error[] = _('Database does not exists or can not be accessed');
}
}
} elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port']
&& $parm['new_user'] && $parm['new_password']
&& $parm['new_dbname'] && $parm['new_data_template']) {
if (p4string::hasAccent($parm['new_dbname'])) {
$error[] = _('Database name can not contains special characters');
}
if (count($error) === 0) {
try {
$data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$connbas = new connection_pdo('databox_creation', $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], array(), $appbox->get_registry());
$base = databox::create($appbox, $connbas, $data_template, $registry);
$base->registerAdmin($user_obj);
$createBase = $sbas_id = $base->get_sbas_id();
} catch (Exception $e) {
$error[] = $e->getMessage();
}
}
}
} elseif ($parm['mount_base']) {
if ( ! $parm['new_settings'] && $parm['new_dbname']) {
if (p4string::hasAccent($parm['new_dbname']))
$error[] = _('Database name can not contains special characters');
if (count($error) === 0) {
try {
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
$connexion = $configuration->getConnexion();
$hostname = $connexion->get('host');
$port = $connexion->get('port');
$user = $connexion->get('user');
$password = $connexion->get('password');
$appbox->get_connection()->beginTransaction();
$base = databox::mount($appbox, $hostname, $port, $user, $password, $parm['new_dbname'], $registry);
$base->registerAdmin($user_obj);
$mountBase = true;
$appbox->get_connection()->commit();
} catch (Exception $e) {
$appbox->get_connection()->rollBack();
$error[] = $e->getMessage();
}
}
} elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port'] && $parm['new_user']
&& $parm['new_password'] && $parm['new_dbname']) {
if (p4string::hasAccent($parm['new_dbname']))
$error[] = 'No special chars in dbname';
if (count($error) === 0) {
try {
$appbox->get_connection()->beginTransaction();
$base = databox::mount($appbox, $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], $registry);
$base->registerAdmin($user_obj);
$appbox->get_connection()->commit();
} catch (Exception $e) {
$appbox->get_connection()->rollBack();
$error[] = $e->getMessage() . '@' . $e->getFile() . $e->getLine();
}
}
try {
$data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$connbas = new connection_pdo('databox_creation', $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], array(), $appbox->get_registry());
$base = databox::create($appbox, $connbas, $data_template, $registry);
$base->registerAdmin($user_obj);
$createBase = $sbas_id = $base->get_sbas_id();
} catch (Exception $e) {
$error[] = $e->getMessage();
}
}
}
} elseif ($parm['mount_base']) {
if ( ! $parm['new_settings'] && $parm['new_dbname']) {
if (p4string::hasAccent($parm['new_dbname']))
$error[] = _('Database name can not contains special characters');
if (count($error) === 0) {
try {
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
$connexion = $configuration->getConnexion();
$hostname = $connexion->get('host');
$port = $connexion->get('port');
$user = $connexion->get('user');
$password = $connexion->get('password');
$appbox->get_connection()->beginTransaction();
$base = databox::mount($appbox, $hostname, $port, $user, $password, $parm['new_dbname'], $registry);
$base->registerAdmin($user_obj);
$mountBase = true;
$appbox->get_connection()->commit();
} catch (Exception $e) {
$appbox->get_connection()->rollBack();
$error[] = $e->getMessage();
}
}
} elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port'] && $parm['new_user']
&& $parm['new_password'] && $parm['new_dbname']) {
if (p4string::hasAccent($parm['new_dbname']))
$error[] = 'No special chars in dbname';
if (count($error) === 0) {
try {
$appbox->get_connection()->beginTransaction();
$base = databox::mount($appbox, $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], $registry);
$base->registerAdmin($user_obj);
$appbox->get_connection()->commit();
} catch (Exception $e) {
$appbox->get_connection()->rollBack();
$error[] = $e->getMessage() . '@' . $e->getFile() . $e->getLine();
}
}
}
}
}
$upgrade_available = false;
$upgrade_available = false;
if ($appbox->upgradeavailable())
if ($appbox->upgradeavailable())
$upgrade_available = true;
$sbas_ids = array_merge(
array_keys($user_obj->ACL()->get_granted_sbas(array('bas_manage')))
, array_keys($user_obj->ACL()->get_granted_sbas(array('bas_modify_struct')))
);
$hasRightsMountDB = count($sbas_ids) > 0;
$sbas = array();
foreach ($sbas_ids as $sbas_id) {
$version = 'unknown';
$sbas[$sbas_id] = '<img src="/skins/icons/db-remove.png" /> ' . ' (Unreachable server)';
try {
$databox = databox::get_instance($sbas_id);
$version = $databox->get_version();
if ($databox->upgradeavailable())
$upgrade_available = true;
$sbas[$sbas_id] = '<img src="/skins/icons/foldph20close_0.gif" /> ' . phrasea::sbas_names($sbas_id)
. ' (version ' . $version . ') MySQL ' . $databox->get_connection()->server_info();
} catch (Exception $e) {
$sbas_ids = array_merge(
array_keys($user_obj->ACL()->get_granted_sbas(array('bas_manage')))
, array_keys($user_obj->ACL()->get_granted_sbas(array('bas_modify_struct')))
);
$hasRightsMountDB = count($sbas_ids) > 0;
$sbas = array();
foreach ($sbas_ids as $sbas_id) {
$version = 'unknown';
$sbas[$sbas_id] = '<img src="/skins/icons/db-remove.png"/> ' . ' (Unreachable server)';
try {
$databox = databox::get_instance($sbas_id);
$version = $databox->get_version();
if ($databox->upgradeavailable())
$upgrade_available = true;
$sbas[$sbas_id] = '<img src="/skins/icons/foldph20close_0.gif">' . phrasea::sbas_names($sbas_id)
. ' (version ' . $version . ') MySQL ' . $databox->get_connection()->server_info();
} catch (Exception $e) {
}
}
?>
<script type="text/javascript">
}
}
?>
<script type="text/javascript">
<?php
if ($createBase || $mountBase) {
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
@@ -268,11 +252,11 @@ if ($createBase || $mountBase) {
<?php
foreach ($error as $e) {
?>
<span style="background-color:red;color:white;padding:3px"><?php echo $e; ?></span>
<span style="background-color: #F00; color: #FFF;"><?php echo $e; ?></span>
<?php
}
?>
<div style="position:relative;float:left;width:100%;">
<div class="db_infos">
<h2>Bases actuelles :</h2>
<ul>
<?php
@@ -281,7 +265,7 @@ if ($createBase || $mountBase) {
?>
<li>
<a href='database.php?p0=<?php echo $k ?>' target='_self'>
<span><?php echo $v ?></span>
<?php echo $v ?>
</a>
</li>
<?php
@@ -292,114 +276,95 @@ if ($createBase || $mountBase) {
<?php
}
?>
</ul>
</div>
<?php
if ($user_obj->is_admin() === true) {
?>
<div style="position:relative;float:left;width:100%;">
<div class="db_infos">
<h2><?php echo _('admin::base: Version') ?></h2>
<?php
if ($upgrade_available) {
?>
<div><?php echo _('update::Votre application necessite une mise a jour vers : '), ' ', $Core->getVersion()->getNumber() ?></div>
<p><?php echo _('update::Votre application necessite une mise a jour vers : '), ' ', $Core->getVersion()->getNumber() ?></p>
<?php
} else {
?>
<div><?php echo _('update::Votre version est a jour : '), ' ', $Core->getVersion()->getNumber() ?></div>
<p><?php echo _('update::Votre version est a jour : '), ' ', $Core->getVersion()->getNumber() ?></p>
<?php
}
?>
<form action="databases.php" method="post" >
<input type="hidden" value="" name="upgrade" />
<input type="submit" value="<?php echo _('update::Verifier els tables') ?>"/>
<input type="submit" class="btn btn-warning" value="<?php echo _('update::Verifier els tables') ?>" />
</form>
</div>
<div style="position:relative;float:left;width:100%;">
<div class="db_infos">
<h2><?php echo _('admin::base: creer une base') ?></h2>
<div id="create_base">
<form method="post" action="databases.php">
<div>
<input type="checkbox" name="new_settings" onchange="if(this.checked == true)$('#server_opts').slideDown();else $('#server_opts').slideUp();"/><label><?php echo _('phraseanet:: Creer une base sur un serveur different de l\'application box'); ?></label>
</div>
<form class="form-vertical" method="post" action="databases.php">
<label class="checkbox">
<input type="checkbox" name="new_settings" onchange="if(this.checked == true)$('#server_opts').slideDown();else $('#server_opts').slideUp();" />
<?php echo _('phraseanet:: Creer une base sur un serveur different de l\'application box'); ?>
</label>
<div id="server_opts" style="display:none;">
<div>
<label><?php echo _('phraseanet:: hostname'); ?></label><input name="new_hostname" value="" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: port'); ?></label><input name="new_port" value="3306" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: user'); ?></label><input name="new_user" value="" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: password'); ?></label><input name="new_password" value="" type="password"/>
</div>
<label><?php echo _('phraseanet:: hostname'); ?></label>
<input name="new_hostname" value="" type="text" />
<label><?php echo _('phraseanet:: port'); ?></label>
<input name="new_port" value="3306" type="text" />
<label><?php echo _('phraseanet:: user'); ?></label>
<input name="new_user" value="" type="text" />
<label><?php echo _('phraseanet:: password'); ?></label>
<input name="new_password" value="" type="password" />
</div>
<div>
<label><?php echo _('phraseanet:: dbname'); ?></label><input name="new_dbname" value="" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: Modele de donnees'); ?></label>
<select name="new_data_template">
<?php
if ($handle = opendir($registry->get('GV_RootPath') . 'lib/conf.d/data_templates')) {
while (false !== ($file = readdir($handle))) {
if (is_file($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $file)) {
$file = substr($file, 0, (strlen($file) - 4));
?>
<option value="<?php echo $file; ?>"><?php echo $file; ?></option>
<?php
}
<label><?php echo _('phraseanet:: dbname'); ?></label>
<input name="new_dbname" value="" type="text" />
<label><?php echo _('phraseanet:: Modele de donnees'); ?></label>
<select name="new_data_template">
<?php
if ($handle = opendir($registry->get('GV_RootPath') . 'lib/conf.d/data_templates')) {
while (false !== ($file = readdir($handle))) {
if (is_file($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $file)) {
$file = substr($file, 0, (strlen($file) - 4));
?>
<option value="<?php echo $file; ?>"><?php echo $file; ?></option>
<?php
}
closedir($handle);
}
?>
</select>
</div>
<div>
<input value="<?php echo _('boutton::creer'); ?>" type="submit"/>
</div>
closedir($handle);
}
?>
</select>
<input type="submit" class="btn" value="<?php echo _('boutton::creer'); ?>" />
</form>
</div>
</div>
<div style="position:relative;float:left;width:100%;">
<div class="db_infos">
<h2><?php echo _('admin::base: Monter une base') ?></h2>
<div id="mount_base">
<form method="post" action="databases.php">
<div>
<input type="checkbox" name="new_settings" onchange="if(this.checked == true)$('#servermount_opts').slideDown();else $('#servermount_opts').slideUp();"/><label><?php echo _('phraseanet:: Monter une base provenant d\'un serveur different de l\'application box'); ?></label>
</div>
<label class="checkbox">
<input type="checkbox" name="new_settings" onchange="if(this.checked == true)$('#servermount_opts').slideDown();else $('#servermount_opts').slideUp();" />
<?php echo _('phraseanet:: Monter une base provenant d\'un serveur different de l\'application box'); ?>
</label>
<div id="servermount_opts" style="display:none;">
<div>
<label><?php echo _('phraseanet:: hostname'); ?></label><input name="new_hostname" value="" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: port'); ?></label><input name="new_port" value="3306" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: user'); ?></label><input name="new_user" value="" type="text"/>
</div>
<div>
<label><?php echo _('phraseanet:: password'); ?></label><input name="new_password" value="" type="password"/>
</div>
</div>
<div>
<label><?php echo _('phraseanet:: dbname'); ?></label><input name="new_dbname" value="" type="text"/>
</div>
<div>
<input type="hidden" name="mount_base" value="yes"/>
<input value="<?php echo _('boutton::monter') ?>" type="submit"/>
<label><?php echo _('phraseanet:: hostname'); ?></label>
<input name="new_hostname" value="" type="text" />
<label><?php echo _('phraseanet:: port'); ?></label>
<input name="new_port" value="3306" type="text" />
<label><?php echo _('phraseanet:: user'); ?></label>
<input name="new_user" value="" type="text" />
<label><?php echo _('phraseanet:: password'); ?></label>
<input name="new_password" value="" type="password" />
</div>
<label><?php echo _('phraseanet:: dbname'); ?></label>
<input type="text" name="new_dbname" value="" />
<input type="hidden" name="mount_base" value="yes" />
<input type="submit" class="btn" value="<?php echo _('boutton::monter') ?>" />
</form>
</div>
</div>
<?php
}
?>
</body>
</html>

View File

@@ -183,12 +183,13 @@ if ( ! is_null($templates) || ! is_null($parm['deny']) || ! is_null($parm['accep
?>
<html lang="<?php echo $session->get_I18n(); ?>">
<head>
<link type="text/css" rel="stylesheet" href="/skins/html5/bootstrap/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="/skins/html5/bootstrap/css/bootstrap-responsive.min.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/common/main.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/admin/admincolor.css" />
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js">
</script>
<script type="text/javascript" src="/include/minify/f=include/jquery.tooltip.js">
</script>
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/admin/css/Main.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/admin/css/Tables.css" />
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/include/minify/f=include/jquery.tooltip.js"></script>
<script type="text/javascript">
var bodySize = {x:100,y:100};
function resize(){
@@ -286,10 +287,10 @@ if ( ! is_null($templates) || ! is_null($parm['deny']) || ! is_null($parm['accep
}
</script>
<style>
#tooltip{
background-color:black;
color:white;
position:absolute;
#tooltip {
background-color: black;
color: white;
position: absolute;
}
</style>
@@ -336,7 +337,7 @@ $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$out .= "<div id=\"top_box\" style='height:70px;overflow:hidden;'>";
$out .= "<div id=\"top_box\" style='height:70px;'>";
$out .= "<div id=\"title\"><h1>" . _('admin:: demandes en cours') . "</h1></div>";
$out .= "<div>";
@@ -496,7 +497,7 @@ $out .= "</div>";
$out .= " <div id='bottom_box' style='height:40px;overflow:hidden;'>";
$out .= " <div id=\"divboutdemand\" style=\"text-align:center;\">";
$out .= " <input type='submit' value='" . _('boutton::valider') . "' />";
$out .= " <input type='submit' class='btn' value='" . _('boutton::valider') . "' />";
$out .= " </div>";
$out .= " </div></form>";
$out .= " </body>";

View File

@@ -62,93 +62,41 @@ function getFormTimezone($props = array(), $selected = false)
}
phrasea::start($Core);
?>
<html lang="<?php echo $session->get_I18n(); ?>">
<head>
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery.validate.js"></script>
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery.validate.password.js"></script>
<link href="/skins/common/main.css" type="text/css" rel="stylesheet"/>
<style type="text/css">
.error{
color:red;
font-weight:bold;
}
h1{
font-weight:bold;
color:#404040;
font-size:16px;
margin:5px 0;
}
body{
overflow:auto;
}
.NEW{color:red;}
#form div{
position:relative;
float:left;
width:100%;
}
ul{
position:relative;
float:left;
width:100%;
list-style-type:none;
width:100%;
}
li{
position:relative;
float:left;
width:100%;
}
#form li div.input
{
width:200px;
}
#form li div.input input,
#form li div.input textarea,
#form li div.input select
{
width:180px;
}
#form li div.input input.checkbox
{
width:auto;
}
#form li div.label
{
width:350px;
}
</style>
</head>
<body>
<div>
Adresse : <input type="text" readonly="readonly" value="<?php echo $registry->get('GV_ServerName'); ?>"/>
</div>
<div>
Installation : <input type="text" readonly="readonly" value="<?php echo $registry->get('GV_RootPath'); ?>"/>
</div>
<div>
Maintenance : <input type="checkbox" readonly="readonly" disabled="disabled" <?php echo $registry->get('GV_maintenance') == true ? "checked='checked'" : ''; ?>/>
</div>
<div>
Debug : <input type="checkbox" readonly="readonly" disabled="disabled" <?php echo $registry->get('GV_debug') == true ? "checked='checked'" : ''; ?>/>
</div>
<form class="form-horizontal" id="GV_form_head">
<div class="control-group">
<label class="control-label">Adresse : </label>
<div class="controls">
<input type="text" class="input-xlarge" readonly="readonly" value="<?php echo $registry->get('GV_ServerName'); ?>"/>
</div>
</div>
<div class="control-group">
<label class="control-label">Installation : </label>
<div class="controls">
<input type="text" class="input-xlarge" readonly="readonly" value="<?php echo $registry->get('GV_RootPath'); ?>"/>
</div>
</div>
<div class="control-group">
<label class="control-label">Maintenance : </label>
<div class="controls">
<input type="checkbox" readonly="readonly" disabled="disabled" <?php echo $registry->get('GV_maintenance') == true ? "checked='checked'" : ''; ?>/>
</div>
</div>
<div class="control-group">
<label class="control-label">Debug : </label>
<div class="controls">
<input type="checkbox" readonly="readonly" disabled="disabled" <?php echo $registry->get('GV_debug') == true ? "checked='checked'" : ''; ?>/>
</div>
</div>
</form>
<?php
$rules = array();
echo '<form id="form" method="post" action = "global_values.php">';
echo '<form id="GV_form" class="form-horizontal" method="post" action = "global_values.php">';
foreach ($GV as $section) {
echo '<div style="">';
echo '<div class="section" style="">';
echo '<h1>' . $section['section'] . '</h1>';
echo '<ul>';
foreach ($section['vars'] as $value) {
$readonly = false;
if (isset($value['readonly']) && $value['readonly'] === true)
@@ -166,8 +114,8 @@ foreach ($GV as $section) {
case 'boolean':
$input = '
<input class="checkbox" ' . ($readonly ? 'readonly="readonly"' : '') . ' ' . ( $currentValue == '0' ? 'checked="selected"' : '' ) . ' type="radio" name="' . $value['name'] . '" value="False" id="id_' . $value['name'] . '_no" /><label for="id_' . $value['name'] . '_no">False</label>
<input class="checkbox" ' . ($readonly ? 'readonly="readonly"' : '') . ' ' . ( $currentValue == '1' ? 'checked="checked"' : '' ) . ' type="radio" name="' . $value['name'] . '" value="True" id="id_' . $value['name'] . '_yes" /><label for="id_' . $value['name'] . '_yes">True</label>
<label class="radio inline" for="id_' . $value['name'] . '_no"><input ' . ($readonly ? 'readonly="readonly"' : '') . ' ' . ( $currentValue == '0' ? 'checked="selected"' : '' ) . ' type="radio" name="' . $value['name'] . '" value="False" id="id_' . $value['name'] . '_no" />False</label>
<label class="radio inline" for="id_' . $value['name'] . '_yes"><input ' . ($readonly ? 'readonly="readonly"' : '') . ' ' . ( $currentValue == '1' ? 'checked="checked"' : '' ) . ' type="radio" name="' . $value['name'] . '" value="True" id="id_' . $value['name'] . '_yes" />True</label>
';
break;
case 'string':
@@ -189,9 +137,9 @@ foreach ($GV as $section) {
case 'enum_multi':
if (isset($value['available']) && is_array($value['available'])) {
foreach ($value['available'] as $k => $v)
$input .= '<input class="checkbox" type="checkbox" name="' . $value['name'] . '[]" ' . ($readonly ? 'readonly="readonly"' : '') . ' value="' . $k . '" ' . ( ( ! is_array($currentValue) || in_array($k, $currentValue)) ? 'checked="checked"' : '' ) . '/><label>' . $v . '</label><br>';
$input .= '<label class="checkbox"><input type="checkbox" name="' . $value['name'] . '[]" ' . ($readonly ? 'readonly="readonly"' : '') . ' value="' . $k . '" ' . ( ( ! is_array($currentValue) || in_array($k, $currentValue)) ? 'checked="checked"' : '' ) . '/>' . $v . '</label>';
} else {
echo '<p style="color:red;">erreur avec la valeur ' . $value['name'] . '</p>';
echo '<p class="error">erreur avec la valeur ' . $value['name'] . '</p>';
}
break;
case 'list':
@@ -215,18 +163,16 @@ foreach ($GV as $section) {
}
$isnew = $registry->is_set($value['name']);
echo ' <li>
<div class="input">' . $input . '</div>
<div class="label"><span class="NEW">' . ($isnew === false ? 'NEW' : '') . '</span><label for="id_' . $value['name'] . '">' . $value['comment'] . '</label></div>
</li>';
echo ' <div class="control-group">
<div class="controls">' . $input . '</div>
<label class="control-label" for="id_' . $value['name'] . '"><span class="NEW">' . ($isnew === false ? 'NEW' : '') . '</span>' . $value['comment'] . '</label>
</div>';
if (isset($value['required'])) {
$rules[$value['name']] = array('required' => $value['required']);
$messages[$value['name']] = array('required' => 'Ce champ est requis !');
}
}
echo '</ul>';
if (isset($section['javascript'])) {
echo "<div><input type='button' onclick='" . $section['javascript'] . "(this);' value='Tester'/></div>";
}
@@ -237,7 +183,7 @@ foreach ($GV as $section) {
$JS = '$(document).ready(function() {
// validate signup form on keyup and submit
$("#form").validate({
$("#GV_form").validate({
rules: ' . p4string::jsonencode($rules) . ',
messages: ' . p4string::jsonencode($messages) . ',
errorPlacement: function(error, element) {
@@ -247,11 +193,9 @@ $JS = '$(document).ready(function() {
});
';
?>
<input type="submit" value="<?php echo _('boutton::valider') ?>"/>
<input type="submit" class="btn btn-warning" style="margin-bottom: 10px;" value="<?php echo _('boutton::valider') ?>"/>
</form>
<script type='text/javascript'>
<?php echo $JS ?>
</script>
</body>
</html>

View File

@@ -1,249 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2012 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
/* @var $Core \Alchemy\Phrasea\Core */
$Core = require_once __DIR__ . "/../../lib/bootstrap.php";
$appbox = appbox::get_instance($Core);
$session = $appbox->get_session();
?>
<style type="text/css">
#tooltip{
position:absolute;
}
</style>
<script type="text/javascript">
$(document).ready(
function(){
$('.usrTips').tooltip();
}
);
</script>
<div style="margin:20px 0;text-align:center;">
<div style="font-size:14px"><u><b><?php echo _('admin::utilisateurs: utilisateurs connectes') ?> - <?php echo date("G:i:s") ?></b></u></div>
</div>
<?php
$appLaunched = array(
'0' => 0
, '1' => 0
, '2' => 0
, '3' => 0
, '4' => 0
, '5' => 0
, '6' => 0
, '7' => 0
, '8' => 0
);
$out = "";
$out.="<center>\n";
$out.="<table class='admintable' >\n";
$out.=" <thead><tr>\n";
$out.=" <th style=\"width:140px;\" >" . _('admin::monitor: utilisateur') . "</th>";
$out.=" <th style=\"width:100px;\" >" . _('admin::monitor: modules') . "</th>";
$out.=" <th style=\"width:120px;\" >" . _('phraseanet:: adresse') . "</th>";
$out.=" <th style=\"width:140px;\" >" . _('admin::monitor: date de connexion') . "</th>";
$out.=" <th style=\"width:140px;\" >" . _('admin::monitor: dernier access') . "</th>";
$out.=" </tr>
</thead><tbody>";
$n = 0;
foreach (Session_Handler::get_active_sessions() as $row) {
$onedetail = "<span style=\"position:relative; top:0px;left:0px;\">";
$onedetail.=" <table cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed;width:300px; border:#000000 1px solid;\" id=\"tabledescexp\" >";
$onedetail.=" <tr class=\"noborder\" style=\"border:0px\">";
$onedetail.=" <td class=\"noborder\" style=\"border:0px;width:160px;\" valign=\"center\" />";
$onedetail.=" <td class=\"noborder\" style=\"border:0px;width:200px;\" valign=\"center\" />";
$onedetail.=" </tr>";
$onedetail.=" <tr style=\"border:0px\">";
$onedetail.=" <td colspan=\"2\" class=\"noborder\" style=\"height:20px;text-align:center;background-color:#666666; color:#FFFFFF;font-size:12px\" valign=\"center\" >usr_id : <b>" . $row['usr_id']->get_id() . "</b></td>";
$onedetail.=" </tr>";
$onedetail.=" <tr style=\"border:0px\">";
$onedetail.=" <td class=\"noborder\" style=\"border:0px;\" valign=\"top\" />";
$onedetail.=" <table class=\"noborder\" valign=\"top\" >";
$onedetail.=" <tr class=\"noborder\" >";
$onedetail.=" <td class=\"noborder\"class=\"noborder\" style=\"text-align:left\" >" . _('admin::compte-utilisateur nom') . ' : ' . $row['usr_id']->get_display_name() . "</td>";
$onedetail.=" </tr>";
$onedetail.=" <tr class=\"noborder\" >";
$onedetail.=" <td class=\"noborder\"class=\"noborder\" style=\"text-align:left\" >" . _('admin::compte-utilisateur societe') . ' : ' . $row['usr_id']->get_company() . "</td>";
$onedetail.=" </tr>";
$onedetail.=" <tr class=\"noborder\" >";
$onedetail.=" <td class=\"noborder\"class=\"noborder\" style=\"text-align:left\" >" . _('admin::compte-utilisateur telephone') . ' : ' . $row['usr_id']->get_tel() . "</td>";
$onedetail.=" </tr>";
$onedetail.=" <tr class=\"noborder\" >";
$onedetail.=" <td class=\"noborder\"class=\"noborder\" style=\"text-align:left\" >" . _('admin::compte-utilisateur email') . ' : ' . $row['usr_id']->get_email() . "</td>";
$onedetail.=" </tr>";
$onedetail.=" </table>";
$onedetail.=" </td>";
$onedetail.=" <td style=\"border:0px;width:160px;border-left:#cccccc 1px solid;\" valign=\"top\" />";
$onedetail.=" <table class=\"noborder\" valign=\"top\" >";
$onedetail.=" <tr>";
$onedetail.=" <td class=\"noborder\" style=\"text-align:left\" >" . _('admin::monitor: bases sur lesquelles l\'utilisateur est connecte : ') . "</td>";
$onedetail.=" </tr>";
foreach ($row['usr_id']->ACL()->get_granted_sbas() as $databox) {
$onedetail.=" <tr>";
$onedetail.=" <td class=\"noborder\" style=\"text-align:left;width:160px;overflow:hidden;\" >" . $databox->get_viewname() . "</td>";
$onedetail.=" </tr>";
}
$onedetail.=" </table>";
$onedetail.=" </td>";
$onedetail.=" </tr>";
$onedetail.=" <tr style=\"border:0px\">";
$onedetail.=" <td colspan=\"2\" style=\"height:20px;text-align:center;background-color:#666666; color:#FFFFFF\" valign=\"center\" >" .
$row['platform'] . ' / ' . $row['browser'] . ' - ' . $row['browser_version'] . '<br/>' . ($row['token'] ? _('Session persistente') : '') .
"</td>";
$onedetail.=" </tr>";
$onedetail.=" </table>";
$onedetail.="</span>";
$out.="<tr title=\"" . str_replace('"', '&quot;', $onedetail) . "\" class='" . ($n % 2 == 0 ? 'even' : 'odd') . " usrTips' id=\"TREXP_" . $row["session_id"] . "\">";
if ($row["session_id"] == $session->get_ses_id())
$out.=sprintf("<td style=\"color:#ff0000\"><i>" . $row['usr_id']->get_display_name() . "</i></td>\n");
else
$out.=sprintf("<td>" . $row['usr_id']->get_display_name() . "</td>\n");
$appRef = array(
'0' => _('admin::monitor: module inconnu')
, '1' => _('admin::monitor: module production')
, '2' => _('admin::monitor: module client')
, '3' => _('admin::monitor: module admin')
, '4' => _('admin::monitor: module report')
, '5' => _('admin::monitor: module thesaurus')
, '6' => _('admin::monitor: module comparateur')
, '7' => _('admin::monitor: module validation')
, '8' => _('admin::monitor: module upload')
);
$row["app"] = unserialize($row["app"]);
$out.= "<td>";
foreach ($row["app"] as $app) {
if (isset($appLaunched[$app]))
$appLaunched[$app] ++;
if ($app == '0')
continue;
$out .= ( isset($appRef[$app]) ? $appRef[$app] : $appRef[0]) . '<br>';
}
$out .= "</td>\n";
$out.=sprintf("<td>" . $row["ip"] . '<br/>' . $row["ip_infos"] . "</td>\n");
$out.=sprintf("<td>" . phraseadate::getDate($row['created_on']) . "</td>\n");
$out.=sprintf("<td>" . phraseadate::getPrettyString($row['lastaccess']) . "</td>\n");
$out.="</tr>\n";
$n ++;
}
$out.="</tbody></table>\n";
echo "<center>";
echo "<table style=\"table-layout:fixed;border:#000000 1px solid\">";
echo "<tr>";
echo " <td class=\"colTitle\" nowrap style=\"width:120px;text-align:left;\" >" . _('admin::monitor: module production') . "</td>";
echo " <td class=\"noborder\" nowrap style=\"width:60px;text-align:right\" >" . $appLaunched[1] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"colTitle\" nowrap style=\"width:120px;text-align:left;\" >" . _('admin::monitor: module client') . "</td>";
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[2] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"colTitle\" style=\"text-align:left\">" . _('admin::monitor: module admin') . "</td>";
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[3] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"colTitle\" style=\"text-align:left\">" . _('admin::monitor: module report') . "</td>";
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[4] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"colTitle\" style=\"text-align:left\">" . _('admin::monitor: module thesaurus') . "</td>";
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[5] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"colTitle\" style=\"text-align:left\">" . _('admin::monitor: module comparateur') . "</td>";
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[6] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"colTitle\" style=\"text-align:left\">" . _('admin::monitor: module validation') . "</td>";
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[7] . "</td>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo " <td class=\"noborder\" colspan=\"2\" style=\"position:relative; background-color:#333333; height:1px; top:0px; overflow:none;\" />";
echo "</tr>";
if ($appLaunched[0] > 0) {
echo "<tr class=\"noborder\">";
echo "<td class=\"noborder\" colspan=\"2\"/>";
echo "</tr>";
echo "<tr class=\"noborder\">";
echo "<td class=\"colTitle\" style=\"text-align:left\">" . _('admin::monitor: total des utilisateurs uniques : ');
echo " <td class=\"noborder\" style=\"text-align:right\">" . $appLaunched[0] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "</center>";
echo "<br><br><hr><br><br>";
echo $out;

View File

@@ -15,6 +15,7 @@
*/
/* @var $Core \Alchemy\Phrasea\Core */
$Core = require_once __DIR__ . "/../../lib/bootstrap.php";
$appbox = appbox::get_instance($Core);
$session = $appbox->get_session();
$registry = $appbox->get_registry();
@@ -23,129 +24,22 @@ $usr_id = $session->get_usr_id();
phrasea::headers();
$request = http_request::getInstance();
$parm = $request->get_parms("act", "p0", "p1", 'flush_cache', 'sudo', 'admins', 'email');
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
if ( ! $user->is_admin()) {
phrasea::headers(403);
}
$request = http_request::getInstance();
$parm = $request->get_parms("act", "p0", "p1", 'flush_cache', 'sudo', 'admins', 'email');
$cache_flushed = false;
if ($parm['flush_cache']) {
$Core = \bootstrap::getCore();
$Core['CacheService']->flushAll();
$cache_flushed = true;
}
?>
<html lang="<?php echo $session->get_I18n(); ?>">
<head>
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/jquery-ui-1.8.17/css/ui-lightness/jquery-ui-1.8.17.custom.css,skins/common/main.css,skins/admin/admincolor.css" />
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
<style type="text/css">
body
{
}
A, A:link, A:visited, A:active
{
color : #000000;
padding-bottom : 15px;
text-decoration:none;
}
A:hover
{
COLOR : #ba36bf;
text-decoration:underline;
}
h1{
position:relative;
float:left;
width:100%;
}
ul.setup {
position:relative;
float:left;
width:360px;
list-style-type:none;
padding:0 0 0 0px;
margin:5px 0 5px 40px;
border:1px solid #404040;
}
ul.setup table{
width:100%;
table-layout: fixed;
}
.setup li{
margin:0px 0;
padding:2px 5px 2px 30px;
background-image:url(/skins/icons/ok.png);
background-repeat:no-repeat;
background-position:5px center;
}
.setup li.non-blocker{
background-image:url(/skins/icons/alert.png);
}
.setup li.blocker{
background-image:url(/skins/icons/delete.png);
}
tr.even{
background-color:#CCCCCC;
}
#flush_button {
width:360px;
margin: 5px 0 5px 40px;
}
</style>
<style>
.ui-autocomplete {
max-height: 200px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 200px;
}
.ui-autocomplete-loading { background: white url('/skins/icons/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(document).ready(function(){
$( ".admin_adder" ).autocomplete({
source: "/admin/users/typeahead/search/",
minLength: 2,
select: function( event, ui ) {
var form = $('#admin_adder');
$('input.new[name="admins[]"]', form).val(ui.item.id);
form.submit();
}
}).data( "autocomplete" )._renderItem = function( ul, item ) {
var email = item.email ? '<br/>'+item.email : '';
var login = item.login != item.name ? " ("+ item.login +")" : '';
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.name + login + email + "</a>" )
.appendTo( ul );
};
});
</script>
</head>
<body>
<?php
if ($parm['sudo']) {
if ($parm['sudo'] == '1') {
User_Adapter::reset_sys_admins_rights();
@@ -171,158 +65,47 @@ if ($parm['admins']) {
}
}
if ($cache_flushed) {
?>
<div>
<?php echo _('all caches services have been flushed'); ?>
</div>
<?php
}
?>
<div>
<h1><?php echo _('setup:: administrateurs de l\'application') ?></h1>
<form id="admin_adder" action="sitestruct.php" method="post">
<?php
$admins = User_Adapter::get_sys_admins();
foreach ($admins as $usr_id => $usr_login) {
?>
<div><input name="admins[]" type="checkbox" value="<?php echo $usr_id ?>" id="adm_<?php echo $usr_id ?>" checked /><label for="adm_<?php echo $usr_id ?>"><?php echo $usr_login; ?></label></div>
<?php
try {
$engine = new searchEngine_adapter($registry);
$search_engine_status = $engine->get_status();
} catch(Exception $e) {
$search_engine_status = null;
}
?>
<div><?php echo _('setup:: ajouter un administrateur de l\'application') ?></div>
<input class="admin_adder"/>
<input type="hidden" class="new" name="admins[]"/>
<input type="submit" value="<?php echo _('boutton::valider') ?>" />
</form>
<h1><?php echo _('setup:: Reinitialisation des droits admins') ?></h1>
$php_version_constraints = setup::check_php_version();
$writability_constraints = setup::check_writability($registry);
$binaries_constraints = setup::check_binaries($registry);
$php_extension_constraints = setup::check_php_extension();
$cache_constraints = setup::check_cache_server();
$phrasea_constraints = setup::check_phrasea();
$cache_opcode_constraints = setup::check_cache_opcode();
$php_configuration_constraints = setup::check_php_configuration();
<form action="sitestruct.php" method="post">
<input type="hidden" name="sudo" value="1" />
<input type="submit" value="<?php echo _('boutton::reinitialiser') ?>" />
</form>
</div>
<h1><?php echo _('setup:: Reglages generaux') ?></h1>
<br>
<h2><?php echo _('setup::Votre configuration') ?></h2>
<div>
<div style="position:relative;float:left;width:400px;">
<?php
setup::check_mail_form();
$email_status = null;
if ($parm['email']) {
echo 'result : ';
var_dump(mail::mail_test($parm['email']));
if(mail::mail_test($parm['email'])) {
$email_status = _('Mail sent');
} else {
$email_status = _('Could not send email');
}
}
$php_constraints = setup::check_php_version();
$parameters = array(
'cache_flushed' => $cache_flushed,
'admins' => User_Adapter::get_sys_admins(),
'email_status' => $email_status,
'search_engine_status' => $search_engine_status,
'php_version_constraints' => $php_version_constraints,
'writability_constraints' => $writability_constraints,
'binaries_constraints' => $binaries_constraints,
'php_extension_constraints' => $php_extension_constraints,
'cache_constraints' => $cache_constraints,
'phrasea_constraints' => $phrasea_constraints,
'cache_opcode_constraints' => $cache_opcode_constraints,
'php_configuration_constraints' => $php_configuration_constraints,
);
foreach ($php_constraints as $php_constraint) {
echo '<h1>' . $php_constraint->get_name() . '</h1>';
echo '<ul class="setup">';
?>
<li class="<?php echo $php_constraint->is_ok() ? 'good-enough' : 'blocker'; ?>">
<?php echo $php_constraint->get_message(); ?>
</li>
<?php
echo '</ul>';
}
$Core['Twig']->display('admin/dashboard.html.twig', $parameters);
$php_constraints = setup::check_writability($registry);
echo '<h1>' . _('setup::Filesystem configuration') . '</h1>';
echo '<ul class="setup">';
foreach ($php_constraints as $constraint) {
?>
<li class="<?php echo ! $constraint->is_ok() ? ($constraint->is_blocker() ? 'blocker' : 'non-blocker') : 'good-enough'; ?>">
<?php echo $constraint->get_message(); ?>
</li>
<?php
}
echo '</ul>';
$php_constraints = setup::check_binaries($registry);
echo '<h1>' . _('setup::Executables') . '</h1>';
echo '<ul class="setup">';
foreach ($php_constraints as $constraint) {
?>
<li class="<?php echo ! $constraint->is_ok() ? ($constraint->is_blocker() ? 'blocker' : 'non-blocker') : 'good-enough'; ?>">
<?php echo $constraint->get_message(); ?>
</li>
<?php
}
echo '</ul>';
$php_constraints = setup::check_php_extension();
echo '<h1>' . _('setup::PHP extensions') . '</h1>';
echo '<ul class="setup">';
foreach ($php_constraints as $constraint) {
?>
<li class="<?php echo ! $constraint->is_ok() ? ($constraint->is_blocker() ? 'blocker' : 'non-blocker') : 'good-enough'; ?>">
<?php echo $constraint->get_message(); ?>
</li>
<?php
}
echo '</ul>';
$php_constraints = setup::check_cache_server();
echo '<h1>' . _('setup::Serveur de cache') . '</h1>';
echo '<ul class="setup">';
foreach ($php_constraints as $constraint) {
?>
<li class="<?php echo ! $constraint->is_ok() ? ($constraint->is_blocker() ? 'blocker' : 'non-blocker') : 'good-enough'; ?>">
<?php echo $constraint->get_message(); ?>
</li>
<?php
}
echo '</ul>';
?>
</div>
<div style="position:relative;float:left;width:400px;margin-left:25px;">
<?php
$php_constraints = setup::check_phrasea();
echo '<h1>' . _('Phrasea Module') . '</h1>';
echo '<ul class="setup">';
foreach ($php_constraints as $constraint) {
?>
<li class="<?php echo ! $constraint->is_ok() ? ($constraint->is_blocker() ? 'blocker' : 'non-blocker') : 'good-enough'; ?>">
<?php echo $constraint->get_message(); ?>
</li>
<?php
}
echo '</ul>';
setup::check_apache();
setup::check_mod_auth_token();
setup::check_cache_opcode();
setup::check_cache_memcache();
if ($Core->getCache()->isServer()) {
?>
<form method="post" action="sitestruct.php">
<input type="hidden" name="flush_cache" value="1"/>
<input id="flush_button" type="submit" value="Flush All Caches" />
</form>
<?php
}
echo '<h1>' . _('OPCode cache') . '</h1>';
echo '<ul class="setup">';
if ($Core['OpcodeCache']->getName() == 'array') {
echo '<li class="non-blocker">' . _('Array opcode cache is activated, but phrasea strongly recommand the use of APC or Xcache in production') . '</li>';
} else {
echo '<li>' . $Core['OpcodeCache']->getName() . '</li>';
}
echo '</ul>';
setup::check_sphinx_search();
setup::check_php_configuration();
?>
</div>
</div>
</body>
</html>
return;

View File

@@ -1,161 +0,0 @@
body{
background-color:white;
color:#000000;
overflow-y:auto;
}
a{
color:#000000;
text-decoration:underline;
cursor:pointer;
}
a:hover{
color:#000000;
text-decoration:underline;
cursor:pointer;
}
div.finder div.content div.title
{
left:0;
margin-top:-2px;
overflow:hidden;
position:relative;
top:0;
white-space:nowrap;
}
#mainMenu{
background-color:#fceb3f;
}
#mainMenu a, #mainMenu b,
#mainMenu .title{
color:#000000;
}
.treeview ul{
background-color:transparent;
}
img{
vertical-align:middle
}
/**
FFFA00 9E9C3C 777400 FFFC65 FFFEB5
**/
#left{
background-color:#fffbcd;
overflow:auto;
}
#FNDR{
overflow:auto;
}
#mainMenu span{
color:black;
}
#mainMenu span.selected {
border-top: 3px solid black;
}
#mainMenu a:hover span{
background-color:#FFFBCD;
}
h1{
font-weight: bold;
font-size:24px;
text-align:left;
margin:10px 0;
}
h2{
font-weight: bold;
font-size:18px;
text-align:left;
margin:7px 0;
}
h3{
font-weight: bold;
font-size:14px;
text-align:left;
margin:4px 0;
}
h4{
font-weight: bold;
font-size:12px;
text-align:left;
margin:2px 0;
}
.admin_head_opts{
margin:5px 0;
}
.admin_head_opts span{
margin:0px 10px;
}
table.admintable{
width:100%;
border:none;
margin:10px 0;
}
table.admintable thead{
background-color:#e5d4a0;
}
table.admintable thead th{
text-align:left;
font-weight:bold;
}
table.admintable tr{
height:28px;
vertical-align: middle;
}
table.admintable tbody tr.even{
background-color:#fffbcd;
}
table.admintable tbody tr.selected{
background-color: #f0ad30;
}
table.admintable tbody .dropdown{
cursor:pointer;
}
#users_check_uncheck{
}
#users_check_uncheck div{
padding:5px 10px;
background-color:#CCCCCC;
color:black;
cursor:pointer
}
#users_check_uncheck div.hovered{
padding:5px 10px;
background-color:#555555;
color:white;
}
.users_col.options{
cursor:pointer;
color:#AFAFAF;
}
#users th.sortable span{
margin:0 5px;
}
#users th.sortable{
cursor:pointer;
}
#users th.sortable.hover,
#users th.sortable.sorted{
background-color:#F0AD30;
}
#users th.sortable span.ord_notifier{
display:none;
}
#users th.sortable.sorted span.ord_notifier{
display:inline;
}

View File

@@ -0,0 +1,73 @@
/******* DATABASES ************************************************************/
.db_recommand {
color: #333333;
font-weight: bold;
}
.db_exception {
margin-top: 10px;
background-color: #fceb3f;
}
.db_infos {
width: 100%;
padding-bottom: 10px;
}
.db_infos h2 {
line-height: 22px;
}
.db_infos input[type="text"],
.db_infos input[type="password"],
.db_infos input[type="submit"],
.db_infos select,
.db_infos textarea,
.db_infos ul {
margin-bottom: 9px;
}
/******* DATABASE *************************************************************/
.db_box {
margin: 0 10px 10px;
}
.db_box p {
margin: 0 0 9px;
}
#INDEX_P_BAR p {
margin: 0;
padding: 0;
}
div[id$="_indexed_bar"] {
width: 0;
height: 15px;
position: absolute;
z-index: 6;
background: #e5d4a0;
}
div[id$="_indexed_percent"] {
width: 198px;
height: 13px;
position: absolute;
z-index: 10;
border: 1px solid #333333;
line-height: 15px;
text-align: center;
}
.logo_box {
margin: 0 10px 10px;
}
.logo_box hr {
border-top: 1px solid #cccccc;
margin-bottom: 10px;
}
.logo_box div[id^="printLogoDIV_"] {
margin: 0 0 5px 0;
display: none;
}
/******* DATABASE - FIELDS ****************************************************/
#field_adder .help-block label {
color: #666666;
}
#form_struct {
margin: 10px 0;
}
#form_struct thead tr th:not(:first-child) {
min-width: 70px;
text-align: center;
}

View File

@@ -0,0 +1,314 @@
/******* GLOBAL CSS for ADMIN *************************************************/
body {
margin: 0;
padding: 0;
background-color: #ffffff;
color: #333333;
overflow-y: auto;
}
.clear {
clear: both;
}
h1 {
font-weight: bold;
font-size: 24px;
text-align: left;
margin: 10px 0;
}
h2 {
font-weight: bold;
font-size: 18px;
text-align: left;
margin: 7px 0;
}
h3 {
font-weight: bold;
font-size: 14px;
text-align: left;
margin: 4px 0;
}
h4 {
font-weight: bold;
font-size: 12px;
text-align: left;
margin: 2px 0;
}
a {
color: #333333;
text-decoration: underline;
cursor: pointer;
}
a:hover {
color: #0088cc;
text-decoration: underline;
cursor: pointer;
}
blockquote {
margin: 20px 15px;
padding: 10px;
border: 1px dotted #000000;
background-color: #f2f2f2;
}
img {
vertical-align: middle;
}
input,
textarea,
.uneditable-input {
margin: 0;
padding: 4px;
}
select {
margin: 0;
padding: 5px 4px;
*padding: 4px;
}
.help-block,
.help-inline {
color: #666666;
}
li.selected,
div.selected {
background-color: #faa732;
color: #ffffff;
}
li.selected a,
div.selected a {
background-color: #faa732;
color: #ffffff;
}
.treeview ul {
background-color: transparent;
}
#right-ajax.loading {
background-image: url('/skins/icons/loaderFFF.gif');
background-repeat: no-repeat;
background-position: center center;
}
div.finder div.content div.title {
margin-top: -2px;
position: relative;
top: 0;
left: 0;
white-space: nowrap;
overflow: hidden;
}
/******* MAIN MENU ************************************************************/
#mainMenu {
background-color: #fceb3f;
}
#mainMenu a,
#mainMenu b,
#mainMenu .title,
#mainMenu span {
color: #000000;
}
#mainMenu a:hover span {
background-color: #fffbcd;
}
#mainMenu span.selected {
border-top: 3px solid #000000;
}
/******* LEFT SIDE ************************************************************/
#left {
background-color: #fffbcd;
overflow: auto;
}
#FNDR {
overflow: auto;
}
#FNDR li.selected {
background-color: #faa732;
color: #ffffff;
}
#FNDR a {
text-decoration: none;
}
#FNDR a:hover {
text-decoration: none;
}
#FNDR a span {
text-decoration: underline;
}
#FNDR a span:hover {
text-decoration: underline;
}
/******* USERS ****************************************************************/
.admin_head_opts {
margin: 5px 0 10px 0;
}
.admin_head_opts span {
margin: 0 10px;
}
.admin_head_opts a {
margin: 0 5px;
}
#users_page_form p {
margin: 5px 5px 10px;
}
#users_page_form .input-mini {
width: 30px;
}
#users_check_uncheck div {
padding: 5px 10px;
background-color: #cccccc;
color: #000000;
cursor: pointer;
}
#users_check_uncheck div.hovered {
padding: 5px 10px;
background-color: #4d4d4d;
color: #ffffff;
}
/******* EDIT USERS ***********************************************************/
div.no_switch {
width: 12px;
height: 12px;
margin: 0 auto;
background-image: url('/skins/icons/ccoch5.gif');
background-repeat: no-repeat;
background-position: center center;
}
div.switch_quota,
div.switch_masks,
div.switch_time,
div.switch_right {
width: 12px;
height: 12px;
margin: 0 auto;
}
div.switch_quota.mixed,
div.switch_masks.mixed,
div.switch_time.mixed,
div.switch_right.mixed {
background-image: url('/skins/icons/ccoch2.gif');
background-repeat: no-repeat;
background-position: center center;
}
div.switch_quota.checked,
div.switch_masks.checked,
div.switch_time.checked,
div.switch_right.checked {
background-image: url('/skins/icons/ccoch1.gif');
background-repeat: no-repeat;
background-position: center center;
}
div.switch_quota.unchecked,
div.switch_masks.unchecked,
div.switch_time.unchecked,
div.switch_right.unchecked {
background-image: url('/skins/icons/ccoch0.gif');
background-repeat: no-repeat;
background-position: center center;
}
.ui-datepicker {
z-index: 1500;
}
/******* BOARD ****************************************************************/
.board_section {
margin: 0 0 30px;
}
.board_section ul,
.board_section #mail_checker {
margin: 0 0 20px 15px;
}
.board_section div[class^="section_"] {
width: 400px;
height: auto;
}
.board_section div[class^="section_"] h2 {
line-height: 24px;
}
.board_section div[class^="section_"] ul.setup {
width: 360px;
border: 1px solid #cccccc;
list-style-type: none;
}
.board_section div[class^="section_"] ul.setup li {
padding: 2px 5px 2px 30px;
background-image: url(/skins/icons/ok.png);
background-repeat: no-repeat;
background-position: 5px center;
}
.board_section div[class^="section_"] ul.setup li.non-blocker {
background-image: url(/skins/icons/alert.png);
}
.board_section div[class^="section_"] ul.setup li.blocker {
background-image: url(/skins/icons/delete.png);
}
.board_section div[class^="section_"] ul.setup li:hover {
background-color: #fffbcd;
}
.board_section div[class^="section_"] #cache_flusher {
margin: -10px 0 20px 0;
}
.board_section .section_left {
float: left;
}
.board_section .section_right {
margin-left: 430px;
padding-top: 1px;
}
.board_section #flush_button {
width: 362px;
margin-left: 15px;
}
/******* PUBLICATIONS *********************************************************/
.form_publication .controls {
margin-left: 10px;
}
#pub_icon {
width: 42px;
height: 42px;
float: left;
}
#pub_icon .thumb_wrapper {
width: 32px;
height: 32px;
margin: 5px auto;
}
#pub_icon .thumb_wrapper img {
width: 32px;
height: 32px;
}
#pub_fileupload {
height: 42px;
line-height: 42px;
margin-left: 47px;
}
/******* GLOBAL VALUES FORM ***************************************************/
#GV_form_head .control-label {
width: 100px;
text-align: left;
}
#GV_form_head .controls {
margin-left: 110px;
}
#GV_form_head .controls input[type="checkbox"] {
margin-top: 8px;
}
#GV_form .error,
#GV_form .NEW {
color: #ff0000;
font-weight: bold;
}
#GV_form .section {
padding-bottom: 10px;
}
#GV_form .section h1 {
font-weight: bold;
font-size: 16px;
text-align: left;
margin: 10px 0;
line-height: 22px;
}
#GV_form .section .control-label {
width: auto;
margin-left: 230px;
float: none;
text-align: left;
}
#GV_form .section .controls {
margin-left: 0;
float: left;
}

View File

@@ -0,0 +1,136 @@
/******* TABLES ***************************************************************/
div.center {
width: 100%;
margin: auto;
}
.tableTitle {
margin: 20px auto;
font-weight: bold;
font-size: 14px;
text-align: center;
text-decoration: underline;
}
table.whoisTable {
margin: auto;
border: #000000 1px solid;
table-layout: fixed;
}
table.whoisTable tr {
border: #cccccc 1px solid;
}
table.whoisTable tr:hover {
background-color: #fffbcd;
}
table.whoisTable td {
padding: 3px;
}
table.whoisTable td.colTitle {
width: 120px;
text-align: left;
}
table.whoisTable td.colValue {
width: 60px;
text-align: right;
}
.spacehr {
margin-top: 40px;
margin-bottom: 30px;
border-top: 1px solid #cccccc;
}
table.admintable {
width: 100%;
margin: 10px 0;
border: none;
}
table.admintable tr {
height: 28px;
vertical-align: middle;
}
table.admintable tr.selected:hover {
background-color: #faa732;
}
table.admintable thead {
background-color: #e5d4a0;
}
table.admintable thead th {
padding: 3px;
text-align: left;
font-weight: bold;
}
table.admintable tbody tr.even {
background-color: #fffbcd;
}
table.admintable tbody tr.selected {
background-color: #faa732;
}
table.admintable tbody tr:hover {
background-color: #faa732;
cursor: pointer;
}
table.admintable tbody td {
padding: 3px;
}
table.admintable tbody.dropdown {
cursor: pointer;
}
table.admintable .centered {
text-align: center;
}
/******* USERS TABLE **********************************************************/
#users th.sortable {
cursor: pointer;
}
#users th.sortable span {
margin: 0 5px;
}
#users th.sortable span.ord_notifier {
display: none;
}
#users th.sortable.hover {
background-color: #faa732;
}
#users th.sortable.sorted {
background-color: #faa732;
}
#users th.sortable.sorted span.ord_notifier {
display: inline;
}
/******* EDIT-USERS TABLE *****************************************************/
td.users_col {
width: 23px;
border: 0px solid transparent;
vertical-align: middle;
text-align: center;
}
td.users_col.options {
color: #afafaf;
cursor: pointer;
}
/******* TOOLTIP CONNECTED USERS **********************************************/
#tooltip-usr {
position: relative;
top: 0;
left: 0;
color: #333333;
}
#tooltip-usr #tabledescexp {
table-layout: fixed;
width: 300px;
}
#tooltip-usr #tabledescexp td {
border: none;
text-align: left;
}
#tooltip-usr #tabledescexp td strong {
font-weight: bold;
}
#tooltip-usr #tabledescexp td.tooltip-title {
background-color: #faa732;
border: 1px solid #f39106;
margin: 10px auto;
font-weight: bold;
font-size: 14px;
text-align: center;
text-decoration: none;
color: #ffffff;
}

7
www/skins/admin/csscompiler.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for i in $( ls less ); do
lessc $DIR/less/$i $DIR/css/`echo $i | sed -e 's/less/css/g'`
done

View File

@@ -0,0 +1,128 @@
//****** LESS SETTINGS ********************************************************/
// Colors & bg settings
@white: #FFF;
@black: #000;
@dark: #333;
@grey: #CCC;
@blue: #0088CC;
@red: #F00;
@orange: #FAA732; //F0AD30;
@lemon: #FCEB3F;
@sand: #FFFBCD;
@dk-sand: #E5D4A0;
.bg(@c: @white) {
background-color: @c;
}
.bgi(@url: '') {
background-image: url(@url);
background-repeat: no-repeat;
background-position: center center;
}
// Spaces settings
.no-space() {
margin: 0;
padding: 0;
}
// Text settings
@size: 12px;
.title(@size, @m1, @m2) {
font-weight: bold;
font-size: @size;
text-align: left;
margin: @m1 @m2;
}
.color(@c: @dark) {
color: @c;
}
// Misc.
.cursor(@type: pointer) {
cursor: @type;
}
/******* DATABASES ************************************************************/
.db_recommand {
.color;
font-weight: bold;
}
.db_exception {
margin-top: 10px;
.bg(@lemon);
}
.db_infos {
width: 100%;
padding-bottom: 10px;
h2 {
line-height: 22px;
}
input[type="text"],
input[type="password"],
input[type="submit"],
select, textarea, ul {
margin-bottom: 9px
}
}
/******* DATABASE *************************************************************/
.db_box {
margin: 0 10px 10px;
p {
margin: 0 0 9px;
}
}
#INDEX_P_BAR p {
.no-space;
}
div[id$="_indexed_bar"] {
width: 0;
height: 15px;
position: absolute;
z-index: 6;
background: @dk-sand;
}
div[id$="_indexed_percent"] {
width: 198px;
height: 13px;
position: absolute;
z-index: 10;
border: 1px solid @dark;
line-height: 15px;
text-align: center;
}
.logo_box {
margin: 0 10px 10px;
hr {
border-top: 1px solid @grey;
margin-bottom: 10px;
}
div[id^="printLogoDIV_"] {
margin: 0 0 5px 0;
display: none;
}
}
/******* DATABASE - FIELDS ****************************************************/
#field_adder .help-block label {
.color(lighten(@dark, 20%));
}
#form_struct {
margin: 10px 0;
thead tr th:not(:first-child) {
min-width: 70px;
text-align: center;
}
}

View File

@@ -0,0 +1,370 @@
//****** LESS SETTINGS ********************************************************/
// Colors & bg settings
@white: #FFF;
@black: #000;
@dark: #333;
@grey: #CCC;
@blue: #0088CC;
@red: #F00;
@orange: #FAA732; //F0AD30;
@lemon: #FCEB3F;
@sand: #FFFBCD;
@dk-sand: #E5D4A0;
.bg(@c: @white) {
background-color: @c;
}
.bgi(@url: '') {
background-image: url(@url);
background-repeat: no-repeat;
background-position: center center;
}
// Spaces settings
.no-space() {
margin: 0;
padding: 0;
}
// Text settings
@size: 12px;
.title(@size, @m1, @m2) {
font-weight: bold;
font-size: @size;
text-align: left;
margin: @m1 @m2;
}
.color(@c: @dark) {
color: @c;
}
// Misc.
.cursor(@type: pointer) {
cursor: @type;
}
/******* GLOBAL CSS for ADMIN *************************************************/
body {
.no-space;
.bg;
.color;
overflow-y: auto;
}
.clear {
clear: both;
}
h1 {
.title(@size * 2,10px,0);
}
h2 {
.title(@size + 6,7px,0);
}
h3 {
.title(@size + 2,4px,0);
}
h4 {
.title(@size,2px,0);
}
a {
.color;
text-decoration: underline;
.cursor;
&:hover {
.color(@blue);
text-decoration: underline;
.cursor;
}
}
blockquote {
margin: 20px 15px;
padding: 10px;
border: 1px dotted @black;
.bg(lighten(@grey, 15%));
}
img {
vertical-align: middle;
}
input, textarea, .uneditable-input {
margin: 0;
padding: 4px;
}
select {
margin: 0;
padding: 5px 4px;
*padding: 4px;
}
.help-block, .help-inline {
.color(lighten(@dark, 20%));
}
li.selected, div.selected {
.bg(@orange);
.color(@white);
a {
.bg(@orange);
.color(@white);
}
}
.treeview ul {
.bg(transparent);
}
#right-ajax.loading{
.bgi('/skins/icons/loaderFFF.gif');
}
div.finder div.content div.title {
margin-top: -2px;
position: relative;
top: 0;
left: 0;
white-space: nowrap;
overflow: hidden;
}
/******* MAIN MENU ************************************************************/
#mainMenu {
.bg(@lemon);
a, b, .title, span {
.color(@black);
}
a {
&:hover {
span {
.bg(@sand);
}
}
}
span {
&.selected {
border-top: 3px solid @black;
}
}
}
/******* LEFT SIDE ************************************************************/
#left {
.bg(@sand);
overflow: auto;
}
#FNDR {
overflow: auto;
li.selected {
.bg(@orange);
.color(@white);
}
a {
text-decoration: none;
&:hover {
text-decoration: none;
}
span {
text-decoration: underline;
&:hover {
text-decoration: underline;
}
}
}
}
/******* USERS ****************************************************************/
.admin_head_opts {
margin: 5px 0 10px 0;
span {
margin: 0 10px;
}
a {
margin: 0 5px;
}
}
#users_page_form {
p {
margin: 5px 5px 10px;
}
.input-mini {
width: 30px;
}
}
#users_check_uncheck div {
padding: 5px 10px;
.bg(@grey);
.color(@black);
.cursor;
&.hovered {
padding: 5px 10px;
.bg(darken(@grey, 50%));
.color(@white);
}
}
/******* EDIT USERS ***********************************************************/
div.no_switch {
width: 12px;
height: 12px;
margin: 0 auto;
.bgi('/skins/icons/ccoch5.gif');
}
div.switch_quota,
div.switch_masks,
div.switch_time,
div.switch_right {
width: 12px;
height: 12px;
margin: 0 auto;
&.mixed {
.bgi('/skins/icons/ccoch2.gif');
}
&.checked {
.bgi('/skins/icons/ccoch1.gif');
}
&.unchecked {
.bgi('/skins/icons/ccoch0.gif');
}
}
.ui-datepicker {
z-index:1500;
}
/******* BOARD ****************************************************************/
.board_section {
margin: 0 0 30px;
ul, #mail_checker {
margin: 0 0 20px 15px;
}
div[class^="section_"] {
width: 400px;
height: auto;
h2 {
line-height: 24px;
}
ul.setup {
width: 360px;
border: 1px solid @grey;
list-style-type: none;
li {
padding: 2px 5px 2px 30px;
background-image: url(/skins/icons/ok.png);
background-repeat: no-repeat;
background-position: 5px center;
&.non-blocker {
background-image: url(/skins/icons/alert.png);
}
&.blocker {
background-image: url(/skins/icons/delete.png);
}
&:hover {
.bg(@sand);
}
}
}
#cache_flusher {
margin: -10px 0 20px 0;
}
}
.section_left {
float: left;
}
.section_right {
margin-left: 430px;
padding-top: 1px;
}
#flush_button {
width: 362px;
margin-left: 15px;
}
}
/******* PUBLICATIONS *********************************************************/
.form_publication {
.controls {
margin-left: 10px;
}
}
@ico-size: 32px;
#pub_icon {
width: (@ico-size + 10px);
height: (@ico-size + 10px);
float: left;
.thumb_wrapper {
width: @ico-size;
height: @ico-size;
margin: 5px auto;
img {
width: @ico-size;
height: @ico-size;
}
}
}
#pub_fileupload {
height: (@ico-size + 10px);
line-height: (@ico-size + 10px);
margin-left: (@ico-size + 10px) + 5px;
}
/******* GLOBAL VALUES FORM ***************************************************/
#GV_form_head {
.control-label {
width: 100px;
text-align: left;
}
.controls {
margin-left: 110px;
input[type="checkbox"] {
margin-top: 8px;
}
}
}
#GV_form {
.error, .NEW {
.color(@red);
font-weight: bold;
}
.section {
padding-bottom: 10px;
h1 {
.title(16px, 10px, 0);
line-height: 22px;
}
.control-label {
width: auto;
margin-left: 230px;
float: none;
text-align: left;
}
.controls {
margin-left: 0;
float: left;
}
}
}

View File

@@ -0,0 +1,188 @@
//****** LESS SETTINGS ********************************************************/
// Colors & bg settings
@white: #FFF;
@black: #000;
@dark: #333;
@grey: #CCC;
@blue: #0088CC;
@red: #F00;
@orange: #FAA732; //F0AD30;
@lemon: #FCEB3F;
@sand: #FFFBCD;
@dk-sand: #E5D4A0;
.bg(@c: @white) {
background-color: @c;
}
// Spaces settings
.no-space() {
margin: 0;
padding: 0;
}
// Text settings
.titleTable(@m1, @m2, @size, @align, @deco) {
margin: @m1 @m2;
font-weight: bold;
font-size: @size;
text-align: @align;
text-decoration: @deco;
}
.color(@c: @dark) {
color: @c;
}
// Misc.
.cursor(@type: pointer) {
cursor: @type;
}
/******* TABLES ***************************************************************/
div.center {
width: 100%;
margin: auto;
}
.tableTitle {
.titleTable(20px, auto, 14px, center, underline);
}
table.whoisTable {
margin: auto;
border: @black 1px solid;
table-layout: fixed;
tr {
border: @grey 1px solid;
&:hover {
.bg(@sand);
}
}
td {
padding: 3px;
&.colTitle {
width: 120px;
text-align: left;
}
&.colValue {
width: 60px;
text-align: right;
}
}
}
.spacehr {
margin-top: 40px;
margin-bottom: 30px;
border-top: 1px solid @grey;
}
table.admintable {
width: 100%;
margin: 10px 0;
border: none;
tr {
height: 28px;
vertical-align: middle;
&.selected {
&:hover {
.bg(@orange);
}
}
}
thead {
.bg(@dk-sand);
th {
padding: 3px;
text-align: left;
font-weight: bold;
}
}
tbody {
tr {
&.even {
.bg(@sand);
}
&.selected {
.bg(@orange);
}
&:hover {
.bg(@orange);
.cursor;
}
}
td {
padding: 3px;
}
&.dropdown {
.cursor;
}
}
.centered {
text-align: center;
}
}
/******* USERS TABLE **********************************************************/
#users th.sortable {
.cursor;
span {
margin: 0 5px;
&.ord_notifier {
display: none;
}
}
&.hover {
.bg(@orange);
}
&.sorted {
.bg(@orange);
span {
&.ord_notifier {
display: inline;
}
}
}
}
/******* EDIT-USERS TABLE *****************************************************/
td.users_col {
width: 23px;
border: 0px solid transparent;
vertical-align: middle;
text-align: center;
&.options {
.color(#AFAFAF);
.cursor;
}
}
/******* TOOLTIP CONNECTED USERS **********************************************/
#tooltip-usr {
position: relative;
top: 0;
left: 0;
.color;
#tabledescexp {
table-layout: fixed;
width: 300px;
td {
border: none;
text-align: left;
strong {
font-weight: bold;
}
&.tooltip-title {
.bg(@orange);
border: 1px solid (darken(@orange, 10%));
.titleTable(10px, auto, 14px, center, none);
.color(@white);
}
}
}
}