Forums

Creating and edit link for each row

rcadmin 23 Oct, 2014
In the "Front List" area, under Column Lists I have
basketball78.id:Ref No
basketball78.studentsurname:Surname
basketball78.studentname:First name
basketball78.datepaid:Paid
basketball78.schoolyear:Year
<?php if ( \GCore\Libs\Authorize::check_rules($connection['Connection']['extras']['front']['permissions']['delete'], \GCore\Libs\Authenticate::get_user_groups())) { echo '_DELETE_:[ Delete ]'; } ?>


In the HTML box I have
basketball78.delete:[ Delete ]


This displays the following list:
[attachment=0]Listing.PNG[/attachment]

What I am wanting is that the ID number i.e. Ref No, on each line is an edit link. I've tried a few things but they have not worked.
Max_admin 24 Oct, 2014
The "Delete" link works ? 🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rcadmin 25 Oct, 2014
Yes and I can get edit to work but I can't get them to work together and I can't get edit it work where it displays the ID number instead of the word edit.
Max_admin 25 Oct, 2014
Why you can't get edit to work ? just use _EDIT_ instead, please test it without PHP, and not in the line after the php line you have, instead put it OVER the php line, because php consumes the new line character after the closing tag!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rcadmin 27 Oct, 2014
Ok so this is as far as I get at present

_EDIT_:[ Edit ]
basketball78.id:Ref No
basketball78.studentsurname:Surname
basketball78.studentname:First name
basketball78.datepaid:Paid
basketball78.schoolyear:Year
<?php if ( \GCore\Libs\Authorize::check_rules($connection['Connection']['extras']['front']['permissions']['delete'], \GCore\Libs\Authenticate::get_user_groups())) { echo '_DELETE_:[ Delete ]'; } ?>


Generates
[attachment=0]cc2.PNG[/attachment]

So it seems to work, I have three more questions and I should be sorted for this part.

The php above seems to involve security. If this is correct don't I need something similar for the edit link?

Instead of having the edit column, how to I make each reference number a hyperlinked edit link?

In an older version of CC there was a dropdown that allowed me to choose the edit form. I can't figure out how to link the edit link to the actual edit form in CF.
Max_admin 28 Oct, 2014
#1- You can use PHP for the edit link, but you will need an extra new line OR a space if there are more columns after it.

#2- Use the links box, and point it to the same connection list url + &act=edit&gcb={Model.primary_key}

#3- Use the form event box under the "actions" tab for the "edit" action.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rcadmin 28 Oct, 2014
Ok so I am crawling forward; sorry for the slow pace 😶

Column List
<?php if ( \GCore\Libs\Authorize::check_rules($connection['Connection']['extras']['front']['permissions']['edit'], \GCore\Libs\Authenticate::get_user_groups())) { echo '_EDIT_:[ Edit ]'; } ?> 
basketball78.studentsurname:Surname
basketball78.studentname:First name
basketball78.datepaid:Paid
basketball78.schoolyear:Year
<?php if ( \GCore\Libs\Authorize::check_rules($connection['Connection']['extras']['front']['permissions']['delete'], \GCore\Libs\Authenticate::get_user_groups())) { echo '_DELETE_:[ Delete ]'; } ?>


Now to change the listing so that instead of having the word "Edit" hyperlinked, the ID number appears as a link, I tried the following in the "Links" box
/index.php?option=com_chronoconnectivity5&cont=lists&act=index&ccname=Basketball_7to8&act=edit&gcb={basketball78.id}


But I still get
[attachment=0]cc4.PNG[/attachment]
Max_admin 30 Oct, 2014
In the links box you don't have the field name used in the "Columns list" box, and since you want to use a field value, then just wrap the "basketball78.id" field in the PHP statement in the "Columns list", then reference it in the links box!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger