From 19369a686039cded1c9c4e183741a23cfe3abe4d Mon Sep 17 00:00:00 2001 From: Olle Haerstedt Date: Fri, 3 Jun 2016 11:59:49 +0200 Subject: [PATCH] Fixed issue #11328: unable to select mandatory date field if the survey is viewed in Arabic Language --- application/helpers/expressions/em_manager_helper.php | 11 +++++++++++ application/helpers/qanda_helper.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 96e9e35c061..b52c93da905 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -8586,6 +8586,17 @@ static function ProcessCurrentResponses() switch($type) // fix value before set it in $_SESSION : the data is reset when show it again to user.trying to save in DB : date only, but think it must be leave like it and filter oinly when save in DB { case 'D': //DATE + + // Handle Arabic numerals + // TODO: Make a wrapper class around date converter, which constructor takes to-lang and from-lang + $lang = $_SESSION['LEMlang']; + if ($lang == 'ar') + { + $standard = array("0","1","2","3","4","5","6","7","8","9"); + $eastern_arabic_symbols = array("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"); + $value = str_replace($eastern_arabic_symbols, $standard, $value); + } + $value=trim($value); if ($value!="" && $value!="INVALID") { diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php index bf55060ddab..a18b6ceaf97 100644 --- a/application/helpers/qanda_helper.php +++ b/application/helpers/qanda_helper.php @@ -1114,7 +1114,7 @@ function do_date($ia) 'maxdate' => $maxdate, 'dateformatdetails' => $dateformatdetails['dateformat'], 'dateformatdetailsjs' => $dateformatdetails['jsdate'], - 'goodchars' => "return goodchars(event,'".$goodchars."')", + 'goodchars' => "", // "return goodchars(event,'".$goodchars."')", // This won't work with non-latin keyboards 'checkconditionFunction' => $checkconditionFunction.'(this.value, this.name, this.type)', 'language' => App()->language, 'hidetip' => trim($aQuestionAttributes['hide_tip'])==0,