Deltacms/module/agenda/view/creation/creation.php

230 lines
7.2 KiB
PHP

<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Enregistrer';
$text[2] = 'Créer un évènement';
$text[3] = 'Evènement';
$text[4] = 'Votre évènement du ';
$text[5] = 'Choix de la date et de l\'heure de début de l\'évènement';
$text[6] = 'Date de début';
$text[7] = 'Choix de la date et de l\'heure de fin de l\'évènement';
$text[8] = 'Date de fin';
$text[9] = 'Choix de la catégorie d\'évènement.';
$text[10] = 'Catégorie d\'évènement';
$text[11] = 'Choix de la couleur du bandeau dans lequel le texte apparaît.';
$text[12] = 'Couleur de fond';
$text[13] = 'Choix de la couleur du texte.';
$text[14] = 'Coleur du texte';
$text[15] = 'Choix du groupe minimal qui pourra voir et lire cet évènement';
$text[16] = 'Accès en lecture';
$text[17] = 'Choix du groupe minimal qui pourra modifier ou supprimer cet évènement';
$text[18] = 'Accès en modification';
$text[19] = 'Envoi d\'un courriel';
$text[20] = 'Case cochée un courriel sera adressé aux destinataires.';
$text[21] = 'Vous pouvez sélectionner ici un fichier txt ou csv qui contient une suite d\'adresses courielles séparées par une virgule.'.'<br/>'.'3 fichiers sont générés automatiquement à partir des utilisateurs inscrits et vous pouvez, en configuration, ajouter vos propres fichiers d\'adresses';
$text[22] = 'Sélection d\'un fichier destinataires';
$text[23] = 'Vous n\'avez pas accès à la création d\'évènements, connectez-vous.';
$text[24] = 'Version n°';
$couleur = $module::$couleur;
$groupe = $module::$groupe;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Save';
$text[2] = 'Create event';
$text[3] = 'Event';
$text[4] = 'Your event of ';
$text[5] = 'Choose the date and time of the event';
$text[6] = 'Start date';
$text[7] = 'Choice of end date and time for the event';
$text[8] = 'End date';
$text[9] = 'Choice of event category';
$text[10] = 'Event category';
$text[11] = 'Choice of colour for the banner in which the text appears';
$text[12] = 'Background colour';
$text[13] = 'Choice of text colour';
$text[14] = 'Text colour';
$text[15] = 'Choice of minimum group that can see and read this event';
$text[16] = 'Read access';
$text[17] = 'Choice of minimal group that will be able to modify or delete this event';
$text[18] = 'Modify access';
$text[19] = 'Sending an email';
$text[20] = 'Checked box will send email to recipients';
$text[21] = 'Here you can select a txt or csv file that contains a comma-separated sequence of e-mail addresses.'.'<br/>'.'3 files are generated automatically from the registered users and you can, in configuration, add your own address files';
$text[22] = 'Select a recipient file';
$text[23] = 'You do not have access to event creation, please login';
$text[24] = 'Version No.';
$couleur = $module::$couleur_en;
$groupe = $module::$groupe_en;
break;
}
?>
<?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' . '">';
?>
<?php echo template::formOpen('creation_events'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('creation_retour', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0),
'ico' => 'left',
'value' => $text[0]
]); ?>
</div>
<?php if( $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'config', 'droit_creation']) ){
if( $this->getUser('group') >= 2){
$class_tinymce = 'editorWysiwyg';
}
else{
$class_tinymce = 'editorWysiwygComment';
}
?>
<!--Suite de la <div class="row"> -->
<div class="col2 offset8">
<?php echo template::submit('creation_enregistrer',[
'value' => $text[1]
]); ?>
</div>
<!-- Fermeture de la <div class="row"> si test true -->
</div>
<div class="block">
<h4><?php echo $text[2]; ?></h4>
<div class="row">
<div class="col12">
<?php echo template::textarea('creation_text', [
'label' => $text[3],
'class' => $class_tinymce,
'value' => $text[4].$module::$jour.'/'.$module::$mois.'/'.$module::$annee
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::date('creation_date_debut', [
'help' => $text[5],
'label' => $text[6],
'value' => $module::$time_unix_deb,
'vendor' => 'flatpickr'
]); ?>
</div>
<div class="col4">
<?php echo template::date('creation_date_fin', [
'help' => $text[7],
'label' => $text[8],
'value' => $module::$time_unix_fin,
'vendor' => 'flatpickr'
]); ?>
</div>
</div>
<div class="row">
<?php if( is_file($module::DATAMODULE.'categories/categories.json') && $this->getData(['module', $this->getUrl(0), 'categories', 'valCategories' ]) ){ ?>
<div class="col8">
<?php echo template::select('creation_categorie', $module::$categorie,[
'help' => $text[9],
'label' => $text[10]
]); ?>
</div>
<?php }
else{ ?>
<div class="col4">
<?php echo template::select('creation_couleur_fond', $couleur,[
'help' => $text[11],
'label' => $text[12],
'selected' => 'black'
]); ?>
</div>
<div class="col4">
<?php echo template::select('creation_couleur_texte', $couleur,[
'help' => $text[13],
'label' => $text[14],
'selected' => 'white'
]); ?>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('creation_groupe_lire', $groupe,[
'help' => $text[15],
'label' => $text[16],
'selected' => '0'
]); ?>
</div>
<div class="col4">
<?php
$groupe_mini = $this->getUser('group');
if ($groupe_mini == 3){ $groupe_mini = 2;}
?>
<?php echo template::select('creation_groupe_mod', $groupe,[
'help' => $text[17],
'label' => $text[18],
'selected' => $groupe_mini
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::checkbox('creation_mailing_validation', true, $text[19], [
'checked' => false,
'help' => $text[20]
]); ?>
</div>
<div class="col4">
<!-- Sélection d'un fichier txt ou csv -->
<?php echo template::select('creation_mailing_adresses', $module::$liste_adresses, [
'help' => $text[21],
'label' => $text[22]
]); ?>
</div>
</div>
</div>
<?php }
else{?>
<!--Fermeture de la <div class="row"> si test false-->
</div>
<div>
<h4><?php echo $text[23]; ?></h4>
</div>
<?php ;} ?>
<?php echo template::formClose(); ?>
<div class="moduleVersion">
<?php echo $text[24];echo $module::VERSION; ?>
</div>