Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2018-04-13 23:50:12 +02:00
commit 6cdb801ed8
5 changed files with 77 additions and 5 deletions

View File

@ -1169,6 +1169,7 @@ BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour
XDebugInstalled=XDebug 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".
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.
FieldEdition=Édition du champ %s
FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export)

View File

@ -263,6 +263,20 @@ if ($action == 'sethideinactivethirdparty')
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
@ -775,6 +789,24 @@ else
print '</a></td>';
print '</tr>';
/*print '<tr class="oddeven">';
print '<td width="80%">'.$langs->trans("OnSearchAndListGoOnCustomerOrSupplierCard").'</td>';
print '<td>&nbsp</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

View File

@ -1972,6 +1972,13 @@ class Societe extends CommonObject
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$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)))
{

View File

@ -504,6 +504,17 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) &&
{
$obj = $db->fetch_object($resql);
$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);
exit;
}

View File

@ -818,10 +818,17 @@ if ($action == 'create' || $action == 'adduserldap')
$valuetoshow.= ($valuetoshow?', ':'').'<input size="30" maxsize="32" type="text" name="password" value="'.$password.'" autocomplete="new-password">';
}
}
// Other form for user password
$parameters=array('valuetoshow' => $valuetoshow, 'password' => $password);
$reshook=$hookmanager->executeHooks('printUserPasswordField',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if ($reshook > 0) $valuetoshow=$hookmanager->resPrint; // to replace
else $valuetoshow.=$hookmanager->resPrint; // to add
print $valuetoshow;
print '</td></tr>';
if(! empty($conf->api->enabled))
if (! empty($conf->api->enabled))
{
// API key
$generated_api_key = '';
@ -1363,6 +1370,13 @@ else
else $valuetoshow.= ($valuetoshow?(' '.$langs->trans("or").' '):'').$langs->trans("Hidden");
}
}
// Other form for user password
$parameters=array('valuetoshow' => $valuetoshow);
$reshook=$hookmanager->executeHooks('printUserPasswordField',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if ($reshook > 0) $valuetoshow=$hookmanager->resPrint; // to replace
else $valuetoshow.=$hookmanager->resPrint; // to add
print $valuetoshow;
print "</td>";
print '</tr>'."\n";
@ -1923,6 +1937,13 @@ else
$valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').preg_replace('/./i','*',$object->pass);
}
}
// Other form for user password
$parameters=array('valuetoshow' => $valuetoshow, 'caneditpassword' => $caneditpassword);
$reshook=$hookmanager->executeHooks('printUserPasswordField',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if ($reshook > 0) $valuetoshow=$hookmanager->resPrint; // to replace
else $valuetoshow.=$hookmanager->resPrint; // to add
print $valuetoshow;
print "</td></tr>\n";
@ -2033,7 +2054,7 @@ else
else
{
$type=0;
if ($object->contact_id) $type=$object->contact_id;
if ($object->contactid) $type=$object->contactid;
print $form->selectcontacts(0,$type,'contactid',2,'','',1,'',false,1);
if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
}
@ -2203,12 +2224,12 @@ else
print '<td>';
if ($caneditfield)
{
print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">';
print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">';
}
else
{
print '<input type="hidden" name="accountancy_code" value="'.$object->accountancy_code.'">';
print $object->accountancy_code;
print '<input type="hidden" name="accountancy_code" value="'.$object->accountancy_code.'">';
print $object->accountancy_code;
}
print '</td>';
print "</tr>";