Eliminate Please Enter Search Criteria

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
elazarus3
User
Posts: 90

Re: Eliminate Please Enter Search Criteria

Post by elazarus3 »

Hi all - the default table for my phpmaker project requires search criteria. However, when there are no search criteria, it still shows a popup window "Please enter search criteria."

For several years, I have disabled this by editing the template file listscript - but I'd really like to just get rid of this popup without needing to edit the template file.

Again, I want the search criteria required, but just want to eliminate this pop-up globally in the project. Is this possible? Or, is it possible just for the table in question (called patient_list)?

I am modifying the list-script template file as follows. I thought in v2018 of phpmaker I could make this modification in my program file instead of having to edit the template file each time I update to the next version of phpmaker or new template.

1) To clear "Please enter search criteria" message, Customize list-script.php in the template, look for and delete:

    if ($<!--##=sPageObj##-->->SearchWhere == "0=101")
        $<!--##=sPageObj##-->->setWarningMessage($Language->Phrase("EnterSearchCriteria"));
    else
        $<!--##=sPageObj##-->->setWarningMessage($Language->Phrase("NoRecord"));

mobhar
User
Posts: 11660

Post by mobhar »

No need to customize template for such case. All you have to do is simply put the following code in "Language_Load" server event:

$this->setPhrase("EnterSearchCriteria", "");


elazarus3
User
Posts: 90

Post by elazarus3 »

You rock. That did it.

Thanks so much!


elazarus3
User
Posts: 90

Post by elazarus3 »

Hmmm - in another project file, I'm having trouble eliminating this - now I'm getting:

No records found

I tried:

$this->setPhrase("Norecordsfound", "");

But this is not clearing the message - any tips on how to eliminate this one too? Thanks.


vincenthung
User
Posts: 88

Post by vincenthung »

The id of the phrase "No records found" is "norecord", you can search the message in english.xml under the folder "phplang" of the destination folder and get the phrase id and use the above code to update it.


elazarus3
User
Posts: 90

Post by elazarus3 »

Thank you - that did it, and thx for the reference.


Post Reply