-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Large changes to increase user-friendliness (including installer):
Introduces a procedure for installation and upgrades (includes changes to the database structure, configuration file and .htaccess). Support for PostgreSQL (includes changes to the database structure). Support for webcron. Some small quality of life fixes: - Sort by the most recent transaction when debt is identical - Better introduction text on landing page - Clear up text describing the licenses of Bootstrap and Font Awesome - Improve URL handling by merging reminderurl and base_url configuration - Favicon ico file fallback - More semantic link for home icon
- Loading branch information
1 parent
e3891d3
commit 7964df7
Showing
26 changed files
with
739 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteCond %{REQUEST_URI} !=/favicon.ico | ||
RewriteRule ^ index.php [L] | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^ index.php [L] | ||
|
||
RewriteCond %{REQUEST_URI} changelog.txt$ | ||
RewriteRule ^ index.php [L] | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version 1.1 - commit 0fbfdb027c944c602f5ae96d94855ffae92440f9 | ||
|
||
Introduces a procedure for installation and upgrades (includes changes to the database structure, configuration file and .htaccess). | ||
Support for PostgreSQL (includes changes to the database structure). | ||
Support for webcron. | ||
Some small quality of life fixes: | ||
- Sort by the most recent transaction when debt is identical | ||
- Better introduction text on landing page | ||
- Clear up text describing the licenses of Bootstrap and Font Awesome | ||
- Improve URL handling by merging reminderurl and base_url configuration | ||
- Favicon ico file fallback | ||
- More semantic link for home icon | ||
|
||
version 1.0.1 - commit 75ab9c8d0f69938240146989b6832d4c20a5ee65 | ||
|
||
Some small quality of life fixes: | ||
- When logged in, redirect any token link to "My debt" | ||
- Add a "Today" button to enter the current date in forms | ||
- Fix sorting issue in detailed overview of a user | ||
- Mention total debt in new activity emails, not just the newly added debt | ||
- Favicons | ||
- Hide unnecessary layout elements on the chrome/chromium date picker | ||
- | ||
|
||
version 1.0 - commit 67b554a08bbed216423b8d968c67ddfe8169df2a | ||
|
||
Very first version of Tabby. | ||
Includes all core features of Tabby as well as the striking and user-friendly interface. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
<?php | ||
|
||
include('config.php'); | ||
include('resources/users.php'); | ||
include('resources/transactions.php'); | ||
include_once('config.php'); | ||
include_once('resources/init.php'); | ||
include_once('resources/users.php'); | ||
include_once('resources/transactions.php'); | ||
|
||
$users = get_users_by_reminddif($days); | ||
$check = $db->prepare('SELECT value FROM config WHERE id=?'); | ||
$check->execute(array('cron')); | ||
$result = $check->fetch(PDO::FETCH_ASSOC); | ||
|
||
foreach($users as $user) { | ||
if(user_have_debtors_in_debt($user['email'])) { | ||
if(is_null($user['reminddate'])) { | ||
$message = "Hi " . $user['name'] . ",\r\n\r\nIt seems you've never sent any reminders on Tabby. Since some people still have an open debt with you, it's probably best if you check your bank account, update any information on Tabby and then sent out new reminders if required.\r\n\r\nYou can get started straight away at " . $reminderurl . ".\r\n\r\nTabby will remind you every " . $days . " days as long as there is open debt.\r\n\r\nHave a nice day!\r\n\r\nTabby"; | ||
if(date('Y-m-d') !== date('Y-m-d', $result['value'])){ | ||
$users = get_users_by_reminddif($days); | ||
|
||
foreach($users as $user) { | ||
if(user_have_debtors_in_debt($user['email'])) { | ||
if(is_null($user['reminddate'])) { | ||
$message = "Hi " . $user['name'] . ",\r\n\r\nIt seems you've never sent any reminders on Tabby. Since some people still have an open debt with you, it's probably best if you check your bank account, update any information on Tabby and then sent out new reminders if required.\r\n\r\nYou can get started straight away at " . $base_url . ".\r\n\r\nTabby will remind you every " . $days . " days as long as there is open debt.\r\n\r\nHave a nice day!\r\n\r\nTabby"; | ||
} | ||
else { | ||
$message = "Hi " . $user['name'] . ",\r\n\r\nIt seems you haven't sent any new reminders on Tabby since " . date('d M Y', strtotime($user['reminddate'])) . ". Since some people still have an open debt with you, it's probably best if you check your bank account, update any information on Tabby and then sent out new reminders if required.\r\n\r\nYou can get started straight away at " . $base_url . ".\r\n\r\nTabby will remind you every " . $days . " days as long as there is open debt.\r\n\r\nHave a nice day!\r\n\r\nTabby"; | ||
} | ||
|
||
$headers = 'From: ' . $application_email; | ||
mail($user['email'], 'Tabby: time to send reminders', $message, $headers); | ||
} | ||
else { | ||
$message = "Hi " . $user['name'] . ",\r\n\r\nIt seems you haven't sent any new reminders on Tabby since " . date('d M Y', strtotime($user['reminddate'])) . ". Since some people still have an open debt with you, it's probably best if you check your bank account, update any information on Tabby and then sent out new reminders if required.\r\n\r\nYou can get started straight away at " . $reminderurl . ".\r\n\r\nTabby will remind you every " . $days . " days as long as there is open debt.\r\n\r\nHave a nice day!\r\n\r\nTabby"; | ||
} | ||
|
||
$headers = 'From: ' . $application_email; | ||
mail($user['email'], 'Tabby: time to send reminders', $message, $headers); | ||
} | ||
|
||
$update = $db->prepare('UPDATE config SET value=? WHERE id=?'); | ||
$update->execute(array(strtotime('now'), 'cron')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
CREATE TABLE "users" ( | ||
"email" varchar(50) NOT NULL, | ||
"name" varchar(50) NOT NULL, | ||
"password" varchar(255) NOT NULL, | ||
"iban" varchar(34) NOT NULL, | ||
"reminddate" date NULL, | ||
PRIMARY KEY ("email") | ||
); | ||
|
||
|
||
CREATE TABLE "tokens" ( | ||
"email" varchar(50) NOT NULL, | ||
"token" varchar(25) NOT NULL, | ||
PRIMARY KEY ("email"), | ||
UNIQUE ("token") | ||
); | ||
|
||
|
||
CREATE TABLE "activities" ( | ||
"id" serial, | ||
"name" varchar(250) NOT NULL, | ||
"owner" varchar(50) NOT NULL, | ||
"date" date NOT NULL, | ||
PRIMARY KEY ("id"), | ||
FOREIGN KEY ("owner") REFERENCES users(email) | ||
); | ||
CREATE INDEX ON "activities" ("owner"); | ||
|
||
|
||
CREATE TABLE "debtors" ( | ||
"id" serial, | ||
"name" varchar(50) NOT NULL, | ||
"email" varchar(50) NOT NULL, | ||
"owner" varchar(50) NOT NULL, | ||
PRIMARY KEY ("id"), | ||
FOREIGN KEY ("owner") REFERENCES users(email) | ||
); | ||
CREATE INDEX ON "debtors" ("owner"); | ||
CREATE INDEX ON "debtors" ("email"); | ||
|
||
|
||
CREATE TABLE "credits" ( | ||
"id" serial, | ||
"debtor" integer NOT NULL, | ||
"comment" varchar(250) NOT NULL, | ||
"amount" integer NOT NULL, | ||
"date" date NOT NULL, | ||
PRIMARY KEY ("id"), | ||
FOREIGN KEY ("debtor") REFERENCES debtors(id) | ||
); | ||
CREATE INDEX ON "credits" ("debtor"); | ||
|
||
|
||
CREATE TABLE "debts" ( | ||
"id" serial, | ||
"activity" integer NOT NULL, | ||
"debtor" integer NOT NULL, | ||
"comment" varchar(250) DEFAULT NULL, | ||
"amount" integer NOT NULL, | ||
PRIMARY KEY ("id"), | ||
FOREIGN KEY ("debtor") REFERENCES debtors(id), | ||
FOREIGN KEY ("activity") REFERENCES activities(id) ON DELETE CASCADE | ||
); | ||
CREATE INDEX ON "debts" ("debtor"); | ||
CREATE INDEX ON "debts" ("activity"); | ||
|
||
|
||
CREATE TABLE "pending_users" ( | ||
"email" varchar(50) NOT NULL, | ||
"name" varchar(50) NOT NULL, | ||
"password" varchar(255) NOT NULL, | ||
"iban" varchar(34) NOT NULL, | ||
"confirmation" varchar(25) NOT NULL, | ||
"datetime" timestamp NOT NULL, | ||
PRIMARY KEY ("email"), | ||
UNIQUE ("confirmation") | ||
); | ||
|
||
CREATE TABLE "config" ( | ||
"id" varchar(50) NOT NULL, | ||
"value" TEXT NOT NULL, | ||
PRIMARY KEY ("id") | ||
); | ||
INSERT INTO "config" VALUES ('schema', '2'); | ||
INSERT INTO "config" VALUES ('cron', '0'); |
Binary file not shown.
Oops, something went wrong.