diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index bae59e7516..54e5aa8711 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core; */ class Version { - protected static $number = '3.8.0.a8'; + protected static $number = '3.8.0.a9'; protected static $name = 'Carnosaurus'; public static function getNumber() diff --git a/lib/classes/databox/status.php b/lib/classes/databox/status.php index 8e919fbd2a..e4bfa0d48b 100644 --- a/lib/classes/databox/status.php +++ b/lib/classes/databox/status.php @@ -11,8 +11,6 @@ use Alchemy\Phrasea\Application; 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\Exception\FileException; @@ -85,7 +83,6 @@ class databox_status if ($bit < 4 && $bit > 31) continue; - $this->status[$bit]["name"] = (string) ($sb); $this->status[$bit]["labeloff"] = (string) $sb['labelOff']; $this->status[$bit]["labelon"] = (string) $sb['labelOn']; @@ -312,11 +309,6 @@ class databox_status $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"))) { $labOn->value = $properties['labelon']; } @@ -336,11 +328,10 @@ class databox_status $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]["labeloff"] = $properties['labeloff']; - self::$_status[$sbas_id]->status[$bit]["searchable"] = ! ! $properties['searchable']; - self::$_status[$sbas_id]->status[$bit]["printable"] = ! ! $properties['printable']; + self::$_status[$sbas_id]->status[$bit]["searchable"] = (Boolean) $properties['searchable']; + self::$_status[$sbas_id]->status[$bit]["printable"] = (Boolean) $properties['printable']; if ( ! isset(self::$_status[$sbas_id]->status[$bit]['img_on'])) { self::$_status[$sbas_id]->status[$bit]['img_on'] = null; diff --git a/lib/classes/patch/3809.php b/lib/classes/patch/3809.php new file mode 100644 index 0000000000..703d5f2c6c --- /dev/null +++ b/lib/classes/patch/3809.php @@ -0,0 +1,74 @@ +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); + } +} diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index b4b09bc901..660507d2d8 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -430,17 +430,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface $status .= ''; + 'src="' . $source1 . '" title="' . $statbit["labelon"] . '"/>'; $status .= ''; + 'src="' . $source0 . '" title="' . $statbit["labeloff"] . '"/>'; } } diff --git a/templates/web/admin/statusbit.html.twig b/templates/web/admin/statusbit.html.twig index 22a282c20a..2516f5c120 100644 --- a/templates/web/admin/statusbit.html.twig +++ b/templates/web/admin/statusbit.html.twig @@ -7,11 +7,9 @@ - - + + - - @@ -42,17 +40,23 @@ {% if attribute(status, bit) is defined %} {% set statusbit = attribute(status, bit) %} - - - + {% else %} - - {% endif %} {% endfor %} diff --git a/templates/web/admin/statusbit/edit.html.twig b/templates/web/admin/statusbit/edit.html.twig index e79c931d89..9dc39dd886 100644 --- a/templates/web/admin/statusbit/edit.html.twig +++ b/templates/web/admin/statusbit/edit.html.twig @@ -9,12 +9,6 @@
-
- -
{% trans'admin::status: case A'%}
diff --git a/templates/web/prod/upload/upload-flash.html.twig b/templates/web/prod/upload/upload-flash.html.twig index b449576b52..175cb09851 100644 --- a/templates/web/prod/upload/upload-flash.html.twig +++ b/templates/web/prod/upload/upload-flash.html.twig @@ -67,11 +67,6 @@
{% trans 'status:: numero de bit' %}{% trans 'status:: numero de bit' %} {% trans 'status:: nom' %}{% trans 'status:: icone A' %}{% trans 'status:: icone B' %} {% trans 'status:: cherchable par tous' %} {% trans 'status:: Affichable pour tous' %}
{{ statusbit['name'] }}{% if statusbit['img_off'] %}{% endif %}{% if statusbit['img_on'] %}{% endif %} + {% if statusbit['img_off'] %} + + {% endif %} + {{ statusbit['labeloff'] }} + / + {% if statusbit['img_on'] %} + + {% endif %} + {{ statusbit['labelon'] }} + {{ statusbit['searchable'] is defined and statusbit['searchable'] == '1' ? 'oui'| trans : 'non'| trans }} {{ statusbit['printable'] is defined and statusbit['printable'] == '1' ? 'oui'| trans : 'non'| trans }}
{% for bit, status in availableCollections['databox'].get_statusbits() %} - - -
-
{{ status['name']|title }}
-
{% if status['img_off'] is not empty %} diff --git a/templates/web/prod/upload/upload.html.twig b/templates/web/prod/upload/upload.html.twig index 7f59128944..988a945709 100644 --- a/templates/web/prod/upload/upload.html.twig +++ b/templates/web/prod/upload/upload.html.twig @@ -72,11 +72,6 @@ {% for bit, status in availableCollections['databox'].get_statusbits() %} - - -
-
{{ status['name']|title }}
-
{% if status['img_off'] is not empty %}