N°1318 - multiple choice in a template - first step

This commit is contained in:
acognet
2023-06-02 09:45:31 +02:00
parent 4264123ef6
commit 6abf65bfb7
16 changed files with 579 additions and 271 deletions

View File

@@ -28,5 +28,16 @@ class MultipleSelectField extends SelectField
{
/** @inheritDoc */
const DEFAULT_MULTIPLE_VALUES_ENABLED = true;
const DEFAULT_STARTS_WITH_NULL_CHOICE = false;
function SetCurrentValue($currentValue)
{
if ($currentValue != null) {
$this->currentValue = $currentValue;
} else {
$this->currentValue = "";
}
return $this;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/*
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Form\Field;
/**
* Description of MultipleSelectObjectField
*
* @author Acc
* @since 3.1.0
*/
class MultipleSelectObjectField extends SelectObjectField
{
function SetCurrentValue($currentValue)
{
if ($currentValue != null) {
$this->currentValue = $currentValue;
} else {
$this->currentValue = "";
}
return $this;
}
}

View File

@@ -24,7 +24,20 @@ namespace Combodo\iTop\Form\Field;
*
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
*/
class TagSetField extends Field
class TagSetField extends SelectField
{
/** @inheritDoc */
const DEFAULT_MULTIPLE_VALUES_ENABLED = true;
const DEFAULT_STARTS_WITH_NULL_CHOICE = false;
function SetCurrentValue($currentValue)
{
if ($currentValue != null) {
$this->currentValue = $currentValue;
} else {
$this->currentValue = "";
}
return $this;
}
}

View File

@@ -0,0 +1,29 @@
<?php
// Copyright (C) 2010-2023 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
namespace Combodo\iTop\Form\Field;
/**
* Description of TagSetField
*
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
*/
class TagSetObjectField extends MultipleSelectObjectField
{
}