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

Conflicts:
	htdocs/core/boxes/box_actions.php
	htdocs/core/boxes/box_contracts.php
	htdocs/core/boxes/box_factures_fourn.php
	htdocs/core/boxes/box_factures_fourn_imp.php
	htdocs/core/boxes/box_ficheinter.php
	htdocs/core/boxes/box_propales.php
	htdocs/core/boxes/box_services_expired.php
	htdocs/core/boxes/box_supplier_orders.php
	htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
This commit is contained in:
Laurent Destailleur 2022-07-29 11:22:01 +02:00
commit a4b7f38346
38 changed files with 116 additions and 81 deletions

View File

@ -1534,7 +1534,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} else { } else {
//print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>'; //print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
if (!$object->user_id && $user->rights->user->user->creer) { if (!$object->user_id && $user->rights->user->user->creer) {
print '<a class="aaa" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create_user&token='.newToken().'">'.img_picto($langs->trans("CreateDolibarrLogin"), 'add').' '.$langs->trans("CreateDolibarrLogin").'</a>'; print '<a class="aaa" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create_user&token='.newToken().'">'.img_picto($langs->trans("CreateDolibarrLogin"), 'add', 'class="pictofixedwidth"').$langs->trans("CreateDolibarrLogin").'</a>';
} }
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -60,7 +60,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->accounting->mouvements->lire); $this->hidden = empty($user->rights->accounting->mouvements->lire);
} }
/** /**

View File

@ -60,7 +60,7 @@ class box_accountancy_suspense_account extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->accounting->mouvements->lire); $this->hidden = empty($user->rights->accounting->mouvements->lire);
} }
/** /**

View File

@ -63,8 +63,8 @@ class box_activity extends ModeleBoxes
$this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments) $this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
$this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire) $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire)
|| (!empty($conf->commande->enabled) && $user->rights->commande->lire) || (isModEnabled('commande') && $user->rights->commande->lire)
|| (!empty($conf->propal->enabled) && $user->rights->propale->lire) || (isModEnabled('propal') && $user->rights->propale->lire)
); );
} }

View File

@ -60,7 +60,7 @@ class box_boms extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->bom->read); $this->hidden = empty($user->rights->bom->read);
} }
/** /**

View File

@ -56,7 +56,7 @@ class box_bookmarks extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->bookmark->lire); $this->hidden = empty($user->rights->bookmark->lire);
} }
/** /**

View File

@ -60,7 +60,7 @@ class box_commandes extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->commande->lire); $this->hidden = empty($user->rights->commande->lire);
} }
/** /**

View File

@ -68,7 +68,7 @@ class box_comptes extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !($user->rights->banque->lire); $this->hidden = empty($user->rights->banque->lire);
} }
/** /**

View File

@ -112,32 +112,32 @@ class box_dolibarr_state_board extends ModeleBoxes
'dolresource' 'dolresource'
); );
$conditions = array( $conditions = array(
'users' => $user->rights->user->user->lire, 'users' => $user->hasRight('user', 'user', 'lire'),
'members' => !empty($conf->adherent->enabled) && $user->rights->adherent->lire, 'members' => isModEnabled('adherent') && $user->rights->adherent->lire,
'customers' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), 'customers' => isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), 'prospects' => isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
'suppliers' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire) 'suppliers' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire)
|| (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)
|| (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)
) )
&& empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, 'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'),
'products' => !empty($conf->product->enabled) && $user->rights->produit->lire, 'products' => isModEnabled('product') && $user->hasRight('produit', 'lire'),
'services' => !empty($conf->service->enabled) && $user->rights->service->lire, 'services' => isModEnabled('service') && $user->hasRight('service', 'lire'),
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire, 'proposals' => isModEnabled('propal') && $user->hasRight('propale', 'lire'),
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire, 'orders' => isModEnabled('commande') && $user->hasRight('commande', 'lire'),
'invoices' => isModEnabled('facture') && $user->rights->facture->lire, 'invoices' => isModEnabled('facture') && $user->hasRight('facture', 'lire'),
'donations' => !empty($conf->don->enabled) && $user->rights->don->lire, 'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'),
'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire, 'contracts' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire'),
'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, 'interventions' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'),
'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), 'supplier_orders' => isModEnabled('supplier_order') && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), 'supplier_invoices' => isModEnabled('supplier_invoice') && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), 'supplier_proposals' => isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire, 'projects' => isModEnabled('project') && $user->hasRight('projet', 'lire'),
'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, 'expensereports' => isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire'),
'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read, 'holidays' => isModEnabled('holiday') && $user->hasRight('holiday', 'read'),
'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read, 'ticket' => isModEnabled('ticket') && $user->hasRight('ticket', 'read'),
'dolresource' => !empty($conf->resource->enabled) && $user->rights->resource->read 'dolresource' => isModEnabled('resource') && $user->hasRight('resource', 'read')
); );
$classes = array( $classes = array(
'users' => 'User', 'users' => 'User',

View File

@ -58,7 +58,7 @@ class box_factures extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->facture->lire); $this->hidden = empty($user->rights->facture->lire);
} }
/** /**

View File

@ -61,7 +61,7 @@ class box_factures_imp extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->facture->lire); $this->hidden = empty($user->rights->facture->lire);
} }
/** /**

View File

@ -69,7 +69,7 @@ class box_goodcustomers extends ModeleBoxes
$this->enabled = 0; // not enabled by default. Very slow on large database $this->enabled = 0; // not enabled by default. Very slow on large database
} }
$this->hidden = !($user->rights->societe->lire); $this->hidden = empty($user->rights->societe->lire);
} }
/** /**

View File

@ -56,7 +56,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->facture->lire); $this->hidden = empty($user->rights->facture->lire);
} }
/** /**

View File

@ -54,7 +54,7 @@ class box_graph_invoices_peryear extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->facture->lire); $this->hidden = empty($user->rights->facture->lire);
} }
/** /**

View File

@ -56,7 +56,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->fournisseur->facture->lire); $this->hidden = empty($user->rights->fournisseur->facture->lire);
} }
/** /**

View File

@ -56,7 +56,7 @@ class box_graph_orders_permonth extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->commande->lire); $this->hidden = empty($user->rights->commande->lire);
} }
/** /**

View File

@ -56,7 +56,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->fournisseur->commande->lire); $this->hidden = empty($user->rights->fournisseur->commande->lire);
} }
/** /**

View File

@ -61,8 +61,8 @@ class box_graph_product_distribution extends ModeleBoxes
$this->hidden = !( $this->hidden = !(
(isModEnabled('facture') && !empty($user->rights->facture->lire)) (isModEnabled('facture') && !empty($user->rights->facture->lire))
|| (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) || (isModEnabled('commande') && !empty($user->rights->commande->lire))
|| (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) || (isModEnabled('propal') && !empty($user->rights->propale->lire))
); );
} }

View File

@ -56,7 +56,7 @@ class box_graph_propales_permonth extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->propale->lire); $this->hidden = empty($user->rights->propale->lire);
} }
/** /**

View File

@ -60,7 +60,7 @@ class box_mos extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->bom->read); $this->hidden = empty($user->rights->bom->read);
} }
/** /**

View File

@ -62,7 +62,7 @@ class box_project extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->boxlabel = "OpenedProjects"; $this->boxlabel = "OpenedProjects";
$this->hidden = !($user->rights->projet->lire); $this->hidden = empty($user->rights->projet->lire);
} }
/** /**

View File

@ -60,7 +60,7 @@ class box_shipments extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->expedition->lire); $this->hidden = empty($user->rights->expedition->lire);
} }
/** /**

View File

@ -64,7 +64,7 @@ class box_task extends ModeleBoxes
$this->boxlabel = "Tasks"; $this->boxlabel = "Tasks";
$this->db = $db; $this->db = $db;
$this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || !($user->rights->projet->lire)); $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || empty($user->rights->projet->lire));
} }
/** /**

View File

@ -66,7 +66,7 @@ class box_validated_projects extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->boxlabel = "ProjectTasksWithoutTimeSpent"; $this->boxlabel = "ProjectTasksWithoutTimeSpent";
$this->hidden = !($user->rights->projet->lire); $this->hidden = empty($user->rights->projet->lire);
if ($conf->global->MAIN_FEATURES_LEVEL < 2) { if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
$this->enabled = 0; $this->enabled = 0;

View File

@ -5476,7 +5476,7 @@ abstract class CommonObject
// We save charset_output to restore it because write_file can change it if needed for // We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8. // output format that does not support UTF8.
$sav_charset_output = $outputlangs->charset_output; $sav_charset_output = empty($outputlangs->charset_output) ? '' : $outputlangs->charset_output;
if (in_array(get_class($this), array('Adherent'))) { if (in_array(get_class($this), array('Adherent'))) {
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams); $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams);

View File

@ -195,14 +195,14 @@ class vCard
// $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL" // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
$key = "ADR"; $key = "ADR";
if ($type != "") { if ($type != "") {
$key .= ";$type"; $key .= ";".$type;
} }
$key .= ";CHARSET=".$this->encoding; $key .= ";CHARSET=".$this->encoding;
$this->properties[$key] = ";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country); $this->properties[$key] = ";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country);
if ($this->properties["LABEL;$type;CHARSET=".$this->encoding] == "") { //if ($this->properties["LABEL;".$type.";CHARSET=".$this->encoding] == '') {
//$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type); //$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type);
} //}
} }
/** /**

View File

@ -152,8 +152,6 @@ if (empty($reshook)) {
/* /*
* View * View
*
* Put here all code to build page
*/ */
$form = new Form($db); $form = new Form($db);
@ -216,9 +214,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref = '<div class="refid">'; $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
if (isset($object->label)) $morehtmlref.= $object->label; $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</div>'; $morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype);

View File

@ -162,21 +162,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of project opened // Number of project opened
if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->hasRight('projet', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$board = new Project($db); $board = new Project($db);
$dashboardlines[$board->element] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
// Number of tasks to do (late) // Number of tasks to do (late)
if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { if (isModEnabled('project') && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->hasRight('projet', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$board = new Task($db); $board = new Task($db);
$dashboardlines[$board->element] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
// Number of commercial customer proposals open (expired) // Number of commercial customer proposals open (expired)
if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->propale->lire) { if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propale', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$board = new Propal($db); $board = new Propal($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
@ -185,7 +185,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of supplier proposals open (expired) // Number of supplier proposals open (expired)
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->supplier_proposal->lire) { if (isModEnabled('supplier_proposal') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight('supplier_proposal', 'lire')) {
$langs->load("supplier_proposal"); $langs->load("supplier_proposal");
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
$board = new SupplierProposal($db); $board = new SupplierProposal($db);
@ -195,14 +195,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of customer orders a deal // Number of customer orders a deal
if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->commande->lire) { if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$board = new Commande($db); $board = new Commande($db);
$dashboardlines[$board->element] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
// Number of suppliers orders a deal // Number of suppliers orders a deal
if (!empty($conf->supplier_order->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) { if (isModEnabled('supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$board = new CommandeFournisseur($db); $board = new CommandeFournisseur($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
@ -210,7 +210,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of contract / services enabled (delayed) // Number of contract / services enabled (delayed)
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->rights->contrat->lire) { if (isModEnabled('contrat') && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->hasRight('contrat', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$board = new Contrat($db); $board = new Contrat($db);
$dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive"); $dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive");
@ -219,7 +219,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of tickets open // Number of tickets open
if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->rights->ticket->read) { if (isModEnabled('ticket') && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->hasRight('ticket', 'read')) {
include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$board = new Ticket($db); $board = new Ticket($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
@ -228,21 +228,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of invoices customers (paid) // Number of invoices customers (paid)
if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) { if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('facture', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$board = new Facture($db); $board = new Facture($db);
$dashboardlines[$board->element] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
// Number of supplier invoices (paid) // Number of supplier invoices (paid)
if (!empty($conf->supplier_invoice->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) { if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$board = new FactureFournisseur($db); $board = new FactureFournisseur($db);
$dashboardlines[$board->element] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
// Number of transactions to conciliate // Number of transactions to conciliate
if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->rights->banque->lire && !$user->socid) { if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$board = new Account($db); $board = new Account($db);
$nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate $nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate
@ -253,7 +253,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
// Number of cheque to send // Number of cheque to send
if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->rights->banque->lire && !$user->socid) { if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) {
if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) { if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
$board = new RemiseCheque($db); $board = new RemiseCheque($db);
@ -272,7 +272,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of foundation members // Number of foundation members
if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->rights->adherent->lire && !$user->socid) { if (isModEnabled('adherent') && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->hasRight('adherent', 'lire') && !$user->socid) {
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$board = new Adherent($db); $board = new Adherent($db);
$dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift'); $dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift');
@ -280,21 +280,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
} }
// Number of expense reports to approve // Number of expense reports to approve
if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->rights->expensereport->approve) { if (isModEnabled('expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight('expensereport', 'approve')) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db); $board = new ExpenseReport($db);
$dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove'); $dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove');
} }
// Number of expense reports to pay // Number of expense reports to pay
if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->rights->expensereport->to_paid) { if (isModEnabled('expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight('expensereport', 'to_paid')) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db); $board = new ExpenseReport($db);
$dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay'); $dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay');
} }
// Number of holidays to approve // Number of holidays to approve
if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->rights->holiday->approve) { if (isModEnabled('holiday') && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->hasRight('holiday', 'approve')) {
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$board = new Holiday($db); $board = new Holiday($db);
$dashboardlines[$board->element] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);

View File

@ -169,7 +169,11 @@ if ($user->rights->user->user->lire || $user->admin) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';

View File

@ -310,7 +310,11 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter"><div class="fichehalfleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';

View File

@ -43,6 +43,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('usercard', 'globalcard')); $hookmanager->initHooks(array('usercard', 'globalcard'));
/* /*
* Actions * Actions
*/ */
@ -104,7 +105,11 @@ if ($id > 0) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';

View File

@ -151,7 +151,11 @@ if ($object->id) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';

View File

@ -79,7 +79,11 @@ if ($user->rights->user->user->lire || $user->admin) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
$object->info($id); // This overwrite ->ref with login instead of id $object->info($id); // This overwrite ->ref with login instead of id

View File

@ -103,7 +103,11 @@ if ($id) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';

View File

@ -154,7 +154,11 @@ if ($result > 0) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', '', '', 0, '', '', 0, ''); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, '');
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -342,7 +342,11 @@ if ($action == 'edit') {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -253,7 +253,11 @@ if ($user->rights->user->user->lire || $user->admin) {
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
} }
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -113,7 +113,7 @@ if ($company->id) {
} }
// Si user lie a un tiers non de type "particulier" // Si user lie a un tiers non de type "particulier"
if ($user2->typent_code != 'TE_PRIVATE') { if ($company->typent_code != 'TE_PRIVATE') {
$v->setOrg($company->name); $v->setOrg($company->name);
} }
} }