lcollong
FabriKant d'applications web
This plugin seems to work as expected (do not use the email part).
However, I use the prompt user feature for the value and I verify the value is correct using an api to an external site then returning true or false to validate the update. Here is the code in the preeval field :
The first two lines are using the $update var to catch back the user input value and the column concerned.
In order to make it runs as it was running on the J3/F3 site, I had to modify the update_col.php in line 201 to :
Could this mod added to the next distrib ?
Also when the Jdebug is on, this plugin throws errors on a eval field regarding incorrect use of language method. Could not be able to localize it. And also a "partial router error" when displaying back the list (list is not ajaxified).
However, I use the prompt user feature for the value and I verify the value is correct using an api to an external site then returning true or false to validate the update. Here is the code in the preeval field :
PHP:
$k = array_search('f_inscriptions.insc_id_stadline', $update->coltoupdate);
$v = $update->update_value[$k];
//echo "<pre>k:$k et val = $v";print_r($update);exit;
// et on vérifie si elle est correcte
$r = Exam_Inscriptions::isStadLineIdValid($v);
if ($r === false) {
$this->msg = "<span style=\"color:red;\">Pas possible de se connecter à StadLines !</span>";
return false;
}
if ($r === true) {
$this->msg = "<span style=\"color:red;\">Le code examen saisi (<strong>$v</strong>) n'existe pas !</span>";
return false;
}
if (Exam_Inscriptions::isStadLineIdAlreadyExist($v)) {
$this->msg = "<span style=\"color:red;\">Le code examen saisi (<strong>$v</strong>) existe déjà pour un autre candidat/session. Merci de vérifier et de recommencer.</span>";
return false;
}
$this->msg = $r;
return true;
The first two lines are using the $update var to catch back the user input value and the column concerned.
In order to make it runs as it was running on the J3/F3 site, I had to modify the update_col.php in line 201 to :
PHP:
if (!empty($preEval))
{
FabrikWorker::clearEval();
//apchea $res = Php::Eval(['code' => $preEval, 'vars'=>['data'=>$data, 'ids'=>$ids], 'thisVars'=>['msg'=>&$this->msg]]);
$res = Php::Eval(['code' => $preEval, 'vars'=>['data'=>$data, 'ids'=>$ids, 'update'=>$update], 'thisVars'=>['msg'=>&$this->msg]]);
Worker::logEval($res, 'Caught exception on eval in updatecol::process() : %s');
if ($res === false)
{
return false;
}
}
Could this mod added to the next distrib ?
Also when the Jdebug is on, this plugin throws errors on a eval field regarding incorrect use of language method. Could not be able to localize it. And also a "partial router error" when displaying back the list (list is not ajaxified).