I'm working with 2 tables: Master A and Detail B . The table B is also at menu as normal entry
i made a very simple custom script to see a PDF document stored (as name , e.g. document1.pdf) in a field of table B. The document has been stored in dedicated folder according with the setup field .
In addition i implemented also a new option in list options just to see the pdf document , to do this i used the events ListOption_Load and ListOptions_Rendered in LIst Page events of the table B. The php file invoked by the script is very simple and stored in the folder customphp created under the main path of the website.
The ListOptions_Rendered event has a below construct :
$this->ListOptions->Items["Vedi Documento"]->Body = "<a href='customphp/VedoPDF.php?id=$Doc_id' target='_blank' ><span>Vedi Documento</span></a>";
when i select table B from the main menu it recognizes correctly the option and if i click on the option VedoPDF.php is launched
Differently if i reach table B using Master Detail View option from table A the list Option doesn't apperas in the row and this is the first bug i experienced
In addition i have a stonger bug which i'm not able to overcome:
the field document in table B has been customized in PHP Maker using Cutom View Tag and it is :
<?php
if (urlencode(CurrentPage()->documento->CurrentValue) != "") {?>
<a target= "_blank" href="customphp/VedoPDF.php?id=<?php echo '../Documenti/Parrocchie/Incontri/' . urlencode(CurrentPage()->documento->CurrentValue) ?>">Click per Vedere/Ristampare il documento</a>
<?php
}?>
it means that when i view the record and i click on the link i launch the same VedoPDF.php
It runs perfectly when i reach the row from table B as normal entry at the menu, but when i reach the row from Master Detail View from table A it doesn't run due to the fact that the path is different. Just to identify what happens :
- in the first case the path you see on the screen when i put the cursor on the field is
localhost/Caritas/customphp/VedoPDF.php?id=...........
and it is correct - in the second case the path you see is :
localhost/Caritas/ParrocchieView/customphp/VedoPDF.php?=.......
and this is wrong and i receive the error 404
of course the Master Table is Parrocchie and it seems be a folder
do you have some suggestions to offer in order to bypass two bugs
thanks in advance