From 9b2f871b51991a4ddb15f7d0668ce401567922ba Mon Sep 17 00:00:00 2001 From: Jan-E Date: Tue, 28 Jul 2015 16:05:24 +0200 Subject: [PATCH 01/21] Fix #09790: Use conditions to get a subset of list_participants --- .../helpers/remotecontrol/remotecontrol_handle.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/application/helpers/remotecontrol/remotecontrol_handle.php b/application/helpers/remotecontrol/remotecontrol_handle.php index 0be98e605e5..d47d3ba56ca 100644 --- a/application/helpers/remotecontrol/remotecontrol_handle.php +++ b/application/helpers/remotecontrol/remotecontrol_handle.php @@ -1772,9 +1772,10 @@ public function list_groups($sSessionKey, $iSurveyID) * @param int $iLimit Number of participants to return * @param bool $bUnused If you want unused tokens, set true * @param bool|array $aAttributes The extented attributes that we want + * @param array $aConditions Optional conditions to limit the list, e.g. with array('email' => 'info@example.com') * @return array The list of tokens */ - public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=10, $bUnused=false,$aAttributes=false) + public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=10, $bUnused=false, $aAttributes=false, $aConditions=array() ) { if ($this->_checkSessionKey($sSessionKey)) { @@ -1787,10 +1788,16 @@ public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=1 if(!tableExists("{{tokens_$iSurveyID}}")) return array('status' => 'Error: No token table'); + $aAttributeValues = array(); + if (count($aConditions)) { + $aConditionFields = array_flip(Token::model($iSurveyID)->getMetaData()->tableSchema->columnNames); + $aAttributeValues = array_intersect_key($aConditions, $aConditionFields); + } + if($bUnused) - $oTokens = Token::model($iSurveyID)->incomplete()->findAll(array('limit' => $iLimit, 'offset' => $iStart)); + $oTokens = Token::model($iSurveyID)->incomplete()->findAllByAttributes($aAttributeValues, array('order' => 'tid', 'limit' => $iLimit, 'offset' => $iStart)); else - $oTokens = Token::model($iSurveyID)->findAll(array('limit' => $iLimit, 'offset' => $iStart)); + $oTokens = Token::model($iSurveyID)->findAllByAttributes($aAttributeValues, array('order' => 'tid', 'limit' => $iLimit, 'offset' => $iStart)); if(count($oTokens)==0) return array('status' => 'No Tokens found'); From 3b5489b97609b09613eb043bd911585498a0f08f Mon Sep 17 00:00:00 2001 From: Ernesto Vargas Date: Wed, 12 Aug 2015 11:25:08 -0600 Subject: [PATCH 02/21] Hide Tip for Datetime values are 0=No 1=Yes same as Admin --- application/helpers/qanda_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php index 3f8e7994106..012e07f7243 100644 --- a/application/helpers/qanda_helper.php +++ b/application/helpers/qanda_helper.php @@ -1308,7 +1308,7 @@ function do_date($ia) "; } - if (trim($aQuestionAttributes['hide_tip'])==1) { + if (trim($aQuestionAttributes['hide_tip'])==0) { $answer.="

".sprintf(gT('Format: %s'),$dateformatdetails['dateformat'])."

"; } //App()->getClientScript()->registerScript("doPopupDate{$ia[0]}","doPopupDate({$ia[0]})",CClientScript::POS_END);// Beter if just afetre answers part From 07dd3da1fc609d99282a29844a6ecf55c82daa38 Mon Sep 17 00:00:00 2001 From: louis Date: Thu, 13 Aug 2015 16:41:21 +0200 Subject: [PATCH 03/21] Dev: ComfortUpdate RTL rendering --- application/controllers/admin/update.php | 22 ++--- .../views/admin/update/_updateContainer.php | 24 ----- .../update/check_updates/_checkButtons.php | 6 +- .../views/admin/update/updater/_progress.php | 2 +- .../admin/update/updater/_right_container.php | 4 +- .../admin/update/updater/steps/_backup.php | 8 +- .../updater/steps/_check_local_errors.php | 27 +++--- .../steps/textaeras/_existingfiles.php | 2 +- .../steps/textaeras/_modifiedfiles.php | 2 +- .../steps/textaeras/_readonlyfiles.php | 2 +- .../admin/update/updater/welcome/_welcome.php | 10 +-- styles/gringegreen/adminstyle-rtl.css | 47 ++++++++++ styles/gringegreen/adminstyle.css | 90 +++++++++++++++++++ 13 files changed, 179 insertions(+), 67 deletions(-) diff --git a/application/controllers/admin/update.php b/application/controllers/admin/update.php index 466524ef6da..3aa34c288d8 100755 --- a/application/controllers/admin/update.php +++ b/application/controllers/admin/update.php @@ -118,7 +118,7 @@ public function checkLocalErrors() $aData['destinationBuild'] = $destinationBuild; $aData['access_token'] = $access_token; - return $this->controller->renderPartial('update/updater/steps/_check_local_errors', $aData, false, true); + return $this->controller->renderPartial('update/updater/steps/_check_local_errors', $aData, false, false); } return $this->_renderErrorString("unkown_destination_build"); } @@ -152,7 +152,7 @@ public function changeLog() { return $this->_renderError($changelog); } - return $this->controller->renderPartial('update/updater/steps/_change_log', $aData, false, true); + return $this->controller->renderPartial('update/updater/steps/_change_log', $aData, false, false); } return $this->_renderErrorString("unkown_destination_build"); } @@ -184,7 +184,7 @@ public function fileSystem() $aData['updateinfo'] = $changedFiles->files; $aData['access_token'] = $access_token; - return $this->controller->renderPartial('update/updater/steps/_fileSystem', $aData, false, true); + return $this->controller->renderPartial('update/updater/steps/_fileSystem', $aData, false, false); } return $this->_renderError($changedFiles); } @@ -220,7 +220,7 @@ public function backup() $aData['datasupdateinfo'] = $this->_parseToView($updateinfos); $aData['destinationBuild'] = $destinationBuild; $aData['access_token'] = $access_token; - return $this->controller->renderPartial('update/updater/steps/_backup', $aData, false, true); + return $this->controller->renderPartial('update/updater/steps/_backup', $aData, false, false); } else @@ -274,7 +274,7 @@ function step4() $updateModel->removeTmpFile('comfort_updater_cookie.txt'); // TODO : aData should contains information about each step - return $this->controller->renderPartial('update/updater/steps/_final', array(), false, true); + return $this->controller->renderPartial('update/updater/steps/_final', array(), false, false); } else { @@ -327,7 +327,7 @@ public function updateUpdater() $unzip = $updateModel->unzipUpdateUpdaterFile(); if( $unzip->result ) { - return $this->controller->renderPartial('update/updater/steps/_updater_updated', array('destinationBuild'=>$destinationBuild), false, true); + return $this->controller->renderPartial('update/updater/steps/_updater_updated', array('destinationBuild'=>$destinationBuild), false, false); } else { @@ -341,7 +341,7 @@ public function updateUpdater() } else { - return $this->controller->renderPartial('update/updater/welcome/_error_files_update_updater', array('localChecks'=>$localChecks), false, true); + return $this->controller->renderPartial('update/updater/welcome/_error_files_update_updater', array('localChecks'=>$localChecks), false, false); } } @@ -440,10 +440,10 @@ private function _getButtons($crosscheck) if( $serverAnswer->result ) { unset($serverAnswer->result); - return $this->controller->renderPartial('//admin/update/check_updates/update_buttons/_updatesavailable', array('updateInfos' => $serverAnswer)); + return $this->controller->renderPartial('//admin/update/check_updates/update_buttons/_updatesavailable', array('updateInfos' => $serverAnswer), false, false); } // Error : we build the error title and messages - return $this->controller->renderPartial('//admin/update/check_updates/update_buttons/_updatesavailable_error', array('serverAnswer' => $serverAnswer)); + return $this->controller->renderPartial('//admin/update/check_updates/update_buttons/_updatesavailable_error', array('serverAnswer' => $serverAnswer), false, false); } /** @@ -458,7 +458,7 @@ private function _renderWelcome($serverAnswer) $views = array('welcome', 'subscribe', 'key_updated', 'updater_update'); if( in_array($serverAnswer->view, $views) ) { - return $this->controller->renderPartial('//admin/update/updater/welcome/_'.$serverAnswer->view, array('serverAnswer' => $serverAnswer), false, true); + return $this->controller->renderPartial('//admin/update/updater/welcome/_'.$serverAnswer->view, array('serverAnswer' => $serverAnswer), false, false); } else { @@ -478,7 +478,7 @@ private function _renderWelcome($serverAnswer) */ private function _renderError($errorObject) { - echo $this->controller->renderPartial('//admin/update/updater/_error', array('errorObject' => $errorObject), false, true); + echo $this->controller->renderPartial('//admin/update/updater/_error', array('errorObject' => $errorObject), false, false); } /** diff --git a/application/views/admin/update/_updateContainer.php b/application/views/admin/update/_updateContainer.php index 92228f41352..2eca4730262 100644 --- a/application/views/admin/update/_updateContainer.php +++ b/application/views/admin/update/_updateContainer.php @@ -27,29 +27,5 @@ ?> \ No newline at end of file diff --git a/application/views/admin/update/check_updates/_checkButtons.php b/application/views/admin/update/check_updates/_checkButtons.php index 2ff0af3301d..31ad37fc2a7 100644 --- a/application/views/admin/update/check_updates/_checkButtons.php +++ b/application/views/admin/update/check_updates/_checkButtons.php @@ -11,7 +11,7 @@ * */ ?> -