From 24eab5b8fd33ef0a9fa5bd7dd732f965c3aea6ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Feb 2013 18:22:28 +0100 Subject: [PATCH] New: Add page with seach only boxes. --- htdocs/core/search_jmobile.php | 110 +++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 htdocs/core/search_jmobile.php diff --git a/htdocs/core/search_jmobile.php b/htdocs/core/search_jmobile.php new file mode 100644 index 00000000000..9a86fb8619a --- /dev/null +++ b/htdocs/core/search_jmobile.php @@ -0,0 +1,110 @@ + + * + * This file is a modified version of datepicker.php from phpBSM to fix some + * bugs, to add new features and to dramatically increase speed. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/search_jmobile.php + * \brief File to return search box + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); +//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); + +require_once '../main.inc.php'; + +if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php +$langs->load("main"); +$right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); +$left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); + +//var_dump($langs->defaultlang); +//var_dump($conf->format_date_short_java); +//var_dump($langs->trans("FormatDateShortJava")); + + + +/* + * View + */ + +// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests +top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + + + +print ''."\n"; +print '
'; + +// Define $searchform +if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) +{ + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname'); +} + +if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) +{ + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname'); +} + +if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) +{ + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall'); +} + +if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) +{ + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/liste.php', DOL_URL_ROOT.'/fourn/product/liste.php', img_object('','product').' '.$langs->trans("SupplierRef"), 'products', 'srefsupplier'); +} + +if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) +{ + $langs->load("members"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall'); +} + +// Execute hook printSearchForm +$parameters=array(); +$searchform.=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + + +print "\n"; +print "\n"; +print '
'."\n"; +print $searchform; +print '
'."\n"; +print "\n"; + +print '
'; +print ''."\n"; + +$db->close(); +?>