mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 08:12:26 +02:00
Customer portal : Readonly attachments when object is not longer editable
SVN:trunk[4250]
This commit is contained in:
@@ -599,7 +599,7 @@ class ObjectFormManager extends FormManager
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adding attachment field
|
||||
if ($bClassAllowed)
|
||||
{
|
||||
@@ -611,7 +611,7 @@ class ObjectFormManager extends FormManager
|
||||
->SetAllowDelete($this->oApp['combodo.portal.instance.conf']['properties']['attachments']['allow_delete'])
|
||||
->SetObject($this->oObject);
|
||||
|
||||
if ($this->sMode === static::ENUM_MODE_VIEW)
|
||||
if (($this->sMode === static::ENUM_MODE_VIEW) || ($oForm->GetEditableFieldCount() === 0))
|
||||
{
|
||||
$oField->SetReadOnly(true);
|
||||
}
|
||||
|
||||
@@ -72,8 +72,14 @@
|
||||
var oNormalRegularButtons_{{ sFormIdSanitized }} = $('#{{ sFormId }} .form_btn_regular');
|
||||
var oStickyRegularButtons_{{ sFormIdSanitized }} = oNormalRegularButtons_{{ sFormIdSanitized }}.clone(true, true);
|
||||
oStickyRegularButtons_{{ sFormIdSanitized }}.addClass('sticky');
|
||||
oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_submit').html( oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_submit span.glyphicon')[0].outerHTML );
|
||||
oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_cancel').html( oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_cancel span.glyphicon')[0].outerHTML );
|
||||
if(oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_submit span.glyphicon').length > 0)
|
||||
{
|
||||
oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_submit').html( oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_submit span.glyphicon')[0].outerHTML );
|
||||
}
|
||||
if(oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_cancel span.glyphicon').length > 0)
|
||||
{
|
||||
oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_cancel').html( oStickyRegularButtons_{{ sFormIdSanitized }}.find('.form_btn_cancel span.glyphicon')[0].outerHTML );
|
||||
}
|
||||
|
||||
$('#{{ sFormId }}').closest({% if tIsModal == true %}'.modal'{% else %}'#main-content'{% endif %}).append(oStickyRegularButtons_{{ sFormIdSanitized }});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user