Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c013a22008
@ -1093,6 +1093,19 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
$id = $object->create($user);
|
||||
if ($id < 0) {
|
||||
$error++;
|
||||
} else {
|
||||
// copy internal contacts
|
||||
if ($object->copy_linked_contact($facture_source, 'internal') < 0) {
|
||||
$error++;
|
||||
} elseif ($facture_source->socid == $object->socid) {
|
||||
// copy external contacts if same company
|
||||
if ($object->copy_linked_contact($facture_source, 'external') < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: Pb with situation invoice
|
||||
// NOTE: fields total on situation invoice are stored as cumulative values on total of lines (bad) but delta on invoice total
|
||||
|
||||
@ -138,8 +138,8 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
||||
$fieldstosearchall = array(
|
||||
'd.ref'=>'Ref',
|
||||
'd.note_public'=>"NotePublic",
|
||||
'u.lastname'=>'Lastname',
|
||||
'u.firstname'=>"Firstname",
|
||||
'u.lastname'=>'EmployeeLastname',
|
||||
'u.firstname'=>"EmployeeFirstname",
|
||||
'u.login'=>"Login",
|
||||
);
|
||||
if (empty($user->socid)) {
|
||||
|
||||
@ -2201,6 +2201,7 @@ function top_menu_quickadd()
|
||||
{
|
||||
global $langs, $conf, $db, $hookmanager, $user;
|
||||
global $menumanager;
|
||||
|
||||
$html = '';
|
||||
// Define $dropDownQuickAddHtml
|
||||
$dropDownQuickAddHtml = '<div class="dropdown-header bookmark-header center">';
|
||||
@ -2215,9 +2216,7 @@ function top_menu_quickadd()
|
||||
<!-- Thirdparty link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/societe/card.php?action=create" title="'.$langs->trans("MenuNewThirdParty").'">
|
||||
<i class="fa fa-building"></i><br>
|
||||
'.$langs->trans("ThirdParty").'
|
||||
</a>
|
||||
'. img_picto('', 'object_company') .'<br>'. $langs->trans("ThirdParty") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2228,9 +2227,7 @@ function top_menu_quickadd()
|
||||
<!-- Contact link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/contact/card.php?action=create" title="'.$langs->trans("NewContactAddress").'">
|
||||
<i class="fa fa-address-book"></i><br>
|
||||
'.$langs->trans("Contact").'
|
||||
</a>
|
||||
'. img_picto('', 'object_contact') .'<br>'. $langs->trans("Contact") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2241,9 +2238,7 @@ function top_menu_quickadd()
|
||||
<!-- Propal link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create" title="'.$langs->trans("NewPropal").'">
|
||||
<i class="fa fa-suitcase"></i><br>
|
||||
'.$langs->trans("Proposal").'
|
||||
</a>
|
||||
'. img_picto('', 'object_propal') .'<br>'. $langs->trans("Proposal") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2254,9 +2249,7 @@ function top_menu_quickadd()
|
||||
<!-- Order link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
|
||||
<i class="fa fa-file-alt"></i><br>
|
||||
'.$langs->trans("Order").'
|
||||
</a>
|
||||
'. img_picto('', 'object_order') .'<br>'. $langs->trans("Order") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2267,9 +2260,7 @@ function top_menu_quickadd()
|
||||
<!-- Invoice link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
|
||||
<i class="fa fa-coins"></i><br>
|
||||
'.$langs->trans("Bill").'
|
||||
</a>
|
||||
'. img_picto('', 'object_bill') .'<br>'. $langs->trans("Bill") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2280,9 +2271,7 @@ function top_menu_quickadd()
|
||||
<!-- Contract link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewContractSubscription").'">
|
||||
<i class="fa fa-file-contract"></i><br>
|
||||
'.$langs->trans("Contract").'
|
||||
</a>
|
||||
'. img_picto('', 'object_contract') .'<br>'. $langs->trans("Contract") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2293,9 +2282,7 @@ function top_menu_quickadd()
|
||||
<!-- Supplier proposal link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create" title="'.$langs->trans("NewAskPrice").'">
|
||||
<i class="fa fa-suitcase"></i><br>
|
||||
'.$langs->trans("AskPrice").'
|
||||
</a>
|
||||
'. img_picto('', 'object_propal') .'<br>'. $langs->trans("AskPrice") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2306,9 +2293,7 @@ function top_menu_quickadd()
|
||||
<!-- Supplier order link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
|
||||
<i class="fa fa-file-alt"></i><br>
|
||||
'.$langs->trans("SupplierOrder").'
|
||||
</a>
|
||||
'. img_picto('', 'object_order') .'<br>'. $langs->trans("SupplierOrder") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2319,9 +2304,7 @@ function top_menu_quickadd()
|
||||
<!-- Supplier invoice link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
|
||||
<i class="fa fa-coins"></i><br>
|
||||
'.$langs->trans("SupplierBill").'
|
||||
</a>
|
||||
'. img_picto('', 'object_bill') .'<br>'. $langs->trans("SupplierBill") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2332,9 +2315,7 @@ function top_menu_quickadd()
|
||||
<!-- Product link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&type=0" title="'.$langs->trans("NewProduct").'">
|
||||
<i class="fa fa-cube"></i><br>
|
||||
'.$langs->trans("Product").'
|
||||
</a>
|
||||
'. img_picto('', 'object_product') .'<br>'. $langs->trans("Product") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
@ -2345,9 +2326,29 @@ function top_menu_quickadd()
|
||||
<!-- Service link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&type=1" title="'.$langs->trans("NewService").'">
|
||||
<i class="fa fa-concierge-bell"></i><br>
|
||||
'.$langs->trans("Service").'
|
||||
</a>
|
||||
'. img_picto('', 'object_service') .'<br>'. $langs->trans("Service") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) {
|
||||
$langs->load("trips");
|
||||
$dropDownQuickAddHtml .= '
|
||||
<!-- Expense report link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$user->id.'" title="'.$langs->trans("AddTrip").'">
|
||||
'. img_picto('', 'object_trip') .'<br>'. $langs->trans("ExpenseReport") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
if (!empty($conf->holiday->enabled) && $user->rights->holiday->write) {
|
||||
$langs->load("holiday");
|
||||
$dropDownQuickAddHtml .= '
|
||||
<!-- Holiday link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/holiday/card.php?action=create&fuserid='.$user->id.'" title="'.$langs->trans("AddCP").'">
|
||||
'. img_picto('', 'object_holiday') .'<br>'. $langs->trans("Holidays") .'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
@ -2795,10 +2795,10 @@ class User extends CommonObject
|
||||
if (!empty($conf->global->LDAP_FIELD_USERID)) {
|
||||
$info[$conf->global->LDAP_FIELD_USERID] = $this->id;
|
||||
}
|
||||
if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) {
|
||||
if (!empty($conf->global->LDAP_FIELD_GROUPID)) {
|
||||
$usergroup = new UserGroup($this->db);
|
||||
$groupslist = $usergroup->listGroupsForUser($this->id);
|
||||
$info[$conf->global->LDAP_FIELD_GROUPID] = '1';
|
||||
$info[$conf->global->LDAP_FIELD_GROUPID] = '65534';
|
||||
if (!empty($groupslist)) {
|
||||
foreach ($groupslist as $groupforuser) {
|
||||
$info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list
|
||||
@ -2806,8 +2806,8 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) {
|
||||
$info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname";
|
||||
if (!empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) {
|
||||
$info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->login";
|
||||
}
|
||||
|
||||
return $info;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user