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

157 lines
4.7 KiB
PHP
Raw Normal View History

2022-03-18 07:50:13 +01:00
<?php
// Lexique
2022-09-11 09:42:42 +02:00
include('./module/agenda/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_agenda.php');
2022-09-02 08:44:18 +02:00
?>
<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-09-11 09:42:42 +02:00
echo template::formOpen('creation_events'); ?>
2022-01-31 09:10:49 +01:00
<div class="row">
<div class="col2">
<?php echo template::button('creation_retour', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0),
'ico' => 'left',
2022-09-11 09:42:42 +02:00
'value' => $text['agenda_view']['creation'][0]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
2022-03-18 07:50:13 +01:00
<?php if( $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'config', 'droit_creation']) ){
2022-01-31 09:10:49 +01:00
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
}
?>
<!--Suite de la <div class="row"> -->
<div class="col2 offset8">
2022-03-18 07:50:13 +01:00
<?php echo template::submit('creation_enregistrer',[
2022-09-11 09:42:42 +02:00
'value' => $text['agenda_view']['creation'][1]
2022-03-18 07:50:13 +01:00
]); ?>
2022-01-31 09:10:49 +01:00
</div>
<!-- Fermeture de la <div class="row"> si test true -->
</div>
<div class="block">
2022-09-11 09:42:42 +02:00
<h4><?php echo $text['agenda_view']['creation'][2]; ?></h4>
2022-01-31 09:10:49 +01:00
<div class="row">
<div class="col12">
<?php echo template::textarea('creation_text', [
2022-09-11 09:42:42 +02:00
'label' => $text['agenda_view']['creation'][3],
2022-03-18 07:50:13 +01:00
'class' => $class_tinymce,
2022-09-11 09:42:42 +02:00
'value' => $text['agenda_view']['creation'][4].$module::$jour.'/'.$module::$mois.'/'.$module::$annee
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::date('creation_date_debut', [
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][5],
'label' => $text['agenda_view']['creation'][6],
2022-01-31 09:10:49 +01:00
'value' => $module::$time_unix_deb,
'vendor' => 'flatpickr'
]); ?>
</div>
<div class="col4">
<?php echo template::date('creation_date_fin', [
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][7],
'label' => $text['agenda_view']['creation'][8],
2022-01-31 09:10:49 +01:00
'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,[
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][9],
'label' => $text['agenda_view']['creation'][10]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<?php }
else{ ?>
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('creation_couleur_fond', $couleur,[
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][11],
'label' => $text['agenda_view']['creation'][12],
2022-01-31 09:10:49 +01:00
'selected' => 'black'
]); ?>
</div>
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('creation_couleur_texte', $couleur,[
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][13],
'label' => $text['agenda_view']['creation'][14],
2022-01-31 09:10:49 +01:00
'selected' => 'white'
]); ?>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col4">
2022-03-18 07:50:13 +01:00
<?php echo template::select('creation_groupe_lire', $groupe,[
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][15],
'label' => $text['agenda_view']['creation'][16],
2022-01-31 09:10:49 +01:00
'selected' => '0'
]); ?>
</div>
<div class="col4">
<?php
$groupe_mini = $this->getUser('group');
if ($groupe_mini == 3){ $groupe_mini = 2;}
?>
2022-03-18 07:50:13 +01:00
<?php echo template::select('creation_groupe_mod', $groupe,[
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][17],
'label' => $text['agenda_view']['creation'][18],
2022-01-31 09:10:49 +01:00
'selected' => $groupe_mini
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('creation_mailing_validation', true, $text['agenda_view']['creation'][19], [
2022-01-31 09:10:49 +01:00
'checked' => false,
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][20]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col4">
<!-- Sélection d'un fichier txt ou csv -->
<?php echo template::select('creation_mailing_adresses', $module::$liste_adresses, [
2022-09-11 09:42:42 +02:00
'help' => $text['agenda_view']['creation'][21],
'label' => $text['agenda_view']['creation'][22]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
<?php }
else{?>
<!--Fermeture de la <div class="row"> si test false-->
</div>
2022-03-18 07:50:13 +01:00
<div>
2022-09-11 09:42:42 +02:00
<h4><?php echo $text['agenda_view']['creation'][23]; ?></h4>
2022-01-31 09:10:49 +01:00
</div>
<?php ;} ?>
<?php echo template::formClose(); ?>
2022-03-18 07:50:13 +01:00
<div class="moduleVersion">
2022-09-11 09:42:42 +02:00
<?php echo $text['agenda_view']['creation'][24];echo $module::VERSION; ?>
2022-01-31 09:10:49 +01:00
</div>