Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How to show custom fields in back end list?

How to show custom fields in back end list? 12 years 1 month ago #18797

  • schwedenfan
  • schwedenfan's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

How to show custom fields in back end list? 11 years 7 months ago #20409

  • waynejb
  • waynejb's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 131
  • Thank you received: 4
Did you ever get this figured out? I would love to be able to break the name field and have first name and last name columns. This way you can sort by last name quickly.

Please Log in or Create an account to join the conversation.

How to show custom fields in back end list? 11 years 7 months ago #20447

  • schwedenfan
  • schwedenfan's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
Unfortunately I never got an answer to my question.
I would love to see that implemented in upcoming versions of the component.
Would be great to hear a statement of the admin, wouldn't it?

Please Log in or Create an account to join the conversation.

How to show custom fields in back end list? 11 years 6 months ago #20498

  • waynejb
  • waynejb's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 131
  • Thank you received: 4
I would agree with you here. We are looking to some developer friends I have in India to assist me at the moment. I will keep you posted.

Please Log in or Create an account to join the conversation.

How to show custom fields in back end list? 11 years 5 months ago #20834

  • mdesmit
  • mdesmit's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 26
  • Thank you received: 0
Hi,

I also would like to have the option of custom fields in the backoffice.
But first i must implement the site on joomla 3. Fortunately i have some
time to test ..

Please keep me posted about new developments here and I'm also interested in custom development options.

best regards,

Martin

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.168 seconds