When i create and incident in customer portal the redirection put refno on url - rightnow-crm

i'm working on OSC rightnow. I have a form to create an incident:
<form id="rn_QuestionSubmit" method="post" action="/ci/ajaxRequest/sendForm">
<fieldset>
<legend>Rellena los siguientes campos para formalizar la inscripción:</legend>
<div id="rn_ErrorLocation"></div>
<div class="rn_Hidden">
<rn:widget path="input/FormInput" name="Incident.Subject" required="true" label_input="#rn:msg:SUBJECT_LBL#" default_value="Las claves de la Transformación Digital en la relación con el Cliente." />
<rn:widget path="input/FormInput" name="Incident.CustomFields.c.partner" required="true"/>
</div>
<div class="row">
<div class="col-md-6">
<rn:widget path="input/FormInput" label_input="Nombre" name="Contact.Name.First" required="true" />
</div>
<div class="col-md-6">
<rn:widget path="input/FormInput" label_input="Apellidos" name="Contact.Name.Last" required="true" />
</div>
</div>
<div class="row">
<div class="col-md-6">
<rn:widget path="input/FormInput" label_input="Cargo" name="Contact.CustomFields.c.cargo2" required="true" />
</div>
<div class="col-md-6">
<rn:widget path="input/FormInput" name="Contact.CustomFields.c.empresa" required="true" />
</div>
</div>
<div class="row">
<div class="col-md-6">
<rn:widget path="input/FormInput" label_input="Email" name="Contact.Emails.PRIMARY.Address" required="true" />
</div>
<div class="col-md-6">
<rn:widget path="input/FormInput" label_input="Asistencia" name="Incident.CustomFields.c.interaccion" required="true" />
</div>
</div>
<div class="clear"></div>
<hr class="blueHr">
<rn:widget path="input/FormSubmit" label_button="Confirmar" flash_message="redireccionando..." on_success_url="/app/emailFailed" add_params_to_url="userName,marcos" error_location="rn_ErrorLocation"/>
<div class="row informationRights">
<div class="col-md-7">
<p>
La información que aquí nos proporciones será exclusivamente utilizada para mantenerte al corriente sobre novedades de esta jornada. Tienes derecho a acceder a tu registro para rectificarlo o cancelarlo, mediante email a
</p>
</div>
</div>
</fieldset>
</form>
When I do submit redirect to the correct page (/app/emailFailed) but puts on url a parameter called "refno" how can i modify that and put my own parameters?

The refno field is a standard parameter added to the out-of-the-box controller that your form is submitted to. If you need to alter the URL parameters, then you'll need to create a custom controller that can perform the action of submitting your form and adding the parameters that you need. The easiest way to do this would be to create a new controller that subclasses ajaxRequest so that you can override the sendform method with the logic that you need to implement.

Related

Preventing developer message to user frontend

I am developing a website with different pages, and among those pages,
I have a contact form that send message to the backend, the email id is unique, I need to display an error message to the front end that if a user enter the email that exist to then it has to display a message the email is taken. How can I go to achieve this. Here is my code
Controller
<?php
namespace App\Http\Controllers\Frontend;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Contact;
use Illuminate\Support\Carbon;
class FrontendPages extends Controller
{
public function About(){
return view('frontend.pages.about');
}//end method
public function Service(){
return view('frontend.pages.services');
}//end method
public function Blog(){
return view('frontend.pages.blog');
}//end method
public function Contact(){
return view('frontend.pages.contact');
}//end method
public function StoreMessage(Request $request){
Contact::insert([
'name' => $request->name,
'email' => $request->email,
'subject' => $request->subject,
'message' => $request->message,
'created_at' =>Carbon::now(),
]);
if ($request->email == 'email') {
return response()->json(['email exist']);
}
$notification = array(
'message' => 'Thank for being in touch we will get back to you soon',
'alert-type' => 'success'
);
return redirect()->back()->with($notification);
}
}
my form
#extends('frontend.main_master')
#section('main')
#php
$footersetup = App\Models\Footer::find(1)->first();
#endphp
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
<div class="container mt-3">
<div class="d-flex justify-content-between align-items-center">
<h2>Contact</h2>
<ol>
<li>Home</li>
<li>Contact</li>
</ol>
</div>
</div>
</section>
<!-- End Breadcrumbs -->
<!-- ======= Contact Section ======= -->
<section id="contact" class="contact">
<div class="container">
<div class="row mt-5">
<div class="col-lg-4">
<div class="info">
<h4>Location:</h4>
<div class="address">
<i class="bi bi-geo-alt"></i>
{!! $footersetup->address !!}<br /><br />
</div>
<div class="email">
<i class="bi bi-envelope"></i>
<h4>Email:</h4>
<p>
{{$footersetup->email}}<br />{{$footersetup->email1}}
</p>
</div>
<div class="phone">
<i class="bi bi-phone"></i>
<h4>Call:</h4>
<p>{{$footersetup->phone}}</p>
</div>
</div>
</div>
<div class="col-lg-8 mt-5 mt-lg-0">
<form
action="{{route('store.message')}}"
method="post"
role="form"
>
#csrf
<div class="row">
<div class="col-md-6 form-group">
<input
type="text"
name="name"
class="form-control"
id="name"
placeholder="Your Name"
required
/>
</div>
<div class="col-md-6 form-group mt-3 mt-md-0">
<input
type="email"
class="form-control"
name="email"
id="email"
placeholder="Your Email"
required
/>
</div>
</div>
<div class="form-group mt-3">
<input
type="text"
class="form-control"
name="subject"
id="subject"
placeholder="Subject"
required
/>
</div>
<div class="form-group mt-3">
<textarea
class="form-control"
name="message"
rows="5"
placeholder="Message"
required
></textarea>
</div>
<div class="my-3">
</div>
<div class="text-center">
<button type="submit" class="btn btn-success">Send Message</button>
</div>
</form>
</div>
</div>
</div>
</section>
<!-- End Contact Section -->
#endsection

I want to have two different forms for two pages

I want to have a different forms for the identity.tpl page and registration.tpl.
But the two references on the same form page customer-form.tpl.
How can I do ?
My form is static, it works perfectly for the registration.tpl page.
custom-form.tpl :
{include file='_partials/form-errors.tpl' errors=$errors['']}
<form action="{$action}" id="customer-form" class="js-customer-form" method="post">
<section>
<div class="col-md-6 mt-15">
<div class="row">
<label for="">
Civilité <sup class="c-warning">*</sub>
</label>
<label class="ml-60 mr-20" for="">
<input name="id_gender"
type="radio"
value="1">
Monsieur
</label>
<label for="">
<input name="id_gender"
type="radio"
value="2">
Madame
</label>
</div>
<div class="row">
<div class="col-md-3 plr-0 ">
<label for="">
Nom <sup class="c-warning">*</sub>
</label>
</div>
<div class="col-md-6">
<input name="lastname" type="text" value="" required>
</div>
</div>
<div class="row">
<div class="col-md-3 plr-0 ">
<label for="">
Prénom <sup class="c-warning">*</sub>
</label>
</div>
<div class="col-md-6">
<input name="firstname" type="text" value="" required>
</div>
</div>
<div class="row obligatory">
<label for=""><sup>*</sup>Champs obligatoires</label>
</div>
</div>
<div class="col-md-6 pt-55">
<div class="row">
<div class="col-md-4 plr-0 ">
<label for="">
Adresse e-mail <sup class="c-warning">*</sub>
</label>
</div>
<div class="col-md-6">
<input name="email" type="email" value="" required>
</div>
</div>
<div class="row">
<div class="col-md-4 plr-0 ">
<label for="">
Mot de passe <sup class="c-warning">*</sub>
</label>
</div>
<div class="col-md-6">
<input
name="password"
type="password"
value=""
required >
</div>
</div>
<div class="row">
<div class="col-md-4 plr-0 ">
</div>
<div class="col-md-6 ml-10">
<label for="">
<input
name="newsletter"
type="checkbox"
value="1">
S’inscrire à la newsletter
</label>
<!-- <input class="mt-10" type="submit" value="S'INSCRIRE"> -->
</div>
</div>
<footer class="form-footer clearfix">
<input type="hidden" name="submitCreate" value="1">
{block "form_buttons"}
<button class="btn form-control-submit pull-xs-right" data-link-action="save-customer" type="submit">
S'INSCRIRE
</button>
{/block}
</footer>
</div>
</section>
</form>
identity.tpl :
{extends 'customer/page.tpl'}
{block name='page_content'}
<div class="container container-id container-perso">
<h2 class="legal">{l s='Your personal information'}</h2>
{render file='customer/_partials/customer-form.tpl' ui=$customer_form}
</div>
{/block}
identity.tpl :
{extends file='page.tpl'}
{block name='page_header_container'}{/block}
{block name='page_content_container'}
{hook h="displaySliderImg"}
<div class="container container-id container-user">
{block name='register_form_container'}
<h2 class="legal">{l s='Create an account'}</h2>
<p class="text-center mt-10">Remplissez les informations ci-dessous.</p>
<div class="row bg-grey ptb-30 plr-50 mt-90" id="registration">
<div class="col-md-12">
{$hook_create_account_top nofilter}
<section class="register-form">
{render file='customer/_partials/customer-form.tpl' ui=$register_form}
</section>
</div>
</div>
</div>
<p>{l s='Already have an account?'} {l s='Log in instead!'}</p>
{/block}
</div>
{/block}
Copy all content from customer-form.tpl to identity.tpl and registration.tpl and then make your modifications.
As advice, you should make some changes in corresponding front controller and model object too, because it has validation based on current customer-form.tpl fields. Code should be something like this:
{render file='customer/_partials/form-that-you-want.tpl' ui=$form-that-you-want}
Good luck.
In PrestaShop each page has a unique value and this value can be fetched using the following code:
$this->context->smarty->smarty->tpl_vars['page']->value['page_name']
You will get a different value from above variable on Identity and Registration page, you can pass the value of above variable through Smarty and add a condition in 'custom-form.tpl'

ValidationSummary.ModelOnly fails but ValidationSummary.All works

This is strange. For some reason, this fails:
<div asp-validation-summary="ValidationSummary.ModelOnly"></div>
But this one works just fine:
<div asp-validation-summary="All"></div>
Any one would know why? Here is entire code snippet:
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h3>Login</h3>
<form method="post" novalidate>
<div asp-validation-summary="All"></div>
#*<div asp-validation-summary="ValidationSummary.ModelOnly"></div>*#
<div class="form-group">
<label asp-for="Username"></label>
<input type="text" asp-for="Username" class="form-control" />
<span asp-validation-for="Username"></span>
</div>
<div class="form-group">
<label asp-for="Password"></label>
<input type="password" asp-for="Password" class="form-control" />
<span asp-validation-for="Password"></span>
</div>
<div class="form-group">
<input type="submit" value="Login" class="btn btn-success" />
</div>
</form>
</div>
I'm assuming you are using asp.net core 1.0. The value for the validation-summary tag helper was changed from
<div asp-validation-summary="ValidationSummary.ModelOnly"></div>
to simply
<div asp-validation-summary="ModelOnly"></div>
You did it correclty with All ;-)
asp.net core docs

How to get a 4 containers to display in-line using Bootstrap 3

I have the following Bootstrap markup and and screen shot below. I want the entire group of (4) items to appear in one line and not to break. I've been tweaking for a couple hours and cannot make it happen. Is it possible to get them to all align in 1 row?
<div class="container-fluid">
<div id="sys-page-headerBar-container">
<div class="row">
<!--<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div> <!-- left gutter -->
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<!-- header -->
<form class="form-horizontal" method="post">
<fieldset>
<!-- Text input-->
<div class="form-group">
<label class="col-md-2 control-label" for="report_date">Service Date(s):</label>
<div class="col-md-2" id="dispatchLog-container">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="start" value="<?php echo date( DATE_SZ, strtotime( "today" ) ); ?>" tabindex="1" />
<span class="input-group-addon">to</span>
<input type="text" class="input-sm form-control" name="end" value="<?php echo date( DATE_SZ, strtotime( "today" ) ); ?>" tabindex="2" />
</div>
</div>
<label class="col-md-2 control-label" for="report_time">Service Time:</label>
<div class="input-group bootstrap-timepicker timepicker col-md-1">
<input id="timepicker" type="text" class="form-control input-small" data-minute-step="30" name="tour_time" tabindex="3"><input type="hidden" id="tour_time_value" value="<?php echo date( DATE_TP, strtotime( "12:00 AM" ) ); ?>">
<span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
</div>
<label class="col-md-1 control-label" for="report_order">Sort Order:</label>
<div class="col-md-1">
<select id="report_order" name="report_order" class="form-control" tabindex="4">
<option></option>
</select>
</div>
<div class="col-md-1">
<button id="submit" name="submit" class="btn btn-default" value="1" tabindex="5">Go</button>
</div>
</div>
</fieldset>
</form>
</div> <!-- .col-xs-10.col-sm-10.col-md-10.col-lg-10 -->
<!--<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div> <!-- right gutter -->
</div> <!-- .row -->
</div> <!-- #sys-login-container -->
</div> <!-- .container-fluid -->
One of the things to learn about bootstrap is when to not use bootstrap :-)
In your case just use your own css.
You can:
float them all;
make them all in-line-block
use flexbox with a fallback for older IE (IE Conditional css) to one of the above methods
Flexbox is probably what I'd use http://caniuse.com/#feat=flexbox, https://css-tricks.com/snippets/css/a-guide-to-flexbox/ but inline-block might just do it; In any case you can use your own media queries to change the display format if you need to.

Bootstrap 3 need white Space input group

in bootstrap 3 i want an input in one row by grouping the input i done it but the space is not occurring can any one help http://jsfiddle.net/qkPEm/1/
<div class="row">
<div class="col-lg-3">
<div class="input-group">
<input id="dd" class="location" name="city" type="text" placeholder="Source" size="90" />
</div>
</div>
<div class="col-lg-3">
<div class="input-group">
<input id="geocomplete" class="location" name="city" type="text" placeholder="Destination" size="90" />
</div>
</div>
<div class="col-lg-2">
<div class="input-group">
<input class="input-append form-date" readonly="true" type="text" id="dpd1" placeholder="From" value="" name="arrival" data-date-format="dd/mm/yyyy">
</div>
</div>
<div class="col-lg-2">
<div class="input-group">
<input class="input-append form-date" readonly="true" type="text" id="dpd2" placeholder="To" value="" name="departure" data-date-format="dd/mm/yyyy">
</div>
</div>
<div class="col-lg-2">
<div class="input-group">
<input class="guests" class="date" readonly="true" type="text" id="tags2" placeholder="Ttl.Expenses" value="" name="guests" />
</div>
</div>
</div>
Input size causing the issues.
Here's my method on solving the white space.
http://www.bootply.com/PRnJqqD8S3
Your input size is way over the col-lg-2's width, that's why you got the extra spacing.