From 7abb602f9a8efc1c61c03e08f0947a1cae8386c1 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 4 Jan 2012 18:02:29 +0100 Subject: [PATCH 1/3] Fix #156 : editing presets does not contain meta_struct_ids --- www/prod/jquery.edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/prod/jquery.edit.js b/www/prod/jquery.edit.js index a00be8d94a..f9db0030c7 100644 --- a/www/prod/jquery.edit.js +++ b/www/prod/jquery.edit.js @@ -1840,6 +1840,7 @@ function preset_load(preset_id) { p4.edit.T_records[r].fields[""+i] = { value:[], + "meta_struct_id":p4.edit.T_fields[i].meta_struct_id, dirty:true };// = { var n = 0; @@ -1853,6 +1854,7 @@ function preset_load(preset_id) { p4.edit.T_records[r].fields[""+i] = { "value":p4.edit.T_fields[i].preset[0], + "meta_struct_id":p4.edit.T_fields[i].meta_struct_id, "dirty":true }; } @@ -1875,7 +1877,6 @@ function preset_load(preset_id) - function hsplit1() { var el = $('#EDIT_TOP'); From 9835fa1ff7a5df102764851973c14cd4da3481e5 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 4 Jan 2012 18:03:38 +0100 Subject: [PATCH 2/3] Fix #155 : wrong stories caption --- lib/classes/record/preview.class.php | 27 ++++++++++++------------- templates/web/prod/preview/caption.html | 6 +++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/classes/record/preview.class.php b/lib/classes/record/preview.class.php index 330e9e0edf..1078fc7ca9 100644 --- a/lib/classes/record/preview.class.php +++ b/lib/classes/record/preview.class.php @@ -268,40 +268,39 @@ class record_preview extends record_adapter { if ($this->title) return $this->title; + $this->title = collection::getLogo($this->get_base_id()) . ' '; + switch ($this->env) { case "RESULT": $this->title .= sprintf( _('preview:: resultat numero %s '), '' . ($this->number + 1) - . '' + . ' : ' ); - $title = parent::get_title(); - if ($search_engine instanceof searchEngine_adapter) - { - $this->title .= array_pop($search_engine->build_excerpt($highlight, array($title), $this)); - } - else - { - $this->title .= $title; - } + $this->title .= parent::get_title($highlight, $search_engine); break; case "BASK": - $this->title .= $this->name . ' - ' . parent::get_title() + $this->title .= $this->name . ' - ' . parent::get_title($highlight, $search_engine) . ' (' . $this->get_number() . '/' . $this->total . ') '; break; case "REG": + $title = parent::get_title(); if ($this->get_number() == 0) - $this->title .= _('preview:: regroupement '); + { + $this->title .= $title; + } else + { $this->title .= sprintf( - _('preview:: Previsualisation numero %s '), $this->get_number() . '/' . $this->total + _('%s %d/%d '), $title, $this->get_number() . '/' . $this->total ); + } break; default: - $this->title .= parent::get_title(); + $this->title .= parent::get_title($highlight, $search_engine); break; } diff --git a/templates/web/prod/preview/caption.html b/templates/web/prod/preview/caption.html index 7a037b4f81..011271a70e 100644 --- a/templates/web/prod/preview/caption.html +++ b/templates/web/prod/preview/caption.html @@ -9,6 +9,10 @@
{{record.get_status_icons()|raw}}
- {{caption.format_caption(record, highlight, searchEngine)}} + {% if record.is_from_reg() %} + {{caption.format_caption(record)}} + {% else %} + {{caption.format_caption(record, highlight, searchEngine)}} + {% endif %}
{% include 'common/technical_datas.twig' %} \ No newline at end of file From d04ba1e76c4e7d088a6da2559c84d08f457bce73 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 4 Jan 2012 18:05:40 +0100 Subject: [PATCH 3/3] Add exception verbosity --- lib/classes/record/adapter.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index 9a8673306d..3a3402567c 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -1097,7 +1097,9 @@ class record_adapter implements record_Interface, cache_cacheableInterface foreach ($mandatoryParams as $param) { if (!array_key_exists($param, $params)) - throw new Exception_InvalidArgument(); + { + throw new Exception_InvalidArgument(sprintf('Invalid metadata, missing key %s', $param)); + } } if (!is_array($params['value']))