reset agenda form - refs #2681

pull/2818/head
Alex Aragón 7 years ago
parent 2de4c95f67
commit 1cf8457e09
  1. 30
      assets/css/base.css
  2. 10
      main/inc/lib/agenda.lib.php
  3. 42
      main/inc/lib/pear/HTML/QuickForm/select.php

@ -460,15 +460,9 @@
margin: 6px;
padding: 0;
}
.actions form {
.actions .form-group{
margin-bottom: 0;
}
.actions fieldset {
margin-top: 0;
}
.muted {
color: #999999 !important;
}
@ -521,15 +515,6 @@
border: none;
}
.actions form {
margin-right: 10px;
vertical-align: middle;
}
.actions fieldset {
margin-top: 0;
}
.separate-action {
padding-top: 10px;
padding-bottom: 10px;
@ -4657,15 +4642,6 @@ i.size-32.icon-new-work {
display: inline-block;
}
.actions .form-inline {
display: block;
width: 100%;
}
.actions #groups .bootstrap-select {
width: 300px;
}
ul.holder {
list-style: none;
margin: 0;
@ -6923,10 +6899,6 @@ a.sessionView {
padding-left: 0;
}
.actions label {
display: none;
}
#my_timeline {
width: 900px;
height: 350px;

@ -3031,7 +3031,7 @@ class Agenda
api_get_self().'?type=personal&',
'',
[],
FormValidator::LAYOUT_INLINE
'box-search'
);
if (api_is_drh()) {
@ -3055,16 +3055,14 @@ class Agenda
);
}
$form->addHidden('type', 'personal');
$sessions = ['0' => get_lang('SelectAnOption')] + $sessions;
$sessions = ['0' => get_lang('Select An Option')] + $sessions;
$form->addSelect(
'session_id',
get_lang('Session'),
$sessions,
['id' => 'session_id', 'onchange' => 'submit();']
);
$form->addButtonReset(get_lang('Reset'));
['id' => 'session_id', 'onchange' => 'submit();', 'icon' => 'broom']
)->setButton(true);
$form = $form->returnForm();
}
}

@ -95,6 +95,11 @@ class HTML_QuickForm_select extends HTML_QuickForm_element
}
$columnsSize = isset($attributes['cols-size']) ? $attributes['cols-size'] : null;
$this->setColumnsSize($columnsSize);
$icon = isset($attributes['icon']) ? $attributes['icon'] : null;
$this->setIcon($icon);
if (!empty($icon)) {
unset($attributes['icon']);
}
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'select';
@ -581,6 +586,31 @@ class HTML_QuickForm_select extends HTML_QuickForm_element
}
}
/**
* Show an icon at the left side of an input
* @return string
*/
public function getIconToHtml()
{
$icon = $this->getIcon();
$isButton = $this->getButton();
if (empty($icon)) {
return '';
}
$element = '<span class="input-group-text"><em class="fa fa-' . $icon . '"></em></span>';
if ($isButton) {
$element = '<button class="btn btn-outline-secondary" type="reset">
<em class="fa fa-' . $icon . '"></em>
</button>';
}
return '<div class="input-group-append">
' . $element . '
</div>';
}
/**
* @param string $layout
*
@ -647,6 +677,18 @@ class HTML_QuickForm_select extends HTML_QuickForm_element
{icon}
{element}
</div>';
case FormValidator::LAYOUT_BOX_SEARCH:
return '
<div class="form-group row">
<label class="col-sm-2 col-form-label" {label-for}>{label}</label>
<div class="col-sm-8">
<div class="input-group">
{element}
{icon}
</div>
</div>
<div class="col-sm-2"></div>
</div>';
break;
}
}

Loading…
Cancel
Save