Skip to content
Snippets Groups Projects
Commit 3e2c0d26 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix MVC

parent a8129ce4
No related branches found
No related tags found
No related merge requests found
...@@ -105,7 +105,6 @@ if ($action != 'export_csv' && ! isset($_POST['begin']) && ! isset($_GET['begin' ...@@ -105,7 +105,6 @@ if ($action != 'export_csv' && ! isset($_POST['begin']) && ! isset($_GET['begin'
/* /*
* Action * Action
*/ */
...@@ -132,74 +131,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP ...@@ -132,74 +131,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_date_end = ''; $search_date_end = '';
} }
if ($action == 'delbookkeeping') { // Must be after the remove filter action, before the export.
$import_key = GETPOST('importkey', 'alpha');
if (! empty($import_key)) {
$result = $object->deleteByImportkey($import_key);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
Header("Location: list.php");
exit();
}
}
if ($action == 'delbookkeepingyearconfirm') {
$delyear = GETPOST('delyear', 'int');
if ($delyear==-1) {
$delyear=0;
}
$deljournal = GETPOST('deljournal','alpha');
if ($deljournal==-1) {
$deljournal=0;
}
if (! empty($delyear) || ! empty($deljournal))
{
$result = $object->deleteByYearAndJournal($delyear,$deljournal);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
setEventMessages("RecordDeleted", null, 'mesgs');
}
Header("Location: list.php");
exit;
}
else
{
setEventMessages("NoRecordDeleted", null, 'warnings');
Header("Location: list.php");
exit;
}
}
if ($action == 'delmouvconfirm') {
$mvt_num = GETPOST('mvt_num', 'int');
if (! empty($mvt_num)) {
$result = $object->deleteMvtNum($mvt_num);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
Header("Location: list.php");
exit;
}
}
/*
* View
*/
$param = ''; $param = '';
$filter = array (); $filter = array ();
if (! empty($search_date_start)) { if (! empty($search_date_start)) {
...@@ -266,6 +198,68 @@ if (! empty($search_mvt_num)) { ...@@ -266,6 +198,68 @@ if (! empty($search_mvt_num)) {
$param .= '&search_mvt_num=' . $search_mvt_num; $param .= '&search_mvt_num=' . $search_mvt_num;
} }
if ($action == 'delbookkeeping') {
$import_key = GETPOST('importkey', 'alpha');
if (! empty($import_key)) {
$result = $object->deleteByImportkey($import_key);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
Header("Location: list.php");
exit();
}
}
if ($action == 'delbookkeepingyearconfirm') {
$delyear = GETPOST('delyear', 'int');
if ($delyear==-1) {
$delyear=0;
}
$deljournal = GETPOST('deljournal','alpha');
if ($deljournal==-1) {
$deljournal=0;
}
if (! empty($delyear) || ! empty($deljournal))
{
$result = $object->deleteByYearAndJournal($delyear,$deljournal);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
setEventMessages("RecordDeleted", null, 'mesgs');
}
Header("Location: list.php");
exit;
}
else
{
setEventMessages("NoRecordDeleted", null, 'warnings');
Header("Location: list.php");
exit;
}
}
if ($action == 'delmouvconfirm') {
$mvt_num = GETPOST('mvt_num', 'int');
if (! empty($mvt_num)) {
$result = $object->deleteMvtNum($mvt_num);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
Header("Location: list.php");
exit;
}
}
if ($action == 'export_csv') { if ($action == 'export_csv') {
include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php'; include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
...@@ -287,6 +281,11 @@ if ($action == 'export_csv') { ...@@ -287,6 +281,11 @@ if ($action == 'export_csv') {
} }
} }
/*
* View
*/
$title_page = $langs->trans("Bookkeeping"); $title_page = $langs->trans("Bookkeeping");
llxHeader('', $title_page); llxHeader('', $title_page);
......
...@@ -43,6 +43,7 @@ $langs->load("bills"); ...@@ -43,6 +43,7 @@ $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$langs->load("trips");
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
......
...@@ -60,6 +60,7 @@ DATE_SAVE=Validation date ...@@ -60,6 +60,7 @@ DATE_SAVE=Validation date
DATE_CANCEL=Cancelation date DATE_CANCEL=Cancelation date
DATE_PAIEMENT=Payment date DATE_PAIEMENT=Payment date
BROUILLONNER=Reopen BROUILLONNER=Reopen
ExpenseReportRef=Ref. expense report
ValidateAndSubmit=Validate and submit for approval ValidateAndSubmit=Validate and submit for approval
ValidatedWaitingApproval=Validated (waiting for approval) ValidatedWaitingApproval=Validated (waiting for approval)
NOT_AUTHOR=You are not the author of this expense report. Operation cancelled. NOT_AUTHOR=You are not the author of this expense report. Operation cancelled.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment