From a88ebb5cf027dc7c80f2df22150b03e7245ae326 Mon Sep 17 00:00:00 2001 From: Menno Dekker Date: Wed, 7 Nov 2012 16:45:02 +0100 Subject: [PATCH] dev: minor fixes to participant panel --- .../controllers/admin/participantsaction.php | 18 +++++++++++------- application/models/Participants.php | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/application/controllers/admin/participantsaction.php b/application/controllers/admin/participantsaction.php index 046dcd9a946..6ef1b08e164 100644 --- a/application/controllers/admin/participantsaction.php +++ b/application/controllers/admin/participantsaction.php @@ -288,7 +288,7 @@ function getAttributeInfo_json() 'DP' => $clang->gT("Date"), 'TB' => $clang->gT("Text box") ); - + $aData = new stdClass(); $aData->page = $page; $aData->records = count($records); @@ -306,7 +306,7 @@ function getAttributeInfo_json() $i++; } - + echo ls_json_encode($aData); } @@ -1146,6 +1146,8 @@ function getAttribute_json() { function subval_sort($a, $subkey, $order) { + $b = array(); + $c = array(); foreach ($a as $k => $v) { $b[$k] = strtolower($v[$subkey]); @@ -1168,6 +1170,8 @@ function subval_sort($a, $subkey, $order) $iParticipantId = Yii::app()->request->getQuery('pid'); $records = ParticipantAttributeNames::model()->getParticipantVisibleAttribute($iParticipantId); //$getallattributes = ParticipantAttributeNames::model()->with('participant_attribute_names_lang')->findAll(); + Yii::trace(CVarDumper::dumpAsString($records), 'vardump'); + $records = array(); $records = subval_sort($records, "attribute_name", "asc"); $i = 0; @@ -1343,9 +1347,9 @@ function saveAttribute() if (Yii::app()->request->getPost('attribute_value_name_1') || Yii::app()->request->getPost('attribute_value_name_1') == "0") { $i = 1; - do + $attvaluename = 'attribute_value_name_' . $i; + while (array_key_exists($attvaluename, $_POST) && $_POST[$attvaluename] != "") { - $attvaluename = 'attribute_value_name_' . $i; if ($_POST[$attvaluename] != "") { $aDatavalues[$i] = array( @@ -1353,8 +1357,8 @@ function saveAttribute() 'value' => Yii::app()->request->getPost($attvaluename) ); } - $i++; - } while ($_POST[$attvaluename] != ""); + $attvaluename = 'attribute_value_name_' . ++$i; + }; ParticipantAttributeNames::model()->storeAttributeValues($aDatavalues); } /* Save updated attribute values */ @@ -2061,4 +2065,4 @@ function blacklistParticipant() } -?> +?> \ No newline at end of file diff --git a/application/models/Participants.php b/application/models/Participants.php index c16ec7c23b9..e496ba3e4a7 100644 --- a/application/models/Participants.php +++ b/application/models/Participants.php @@ -212,7 +212,7 @@ function getParticipants($page, $limit,$attid) $joinValue = array(); array_push($selectValue,"p.*"); array_push($selectValue,"luser.full_name as ownername"); - array_push($joinValue,"left join lime_users luser ON luser.uid=p.owner_uid"); + array_push($joinValue,"left join {{users}} luser ON luser.uid=p.owner_uid"); foreach($attid as $key=>$attid) { $attid = $attid['attribute_id'];