NEW Merge all left menu search boxes into one.
This commit is contained in:
parent
71da059ef0
commit
5c4ac0bf62
@ -40,14 +40,14 @@ $search_boxvalue=GETPOST('q');
|
|||||||
$arrayresult=array();
|
$arrayresult=array();
|
||||||
|
|
||||||
// Define $searchform
|
// Define $searchform
|
||||||
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
|
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company'));
|
//$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company'));
|
||||||
$arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
|
if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact'));
|
//$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact'));
|
||||||
@ -55,42 +55,50 @@ if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_C
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||||
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
|
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
|
||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product'));
|
//$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product'));
|
||||||
$arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled)
|
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
||||||
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER))
|
|
||||||
{
|
|
||||||
$langs->load("products");
|
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
|
|
||||||
{
|
|
||||||
$langs->load("members");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
|
||||||
$arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
|
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
//$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
||||||
$arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
|
$arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||||
|
{
|
||||||
|
$langs->load("members");
|
||||||
|
//$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
||||||
|
$arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire)
|
||||||
|
{
|
||||||
|
$langs->load("users");
|
||||||
|
//$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
||||||
|
$arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
||||||
|
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
||||||
|
{
|
||||||
|
$langs->load("hrm");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user'));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Execute hook addSearchEntry
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters);
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$searchform.=$hookmanager->resPrint;
|
$arrayresult=array_merge($arrayresult, $hookmanager->resArray);
|
||||||
}
|
}
|
||||||
else $searchform=$hookmanager->resPrint;
|
else $arrayresult=$hookmanager->resArray;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4512,10 +4512,13 @@ class Form
|
|||||||
* @param int $minimumInputLength Minimum Input Length
|
* @param int $minimumInputLength Minimum Input Length
|
||||||
* @param string $morecss Add more class to css styles
|
* @param string $morecss Add more class to css styles
|
||||||
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
||||||
|
* @param string $placeholder String to use as placeholder
|
||||||
* @return string HTML select string.
|
* @return string HTML select string.
|
||||||
*/
|
*/
|
||||||
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0)
|
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='')
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
$tmpplugin='select2';
|
$tmpplugin='select2';
|
||||||
@ -4559,6 +4562,7 @@ class Form
|
|||||||
},*/
|
},*/
|
||||||
cache: true
|
cache: true
|
||||||
},
|
},
|
||||||
|
placeholder: "'.dol_escape_js($placeholder).'",
|
||||||
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
||||||
minimumInputLength: '.$minimumInputLength.',
|
minimumInputLength: '.$minimumInputLength.',
|
||||||
formatResult: function(result, container, query, escapeMarkup) {
|
formatResult: function(result, container, query, escapeMarkup) {
|
||||||
|
|||||||
@ -755,5 +755,6 @@ SetRef=Set ref
|
|||||||
SearchIntoThirdparties=Search %s into thirdparties
|
SearchIntoThirdparties=Search %s into thirdparties
|
||||||
SearchIntoContacts=Search %s into contacts
|
SearchIntoContacts=Search %s into contacts
|
||||||
SearchIntoMembers=Search %s into members
|
SearchIntoMembers=Search %s into members
|
||||||
|
SearchIntoUsers=Search %s into users
|
||||||
SearchIntoProductsOrServices=Search %s into products or services
|
SearchIntoProductsOrServices=Search %s into products or services
|
||||||
SearchIntoProjects=Search %s into projects
|
SearchIntoProjects=Search %s into projects
|
||||||
@ -1551,7 +1551,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
*/
|
*/
|
||||||
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $db;
|
global $user, $conf, $langs, $db, $form;
|
||||||
global $hookmanager, $menumanager;
|
global $hookmanager, $menumanager;
|
||||||
|
|
||||||
$searchform='';
|
$searchform='';
|
||||||
@ -1567,7 +1567,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
if (! is_object($form)) $form=new Form($db);
|
||||||
|
$selected=-1;
|
||||||
|
$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"));
|
||||||
|
|
||||||
// Define $searchform
|
// Define $searchform
|
||||||
|
/*
|
||||||
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
|
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@ -1594,18 +1599,18 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
|
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
|
||||||
{
|
{
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
|
|
||||||
{
|
|
||||||
$langs->load("projects");
|
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
||||||
{
|
{
|
||||||
$langs->load("hrm");
|
$langs->load("hrm");
|
||||||
@ -1620,6 +1625,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
$searchform.=$hookmanager->resPrint;
|
$searchform.=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
else $searchform=$hookmanager->resPrint;
|
else $searchform=$hookmanager->resPrint;
|
||||||
|
*/
|
||||||
|
|
||||||
// Define $bookmarks
|
// Define $bookmarks
|
||||||
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
||||||
|
|||||||
@ -65,8 +65,6 @@ print $form->selectarray('selectarray',$array);
|
|||||||
print '<br><br>'."\n";
|
print '<br><br>'."\n";
|
||||||
|
|
||||||
print "Test 4d: a select with ajax refresh and with onchange call of url<br>\n";
|
print "Test 4d: a select with ajax refresh and with onchange call of url<br>\n";
|
||||||
//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz');
|
|
||||||
$array=array();
|
|
||||||
$selected=-1;
|
$selected=-1;
|
||||||
print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1);
|
print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1);
|
||||||
|
|
||||||
|
|||||||
@ -1145,6 +1145,10 @@ div.vmenu, td.vmenu {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vmenusearchselectcombo {
|
||||||
|
width: 172px;
|
||||||
|
}
|
||||||
|
|
||||||
.menu_contenu {
|
.menu_contenu {
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
@ -1219,17 +1223,17 @@ div.blockvmenusearch
|
|||||||
color: #000000;
|
color: #000000;
|
||||||
text-align: <?php print $left; ?>;
|
text-align: <?php print $left; ?>;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding-left: 5px;
|
/*padding-left: 5px;
|
||||||
padding-right: 1px;
|
padding-right: 1px;
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px; */
|
||||||
margin: 1px 0px 8px 2px;
|
margin: 1px 0px 4px 2px;
|
||||||
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
||||||
|
|
||||||
border-left: 1px solid #AAA;
|
/*border-left: 1px solid #AAA;
|
||||||
border-right: 1px solid #BBB;
|
border-right: 1px solid #BBB;
|
||||||
border-bottom: 1px solid #BBB;
|
border-bottom: 1px solid #BBB;
|
||||||
border-top: 1px solid #BBB;
|
border-top: 1px solid #BBB;*/
|
||||||
/*border-radius: 4px;
|
/*border-radius: 4px;
|
||||||
-moz-border-radius: 4px;
|
-moz-border-radius: 4px;
|
||||||
-moz-box-shadow: 3px 3px 4px #DDD;
|
-moz-box-shadow: 3px 3px 4px #DDD;
|
||||||
|
|||||||
@ -1173,6 +1173,10 @@ div.vmenu, td.vmenu {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vmenusearchselectcombo {
|
||||||
|
width: 170px;
|
||||||
|
}
|
||||||
|
|
||||||
.menu_contenu { padding-top: 4px; padding-bottom: 3px;}
|
.menu_contenu { padding-top: 4px; padding-bottom: 3px;}
|
||||||
#menu_contenu_logo { padding-right: 4px; }
|
#menu_contenu_logo { padding-right: 4px; }
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,8 @@ $search_user=GETPOST('search_user','alpha');
|
|||||||
$search_login=GETPOST('search_login','alpha');
|
$search_login=GETPOST('search_login','alpha');
|
||||||
$search_lastname=GETPOST('search_lastname','alpha');
|
$search_lastname=GETPOST('search_lastname','alpha');
|
||||||
$search_firstname=GETPOST('search_firstname','alpha');
|
$search_firstname=GETPOST('search_firstname','alpha');
|
||||||
|
$search_accountancy_code=GETPOST('search_accountancy_code','alpha');
|
||||||
|
$search_email=GETPOST('search_email','alpha');
|
||||||
$search_statut=GETPOST('search_statut','alpha');
|
$search_statut=GETPOST('search_statut','alpha');
|
||||||
$search_thirdparty=GETPOST('search_thirdparty','alpha');
|
$search_thirdparty=GETPOST('search_thirdparty','alpha');
|
||||||
$search_supervisor=GETPOST('search_supervisor','alpha');
|
$search_supervisor=GETPOST('search_supervisor','alpha');
|
||||||
@ -82,6 +84,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_login="";
|
$search_login="";
|
||||||
$search_lastname="";
|
$search_lastname="";
|
||||||
$search_firstname="";
|
$search_firstname="";
|
||||||
|
$search_accountancy_code="";
|
||||||
|
$search_email="";
|
||||||
$search_statut="";
|
$search_statut="";
|
||||||
$search_thirdparty="";
|
$search_thirdparty="";
|
||||||
$search_supervisor="";
|
$search_supervisor="";
|
||||||
@ -94,8 +98,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
$fieldstosearchall = array(
|
$fieldstosearchall = array(
|
||||||
'u.login'=>"Login",
|
'u.login'=>"Login",
|
||||||
'u.firstname'=>"Firstname",
|
|
||||||
'u.lastname'=>"Lastname",
|
'u.lastname'=>"Lastname",
|
||||||
|
'u.firstname'=>"Firstname",
|
||||||
'u.accountancy_code'=>"AccountancyCode",
|
'u.accountancy_code'=>"AccountancyCode",
|
||||||
'u.email'=>"EMail",
|
'u.email'=>"EMail",
|
||||||
'u.note'=>"Note"
|
'u.note'=>"Note"
|
||||||
@ -124,7 +128,7 @@ $buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/user/hierarchy.php'.(($sear
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy);
|
print load_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.gender, u.photo,";
|
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.accountancy_code, u.gender, u.photo,";
|
||||||
$sql.= " u.datelastlogin, u.datepreviouslogin,";
|
$sql.= " u.datelastlogin, u.datepreviouslogin,";
|
||||||
$sql.= " u.ldap_sid, u.statut, u.entity,";
|
$sql.= " u.ldap_sid, u.statut, u.entity,";
|
||||||
$sql.= " u.tms as date_update, u.datec as date_creation,";
|
$sql.= " u.tms as date_update, u.datec as date_creation,";
|
||||||
@ -148,14 +152,16 @@ else
|
|||||||
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
|
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
|
||||||
}
|
}
|
||||||
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
|
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
|
||||||
if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
|
//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
|
||||||
if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor;
|
if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor;
|
||||||
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
|
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
|
||||||
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
|
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
|
||||||
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
|
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
|
||||||
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
|
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
|
||||||
|
if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code);
|
||||||
|
if ($search_email != '') $sql.= natural_search("u.email", $search_email);
|
||||||
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
|
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
|
||||||
if ($sall) $sql.= natural_search($fieldstosearchall, $sall);
|
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
@ -188,6 +194,8 @@ if ($result)
|
|||||||
if ($search_login != '') $param.="&search_login=".$search_login;
|
if ($search_login != '') $param.="&search_login=".$search_login;
|
||||||
if ($search_lastname != '') $param.="&search_lastname=".$search_lastname;
|
if ($search_lastname != '') $param.="&search_lastname=".$search_lastname;
|
||||||
if ($search_firstname != '') $param.="&search_firstname=".$search_firstname;
|
if ($search_firstname != '') $param.="&search_firstname=".$search_firstname;
|
||||||
|
if ($search_accountancy_code != '') $param.="&search_accountancy_code=".$search_accountancy_code;
|
||||||
|
if ($search_email != '') $param.="&search_email=".$search_email;
|
||||||
if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor;
|
if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor;
|
||||||
if ($search_statut != '') $param.="&search_statut=".$search_statut;
|
if ($search_statut != '') $param.="&search_statut=".$search_statut;
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
@ -217,7 +225,9 @@ if ($result)
|
|||||||
'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
|
'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
|
||||||
'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
||||||
'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
|
'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
|
||||||
'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0),
|
||||||
|
'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1),
|
||||||
|
'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
||||||
'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
|
'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
|
||||||
'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1),
|
'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1),
|
||||||
'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100),
|
'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100),
|
||||||
@ -233,6 +243,8 @@ if ($result)
|
|||||||
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER['PHP_SELF'],"u.accountancy_code",$param,"","",$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER['PHP_SELF'],"u.email",$param,"","",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder);
|
||||||
@ -273,6 +285,14 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td><input type="text" name="search_firstname" size="6" value="'.$search_firstname.'"></td>';
|
print '<td><input type="text" name="search_firstname" size="6" value="'.$search_firstname.'"></td>';
|
||||||
}
|
}
|
||||||
|
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td><input type="text" name="search_accountancy_code" size="4" value="'.$search_accountancy_code.'"></td>';
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['u.email']['checked']))
|
||||||
|
{
|
||||||
|
print '<td><input type="text" name="search_email" size="6" value="'.$search_email.'"></td>';
|
||||||
|
}
|
||||||
if (! empty($arrayfields['u.fk_soc']['checked']))
|
if (! empty($arrayfields['u.fk_soc']['checked']))
|
||||||
{
|
{
|
||||||
print '<td><input type="text" name="search_thirdparty" size="6" value="'.$search_thirdparty.'"></td>';
|
print '<td><input type="text" name="search_thirdparty" size="6" value="'.$search_thirdparty.'"></td>';
|
||||||
@ -364,13 +384,21 @@ if ($result)
|
|||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.lastname']['checked']))
|
if (! empty($arrayfields['u.lastname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.ucfirst($obj->lastname).'</td>';
|
print '<td>'.$obj->lastname.'</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.firstname']['checked']))
|
if (! empty($arrayfields['u.firstname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.ucfirst($obj->firstname).'</td>';
|
print '<td>'.$obj->firstname.'</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.fk_soc']['checked']))
|
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$obj->accountancy_code.'</td>';
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['u.email']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$obj->email.'</td>';
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['u.fk_soc']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($obj->fk_soc)
|
if ($obj->fk_soc)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user