You are not logged in.
Hi Guys,
Someone of you knows one way to make mandatory the field "Comments" in the Satisfaction Survey window, when the requester select 3 Stars or less ?
This information is very important for us improvement the quality of service that we provide.
Best Regards
Offline
Find the column in the database, and set it to NOT NULL.
Good Luck
Offline
Hi,
glpi version ?
use webservices for satisfaction survey then use a html form to level and comments, validate with a script before submit to glpi.
Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6
préprod : glpi10.0.15
Offline
i'm gonna try, hope it work.
distributor takagi water heater di Indonesia.
Offline
Hi,
glpi version ?use webservices for satisfaction survey then use a html form to level and comments, validate with a script before submit to glpi.
Hi
I would like to you if you had some example or template of how can I do it?
When do you talk "Webservices" it is the GLPI Plugin?
Best Regards
Willian rocha
willianmgrocha@gmail.com
Offline
You can directly define mandatory field only if star<3 in GLPI.
You must write your own code in a plugin or with webservices to do that.
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Hi there,
Has anyone successfully defined the Comments field as mandatory?
Also, where do I modify the message sent out in the Satisfaction email?
Looking forward to hear from all the experts here.
Thanks.
Offline
Hi there,
I've customized GLPi to make the Comment field mandatory when the stars selected are less than 3.
For this, I edited the file: /glpi/inc/ticketsatisfaction.class.php and I added the code below.
echo "<script type='text/javascript'>\n";
echo "$(function() {";
echo "$('#stars').rateit({value: ".$this->fields["satisfaction"].",
min : 0,
max : 5,
step: 1,
backingfld: '#satisfaction_data',
ispreset: true,
resetable: false});";
echo "$('form[name=form]').submit(function(){
var satisfaction = $('#satisfaction_data').val();
var comment = $('#comment_data').val();
if(satisfaction < 1){
alert('Selecione uma nota para o chamado');
return false;
}
else if(satisfaction < 3 && (comment = '' || comment.trim().length < 5)){
alert('Justifique sua nota');
return false;
}
});";
echo "});";
echo "</script>";
Offline
Ce n'est pas la bonne méthode de changer directement le code source.
Il faut mieux écrire un plugin qui surchargera le comportement
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Hi there,
I've customized GLPi to make the Comment field mandatory when the stars selected are less than 3.
For this, I edited the file: /glpi/inc/ticketsatisfaction.class.php and I added the code below.
Hi, based on your code, I wrote a version for 9.5.5
in the file /glpi/inc/ticketsatisfaction.class.php after line 141 paste:
echo "$('form[name=form]').submit(function(){
var satisfaction = $('#satisfaction_data').val();
var comment = $('textarea[name=comment]').val();
if(satisfaction <= 4 && comment.trim().length < 20) {
if(comment.trim().length == ''){
alert('Here message about more or equal 4 stars and please write comment. \\n This is the next line of text if needed.','".__('Error')."');}
else{
alert('Here message about more or equal 4 stars and minimum characters in comment. \\n This is the next line of text if needed.','".__('Error')."');}
return false;}
});";
PS: or replace var comment = $('#comment_data').val(); in you code by $('textarea[name=comment]').val();
Offline