diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index bffbfec9c50..e24bce5e247 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -149,7 +149,7 @@ class HookManager $parameters['context'] = join(':', $this->contextarray); //dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); - // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). + // Define type of hook ('output' or 'addreplace'). Type 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). $hooktype = 'output'; if (in_array( $method, @@ -199,6 +199,7 @@ class HookManager 'pdf_getlinetotalwithtax', 'paymentsupplierinvoices', 'printAddress', + 'printEmail', 'printSearchForm', 'printTabsHead', 'printObjectLine', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 35869df46f1..092e36cef72 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3144,7 +3144,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', @@ -3169,7 +3169,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', - 'company'=>'building', 'contact'=>'address-book', + 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', @@ -3236,6 +3236,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Add CSS $arrayconvpictotomorcess = array( 'action'=>'bg-infoxbox-action', 'account'=>'bg-infoxbox-bank_account', 'bank_account'=>'bg-infoxbox-bank_account', 'cash-register'=>'bg-infoxbox-bank_account', + 'contract'=>'bg-infoxbox-contrat', 'multicurrency'=>'bg-infoxbox-bank_account', 'check'=>'font-status4', 'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 7dd6045b19b..4f81930355e 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -21,7 +21,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; /** - * API class for fichinters + * API class for Interventions * * @access protected * @class DolibarrApiAccess {@requires user,external} diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 118e21a841c..ff88847140b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -202,7 +202,7 @@ class Fichinter extends CommonObject { while ($obj = $this->db->fetch_object($resql)) { - $this->nb["fichinters"] = $obj->nb; + $this->nb["interventions"] = $obj->nb; } $this->db->free($resql); return 1; diff --git a/htdocs/index.php b/htdocs/index.php index 110de972f2b..24330736287 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -108,7 +108,6 @@ if (!empty($conf->global->MAIN_MOTD)) * Hidden for external users */ - $boxstatItems = array(); $boxstatFromHook = ''; @@ -128,26 +127,27 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { // Condition to be checked for each display line dashboard $conditions = array( - $user->rights->user->user->lire, - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, - !empty($conf->adherent->enabled) && $user->rights->adherent->lire, - !empty($conf->product->enabled) && $user->rights->produit->lire, - !empty($conf->service->enabled) && $user->rights->service->lire, - !empty($conf->propal->enabled) && $user->rights->propale->lire, - !empty($conf->commande->enabled) && $user->rights->commande->lire, - !empty($conf->facture->enabled) && $user->rights->facture->lire, - !empty($conf->contrat->enabled) && $user->rights->contrat->lire, - !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, - !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), - !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), - !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - !empty($conf->projet->enabled) && $user->rights->projet->lire, - !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, - !empty($conf->holiday->enabled) && $user->rights->holiday->read, - !empty($conf->don->enabled) && $user->rights->don->lire + $user->rights->user->user->lire, + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, + !empty($conf->adherent->enabled) && $user->rights->adherent->lire, + !empty($conf->product->enabled) && $user->rights->produit->lire, + !empty($conf->service->enabled) && $user->rights->service->lire, + !empty($conf->propal->enabled) && $user->rights->propale->lire, + !empty($conf->commande->enabled) && $user->rights->commande->lire, + !empty($conf->facture->enabled) && $user->rights->facture->lire, + !empty($conf->contrat->enabled) && $user->rights->contrat->lire, + !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, + !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), + !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), + !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), + !empty($conf->projet->enabled) && $user->rights->projet->lire, + !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, + !empty($conf->holiday->enabled) && $user->rights->holiday->read, + !empty($conf->don->enabled) && $user->rights->don->lire, + !empty($conf->ticket->enabled) && $user->rights->ticket->read ); // Class file containing the method load_state_board for each line $includes = array( @@ -170,7 +170,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_DOCUMENT_ROOT."/projet/class/project.class.php", DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php", - DOL_DOCUMENT_ROOT."/don/class/don.class.php" + DOL_DOCUMENT_ROOT."/don/class/don.class.php", + DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php" ); // Name class containing the method load_state_board for each line $classes = array('User', @@ -192,7 +193,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'Project', 'ExpenseReport', 'Holiday', - 'Don' + 'Don', + 'Ticket', ); // Cle array returned by the method load_state_board for each line $keys = array('users', @@ -206,15 +208,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'proposals', 'orders', 'invoices', - 'Contracts', - 'fichinters', + 'contracts', + 'interventions', 'supplier_orders', 'supplier_invoices', 'askprice', 'projects', 'expensereports', 'holidays', - 'donations' + 'donations', + 'ticket' ); // Dashboard Icon lines $icons = array('user', @@ -228,15 +231,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'propal', 'order', 'bill', - 'order', - 'order', + 'contract', + 'intervention', 'order', 'bill', 'propal', 'projectpub', 'trip', 'holiday', - 'generic' + 'generic', + 'ticket', ); // Translation keyword $titres = array("Users", @@ -258,7 +262,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "Projects", "ExpenseReports", "Holidays", - "Donations" + "Donations", + "Ticket", ); // Dashboard Link lines $links = array( @@ -282,7 +287,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday', - DOL_URL_ROOT.'/don/list.php?leftmenu=donations' + DOL_URL_ROOT.'/don/list.php?leftmenu=donations', + DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket' ); // Translation lang files $langfile = array( @@ -306,12 +312,13 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "trips", "holiday", "donations", + "ticket" ); // Loop and displays each line of table $boardloaded = array(); - foreach ($keys as $key=>$val) + foreach ($keys as $key => $val) { if ($conditions[$key]) { @@ -331,7 +338,6 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) $board = $boardloaded[$classe]; } - if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text = $langs->trans($titres[$key]); $boxstatItem .= ''; @@ -415,7 +421,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting'); } - // Number of services enabled (delayed) + // Number of contract / services enabled (delayed) if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); @@ -423,6 +429,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Number of active services (expired) $dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); } + + // Number of tickets open + if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) { + include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $board = new Ticket($db); + $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); + // Number of active services (expired) + //$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); + } + // Number of invoices customers (has paid) if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -526,13 +542,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('facture'), ), - 'contrat' => - array( - 'groupName' => 'Contracts', - 'globalStatsKey' => 'Contracts', - 'stats' => - array('contrat_inactive', 'contrat_active'), - ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', @@ -554,7 +563,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('invoice_supplier'), ), - 'bank_account' => + 'contrat' => + array( + 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', + 'stats' => + array('contrat_inactive', 'contrat_active'), + ), + 'ticket' => + array( + 'groupName' => 'Tickets', + 'globalStatsKey' => 'OpenTickets', + 'stats' => + array('ticket_opened'), + ), + 'bank_account' => array( 'groupName' => 'BankAccount', 'stats' => @@ -587,8 +610,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $parameters = array( 'dashboardgroup' => $dashboardgroup ); - $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index c569a48c84a..609ea0efdf2 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -325,7 +325,6 @@ CompanyDeleted=Company "%s" deleted from database. ListOfContacts=List of contacts/addresses ListOfContactsAddresses=List of contacts/addresses ListOfThirdParties=List of Third Parties -ShowCompany=Show Third Party ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cd7ad23af7f..6c5889b89fe 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2407,7 +2407,7 @@ class Societe extends CommonObject // By default if (empty($linkstart)) { - $label .= ''.$langs->trans("ShowCompany").''; + $label .= ''.$langs->trans("ThirdParty").''; $linkstart = '".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1)."\n"; + print '