Hello!
I hope someone can help me with my request.
I need to include my custom fields in the booking overview. That is working so far, although I have two problems.
1. I have one custom field named "studiengang" where the user can choose his value from a drop down menu (there a roundabout 12 options to choose). When I include the field in my booking overview it only shows the number of the value in the database (from the dtregister_field_values table) not the one that is defined in dtregister_fields. I'm sure it is possible to get the correct value (it's working in the confirmation email, but I don't get it...
)
Here's how I did the inclusion in views/user/tmpl/list.php:
<?php
$k = 0;
$i = 0;
$fieldNameMap = $this->mUser->table->TableUserfield->Tablefield->mapNametoId();
if($this->rows)
foreach($this->rows as $row){
$fee = $this->mUser->table->TableFee->findByUserId($row->userId);
$name = array();
$link = 'index.php?option=com_dtregister&task=edit&controller=user&cid[]='. $row->userId;
$field_values = $this->mUser->table->TableUserfield->findByUserId($row->userId);
$field_address = $field_values[$fieldNameMap['address']];
$field_lastname = $field_values[$fieldNameMap['lastname']];
$field_zip = $field_values[$fieldNameMap['zip']];
$field_city = $field_values[$fieldNameMap['city']];
$field_phone = $field_values[$fieldNameMap['phone']];
$field_studiengang = $field_values[$fieldNameMap['studiengang']];
$field_semester = $field_values[$fieldNameMap['semester']];
$name = array();
if(isset($field_values[$fieldNameMap['firstname']])){
$name[] = $field_values[$fieldNameMap['firstname']];
}
$name = implode(" ",array_filter($name));
$email = "";
if(isset($field_values[$fieldNameMap['email']])){
$email = $field_values[$fieldNameMap['email']];
}
?>
<tr class="<?php echo "row$k"; ?>" >
<td><?php echo $pageNav->getRowOffset( $i ); ?></td>
<td><?php echo $checked = JHTML::_('grid.id', $i, $row->userId); ?></td>
<td align="center">[url=<?php echo $link?>]<?php echo $name; ?>[/url]</td>
<td align="center"><?php echo $field_lastname; ?></td>
<td align="center">[url=mailto:<?php echo stripslashes($email);?>]<?php echo stripslashes($email);?>[/url]</td>
<td align="center"><?php echo $field_address; ?></td>
<td align="center"><?php echo $field_zip; ?></td>
<td align="center"><?php echo $field_city; ?></td>
<td align="center"><?php echo $field_phone; ?></td>
<td align="center"><?php echo $field_studiengang; ?></td>
<td align="center"><?php echo $field_semester; ?></td>
<td align="center"><?php
$evtTable = $this->getModel('event')->table;
$evtTable->slabId = $row->slabId;
$evtTable->dtstart = $row->dtstart;
$evtTable->title = $row->title;
echo $evtTable->displayTitle(); ?> </td>
<td align="center"><?php echo DTreg::numberFormat($row->fee,2);?></td>
<td align="center"><?php echo $row->register_date;?></td>
<td align="center"><?php echo $row->confirmNum; ?></td>
<td align="center">
<?php
if((isset($fee->fee) && $fee->fee >0) || $fee->payment_method == "offline_payment"){
if ( (isset($fee) && $fee != "") && isset($pMethods[$fee->payment_method]) ) echo $pMethods[$fee->payment_method];
else if (isset($fee->payment_method)) echo $fee->payment_method;
}else{
echo Jtext::_('DT_FREE');
}
?>
</td>
<td align="center"><?php echo (isset($fee->fee) && $fee->fee >0)?DtHtml::gridTask($row, $i,'fee_status'):''; ?></td>
<td><?php
if(!count($this->mUser->table->TableMember->findByUserId($row->userId))) {
echo DtHtml::gridTask($row, $i,'attend');
}
?></td>
<td align="center"><?php
if($row->cancel == 1){
echo DTreg::numberFormat($row->due,2);
}else{
echo DTreg::numberFormat(($row->fee-$row->paid_amount),2);
}
?>
</td>
<td align="center"><?php
echo $this->mUser->table->statustxt[$row->user_status];
?></td>
</tr>
<?php
$k = 1 - $k;
$i++;
}
?>
2. The sorting in this "customized" booking overview does not work as it should.
Everytime I want to sort one of the columns that I've added to the list all the entries disappear - the list is empty.
Anyone with an idea?
Thanks for your support!
Greetings from germany
Dominik