Skip to content

Commit

Permalink
dev: minor fixes to participant panel
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Nov 7, 2012
1 parent ad4af30 commit a88ebb5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -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);
Expand All @@ -306,7 +306,7 @@ function getAttributeInfo_json()
$i++;
}


echo ls_json_encode($aData);
}

Expand Down Expand Up @@ -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]);
Expand All @@ -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;
Expand Down Expand Up @@ -1343,18 +1347,18 @@ 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(
'attribute_id' => $iAttributeId,
'value' => Yii::app()->request->getPost($attvaluename)
);
}
$i++;
} while ($_POST[$attvaluename] != "");
$attvaluename = 'attribute_value_name_' . ++$i;
};
ParticipantAttributeNames::model()->storeAttributeValues($aDatavalues);
}
/* Save updated attribute values */
Expand Down Expand Up @@ -2061,4 +2065,4 @@ function blacklistParticipant()

}

?>
?>
2 changes: 1 addition & 1 deletion application/models/Participants.php
Expand Up @@ -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'];
Expand Down

0 comments on commit a88ebb5

Please sign in to comment.