[ task #892 ] Add option in thridparty customer/supplier admin to hide
non active in select_company method
This commit is contained in:
parent
6c4e47514d
commit
aa7e3c2fdd
@ -681,6 +681,7 @@ class Form
|
|||||||
if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id;
|
if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||||
if ($filter) $sql.= " AND (".$filter.")";
|
if ($filter) $sql.= " AND (".$filter.")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 ";
|
||||||
$sql.= " ORDER BY nom ASC";
|
$sql.= " ORDER BY nom ASC";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::select_company sql=".$sql);
|
dol_syslog(get_class($this)."::select_company sql=".$sql);
|
||||||
|
|||||||
@ -116,6 +116,13 @@ class modSociete extends DolibarrModules
|
|||||||
$this->const[$r][4] = 0;
|
$this->const[$r][4] = 0;
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
|
$this->const[$r][0] = "COMPANY_HIDE_INACTIVE_IN_COMBOBOX";
|
||||||
|
$this->const[$r][1] = "chaine";
|
||||||
|
$this->const[$r][2] = "0";
|
||||||
|
$this->const[$r][3] = "hide thirdparty customer inative in combobox";
|
||||||
|
$this->const[$r][4] = 0;
|
||||||
|
$r++;
|
||||||
|
|
||||||
// Boxes
|
// Boxes
|
||||||
$this->boxes = array();
|
$this->boxes = array();
|
||||||
$r=0;
|
$r=0;
|
||||||
|
|||||||
@ -53,6 +53,7 @@ ConfirmAjax=Use Ajax confirmation popups
|
|||||||
UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||||
ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it
|
ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it
|
||||||
UseSearchToSelectContact=Use autocompletion fields to choose contact (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
UseSearchToSelectContact=Use autocompletion fields to choose contact (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||||
|
HideClosedThirdpartyComboBox=Hide Third party with Status to Closed into customer select list (or combobox)
|
||||||
SearchFilter=Search filters options
|
SearchFilter=Search filters options
|
||||||
NumberOfKeyToSearch=Nbr of characters to trigger search: %s
|
NumberOfKeyToSearch=Nbr of characters to trigger search: %s
|
||||||
ViewFullDateActions=Show full dates events in the third sheet
|
ViewFullDateActions=Show full dates events in the third sheet
|
||||||
|
|||||||
@ -52,6 +52,7 @@ ConfirmAjax= Utiliser les popups de confirmation Ajax
|
|||||||
UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de tiers (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
|
UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de tiers (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
|
||||||
ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer
|
ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer
|
||||||
UseSearchToSelectContact= Utiliser un champ avec autocomplétion pour choisir un contact (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de contacts (> 100 000), vous pouvez améliorer les performances en définissant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
|
UseSearchToSelectContact= Utiliser un champ avec autocomplétion pour choisir un contact (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de contacts (> 100 000), vous pouvez améliorer les performances en définissant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
|
||||||
|
HideClosedThirdpartyComboBox=Ne pas afficher les clients à l'état "Clos" dans les listes déroulantes (ou champ avec autocomplétion)
|
||||||
SearchFilter=Options des filtres de recherche
|
SearchFilter=Options des filtres de recherche
|
||||||
NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s
|
NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s
|
||||||
ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers
|
ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers
|
||||||
|
|||||||
@ -245,6 +245,22 @@ if ($action == 'setprofidinvoicemandatory')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Set hide closed customer into combox or select
|
||||||
|
if ($action == 'sethideinactivethirdparty')
|
||||||
|
{
|
||||||
|
$status = GETPOST('status','alpha');
|
||||||
|
|
||||||
|
if (dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX",$status,'chaine',0,'',$conf->entity) > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -728,6 +744,27 @@ else
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
|
// COMPANY_USE_SEARCH_TO_SELECT
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="80%">'.$langs->trans("HideClosedThirdpartyComboBox").'</td>';
|
||||||
|
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX))
|
||||||
|
{
|
||||||
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=sethideinactivethirdparty&status=0">';
|
||||||
|
print img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=sethideinactivethirdparty&status=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user