mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
Fix readonly fields
This commit is contained in:
@@ -61,8 +61,6 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
|
||||
protected $works_on_unique_sbas = true;
|
||||
protected $has_thesaurus = false;
|
||||
|
||||
|
||||
|
||||
public function __construct(Symfony\Component\HttpFoundation\Request $request)
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
@@ -457,7 +455,6 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
|
||||
}
|
||||
|
||||
if (!is_array($request->get('mds')))
|
||||
|
||||
return $this;
|
||||
|
||||
$sbas_id = (int) $request->get('sbid');
|
||||
@@ -500,8 +497,22 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
|
||||
|
||||
if (is_array($rec['metadatas']))
|
||||
{
|
||||
try
|
||||
{
|
||||
$db_field = \databox_field::get_instance($databox, $rec['metadatas']['meta_struct_id']);
|
||||
|
||||
if ($db_field->is_readonly())
|
||||
{
|
||||
throw new \Exception('Can not write a readonly field');
|
||||
}
|
||||
|
||||
$record->set_metadatas($rec['metadatas']);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($write_edit_el instanceof databox_field)
|
||||
{
|
||||
|
@@ -69,6 +69,7 @@
|
||||
{% endif %}
|
||||
{% for field in editing.get_fields() %}
|
||||
{% set i = field.get_id() %}
|
||||
{% if field.is_readonly() is empty %}
|
||||
<div class="edit_field" id="EditFieldBox_{{i}}" onclick="return(edit_mdwn_fld(event, {{i}}, '{{field.get_name()}}'));" >
|
||||
<img id="editSGtri_{{i}}" style="visibility:hidden;" src="/skins/prod/{{cssfile}}/images/suggested.gif" />
|
||||
<img src="/skins/icons/info.gif" tooltipsrc="/prod/tooltip/metas/FieldInfos/{{field.get_databox().get_sbas_id()}}/{{field.get_id()}}/" class="fieldTips" alt=""/>
|
||||
@@ -80,6 +81,7 @@
|
||||
</span>
|
||||
<span class="fieldvalue" id="idEditField_{{i}}" >???</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
|
Reference in New Issue
Block a user