mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
N°803 - Allow display & edition of attributes on n:n relations on Portal
- Remove input when object is in view mode - Improve form errors handling - Prevent row selection when clicking input - Attach date time picker to table instead of input to prevent popup truncating (popup will be visible but not aligned on the input)
This commit is contained in:
@@ -88,6 +88,15 @@ class BsSimpleFieldRenderer extends BsFieldRenderer
|
||||
// - Value regarding the field type
|
||||
switch ($sFieldClass) {
|
||||
case 'Combodo\\iTop\\Form\\Field\\DateTimeField':
|
||||
|
||||
/* @see N°803 - Allow display & edition of attributes on n:n relations on Portal
|
||||
* LinkedSetFieldRenderer allow modification of link attributes, the default widget positioning truncates the popup.
|
||||
*/
|
||||
$sParent = '';
|
||||
if ($this->oField->GetDateTimePickerWidgetParent() != null) {
|
||||
$sParent = ", widgetParent: '{$this->oField->GetDateTimePickerWidgetParent()}'";
|
||||
}
|
||||
|
||||
$oOutput->AddHtml('<div class="input-group date" id="datepicker_'.$this->oField->GetGlobalId().'">');
|
||||
$oOutput->AddHtml('<input type="text" id="'.$this->oField->GetGlobalId().'" name="'.$this->oField->GetId().'" value="')->AddHtml($this->oField->GetDisplayValue(), true)->AddHtml('" class="form-control" maxlength="255" '.$sInputTags.'/>');
|
||||
$oOutput->AddHtml('<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>');
|
||||
@@ -96,7 +105,7 @@ class BsSimpleFieldRenderer extends BsFieldRenderer
|
||||
$sLocale = Dict::S('Portal:Calendar-FirstDayOfWeek');
|
||||
$oOutput->AddJs(
|
||||
<<<EOF
|
||||
$('#datepicker_{$this->oField->GetGlobalId()}').datetimepicker({format: $sJSFormat, locale: '$sLocale'});
|
||||
$('#datepicker_{$this->oField->GetGlobalId()}').datetimepicker({format: $sJSFormat, locale: '$sLocale' $sParent});
|
||||
EOF
|
||||
);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user