Manage paybacks page for english tpl + checking write access on db_backups during install.
This commit is contained in:
parent
2134a2c284
commit
d508288f20
1
db_backups/README
Normal file
1
db_backups/README
Normal file
@ -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.
|
@ -9,7 +9,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable('data/')) {
|
if(!is_writable('data/')) {
|
||||||
$error = "The script seems to be unable to write to <em>data/</em> folder (to write the <em>data/config.php</em> 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 <em>data/</em> folder (to write the <em>data/config.php</em> 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 <em>db_backups/</em> folder (to write the database backups). You should give write access.";
|
||||||
$block_form = true;
|
$block_form = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
43
tpl/default_en/manage_paybacks.html
Normal file
43
tpl/default_en/manage_paybacks.html
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{include="header"}
|
||||||
|
|
||||||
|
{if condition="!empty($list)"}
|
||||||
|
<h2>Manage global paybacks</h2>
|
||||||
|
<p class="center"><a href="?do=manage_paybacks&new=1">Add a new global payback</a></p>
|
||||||
|
|
||||||
|
{if condition="count($global_paybacks) > 0"}
|
||||||
|
<p>List of previous global paybacks :</p>
|
||||||
|
<dl>
|
||||||
|
{loop="$global_paybacks"}
|
||||||
|
<dt>{$value['date']}</dt>
|
||||||
|
<dd><a href="?do=see_paybacks&id={$value['id']}">Payback n°{$value['id']}</a></dd>
|
||||||
|
{/loop}
|
||||||
|
</dl>
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
<h2>Add a global paybck</h2>
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
<p><strong>Note : <span class="red">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.</span></strong></p>
|
||||||
|
|
||||||
|
<p><strong>Note :</strong> 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.</p>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<p>If you confirm the creation of a global payback, please select right below the users you want to include in the payback.</p>
|
||||||
|
|
||||||
|
<form method="post" action="?do=manage_paybacks&new=1" id="global_payback_form">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Users to include</legend>
|
||||||
|
{loop="$users"}
|
||||||
|
<input type="checkbox" id="users_in_{$value->getId()}" name="users_in[]" value="{$value->getId()}"/>
|
||||||
|
<label for="users_in_{$value->getId()}">{$value->getDisplayName()}</label><br/>
|
||||||
|
{/loop}
|
||||||
|
</fieldset>
|
||||||
|
<p>
|
||||||
|
<input type="submit" onclick="confirm('You are going to add a global payback which includes the selected user. Confirm ?');" value="Confirm"/>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
{/if}
|
||||||
|
{include="footer"}
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<p><strong>Note : <span class="red">Cette opération est irréversible sans mettre les mains dans la base de données.</span></strong></p>
|
<p><strong>Note : <span class="red">Cette opération est irréversible sans mettre les mains dans la base de données.</span></strong></p>
|
||||||
|
|
||||||
<p><strong>Note :</strong> 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.</p>
|
<p><strong>Note :</strong> 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.</p>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user