fix: bug trajet perdu apres modif
This commit is contained in:
parent
f36dd9cf46
commit
473125d0b9
1 changed files with 7 additions and 6 deletions
|
@ -22,23 +22,24 @@ class TrajetField extends BazarField
|
|||
|
||||
protected function renderInput($entry)
|
||||
{
|
||||
if (!empty($_GET['trajet'])) {
|
||||
$traj = baz_valeurs_fiche($_GET['trajet']);
|
||||
if ($trajet = !empty($_GET['trajet']) || $trajet = !empty($entry['trajet'])) {
|
||||
$traj = baz_valeurs_fiche($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']);
|
||||
$producteur = $_GET['producteur'] ?? $traj['listefiche8producteur'];
|
||||
$prod = baz_valeurs_fiche($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']);
|
||||
$GLOBALS['wiki']->tag = $producteur;
|
||||
$GLOBALS['wiki']->page = $GLOBALS['wiki']->LoadPage($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'].'" />';
|
||||
$output .= '<input type="hidden" name="trajet" value="'.$trajet.'" />';
|
||||
$GLOBALS['wiki']->tag = $oldPage;
|
||||
$GLOBALS['wiki']->page = $oldPageArray;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue