0

I have an extension that adds a tab to Events. The form is called up, and works using the automatic layout for the top piece.

 {foreach from=$elementNames item=elementName}
     <div class="crm-section">
     <div class="label">{$form.$elementName.label}</div>
     <div class="content">{$form.$elementName.html}</div>
     <div class="clear"></div>   </div> {/foreach}

Further down I add more to this form:

/script>
{/literal}
<table border='1' cellpadding='5' cellspacing='5'><tr class="crm-entity" id="TrialComponents" style='border-bottom: 1px solid black'><th>id</th><th>Event ID</th><th>Trial Number</th><th>Trial Date</th><th>Judge</th><th>Started</th><th>Advanced</th><th>Excellent</th><th>Elite Offered</th><th>Games</th></tr>

{crmAPI var='result' entity='TrialComponents' action='get' event_id = $event_id}
{foreach from=$result.values item=component}
<td>{$component.id}</td>
<td>{$component.event_id}</td>
<td>{$component.trial_number}</td>
<td>{$component.trial_date}</td>
<td>{$component.judge}</td>
<td>{$component.started_components}</td>
<td>{$component.advanced_components}</td>
<td>{$component.excellent_components}</td>
<td>{$component.elite_offered}</td>
<td>{$component.games_components}</td>
<td><a href="{$url}&reset=1&action=update&id={$component.id}" class="crm-popup"> Edit </a><a href="javascript:deleteComponent({$component.id})"> Delete </a></td></tr>
{/foreach}
<a title="Add a Component" class="button_name button crm-popup" href="{$url}?reset=1&action=add&id={$event_id}">
  <span>Add Component</span>
</a>

The idea here is I have a one to multi so this second bit lists out the component section, and I have an Edit and a Delete function associated with each line. The Delete works fine but its the href that does not. I have a second form in this extension called EditComponent, which I want to call and put in the popup window that gets produced when you hit the edit or Add Component. The issue is I'm getting a 404 error and it can't find that form? What URL should I be using in there to get that other form in the popup? My extension is called TrialAdmin and the two forms are called TrialDetails and EditComponent, both in the same directory of the extension. I think I'm just too tired to think this one through -- help?

3
  • Is your extension available on lab or github? Sometimes easier to try it!
    – Aidan
    Commented May 28, 2021 at 8:37
  • No it's not - very specialized and specific to our dog association. I can upload it though. Commented May 28, 2021 at 12:53
  • Ok, I needed to get some code control going so I have uploaded it to Github. github.com/cub69/ca.sdda.trialadmin/tree/master Commented May 28, 2021 at 14:02

1 Answer 1

2

Resolved this issue by using:

<td><a href="{crmURL p='civicrm/EditComponent' q='reset=1&action=update&id=2'}" class="crm-popup"> Edit </a><a href="javascript:deleteComponent({$component.id})"> Delete </a></td></tr>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.