Commit a970ff28 authored by Loïc DAYOT's avatar Loïc DAYOT
Browse files

feat(): Allow duplicate event.

Allow duplicate event when display one event. Solution for repeted events.

close #6
parent 35075851
...@@ -110,6 +110,7 @@ echo $campaigns->returnTagMessage($event->tags); ...@@ -110,6 +110,7 @@ echo $campaigns->returnTagMessage($event->tags);
// Display actions in context div // Display actions in context div
echo "<h1>Actions</h1>\n"; echo "<h1>Actions</h1>\n";
echo "<a href=\"ical.php?id=". $event_id. "\" title=\"Export au format iCal\"><i class='fa fa-calendar'></i> Ajouter à mon calendrier</a><br/>"; echo "<a href=\"ical.php?id=". $event_id. "\" title=\"Export au format iCal\"><i class='fa fa-calendar'></i> Ajouter à mon calendrier</a><br/>";
echo "<a href=\"submit.php?id=" . $event_id . "&new\"><i class='fa fa-files-o'></i> Dupliquer évènement</a><br/>";
if ($session->exists('agenda_libre_id')) if ($session->exists('agenda_libre_id'))
{ // moderateur { // moderateur
echo "<a href=\"editevent.php?id=" . $event_id . "\"><i class='fa fa-pencil'></i> &Eacute;diter évènement</a><br/>"; echo "<a href=\"editevent.php?id=" . $event_id . "\"><i class='fa fa-pencil'></i> &Eacute;diter évènement</a><br/>";
......
<?php <?php
/* /*
* Copyright 2004-2015 * Copyright 2004-2017
* - Melanie Bats <melanie POINT bats CHEZ utbm POINT fr> * - Melanie Bats <melanie POINT bats CHEZ utbm POINT fr>
* - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org> * - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
* - Loic Dayot <ldayot CHEZ epnadmin POINT net> * - Loic Dayot <ldayot CHEZ epnadmin POINT net>
...@@ -29,9 +29,14 @@ put_header("Soumettre un évènement"); ...@@ -29,9 +29,14 @@ put_header("Soumettre un évènement");
echo "<h2>Soumettre un évènement</h2>"; echo "<h2>Soumettre un évènement</h2>";
$event = new event($db, 0); // get id in case of duplicate event request
$event->start = time(); $id = get_safe_integer('id', 0);
$event->end = time() + 60*60;
$event = new event($db, $id);
// in case of duplicate event request, forget original id
$event->id = 0;
$event->start = get_safe_integer('start', time());
$event->end = $event->start + 60*60;
function alertModerators ($event) function alertModerators ($event)
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment