Deltacms/module/agenda/view/edition/edition.php

221 lines
6.1 KiB
PHP
Raw Normal View History

2022-03-18 07:50:13 +01:00
<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Supprimer';
$text[2] = 'Enregistrer';
$text[3] = 'Lire un évènement';
$text[4] = 'Lire, modifier, supprimer un évènement';
$text[5] = 'Evénement';
$text[6] = 'Date de début';
$text[7] = 'Date de début';
$text[8] = 'Date de fin';
$text[9] = 'Date de fin';
$text[10] = 'Choix de la catégorie d\'évènement.';
$text[11] = 'Catégorie d\'évènement';
$text[12] = 'Choix de la couleur du bandeau dans lequel le texte apparaît.';
$text[13] = 'Couleur de fond';
$text[14] = 'Choix de la couleur du texte.';
$text[15] = 'Couleur du texte';
$text[16] = 'Choix du groupe minimal qui pourra voir et lire cet évènement';
$text[17] = 'Accès en lecture';
$text[18] = 'Choix du groupe minimal qui pourra modifier ou supprimer cet évènement';
$text[19] = 'Accès en modification';
$text[20] ='Version n°';
$couleur = $module::$couleur;
$groupe = $module::$groupe;
break;
case 'en' :
$text[0] = 'Return';
$text[1] = 'Delete';
$text[2] = 'Save';
$text[3] = 'Read event';
$text[4] = 'Read, modify, delete event';
$text[5] = 'Event';
$text[6] = 'Start date';
$text[7] = 'Start date';
$text[8] = 'End date';
$text[9] = 'End date';
$text[10] = 'Choice of event category';
$text[11] = 'Event category';
$text[12] = 'Choice of colour for the banner in which the text appears';
$text[13] = 'Background colour';
$text[14] = 'Choice of text colour';
$text[15] = 'Text colour';
$text[16] = 'Choice of minimum group that can see and read this event';
$text[17] = 'Read access';
$text[18] = 'Choice of minimal group that can modify or delete this event';
$text[19] = 'Edit access';
$text[20] = 'Version No.';
$couleur = $module::$couleur_en;
$groupe = $module::$groupe_en;
break;
}
?>
2022-09-02 08:44:18 +02:00
<?php
// Passage de la langue d'administration à Tinymce et à flatpickr
$lang_admin = 'fr_FR';
$lang_flatpickr = 'fr';
if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en'){
$lang_admin = 'en_GB';
$lang_flatpickr = 'default';
}
?>
<script>
var lang_admin = "<?php echo $lang_admin; ?>";
var lang_flatpickr = "<?php echo $lang_flatpickr; ?>";
</script>
<?php
// Inclusion de tinymce
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/tinymce.min.js' . '"></script>';
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.js' . '"></script>';
echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.css' . '">';
?>
2022-03-18 07:50:13 +01:00
<!--Adaptation de Tinymce en fonction des droits des utilisateurs -->
2022-01-31 09:10:49 +01:00
<?php if( $this->getUser('group') >= $module::$evenement['groupe_mod'] ){
if( $this->getUser('group') >= 2){
2022-03-18 07:50:13 +01:00
$class_tinymce = 'editorWysiwyg';
2022-01-31 09:10:49 +01:00
}
else{
2022-03-18 07:50:13 +01:00
$class_tinymce = 'editorWysiwygComment';
2022-01-31 09:10:49 +01:00
}
}
?>
<?php echo template::formOpen('edition_events'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('edition_retour', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0),
'ico' => 'left',
2022-03-18 07:50:13 +01:00
'value' => $text[0]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<?php if( $this->getUser('group') >= $module::$evenement['groupe_mod'] ){?>
<div class="col2 offset6">
<?php echo template::button('edition_event_delete', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteEvent/' .$module::$evenement['id'],
2022-03-18 07:50:13 +01:00
'value' => $text[1],
2022-01-31 09:10:49 +01:00
'ico' => 'cancel'
]); ?>
</div>
<div class="col2">
<?php echo template::submit('edition_enregistrer',[
2022-03-18 07:50:13 +01:00
'value' => $text[2],
2022-01-31 09:10:49 +01:00
'ico' => 'check'
]); ?>
</div>
<?php
$readonly = false;
}
else{
$readonly = true;
}?>
</div>
<div class="block">
2022-03-18 07:50:13 +01:00
<h4><?php if ($readonly){echo $text[3]; }else{echo $text[4];}?></h4>
2022-01-31 09:10:49 +01:00
2022-03-18 07:50:13 +01:00
<?php if($readonly){echo $text[5].'<br/><div class="block">'.$module::$evenement['texte'].'</div>';}
2022-01-31 09:10:49 +01:00
else{
?>
<div class="row">
<div class="col12">
<?php echo template::textarea('edition_text', [
2022-03-18 07:50:13 +01:00
'label' => $text[5],
'class' => $class_tinymce,
2022-01-31 09:10:49 +01:00
'value' => $module::$evenement['texte']
]); ?>
</div>
</div>
<?php
}
?>
<div class="row">
<div class="col4">
<?php echo template::date('edition_date_debut', [
2022-03-18 07:50:13 +01:00
'help' => $text[6],
'label' => $text[7],
2022-01-31 09:10:49 +01:00
'disabled' => $readonly,
'value' => $module::$evenement['datedebut'],
'vendor' => 'flatpickr'
]); ?>
</div>
<div class="col4">
<?php echo template::date('edition_date_fin', [
2022-03-18 07:50:13 +01:00
'help' => $text[8],
'label' => $text[9],
2022-01-31 09:10:49 +01:00
'disabled' => $readonly,
'value' => $module::$evenement['datefin'],
'vendor' => 'flatpickr'
]); ?>
</div>
</div>
<div class="row">
<?php if( $module::$evenement['categorie'] != '' ){ ?>
<div class="col8">
<?php echo template::select('edition_categorie', $module::$categorie,[
2022-03-18 07:50:13 +01:00
'help' => $text[10],
'label' => $text[11],
2022-01-31 09:10:49 +01:00
'selected' => $module::$evenement['categorie']
]); ?>
</div>
<?php }
else{ ?>
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('edition_couleur_fond', $couleur,[
'help' => $text[12],
'label' => $text[13],
2022-01-31 09:10:49 +01:00
'disabled' => $readonly,
'selected' => $module::$evenement['couleurfond']
]); ?>
</div>
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('edition_couleur_texte', $couleur,[
'help' => $text[14],
'label' => $text[15],
2022-01-31 09:10:49 +01:00
'disabled' => $readonly,
'selected' => $module::$evenement['couleurtexte']
]); ?>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('edition_groupe_lire', $groupe,[
'help' => $text[16],
'label' => $text[17],
2022-01-31 09:10:49 +01:00
'disabled' => $readonly,
'selected' => $module::$evenement['groupe_lire']
]); ?>
</div>
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('edition_groupe_mod', $groupe,[
'help' => $text[18],
'label' => $text[19],
2022-01-31 09:10:49 +01:00
'disabled' => $readonly,
'selected' => $module::$evenement['groupe_mod']
]); ?>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
2022-03-18 07:50:13 +01:00
<div class="moduleVersion">
<?php echo $text[20]; echo $module::VERSION; ?>
2022-01-31 09:10:49 +01:00
</div>