From d508288f2090d3a9f35a56ed9b9419e795e30c65 Mon Sep 17 00:00:00 2001 From: Phyks Date: Mon, 23 Sep 2013 23:18:21 +0200 Subject: [PATCH] Manage paybacks page for english tpl + checking write access on db_backups during install. --- db_backups/README | 1 + install.php | 6 +++- tpl/default_en/manage_paybacks.html | 43 +++++++++++++++++++++++++++++ tpl/default_fr/manage_paybacks.html | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 db_backups/README create mode 100644 tpl/default_en/manage_paybacks.html diff --git a/db_backups/README b/db_backups/README new file mode 100644 index 0000000..fbc260d --- /dev/null +++ b/db_backups/README @@ -0,0 +1 @@ +This directory will contain the backups of your database, stored before each global payback. Make sure it is readable *AND* writable by the script. diff --git a/install.php b/install.php index 774e5c4..712c76e 100644 --- a/install.php +++ b/install.php @@ -9,7 +9,11 @@ } if(!is_writable('data/')) { - $error = "The script seems to be unable to write to data/ folder (to write the data/config.php configuration file). You should give write access during install and disable them after (chmod 777 -R data/ to install and chmod 755 -R data/ after installation for example)."; + $error = "The script seems to be unable to write to data/ folder (to write the data/config.php configuration file). You should give write access during install and disable them after (chmod 777 -R data/ to install and chmod 755 -R data/ after installation for example). You'll need right access on this folder each time you will want to edit settings."; + $block_form = true; + } + if(!is_writable('db_backups/')) { + $error = "The script seems to be unable to write to db_backups/ folder (to write the database backups). You should give write access."; $block_form = true; } diff --git a/tpl/default_en/manage_paybacks.html b/tpl/default_en/manage_paybacks.html new file mode 100644 index 0000000..c57ad74 --- /dev/null +++ b/tpl/default_en/manage_paybacks.html @@ -0,0 +1,43 @@ +{include="header"} + +{if condition="!empty($list)"} +

Manage global paybacks

+

Add a new global payback

+ + {if condition="count($global_paybacks) > 0"} +

List of previous global paybacks :

+
+ {loop="$global_paybacks"} +
{$value['date']}
+
Payback n°{$value['id']}
+ {/loop} +
+ {/if} +{else} +

Add a global paybck

+

You can add a global payback using this page. Such a payback aims at minimizing as much as possible the number of individual paybacks between users. So, the index page table will be resetted and a new table will be created. This new table will be available in the "see global paybacks" page and will contain as least exchange as possible.

+ +

For eample, if a user A owes 5{$currency} to a user B and if B owes 5{$currency} to C, after the global paybacks, these paybacks will simplify and A will owe 5{$currency} to C only.

+ +

Note : It's not possible to revert this operation, unless you handle the restoration of data in your database manually. Be sure you want to launch this procedure before clicking on the button below.

+ +

Note : A backup of your database right now will be made and stored in the db_backup folder at the root of your instance. You'll be able to restore the current status of your database in case of error from your part.

+ +
+ +

If you confirm the creation of a global payback, please select right below the users you want to include in the payback.

+ +
+
+ Users to include + {loop="$users"} + +
+ {/loop} +
+

+ +

+
+{/if} +{include="footer"} diff --git a/tpl/default_fr/manage_paybacks.html b/tpl/default_fr/manage_paybacks.html index c8ca15e..7b1a096 100644 --- a/tpl/default_fr/manage_paybacks.html +++ b/tpl/default_fr/manage_paybacks.html @@ -21,7 +21,7 @@

Note : Cette opération est irréversible sans mettre les mains dans la base de données.

-

Note : Un backup de votre base de données à l'heure actuelle sera effectué et stocké dans le répertoire backups à la racine de l'instance. Vous pourrez ainsi restaurer la base de données en cas d'erreur de votre part.

+

Note : Un backup de votre base de données à l'heure actuelle sera effectué et stocké dans le répertoire db_backups à la racine de l'instance. Vous pourrez ainsi restaurer la base de données en cas d'erreur de votre part.