[ task #892 ] Add option in thridparty customer/supplier admin to hide

non active in select_company method
This commit is contained in:
fhenry 2013-05-11 17:10:11 +02:00
parent 6c4e47514d
commit aa7e3c2fdd
5 changed files with 47 additions and 0 deletions

View File

@ -681,6 +681,7 @@ class Form
if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id;
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 (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 ";
$sql.= " ORDER BY nom ASC";
dol_syslog(get_class($this)."::select_company sql=".$sql);

View File

@ -116,6 +116,13 @@ class modSociete extends DolibarrModules
$this->const[$r][4] = 0;
$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
$this->boxes = array();
$r=0;

View File

@ -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.
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.
HideClosedThirdpartyComboBox=Hide Third party with Status to Closed into customer select list (or combobox)
SearchFilter=Search filters options
NumberOfKeyToSearch=Nbr of characters to trigger search: %s
ViewFullDateActions=Show full dates events in the third sheet

View File

@ -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.
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.
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
NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s
ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers

View File

@ -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
*/
@ -728,6 +744,27 @@ else
print "</td>";
}
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>';