Force search pattern global search

This commit is contained in:
Benjamin Renard 2019-06-17 13:39:15 +02:00
parent fa96fc42ab
commit 63cd2e6fbc
5 changed files with 16 additions and 4 deletions

View file

@ -26,6 +26,10 @@ if(LSsession :: startLSsession()) {
if (LSsession :: globalSearch()) {
$LSaccess = LSsession :: getLSaccess();
$pattern = (isset($_REQUEST['pattern'])?$_REQUEST['pattern']:'');
if (empty($pattern)) {
LSerror :: addErrorCode(false, _('You must provide pattern for global search.'));
LSsession :: redirect('index.php');
}
$LSview_actions=array();
$LSview_actions['refresh'] = array (

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: LdapSaisie\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2019-06-17 12:20+0200\n"
"PO-Revision-Date: 2019-06-17 13:35+0200\n"
"Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n"
"Language-Team: LdapSaisie <ldapsaisie-users@lists.labs.libre-entreprise."
"org>\n"
@ -78,7 +78,7 @@ msgstr "Importer"
#: /home/brenard/dev/ldapsaisie_clean3/public_html/view.php:156
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/class/class.LSsession.php:1417
#: /home/brenard/dev/ldapsaisie_clean3/public_html/global_search.php:32
#: /home/brenard/dev/ldapsaisie_clean3/public_html/global_search.php:36
msgid "Refresh"
msgstr "Rafraîchir"
@ -1980,6 +1980,10 @@ msgstr "a bien été supprimé"
msgid "Do you really want to delete <strong>%{displayName}</strong> ?"
msgstr "Voulez-vous vraiment supprimer <strong>%{displayName}</strong> ?"
#: /home/brenard/dev/ldapsaisie_clean3/public_html/global_search.php:30
msgid "You must provide pattern for global search."
msgstr "Vous devez fournir un mot clé pour les recherches globales."
#: templates/default/import.tpl:8
msgid "File"
msgstr "Fichier"

View file

@ -56,7 +56,7 @@ msgstr ""
#: /home/brenard/dev/ldapsaisie_clean3/public_html/view.php:156
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/class/class.LSsession.php:1417
#: /home/brenard/dev/ldapsaisie_clean3/public_html/global_search.php:32
#: /home/brenard/dev/ldapsaisie_clean3/public_html/global_search.php:36
msgid "Refresh"
msgstr ""
@ -1696,6 +1696,10 @@ msgstr ""
msgid "Do you really want to delete <strong>%{displayName}</strong> ?"
msgstr ""
#: /home/brenard/dev/ldapsaisie_clean3/public_html/global_search.php:30
msgid "You must provide pattern for global search."
msgstr ""
#: templates/default/import.tpl:8
msgid "File"
msgstr ""

View file

@ -32,7 +32,7 @@
{if $globalSearch && $LSaccess}
<form action='global_search.php' method='post' class='LSview_search LSglobal_search'>
<input type='hidden' name='LSsearch_submit' value='1'/>
<input type='text' name='pattern' class='LSview_search LSglobal_search' placeholder='{tr msg='Global search'}'/>
<input type='text' name='pattern' class='LSview_search LSglobal_search' placeholder='{tr msg='Global search'}' required="required"/>
<input type='image' src='{img name='find'}' alt='{tr msg='Global search'}' title='{tr msg='Global search'}' />
</form>
{/if}