initial commit of code
This commit is contained in:
parent
9b00433142
commit
17d2c64f66
13 changed files with 1928 additions and 0 deletions
81
fields/ReservationField.php
Normal file
81
fields/ReservationField.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Custom\Field;
|
||||
|
||||
include_once 'custom/templates/bazar/circuitscourt.php';
|
||||
|
||||
use YesWiki\Bazar\Field\BazarField;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @Field({"reservation"})
|
||||
*/
|
||||
class ReservationField extends BazarField
|
||||
{
|
||||
public function __construct(array $values, ContainerInterface $services)
|
||||
{
|
||||
parent::__construct($values, $services);
|
||||
$this->size = null;
|
||||
$this->maxChars = null;
|
||||
$this->default = "";
|
||||
}
|
||||
|
||||
protected function renderInput($entry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
protected function renderStatic($entry)
|
||||
{
|
||||
return displayReservation($entry);
|
||||
}
|
||||
|
||||
public function formatValuesBeforeSave($entry)
|
||||
{
|
||||
$mail_receiver = 'cyrille.bombard@lilo.org'; // todo prendre l'email du owner
|
||||
$producteur = baz_valeurs_fiche($entry['listefiche8producteur']);
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
setlocale(LC_TIME, "fr_FR");
|
||||
$date = str_replace(' à 0:00', '', strftime("%A %d %B %Y à %k:%M", strtotime($entry['date_du_trajet'])));
|
||||
$users = $GLOBALS['wiki']->LoadAll("select email from ".$GLOBALS['wiki']->config["table_prefix"]."users");
|
||||
$u = [];
|
||||
//$url = $GLOBALS['wiki']->href('', 'saisie-participants-trajet', 'trajet='.$entry['id_fiche'].'&producteur='.urlencode($producteur['id_fiche']));
|
||||
$url = $GLOBALS['wiki']->href('', 'PagePrincipale');
|
||||
$message = 'Un nouveau trajet pour le producteur '.$producteur['bf_titre'].' le '.$date.' vient d’être proposé par '.$GLOBALS['wiki']->GetUsername().'.
|
||||
|
||||
Nature des productions de ce producteur : '.$producteur['nature_des_productions'].'
|
||||
|
||||
Si vous êtes intéressé par profiter de ce trajet pour vous approvisionner chez ce producteur et ainsi augmenter la résilience alimentaire de votre territoire, inscrivez-vous en cliquant sur '.$url.' , puis allez dans le menu "Je profite d\'un trajet".
|
||||
|
||||
En cas de souci avec l’outil numérique, vous pouvez contacter Cyrille Bombard au 06 63 28 13 11 ou par mail à cyrille.bombard@wision.info';
|
||||
|
||||
$message_html = nl2br($message);
|
||||
if ($GLOBALS['wiki']->getPageTag() == $entry['id_fiche']) {
|
||||
// modification : on ne fait pas de mail
|
||||
} else {
|
||||
// creation : on envoie un mail a tous
|
||||
foreach ($users as $user) {
|
||||
//$u[] = $user["email"];
|
||||
if (!empty($user["email"])) {
|
||||
send_mail('noreply@yeswiki.pro', 'Fors Circuit Court', $user["email"], '[Fors CC] un nouveau trajet pour '.$producteur['bf_titre'].' le '.$date, $message , $message_html);
|
||||
}
|
||||
}
|
||||
}
|
||||
//$message = 'Ce message sera envoyé à :'.implode(', ', $u)."\n\n";
|
||||
return array_merge(
|
||||
['trajet' => $entry['trajet']],
|
||||
);
|
||||
}
|
||||
|
||||
// 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>'
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
99
fields/TrajetField.php
Normal file
99
fields/TrajetField.php
Normal file
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Custom\Field;
|
||||
|
||||
use YesWiki\Bazar\Field\BazarField;
|
||||
use YesWiki\Core\Service\PageManager;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @Field({"trajet"})
|
||||
*/
|
||||
class TrajetField extends BazarField
|
||||
{
|
||||
public function __construct(array $values, ContainerInterface $services)
|
||||
{
|
||||
parent::__construct($values, $services);
|
||||
$this->size = null;
|
||||
$this->maxChars = null;
|
||||
$this->default = "";
|
||||
}
|
||||
|
||||
protected function renderInput($entry)
|
||||
{
|
||||
if (!empty($_GET['trajet'])) {
|
||||
$traj = baz_valeurs_fiche($_GET['trajet']);
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
$date = str_replace(' à 0:00', '', strftime("%A %d %B %Y à %k:%M", strtotime($traj['date_du_trajet'])));
|
||||
$prod = baz_valeurs_fiche($_GET['producteur']);
|
||||
// Do the page change in any case (useful for attach or grid)
|
||||
$oldPage = $GLOBALS['wiki']->GetPageTag();
|
||||
$oldPageArray = $GLOBALS['wiki']->page;
|
||||
$GLOBALS['wiki']->tag = $_GET['producteur'];
|
||||
$GLOBALS['wiki']->page = $GLOBALS['wiki']->LoadPage($_GET['producteur']);
|
||||
|
||||
$output = '<div class="text-left"><h3>Trajet proposé le '.$date.' par '.$traj['owner'].'</h3>';
|
||||
$output .= $GLOBALS['wiki']->Format('===Comment commander==='."\n".$prod["bf_process_commande"]);
|
||||
$output .= $GLOBALS['wiki']->Format('===Produits commandables==='."\n".$prod["bf_produits_commandables"]);
|
||||
$output .= $GLOBALS['wiki']->Format('===RIB pour paiement==='."\n".$prod["bf_rib"]);
|
||||
$output .= '</div>';
|
||||
$output .= '<input type="hidden" name="trajet" value="'.$_GET['trajet'].'" />';
|
||||
$GLOBALS['wiki']->tag = $oldPage;
|
||||
$GLOBALS['wiki']->page = $oldPageArray;
|
||||
|
||||
return $output;
|
||||
} else {
|
||||
return 'Pas normal';
|
||||
}
|
||||
}
|
||||
public function formatValuesBeforeSave($entry)
|
||||
{
|
||||
if (!empty($entry['bf_telephone']) && !empty($entry['trajet'])) {
|
||||
$traj = baz_valeurs_fiche($entry['trajet']);
|
||||
$u = $GLOBALS['wiki']->services->get(PageManager::class)->getOwner($traj['id_fiche']);
|
||||
$u = $GLOBALS['wiki']->LoadUser($u);
|
||||
$mail_receiver = $u['email'];
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
setlocale(LC_TIME, "fr_FR");
|
||||
$date = str_replace(' à 0:00', '', strftime("%A %d %B %Y à %k:%M", strtotime($traj['date_du_trajet'])));
|
||||
$message = 'Une nouvelle personne souhaite profiter du trajet que vous avez proposé le '.$date.'.
|
||||
|
||||
Prénom : '.$entry['bf_prenom'].'
|
||||
Nom : '.$entry['bf_nom'].'
|
||||
Téléphone : '.$entry['bf_telephone'].'
|
||||
Son commentaire lors de son inscription : '.$entry['bf_commentaire'].'
|
||||
|
||||
Ses coordonnées figureront sur la liste des participants à votre trajet que nous vous invitons à éditer avant de partir chez le producteur concerné. Cela vous permettra de vérifier sur place, le jour même avec le producteur, que les commandes de toutes les personnes qui se sont inscrites vous soient bien remises.
|
||||
Pour éditer la liste des participants à votre trajet, cliquez sur ce lien : https://mutualisation.cc/fors/?espace-perso.
|
||||
|
||||
Merci pour la proposition de ce trajet.
|
||||
|
||||
En cas de souci avec l’outil numérique, vous pouvez contacter Cyrille Bombard au 06 63 28 13 11 ou par mail à cyrille.bombard@wision.info';
|
||||
$message_html = nl2br($message);
|
||||
if (!empty($mail_receiver)) {
|
||||
send_mail('noreply@yeswiki.pro', 'Fors Circuit Court', $mail_receiver, '[Fors CC] Une nouvelle personne pour votre trajet du '.$date, $message , $message_html);
|
||||
}
|
||||
}
|
||||
return array_merge(
|
||||
['trajet' => $entry['trajet']],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
protected function renderStatic($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>'
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
89
templates/bazar/circuitscourt.php
Normal file
89
templates/bazar/circuitscourt.php
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
setlocale(LC_TIME, "fr_FR");
|
||||
function calculateFreePlaces($fiche) {
|
||||
//dump($fiche);
|
||||
$entries = $GLOBALS['wiki']->services->get(EntryManager::class)->search(
|
||||
[
|
||||
'queries' => ['trajet'=> $fiche['id_fiche']],
|
||||
'formsIds' => [6],
|
||||
'keywords' => '',
|
||||
'user' => '',
|
||||
'minDate' => '',
|
||||
'correspondance' => ''
|
||||
],
|
||||
true, // filter on read ACL,
|
||||
true // use Guard
|
||||
);
|
||||
//dump($entries);
|
||||
$nbres = count($entries);
|
||||
return (int) $fiche['capacite_de_transport'] - (int) $nbres;
|
||||
}
|
||||
function getStatus($fiche, $consultable = false) {
|
||||
$dateFermeture = date(DATE_W3C, strtotime("-1 days", strtotime($fiche['date_du_trajet'])));
|
||||
$dateContrainte = !empty($fiche['bf_contrainte_date']) ? date(DATE_W3C, strtotime($fiche['bf_contrainte_date'])) : null;
|
||||
if (!empty($dateContrainte)) {
|
||||
$dateFermeture = $dateContrainte;
|
||||
}
|
||||
$dateDisparition = date(DATE_W3C, strtotime("+1 hour", strtotime($fiche['date_du_trajet'])));
|
||||
$dateJour = date(DATE_W3C);
|
||||
if (!empty($dateContrainte) && $dateJour<$dateContrainte) {
|
||||
$status = 'Ouvert';
|
||||
} elseif ($dateJour<$dateFermeture) {
|
||||
$status = 'Ouvert';
|
||||
} elseif ($dateJour<$dateDisparition) {
|
||||
$status = 'Fermé';
|
||||
} else {
|
||||
if (!$consultable) {
|
||||
$status = 'Fini';
|
||||
} else {
|
||||
$status = 'Fini consultable';
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
function displayReservation($fiche) {
|
||||
$output = '';
|
||||
$isProducteur = ($GLOBALS['wiki']->GetUserName() == $GLOBALS['wiki']->GetPageOwner($fiche['listefiche8producteur']));
|
||||
$status = getStatus($fiche, $GLOBALS['wiki']->UserIsOwner($fiche['id_fiche']) || $isProducteur);
|
||||
if ($status == 'Fini consultable' || $status == 'Ouvert' || $status == 'Fermé' ) {
|
||||
// récuperer la fiche producteur
|
||||
$producteur = baz_valeurs_fiche($fiche['listefiche8producteur']);
|
||||
$placesrestantes = calculateFreePlaces($fiche);
|
||||
if ($GLOBALS['wiki']->UserIsOwner($fiche['id_fiche']) || $isProducteur) {
|
||||
$entries = $GLOBALS['wiki']->services->get(EntryManager::class)->search(
|
||||
[
|
||||
'queries' => ['trajet'=> $fiche['id_fiche']],
|
||||
'formsIds' => [6],
|
||||
'keywords' => '',
|
||||
'user' => '',
|
||||
'minDate' => '',
|
||||
'correspondance' => ''
|
||||
],
|
||||
true, // filter on read ACL,
|
||||
true // use Guard
|
||||
);
|
||||
if (count($entries) == 0) {
|
||||
$output .= '<br><strong>Il n\'y a pas encore de personnes qui participent à ce trajet.</strong>';
|
||||
} else {
|
||||
$output .= '<br><strong>Liste des personnes qui participent à ce trajet</strong>';
|
||||
$output .= $GLOBALS['wiki']->Format('{{bazarliste id="6" query="trajet='.$fiche['id_fiche'].'" template="tableau" columnfieldsids=",bf_prenom,bf_nom,bf_telephone,bf_commentaire" {{bazarliste id="6" template="tableau.tpl.html" columnfieldsids=",bf_prenom,bf_nom,bf_telephone,bf_commentaire" search="false" }}');
|
||||
}
|
||||
} else {
|
||||
if ($placesrestantes < 1) {
|
||||
$output .= '<a class="disabled btn btn-primary" href="#">Trajet complet</a>';
|
||||
} else {
|
||||
$output .= '<p class="places"><strong>Nombres de places restantes</strong> : '.$placesrestantes.'</p>';
|
||||
if ($status== 'Ouvert') {
|
||||
$output .= '<a class="btn-participe btn btn-primary" href="'.$GLOBALS['wiki']->href('', 'saisie-participants-trajet', 'trajet='.$fiche['id_fiche'].'&producteur='.urlencode($producteur['id_fiche'])).'"><i class="fa fa-plus"></i> Je profite de ce trajet</a>';
|
||||
} else {
|
||||
$output .= '<a class="disabled btn btn-primary" href="#">Fermé</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
16
templates/bazar/co2.tpl.html
Normal file
16
templates/bazar/co2.tpl.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
$total = 0;
|
||||
$datejour = date("Y-m-d");
|
||||
foreach ($fiches as $f) {
|
||||
$trajet = baz_valeurs_fiche($f['trajet']);
|
||||
if ($trajet['date_du_trajet'] < $datejour) {
|
||||
$producteur = baz_valeurs_fiche($trajet['listefiche8producteur']);
|
||||
$total = $total + floatval($producteur['bf_kms_evites']);
|
||||
}
|
||||
}
|
||||
echo round($total * 0.217 * 100) / 100;
|
||||
?>
|
||||
|
||||
<style>
|
||||
[data-template="co2.tpl.html"] { display:inline-block;}
|
||||
</style>
|
16
templates/bazar/km.tpl.html
Normal file
16
templates/bazar/km.tpl.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
$total = 0;
|
||||
$datejour = date("Y-m-d");
|
||||
foreach ($fiches as $f) {
|
||||
$trajet = baz_valeurs_fiche($f['trajet']);
|
||||
if ($trajet['date_du_trajet'] < $datejour) {
|
||||
$producteur = baz_valeurs_fiche($trajet['listefiche8producteur']);
|
||||
$total = $total + floatval($producteur['bf_kms_evites']);
|
||||
}
|
||||
}
|
||||
echo round($total * 100) / 100;
|
||||
?>
|
||||
|
||||
<style>
|
||||
[data-template="km.tpl.html"] { display:inline-block;}
|
||||
</style>
|
42
templates/bazar/liste_liens.tpl.html
Normal file
42
templates/bazar/liste_liens.tpl.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
if (count($fiches) > 0) : ?>
|
||||
<?php echo $info_res; ?>
|
||||
<ul class="BAZ_liste <?php echo $param['class']; ?>">
|
||||
<?php
|
||||
foreach ($fiches as $fiche): ?>
|
||||
<li class="bazar-entry" <?php echo $fiche['html_data']; ?>>
|
||||
<a class="modalbox" title="<?php echo htmlentities($fiche['bf_titre']); ?>" href="<?php echo $fiche['url']; ?>"
|
||||
<?php if (isset($param['links_in_new_window'])
|
||||
&& filter_var($param['links_in_new_window'], FILTER_VALIDATE_BOOLEAN)) {
|
||||
echo 'target="_blank"';
|
||||
} ?>>
|
||||
<?php
|
||||
$style = '';
|
||||
$color = getCustomValueForEntry(
|
||||
$param['color'],
|
||||
$param['colorfield'],
|
||||
$fiche,
|
||||
''
|
||||
);
|
||||
if (!empty($color)) {
|
||||
echo '<span class="pellet" style="background-color:' . $color . ';"></span> ';
|
||||
}
|
||||
$icon = getCustomValueForEntry(
|
||||
$param['icon'],
|
||||
$param['iconfield'],
|
||||
$fiche,
|
||||
''
|
||||
);
|
||||
if (!empty($icon)) {
|
||||
echo '<i class="' . $icon . '"></i> ';
|
||||
}
|
||||
|
||||
echo '<span class="entry-title">' . $fiche['bf_titre'] . '</span>';
|
||||
?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
</ul>
|
||||
<?php echo $pager_links; ?>
|
||||
<?php endif; ?>
|
16
templates/bazar/nb.tpl.html
Normal file
16
templates/bazar/nb.tpl.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
if ($GLOBALS['wiki']->GetParameter('encours')== true) {
|
||||
include_once 'custom/templates/bazar/circuitscourt.php';
|
||||
foreach ($fiches as $id => $fiche) {
|
||||
$status = getStatus($fiche);
|
||||
$places = calculateFreePlaces($fiche);
|
||||
//dump($places,$status);
|
||||
if ($status != 'Ouvert' || $places == 0) {
|
||||
unset($fiches[$id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo count ($fiches); ?>
|
||||
<style>
|
||||
[data-template="nb.tpl.html"] { display:inline-block;}
|
||||
</style>
|
56
templates/bazar/trajets-demandes.tpl.html
Normal file
56
templates/bazar/trajets-demandes.tpl.html
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
setlocale(LC_TIME, "fr_FR");
|
||||
if (count($fiches) > 0) : ?>
|
||||
<?php echo '<h4>Des demandes de trajets sont en cours !</h4>'; ?>
|
||||
<?php
|
||||
echo '<div class="panel-group" id="accordion-demandes" role="tablist" aria-multiselectable="true">';
|
||||
foreach ($fiches as $fiche): ?>
|
||||
<?php
|
||||
$dateOuverture = date(DATE_W3C, strtotime($fiche['date_souhaitee']));
|
||||
$dateFin = date(DATE_W3C, strtotime($fiche['date_souhaitee_fin']));
|
||||
$dateJour = date(DATE_W3C);
|
||||
if ($dateJour<$dateFin) {
|
||||
$statut = 'Ouvert';
|
||||
}
|
||||
if ($statut== 'Ouvert' ) {
|
||||
// récuperer la fiche producteur
|
||||
$producteur = baz_valeurs_fiche($fiche['listefiche8producteur']);
|
||||
|
||||
$dateTimeObj = new DateTime($fiche['date_souhaitee'], new DateTimeZone('Europe/Paris'));
|
||||
$date_souhaitee =
|
||||
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
|
||||
$dateTimeObj,
|
||||
'eeee d MMMM y à HH:mm',
|
||||
'fr'
|
||||
));
|
||||
$dateTimeObj = new DateTime($fiche['date_souhaitee_fin'], new DateTimeZone('Europe/Paris'));
|
||||
$date_souhaitee_fin =
|
||||
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
|
||||
$dateTimeObj,
|
||||
'eeee d MMMM y à HH:mm',
|
||||
'fr'
|
||||
));
|
||||
|
||||
echo '<div class="bazar-entry panel panel-default collapsed" '.$fiche['html_data'].'>
|
||||
<div class="panel-heading collapsed"
|
||||
data-target="#collapse'.$fiche['id_fiche'].'"
|
||||
data-toggle="collapse">
|
||||
<h4 class="panel-title">
|
||||
Trajet demandé pour '.$producteur['bf_titre'].'<br /><span style="color:#222">du '.$date_souhaitee.' au '.$date_souhaitee_fin.'</span>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse'.$fiche['id_fiche'].'" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading'.$fiche['id_fiche'].'">
|
||||
<div class="panel-body">
|
||||
'.baz_voir_fiche(true, $fiche).'
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
?>
|
||||
<?php }
|
||||
endforeach; ?>
|
||||
</div>
|
||||
<?php echo $pager_links; ?>
|
||||
<?php else: ?>
|
||||
<?php echo '<h4>Pour info, aucun habitant n\'a demandé un trajet particulier actuellement.</h4>'; ?>
|
||||
<?php endif; ?>
|
51
templates/bazar/trajets-proposes.tpl.html
Normal file
51
templates/bazar/trajets-proposes.tpl.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
setlocale(LC_TIME, "fr_FR");
|
||||
if (count($fiches) > 0) : ?>
|
||||
<?php echo $info_res; ?>
|
||||
<?php
|
||||
foreach ($fiches as $fiche): ?>
|
||||
<?php
|
||||
$dateFermeture = date(DATE_W3C, strtotime("-1 days", strtotime($fiche['date_du_trajet'])));
|
||||
$dateDisparition = date(DATE_W3C, strtotime("+2 days", strtotime($fiche['date_du_trajet'])));
|
||||
$dateJour = date(DATE_W3C);
|
||||
if ($dateJour<$dateFermeture) {
|
||||
$statut = 'Ouvert';
|
||||
} elseif ($dateJour<$dateDisparition) {
|
||||
$statut = 'Fermé';
|
||||
} else {
|
||||
$statut = 'Fini';
|
||||
}
|
||||
if ($statut== 'Ouvert' ) {
|
||||
// récuperer la fiche producteur
|
||||
$producteur = baz_valeurs_fiche($fiche['listefiche8producteur']);
|
||||
$dateTimeObj = new DateTime($fiche['date_du_trajet'], new DateTimeZone('Europe/Paris'));
|
||||
$date =
|
||||
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
|
||||
$dateTimeObj,
|
||||
'eeee d MMMM y à HH:mm',
|
||||
'fr'
|
||||
));
|
||||
//$date = str_replace(' à 0:00', '', strftime("%A %d %B %Y à %k:%M", strtotime($fiche['date_du_trajet'])));
|
||||
echo '<div class="bazar-entry panel panel-default collapsed" '.$fiche['html_data'].'>
|
||||
<div class="panel-heading collapsed"
|
||||
data-target="#collapse'.$fiche['id_fiche'].'"
|
||||
data-toggle="collapse">
|
||||
<h4 class="panel-title">
|
||||
Trajet proposé pour '.$producteur['bf_titre'].'<br /><span style="color:#222">le '.$date.'</span>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse'.$fiche['id_fiche'].'" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading'.$fiche['id_fiche'].'">
|
||||
<div class="panel-body">
|
||||
'.baz_voir_fiche(true, $fiche).'
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
// echo '<p class="places">Nombres de places disponibles : '.$fiche['capacite_de_transport'].'</p>';
|
||||
|
||||
|
||||
?>
|
||||
<?php }
|
||||
endforeach; ?>
|
||||
<?php echo $pager_links; ?>
|
||||
<?php endif; ?>
|
47
templates/bazar/trajets.tpl.html
Normal file
47
templates/bazar/trajets.tpl.html
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
|
||||
setlocale(LC_TIME, "fr_FR");
|
||||
include_once 'custom/templates/bazar/circuitscourt.php';
|
||||
|
||||
if (count($fiches) > 0) {
|
||||
echo $info_res;
|
||||
foreach ($fiches as $fiche) {
|
||||
$statut = getStatus($fiche);
|
||||
if ($statut== 'Ouvert' || $statut== 'Fermé' ) {
|
||||
// récuperer la fiche producteur
|
||||
$producteur = baz_valeurs_fiche($fiche['listefiche8producteur']);
|
||||
$dateTimeObj = new DateTime($fiche['date_du_trajet'], new DateTimeZone('Europe/Paris'));
|
||||
$dateFormatted =
|
||||
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
|
||||
$dateTimeObj,
|
||||
'eeee d MMMM y à HH:mm',
|
||||
'fr'
|
||||
));
|
||||
|
||||
//$date = str_replace(' à 0:00', '', strftime("%A %d %B %Y à %k:%M", strtotime($fiche['date_du_trajet'])));
|
||||
echo '<h2 class="entry-title"><a class="modalbox" title="'.htmlspecialchars('Trajet du '.$date).'" href="'.$GLOBALS['wiki']->href('', $fiche['id_fiche']).'">Trajet du '.$dateFormatted.'</a></h2>'."\n";
|
||||
echo '<h4>Producteur concerné</h4>'."\n";
|
||||
echo '<p class="producteur"><strong>'.$producteur['bf_titre'].'</strong></p>';
|
||||
|
||||
echo '<p class="nature"><strong>Produits possibles</strong> : '.str_replace(',', ', ', $producteur['checkboxListeProduitsVendusproduits_vendus']).'</p>';
|
||||
$lieux = baz_valeurs_liste('ListeLieuxRecuperationDesCommandes');
|
||||
echo '<p class="lieu"><strong>Lieu de récupération de la commande</strong> : '.$lieux['label'][$fiche["listeListeLieuxRecuperationDesCommandeslieu_de_retrait_des_commandes"]].'</p>';
|
||||
echo '<p class="adresse"><strong>Adresse de récupération de la commande</strong> : '.$GLOBALS['wiki']->format($fiche["adresse_de_livraison"]).'</p>';
|
||||
$dateTimeObj = new DateTime($fiche['date_heure_recuperation_commandes'], new DateTimeZone('Europe/Paris'));
|
||||
$dateRecup =
|
||||
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
|
||||
$dateTimeObj,
|
||||
'eeee d MMMM y à HH:mm',
|
||||
'fr'
|
||||
));
|
||||
echo '<p class="date"><strong>Date et heure pour récupérer la commande</strong> : '.$dateRecup.'</p>';
|
||||
echo '<p class="adresse"><strong>Information supplémentaire</strong> : '.$GLOBALS['wiki']->format($fiche["information_supplementaire"]).'</p>';
|
||||
echo displayReservation($fiche);
|
||||
echo '<hr />';
|
||||
}
|
||||
}
|
||||
echo $pager_links;
|
||||
} else {
|
||||
echo '<div class="alert alert-info">Il y a 0 fiche.</div>';
|
||||
}
|
||||
?>
|
34
templates/login/modal.twig
Normal file
34
templates/login/modal.twig
Normal file
|
@ -0,0 +1,34 @@
|
|||
{% extends "@login/default.twig" %}
|
||||
|
||||
{% block logoutLinkClass %}btn btn-default{% endblock %}
|
||||
|
||||
{% block connected %}
|
||||
<a href="?espace-perso" role="button" class="{{ not nobtn ? 'btn btn-default ' ~ btnclass : '' }}">
|
||||
Espace Perso
|
||||
</a>
|
||||
<a href="?PagePrincipale&action=logout" role="button" class="{{ not nobtn ? 'btn btn-default ' ~ btnclass : '' }}">
|
||||
<i class="fas fa-sign-out-alt"></i>
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block formClass %}login-form-modal{% endblock %}
|
||||
{% block formTitle %}{% endblock %}
|
||||
|
||||
{% block notConnected %}
|
||||
<a href="#LoginModal" role="button" class="{{ not nobtn ? 'btn btn-default ' ~ btnclass : '' }}" data-toggle="modal">
|
||||
<i class="fa fa-user"></i> {{ _t('LOGIN_LOGIN') }}
|
||||
</a>
|
||||
<div class="modal fade" id="LoginModal" tabindex="-1" role="dialog" aria-labelledby="LoginModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="LoginModalLabel">{{ _t('LOGIN_LOGIN') }}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ block('form') }}
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div> <!-- /#LoginModal-->
|
||||
{% endblock %}
|
1380
wiki-models/mutualisation.cc--fors/default-content.sql
Normal file
1380
wiki-models/mutualisation.cc--fors/default-content.sql
Normal file
File diff suppressed because one or more lines are too long
1
wiki-models/mutualisation.cc--fors/infos.json
Normal file
1
wiki-models/mutualisation.cc--fors/infos.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"label":"https:\/\/mutualisation.cc\/fors","sourceUrl":"https:\/\/mutualisation.cc\/fors","dateOfCreation":"2023-09-18 15:42:10"}
|
Loading…
Add table
Reference in a new issue