NEW OnSearchAndListGoOnCustomerOrSupplierCard conf
This commit is contained in:
parent
77a853e49d
commit
ba5ac47602
@ -1169,6 +1169,7 @@ BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour
|
|||||||
XDebugInstalled=XDebug est chargé.
|
XDebugInstalled=XDebug est chargé.
|
||||||
XCacheInstalled=XCache est chargé.
|
XCacheInstalled=XCache est chargé.
|
||||||
AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables. Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp".
|
AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables. Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp".
|
||||||
|
OnSearchAndListGoOnCustomerOrSupplierCard = A la recherche, ou sur une liste, aller directement sur la fiche client ou fournisseur (si le tiers est client ou fournisseur)
|
||||||
AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les tiers.
|
AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les tiers.
|
||||||
FieldEdition=Édition du champ %s
|
FieldEdition=Édition du champ %s
|
||||||
FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export)
|
FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export)
|
||||||
|
|||||||
@ -263,6 +263,20 @@ if ($action == 'sethideinactivethirdparty')
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($action=='setonsearchandlistgooncustomerorsuppliercard'){
|
||||||
|
$setonsearchandlistgooncustomerorsuppliercard = GETPOST('value','int');
|
||||||
|
$res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard,'yesno',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -775,6 +789,24 @@ else
|
|||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td width="80%">'.$langs->trans("OnSearchAndListGoOnCustomerOrSupplierCard").'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD))
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setonsearchandlistgooncustomerorsuppliercard&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setonsearchandlistgooncustomerorsuppliercard&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
|
}
|
||||||
|
print '</a></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// COMPANY_USE_SEARCH_TO_SELECT
|
// COMPANY_USE_SEARCH_TO_SELECT
|
||||||
|
|||||||
@ -1973,6 +1973,13 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
$name=$this->name?$this->name:$this->nom;
|
$name=$this->name?$this->name:$this->nom;
|
||||||
|
|
||||||
|
if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){
|
||||||
|
|
||||||
|
if(empty($option) && $this->client > 0) $option = 'customer';
|
||||||
|
if(empty($option) && $this->fournisseur > 0) $option = 'supplier';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
|
if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
|
||||||
{
|
{
|
||||||
if (($this->client) && (! empty ( $this->code_client ))
|
if (($this->client) && (! empty ( $this->code_client ))
|
||||||
|
|||||||
@ -504,6 +504,17 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) &&
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$id = $obj->rowid;
|
$id = $obj->rowid;
|
||||||
|
if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){
|
||||||
|
if( $obj->client > 0) {
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/comm/card.php?socid='.$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if( $obj->fournisseur > 0){
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/fourn/card.php?socid='.$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
header("Location: ".DOL_URL_ROOT.'/societe/card.php?socid='.$id);
|
header("Location: ".DOL_URL_ROOT.'/societe/card.php?socid='.$id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user