Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
bafa2530
Commit
bafa2530
authored
7 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FIX empty cell when we export report
parent
40c1877a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/maarch_entreprise/reports/record_data.php
+59
-57
59 additions, 57 deletions
apps/maarch_entreprise/reports/record_data.php
with
59 additions
and
57 deletions
apps/maarch_entreprise/reports/record_data.php
100644 → 100755
+
59
−
57
View file @
bafa2530
<?php
<?php
/*
/*
* Copyright 2008-2015 Maarch
* Copyright 2008-2017 Maarch
*
*
* This file is part of Maarch Framework.
* This file is part of Maarch Framework.
*
*
* Maarch Framework is free software: you can redistribute it and/or modify
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* (at your option) any later version.
*
*
* Maarch Framework is distributed in the hope that it will be useful,
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
*/
require_once
(
"core"
.
DIRECTORY_SEPARATOR
.
"class"
.
DIRECTORY_SEPARATOR
.
"class_functions.php"
);
require_once
(
"core"
.
DIRECTORY_SEPARATOR
.
"class"
.
DIRECTORY_SEPARATOR
.
"class_functions.php"
);
$core_tools
=
new
core_tools
();
$core_tools
=
new
core_tools
();
$core_tools
->
test_user
();
$core_tools
->
test_user
();
$core_tools
->
test_service
(
'reports'
,
'reports'
);
$core_tools
->
test_service
(
'reports'
,
'reports'
);
if
(
isset
(
$_POST
[
"data"
])){
if
(
isset
(
$_POST
[
"data"
]))
{
try
{
try
{
$functions
=
new
functions
();
$functions
=
new
functions
();
$_POST
[
'data'
]
=
urldecode
(
$_POST
[
'data'
]);
$_POST
[
'data'
]
=
urldecode
(
$_POST
[
'data'
]);
$data
=
json_decode
(
$_POST
[
'data'
]);
$data
=
json_decode
(
$_POST
[
'data'
]);
//var_dump($data);
//var_dump($data);
$_SESSION
[
'export'
][
'filename'
]
=
'export_reports_maarch.csv'
;
$_SESSION
[
'export'
][
'filename'
]
=
'export_reports_maarch.csv'
;
$contenu
=
''
;
$contenu
=
''
;
$fp
=
fopen
(
'apps/maarch_entreprise/tmp/export_reports_maarch.csv'
,
'w'
);
$fp
=
fopen
(
'apps/maarch_entreprise/tmp/export_reports_maarch.csv'
,
'w'
);
$data_to_array
=
$functions
->
object2array
(
$data
);
$data_to_array
=
$functions
->
object2array
(
$data
);
foreach
(
$data_to_array
as
$line
){
foreach
(
$data_to_array
as
$line
)
{
//conversion en UTF-8
//conversion en UTF-8
$line
[
'LABEL'
]
=
$functions
->
wash_html
(
$line
[
'LABEL'
],
"UTF-8"
);
$line
[
'LABEL'
]
=
$functions
->
wash_html
(
$line
[
'LABEL'
],
"UTF-8"
);
$line
[
'VALUE'
]
=
$functions
->
wash_html
(
$line
[
'VALUE'
],
"UTF-8"
);
$line
[
'VALUE'
]
=
$functions
->
wash_html
(
$line
[
'VALUE'
],
"UTF-8"
);
fputcsv
(
$fp
,
$line
,
';'
);
if
(
empty
(
$line
[
'VALUE'
]))
{
}
// Evite d'avoir une cellule vide
$line
[
'VALUE'
]
=
0
;
fclose
(
$fp
);
}
$return
[
'status'
]
=
1
;
fputcsv
(
$fp
,
$line
,
';'
);
}
catch
(
Exeption
$e
){
}
$return
[
'response'
]
=
"ERROR : "
.
$e
;
$return
[
'status'
]
=
0
;
fclose
(
$fp
);
}
$return
[
'status'
]
=
1
;
}
catch
(
Exeption
$e
)
{
}
$return
[
'response'
]
=
"ERROR : "
.
$e
;
echo
json_encode
(
$return
);
$return
[
'status'
]
=
0
;
?>
}
}
echo
json_encode
(
$return
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment