Page 1 of 1

Re: Eliminate Please Enter Search Criteria

Posted: Tue Feb 20, 2018 4:56 am
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"));

Re: Eliminate Please Enter Search Criteria

Posted: Tue Feb 20, 2018 9:20 am
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", "");


Re: Eliminate Please Enter Search Criteria

Posted: Wed Feb 21, 2018 3:31 am
by elazarus3

You rock. That did it.

Thanks so much!


Re: Eliminate Please Enter Search Criteria

Posted: Sat Feb 24, 2018 5:52 am
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.


Re: Eliminate Please Enter Search Criteria

Posted: Sat Feb 24, 2018 11:12 am
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.


Re: Eliminate Please Enter Search Criteria

Posted: Sun Feb 25, 2018 1:32 am
by elazarus3

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