feat: change texte bouton pour rencontre employeur
This commit is contained in:
parent
2da5a55bc8
commit
bd32ff0dbf
1 changed files with 45 additions and 43 deletions
|
@ -10,52 +10,54 @@ use Psr\Container\ContainerInterface;
|
||||||
*/
|
*/
|
||||||
class InscriptionField extends BazarField
|
class InscriptionField extends BazarField
|
||||||
{
|
{
|
||||||
protected $inscriptionForm;
|
protected $inscriptionForm;
|
||||||
protected const INSCRIPTION_FIELD = 1;
|
protected const INSCRIPTION_FIELD = 1;
|
||||||
|
|
||||||
public function __construct(array $values, ContainerInterface $services)
|
public function __construct(array $values, ContainerInterface $services)
|
||||||
{
|
{
|
||||||
parent::__construct($values, $services);
|
parent::__construct($values, $services);
|
||||||
|
|
||||||
$this->inscriptionForm = $values[self::INSCRIPTION_FIELD];
|
$this->inscriptionForm = $values[self::INSCRIPTION_FIELD];
|
||||||
$this->size = null;
|
$this->size = null;
|
||||||
$this->maxChars = null;
|
$this->maxChars = null;
|
||||||
$this->default = "";
|
$this->default = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function renderInput($entry)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function renderStatic($entry)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
$this->getWiki()->UserIsInGroup('admins')
|
||||||
|
|| $this->getWiki()->UserIsInGroup('Employeur')
|
||||||
|
|| $this->getWiki()->UserIsInGroup('Coordination')
|
||||||
|
) {
|
||||||
|
if ($entry['id_typeannonce'] == '13') {
|
||||||
|
return '<a href="' . $this->getWiki()->href('iframe', 'BazaR', 'vue=saisir&action=saisir_fiche&listefiche' . $entry['id_typeannonce'] . 'inscription=' . $entry['id_fiche'] . '&id=' . $this->inscriptionForm) . '" class="modalbox btn btn-primary" data-iframe="1" title="Vous inscrire a cette rencontre">Vous inscrire à cette rencontre</a>';
|
||||||
|
}
|
||||||
|
return '<a href="' . $this->getWiki()->href('iframe', 'BazaR', 'vue=saisir&action=saisir_fiche&listefiche' . $entry['id_typeannonce'] . 'inscription=' . $entry['id_fiche'] . '&id=' . $this->inscriptionForm) . '" class="modalbox btn btn-primary" data-iframe="1" title="Inscrire des adultes relais">Inscrire des adultes relais à cette formation</a>';
|
||||||
|
} else {
|
||||||
|
return '<div class="alert alert-info">Pour vous inscrire à cette session, vous devez en faire la demande à votre employeur qui une fois connecté pourra vous inscrire.</div>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected function renderInput($entry)
|
public function formatValuesBeforeSave($entry)
|
||||||
{
|
{
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function renderStatic($entry)
|
// change return of this method to keep compatible with php 7.3 (mixed is not managed)
|
||||||
{
|
#[\ReturnTypeWillChange]
|
||||||
if (
|
public function jsonSerialize()
|
||||||
$this->getWiki()->UserIsInGroup('admins')
|
{
|
||||||
|| $this->getWiki()->UserIsInGroup('Employeur')
|
return array_merge(
|
||||||
||$this->getWiki()->UserIsInGroup('Coordination')
|
parent::jsonSerialize(),
|
||||||
) {
|
[
|
||||||
|
'reservation_button' => '<a class="btn btn-primary" href="#"><i class="fa fa-plus"></i> Je profite de ce trajet</a>'
|
||||||
return '<a href="'.$this->getWiki()->href('iframe','BazaR', 'vue=saisir&action=saisir_fiche&listefiche'.$entry['id_typeannonce'].'inscription='.$entry['id_fiche'].'&id='.$this->inscriptionForm).'" class="modalbox btn btn-primary" data-iframe="1" title="Inscrire des adultes relais">Inscrire des adultes relais à cette formation</a>';
|
]
|
||||||
} else {
|
);
|
||||||
return '<div class="alert alert-info">Pour vous inscrire à cette session, vous devez en faire la demande à votre employeur qui une fois connecté pourra vous inscrire.</div>';
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function formatValuesBeforeSave($entry)
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// change return of this method to keep compatible with php 7.3 (mixed is not managed)
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function jsonSerialize()
|
|
||||||
{
|
|
||||||
return array_merge(
|
|
||||||
parent::jsonSerialize(),
|
|
||||||
[
|
|
||||||
'reservation_button' => '<a class="btn btn-primary" href="#"><i class="fa fa-plus"></i> Je profite de ce trajet</a>'
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue