Commit e13da69e authored by nepski's avatar nepski

light doc and sip feedback

parent beb410e3
...@@ -11,18 +11,26 @@ class Main extends Controller { ...@@ -11,18 +11,26 @@ class Main extends Controller {
$f3->set('block_content','home.html'); $f3->set('block_content','home.html');
} }
/*
* Feedback page
* Form for a feedback after a call
* GET: show the form
* POST: send the form to the campaign API and show thank you
*/
function feedbackform($f3, $args) { function feedbackform($f3, $args) {
//GET
if ($f3->get('VERB') == 'GET'){ if ($f3->get('VERB') == 'GET'){
$categories = Api::get_feedback_categories()['categories']; $categories = Api::get_feedback_categories()['categories'];
$f3->set('feedback_categories', $categories); $f3->set('feedback_categories', $categories);
$f3->set("contact_id", 42); $f3->set("contact_id", 42);
//create call //TODO: create call
//start call //TODO: start call
$f3->set('block_content', 'feedbackform.html'); $f3->set('block_content', 'feedbackform.html');
} }
//POST
elseif ($f3->get('VERB') == 'POST'){ elseif ($f3->get('VERB') == 'POST'){
$contact_id = $f3->get('POST.contact_id'); $contact_id = $f3->get('POST.contact_id');
$feedback = $f3->get('POST.feedback'); $feedback = $f3->get('POST.feedback');
...@@ -34,6 +42,8 @@ class Main extends Controller { ...@@ -34,6 +42,8 @@ class Main extends Controller {
} }
} }
function feedbacksip($f3, $args) {
}
}; };
...@@ -14,3 +14,4 @@ GET /restapi/campaign/@id/arguments/@lang=RestApi->arguments ...@@ -14,3 +14,4 @@ GET /restapi/campaign/@id/arguments/@lang=RestApi->arguments
GET|POST @feedback:/feedback=Main->feedbackform GET|POST @feedback:/feedback=Main->feedbackform
POST @feedbacksip:/feedbacksip=Main->feedbacksip
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<p>{{ _("Please tell us what happened if you was able to talk to someone. Your feedback is important to us.") }}</p> <p>{{ _("Please tell us what happened if you was able to talk to someone. Your feedback is important to us.") }}</p>
<form method="post" action="/feedback/" > <form method="post" action="{{ @feedback }}" >
<input type="text" id="contact_id" name="contact_id" hidden="hidden" value="{{ @contact_id }}" /> <input type="text" id="contact_id" name="contact_id" hidden="hidden" value="{{ @contact_id }}" />
<repeat group="{{ @feedback_categories }}" value="{{ @feedback_category }}"> <repeat group="{{ @feedback_categories }}" value="{{ @feedback_category }}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment