Skip to content

Commit

Permalink
Fixed issue #06669: Paticipants panel Attribute error on add
Browse files Browse the repository at this point in the history
Dev Working fine now for single attribute
  • Loading branch information
aniesshsethh committed Oct 14, 2012
1 parent c049298 commit 12106b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -1186,7 +1186,7 @@ function subval_sort($a, $subkey, $order)
/* Iterate through each attribute owned by this user */
foreach ($records as $row)
{
$outputs[$i] = array("", $row['participant_id'], $row['attribute_type'], $row['attribute_name'], $row['value']);
$outputs[$i] = array("", $row['participant_id'], $row['attribute_type'], $row['attribute_id'], $row['attribute_name'], $row['value']);
/* Collect allowed values for a DropDown attribute */
if ($row['attribute_type'] == "DD")
{
Expand Down Expand Up @@ -1231,7 +1231,7 @@ function subval_sort($a, $subkey, $order)
/* Go through the empty attributes and build an entry in the output for them */
foreach ($attributenotdone as $row)
{
$outputs[$i] = array("", $iParticipantId, $row['attribute_type'], $row['attribute_name'], "");
$outputs[$i] = array("", $iParticipantId, $row['attribute_type'], $row['attribute_id'], $row['attribute_name'], "");
if ($row['attribute_type'] == "DD")
{
$attvalues = ParticipantAttributeNames::model()->getAttributesValues($row['attribute_id']);
Expand Down Expand Up @@ -1397,8 +1397,10 @@ function editAttributevalue()
{
if (Yii::app()->request->getPost('oper') == "edit" && (Yii::app()->request->getPost('attvalue') || Yii::app()->request->getPost('attvalue')=="0"))
{
$iAttributeId = explode("_", Yii::app()->request->getPost('id'));
$aData = array('participant_id' => Yii::app()->request->getPost('participant_id'), 'attribute_id' => $iAttributeId[1], 'value' => Yii::app()->request->getPost('attvalue'));

$iAttributeId = Yii::app()->request->getPost('attid');

$aData = array('participant_id' => Yii::app()->request->getPost('participant_id'), 'attribute_id' => $iAttributeId, 'value' => Yii::app()->request->getPost('attvalue'));
ParticipantAttributeNames::model()->editParticipantAttributeValue($aData);
}
}
Expand Down
Expand Up @@ -96,6 +96,7 @@
var actionsColTxt="<?php $clang->eT("Actions") ?>";
var participantIdColTxt="<?php $clang->eT("Participant ID") ?>";
var attributeTypeColTxt="<?php $clang->eT("Attribute type") ?>";
var attributeIdColTxt="<?php $clang->eT("Attribute ID") ?>";
var attributeNameColTxt="<?php $clang->eT("Attribute name") ?>";
var attributeValueColTxt="<?php $clang->eT("Attribute value") ?>";
var attributePosValColTxt="<?php $clang->eT("Possible attribute values") ?>";
Expand Down
4 changes: 2 additions & 2 deletions scripts/admin/displayParticipant.js
Expand Up @@ -209,7 +209,6 @@ $(document).ready(function() {
}
}
});

/* Subgrid that displays user attributes */
jQuery("#"+subgrid_table_id).jqGrid( {
url: getAttribute_json+'/'+row_id,
Expand All @@ -219,13 +218,14 @@ $(document).ready(function() {
caption: attributesHeadingTxt,
editable: true,
loadonce : true,
colNames: [actionsColTxt,participantIdColTxt,attributeTypeColTxt,attributeNameColTxt,attributeValueColTxt,attributePosValColTxt],
colNames: [actionsColTxt,participantIdColTxt,attributeTypeColTxt,attributeIdColTxt,attributeNameColTxt,attributeValueColTxt,attributePosValColTxt],
colModel: [ { name:'act',index:'act',width:55,align:'center',search: false,sortable:false,formatter:'actions',formatoptions : { keys:true,onEdit:function(id){
var iRow = $('#' + $.jgrid.jqID(id))[0].rowIndex;
editModifier(id,iRow, method='edit');
}}},
{ name:'participant_id',index:'participant_id', width:150, sorttype:"string",align:"center",editable:true,hidden:true},
{ name:'atttype',index:'atttype', width:150, sorttype:"string",align:"center",editable:false,hidden:true},
{ name:'attid',index:'attid', width:150, sorttype:"string",align:"center",editable:true,hidden:true},
{ name:'attname',index:'attname', width:150, sorttype:"string",align:"center",editable:false},
{ name:'attvalue',index:'attvalue', width:150, sorttype:"string",align:"center",editable:true},
{ name:'attpvalues',index:'attpvalues', width:150, sorttype:"string",align:"center",editable:false,hidden:true}],
Expand Down

0 comments on commit 12106b4

Please sign in to comment.