Skip to content
This repository has been archived by the owner on Oct 31, 2018. It is now read-only.

Multiple reminders - Email & Popup #410

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
19f3df3
read alarm-related data from calender-event
Iridias Mar 20, 2014
c6c7834
show alarm times in event form and support editing it
Iridias Mar 20, 2014
b0743f6
added german and english translation for simple alarm feature
Iridias Mar 20, 2014
ce03dbe
allow setting valarm-actiontype via request / selectbox-entries for a…
Iridias Apr 14, 2014
602abb4
better validation for accessclass, fixes #423
georgehrke Jul 4, 2014
dac0113
add ocsid
georgehrke Jul 7, 2014
4390e12
Fixed weird event registration
PVince81 Jul 8, 2014
49e8185
Possible Fix #463
libasys Jul 13, 2014
1445d6c
backport 483
georgehrke Jul 20, 2014
f91e27b
Fix import.
michaelkuhn Jul 24, 2014
023367f
don't change active state when updating calendar
georgehrke Jul 25, 2014
b434d26
Allow only owner of calendar edit shared calendars - pr 385
georgehrke Aug 7, 2014
eea7982
show 'Clear cache for repeating events' only when debug is enabled
georgehrke Aug 7, 2014
d1f1530
Multiple reminder/alarm by event
ElieSauveterre Aug 7, 2014
042673e
fix issue with repeating events in week 52
georgehrke Aug 8, 2014
4d606bd
Allow download of shared calendars and events
alevy Aug 13, 2014
c9e23e8
fix caldav issue that could lead to etag problems
georgehrke Aug 20, 2014
5d7e754
add reply-to field to e-mail when using "send mail"
georgehrke Aug 23, 2014
337d2ed
reply-to is not possible with core's sendMail, therefore remove reply-to
georgehrke Aug 23, 2014
80b3fdf
Send Mail: User proper displayname instead of string "user"
georgehrke Aug 23, 2014
5b77342
Merge branch 'Main-source/stable7'
ElieSauveterre Aug 25, 2014
83c05d9
read alarm-related data from calender-event
Iridias Mar 20, 2014
1702b4b
show alarm times in event form and support editing it
Iridias Mar 20, 2014
cc8989b
added german and english translation for simple alarm feature
Iridias Mar 20, 2014
53ff0c6
allow setting valarm-actiontype via request / selectbox-entries for a…
Iridias Apr 14, 2014
7be6f1d
Multiple reminder/alarm by event
ElieSauveterre Aug 7, 2014
a97eea3
Merge remote-tracking branch 'origin/master'
ElieSauveterre Nov 12, 2014
9fbb276
Fix merge
ElieSauveterre Nov 12, 2014
ff95d78
Upgrade version number to force database updates
ElieSauveterre Nov 15, 2014
bd81fc1
Get sender email from mail_smtpname or mail_from_address@mail_domain
ElieSauveterre Nov 18, 2014
df5702e
Merge remote-tracking branch 'owncloud/master'
ElieSauveterre Nov 21, 2014
ae4d30c
Fix field name
ElieSauveterre Jan 6, 2015
053bf2e
Fix error mapping field "sent"
ElieSauveterre Feb 4, 2015
b688583
Merge remote-tracking branch 'upstream/master'
ElieSauveterre Feb 4, 2015
9669775
Merge remote-tracking branch 'upstream/master'
ElieSauveterre Feb 11, 2015
7cadce0
fix event sharing
georgehrke Apr 6, 2015
9d5f140
Ensure that color is always valid
LukasReschke Apr 12, 2015
0bf7496
Revert "fix event sharing"
Apr 16, 2015
1d4a2d1
Merge pull request #770 from owncloud/stable8-revert-sharingfix
georgehrke Apr 16, 2015
d264a89
fix event sharing on stable8
georgehrke Apr 16, 2015
bfa462d
fix displaying access class for part.showevent
georgehrke Apr 16, 2015
a3201f8
Merge pull request #772 from owncloud/event_sharing_fix_stable8
georgehrke Apr 16, 2015
6846b45
don't transfer event to different calendar when editing a shared event
georgehrke Apr 16, 2015
e9f9531
fix ocsid
georgehrke May 7, 2015
3e4a1e1
Fix error message for cron run
MorrisJobke Mar 18, 2015
621b82b
Merge remote-tracking branch 'upstream/stable8'
ElieSauveterre Jun 9, 2015
ca4d6e0
Add route for alarm alert
ElieSauveterre Jun 9, 2015
0fd923f
Make installation instructions more clear.
Jul 2, 2015
ee5df56
Update README.md
Jul 2, 2015
3ac004c
Update README.md
Jul 2, 2015
2997812
Add only one (email) event by default.
Jul 2, 2015
194bb40
Update README.md
Jul 2, 2015
d3149e6
revert back
Jul 3, 2015
b72e213
Merge pull request #1 from thend20/thend20-patch-readme
ElieSauveterre Jul 3, 2015
0c4723a
insert missing variables in event editor
georgehrke Jul 6, 2015
d90b069
Implement getChild() - fixes #832
DeepDiver1975 Jul 7, 2015
c863789
Merge pull request #836 from owncloud/fix-shared-calendars-webdav-8.1
georgehrke Jul 7, 2015
2406220
increment version number
georgehrke Jul 7, 2015
4091c71
fix caching issue in import
georgehrke Jul 9, 2015
3ea6a52
fix issue with wrong principal-uris
georgehrke Jul 11, 2015
0f49645
fix issue with using modify instead of add on DateTime
georgehrke Jul 11, 2015
ec53139
increment version number
georgehrke Jul 11, 2015
819751b
[stable8.1] Use proper OCS id
LukasReschke Jul 16, 2015
97d0f11
Merge pull request #858 from owncloud/LukasReschke-patch-1
georgehrke Jul 18, 2015
026683d
[stable8.1] Clarify permission checks
LukasReschke Jul 21, 2015
78d8e1b
Merge pull request #871 from owncloud/stable8.1-158
LukasReschke Jul 23, 2015
8b0d78a
Fixed ajax import script to resolve #843
ravenscroftj Jul 13, 2015
6d68a0c
Fix appname string
Jul 19, 2015
097baf4
Overwrite getMultipleChildren
gvde Aug 6, 2015
d756b5b
increment version number
georgehrke Aug 12, 2015
7fbe126
Merge remote-tracking branch 'upstream/stable8.1'
ElieSauveterre Aug 26, 2015
bb6c62c
Fix merge
ElieSauveterre Aug 26, 2015
9371375
Fix merge
ElieSauveterre Aug 26, 2015
e8cc6ff
Fix creation VALARM
ElieSauveterre Sep 2, 2015
3b39c65
Fix creation VALARM
ElieSauveterre Sep 2, 2015
1271f1d
Fix background job that send email reminder
ElieSauveterre Oct 16, 2015
a0278e7
Add webhook alarm Type, fixes some bugs using sqlite and in alarm js
Kwaadpepper Oct 18, 2015
81eae7c
Merge pull request #2 from Kwaadpepper/master
ElieSauveterre Oct 18, 2015
271a1c7
Fix email alarm sent
ElieSauveterre Oct 18, 2015
48b59fc
Fix CALDAV issue
Kwaadpepper Oct 18, 2015
07d2f7c
Merge pull request #3 from Kwaadpepper/master
ElieSauveterre Oct 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions 3rdparty/curl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?php
/**
* This class is a handy wrapper for using curl
* @author original author http://php.net/manual/fr/book.curl.php#90821
* modified bye
* @author Jérémy Munsch <[email protected]>
* @copyright https://creativecommons.org/publicdomain/mark/1.0/
*/
class Curl
{
protected $_useragent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1';
protected $_url;
protected $_followlocation;
protected $_timeout;
protected $_maxRedirects;
protected $_cookieFileLocation = null;
protected $_post;
protected $_postFields;
protected $_referer = "http://www.google.com";
protected $_debug = false;

protected $_session;
protected $_webpage;
protected $_includeHeader;
protected $_noBody;
protected $_status;
protected $_contentType;
protected $_infos;
protected $_binaryTransfer;
public $authentication = 0;
public $auth_name = '';
public $auth_pass = '';

public function useAuth($use)
{
$this->authentication = 0;
if ($use == true) {
$this->authentication = 1;
}
}

public function setName($name)
{
$this->auth_name = $name;
}

public function setPass($pass)
{
$this->auth_pass = $pass;
}

public function __construct($url, $followlocation = true, $timeOut = 30, $maxRedirecs = 4, $binaryTransfer = false, $includeHeader = false, $noBody = false)
{
$this->_url = $url;
$this->_followlocation = $followlocation;
$this->_timeout = $timeOut;
$this->_maxRedirects = $maxRedirecs;
$this->_noBody = $noBody;
$this->_includeHeader = $includeHeader;
$this->_binaryTransfer = $binaryTransfer;
}

public function setDebug($debug)
{
$this->_debug = $debug;
}

public function setReferer($referer)
{
$this->_referer = $referer;
}

public function setCookieFileLocation($path)
{
$this->_cookieFileLocation = $path;
}

public function setPost ($postFields)
{
$this->_post = true;
$this->_postFields = $postFields;
}

public function setUserAgent($userAgent)
{
$this->_useragent = $userAgent;
}

public function createCurl($url = null)
{
if ($url) {
$this->_url = $url;
}

$s = curl_init();

curl_setopt($s, CURLOPT_URL, $this->_url);
curl_setopt($s, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($s, CURLOPT_TIMEOUT, $this->_timeout);
curl_setopt($s, CURLOPT_MAXREDIRS, $this->_maxRedirects);
curl_setopt($s, CURLOPT_RETURNTRANSFER, true);
curl_setopt($s, CURLOPT_FOLLOWLOCATION, $this->_followlocation);

if ($this->_debug) {
curl_setopt($s, CURLOPT_VERBOSE, true);
}

if ($this->_cookieFileLocation) {
curl_setopt($s, CURLOPT_COOKIEJAR, $this->_cookieFileLocation);
curl_setopt($s, CURLOPT_COOKIEFILE, $this->_cookieFileLocation);
}

if ($this->authentication == 1) {
curl_setopt($s, CURLOPT_USERPWD, $this->auth_name.':'.$this->auth_pass);
}
if ($this->_post) {
curl_setopt($s, CURLOPT_POST, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $this->_postFields);

}

if ($this->_includeHeader) {
curl_setopt($s, CURLOPT_HEADER, true);
}

if ($this->_noBody) {
curl_setopt($s, CURLOPT_NOBODY, true);
}
if($this->_binaryTransfer) {
curl_setopt($s,CURLOPT_BINARYTRANSFER,true);
}
curl_setopt($s, CURLOPT_USERAGENT, $this->_useragent);
curl_setopt($s, CURLOPT_REFERER, $this->_referer);

$this->_webpage = curl_exec($s);
$this->_status = curl_getinfo($s, CURLINFO_HTTP_CODE);
$this->_contentType = curl_getinfo($s, CURLINFO_CONTENT_TYPE);
$this->_infos = curl_getinfo($s);

curl_close($s);

}

public function getHttpStatus()
{
return $this->_status;
}

public function getContentType()
{
return $this->_contentType;
}

public function getInfos()
{
return $this->_infos;
}

public function getDebug()
{
return $this->_infos;
}

public function __tostring()
{
return $this->_webpage;
}
}
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
Calendar app
============
Fork from the owncloud/calendar with Alarm/Reminder/Notifications.

Maintainers:
------------
- [Georg Ehrke](https://github.com/georgehrke)
- [Thomas Tanghus](https://github.com/tanghus)
- [Bart Visscher](https://github.com/bartv2)
Install
=======
```
cd apps
git clone https://github.com/ElieSauveterre/calendar.git
```

Developer setup info:
---------------------
__Important note__: ownCloud 7 or ownCloud 8 will be last version to ship the master branch's codebase. It will be replaced by the rework branch. If you want to implement new features, please strongly consider implementing them based on the rework branch's codebase.
In ownCloud:
`Enable the Calendar app.`

### Master branch:
Just clone this repo into your apps directory.
Get the lastest version of master:
```bash
git clone git://github.com/owncloud/calendar.git
cd calendar
```
Database
========
If the `oc_clndr_alarms` does not exist after the install, you may manually create the table:

### Rework branch:
Get the lastest version of rework:
```bash
git clone git://github.com/owncloud/calendar.git
cd calendar
git checkout rework
```
CREATE TABLE `oc_clndr_alarms` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`objid` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) COLLATE utf8_bin NOT NULL,
`optionfield` varchar(1024) COLLATE utf8_bin NOT NULL,
`timetype` varchar(255) COLLATE utf8_bin NOT NULL,
`senddate` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
`type` varchar(255) COLLATE utf8_bin NOT NULL,
`sent` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
```
50 changes: 50 additions & 0 deletions ajax/alarms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/**
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$l = OC_L10N::get('calendar');

$alarms = OC_Calendar_Object::getAlarmsToDisplay();

$alarmsIdsSent = array();
$ouput = array();
$timeFormat = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'H:i' : 'h:i a';
$dateFormat = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'dateformat', 'dd-mm-yy') == 'dd-mm-yy' ? 'd-m-Y' : 'm-d-Y';
$tz = OC_Calendar_App::getTimezone();
$midnight = new DateTime('now', new DateTimeZone($tz));
$midnight->setTime(23, 59, 59);

while($row = $alarms->fetchRow()){

$startDate = new DateTime($row['startdate'], new DateTimeZone('UTC'));
$startDate->setTimezone(new DateTimeZone($tz));
$oneDay = 60 * 60 * 24;

if($startDate->getTimestamp() <= $midnight->getTimestamp()){

$ouput[] = $l->t('Reminder (%s): %s is starting at %s', array(
$row['displayname'],
$row['summary'],
$startDate->format($timeFormat)));
}else{

$ouput[] = $l->t('Reminder (%s): %s is starting at %s on %s', array(
$row['displayname'],
$row['summary'],
$startDate->format($timeFormat),
$startDate->format($dateFormat)
));
}


$alarmsIdsSent[] = $row['id'];
}

OC_Calendar_Object::setAlarmsSent($alarmsIdsSent);
OCP\JSON::success(array('events' => $ouput));
7 changes: 7 additions & 0 deletions ajax/event/edit.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);

$summary = $vevent->SUMMARY;
$location = $vevent->LOCATION;
$description = $vevent->DESCRIPTION;

// DATE
if ($dtstart->hasTime()) {
// UTC ?
Expand Down Expand Up @@ -258,6 +262,9 @@
$tmpl->assign('endtime', $endtime);
$tmpl->assign('description', $description);

$alarms = OC_Calendar_Object::getAlarms($id);
$tmpl->assign('alarms', $alarms);

$tmpl->assign('repeat', $repeat['repeat']);
if($repeat['repeat'] != 'doesnotrepeat') {
if(array_key_exists('weekofmonth', $repeat) === false) {
Expand Down
1 change: 1 addition & 0 deletions ajax/event/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

OC_Calendar_App::isNotModified($vcalendar->VEVENT, $_POST['lastmodified']);
OC_Calendar_Object::updateVCalendarFromRequest($_POST, $vcalendar);
OC_Calendar_Object::addAlarmsDB($_POST['alarmsDuration'], $_POST['alarmsOptionField'], $_POST['alarmsType'], $_POST['alarmsTimeType'], $vcalendar->VEVENT, $id);

try {
OC_Calendar_Object::edit($id, $vcalendar->serialize());
Expand Down
1 change: 1 addition & 0 deletions ajax/event/move.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

try {
OC_Calendar_Object::edit($id, $vcalendar->serialize());
OC_Calendar_Object::moveAlarmsDB($id, $delta);
} catch(Exception $e) {
OCP\JSON::error(array('message'=>$e->getMessage()));
exit;
Expand Down
34 changes: 34 additions & 0 deletions ajax/event/new.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
array_push($calendar_options, $calendar);
}
}


$access_class_options = OC_Calendar_App::getAccessClassOptions();
$repeat_options = OC_Calendar_App::getRepeatOptions();
$repeat_end_options = OC_Calendar_App::getEndOptions();
Expand Down Expand Up @@ -72,6 +74,38 @@
$tmpl->assign('repeat_bymonthday_options', $repeat_bymonthday_options);
$tmpl->assign('repeat_weekofmonth_options', $repeat_weekofmonth_options);

$_alarms = array();
$_alarmsType = explode('|', OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'defaultalarms' ));

if (in_array('DISPLAY', $_alarmsType)) {
$_alarms[] = array(
'type' => 'DISPLAY',
'value' => 10,
'optionfield' => '',
'timetype' => 'M'
);
}

if (in_array('EMAIL', $_alarmsType)) {
$_alarms[] = array(
'type' => 'EMAIL',
'value' => 10,
'optionfield' => '',
'timetype' => 'M'
);
}

if (in_array('WEBHOOK', $_alarmsType)) {
$_alarms[] = array(
'type' => 'WEBHOOK',
'value' => 10,
'optionfield' => OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'webhookdefaulturl' ),
'timetype' => 'M'
);
}

$tmpl->assign('alarms', $_alarms);

$tmpl->assign('eventid', 'new');
$tmpl->assign('startdate', $start->format('d-m-Y'));
$tmpl->assign('starttime', $start->format('H:i'));
Expand Down
5 changes: 3 additions & 2 deletions ajax/event/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
$cal = $_POST['calendar'];
$vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
try {
OC_Calendar_Object::add($cal, $vcalendar->serialize());
$objectId = OC_Calendar_Object::add($cal, $vcalendar->serialize());
OC_Calendar_Object::addAlarmsDB($_POST['alarmsDuration'], $_POST['alarmsOptionField'], $_POST['alarmsType'], $_POST['alarmsTimeType'], $vcalendar->VEVENT, $objectId);
} catch(Exception $e) {
OCP\JSON::error(array('message'=>$e->getMessage()));
exit;
}
OCP\JSON::success();
}
}
2 changes: 1 addition & 1 deletion ajax/event/resize.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OC_Calendar_App::isNotModified($vevent, $_POST['lastmodified']);

$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$dtend->getDateTime()->modify($delta);
$dtend->getDateTime()->add($delta);
unset($vevent->DURATION);


Expand Down
2 changes: 1 addition & 1 deletion ajax/import/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
OCP\JSON::callCheck();
session_write_close();
if (isset($_POST['progresskey']) && isset($_POST['getprogress'])) {
echo OCP\JSON::success(array('percent'=>\OC\Cache::get($_POST['progresskey'])));
echo OCP\JSON::success(array('percent'=>\OC::$server->getCache()->get($_POST['progresskey'])));
exit;
}
$file = \OC\Files\Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']);
Expand Down
Loading