Merge branch '3.5.5' into 3.6

This commit is contained in:
Romain Neutron
2011-12-28 15:00:18 +01:00
14 changed files with 45 additions and 22 deletions

View File

@@ -88,8 +88,7 @@ class Session_Handler
if (!$this->is_authenticated()) if (!$this->is_authenticated())
return; return;
$user = User_Adapter::getInstance($this->get_usr_id(), $this->appbox);
$user->ACL()->delete_injected_rights();
$this->storage()->reset(); $this->storage()->reset();
$this->close_phrasea_session(); $this->close_phrasea_session();

View File

@@ -346,9 +346,9 @@ class caption_field implements cache_cacheableInterface
if ($this->databox_field->is_multi() === true) if ($this->databox_field->is_multi() === true)
{ {
if ($as_string === true && $custom_separator === false) if ($as_string === true && $custom_separator === false)
{
return $this->value; return $this->value;
}
$separator = $this->databox_field->get_separator(); $separator = $this->databox_field->get_separator();
$array_values = self::get_multi_values($this->value, $separator); $array_values = self::get_multi_values($this->value, $separator);

View File

@@ -59,8 +59,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
protected function retrieve_fields() protected function retrieve_fields()
{ {
if(is_array($this->fields)) if (is_array($this->fields))
return $this->fields; return $this->fields;
$fields = array(); $fields = array();
@@ -134,7 +133,6 @@ class caption_record implements caption_interface, cache_cacheableInterface
{ {
$fields = $this->retrieve_fields(); $fields = $this->retrieve_fields();
if (isset($this->dces_elements[$label])) if (isset($this->dces_elements[$label]))
return $fields[$this->dces_elements[$label]]; return $fields[$this->dces_elements[$label]];
return null; return null;
} }
@@ -172,7 +170,10 @@ class caption_record implements caption_interface, cache_cacheableInterface
, $field->highlight_thesaurus() , $field->highlight_thesaurus()
); );
$fields[$field->get_name()] = $value; $fields[$field->get_name()] = array(
'value' => $value
, 'separator' => $field->get_databox_field()->get_separator()
);
} }
if ($searchEngine instanceof searchEngine_adapter) if ($searchEngine instanceof searchEngine_adapter)
@@ -185,7 +186,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
foreach ($fields as $key => $value) foreach ($fields as $key => $value)
{ {
$fields[$key] = $ret[$n]; $fields[$key]['value'] = $ret[$n];
$n++; $n++;
} }
} }

View File

@@ -863,9 +863,9 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$titles = array(); $titles = array();
foreach ($retrieved_fields as $key => $value) foreach ($retrieved_fields as $key => $value)
{ {
if (trim($value === '')) if (trim($value['value'] === ''))
continue; continue;
$titles[] = $value; $titles[] = $value['value'];
} }
$title = trim(implode(' - ', $titles)); $title = trim(implode(' - ', $titles));
} }

View File

@@ -639,9 +639,20 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
foreach ($fields as $name => $field) foreach ($fields as $name => $field)
{ {
if ($sxe->description->$name) if ($sxe->description->$name)
$ret[] = str_replace(array('[[em]]', '[[/em]]'), array('<em>', '</em>'), (string) $sxe->description->$name); {
$val = array();
foreach($sxe->description->$name as $value)
{
$val[] = str_replace(array('[[em]]', '[[/em]]'), array('<em>', '</em>'), (string) $value);
}
$val = implode(' '.$field['separator'].' ', $val);
}
else else
$ret[] = $field; {
$val = $field['value'];
}
$ret[] = $val;
} }
return $ret; return $ret;

View File

@@ -753,7 +753,14 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i
'after_match' => "</em>" 'after_match' => "</em>"
); );
return $this->sphinx->BuildExcerpts($fields, $index, $query, $opts); $fields_to_send = array();
foreach($fields as $k=>$f)
{
$fields_to_send[$k] = $f['value'];
}
return $this->sphinx->BuildExcerpts($fields_to_send, $index, $query, $opts);
} }
} }

View File

@@ -108,11 +108,16 @@ class task_Scheduler
foreach ($task_manager->get_tasks() as $task) foreach ($task_manager->get_tasks() as $task)
{ {
if (!$task->is_active()) if (!$task->is_active())
{
continue; continue;
}
$tid = $task->get_task_id(); $tid = $task->get_task_id();
if (!$task->is_running()) if (!$task->is_running())
{ {
/* @var $task task_abstract */
$task->reset_crash_counter();
$task->set_status(task_abstract::STATUS_TOSTART); $task->set_status(task_abstract::STATUS_TOSTART);
} }
} }

View File

@@ -1,5 +1,5 @@
{% macro format_caption(record, highlight, searchEngine) %} {% macro format_caption(record, highlight, searchEngine) %}
{% for name, value in record.get_caption().get_highlight_fields(highlight, null, searchEngine) %} {% for name, value in record.get_caption().get_highlight_fields(highlight, null, searchEngine) %}
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value|raw}}</div> <div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value.value|raw}}</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@@ -1,5 +1,5 @@
{% macro format_caption(record) %} {% macro format_caption(record) %}
{% for name, value in record.get_caption().get_highlight_fields() %} {% for name, value in record.get_caption().get_highlight_fields() %}
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value|raw}}</div> <div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value.value|raw}}</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@@ -1,5 +1,5 @@
{% macro format_caption(record) %} {% macro format_caption(record) %}
{% for name, value in record.get_caption().get_highlight_fields() %} {% for name, value in record.get_caption().get_highlight_fields() %}
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value|raw}}</div> <div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value.value|raw}}</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@@ -1,5 +1,5 @@
{% macro format_caption(record) %} {% macro format_caption(record) %}
{% for name, value in record.get_caption().get_highlight_fields() %} {% for name, value in record.get_caption().get_highlight_fields() %}
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value|raw}}</div> <div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value.value|raw}}</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@@ -1,5 +1,5 @@
{% macro format_caption(record) %} {% macro format_caption(record) %}
{% for name, value in record.get_caption().get_highlight_fields() %} {% for name, value in record.get_caption().get_highlight_fields() %}
<div><b>{{name}}</b> : {{value|raw}}</div> <div><b>{{name}}</b> : {{value.value|raw}}</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@@ -1,5 +1,5 @@
{% macro format_caption(record, highlight, searchEngine) %} {% macro format_caption(record, highlight, searchEngine) %}
{% for name, value in record.get_caption().get_highlight_fields(highlight, null, searchEngine) %} {% for name, value in record.get_caption().get_highlight_fields(highlight, null, searchEngine) %}
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value|raw}}</div> <div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{name}}</b> : {{value.value|raw}}</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@@ -376,7 +376,7 @@
</div> </div>
<div id="ftp_form"> <div id="ftp_form">
<div id="ftp_form_stock"> <div id="ftp_form_stock">
{% for datas in download.ftp_datas %} {% for datas in download.get_ftp_datas() %}
{{ _self.print_ftp_form(datas) }} {{ _self.print_ftp_form(datas) }}
{% endfor %} {% endfor %}
</div> </div>