From 1b04eabf1facf33b7ccb4ec219cd942143685fb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Apr 2016 14:28:49 +0200 Subject: [PATCH] Merge log with events tabs --- composer.json | 6 -- htdocs/admin/security_file.php | 5 +- htdocs/commande/card.php | 4 +- htdocs/commande/contact.php | 2 +- htdocs/core/lib/company.lib.php | 21 ++-- htdocs/core/lib/functions2.lib.php | 128 ++++++++++++++++++------ htdocs/core/modules/modAgenda.class.php | 2 +- htdocs/expedition/shipment.php | 2 +- htdocs/langs/en_US/admin.lang | 5 +- htdocs/societe/agenda.php | 29 ++++-- htdocs/societe/info.php | 106 -------------------- 11 files changed, 141 insertions(+), 169 deletions(-) delete mode 100644 htdocs/societe/info.php diff --git a/composer.json b/composer.json index f4ea5de0c73..ab7d225039b 100644 --- a/composer.json +++ b/composer.json @@ -23,12 +23,6 @@ "restler/framework": "^3.0", "tecnickcom/tcpdf": "6.2.12" }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "^0", - "jakub-onderka/php-console-highlighter": "^0", - "phpunit/phpunit": "^4", - "squizlabs/php_codesniffer": "^2" - }, "suggest": { "ext-mysqlnd": "To use with MySQL or MariaDB", "ext-mysqli": "To use with MySQL or MariaDB", diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 1213a9b2238..d3c421e31ec 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -114,9 +114,8 @@ llxHeader('',$langs->trans("Files"),$wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); -//print $langs->trans("FilesDesc")."
\n"; -//print "
\n"; - +print $langs->trans("SecurityFilesDesc")."
\n"; +print "
\n"; print '
'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 94b6e2ce2f2..f5ba58bbfaa 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1953,7 +1953,7 @@ if ($action == 'create' && $user->rights->commande->creer) $linkback = '' . $langs->trans("BackToList") . ''; // Ref - print '' . $langs->trans('Ref') . ''; + print '' . $langs->trans('Ref') . ''; print ''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); print ''; @@ -1993,7 +1993,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($action == 'editthirdparty') { $form->form_thirdparty($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, 'socid','client>0'); } else { - print '  ' . $soc->getNomUrl(1, 'compta'); + print $soc->getNomUrl(1, 'compta'); } print ''; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index c72e040e61c..93d46c05997 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref)) $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); print ""; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7e3b5ea2810..e2d63d6d151 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -84,13 +84,6 @@ function societe_prepare_head(Societe $object) $h++; } - if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Agenda"); - $head[$h][2] = 'agenda'; - $h++; - } if (! empty($conf->projet->enabled) && (!empty($user->rights->projet->lire) )) { $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; @@ -189,11 +182,21 @@ function societe_prepare_head(Societe $object) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) + { + $head[$h][1] = $langs->trans("Events"); + $head[$h][1].= ' / '; + } + $head[$h][1].= $langs->trans("Info"); + $head[$h][2] = 'agenda'; + $h++; + // Log - $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$object->id; + /*$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; - $h++; + $h++;*/ complete_head_from_modules($conf,$langs,$object,$head,$h,'thirdparty','remove'); diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index bdc18205001..01ebaf7c42c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -203,9 +203,10 @@ function dol_print_file($langs,$filename,$searchalt=0) * TODO Move this into html.formother * * @param object $object Objet to show + * @param int $usetable Output into a table * @return void */ -function dol_print_object_info($object) +function dol_print_object_info($object, $usetable=0) { global $langs,$db; $langs->load("other"); @@ -219,14 +220,27 @@ function dol_print_object_info($object) $deltadateforuser=round($deltadateforclient-$deltadateforserver); //print "x".$deltadateforserver." - ".$deltadateforclient." - ".$deltadateforuser; + if ($usetable) print ''; + // Import key if (! empty($object->import_key)) - print $langs->trans("ImportedWithSet").': '.$object->import_key.'
'; + { + if ($usetable) print ''; + else print '
'; + } // User creation if (! empty($object->user_creation)) { - print $langs->trans("CreatedBy").': '; + if ($usetable) print ''; + else print '
'; } // Date creation if (! empty($object->date_creation)) { - print $langs->trans("DateCreation").': '.dol_print_date($object->date_creation, 'dayhour'); + if ($usetable) print ''; + else print '
'; } // User change if (! empty($object->user_modification)) { - print $langs->trans("ModifiedBy").': '; + if ($usetable) print ''; + else print '
'; } // Date change if (! empty($object->date_modification)) { - print $langs->trans("DateLastModification").': '.dol_print_date($object->date_modification, 'dayhour'); + if ($usetable) print ''; + else print '
'; } // User validation if (! empty($object->user_validation)) { - print $langs->trans("ValidatedBy").': '; + if ($usetable) print ''; + else print '
'; } // Date validation if (! empty($object->date_validation)) { - print $langs->trans("DateValidation").': '.dol_print_date($object->date_validation, 'dayhour'); + if ($usetable) print ''; + else print '
'; } // User approve if (! empty($object->user_approve)) { - print $langs->trans("ApprovedBy").': '; + if ($usetable) print ''; + else print '
'; } // Date approve if (! empty($object->date_approve)) { - print $langs->trans("DateApprove").': '.dol_print_date($object->date_approve, 'dayhour'); + if ($usetable) print ''; + else print '
'; } // User close if (! empty($object->user_cloture)) { - print $langs->trans("ClosedBy").': '; + if ($usetable) print ''; + else print '
'; } // Date close if (! empty($object->date_cloture)) { - print $langs->trans("DateClosing").': '.dol_print_date($object->date_cloture, 'dayhour'); + if ($usetable) print ''; + else print '
'; } // User conciliate if (! empty($object->user_rappro)) { - print $langs->trans("ConciliatedBy").': '; + if ($usetable) print ''; + else print '
'; } // Date conciliate if (! empty($object->date_rappro)) { - print $langs->trans("DateConciliating").': '.dol_print_date($object->date_rappro, 'dayhour'); + if ($usetable) print ''; + else print '
'; } // Date send if (! empty($object->date_envoi)) { - print $langs->trans("DateLastSend").': '.dol_print_date($object->date_envoi, 'dayhour'); + if ($usetable) print ''; + else print '
'; } + + if ($usetable) print '
'; + print $langs->trans("ImportedWithSet"); + if ($usetable) print ''; + else print ': '; + print $object->import_key; + if ($usetable) print '
'; + print $langs->trans("CreatedBy"); + if ($usetable) print ''; + else print ': '; if (is_object($object->user_creation)) { if ($object->user_creation->id) print $object->user_creation->getNomUrl(1); @@ -239,21 +253,30 @@ function dol_print_object_info($object) if ($userstatic->id) print $userstatic->getNomUrl(1); else print $langs->trans("Unknown"); } - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateCreation"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_creation, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_creation+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; + print $langs->trans("ModifiedBy"); + if ($usetable) print ''; + else print ': '; if (is_object($object->user_modification)) { if ($object->user_modification->id) print $object->user_modification->getNomUrl(1); @@ -266,21 +289,30 @@ function dol_print_object_info($object) if ($userstatic->id) print $userstatic->getNomUrl(1); else print $langs->trans("Unknown"); } - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateLastModification"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_modification, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_modification+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; + print $langs->trans("ValidatedBy"); + if ($usetable) print ''; + else print ': '; if (is_object($object->user_validation)) { if ($object->user_validation->id) print $object->user_validation->getNomUrl(1); @@ -293,21 +325,30 @@ function dol_print_object_info($object) if ($userstatic->id) print $userstatic->getNomUrl(1); else print $langs->trans("Unknown"); } - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateValidation"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_validation, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_validation+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; + print $langs->trans("ApprovedBy"); + if ($usetable) print ''; + else print ': '; if (is_object($object->user_approve)) { if ($object->user_approve->id) print $object->user_approve->getNomUrl(1); @@ -320,21 +361,30 @@ function dol_print_object_info($object) if ($userstatic->id) print $userstatic->getNomUrl(1); else print $langs->trans("Unknown"); } - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateApprove"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_approve, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; + print $langs->trans("ClosedBy"); + if ($usetable) print ''; + else print ': '; if (is_object($object->user_cloture)) { if ($object->user_cloture->id) print $object->user_cloture->getNomUrl(1); @@ -347,21 +397,30 @@ function dol_print_object_info($object) if ($userstatic->id) print $userstatic->getNomUrl(1); else print $langs->trans("Unknown"); } - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateClosing"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_cloture, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_cloture+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; + print $langs->trans("ConciliatedBy"); + if ($usetable) print ''; + else print ': '; if (is_object($object->user_rappro)) { if ($object->user_rappro->id) print $object->user_rappro->getNomUrl(1); @@ -374,24 +433,37 @@ function dol_print_object_info($object) if ($userstatic->id) print $userstatic->getNomUrl(1); else print $langs->trans("Unknown"); } - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateConciliating"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_rappro, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; + print $langs->trans("DateLastSend"); + if ($usetable) print ''; + else print ': '; + print dol_print_date($object->date_envoi, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_envoi+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); - print '
'; + if ($usetable) print '
'; } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 482846032dc..7baed59a0ad 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -53,7 +53,7 @@ class modAgenda extends DolibarrModules $this->module_position = 15; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); - $this->description = "Gestion de l'agenda et des actions"; + $this->description = "Follow events or rendez-vous. Record manual events into Agendas or let application record automatic events for log tracking."; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 66f9582cfc0..2677d06ec7b 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -198,7 +198,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Ref - print ''; + print ''; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7decc602dbe..670546ca87a 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -45,6 +45,7 @@ IfModuleEnabled=Note: yes is effective only if module %s is enabled RemoveLock=Remove file %s if it exists to allow usage of the update tool. RestoreLock=Restore file %s, with read permission only, to disable any usage of update tool. SecuritySetup=Security setup +SecurityFilesDesc=Define here options related to security about uploading files. ErrorModuleRequirePHPVersion=Error, this module requires PHP version %s or higher ErrorModuleRequireDolibarrVersion=Error, this module requires Dolibarr version %s or higher ErrorDecimalLargerThanAreForbidden=Error, a precision higher than %s is not supported. @@ -524,8 +525,8 @@ Module2200Name=Dynamic Prices Module2200Desc=Enable the usage of math expressions for prices Module2300Name=Cron Module2300Desc=Scheduled job management -Module2400Name=Agenda -Module2400Desc=Events/tasks and agenda management +Module2400Name=Agenda/Events +Module2400Desc=Follow events or rendez-vous. Record manual events into Agendas or let application logs automatic events for tracking purposes. Module2500Name=Electronic Content Management Module2500Desc=Save and share documents Module2600Name=API/Web services (SOAP server) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 3d72ad9d328..7bbba527ed8 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -30,6 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("companies"); @@ -117,6 +118,12 @@ if ($socid) print '
'.$langs->trans('Ref').'
'.$langs->trans('Ref').''; print $form->showrefnav($commande,'ref','',1,'ref','ref'); print '
'; + + print '
'; + + $object->info($socid); + print dol_print_object_info($object, 1); + print ''; dol_fiche_end(); @@ -158,16 +165,18 @@ if ($socid) print ''; - print '
'; - - - print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - - // List of todo actions - show_actions_todo($conf,$langs,$db,$object,null,0,1); - - // List of done actions - show_actions_done($conf,$langs,$db,$object); + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) + { + print '
'; + + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + + // List of todo actions + show_actions_todo($conf,$langs,$db,$object,null,0,1); + + // List of done actions + show_actions_done($conf,$langs,$db,$object); + } } diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php deleted file mode 100644 index 3a2ecea9305..00000000000 --- a/htdocs/societe/info.php +++ /dev/null @@ -1,106 +0,0 @@ - - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/societe/info.php - * \ingroup societe - * \brief Page des informations d'une societe - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - -$langs->load("companies"); -$langs->load("other"); -if (! empty($conf->notification->enabled)) $langs->load("mails"); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'societe', $socid, '&societe'); - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('infothirdparty')); - -$object = new Societe($db); - - -/* - * Actions - */ - -$parameters=array('id'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - - -/* - * View - */ - -$form=new Form($b); - -$title=$langs->trans("ThirdParty"); -if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Info"); -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$title,$help_url); - -if ($socid > 0) -{ - $result = $object->fetch($socid); - if (! $result) - { - $langs->load("errors"); - print $langs->trans("ErrorRecordNotFound"); - - llxFooter(); - $db->close(); - - exit; - } - - $head = societe_prepare_head($object); - - dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company'); - - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); - - $object->info($socid); - - - print '
'; - - print '
'; - - print '
'; - - dol_print_object_info($object); - - print '
'; - - dol_fiche_end(); -} - - -llxFooter(); - -$db->close();