From 5c49af73288bd9111bc8790dc523db023afdbb16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2011 21:19:58 +0000 Subject: [PATCH 1/8] Prepare 3.1 beta From 11a1b018162a62a85dba93d4c9c61bc6f3b59b13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2011 21:33:38 +0000 Subject: [PATCH 2/8] Fix: Object should never be a global variable as there is several object in a context. Also object type must be fixed for each "trigger code". So we add trigger code and object on parameter because only caller of a function know which object type we use and what trigger code we want to trigger. From 974cd30b06098b6fb17c2f0ba97531916489905c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2011 21:54:07 +0000 Subject: [PATCH 3/8] Fix: Removed warning --- .../modules/DolibarrModules.class.php | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php index b41e2e2b31f..d5c37a443e4 100644 --- a/htdocs/includes/modules/DolibarrModules.class.php +++ b/htdocs/includes/modules/DolibarrModules.class.php @@ -24,7 +24,7 @@ /** * \file htdocs/includes/modules/DolibarrModules.class.php * \brief Fichier de description et activation des modules Dolibarr - * \version $Id: DolibarrModules.class.php,v 1.161 2011/07/13 22:15:19 eldy Exp $ + * \version $Id: DolibarrModules.class.php,v 1.160 2011/07/13 21:54:07 eldy Exp $ */ @@ -926,7 +926,7 @@ class DolibarrModules /** * Insert permissions definitions related to the module into llx_rights_def - * @param $reinitadminperms If 1, we also grant them to all admin users + * @param $reinitadminperms If 1, we also grant them to admin user * @return int Number of error (0 if OK) */ function insert_permissions($reinitadminperms=0) @@ -1004,15 +1004,12 @@ class DolibarrModules } // If we are into a logged session and we are an admin user, we take permission of new activated module - if ($reinitadminperms) + if ($reinitadminperms && ! empty($user->admin)) { - if (! empty($user->admin)) // FIXME. We must loop on each admin records and make grant on each fuser object. We must removed global $user. - { - $user->addrights($r_id); - // We reload permissions - $user->clearrights(); - $user->getrights(); - } + $user->addrights($r_id); + // We reload permissions + $user->clearrights(); + $user->getrights(); } } } @@ -1059,6 +1056,8 @@ class DolibarrModules */ function insert_menus() { + global $user; + require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php"); $err=0; @@ -1119,7 +1118,7 @@ class DolibarrModules if (! $err) { - $result=$menu->create(); + $result=$menu->create($user); if ($result > 0) { $this->menu[$key]['rowid']=$result; From 20f884e239ff032d4d549a3867e1059e3af3bacb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2011 22:15:19 +0000 Subject: [PATCH 4/8] Fix: Activation of a module must works even when $user not defined (for installer). --- .../modules/DolibarrModules.class.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php index d5c37a443e4..b41e2e2b31f 100644 --- a/htdocs/includes/modules/DolibarrModules.class.php +++ b/htdocs/includes/modules/DolibarrModules.class.php @@ -24,7 +24,7 @@ /** * \file htdocs/includes/modules/DolibarrModules.class.php * \brief Fichier de description et activation des modules Dolibarr - * \version $Id: DolibarrModules.class.php,v 1.160 2011/07/13 21:54:07 eldy Exp $ + * \version $Id: DolibarrModules.class.php,v 1.161 2011/07/13 22:15:19 eldy Exp $ */ @@ -926,7 +926,7 @@ class DolibarrModules /** * Insert permissions definitions related to the module into llx_rights_def - * @param $reinitadminperms If 1, we also grant them to admin user + * @param $reinitadminperms If 1, we also grant them to all admin users * @return int Number of error (0 if OK) */ function insert_permissions($reinitadminperms=0) @@ -1004,12 +1004,15 @@ class DolibarrModules } // If we are into a logged session and we are an admin user, we take permission of new activated module - if ($reinitadminperms && ! empty($user->admin)) + if ($reinitadminperms) { - $user->addrights($r_id); - // We reload permissions - $user->clearrights(); - $user->getrights(); + if (! empty($user->admin)) // FIXME. We must loop on each admin records and make grant on each fuser object. We must removed global $user. + { + $user->addrights($r_id); + // We reload permissions + $user->clearrights(); + $user->getrights(); + } } } } @@ -1056,8 +1059,6 @@ class DolibarrModules */ function insert_menus() { - global $user; - require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php"); $err=0; @@ -1118,7 +1119,7 @@ class DolibarrModules if (! $err) { - $result=$menu->create($user); + $result=$menu->create(); if ($result > 0) { $this->menu[$key]['rowid']=$result; From e6f275e6d29f67a6f987386241d1180dcca630b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2011 22:18:12 +0000 Subject: [PATCH 5/8] Convert a FIXME into a TODO From 86c42ee50e595227ab8379695307732f855f7654 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 14 Jul 2011 05:21:52 +0000 Subject: [PATCH 6/8] Fix: object is a parameter --- htdocs/comm/propal/document.php | 8 ++++---- htdocs/commande/document.php | 6 +++--- htdocs/compta/facture/document.php | 6 +++--- htdocs/lib/files.lib.php | 4 ++-- htdocs/societe/document.php | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 561c68482de..c6bbc00d399 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2004 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * * 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 @@ -23,7 +23,7 @@ * \file htdocs/comm/propal/document.php * \ingroup propale * \brief Page de gestion des documents attaches a une proposition commerciale - * \version $Id: document.php,v 1.66 2011/07/06 20:56:49 eldy Exp $ + * \version $Id: document.php,v 1.67 2011/07/14 05:21:53 hregis Exp $ */ require("../../main.inc.php"); @@ -110,7 +110,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file); + dol_delete_file($file,0,0,0,'FILE_DELETE',$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } @@ -209,5 +209,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.66 $'); +llxFooter('$Date: 2011/07/14 05:21:53 $ - $Revision: 1.67 $'); ?> diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 6b27978ce6f..e026511a0c0 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -23,7 +23,7 @@ * \file htdocs/commande/document.php * \ingroup order * \brief Page de gestion des documents attachees a une commande - * \version $Id: document.php,v 1.34 2011/07/06 20:56:49 eldy Exp $ + * \version $Id: document.php,v 1.35 2011/07/14 05:21:53 hregis Exp $ */ require("../main.inc.php"); @@ -113,7 +113,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file); + dol_delete_file($file,0,0,0,'FILE_DELETE',$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } @@ -193,5 +193,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.34 $'); +llxFooter('$Date: 2011/07/14 05:21:53 $ - $Revision: 1.35 $'); ?> diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 9c7d62baa30..b042421346d 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -23,7 +23,7 @@ * \file htdocs/compta/facture/document.php * \ingroup facture * \brief Page for attached files on invoices - * \version $Id: document.php,v 1.44 2011/07/06 20:56:49 eldy Exp $ + * \version $Id: document.php,v 1.45 2011/07/14 05:21:53 hregis Exp $ */ require("../../main.inc.php"); @@ -115,7 +115,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file); + dol_delete_file($file,0,0,0,'FILE_DELETE',$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } @@ -213,5 +213,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.44 $'); +llxFooter('$Date: 2011/07/14 05:21:53 $ - $Revision: 1.45 $'); ?> diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 5dda38dcc5c..95fb3e6adb0 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.69 2011/07/13 21:33:38 eldy Exp $ + * \version $Id: files.lib.php,v 1.70 2011/07/14 05:21:53 hregis Exp $ */ /** @@ -590,7 +590,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable * @param disableglob Disable usage of glob like * * @param nophperrors Disable all PHP output errors * @param notrigger Disable all triggers - * @param triggercode Code of trigger + * @param triggercode Code of trigger TODO ???? why ? * @param object Object for trigger * @return boolean True if file is deleted, False if error */ diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index cb031662e83..74252ada670 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -23,7 +23,7 @@ * \file htdocs/societe/document.php * \brief Tab for documents linked to third party * \ingroup societe - * \version $Id: document.php,v 1.37 2011/07/06 20:56:49 eldy Exp $ + * \version $Id: document.php,v 1.38 2011/07/14 05:21:52 hregis Exp $ */ require("../main.inc.php"); @@ -118,7 +118,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($object->fetch($socid)) { $file = $upload_dir . "/" . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file); + dol_delete_file($file,0,0,0,'FILE_DELETE',$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } @@ -241,6 +241,6 @@ else $db->close(); -llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.37 $'); +llxFooter('$Date: 2011/07/14 05:21:52 $ - $Revision: 1.38 $'); ?> From 91188490d7cae898f305d83846cccbf34c4132fa Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 14 Jul 2011 14:59:46 +0000 Subject: [PATCH 7/8] Trad: Message for payment forms --- htdocs/langs/ca_ES/members.lang | 8 ++++++-- htdocs/langs/es_ES/members.lang | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/ca_ES/members.lang b/htdocs/langs/ca_ES/members.lang index 7c934aceef6..3bb7f860816 100644 --- a/htdocs/langs/ca_ES/members.lang +++ b/htdocs/langs/ca_ES/members.lang @@ -75,9 +75,12 @@ NewCotisation=Nova afiliació PaymentSubscription=Pagament de quotes EditMember=Edició membre SubscriptionEndDate=Data fi afiliació +NewAttribute=Nou atribut +AttributeCode=Codi de l'atribut +OptionalFieldsSetup=Configuració dels camps opcionals MembersTypeSetup=Configuració dels tipus de membres NewSubscription=Nova afiliació -NewSubscriptionDesc=Utilitzi aquest formulari per registrar-se com un nou membre de l'associació. Per a una renovació, si ja és membre, poseu-vos en contacte amb l'associació. +NewSubscriptionDesc=Utilitzi aquest formulari per registrar-se com un nou membre de l'associació. Per a una renovació, si ja és membre, poseu-vos en contacte amb l'associació mitjançant l'e-mail %s. Subscription=Afiliació Subscriptions=Afiliacions SubscriptionLate=En retard @@ -192,4 +195,5 @@ MEMBER_NEWFORM_PAYONLINE=Anar a la pàgina integrada de pagament en línia Associations=Asssociacions Collectivités=Col.lectivitats Particuliers=Particulars -Entreprises=Empreses \ No newline at end of file +Entreprises=Empreses +DOLIBARRFOUNDATION_PAYMENT_FORM=Per realitzar el pagament de la seva cotització per transferència bancària, visiteu la pàgina http://wiki.dolibarr.org/index.php/Subscribirse.
Per pagar amb targeta de crèdit o PayPal, feu clic al botó a la part inferior d'aquesta pàgina.

\ No newline at end of file diff --git a/htdocs/langs/es_ES/members.lang b/htdocs/langs/es_ES/members.lang index 2f12433e4a9..5142dd187cd 100644 --- a/htdocs/langs/es_ES/members.lang +++ b/htdocs/langs/es_ES/members.lang @@ -75,9 +75,12 @@ NewCotisation=Nueva afiliación PaymentSubscription=Pago de cuotas EditMember=Edición miembro SubscriptionEndDate=Fecha fin afiliación +NewAttribute=Nuevo atributo +AttributeCode=Código del atributo +OptionalFieldsSetup=Configuración de los campos opcionales MembersTypeSetup=Configuración de los tipos de miembros NewSubscription=Nueva afiliación -NewSubscriptionDesc=Utilice este formulario para registrarse como un nuevo miembro de la asociación. Para una renovación, si ya es miembro, póngase en contacto con la asociación. +NewSubscriptionDesc=Utilice este formulario para registrarse como un nuevo miembro de la asociación. Para una renovación, si ya es miembro, póngase en contacto con la asociación a través del e-mail %s. Subscription=Afiliación Subscriptions=Afiliaciones SubscriptionLate=En retraso @@ -192,4 +195,5 @@ MEMBER_NEWFORM_PAYONLINE=Ir a la página integrada de pago en línea Associations=Asociaciones Collectivités=Colectividades Particuliers=Particulares -Entreprises=Empresas \ No newline at end of file +Entreprises=Empresas +DOLIBARRFOUNDATION_PAYMENT_FORM=Para realizar el pago de su cotización por transferencia bancaria, visite la página http://wiki.dolibarr.org/index.php/Subscribirse.
Para pagar con tarjeta de crédito o PayPal, haga clic en el botón en la parte inferior de esta página.

\ No newline at end of file From 493a0db5c657a02d2e71fd3929423b321a3625dc Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 14 Jul 2011 15:37:37 +0000 Subject: [PATCH 8/8] Proyects: Add Total time to tasks tables --- htdocs/lib/project.lib.php | 17 +++++++++++++++-- htdocs/projet/tasks/time.php | 14 ++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php index 2d5ec19e880..ce197938ea7 100644 --- a/htdocs/lib/project.lib.php +++ b/htdocs/lib/project.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2010 Regis Houssin + * Copyright (C) 2011 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 @@ -22,7 +23,7 @@ * \file htdocs/lib/project.lib.php * \brief Functions used by project module * \ingroup project - * \version $Id: project.lib.php,v 1.68 2011/07/04 09:01:38 eldy Exp $ + * \version $Id: project.lib.php,v 1.69 2011/07/14 15:37:37 simnandez Exp $ */ require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); @@ -98,7 +99,7 @@ function project_prepare_head($object) * \file htdocs/lib/project.lib.php * \brief Ensemble de fonctions de base pour le module projet * \ingroup societe - * \version $Id: project.lib.php,v 1.68 2011/07/04 09:01:38 eldy Exp $ + * \version $Id: project.lib.php,v 1.69 2011/07/14 15:37:37 simnandez Exp $ */ function task_prepare_head($object) { @@ -375,6 +376,9 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole $projectsArrayId=explode(',',$projectsListId); $numlines=sizeof($lines); + + $total=0; + for ($i = 0 ; $i < $numlines ; $i++) { if ($parent == 0) $level = 0; @@ -485,6 +489,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole $level++; if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId); $level--; + $total += $lines[$i]->duration; } } else @@ -493,6 +498,14 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole } } + if ($total>0) + { + print ''.$langs->trans("Total").''; + print ''; + print ''; + print ''.ConvertSecondToTime($total).''; + } + return $inc; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index bf80c36e7ed..ad10c1b51d8 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2006-2010 Laurent Destailleur * Copyright (C) 2010 Regis Houssin + * Copyright (C) 2011 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 @@ -22,7 +23,7 @@ * \file htdocs/projet/tasks/time.php * \ingroup projet * \brief Page to add new time spent on a task - * \version $Id$ + * \version $Id: time.php,v 1.32 2011/07/14 15:37:37 simnandez Exp $ */ require("../../main.inc.php"); @@ -307,7 +308,8 @@ if ($_GET["id"] > 0) print ''.$langs->trans("Duration").''; print ' '; print "\n"; - + + $total = 0; foreach ($tasks as $task_time) { $var=!$var; @@ -389,8 +391,12 @@ if ($_GET["id"] > 0) print ''; print "\n"; + $total += $task_time->task_duration; } - + print ''.$langs->trans("Total").''; + print ''.ConvertSecondToTime($total).' '; + print ''; + print ""; print ""; } @@ -398,5 +404,5 @@ if ($_GET["id"] > 0) $db->close(); -llxFooter('$Date$ - $Revision$'); +llxFooter('$Date: 2011/07/14 15:37:37 $ - $Revision: 1.32 $'); ?>