Commit fef84c4f authored by okhin's avatar okhin 🚴

Simplification du workflow

parent 961cda9d
Pipeline #2420 passed with stages
in 17 seconds
......@@ -64,23 +64,15 @@ class Main extends Controller {
//GET
if ($f3->get('VERB') == 'GET') {
$f3->set('contact', Api::get_contact($args['id']));
$f3->set('block_content', 'call.html');
$f3->set('block_content', 'feedbackform.html');
}
//POST
elseif ($f3->get('VERB') == 'POST'){
// Create the call
// Generate a jwt token
$token = JWT::encode(array('api' => JWT_TOKEN, 'nbf' => time() - 5 , 'exp' => time() + 10 * 60, 'iat' => time()), JWT_KEY);
// To get the callee, we have the callee_id in the form. Using that
// to load the callee and retrieve its number.
$contact = Api::get_contact($args['id']);
$f3->set('contact', $contact);
$data = array('api' => JWT_TOKEN,
'caller' => $f3->get('POST.phone'),
'token' => $token);
// We want to generate a UNIQUE-ID (doesn't need to be cryptogaphically unique though
$call_id = str_replace('.', '-', uniqid('', true));
$f3->set('CALL_ID', $call_id);
}
}
......
<div class="modal fade" tabindex="-1" role="dialog" aria-labelled-by="callModalLabel" id="callModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="callModalLabel">{{ _("Reach out to ");}} {{ @contact.first_name }}&nbsp;{{ @contact.last_name }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-10">
<h2>{{ _("Call This representative") }}</h2>
<p>{{ _("Here is the number of the selected MEP - you can either dial it from your phone or push the button if any VoIP client is installed on your device.") }}</p>
<a class="btn btn-default" href="tel:{{ @contact.phone }}" target="_blank">☎ {{ @contact.phone }}</a>
</div>
</div>
</div>
</div>
</div>
</div>
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