Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
piphone-front
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
cdce78cd
Commit
cdce78cd
authored
Nov 22, 2014
by
nepski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feedback API side
parent
d53aeed3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
app/Main.php
app/Main.php
+5
-2
app/RestApi.php
app/RestApi.php
+6
-0
templates/feedbackform.html
templates/feedbackform.html
+6
-8
templates/thankyou.html
templates/thankyou.html
+1
-1
No files found.
app/Main.php
View file @
cdce78cd
...
...
@@ -13,7 +13,9 @@ class Main extends Controller {
function
feedbackform
(
$f3
,
$args
)
{
if
(
$f3
->
get
(
'VERB'
)
==
'GET'
){
$f3
->
set
(
'feedback_categories'
,
Api
::
get_feedback_categories
());
$categories
=
Api
::
get_feedback_categories
()[
'categories'
];
$f3
->
set
(
'feedback_categories'
,
$categories
);
$f3
->
set
(
"contact_id"
,
42
);
//create call
...
...
@@ -25,9 +27,10 @@ class Main extends Controller {
elseif
(
$f3
->
get
(
'VERB'
)
==
'POST'
){
$contact_id
=
$f3
->
get
(
'POST.contact_id'
);
$feedback
=
$f3
->
get
(
'POST.feedback'
);
$category
=
$f3
->
get
(
'POST.feedback_category'
);
//send feedback to campaign
$f3
->
set
(
'post_feedback_result'
,
Api
::
post_feedback
(
$contact_id
,
$feedback
));
$f3
->
set
(
'post_feedback_result'
,
Api
::
post_feedback
(
$contact_id
,
$feedback
,
$category
));
$f3
->
set
(
'block_content'
,
'thankyou.html'
);
}
}
...
...
app/RestApi.php
View file @
cdce78cd
...
...
@@ -68,6 +68,12 @@ class RestApi {
function
categories
(
$f3
,
$args
)
{
// List of feedback categories
echo
'{"categories": [
"category1",
"category2",
"category3"
]
}'
;
}
function
feedback_add
(
$f3
,
$args
)
{
...
...
templates/feedbackform.html
View file @
cdce78cd
...
...
@@ -7,15 +7,13 @@
<form
method=
"post"
action=
"/feedback/"
>
<input
type=
"text"
id=
"contact_id"
name=
"contact_id"
hidden=
"hidden"
value=
"{{ @contact_id }}"
/>
<repeat
group=
"feedback_categories"
value=
"feedback_category"
>
<p>
<input
type=
"radio"
group=
"feedback_category"
value=
"{{ trim(@feedback_category }}"
/>
{{ trim(@feedback_category }}
</p>
<repeat
group=
"{{ @feedback_categories }}"
value=
"{{ @feedback_category }}"
>
<input
type=
"radio"
name=
"feedback_category"
value=
"{{ @feedback_category }}"
/>
{{ @feedback_category }}
</repeat>
<textarea
id=
"feedback"
name=
"feedback"
></textarea>
<p>
<textarea
id=
"feedback"
name=
"feedback"
></textarea>
</p>
<input
type=
"submit"
name=
"go"
value=
"{{ _("
Send
my
feedback
")
}}"
/>
</form>
\ No newline at end of file
templates/thankyou.html
View file @
cdce78cd
<p>
thank you!
</p>
<p>
thank you!
<
3
</
p
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment