mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Remove status bit name, use only labels
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core;
|
|||||||
*/
|
*/
|
||||||
class Version
|
class Version
|
||||||
{
|
{
|
||||||
protected static $number = '3.8.0.a8';
|
protected static $number = '3.8.0.a9';
|
||||||
protected static $name = 'Carnosaurus';
|
protected static $name = 'Carnosaurus';
|
||||||
|
|
||||||
public static function getNumber()
|
public static function getNumber()
|
||||||
|
@@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use MediaAlchemyst\Specification\Image as ImageSpecification;
|
use MediaAlchemyst\Specification\Image as ImageSpecification;
|
||||||
use MediaAlchemyst\Alchemyst;
|
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
||||||
|
|
||||||
@@ -85,7 +83,6 @@ class databox_status
|
|||||||
if ($bit < 4 && $bit > 31)
|
if ($bit < 4 && $bit > 31)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$this->status[$bit]["name"] = (string) ($sb);
|
|
||||||
$this->status[$bit]["labeloff"] = (string) $sb['labelOff'];
|
$this->status[$bit]["labeloff"] = (string) $sb['labelOff'];
|
||||||
$this->status[$bit]["labelon"] = (string) $sb['labelOn'];
|
$this->status[$bit]["labelon"] = (string) $sb['labelOn'];
|
||||||
|
|
||||||
@@ -312,11 +309,6 @@ class databox_status
|
|||||||
|
|
||||||
$sbit = $statbits->appendChild($doc->createElement("bit"));
|
$sbit = $statbits->appendChild($doc->createElement("bit"));
|
||||||
|
|
||||||
if ($n = $sbit->appendChild($doc->createAttribute("n"))) {
|
|
||||||
$n->value = $bit;
|
|
||||||
$sbit->appendChild($doc->createTextNode($properties['name']));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($labOn = $sbit->appendChild($doc->createAttribute("labelOn"))) {
|
if ($labOn = $sbit->appendChild($doc->createAttribute("labelOn"))) {
|
||||||
$labOn->value = $properties['labelon'];
|
$labOn->value = $properties['labelon'];
|
||||||
}
|
}
|
||||||
@@ -336,11 +328,10 @@ class databox_status
|
|||||||
|
|
||||||
$databox->saveStructure($doc);
|
$databox->saveStructure($doc);
|
||||||
|
|
||||||
self::$_status[$sbas_id]->status[$bit]["name"] = $properties['name'];
|
|
||||||
self::$_status[$sbas_id]->status[$bit]["labelon"] = $properties['labelon'];
|
self::$_status[$sbas_id]->status[$bit]["labelon"] = $properties['labelon'];
|
||||||
self::$_status[$sbas_id]->status[$bit]["labeloff"] = $properties['labeloff'];
|
self::$_status[$sbas_id]->status[$bit]["labeloff"] = $properties['labeloff'];
|
||||||
self::$_status[$sbas_id]->status[$bit]["searchable"] = ! ! $properties['searchable'];
|
self::$_status[$sbas_id]->status[$bit]["searchable"] = (Boolean) $properties['searchable'];
|
||||||
self::$_status[$sbas_id]->status[$bit]["printable"] = ! ! $properties['printable'];
|
self::$_status[$sbas_id]->status[$bit]["printable"] = (Boolean) $properties['printable'];
|
||||||
|
|
||||||
if ( ! isset(self::$_status[$sbas_id]->status[$bit]['img_on'])) {
|
if ( ! isset(self::$_status[$sbas_id]->status[$bit]['img_on'])) {
|
||||||
self::$_status[$sbas_id]->status[$bit]['img_on'] = null;
|
self::$_status[$sbas_id]->status[$bit]['img_on'] = null;
|
||||||
|
74
lib/classes/patch/3809.php
Normal file
74
lib/classes/patch/3809.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
|
class patch_3809 implements patchInterface
|
||||||
|
{
|
||||||
|
/** @var string */
|
||||||
|
private $release = '3.8.0.a9';
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $concern = array(base::DATA_BOX);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function get_release()
|
||||||
|
{
|
||||||
|
return $this->release;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function require_all_upgrades()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function concern()
|
||||||
|
{
|
||||||
|
return $this->concern;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function apply(base $databox, Application $app)
|
||||||
|
{
|
||||||
|
$sxe = $databox->get_sxml_structure();
|
||||||
|
|
||||||
|
if ($sxe !== false) {
|
||||||
|
foreach ($sxe->statbits->bit as $sb) {
|
||||||
|
$bit = (int) ($sb["n"]);
|
||||||
|
if ($bit < 4 && $bit > 31) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$name = (string) $sb;
|
||||||
|
$labelOff = (string) $sb['labelOff'];
|
||||||
|
$labelOn = (string) $sb['labelOn'];
|
||||||
|
|
||||||
|
$this->status[$bit]["labeloff"] = $labelOff ? : 'no-' . $name;
|
||||||
|
$this->status[$bit]["labelon"] = $labelOn ? : 'ok-' . $name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$dom = new \DOMDocument();
|
||||||
|
$dom->loadXML($sxe->asXML());
|
||||||
|
|
||||||
|
$databox->saveStructure($dom);
|
||||||
|
}
|
||||||
|
}
|
@@ -430,17 +430,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$status .= '<img style="margin:1px;' . $style1 . '" ' .
|
$status .= '<img style="margin:1px;' . $style1 . '" ' .
|
||||||
'class="STAT_' . $this->base_id . '_'
|
'class="STAT_' . $this->base_id . '_'
|
||||||
. $this->record_id . '_' . $n . '_1" ' .
|
. $this->record_id . '_' . $n . '_1" ' .
|
||||||
'src="' . $source1 . '" title="' .
|
'src="' . $source1 . '" title="' . $statbit["labelon"] . '"/>';
|
||||||
(isset($statbit["labelon"]) ?
|
|
||||||
$statbit["labelon"] :
|
|
||||||
$statbit["lib"]) . '"/>';
|
|
||||||
$status .= '<img style="margin:1px;' . $style0 . '" ' .
|
$status .= '<img style="margin:1px;' . $style0 . '" ' .
|
||||||
'class="STAT_' . $this->base_id . '_'
|
'class="STAT_' . $this->base_id . '_'
|
||||||
. $this->record_id . '_' . $n . '_0" ' .
|
. $this->record_id . '_' . $n . '_0" ' .
|
||||||
'src="' . $source0 . '" title="' .
|
'src="' . $source0 . '" title="' . $statbit["labeloff"] . '"/>';
|
||||||
(isset($statbit["labeloff"]) ?
|
|
||||||
$statbit["labeloff"] :
|
|
||||||
("non-" . $statbit["lib"])) . '"/>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,11 +7,9 @@
|
|||||||
|
|
||||||
<table class="table table-striped table-condensed">
|
<table class="table table-striped table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<th>{% trans 'status:: numero de bit' %}</th>
|
<th style="width:30px;">{% trans 'status:: numero de bit' %}</th>
|
||||||
<th colspan='2'></th>
|
<th style="width:60px;" colspan='2'></th>
|
||||||
<th>{% trans 'status:: nom' %}</th>
|
<th>{% trans 'status:: nom' %}</th>
|
||||||
<th>{% trans 'status:: icone A' %}</th>
|
|
||||||
<th>{% trans 'status:: icone B' %}</th>
|
|
||||||
<th>{% trans 'status:: cherchable par tous' %}</th>
|
<th>{% trans 'status:: cherchable par tous' %}</th>
|
||||||
<th>{% trans 'status:: Affichable pour tous' %}</th>
|
<th>{% trans 'status:: Affichable pour tous' %}</th>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -42,17 +40,23 @@
|
|||||||
|
|
||||||
{% if attribute(status, bit) is defined %}
|
{% if attribute(status, bit) is defined %}
|
||||||
{% set statusbit = attribute(status, bit) %}
|
{% set statusbit = attribute(status, bit) %}
|
||||||
<td>{{ statusbit['name'] }}</td>
|
<td>
|
||||||
<td>{% if statusbit['img_off'] %}<img title='{{ statusbit['labeloff'] }}' src='{{ statusbit['img_off'] }}' />{% endif %}</td>
|
{% if statusbit['img_off'] %}
|
||||||
<td>{% if statusbit['img_on'] %}<img title='{{ statusbit['labelon'] }}' src='{{ statusbit['img_on'] }}' />{% endif %}</td>
|
<img title='{{ statusbit['labeloff'] }}' src='{{ statusbit['img_off'] }}' />
|
||||||
|
{% endif %}
|
||||||
|
{{ statusbit['labeloff'] }}
|
||||||
|
/
|
||||||
|
{% if statusbit['img_on'] %}
|
||||||
|
<img title='{{ statusbit['labelon'] }}' src='{{ statusbit['img_on'] }}' />
|
||||||
|
{% endif %}
|
||||||
|
{{ statusbit['labelon'] }}
|
||||||
|
</td>
|
||||||
<td>{{ statusbit['searchable'] is defined and statusbit['searchable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
<td>{{ statusbit['searchable'] is defined and statusbit['searchable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
||||||
<td>{{ statusbit['printable'] is defined and statusbit['printable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
<td>{{ statusbit['printable'] is defined and statusbit['printable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -9,12 +9,6 @@
|
|||||||
|
|
||||||
<form id="fileupload" class="form-horizontal" enctype="multipart/form-data" method="post" action="{{ path('database_submit_statusbit', { 'databox_id' : app['request'].get('databox_id'), 'bit' : app['request'].get('bit') }) }}">
|
<form id="fileupload" class="form-horizontal" enctype="multipart/form-data" method="post" action="{{ path('database_submit_statusbit', { 'databox_id' : app['request'].get('databox_id'), 'bit' : app['request'].get('bit') }) }}">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="span5 well-small">
|
|
||||||
<label for="name">
|
|
||||||
{% trans'admin::status: nom du status : '%}
|
|
||||||
<input id="name" name="name" class="input-xlarge" type="text" value="{{ status['name']|default('') }}">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="span5 well">
|
<div class="span5 well">
|
||||||
<span class="label">{% trans'admin::status: case A'%}</span>
|
<span class="label">{% trans'admin::status: case A'%}</span>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
@@ -67,11 +67,6 @@
|
|||||||
<table class="status-tab">
|
<table class="status-tab">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for bit, status in availableCollections['databox'].get_statusbits() %}
|
{% for bit, status in availableCollections['databox'].get_statusbits() %}
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<h6>{{ status['name']|title }}</h6>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="status-tab-left">
|
<td class="status-tab-left">
|
||||||
{% if status['img_off'] is not empty %}
|
{% if status['img_off'] is not empty %}
|
||||||
|
@@ -72,11 +72,6 @@
|
|||||||
<table class="status-tab">
|
<table class="status-tab">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for bit, status in availableCollections['databox'].get_statusbits() %}
|
{% for bit, status in availableCollections['databox'].get_statusbits() %}
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<h6>{{ status['name']|title }}</h6>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="status-tab-left">
|
<td class="status-tab-left">
|
||||||
{% if status['img_off'] is not empty %}
|
{% if status['img_off'] is not empty %}
|
||||||
|
Reference in New Issue
Block a user