mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-26 21:27:34 +02:00
Upgrade LBCAlerte to version 3.3
Add upgrade script
This commit is contained in:
20
sources/app/annonce/views/backup.phtml
Normal file
20
sources/app/annonce/views/backup.phtml
Normal file
@ -0,0 +1,20 @@
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<legend>Annonce déjà sauvegardée</legend>
|
||||
|
||||
<p>
|
||||
Vous avez déjà sauvegardé cette annonce.
|
||||
Souhaitez vous écraser la sauvegarde ?
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Titre : <?php echo htmlspecialchars($ad_stored->getTitle()); ?></li>
|
||||
<li>Url : <?php echo htmlspecialchars($ad_stored->getLink()); ?></li>
|
||||
</ul>
|
||||
<p>
|
||||
<input type="hidden" name="id" value="<?php echo $ad_stored->getId(); ?>" />
|
||||
<input type="submit" value="Oui" style="font-weight: bold;" />
|
||||
| <a href="?mod=annonce">Non</a>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
17
sources/app/annonce/views/form-comment.phtml
Normal file
17
sources/app/annonce/views/form-comment.phtml
Normal file
@ -0,0 +1,17 @@
|
||||
<h2>
|
||||
<?php echo htmlspecialchars($ad->getTitle()); ?>
|
||||
</h2>
|
||||
|
||||
<form action="" method="post">
|
||||
<p><label for="comment">Votre note :</label></p>
|
||||
<p>
|
||||
<textarea name="comment" cols="75" rows="5"><?php
|
||||
echo htmlspecialchars($ad->getComment()); ?></textarea>
|
||||
<br />
|
||||
<p>
|
||||
<input type="submit" value="Enregistrer" />
|
||||
| <a href="?mod=annonce&a=view&id=<?php
|
||||
echo $ad->getId(); ?>">annuler</a>
|
||||
</p>
|
||||
</p>
|
||||
</form>
|
15
sources/app/annonce/views/form-delete.phtml
Normal file
15
sources/app/annonce/views/form-delete.phtml
Normal file
@ -0,0 +1,15 @@
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<legend>Supprimer cette annonce ?</legend>
|
||||
<ul>
|
||||
<li>Titre : <?php echo htmlspecialchars($ad->getTitle()); ?></li>
|
||||
<li>Url : <?php echo htmlspecialchars($ad->getLink()); ?></li>
|
||||
</ul>
|
||||
<p>
|
||||
<input type="hidden" name="id" value="<?php echo $_GET["id"]; ?>" />
|
||||
<input type="submit" value="Oui" style="font-weight: bold;" />
|
||||
| <a href="?mod=annonce<?php
|
||||
echo $referer == "view" ? '&a=view&id='.$ad->getId() : ''; ?>">Non</a>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
28
sources/app/annonce/views/form.phtml
Normal file
28
sources/app/annonce/views/form.phtml
Normal file
@ -0,0 +1,28 @@
|
||||
<form action="" method="post">
|
||||
<h2>Sauvegarder une annonce</h2>
|
||||
<dl>
|
||||
<dt>
|
||||
<label for="url">URL de l'annonce</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<input type="text" id="link" name="link" value="<?php
|
||||
echo htmlspecialchars($link);
|
||||
?>" size="75" />
|
||||
<?php if (isset($errors["link"])) : ?>
|
||||
<p class="error"><?php echo $errors["link"]; ?></p>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
<p><input type="submit" value="Enregistrer" />
|
||||
| <a href="?mod=annonce">annuler</a></p>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
103
sources/app/annonce/views/index.phtml
Normal file
103
sources/app/annonce/views/index.phtml
Normal file
@ -0,0 +1,103 @@
|
||||
<p>
|
||||
<?php if (0 < $nbAds = count($ads)) : ?>
|
||||
<strong><?php echo $nbAds ?> <?php
|
||||
echo $nbAds > 1?"annonces sauvegardées":"annonce sauvegardée"; ?></strong> |
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&a=form" class="link-create-ad">Sauvegarder une annonce</a>
|
||||
</p>
|
||||
|
||||
<table style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20px"></th>
|
||||
<th style="width: 20px"></th>
|
||||
<th>
|
||||
<?php if ($sort == "title") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=title">Titre</a>
|
||||
</th>
|
||||
<th style="width: 200px">
|
||||
<?php if ($sort == "author") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=author">Auteur</a>
|
||||
</th>
|
||||
<th style="width: 200px">
|
||||
<?php if ($sort == "date_created") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=date_created">Date de sauvegarde</a>
|
||||
</th>
|
||||
<th style="width: 200px">
|
||||
<?php if ($sort == "date") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=date">Date de publication</a>
|
||||
</th>
|
||||
<th style="width: 200px">
|
||||
<?php if ($sort == "category") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=category">Catégorie</a>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<?php if ($sort == "price") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=price">Prix</a>
|
||||
</th>
|
||||
<th style="width: 200px">
|
||||
<?php if ($sort == "zip_code") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=zip_code">Code postal</a>
|
||||
</th>
|
||||
<th style="width: 200px">
|
||||
<?php if ($sort == "city") : ?>
|
||||
<img src="static/images/sort-<?php echo $order; ?>.png" alt="" />
|
||||
<?php endif; ?>
|
||||
<a href="?mod=annonce&sort=city">Villes</a>
|
||||
</th>
|
||||
<th style="width: 20px"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (0 == $nbAds) : ?>
|
||||
<tr><td colspan="11">Aucune annonce sauvegardée</td></tr>
|
||||
<?php else: ?>
|
||||
<?php $i = 1; foreach ($ads AS $ad) : ?>
|
||||
<?php
|
||||
$date = implode("/", array_reverse(explode("-", $ad->getDate())));
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $i++; ?></td>
|
||||
<td>
|
||||
<?php if ($photos = $ad->getPhotos()) : ?>
|
||||
<img src="<?php echo $adPhoto->getPublicDestination($photos[0]["local"]); ?>" alt=""
|
||||
style="max-width: 100px; max-height: 100px;" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="title"><a href="?mod=annonce&a=view&id=<?php echo $ad->getId(); ?>"><?php
|
||||
echo $ad->getTitle()?htmlspecialchars($ad->getTitle()):"-"; ?></a></td>
|
||||
<td><?php echo htmlspecialchars($ad->getAuthor()); ?></td>
|
||||
<td><?php echo date("d/m/Y à H:i", strtotime($ad->getDateCreated())); ?></td>
|
||||
<td><?php echo htmlspecialchars($date); ?></td>
|
||||
<td><?php echo htmlspecialchars($ad->getCategory()); ?></td>
|
||||
<td style="text-align: right;">
|
||||
<?php if ($price = $ad->getPrice()) : ?>
|
||||
<?php echo number_format($price, 0, ",", " ")." ";
|
||||
echo htmlspecialchars($ad->getCurrency()); ?>
|
||||
<?php else: ?>
|
||||
-
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo htmlspecialchars($ad->getZipCode()); ?></td>
|
||||
<td><?php echo htmlspecialchars($ad->getCity()); ?></td>
|
||||
<td><a href="?mod=annonce&a=form-delete&id=<?php echo $ad->getId(); ?>"
|
||||
title="Supprimer l'annonce"><span class="fa fa-times"></span></a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
95
sources/app/annonce/views/view.phtml
Normal file
95
sources/app/annonce/views/view.phtml
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
$date = implode("/", array_reverse(explode("-", $ad->getDate())));
|
||||
?>
|
||||
<p>
|
||||
<a href="?mod=annonce">< retour à la liste des annonces sauvegardées</a> |
|
||||
<a href="?mod=annonce&a=form-delete&id=<?php echo $ad->getId(); ?>&r=view"
|
||||
title="Supprimer l'annonce"><span class="fa fa-times"></span> supprimer l'annonce</a>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<?php echo htmlspecialchars($ad->getTitle()); ?>
|
||||
<a href="<?php echo $ad->getLink(); ?>"
|
||||
target="_blank"
|
||||
title="Ouvrir sur <?php echo $ad_config->getOption("site_name");
|
||||
?>"><span class="fa fa-external-link"></span></a>
|
||||
</h2>
|
||||
<div class="annonce">
|
||||
<div class="annonce-data">
|
||||
<ul>
|
||||
<li class="annonce-data-line">
|
||||
<span class="annonce-label">Auteur</span><span
|
||||
class="annonce-value"><?php echo $ad->getAuthor(); ?></span>
|
||||
</li>
|
||||
<?php if ($value = $ad->getPrice()) : ?>
|
||||
<li class="annonce-data-line">
|
||||
<span class="annonce-label">Prix</span><span
|
||||
class="annonce-value"><?php
|
||||
echo number_format($value, 0, ",", " ")." ";
|
||||
echo htmlspecialchars($ad->getCurrency());
|
||||
?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li class="annonce-data-line">
|
||||
<span class="annonce-label">Date</span><span
|
||||
class="annonce-value"><?php
|
||||
echo $date; ?></span>
|
||||
</li>
|
||||
<li class="annonce-data-line">
|
||||
<span class="annonce-label">Catégorie</span><span
|
||||
class="annonce-value"><?php
|
||||
echo htmlspecialchars($ad->getCategory()); ?></span>
|
||||
</li>
|
||||
<?php if ($value = $ad->getCity()) : ?>
|
||||
<li class="annonce-data-line">
|
||||
<span class="annonce-label">Ville</span><span
|
||||
class="annonce-value">
|
||||
<?php echo htmlspecialchars($ad->getZipCode()); ?>
|
||||
<?php echo htmlspecialchars($value); ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($ad->getProperties() AS $name => $value) : ?>
|
||||
<?php if ($value) : ?>
|
||||
<li class="annonce-data-line">
|
||||
<span class="annonce-label"><?php echo htmlspecialchars($name); ?></span><span
|
||||
class="annonce-value">
|
||||
<?php echo htmlspecialchars($value); ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<div class="annonce-description">
|
||||
<span class="annonce-label">Description</span>
|
||||
<p><?php
|
||||
echo nl2br(htmlspecialchars($ad->getDescription())); ?></p>
|
||||
</div>
|
||||
<div class="annonce-comment">
|
||||
<span class="annonce-label">Note</span>
|
||||
<div>
|
||||
<p><?php echo nl2br(htmlspecialchars($note = $ad->getComment())); ?></p>
|
||||
<p><a href="?mod=annonce&a=form-comment&id=<?php echo $ad->getId(); ?>"
|
||||
class="button">
|
||||
<?php if (!$note) : ?>
|
||||
Ajouter une note
|
||||
<?php else: ?>
|
||||
Modifier la note
|
||||
<?php endif; ?>
|
||||
</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $photos = $ad->getPhotos(); ?>
|
||||
<div class="annonce-photos">
|
||||
<?php foreach ($photos AS $photo) : ?>
|
||||
<div class="annonce-photo">
|
||||
<a href="<?php echo $adPhoto->getPublicDestination($photo["local"]);
|
||||
?>" target="_blank"><img
|
||||
src="<?php echo $adPhoto->getPublicDestination($photo["local"]); ?>"
|
||||
alt="" class="annonce-photo-img" /></a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user