From b7ef2db5d9aa13fa8ae00bbc9c26eb37aaecbfc4 Mon Sep 17 00:00:00 2001 From: braito4 Date: Tue, 16 Sep 2014 19:33:07 +0200 Subject: [PATCH 01/30] problem with type of product the column should be product_type --- htdocs/webservices/server_invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index c79c862146c..0b601347f38 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -528,7 +528,7 @@ function createInvoice($authentication,$invoice) { // $key can be 'line' or '0','1',... $newline=new FactureLigne($db); - $newline->type=$line['type']; + $newline->product_type=$line['type']; $newline->desc=$line['desc']; $newline->fk_product=$line['fk_product']; $newline->tva_tx=$line['vat_rate']; From 634d5aa54954664b834f6575dd8d587c4addfc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Tue, 23 Sep 2014 19:33:36 +0200 Subject: [PATCH 02/30] FIX: double header --- htdocs/projet/activity/list.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index 89e23bf6a07..430970c981d 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -131,10 +131,6 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($project->id?$pr //var_dump($taskrole); - -llxHeader("",$title,""); - - llxHeader("",$title,""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); From 63c6bd5d1735914bbf58cc927232e314a5ef7195 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 24 Sep 2014 13:28:59 +0200 Subject: [PATCH 03/30] New: Added hook "formConfirm" and "doActions" for fichinter card --- ChangeLog | 1 + htdocs/fichinter/card.php | 33 ++++++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b8a3f8da52..841e4b39651 100644 --- a/ChangeLog +++ b/ChangeLog @@ -109,6 +109,7 @@ For developers: - New: Added hook "formConfirm" and "doActions" for supplier invoice card. - New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card. - New: renamed table llx_c_pays to llx_c_country & libelle field to label. +- New: Added hook "formConfirm" and "doActions" for fichinter card - Qual: Renamed table llx_c_civilite into llx_c_civility, field civilite into label in the same table, and field civilite into civility in other table. diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a300d11219d..0908bc15fbe 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -64,6 +65,7 @@ $mesg = GETPOST('msg','alpha'); $origin=GETPOST('origin','alpha'); $originid=(GETPOST('originid','int')?GETPOST('originid','int'):GETPOST('origin_id','int')); // For backward compatibility $note_public = GETPOST('note_public'); +$lineid = GETPOST('line_id','int'); //PDF $hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); @@ -95,7 +97,8 @@ $permissionnote=$user->rights->ficheinter->creer; // Used by the include of acti /* * Actions */ - +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) @@ -538,7 +541,7 @@ else if ($action == 'classifyunbilled' && $user->rights->ficheinter->creer) else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save")) { $objectline = new FichinterLigne($db); - if ($objectline->fetch(GETPOST('line_id','int')) <= 0) + if ($objectline->fetch($lineid) <= 0) { dol_print_error($db); exit; @@ -594,7 +597,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST( else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer) { $objectline = new FichinterLigne($db); - if ($objectline->fetch(GETPOST('line_id','int')) <= 0) + if ($objectline->fetch($lineid) <= 0) { dol_print_error($db); exit; @@ -626,7 +629,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> else if ($action == 'up' && $user->rights->ficheinter->creer) { - $object->line_up(GETPOST('line_id','int')); + $object->line_up($lineid); // Define output language $outputlangs = $langs; @@ -640,13 +643,13 @@ else if ($action == 'up' && $user->rights->ficheinter->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid); exit; } else if ($action == 'down' && $user->rights->ficheinter->creer) { - $object->line_down(GETPOST('line_id','int')); + $object->line_down($lineid); // Define output language $outputlangs = $langs; @@ -660,7 +663,7 @@ else if ($action == 'down' && $user->rights->ficheinter->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid); exit; } @@ -1160,7 +1163,7 @@ else if ($id > 0 || ! empty($ref)) // Confirmation de la suppression de la fiche d'intervention if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); } @@ -1184,23 +1187,31 @@ else if ($id > 0 || ! empty($ref)) } $text=$langs->trans('ConfirmValidateIntervention',$numref); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); } // Confirmation de la validation de la fiche d'intervention if ($action == 'modify') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); } // Confirmation de la suppression d'une ligne d'intervention if ($action == 'ask_deleteline') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); } + + if (!$formconfirm) { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + // Print form confirm + print $formconfirm; print '
'; print ''; From c2cbbffd127726d5b10a788ae1b93861a2e256df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Sep 2014 17:30:49 +0200 Subject: [PATCH 04/30] Fix: duplicate field --- htdocs/install/mysql/tables/llx_user.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 3c084640367..28385298125 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -56,7 +56,6 @@ create table llx_user fk_socpeople integer, fk_member integer, fk_user integer, -- Hierarchic parent - thm double(24,8), note text DEFAULT NULL, datelastlogin datetime, datepreviouslogin datetime, From cff713ad073e718c2a54d895e530851bd44979c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Sep 2014 17:43:38 +0200 Subject: [PATCH 05/30] Fix: var not initialized --- htdocs/fichinter/card.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 0908bc15fbe..1ade8eddf13 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1160,11 +1160,12 @@ else if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention'); + $formconfirm=''; + // Confirmation de la suppression de la fiche d'intervention if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); - } // Confirmation validation @@ -1188,24 +1189,22 @@ else if ($id > 0 || ! empty($ref)) $text=$langs->trans('ConfirmValidateIntervention',$numref); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); - } // Confirmation de la validation de la fiche d'intervention if ($action == 'modify') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); - } // Confirmation de la suppression d'une ligne d'intervention if ($action == 'ask_deleteline') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); - } - - if (!$formconfirm) { + + if (!$formconfirm) + { $parameters=array('lineid'=>$lineid); $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook } From 396bae21d636b64c30b9b430c5b96f512b620dd7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Sep 2014 18:15:20 +0200 Subject: [PATCH 06/30] Fix: Missing closing tr --- htdocs/fourn/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 403aa46c657..ba3cb7e9de0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1435,7 +1435,7 @@ elseif (! empty($object->id)) print ''; // Delivery date planed - print ''; + print ''; print ''; @@ -1456,13 +1456,13 @@ elseif (! empty($object->id)) { print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : ' '; } - print ''; + print ''; // Project if (! empty($conf->projet->enabled)) { $langs->load('projects'); - print '
'; print $langs->trans('DateDeliveryPlanned'); print '
'; + print '
'; print ''; From 3daf06960d52679bd1ed9834ed9961dfda14a1e2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Sep 2014 12:07:11 +0200 Subject: [PATCH 07/30] Fix: add generic doc and uniformize code --- htdocs/admin/fichinter.php | 186 +++++++++++++++++++++++-------------- 1 file changed, 118 insertions(+), 68 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 37a3b2a5a5c..dad5f484a4d 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand @@ -113,6 +113,35 @@ else if ($action == 'specimen') // For fiche inter } } +// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) +if ($action == 'setModuleOptions') +{ + $post_size=count($_POST); + + $db->begin(); + + for($i=0;$i < $post_size;$i++) + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); + } +} + // Activate a model else if ($action == 'set') { @@ -261,13 +290,13 @@ foreach ($dirmodels as $reldir) require_once $dir.$file.'.php'; $module = new $file; - + if ($module->isEnabled()) { // Show modules according to features level if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + $var=!$var; print ''; - - // Active - if (in_array($name, $def)) + if (file_exists($dir.'/'.$file)) { - print ""; - } - else - { - print ""; - } + $var=!$var; - // Default - print "'; + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); - print ''; - - // Preview - $link=''.img_object($langs->trans("Preview"),'intervention').''; - print ''; + require_once $dir.'/'.$file; + $module = new $classname($db); - print ''; + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) + { + print ''; + + // Active + if (in_array($name, $def)) + { + print ""; + } + else + { + print ""; + } + + // Default + print "'; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + print ''; + + // Preview + print ''; + + print ''; + } + } } } - closedir($handle); } } } From 64b757ed81810226d6869ce3b75aecd5863caa9a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Sep 2014 12:44:57 +0200 Subject: [PATCH 08/30] Fix: add generic doc and use doc dir instead pdf --- htdocs/admin/livraison.php | 165 ++++++++++++------ .../modules/livraison/{pdf => doc}/index.html | 0 .../{pdf => doc}/pdf_typhon.modules.php | 4 +- htdocs/livraison/class/livraison.class.php | 4 +- 4 files changed, 114 insertions(+), 59 deletions(-) rename htdocs/core/modules/livraison/{pdf => doc}/index.html (100%) rename htdocs/core/modules/livraison/{pdf => doc}/pdf_typhon.modules.php (99%) diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 415bff261de..b591aa79c08 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand * @@ -95,7 +95,7 @@ if ($action == 'specimen') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/livraison/pdf/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php",0); if (file_exists($file)) { $filefound=1; @@ -128,6 +128,35 @@ if ($action == 'specimen') } } +// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) +if ($action == 'setModuleOptions') +{ + $post_size=count($_POST); + + $db->begin(); + + for($i=0;$i < $post_size;$i++) + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); + } +} + if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); @@ -356,75 +385,101 @@ clearstatcache(); $var=true; foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/pdf/"); + $dir = dol_buildpath($reldir."core/modules/livraison/doc/"); if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { - while (($file = readdir($handle))!==false) - { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); + + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) { - $name = substr($file, 4, dol_strlen($file) - 16); - $classname = substr($file, 0, dol_strlen($file) - 12); + if (file_exists($dir.'/'.$file)) + { + $var=!$var; - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - print ''; + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; - // Activ - if (in_array($name, $def)) - { - print ""; - } - else - { - print ""; - } + if ($modulequalified) + { + print ''; - // Default - print "'; + // Active + if (in_array($name, $def)) + { + print ""; + } + else + { + print ""; + } - // Info - $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - print ''; - print ''; + // Default + print "'; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + print ''; + + // Preview + print ''; + + print ''; + } + } } } - closedir($handle); } } } diff --git a/htdocs/core/modules/livraison/pdf/index.html b/htdocs/core/modules/livraison/doc/index.html similarity index 100% rename from htdocs/core/modules/livraison/pdf/index.html rename to htdocs/core/modules/livraison/doc/index.html diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php similarity index 99% rename from htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php rename to htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 569cfdff85e..363e7960fe8 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik * Copyright (C) 2011-2012 Philippe Grand @@ -21,7 +21,7 @@ */ /** - * \file htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php + * \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Typhon * \author Laurent Destailleur diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index ad20f319ed2..ebe46c78ac3 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006-2007 Laurent Destailleur * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2011-2012 Philippe Grand @@ -953,7 +953,7 @@ class Livraison extends CommonObject } } - $modelpath = "core/modules/livraison/pdf/"; + $modelpath = "core/modules/livraison/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, 0, 0, 0); } From 179da9a2206fcbe7d7bf98b71a6aa60918222f8b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Sep 2014 13:49:33 +0200 Subject: [PATCH 09/30] Fix: uniformize code --- htdocs/admin/expedition.php | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index d89b406280b..2efdfdd56ba 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -138,6 +138,35 @@ else if ($action == 'specimen') } } +// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) +else if ($action == 'setModuleOptions') +{ + $post_size=count($_POST); + + $db->begin(); + + for($i=0;$i < $post_size;$i++) + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); + } +} + // Activate a model else if ($action == 'set') { @@ -175,14 +204,6 @@ else if ($action == 'setmodel') { dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } -else if ($action=='setModuleOptions') { - if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) - { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->EXPEDITION_ADDON_PDF_ODT_PATH = GETPOST('value1'); - } -} /* From 44cecb8e7d875dc622921aa4f6474456808071b7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 Sep 2014 09:17:37 +0200 Subject: [PATCH 10/30] Fix: add possibility to use element id --- htdocs/core/ajax/loadinplace.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 69a0bbc72c7..de3a4e57d19 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2014 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 @@ -98,7 +98,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php'); $classname = 'Actions'.ucfirst($subelement); $object = new $classname($db); - $ret = $object->$methodname(); + $ret = $object->$methodname($fk_element); if ($ret > 0) echo json_encode($object->$cachename); } } From 3ab8b6f7d10be433a36aeab685ebe9f3677df4f4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 Sep 2014 09:44:21 +0200 Subject: [PATCH 11/30] New: add possibility to define a custom error message --- htdocs/core/class/html.form.class.php | 25 ++++++++++++++++++------- htdocs/core/js/editinplace.js | 17 ++++++++++++----- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0233706928c..8bbf5ad8337 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006 Marc Barilley/Ocebo * Copyright (C) 2007 Franky Van Liedekerke @@ -124,11 +124,11 @@ class Form * @param string $typeofdata Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param object $extObject External object - * @param string $success Success message + * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @param string $moreparam More param to add on a href URL * @return string HTML edit field */ - function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $success=null, $moreparam='') + function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='') { global $conf,$langs,$db; @@ -140,7 +140,7 @@ class Form // When option to edit inline is activated if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker { - $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success); + $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); } else { @@ -244,10 +244,10 @@ class Form * @param string $inputType Type of input ('numeric', 'datepicker', 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') * @param string $editvalue When in edit mode, use this value as $value instead of value * @param object $extObject External object - * @param string $success Success message + * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @return string HTML edit in place */ - private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $success=null) + private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null) { global $conf; @@ -334,7 +334,18 @@ class Form $out.= ''."\n"; if (! empty($savemethod)) $out.= ''."\n"; if (! empty($ext_element)) $out.= ''."\n"; - if (! empty($success)) $out.= ''."\n"; + if (! empty($custommsg)) + { + if (is_array($custommsg)) + { + if (!empty($custommsg['success'])) + $out.= ''."\n"; + if (!empty($custommsg['error'])) + $out.= ''."\n"; + } + else + $out.= ''."\n"; + } if ($inputType == 'textarea') { $out.= ''."\n"; $out.= ''."\n"; diff --git a/htdocs/core/js/editinplace.js b/htdocs/core/js/editinplace.js index 4fe29e4b4fb..17d70220b31 100644 --- a/htdocs/core/js/editinplace.js +++ b/htdocs/core/js/editinplace.js @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2012 Regis Houssin +// Copyright (C) 2011-2014 Regis Houssin // Copyright (C) 2011 Laurent Destailleur // // This program is free software; you can redistribute it and/or modify @@ -358,12 +358,19 @@ $(document).ready(function() { var res = $.parseJSON(result); if (res.error) { $(obj).html(obj.revert); - $.jnotify(res.error, "error", true); + var htmlname = $(obj).attr('id').substr(8); + var errormsg = $( '#errormsg_' + htmlname ).val(); + if (errormsg != undefined) { + $.jnotify(errormsg, "error", true); + } else { + $.jnotify(res.error, "error", true); + } + } else { var htmlname = $(obj).attr('id').substr(8); - var success = $( '#success_' + htmlname ).val(); - if (success != undefined) { - $.jnotify(success, "ok"); + var successmsg = $( '#successmsg_' + htmlname ).val(); + if (successmsg != undefined) { + $.jnotify(successmsg, "ok"); } $(obj).html(res.value); $(obj).hide(); From bf4b99fa641bd4ac00092b2780f3a89aefa09b66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Sep 2014 12:27:18 +0200 Subject: [PATCH 12/30] Assignation of event to several users is on a very good way for 3.7 --- htdocs/comm/action/card.php | 2 + htdocs/comm/action/class/actioncomm.class.php | 31 ++++++++++----- htdocs/comm/action/index.php | 30 +++++++------- htdocs/comm/action/peruser.php | 39 +++++++++++-------- htdocs/core/class/html.form.class.php | 6 ++- 5 files changed, 67 insertions(+), 41 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index aef2d5fad3d..827e2df976a 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -219,6 +219,7 @@ if ($action == 'add') if ($value['id'] > 0) { $usertodo->fetch($value['id']); + $object->userownerid = $usertodo->id; } $object->usertodo = $usertodo; $object->transparency = (GETPOST("transparency")=='on'?1:0); @@ -235,6 +236,7 @@ if ($action == 'add') if ($_POST["doneby"] > 0) { $userdone->fetch($_POST["doneby"]); + $object->userdoneid = $userdone->id; } $object->userdone = $userdone; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 1d7cf0efd68..fa7130ec018 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -47,8 +47,10 @@ class ActionComm extends CommonObject var $datec; // Date creation record (datec) var $datem; // Date modification record (tms) - var $author; // Object user that create action - var $usermod; // Object user that modified action + var $author; // Object user that create action //deprecated + var $usermod; // Object user that modified action // deprecated + var $authorid; // Id user that create action + var $usermodid; // Id user that modified action var $datep; // Date action start (datep) var $datef; // Date action end (datep2) @@ -63,8 +65,9 @@ class ActionComm extends CommonObject var $note; // Description var $userassigned = array(); // Array of user ids - var $usertodo; // Object user of owner - var $userdone; // Object user that did action (deprecated) + var $userownerid; // Id of user owner + var $usertodo; // Object user of owner // deprecated + var $userdone; // Object user that did action // deprecated var $socid; var $contactid; @@ -134,6 +137,9 @@ class ActionComm extends CommonObject if ($this->elementtype=='commande') $this->elementtype='order'; if ($this->elementtype=='contrat') $this->elementtype='contract'; + $userownerid=isset($this->usertodo->id)?$this->usertodo->id:$this->userownerid; // For backward compatibility + $userdoneid=isset($this->userdone->id)?$this->userdone->id:$this->userdoneid; // For backward compatibility + if (! $this->type_id && $this->type_code) { // Get id from code @@ -197,8 +203,8 @@ class ActionComm extends CommonObject $sql.= " '".$this->db->escape($this->note)."',"; $sql.= (isset($this->contactid) && $this->contactid > 0?"'".$this->contactid."'":"null").","; $sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").","; - $sql.= (isset($this->usertodo->id) && $this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").","; - $sql.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").","; + $sql.= ($userownerid>0?"'".$userownerid."'":"null").","; + $sql.= ($userdoneid>0?"'".$userdoneid."'":"null").","; $sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',"; $sql.= "'".$this->transparency."',"; $sql.= (! empty($this->fk_element)?$this->fk_element:"null").","; @@ -351,8 +357,9 @@ class ActionComm extends CommonObject $this->author->lastname = $obj->lastname; $this->usermod->id = $obj->fk_user_mod; - $this->usertodo->id = $obj->fk_user_action; - $this->userdone->id = $obj->fk_user_done; + $this->userownerid = $obj->fk_user_action; + $this->usertodo->id = $obj->fk_user_action; // deprecated + //$this->userdone->id = $obj->fk_user_done; $this->priority = $obj->priority; $this->fulldayevent = $obj->fulldayevent; $this->location = $obj->location; @@ -380,19 +387,25 @@ class ActionComm extends CommonObject /** - * Initialize this->userassigned array + * Initialize this->userassigned array with list of id of user assigned to event * * @return int <0 if KO, >0 if OK */ function fetch_userassigned() { global $langs; + $sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; $sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id; $resql2=$this->db->query($sql); if ($resql2) { + $this->userassigned=array(); + + // If owner is known, we must but id first into list + if ($this->userownerid > 0) $this->userassigned[$this->userownerid]=array('id'=>$this->userownerid); // Set first so will be first into list. + while ($obj = $this->db->fetch_object($resql2)) { $this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 44d1e209694..67d27de66a5 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -484,10 +484,12 @@ if ($resql) $event->type_code=$obj->code; $event->libelle=$obj->label; $event->percentage=$obj->percent; - $event->author->id=$obj->fk_user_author; // user id of creator - $event->usertodo->id=$obj->fk_user_action; // user id of owner - $event->userdone->id=$obj->fk_user_done; // deprecated - // $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event + //$event->author->id=$obj->fk_user_author; // user id of creator + $event->authorid=$obj->fk_user_author; // user id of creator + $event->userownerid=$obj->fk_user_action; // user id of owner + $event->fetch_userassigned(); // This load $event->userassigned + //$event->usertodo->id=$obj->fk_user_action; // user id of owner + //$event->userdone->id=$obj->fk_user_done; // deprecated $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; @@ -1132,19 +1134,19 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa { if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA)) { - $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); + $keysofuserassigned=array_keys($event->userassigned); + + $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); // Define $color and $cssclass of event $color=-1; $cssclass=''; $colorindex=-1; - if ((! empty($event->author->id) && $event->author->id == $user->id) - || (! empty($event->usertodo->id) && $event->usertodo->id == $user->id) - || (! empty($event->userdone->id) && $event->userdone->id == $user->id)) - { - $nummytasks++; $cssclass='family_mytasks'; + if (in_array($user->id, $keysofuserassigned)) + { + $nummytasks++; $cssclass='family_mytasks'; // TODO Set a color using user color // Must defined rule to choose color of who to use. - // event->usertodo->id will still contains user id of owner - // event->userstodo will be an array in future. + // event->ownerid will still contains user id of owner + // event->userassigned will be an array in future. // $color=$user->color; } else if ($event->type_code == 'ICALEVENT') @@ -1164,7 +1166,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($color == -1) // Color was not forced. Set color according to color index. { // Define color index if not yet defined - $idusertouse=($event->usertodo->id?$event->usertodo->id:0); + $idusertouse=($event->userownerid?$event->userownerid:0); if (isset($colorindexused[$idusertouse])) { $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user @@ -1344,7 +1346,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { - print 'datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datef=$db->jdate($obj->datep2); $event->type_code=$obj->code; - $event->libelle=$obj->label; // deprecated + //$event->libelle=$obj->label; // deprecated $event->label=$obj->label; $event->percentage=$obj->percent; - $event->author->id=$obj->fk_user_author; // user id of creator - $event->usertodo->id=$obj->fk_user_action; // user id of owner - $event->userdone->id=$obj->fk_user_done; // deprecated - // $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event + //$event->author->id=$obj->fk_user_author; // user id of creator + $event->authorid=$obj->fk_user_author; // user id of creator + $event->userownerid=$obj->fk_user_action; // user id of owner + $event->fetch_userassigned(); // This load $event->userassigned + //$event->userdone->id=$obj->fk_user_done; // deprecated $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; @@ -412,8 +413,8 @@ if ($resql) $event->socid=$obj->fk_soc; $event->contactid=$obj->fk_contact; - $event->societe->id=$obj->fk_soc; - $event->contact->id=$obj->fk_contact; + //$event->societe->id=$obj->fk_soc; // deprecated + //$event->contact->id=$obj->fk_contact; // deprecated // Defined date_start_in_calendar and date_end_in_calendar property // They are date start and end of action but modified to not be outside calendar view. @@ -424,7 +425,7 @@ if ($resql) else $event->date_end_in_calendar=$event->datep; } else - { + { $event->date_start_in_calendar=$event->datep; if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef; else $event->date_end_in_calendar=$event->datep; @@ -442,7 +443,7 @@ if ($resql) // This record is out of visible range } else - { + { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; @@ -598,6 +599,9 @@ else $usernames = $tmpgroup->listUsersForGroup(); } +// Load array of colors by type +// TODO +$colorsbytype=array(); // Loop on each user to show calendar $sav = $tmpday; @@ -608,6 +612,7 @@ foreach ($usernames as $username) echo ''; $tmpday = $sav; + // Lopp on each day of week $i = 0; for ($iter_day = 0; $iter_day < 7; $iter_day++) { @@ -631,7 +636,7 @@ foreach ($usernames as $username) if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; if ($today) $style='cal_today_peruser'; - show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader); + show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype); $i++; } @@ -721,8 +726,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); - $nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ... + $nextindextouse=count($colorindexused); // At first run, this is 0, so fist user has 0, next 1, ... + // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { $annee = date('Y',$daykey); @@ -733,17 +739,18 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & //Tout les events à la même date : foreach ($eventarray[$daykey] as $index => $event) { - if ($username->id != $event->usertodo->id) continue; // We discard record if event is from another user than user we want to show + $keysofuserassigned=array_keys($event->userassigned); + if (! in_array($username->id,$keysofuserassigned)) continue; // We discard record if event is from another user than user we want to show + //if ($username->id != $event->userownerid) continue; // We discard record if event is from another user than user we want to show $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); // Define $color and $cssclass of event $color=-1; $cssclass=''; $colorindex=-1; - if ((! empty($event->author->id) && $event->author->id == $user->id) - || (! empty($event->usertodo->id) && $event->usertodo->id == $user->id) - || (! empty($event->userdone->id) && $event->userdone->id == $user->id)) + if (in_array($user->id, $keysofuserassigned)) { $nummytasks++; $cssclass='family_mytasks'; + // TODO Set color according to event type } else if ($event->type_code == 'ICALEVENT') { @@ -765,7 +772,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if ($color == -1) // Color was not forced. Set color according to color index. { // Define color index if not yet defined - $idusertouse=($event->usertodo->id?$event->usertodo->id:0); + $idusertouse=($event->userownerid?$event->userownerid:0); if (isset($colorindexused[$idusertouse])) { $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0233706928c..5047d493f08 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1318,7 +1318,9 @@ class Form { $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); } - if (count($assignedtouser) && $action != 'view') $out.='
'; + $numassignetouser=count($assignedtouser); + + if ($numassignetouser && $action != 'view') $out.='
'; $i=0; $ownerid=0; foreach($assignedtouser as $key => $value) { @@ -1326,7 +1328,7 @@ class Form $userstatic->fetch($value['id']); $out.=$userstatic->getNomUrl(1); if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; } - if ($i > 0 && $action != 'view') $out.=' '; + if ($numassignetouser > 1 && $action != 'view') $out.=' '; //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); $out.='
'; From c0e93a17da048513ed5d34043e2ea6b4e502004e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Sep 2014 12:42:21 +0200 Subject: [PATCH 13/30] Add FIXME --- htdocs/comm/action/index.php | 2 ++ htdocs/comm/action/listactions.php | 2 ++ htdocs/comm/action/peruser.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 67d27de66a5..882e26df432 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -419,6 +419,7 @@ if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; +// FIXME: We must filter on assignement table if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($action == 'show_day') { @@ -453,6 +454,7 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } +// FIXME: We must filter on assignement table if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) { $sql.= " AND ("; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index a2c75386e56..bc8a15827e0 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -163,6 +163,7 @@ if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; +// FIXME: We must filter on assignement table if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($type) $sql.= " AND c.id = ".$type; if ($status == '0') { $sql.= " AND a.percent = 0"; } @@ -170,6 +171,7 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } +// FIXME: We must filter on assignement table if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) { $sql.= " AND ("; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 212fdddb9ac..b85ac59c9a7 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -335,6 +335,7 @@ if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; +// FIXME: We must filter on assignement table if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($action == 'show_day') { @@ -369,6 +370,7 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } +// FIXME: We must filter on assignement table if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) { $sql.= " AND ("; From 722e939e197ae30e7561c492608553d3d8a4b3d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Sep 2014 13:23:54 +0200 Subject: [PATCH 14/30] Fix: form must not be into a closing and opening tr tag. --- htdocs/commande/card.php | 110 ++++++++++++++++++--------------- htdocs/fourn/commande/card.php | 44 +++++++------ 2 files changed, 86 insertions(+), 68 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 29b22f8dbd2..3119205fda8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -371,11 +371,11 @@ else if ($action == 'add' && $user->rights->commande->creer) { // If some invoice's lines already known $NBLINES = 8; for($i = 1; $i <= $NBLINES; $i ++) { - if ($_POST ['idprod' . $i]) { + if ($_POST['idprod' . $i]) { $xid = 'idprod' . $i; $xqty = 'qty' . $i; $xremise = 'remise_percent' . $i; - $object->add_product($_POST [$xid], $_POST [$xqty], $_POST [$xremise]); + $object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]); } } } @@ -546,7 +546,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { if (is_array($extralabelsline)) { // Get extra fields foreach ($extralabelsline as $key => $value) { - unset($_POST ["options_" . $key]); + unset($_POST["options_" . $key]); } } @@ -725,23 +725,23 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - unset($_POST ['prod_entry_mode']); + unset($_POST['prod_entry_mode']); - unset($_POST ['qty']); - unset($_POST ['type']); - unset($_POST ['remise_percent']); - unset($_POST ['price_ht']); - unset($_POST ['price_ttc']); - unset($_POST ['tva_tx']); - unset($_POST ['product_ref']); - unset($_POST ['product_label']); - unset($_POST ['product_desc']); - unset($_POST ['fournprice']); - unset($_POST ['buying_price']); - unset($_POST ['np_marginRate']); - unset($_POST ['np_markRate']); - unset($_POST ['dp_desc']); - unset($_POST ['idprod']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); + unset($_POST['dp_desc']); + unset($_POST['idprod']); unset($_POST['date_starthour']); unset($_POST['date_startmin']); @@ -796,7 +796,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { - unset($_POST ["options_" . $key]); + unset($_POST["options_" . $key]); } } @@ -850,18 +850,18 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - unset($_POST ['qty']); - unset($_POST ['type']); - unset($_POST ['productid']); - unset($_POST ['remise_percent']); - unset($_POST ['price_ht']); - unset($_POST ['price_ttc']); - unset($_POST ['tva_tx']); - unset($_POST ['product_ref']); - unset($_POST ['product_label']); - unset($_POST ['product_desc']); - unset($_POST ['fournprice']); - unset($_POST ['buying_price']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); } else { setEventMessage($object->error, 'errors'); } @@ -1699,6 +1699,8 @@ if ($action == 'create' && $user->rights->commande->creer) { $author = new User($db); $author->fetch($object->user_author_id); + $res = $object->fetch_optionals($object->id, $extralabels); + $head = commande_prepare_head($object); dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order'); @@ -2120,30 +2122,38 @@ if ($action == 'create' && $user->rights->commande->creer) { } // Other attributes (TODO Move this into an include) - $res = $object->fetch_optionals($object->id, $extralabels); $parameters = array('colspan' => ' colspan="3"'); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by - // hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) { - foreach ($extrafields->attribute_label as $key => $label) { - if ($action == 'edit_extras') { - $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); - } else { - $value = $object->array_options ["options_" . $key]; + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach ($extrafields->attribute_label as $key => $label) + { + if ($action == 'edit_extras') + { + $value = (isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); } - if ($extrafields->attribute_type [$key] == 'separate') { + else + { + $value = $object->array_options["options_" . $key]; + } + + if ($extrafields->attribute_type[$key] == 'separate') + { print $extrafields->showSeparator($key); - } else { + } + else + { print '
attribute_required [$key])) - print ' class="fieldrequired"'; + if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"'; print '>' . $label . ''; } - // Other attributes + // Other attributes (TODO Move this into an include) $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - if ($action == 'edit_extras') - { - print '
'; - print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { - if ($action == 'edit_extras') { + if ($action == 'edit_extras') + { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - } else { + } + else + { $value=$object->array_options["options_".$key]; } @@ -1518,15 +1514,25 @@ elseif (! empty($object->id)) $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer) + if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { - print $extrafields->showInputField($key,$value); + print ''; + print ''; + print ''; + print ''; + print ''; + + print $extrafields->showInputField($key, $value); + + print ''; + print ''; } else { - print $extrafields->showOutputField($key,$value); + print $extrafields->showOutputField($key, $value); + if ($object->statut == 0 && $user->rights->commande->creer) + print '
' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; } - print ''."\n"; } } From b8969edcc5e367f840523d9960eb416facbaaf61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Sep 2014 12:34:45 +0200 Subject: [PATCH 15/30] Prepare 3.6.1 --- build/debian/changelog | 7 +++++++ build/exe/doliwamp/doliwamp.iss | 4 ++-- build/rpm/dolibarr_fedora.spec | 3 +++ build/rpm/dolibarr_generic.spec | 3 +++ build/rpm/dolibarr_mandriva.spec | 3 +++ build/rpm/dolibarr_opensuse.spec | 3 +++ htdocs/filefunc.inc.php | 2 +- 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 06d0d2212d5..76e8ae3a2fc 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,3 +1,10 @@ +dolibarr (3.6.1-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 23 Sep 2014 12:00:00 +0100 + dolibarr (3.6.0-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index da727786896..1657ff1c7e7 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.6.0 +AppVerName=DoliWamp-3.6.1 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.6.0 +OutputBaseFilename=DoliWamp-3.6.1 ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index d676e59255e..439a09b8266 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -333,6 +333,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index ef94435a62a..945e8f4812c 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -569,6 +569,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index dfa148570f0..17b46c3c143 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -338,6 +338,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index b3b304312f5..f6192c87c9b 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -349,6 +349,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index b927b0016e8..8066c2a1a22 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.0'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.1'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 7dcaa6121863d5115adb03666c4653df91894d6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Sep 2014 13:23:38 +0200 Subject: [PATCH 16/30] Prepare 3.6.1 --- build/makepack-howto.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 24e5f809185..40b0e5180bc 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -36,14 +36,13 @@ complete release of Dolibarr, step by step. - Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z in build/rpm/*.spec - Commit all changes. -- Add a Tag (x.y.z) - Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl - Check content of built packages. - Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files/stable). - Run makepack-dolibarr.pl again with option to publish files on - sourceforge. + sourceforge. This will also add official tag. - Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx" on server to point to new files (used by some web sites). From 05f83dddf09464053e17a5072f5febc8345eb2dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Sep 2014 15:23:40 +0200 Subject: [PATCH 17/30] Fix: packager --- build/makepack-dolibarr.pl | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 77f19c1500a..b6fa0dd7122 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -460,8 +460,8 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`; @@ -610,9 +610,6 @@ if ($nboftargetok) { print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; - #print "Create directory $RPMDIR\n"; - #$ret=`mkdir -p "$RPMDIR"`; - print "Remove target ".$FILENAMERPM."...\n"; unlink("$NEWDESTI/".$FILENAMERPM); print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n"; @@ -620,13 +617,13 @@ if ($nboftargetok) { print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; - # Set owners - #print "Set owners on files/dir\n"; - #$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`; + # Removed files we don't need + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; print "Set permissions on files/dir\n"; $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; @@ -747,10 +744,18 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; # Removed duplicate license files + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/scayt/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/wsc/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/freefont-20120503/COPYING`; + # Removed files we don't need + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source`; + # Rename upstream changelog to match debian rules $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; From e8b7c9c6bdad044e675e05484d29d1f24277f348 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Sep 2014 16:00:11 +0200 Subject: [PATCH 18/30] Fix: doxygen --- .../actions_adherentcard_common.class.php | 4 ++-- .../actions_adherentcard_default.class.php | 2 +- htdocs/comm/action/index.php | 2 +- .../class/bonprelevement.class.php | 2 +- .../actions_contactcard_common.class.php | 4 ++-- .../actions_contactcard_default.class.php | 2 +- htdocs/core/class/canvas.class.php | 4 ++-- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/hookmanager.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 8 +++---- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/class/ldap.class.php | 16 +++++++------- htdocs/core/class/link.class.php | 2 +- htdocs/core/class/menubase.class.php | 6 ++--- htdocs/core/class/rssparser.class.php | 8 +++---- htdocs/core/db/DoliDB.class.php | 4 ++-- htdocs/core/lib/admin.lib.php | 22 +++++++++---------- htdocs/core/lib/files.lib.php | 4 ++-- htdocs/core/lib/functions.lib.php | 8 +++---- htdocs/core/lib/functions2.lib.php | 4 ++-- htdocs/core/lib/pdf.lib.php | 16 +++++++------- htdocs/core/lib/project.lib.php | 22 +++++++++---------- htdocs/core/lib/treeview.lib.php | 2 +- htdocs/core/lib/ws.lib.php | 6 ++--- htdocs/core/menus/standard/auguria.lib.php | 12 +++++----- htdocs/core/menus/standard/eldy.lib.php | 12 +++++----- htdocs/core/modules/action/rapport.pdf.php | 4 ++-- .../barcode/mod_barcode_product_standard.php | 8 +++---- .../modules/cheque/pdf/pdf_blochet.class.php | 6 ++--- .../commande/doc/pdf_einstein.modules.php | 12 +++++----- .../commande/doc/pdf_proforma.modules.php | 12 +++++----- .../contract/doc/pdf_strato.modules.php | 6 ++--- .../expedition/doc/pdf_merou.modules.php | 8 +++---- .../expedition/doc/pdf_rouget.modules.php | 8 +++---- .../modules/facture/doc/pdf_crabe.modules.php | 12 +++++----- .../fichinter/doc/pdf_soleil.modules.php | 6 ++--- .../livraison/pdf/pdf_typhon.modules.php | 8 +++---- .../modules/member/doc/pdf_standard.class.php | 10 ++++----- htdocs/core/modules/modSalaries.class.php | 2 +- .../doc/pdf_standardlabel.class.php | 10 ++++----- .../product/mod_codeproduct_elephant.php | 2 +- .../product/mod_codeproduct_leopard.php | 2 +- .../project/pdf/pdf_baleine.modules.php | 6 ++--- .../modules/propale/doc/pdf_azur.modules.php | 12 +++++----- .../modules/rapport/pdf_paiement.class.php | 10 ++++----- .../societe/mod_codeclient_elephant.php | 2 +- .../societe/mod_codeclient_leopard.php | 2 +- .../modules/societe/mod_codeclient_monkey.php | 4 ++-- .../pdf/pdf_canelle.modules.php | 10 ++++----- .../pdf/pdf_muscadet.modules.php | 12 +++++----- htdocs/imports/import.php | 4 ++-- htdocs/main.inc.php | 2 +- .../product/actions_card_product.class.php | 2 +- .../service/actions_card_service.class.php | 2 +- .../resource/class/actions_resource.class.php | 4 ++-- .../canvas/actions_card_common.class.php | 4 ++-- .../company/actions_card_company.class.php | 4 ++-- .../actions_card_individual.class.php | 4 ++-- htdocs/societe/class/societe.class.php | 6 ++--- htdocs/user/class/user.class.php | 4 ++-- test/phpunit/FactureRecTest.php | 14 ++++++------ test/phpunit/FactureTest.php | 2 +- test/phpunit/UserTest.php | 2 +- 63 files changed, 204 insertions(+), 204 deletions(-) diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index fc593e826f2..4a8b8d584ab 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -94,7 +94,7 @@ abstract class ActionsAdherentCardCommon /** * Load data control * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id of object * @return void */ @@ -228,7 +228,7 @@ abstract class ActionsAdherentCardCommon /** * Set content of ->tpl array, to use into template * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id * @return string HTML output */ diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index b88e4b2134f..5c40cb22954 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -76,7 +76,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon /** * Assign custom values for canvas * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id * @return void */ diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 92b87d94ad1..41435afc84d 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -966,7 +966,7 @@ llxFooter(); * @param int $year Year * @param int $monthshown Current month shown in calendar view * @param string $style Style to use for this day - * @param array &$eventarray Array of events + * @param array $eventarray Array of events * @param int $maxprint Nb of actions to show each day on month view (0 means no limit) * @param int $maxnbofchar Nb of characters to show for event line * @param string $newparam Parameters on current URL diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 104277f4ed5..70431e0d39b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -164,7 +164,7 @@ class BonPrelevement extends CommonObject /** * Add line to withdrawal * - * @param int &$line_id id line to add + * @param int $line_id id line to add * @param int $client_id id invoice customer * @param string $client_nom name of cliente * @param int $amount amount of invoice diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index a2612e51e47..50b45918f9c 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -94,7 +94,7 @@ abstract class ActionsContactCardCommon /** * Load data control * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id of object * @return void */ @@ -228,7 +228,7 @@ abstract class ActionsContactCardCommon /** * Set content of ->tpl array, to use into template * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id * @return string HTML output */ diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index b39114cb3f5..3bfcf347c3f 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -75,7 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon /** * Assign custom values for canvas * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id * @return void */ diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index f51056b2551..959decc581c 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -125,7 +125,7 @@ class Canvas /** * Shared method for canvas to assign values for templates * - * @param string &$action Action string + * @param string $action Action string * @param int $id Object id (if ref not provided) * @param string $ref Object ref (if id not provided) * @return void @@ -181,7 +181,7 @@ class Canvas /** * Shared method for canvas to execute actions * - * @param string &$action Action string + * @param string $action Action string * @param int $id Object id * @return mixed Return return code of doActions of canvas * @deprecated This function is called if you add a doActions class inside your canvas. Try to not diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 13757ef947a..7b1f9d59889 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1041,7 +1041,7 @@ class ExtraFields * Fill array_options property of object by extrafields value (using for data sent by forms) * * @param array $extralabels $array of extrafields - * @param object &$object Object + * @param object $object Object * @param string $onlykey Only following key is filled * @return int 1 if array_options set / 0 if no value */ diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 3afcd941ee9..9d8ce90e812 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -114,8 +114,8 @@ class HookManager * * @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...) * @param array $parameters Array of parameters - * @param Object &$object Object to use hooks on - * @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) + * @param Object $object Object to use hooks on + * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO. * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Deprecated. Must always return an int and things to print into ->resprints. * Can also return some values into an array ->results. diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fdd951293a6..ee28ec6a495 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1492,9 +1492,9 @@ class Form /** * constructProductListOption * - * @param resultset &$objp Resultset of fetch - * @param string &$opt Option - * @param string &$optJson Option + * @param resultset $objp Resultset of fetch + * @param string $opt Option + * @param string $optJson Option * @param int $price_level Price level * @param string $selected Preselected value * @return void @@ -4080,7 +4080,7 @@ class Form /** * Return HTML code to output a barcode * - * @param Object &$object Object containing data to retrieve file name + * @param Object $object Object containing data to retrieve file name * @param int $width Width of photo * @return string HTML code to output barcode */ diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index fe1cd8ddb6b..b5bd99495c9 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -462,7 +462,7 @@ class FormOther /** * Write lines of a project (all lines of a project if parent = 0) * - * @param int &$inc Cursor counter + * @param int $inc Cursor counter * @param int $parent Id of parent task we want to see * @param array $lines Array of task lines * @param int $level Level diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 30eeca5a486..88abc140104 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -370,7 +370,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ @@ -423,7 +423,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param string $user Objet user that modify * @return int <0 if KO, >0 if OK */ @@ -475,7 +475,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that update * @param string $olddn Old DN entry key (before update) * @return int <0 if KO, >0 if OK @@ -563,7 +563,7 @@ class Ldap * Build a LDAP message * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @return string Content of file */ function dump_content($dn, $info) @@ -605,7 +605,7 @@ class Ldap * Dump a LDAP message to ldapinput.in file * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @return int <0 if KO, >0 if OK */ function dump($dn, $info) @@ -642,7 +642,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ @@ -694,7 +694,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ @@ -746,7 +746,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 08d520d519e..02924d86668 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -234,7 +234,7 @@ class Link extends CommonObject /** * Loads all links from database * - * @param array &$links array of Link objects to fill + * @param array $links array of Link objects to fill * @param string $objecttype type of the associated object in dolibarr * @param int $objectid id of the associated object in dolibarr * @param string $sortfield field used to sort diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 966b9ac7f77..c04697acd39 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -380,7 +380,7 @@ class Menubase * @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @return array Return array with menu entries for top menu */ function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) @@ -408,7 +408,7 @@ class Menubase * @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) - * @param array &$tabMenu Array with menu entries already loaded + * @param array $tabMenu Array with menu entries already loaded * @return Menu Menu array for particular mainmenu value or full tabArray */ function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) @@ -493,7 +493,7 @@ class Menubase * @param string $myleftmenu Value for left that defined leftmenu * @param int $type_user Looks for menu entry for 0=Internal users, 1=External users * @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...) - * @param array &$tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) + * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) * @return int >0 if OK, <0 if KO */ function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 80ca1b155b7..d9a7d8348d6 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -258,7 +258,7 @@ class RssParser if (!is_resource($xmlparser)) { $this->error="ErrorFailedToCreateParser"; return -1; } - + xml_set_object($xmlparser, $this); xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); xml_set_character_data_handler($xmlparser, 'feed_cdata'); @@ -268,7 +268,7 @@ class RssParser //var_dump($rss->_format);exit; } } - + // If $rss loaded if ($rss) { @@ -452,7 +452,7 @@ class RssParser * * @param string $p Start * @param string $element Tag - * @param array &$attrs Attributes of tags + * @param array $attrs Attributes of tags * @return void */ function feed_start_element($p, $element, &$attrs) @@ -644,7 +644,7 @@ class RssParser /** * To concat 2 string with no warning if an operand is not defined * - * @param string &$str1 Str1 + * @param string $str1 Str1 * @param string $str2 Str2 * @return string String cancatenated */ diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index aa0792c5970..65b136a7a9c 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/core/db/dolidb.class.php - * \brief Class file to manage Dolibarr database access + * \file htdocs/core/db/DoliDB.class.php + * \brief Class file to manage Dolibarr database access */ require_once DOL_DOCUMENT_ROOT .'/core/db/Database.interface.php'; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index c389f442830..155415f59c3 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -853,17 +853,17 @@ function unActivateModule($value, $requiredby=1) /** * Add external modules to list of dictionaries * - * @param array &$taborder Taborder - * @param array &$tabname Tabname - * @param array &$tablib Tablib - * @param array &$tabsql Tabsql - * @param array &$tabsqlsort Tabsqlsort - * @param array &$tabfield Tabfield - * @param array &$tabfieldvalue Tabfieldvalue - * @param array &$tabfieldinsert Tabfieldinsert - * @param array &$tabrowid Tabrowid - * @param array &$tabcond Tabcond - * @param array &$tabhelp Tabhelp + * @param array $taborder Taborder + * @param array $tabname Tabname + * @param array $tablib Tablib + * @param array $tabsql Tabsql + * @param array $tabsqlsort Tabsqlsort + * @param array $tabfield Tabfield + * @param array $tabfieldvalue Tabfieldvalue + * @param array $tabfieldinsert Tabfieldinsert + * @param array $tabrowid Tabrowid + * @param array $tabcond Tabcond + * @param array $tabhelp Tabhelp * @return int 1 */ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c90e58f556c..bcc6c165472 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -43,7 +43,7 @@ function dol_basename($pathfile) * @param string $types Can be "directories", "files", or "all" * @param int $recursive Determines whether subdirectories are searched * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function - * @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')) + * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')) * @param string $sortcriteria Sort criteria ("","fullname","name","date","size") * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only @@ -1289,7 +1289,7 @@ function dol_uncompress($inputfile,$outputdir) * * @param string $dir Directory to scan * @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function - * @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function + * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function * @param int $nohook Disable all hooks * @return string Full path to most recent file */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1450e2f100f..e238b1e5834 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3770,7 +3770,7 @@ function make_substitutions($chaine,$substitutionarray) /** * Complete the $substitutionarray with more entries * - * @param array &$substitutionarray Array substitution old value => new value value + * @param array $substitutionarray Array substitution old value => new value value * @param Translate $outputlangs If we want substitution from special constants, we provide a language * @param Object $object If we want substitution from special constants, we provide data in a source object * @param Mixed $parameters Add more parameters (useful to pass product lines) @@ -4109,7 +4109,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) * or descending output and uses optionally natural case insensitive sorting (which * can be optionally case sensitive as well). * - * @param array &$array Array to sort (array of array('key','otherkey1','otherkey2'...)) + * @param array $array Array to sort (array of array('key','otherkey1','otherkey2'...)) * @param string $index Key in array to use for sorting criteria * @param int $order Sort order * @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort) @@ -4330,8 +4330,8 @@ function picto_from_langcode($codelang) * @param Conf $conf Object conf * @param Translate $langs Object langs * @param Object $object Object object - * @param array &$head Object head - * @param int &$h New position to fill + * @param array $head Object head + * @param int $h New position to fill * @param string $type Value for object where objectvalue can be * 'thirdparty' to add a tab in third party view * 'intervention' to add a tab in intervention view diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 1c3953906a2..4127686b459 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1107,7 +1107,7 @@ function numero_semaine($time) * Convertit une masse d'une unite vers une autre unite * * @param float $weight Masse a convertir - * @param int &$from_unit Unite originale en puissance de 10 + * @param int $from_unit Unite originale en puissance de 10 * @param int $to_unit Nouvelle unite en puissance de 10 * @return float Masse convertie */ @@ -1142,7 +1142,7 @@ function weight_convert($weight,&$from_unit,$to_unit) * * @param DoliDB $db Handler database * @param Conf $conf Object conf - * @param User &$user Object user + * @param User $user Object user * @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder * @return int <0 if KO, >0 if OK * diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index bcb1008b622..17c1185e2e0 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -420,7 +420,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target /** * Show header of page for PDF generation * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $page_height Height of page * @return void @@ -441,7 +441,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height) /** * Add a draft watermark on PDF files * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang * @param int $h Height of PDF * @param int $w Width of PDF @@ -481,7 +481,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) /** * Show bank informations for PDF generation * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang * @param int $curx X * @param int $cury Y @@ -643,7 +643,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default /** * Show footer of page for PDF generation * - * @param PDF &$pdf The PDF factory + * @param PDF $pdf The PDF factory * @param Translate $outputlangs Object lang for output * @param string $paramfreetext Constant name of free text * @param Societe $fromcompany Object company @@ -852,7 +852,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass /** * Show linked objects for PDF generation * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param object $object Object * @param Translate $outputlangs Object lang * @param int $posx X @@ -890,7 +890,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al /** * Output line description into PDF * - * @param PDF &$pdf PDF object + * @param PDF $pdf PDF object * @param Object $object Object * @param int $i Current line number * @param Translate $outputlangs Object lang for output @@ -1587,13 +1587,13 @@ function pdf_getLinkedObjects($object,$outputlangs) { $outputlangs->load('orders'); $outputlangs->load('sendings'); - + $num=count($objects); for ($i=0;$i<$num;$i++) { $objects[$i]->fetchObjectLinked(); $order = $objects[$i]->linkedObjects['commande'][0]; - + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : ''); $linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index bfe782c40f9..a564a312ac2 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -206,13 +206,13 @@ function project_admin_prepare_head() /** * Show task lines with a particular parent * - * @param string &$inc Counter that count number of lines legitimate to show (for return) + * @param string $inc Counter that count number of lines legitimate to show (for return) * @param int $parent Id of parent task to start - * @param array &$lines Array of all tasks - * @param int &$level Level of task + * @param array $lines Array of all tasks + * @param int $level Level of task * @param string $var Color * @param int $showproject Show project columns - * @param int &$taskrole Array of roles of user for each tasks + * @param int $taskrole Array of roles of user for each tasks * @param int $projectsListId List of id of project allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @return void @@ -443,12 +443,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t /** * Output a task line * - * @param string &$inc ? + * @param string $inc ? * @param string $parent ? * @param Object $lines ? - * @param int &$level ? - * @param string &$projectsrole ? - * @param string &$tasksrole ? + * @param int $level ? + * @param string $projectsrole ? + * @param string $tasksrole ? * @param string $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @return $inc @@ -589,10 +589,10 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr /** * Search in task lines with a particular parent if there is a task for a particular user (in taskrole) * - * @param string &$inc Counter that count number of lines legitimate to show (for return) + * @param string $inc Counter that count number of lines legitimate to show (for return) * @param int $parent Id of parent task to start - * @param array &$lines Array of all tasks - * @param string &$taskrole Array of task filtered on a particular user + * @param array $lines Array of all tasks + * @param string $taskrole Array of task filtered on a particular user * @return int 1 if there is */ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 1bbf2e55e27..470da211f2e 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -28,7 +28,7 @@ /** * Show indent and picto of a tree line. Return array with information of line. * - * @param array &$fulltree Array of entries in correct order + * @param array $fulltree Array of entries in correct order * @param string $key Key of entry into fulltree to show picto * @param int $silent Do not output indent and picto, returns only value * @return array array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub) diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php index 1e7f4b4e522..533a13e1fb6 100644 --- a/htdocs/core/lib/ws.lib.php +++ b/htdocs/core/lib/ws.lib.php @@ -27,9 +27,9 @@ * Check authentication array and set error, errorcode, errorlabel * * @param array $authentication Array with authentication informations ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) - * @param int &$error Number of errors - * @param string &$errorcode Error string code - * @param string &$errorlabel Error string label + * @param int $error Number of errors + * @param string $errorcode Error string code + * @param string $errorlabel Error string label * @return User Return user object identified by login/pass/entity into authentication array */ function check_authentication($authentication,&$error,&$errorcode,&$errorlabel) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 837403828ee..427a03d9929 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param DoliDB $db Database handler * @param string $atarget Target * @param int $type_user 0=Menu for backoffice, 1=Menu for front office - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param array &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @return int 0 */ @@ -203,8 +203,8 @@ function print_end_menu_array_auguria() * @param DoliDB $db Database handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler * @param array $menu_array_after Table of menu entries to show after entries of menu handler - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param Menu &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) @@ -402,8 +402,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM * Function to test if an entry is enabled or not * * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu - * @param array &$menuentry Array for menu entry - * @param array &$listofmodulesforexternal Array with list of modules allowed to external users + * @param array $menuentry Array for menu entry + * @param array $listofmodulesforexternal Array with list of modules allowed to external users * @return int 0=Hide, 1=Show, 2=Show gray */ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ed255b5785f..b42fc258c6d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param DoliDB $db Database handler * @param string $atarget Target (Example: '' or '_top') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param array &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @return int 0 */ @@ -428,8 +428,8 @@ function print_end_menu_array() * @param DoliDB $db Database handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) * @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param Menu &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) @@ -1364,8 +1364,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu * Function to test if an entry is enabled or not * * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu - * @param array &$menuentry Array for menu entry - * @param array &$listofmodulesforexternal Array with list of modules allowed to external users + * @param array $menuentry Array for menu entry + * @param array $listofmodulesforexternal Array with list of modules allowed to external users * @return int 0=Hide, 1=Show, 2=Show gray */ function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b864205f2c9..cc3f2557db9 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -159,7 +159,7 @@ class CommActionRapport /** * Write content of pages * - * @param PDF &$pdf Object pdf + * @param PDF $pdf Object pdf * @param Translate $outputlangs Object langs * @return int 1 */ @@ -255,7 +255,7 @@ class CommActionRapport /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $pagenb Page nb * @return void diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index e03bdc6d2e9..28fa03ee4f3 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/core/modules/product/mod_barcode_product_standard.php + * \file htdocs/core/modules/barcode/mod_barcode_product_standard.php * \ingroup barcode * \brief File of class to manage barcode numbering with standard rule */ @@ -162,7 +162,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $thirdparty_type 0 = customer/prospect , 1 = supplier * @param string $type type of barcode (EAN, ISBN, ...) @@ -177,7 +177,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode global $conf; //var_dump($code.' '.$product->ref.' '.$thirdparty_type);exit; - + require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; $result=0; @@ -282,7 +282,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { $newcodefortest=substr($newcodefortest,0,12); } - + $result=check_value($mask,$newcodefortest); return $result; diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index 96214f08d66..04ba6a57174 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -177,7 +177,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Generate Header * - * @param PDF &$pdf Pdf object + * @param PDF $pdf Pdf object * @param int $page Current page number * @param int $pages Total number of pages * @param Translate $outputlangs Object language for output @@ -283,7 +283,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Output array * - * @param PDF &$pdf PDF object + * @param PDF $pdf PDF object * @param int $pagenb Page nb * @param int $pages Pages * @param Translate $outputlangs Object lang @@ -341,7 +341,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 68266f2cef9..b3dd27a8a7a 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -533,7 +533,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -548,7 +548,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -732,7 +732,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -989,7 +989,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1084,7 +1084,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1263,7 +1263,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index eb599c2a214..49e3c374752 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -532,7 +532,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -547,7 +547,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -689,7 +689,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -946,7 +946,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1041,7 +1041,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1220,7 +1220,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 5fc0eb6dd2a..238f51e78cd 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -357,7 +357,7 @@ class pdf_strato extends ModelePDFContract /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -423,7 +423,7 @@ class pdf_strato extends ModelePDFContract /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -602,7 +602,7 @@ class pdf_strato extends ModelePDFContract /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 5385d7ad0e6..14bc79bf935 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -73,7 +73,7 @@ class pdf_merou extends ModelePdfExpedition /** * Function to build pdf onto disk * - * @param Object &$object Object expedition to generate (or id if old method) + * @param Object $object Object expedition to generate (or id if old method) * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -353,7 +353,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -394,7 +394,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -423,7 +423,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 6d0e44817a7..37e3f8b911f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -76,7 +76,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Function to build pdf onto disk * - * @param Object &$object Object expedition to generate (or id if old method) + * @param Object $object Object expedition to generate (or id if old method) * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -354,7 +354,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -409,7 +409,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -649,7 +649,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9186e51b954..6b66d9d2df3 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -535,7 +535,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -673,7 +673,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -829,7 +829,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1124,7 +1124,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1218,7 +1218,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1449,7 +1449,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index f2055e8d643..c94cd154251 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -345,7 +345,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -408,7 +408,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -587,7 +587,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index b13177f9127..3aae0e5a18e 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -540,7 +540,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -567,7 +567,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -626,7 +626,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -842,7 +842,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 043a2e89f5c..cef4155c607 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -99,7 +99,7 @@ class pdf_standard * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $pt point * @return void */ @@ -118,7 +118,7 @@ class pdf_standard * - %LOGO% is replace with company logo * - %PHOTO% is replace with photo provided as parameter * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $textleft Text left * @param string $header Header * @param string $footer Footer @@ -300,7 +300,7 @@ class pdf_standard /** * Print dot line * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -341,7 +341,7 @@ class pdf_standard /** * Fonction realisant une croix aux 4 coins des cartes * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -412,7 +412,7 @@ class pdf_standard /** * Set format * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $format Format * @return void */ diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index f8a99b99aab..5ecadcc9792 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -22,7 +22,7 @@ */ /** - * \defgroup tax Module salaries + * \defgroup salaries Module salaries * \brief Module to include salaries management * \file htdocs/core/modules/modSalaries.class.php * \ingroup salaries diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index b6e35f95f8e..8ae45bdc681 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -99,7 +99,7 @@ class pdf_standardlabel * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $pt point * @return void */ @@ -117,7 +117,7 @@ class pdf_standardlabel * - %LOGO% is replace with company logo * - %PHOTO% is replace with photo provided as parameter * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $textleft Text left * @param string $header Header * @param string $footer Footer @@ -292,7 +292,7 @@ class pdf_standardlabel /** * Print dot line * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -333,7 +333,7 @@ class pdf_standardlabel /** * Fonction realisant une croix aux 4 coins des cartes * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -404,7 +404,7 @@ class pdf_standardlabel /** * Set format * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $format Format * @return void */ diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 3ab5fdb9e09..37383474c2d 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -220,7 +220,7 @@ class mod_codeproduct_elephant extends ModeleProductCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index df71792ee86..a3df52f682f 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -91,7 +91,7 @@ class mod_codeproduct_leopard extends ModeleProductCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $type 0 = product , 1 = service * @return int 0 if OK diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index c8cc0b65fbc..d8f2d744e78 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -315,7 +315,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -348,7 +348,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -434,7 +434,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index fe952fb9903..29fea0d9c1a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -589,7 +589,7 @@ class pdf_azur extends ModelePDFPropales /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object proposal * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -604,7 +604,7 @@ class pdf_azur extends ModelePDFPropales /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -779,7 +779,7 @@ class pdf_azur extends ModelePDFPropales /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1050,7 +1050,7 @@ class pdf_azur extends ModelePDFPropales /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1154,7 +1154,7 @@ class pdf_azur extends ModelePDFPropales /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1354,7 +1354,7 @@ class pdf_azur extends ModelePDFPropales /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index d0defd260dd..3bfb6f6b60c 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -95,7 +95,7 @@ class pdf_paiement $socid=0; if ($user->societe_id) $socid=$user->societe_id; - + if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; @@ -141,7 +141,7 @@ class pdf_paiement $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."facture as f,"; $sql.= " ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement_facture as pf,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; - if (! $user->rights->societe->client->voir && ! $socid) + if (! $user->rights->societe->client->voir && ! $socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -149,7 +149,7 @@ class pdf_paiement $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND p.fk_paiement = c.id "; $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; - if (! $user->rights->societe->client->voir && ! $socid) + if (! $user->rights->societe->client->voir && ! $socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } @@ -237,7 +237,7 @@ class pdf_paiement /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param int $page Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -296,7 +296,7 @@ class pdf_paiement /** * Output body * - * @param PDF &$pdf PDF object + * @param PDF $pdf PDF object * @param string $page Page * @param array $lines Array of lines * @param Translate $outputlangs Object langs diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 94dd1b814e7..88b6e65bf01 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -239,7 +239,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Societe $soc Object third party * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 313a14ad246..27155847bf0 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -90,7 +90,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Societe $soc Object third party * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 8b31e581e26..2933a09de8e 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -139,7 +139,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $date = dol_now(); $yymm = strftime("%y%m",$date); - + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s",$max+1); @@ -152,7 +152,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Societe $soc Object third party * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index ead49d7de98..d3cf60295f6 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -494,7 +494,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -689,7 +689,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -785,7 +785,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -870,7 +870,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1045,7 +1045,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index f15cab9cb6b..78a33f76a29 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -521,7 +521,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -536,7 +536,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -599,7 +599,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -802,7 +802,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -897,7 +897,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1089,7 +1089,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 41a82de36b1..f40bcd3e061 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1762,8 +1762,8 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='') /** * Return not used field number * - * @param array &$fieldssource Array of field source - * @param array &$listofkey Array of keys + * @param array $fieldssource Array of field source + * @param array $listofkey Array of keys * @return void */ function getnewkey(&$fieldssource,&$listofkey) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 30837b590f8..419c737b270 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -110,7 +110,7 @@ function test_sql_and_script_inject($val, $type) /** * Security: Return true if OK, false otherwise. * - * @param string &$var Variable name + * @param string $var Variable name * @param string $type 1=GET, 0=POST, 2=PHP_SELF * @return boolean true if there is an injection */ diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index ddbd3c015ff..44c28f383b5 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -67,7 +67,7 @@ class ActionsCardProduct /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index cee958be50f..cbb9e10750c 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -66,7 +66,7 @@ class ActionsCardService /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/resource/class/actions_resource.class.php b/htdocs/resource/class/actions_resource.class.php index afcf9eb19b8..f8f0b5412f9 100644 --- a/htdocs/resource/class/actions_resource.class.php +++ b/htdocs/resource/class/actions_resource.class.php @@ -46,8 +46,8 @@ class ActionsResource * doActions for resource module * * @param array $parameters parameters - * @param Object &$object object - * @param string &$action action + * @param Object $object object + * @param string $action action * @return void */ /* Why a hook action ? TODO Remove this class and replace a method into commonobject diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 1ee163038bb..6f6cb067333 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -89,7 +89,7 @@ abstract class ActionsCardCommon /** * Load data control * - * @param int &$action Action code + * @param int $action Action code * @return void */ function doActions(&$action) @@ -354,7 +354,7 @@ abstract class ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index a47b6321792..d54af2b8bba 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -75,7 +75,7 @@ class ActionsCardCompany extends ActionsCardCommon /** * Execute actions * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id of object * @return int <0 if KO, >0 if OK */ @@ -91,7 +91,7 @@ class ActionsCardCompany extends ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index b8cb94a820b..2f00cd4bc27 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -75,7 +75,7 @@ class ActionsCardIndividual extends ActionsCardCommon /** * Execute actions * - * @param string &$action Action + * @param string $action Action * @param int $id Id of object (may be empty for creation) * @return int <0 if KO, >0 if OK */ @@ -91,7 +91,7 @@ class ActionsCardIndividual extends ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5893fbab021..b97103458c3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -133,17 +133,17 @@ class Societe extends CommonObject var $barcode_type; /** * code (loaded by fetch_barcode) - * @var + * @var string */ var $barcode_type_code; /** * label (loaded by fetch_barcode) - * @var + * @var string */ var $barcode_type_label; /** * coder (loaded by fetch_barcode) - * @var + * @var string */ var $barcode_type_coder; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index df36812cce8..6f59ac5eadf 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2118,7 +2118,7 @@ class User extends CommonObject /** * Update user using data from the LDAP * - * @param ldapuser &$ldapuser Ladp User + * @param ldapuser $ldapuser Ladp User * * @return int <0 if KO, >0 if OK */ @@ -2237,7 +2237,7 @@ class User extends CommonObject // Init this->parentof that is array(id_son=>id_parent, ...) $this->load_parentof(); - + // Init $this->users array $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 4adace8ef9a..7b5caffc2df 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -131,7 +131,7 @@ class FactureRecTest extends PHPUnit_Framework_TestCase $localobjectinv=new Facture($this->savdb); $localobjectinv->initAsSpecimen(); $localobjectinv->create($user); - + $localobject=new FactureRec($this->savdb); $localobject->initAsSpecimen(); $result=$localobject->create($user, $localobjectinv->id); @@ -141,15 +141,15 @@ class FactureRecTest extends PHPUnit_Framework_TestCase return $result; } - - - - - + + + + + /** * Edit an object to test updates * - * @param mixed &$localobject Object Facture + * @param mixed $localobject Object Facture * @return void */ public function changeProperties(&$localobject) diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 9551c6ce02e..cc54953875c 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -282,7 +282,7 @@ class FactureTest extends PHPUnit_Framework_TestCase /** * Edit an object to test updates * - * @param mixed &$localobject Object Facture + * @param mixed $localobject Object Facture * @return void */ public function changeProperties(&$localobject) diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index d161b3ce395..ef103eb1a46 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -272,7 +272,7 @@ class UserTest extends PHPUnit_Framework_TestCase /** * Edit an object to test updates * - * @param mixed &$localobject Object Facture + * @param mixed $localobject Object Facture * @return void */ public function changeProperties(&$localobject) From 5fdd798e9128e0b0ffdf165b6acf059a71164b7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Sep 2014 17:13:15 +0200 Subject: [PATCH 19/30] Fix: phpcheckstyle from phpcs 1.5.5 (closing tags and & char on parameter). --- htdocs/admin/commande.php | 1 - htdocs/admin/menus/other.php | 1 - htdocs/admin/stock.php | 6 ++--- htdocs/admin/system/database.php | 7 +++--- htdocs/admin/system/dbtable.php | 1 - htdocs/admin/system/dolibarr.php | 1 - htdocs/admin/system/index.php | 2 -- htdocs/admin/tools/eaccelerator.php | 1 - htdocs/admin/tools/purge.php | 1 - htdocs/admin/tools/update.php | 1 - htdocs/admin/translation.php | 1 - htdocs/admin/workflow.php | 1 - htdocs/cashdesk/affIndex.php | 1 - htdocs/cashdesk/facturation.php | 2 -- htdocs/cashdesk/tpl/menu.tpl.php | 1 - htdocs/categories/viewcat.php | 1 - htdocs/comm/action/class/actioncomm.class.php | 1 - htdocs/comm/fiche.php | 7 +++--- htdocs/commande/customer.php | 8 +++---- htdocs/compta/facture/apercu.php | 1 - htdocs/core/actions_sendmails.inc.php | 2 -- htdocs/core/actions_setnotes.inc.php | 2 -- htdocs/core/class/dolprintipp.class.php | 1 - htdocs/core/lib/holiday.lib.php | 1 - htdocs/core/lib/product.lib.php | 2 -- htdocs/core/lib/trip.lib.php | 4 +--- htdocs/core/lib/usergroups.lib.php | 1 - htdocs/core/login/functions_empty.php | 2 -- htdocs/core/login/functions_forceuser.php | 3 --- htdocs/core/login/functions_http.php | 3 --- htdocs/core/login/functions_ldap.php | 2 -- htdocs/core/login/functions_openid.php | 2 -- htdocs/core/menus/standard/auguria.lib.php | 2 -- .../core/modules/propale/modules_propale.php | 1 - htdocs/fichinter/document.php | 2 +- htdocs/holiday/define_holiday.php | 3 ++- htdocs/langs/en_US/compta.lang | 2 +- htdocs/livraison/class/livraison.class.php | 2 -- htdocs/opensurvey/fonctions.php | 23 +++++++++---------- htdocs/opensurvey/results.php | 1 - htdocs/printipp/admin/printipp.php | 8 +++---- htdocs/societe/ajaxcompanies.php | 2 -- .../canvas/actions_card_common.class.php | 1 - test/phpunit/CommandeFournisseurTest.php | 1 - test/phpunit/CommandeTest.php | 1 - test/phpunit/CommonObjectTest.php | 1 - test/phpunit/CompanyBankAccountTest.php | 2 +- test/phpunit/EntrepotTest.php | 1 - test/phpunit/ExportTest.php | 2 +- test/phpunit/FactureRecTest.php | 1 - test/phpunit/FactureTest.php | 2 +- test/phpunit/FunctionsLibTest.php | 2 +- test/phpunit/PropalTest.php | 2 +- test/phpunit/SocieteTest.php | 2 +- test/phpunit/UserTest.php | 1 - test/phpunit/WebservicesInvoicesTest.php | 2 +- test/phpunit/WebservicesThirdpartyTest.php | 2 +- 57 files changed, 42 insertions(+), 98 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 6736f9d2279..1d05efa8e99 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -534,4 +534,3 @@ print '
'; llxFooter(); $db->close(); -?> diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 0ec3119c097..36733add335 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -143,4 +143,3 @@ print '
'; print $langs->trans('Project'); print '
'.$module->nom."\n"; print $module->info(); @@ -372,78 +401,99 @@ foreach ($dirmodels as $reldir) $handle=opendir($dir); if (is_resource($handle)) { - while (($file = readdir($handle))!==false) - { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); + + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) { - $var=!$var; - - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); - - require_once $dir.'/'.$file; - $module = new $classname($db); - - print '
'; - print (empty($module->name)?$name:$module->name); - print "\n"; - require_once $dir.$file; - $module = new $classname($db); - print $module->description; - print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print ''; - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; - print ""; - if ($conf->global->FICHEINTER_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; - print $form->textwithpicto('',$htmltooltip,-1,0); - print ''; - print $link; - print '
'; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print '\n"; + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ""; + if ($conf->global->FICHEINTER_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + print $form->textwithpicto('',$htmltooltip,-1,0); + print ''; + if ($module->type == 'pdf') + { + print ''.img_object($langs->trans("Preview"),'intervention').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print '
'; - print $name; - print "\n"; - require_once $dir.$file; - $module = new $classname($db); + require_once $dir.'/'.$file; + $module = new $classname($db); - print $module->description; - print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print ''; - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; - print "
'; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print '"; - if ($conf->global->LIVRAISON_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; - } - print '\n"; + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print "'; - print $form->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''.img_object($langs->trans("Preview"),'sending').''; - print '"; + if ($conf->global->LIVRAISON_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print '
'; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; + if ($module->type == 'pdf') + { + print ''.img_object($langs->trans("Preview"),'sending').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print '
' . $username->getNomUrl(1). '
'; // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); + if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) + { + $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); } - if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { + if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) + { print ''; print ''; print ''; @@ -2154,7 +2164,9 @@ if ($action == 'create' && $user->rights->commande->creer) { print ''; print ''; - } else { + } + else + { print $extrafields->showOutputField($key, $value); if ($object->statut == 0 && $user->rights->commande->creer) print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ba3cb7e9de0..72cc500e187 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1188,19 +1188,20 @@ if ($action=="create") } elseif (! empty($object->id)) { - $author = new User($db); - $author->fetch($object->user_author_id); - $societe = new Fournisseur($db); $result=$societe->fetch($object->socid); if ($result < 0) dol_print_error($db); + $author = new User($db); + $author->fetch($object->user_author_id); + + $res=$object->fetch_optionals($object->id,$extralabels); + $head = ordersupplier_prepare_head($object); $title=$langs->trans("SupplierOrder"); dol_fiche_head($head, 'card', $title, 0, 'order'); - $res=$object->fetch_optionals($object->id,$extralabels); /* * Confirmation de la suppression de la commande @@ -1482,24 +1483,19 @@ elseif (! empty($object->id)) print '
'; llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 9b80662c180..3cc9e70ca31 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -77,7 +77,7 @@ if($action) if($action == 'STOCK_USE_VIRTUAL_STOCK') { $res = dolibarr_set_const($db, "STOCK_USE_VIRTUAL_STOCK", GETPOST('STOCK_USE_VIRTUAL_STOCK','alpha'),'chaine',0,'',$conf->entity); } - + if($action == 'STOCK_MUST_BE_ENOUGH_FOR_INVOICE') { $res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_INVOICE", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_INVOICE','alpha'),'chaine',0,'',$conf->entity); } @@ -329,7 +329,7 @@ if ($virtualdiffersfromphysical) print '
'; } -$db->close(); llxFooter(); -?> + +$db->close(); diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index f32122df7b9..d9833a13d01 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -81,7 +81,7 @@ else print ''.$langs->trans("Parameters").''; print ''.$langs->trans("Value").''; print ''."\n"; - + // arraytest is an array of test to do $arraytest=array(); if (preg_match('/mysql/i',$db->type)) @@ -91,7 +91,7 @@ else 'collation_database'=>array('var'=>'dolibarr_main_db_collation','valifempty'=>'utf8_general_ci') ); } - + $listtouse=array(); if ($listname == 'listofvars') $listtouse=$listofvars; if ($listname == 'listofstatus') $listtouse=$listofstatus; @@ -124,4 +124,5 @@ else } llxFooter(); -?> \ No newline at end of file + +$db->close(); diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index fe182c2e73e..0990d89acd0 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -130,4 +130,3 @@ else llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 8be469006ff..fe9bde59cec 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -379,4 +379,3 @@ print ''; llxFooter(); $db->close(); -?> diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 640d5138362..1f95dce57cf 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -118,5 +118,3 @@ print info_admin($langs->trans("SystemInfoDesc")).'
'; llxFooter(); $db->close(); - -?> diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index a3f046f4510..8f82f33d039 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -350,4 +350,3 @@ print "

"; llxFooter(); $db->close(); -?> diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index cac0bce888c..30c7ba4dd43 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -166,4 +166,3 @@ if (preg_match('/^confirm/i',$choice)) llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index e449d265fa3..8b0b105d0f0 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -174,4 +174,3 @@ if (! empty($result['return'])) llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 8e5370a957e..66bc4fb22ba 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -69,4 +69,3 @@ print $langs->trans("SeeAlso").': '."\n"; -?> \ No newline at end of file diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 4d442c0dbd3..32411f627fb 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -191,5 +191,3 @@ $obj_facturation->paiementLe('RESET'); // Affichage des templates require ('tpl/facturation1.tpl.php'); - -?> diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 59800fb57c1..4ee52ce0da6 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -78,4 +78,3 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) } print ''; print ''; -?> \ No newline at end of file diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index bec834e1ff9..010306d1e00 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -520,4 +520,3 @@ if($object->type == 4) llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index e41e556f3d9..9919dc21e80 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1071,4 +1071,3 @@ class ActionComm extends CommonObject } -?> diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 7a79b658a76..7ba1cc8bc48 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -821,11 +821,11 @@ if ($id > 0) /* * Barre d'actions */ - + $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - - + + print '
'; if (! empty($conf->propal->enabled) && $user->rights->propal->creer) @@ -933,4 +933,3 @@ dol_htmloutput_mesg('',$mesgs); // End of page llxFooter(); $db->close(); -?> diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 373775a0da0..29812903d12 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -156,7 +156,7 @@ if ($resql) print ""; print ''; - + $result=''; $lien=$lienfin=''; $lien = ''; @@ -164,7 +164,7 @@ if ($resql) $name=$obj->nom; $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); $result.=$lien.(dol_trunc($name,$maxlen)).$lienfin; - + print $result; print ''; print ''.$obj->town.' '; @@ -185,7 +185,7 @@ else dol_print_error($db); } +llxFooter(); + $db->close(); -llxFooter(); -?> diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index e1662708489..856640e306e 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -420,4 +420,3 @@ elseif (file_exists($fileimagebis)) $db->close(); llxFooter(); -?> diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f13113487c1..3af164abfab 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -229,5 +229,3 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO } } - -?> \ No newline at end of file diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 3b2bbef75bb..74f576cf852 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -43,5 +43,3 @@ else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST(' $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private'); if ($result < 0) setEventMessage($object->error,'errors'); } - -?> \ No newline at end of file diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index 768741d9368..942ee3da3c3 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -201,4 +201,3 @@ class dolprintIPP return $ipp->printer_attributes; } } -?> diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index dd299ab5c2c..6b4877b14b2 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -50,4 +50,3 @@ function holiday_prepare_head($object) return $head; } -?> diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index e8c86b37db9..a252b361dcf 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -357,5 +357,3 @@ function measuring_units_string($unit,$measuring_style='') return $measuring_units[$unit]; } - -?> diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php index 60794497554..7d58e9e01b1 100644 --- a/htdocs/core/lib/trip.lib.php +++ b/htdocs/core/lib/trip.lib.php @@ -54,10 +54,8 @@ function trip_prepare_head($object) $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; - + complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove'); return $head; } - -?> \ No newline at end of file diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index d6097b6f5a1..75a78627f52 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -342,4 +342,3 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; } -?> diff --git a/htdocs/core/login/functions_empty.php b/htdocs/core/login/functions_empty.php index c96a5023d4d..e4379ee2c3a 100644 --- a/htdocs/core/login/functions_empty.php +++ b/htdocs/core/login/functions_empty.php @@ -39,5 +39,3 @@ function check_user_password_empty($usertotest,$passwordtotest,$entitytotest) return $login; } - -?> \ No newline at end of file diff --git a/htdocs/core/login/functions_forceuser.php b/htdocs/core/login/functions_forceuser.php index e74a253550a..94201c74ad0 100644 --- a/htdocs/core/login/functions_forceuser.php +++ b/htdocs/core/login/functions_forceuser.php @@ -46,6 +46,3 @@ function check_user_password_forceuser($usertotest,$passwordtotest,$entitytotest return $login; } - - -?> \ No newline at end of file diff --git a/htdocs/core/login/functions_http.php b/htdocs/core/login/functions_http.php index b224b27f15b..285ebebbabf 100644 --- a/htdocs/core/login/functions_http.php +++ b/htdocs/core/login/functions_http.php @@ -43,6 +43,3 @@ function check_user_password_http($usertotest,$passwordtotest,$entitytotest) return $login; } - - -?> \ No newline at end of file diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 403530ac80b..88a5f55de19 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -227,5 +227,3 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) return $login; } - -?> diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php index e183bc40795..2470567d596 100644 --- a/htdocs/core/login/functions_openid.php +++ b/htdocs/core/login/functions_openid.php @@ -112,5 +112,3 @@ function check_user_password_openid($usertotest,$passwordtotest,$entitytotest) return $login; } - -?> \ No newline at end of file diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 427a03d9929..e8d71496820 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -430,5 +430,3 @@ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexterna if (! $menuentry['perms']) return 2; // No permissions and user is external return 1; } - -?> diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 289862c8523..8e45f3b86f2 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -253,4 +253,3 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, } } -?> diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 54728df36d9..fd039efff24 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -131,7 +131,7 @@ else print $langs->trans("ErrorUnknown"); } + llxFooter(); $db->close(); -?> diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 4e1540c99e5..c432d37007b 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -190,7 +190,8 @@ print ''; dol_fiche_end(); + llxFooter(); $db->close(); -?> + diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 281ee374343..e0931bf5812 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -167,7 +167,7 @@ AccountancyDashboard=Accountancy summary ByProductsAndServices=By products and services RefExt=External ref ToCreateAPredefinedInvoice=To create a predefined invoice, create a standard invoice then, without validating it, click onto button "Convert to predefined invoice". -LinkedOrder=linked to order +LinkedOrder=Link to order ReCalculate=Recalculate Mode1=Method 1 Mode2=Method 2 diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index dd5ebf38573..65213cea647 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -968,5 +968,3 @@ class LivraisonLigne } } - -?> diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index c3c80a59b86..b2077c05bbf 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -25,14 +25,14 @@ /** * Returns an array with the tabs for the "Opensurvey poll" section * It loads tabs from modules looking for the entity Opensurveyso - * + * * @param Opensurveysondage $object Current viewing poll * @return array Tabs for the opensurvey section */ function opensurvey_prepare_head(Opensurveysondage $object) { - + global $langs, $conf; - + $h = 0; $head = array(); @@ -40,7 +40,7 @@ function opensurvey_prepare_head(Opensurveysondage $object) { $head[0][1] = $langs->trans("Card"); $head[0][2] = 'general'; $h++; - + $head[1][0] = 'results.php?id='.$object->id_sondage; $head[1][1] = $langs->trans("SurveyResults"); $head[1][2] = 'preview'; @@ -111,12 +111,12 @@ function showlogo() $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file=thumbs/'.urlencode($mysoc->logo_small); } } - + if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))) { $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; } - + print '
Logo
'; print '
'; } @@ -205,14 +205,14 @@ function dol_survey_random($car) function ajouter_sondage() { global $db, $user; - + require_once DOL_DOCUMENT_ROOT.'/opensurvey/class/opensurveysondage.class.php'; $sondage=dol_survey_random(16); $allow_comments = empty($_SESSION['allow_comments']) ? 0 : 1; $allow_spy = empty($_SESSION['allow_spy']) ? 0 : 1; - + // Insert survey $opensurveysondage = new Opensurveysondage($db); $opensurveysondage->id_sondage = $sondage; @@ -226,9 +226,9 @@ function ajouter_sondage() $opensurveysondage->allow_comments = $allow_comments; $opensurveysondage->allow_spy = $allow_spy; $opensurveysondage->sujet = $_SESSION['toutchoix']; - + $res = $opensurveysondage->create($user); - + if ($res < 0) { dol_print_error($db); } @@ -243,11 +243,10 @@ function ajouter_sondage() unset($_SESSION['toutchoix']); unset($_SESSION['totalchoixjour']); unset($_SESSION['champdatefin']); - + $urlback=dol_buildpath('/opensurvey/card.php',1).'?id='.$sondage; header("Location: ".$urlback); exit(); } -?> diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 00daab24b27..c5baba61242 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1083,4 +1083,3 @@ print '
'."\n"; llxFooterSurvey(); $db->close(); -?> diff --git a/htdocs/printipp/admin/printipp.php b/htdocs/printipp/admin/printipp.php index 08202b38f8e..6aaf44f8bdd 100644 --- a/htdocs/printipp/admin/printipp.php +++ b/htdocs/printipp/admin/printipp.php @@ -149,7 +149,7 @@ if ($mode == 'config' && $user->admin) print $langs->trans("PRINTIPP_PASSWORD").''; print ''; print ''; - + //$var=true; //print ''; //print ''.$langs->trans("OtherParameter").''; @@ -181,7 +181,7 @@ if ($mode == 'test' && $user->admin) print 'Media'; print 'Supported'; print "\n"; - + $list = $printer->getlist_available_printers(); $var = true; foreach ($list as $value) @@ -203,13 +203,13 @@ if ($mode == 'test' && $user->admin) print "\n"; } print ''; - + if (count($list) == 0) print $langs->trans("NoPrinterFound"); } dol_fiche_end(); + llxFooter(); $db->close(); -?> diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 32fbe2e2c00..de116453cf2 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -110,5 +110,3 @@ else { echo json_encode(array('nom'=>'ErrorBadParameter','label'=>'ErrorBadParameter','key'=>'ErrorBadParameter','value'=>'ErrorBadParameter')); } - -?> \ No newline at end of file diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 6f6cb067333..39f0dc761f8 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -706,4 +706,3 @@ abstract class ActionsCardCommon } -?> diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 2c83b4fdfc3..90c0d10e3fb 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -338,4 +338,3 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 451e886a761..8a2e3f57120 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -265,4 +265,3 @@ class CommandeTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index cbdde31e14d..a22146dfc2a 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -183,4 +183,3 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase return $result; } } -?> \ No newline at end of file diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 24d6ad03d80..693282e62c4 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -233,4 +233,4 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index efd5f54008f..53788d71dab 100755 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -257,4 +257,3 @@ class EntrepotTest extends PHPUnit_Framework_TestCase return; } } -?> \ No newline at end of file diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index d5938fc4691..641fe3b7f9e 100755 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -265,4 +265,4 @@ class ExportTest extends PHPUnit_Framework_TestCase return true; } } -?> + diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 7b5caffc2df..4d4783240fa 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -196,4 +196,3 @@ class FactureRecTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> \ No newline at end of file diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index cc54953875c..2227559ffd3 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -329,4 +329,4 @@ class FactureTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> + diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index dbb3f6d8b8d..78c2278ba69 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -799,4 +799,4 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 3cac847a01f..089b279f75c 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -265,4 +265,4 @@ class PropalTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 162248f2e98..97aa0f0a954 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -456,4 +456,4 @@ class SocieteTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index ef103eb1a46..e0eaa03acec 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -318,4 +318,3 @@ class UserTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> \ No newline at end of file diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 12c01eeba70..85c2398c568 100755 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -181,4 +181,4 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 8ef0c383955..bf7cdc357c0 100755 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -181,4 +181,4 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase } } -?> + From 4244979f4f55a9d29ac28eb260260c14cb865c37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2014 02:46:20 +0200 Subject: [PATCH 20/30] Fix: doxygen Fix: td balance --- htdocs/comm/action/peruser.php | 2 +- htdocs/core/lib/admin.lib.php | 9 +++++---- htdocs/core/modules/contract/mod_contract_olive.php | 6 +++--- htdocs/fichinter/card.php | 9 ++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index b85ac59c9a7..d66765b139b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -702,7 +702,7 @@ $db->close(); * @param int $year Year * @param int $monthshown Current month shown in calendar view * @param string $style Style to use for this day - * @param array &$eventarray Array of events + * @param array $eventarray Array of events * @param int $maxprint Nb of actions to show each day on month view (0 means no limit) * @param int $maxnbofchar Nb of characters to show for event line * @param string $newparam Parameters on current URL diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 370b3ff53eb..a3cf6acca32 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -853,15 +853,16 @@ function unActivateModule($value, $requiredby=1) * * @param array $taborder Taborder * @param array $tabname Tabname - * @param array $tablib Tablib - * @param array $tabsql Tabsql - * @param array $tabsqlsort Tabsqlsort + * @param array $tablib Tablib + * @param array $tabsql Tabsql + * @param array $tabsqlsort Tabsqlsort * @param array $tabfield Tabfield * @param array $tabfieldvalue Tabfieldvalue - * @param array $tabfieldinsert Tabfieldinsert + * @param array $tabfieldinsert Tabfieldinsert * @param array $tabrowid Tabrowid * @param array $tabcond Tabcond * @param array $tabhelp Tabhelp + * @param array $tabfieldcheck Tabfieldcheck * @return int 1 */ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp,&$tabfieldcheck) diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 2b10d520b25..6d22aebeb3d 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -43,7 +43,7 @@ class mod_contract_olive extends ModelNumRefContracts var $code_auto = 0; // Numerotation automatique - /** + /** * Return description of module * * @return string Description of module @@ -51,7 +51,7 @@ class mod_contract_olive extends ModelNumRefContracts function info() { global $langs; - + $langs->load("companies"); return $langs->trans("LeopardNumRefModelDesc"); } @@ -74,7 +74,7 @@ class mod_contract_olive extends ModelNumRefContracts * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $type 0 = product , 1 = service * @return int 0 if OK diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 1ade8eddf13..e5d4aa96856 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1216,7 +1216,6 @@ else if ($id > 0 || ! empty($ref)) print ''; if ($action == 'edit_extras') print ''; if ($action == 'contrat') print ''; - print ''; print ''; @@ -1224,18 +1223,18 @@ else if ($id > 0 || ! empty($ref)) $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''; // Third party - print ""; + print ""; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { // Duration print ''; - print ''; + print ''; print ''; } @@ -1326,7 +1325,7 @@ else if ($id > 0 || ! empty($ref)) } // Statut - print ''; + print ''; // Other attributes (TODO Move this into an include) $parameters=array('colspan' => ' colspan="3"'); From ec95aacd52f3e310b053a12b2b2a8f6e2c3556ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2014 03:41:32 +0200 Subject: [PATCH 21/30] Uniformize code for error reporting after a hook. --- dev/skeletons/skeleton_page.php | 18 ++++++++------- htdocs/adherents/card.php | 1 + htdocs/categories/categorie.php | 2 +- htdocs/comm/card.php | 1 + htdocs/comm/list.php | 3 ++- htdocs/comm/mailing/card.php | 1 + htdocs/comm/propal.php | 4 ++-- htdocs/comm/propal/list.php | 1 + htdocs/comm/prospect/list.php | 1 + htdocs/commande/card.php | 1 + htdocs/commande/list.php | 3 ++- htdocs/compta/facture.php | 1 + htdocs/compta/facture/list.php | 1 + htdocs/compta/paiement.php | 3 +++ htdocs/contact/card.php | 14 +++++------ htdocs/expedition/card.php | 1 + htdocs/fichinter/card.php | 5 +++- htdocs/fourn/card.php | 1 + htdocs/fourn/commande/card.php | 1 + htdocs/fourn/facture/card.php | 1 + htdocs/fourn/facture/paiement.php | 3 +++ htdocs/fourn/list.php | 1 + htdocs/product/card.php | 2 +- htdocs/product/document.php | 3 ++- htdocs/product/fournisseurs.php | 8 ++----- htdocs/product/stats/commande.php | 7 +++--- htdocs/product/stats/commande_fournisseur.php | 11 +++++---- htdocs/product/stats/contrat.php | 3 ++- htdocs/product/stats/facture.php | 6 +++-- htdocs/product/stats/facture_fournisseur.php | 8 +++---- htdocs/product/stats/propal.php | 7 +++--- htdocs/projet/card.php | 2 +- htdocs/resource/card.php | 19 +++++++-------- htdocs/resource/element_resource.php | 3 ++- htdocs/resource/list.php | 23 +++++++++++-------- htdocs/societe/agenda.php | 3 +-- htdocs/societe/commerciaux.php | 6 ++--- htdocs/societe/info.php | 2 +- htdocs/societe/soc.php | 2 +- 39 files changed, 108 insertions(+), 75 deletions(-) diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 67d6298863a..deaecd95526 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -114,8 +114,8 @@ if ($action == 'add') } { // Creation KO - if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); - else setEventMessage($object->error, 'errors'); + if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); $action='create'; } } @@ -139,7 +139,7 @@ if ($action == 'update' && ! GETPOST('cancel')) if (empty($object->ref)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); } if (! $error) @@ -152,8 +152,8 @@ if ($action == 'update' && ! GETPOST('cancel')) else { // Creation KO - if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); - else setEventMessage($object->error, 'errors'); + if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); $action='edit'; } } @@ -170,14 +170,14 @@ if ($action == 'confirm_delete') if ($result > 0) { // Delete OK - setEventMessage($langs->trans("RecordDeleted")); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); exit; } else { - if (! empty($object->errors)) setEventMessage($object->errors,'errors'); - else setEventMessage($object->error,'errors'); + if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors'); + else setEventMessages($object->error,null,'errors'); } } @@ -327,6 +327,8 @@ if ($id && (empty($action) || $action == 'view')) print '
'."\n"; $parameters=array(); $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) { if ($user->rights->mymodule->write) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 3b1f61df5b5..1c9de056acc 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -117,6 +117,7 @@ $hookmanager->initHooks(array('membercard')); $parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas); $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'); if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) { diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index a21f7a53699..d1fe7848564 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -102,7 +102,7 @@ $hookmanager->initHooks(array('categorycard')); $parameters=array('id'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 5ad90cd24de..f1d27b791e6 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -78,6 +78,7 @@ $object = new Societe($db); $parameters = array('socid' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($action == 'setcustomeraccountancycode') diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 18f03f28ca9..ac354d4d08d 100644 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -73,6 +73,7 @@ $hookmanager->initHooks(array('customerlist')); $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) @@ -269,7 +270,7 @@ if ($result) print '
'; print ''; - + $parameters=array('obj' => $obj); $formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 441e51ef293..efff271a08c 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -101,6 +101,7 @@ $object->substitutionarrayfortest=array( $parameters=array(); $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'); // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes') diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 3eac57a64b4..19be47d5b5f 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -105,8 +105,8 @@ $permissionnote = $user->rights->propale->creer; // Used by the include of actio */ $parameters = array('socid' => $socid); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some - // hooks +$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'); include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4b43eadeebf..51c07eaa5b2 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -91,6 +91,7 @@ $hookmanager->initHooks(array('propallist')); $parameters=array('socid'=>$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'); // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 6e138c1153c..7dada3e115f 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -161,6 +161,7 @@ $hookmanager->initHooks(array('prospectlist')); $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($action == 'cstc') { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3119205fda8..6c8c54791bf 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -100,6 +100,7 @@ $permissionnote = $user->rights->commande->creer; // Used by the include of acti $parameters = array('socid' => $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'); include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d699192acbf..0010195605c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -78,6 +78,7 @@ $hookmanager->initHooks(array('orderlist')); $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) @@ -423,7 +424,7 @@ if ($resql) print ''."\n"; print '
'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'
'; - + $db->free($resql); } else diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 00c927bad99..c5d341c0e27 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -111,6 +111,7 @@ $permissionnote = $user->rights->facture->creer; // Used by the include of actio $parameters = array('socid' => $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'); include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f5dbd8186cd..07ebfa5ad7d 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -108,6 +108,7 @@ $now=dol_now(); $parameters=array('socid'=>$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'); // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index cabaf87e4d0..c7af3458fcb 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -71,10 +71,13 @@ $hookmanager->initHooks(array('paiementcard')); $parameters=array('socid'=>$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'); + /* * Actions */ + if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes')) { $error = 0; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index ce607091267..f4d42dbaca0 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -83,7 +83,7 @@ $hookmanager->initHooks(array('contactcard')); $parameters=array('id'=>$id, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { @@ -142,10 +142,10 @@ if (empty($reshook)) { setEventMessage($object->error,'errors'); } - else + else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; + exit; } } @@ -157,11 +157,11 @@ if (empty($reshook)) { setEventMessage($object->error,'errors'); } - else + else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } + exit; + } } // Add contact @@ -380,7 +380,7 @@ else $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); dol_fiche_head($head, 'card', $title, 0, 'contact'); - + dol_htmloutput_events(); } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b0c6991dcf3..ade0014708d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -88,6 +88,7 @@ $hookmanager->initHooks(array('expeditioncard')); */ $parameters=array(); $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'); if ($action == 'add') { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e5d4aa96856..bcc50d32aca 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -97,9 +97,12 @@ $permissionnote=$user->rights->ficheinter->creer; // Used by the include of acti /* * Actions */ + $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 313f82547e7..c31dc5525f7 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -54,6 +54,7 @@ $object = new Fournisseur($db); $parameters=array('socid'=>$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'); if ($action == 'setsupplieraccountancycode') { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 72cc500e187..2591bba4838 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -110,6 +110,7 @@ $permissionnote=$user->rights->fournisseur->commande->creer; // Used by the incl $parameters=array('socid'=>$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'); include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ff1e713384a..c9926cd59dd 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -88,6 +88,7 @@ $permissionnote=$user->rights->fournisseur->facture->creer; // Used by the inclu $parameters=array('socid'=>$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'); include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index adc62ee4cd8..302570330b7 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -68,10 +68,13 @@ $hookmanager->initHooks(array('paymentsupplier')); $parameters=array('socid'=>$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'); + /* * Actions */ + if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes')) { $error = 0; diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php index 571c4a9925c..e3c7effebbf 100644 --- a/htdocs/fourn/list.php +++ b/htdocs/fourn/list.php @@ -66,6 +66,7 @@ $hookmanager->initHooks(array('supplierlist')); $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 1ddc6dac50b..28b0db5efe9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -101,7 +101,7 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barc $parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=$hookmanager->errors; +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 1e8c7b7cd9a..6ca92968e8d 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -75,6 +75,7 @@ $modulepart='produit'; $parameters=array('id'=>$id); $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'); /* @@ -101,7 +102,7 @@ if ($object->id) dol_fiche_head($head, 'documents', $titre, 0, $picto); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 037bb2b1f8b..8720c9cf892 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -64,10 +64,6 @@ $hookmanager->initHooks(array('pricesuppliercard')); $product = new ProductFournisseur($db); $product->fetch($id,$ref); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=$hookmanager->errors; - - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -80,8 +76,8 @@ if (! $sortorder) $sortorder="ASC"; */ $parameters=array('socid'=>$socid, 'id_prod'=>$id); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($action == 'remove_pf') { diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 82483d59805..bf96d63459e 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -67,10 +67,10 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=$hookmanager->errors; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -83,8 +83,9 @@ if ($id > 0 || ! empty($ref)) $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); - + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
".$langs->trans("Company")."".$object->client->getNomUrl(1)."
".$langs->trans("Company").''.$object->client->getNomUrl(1)."
'.$langs->trans("TotalDuration").''.convertSecondToTime($object->duree, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).''.convertSecondToTime($object->duree, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$thirdpartystatic->getLibStatut(3); print '
'; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index f9056187cec..93c880695d3 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -67,10 +67,10 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=$hookmanager->errors; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -80,8 +80,9 @@ if ($id > 0 || ! empty($ref)) $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); - + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); print '
'; @@ -147,7 +148,7 @@ if ($id > 0 || ! empty($ref)) print "\n"; $commandestatic=new CommandeFournisseur($db); - + if ($num > 0) { $var=True; @@ -155,7 +156,7 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); $var=!$var; - + $commandestatic->id=$objp->commandeid; $commandestatic->ref=$objp->ref; $commandestatic->statut=$objp->statut; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 60d3b9b50c8..6c73d0183fa 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -73,7 +73,7 @@ if ($id > 0 || ! empty($ref)) $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=$hookmanager->errors; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -85,6 +85,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'referers', $titre, 0, $picto); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); print '
'; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 376263e122d..1959d53035e 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -72,9 +72,10 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -87,8 +88,9 @@ if ($id > 0 || ! empty($ref)) $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); - + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); print '
'; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 2f1d37602ce..1b07ce3d1ba 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -72,10 +72,10 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=$hookmanager->errors; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -88,9 +88,9 @@ if ($id > 0 || ! empty($ref)) $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); - - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); print '
'; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index ad81e93e299..3368efa2b56 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -66,9 +66,10 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -78,9 +79,9 @@ if ($id > 0 || ! empty($ref)) $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'referers', $titre,0,$picto); - - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); print '
'; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6be174a1dd4..273784faf92 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -74,7 +74,7 @@ $date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendd $parameters=array('id'=>$socid, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 38562557e3a..ed48f7e1b04 100755 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -60,6 +60,7 @@ $object = new Resource($db); $hookmanager->initHooks(array('resource_card')); $parameters=array('resource_id'=>$id); $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'); /******************************************************************* @@ -86,7 +87,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write $object->ref = $ref; $object->description = $description; $object->fk_code_type_resource = $fk_code_type_resource; - + $result=$object->update($user); if ($result > 0) { @@ -98,9 +99,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write setEventMessage('
'.$object->error.'
'); $action='edit'; } - + } - else + else { setEventMessage($object->error,'errors'); $action='edit'; @@ -149,13 +150,13 @@ if ( $object->fetch($id) > 0 ) // Ref print ''; print ''; - + // Type print ''; print ''; - + // Description print ''; print ''; print ''; - + // Description print ''; print ''; @@ -215,8 +216,8 @@ if ( $object->fetch($id) > 0 ) $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook - if (empty($reshook)) - { + if (empty($reshook)) + { if ($action != "edit" ) { // Edit resource diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index c5329edd1f3..02a24735454 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -138,11 +138,12 @@ if ($action == 'confirm_delete_linked_resource' && $user->rights->resource->dele $parameters=array('resource_id'=>resource_id); $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'); $parameters=array('resource_id'=>$resource_id); $reshook=$hookmanager->executeHooks('getElementResources',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /*************************************************** diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 3fde7b52999..9a0fca19781 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -53,9 +53,6 @@ $object = new Resource($db); $hookmanager->initHooks(array('resource_list')); -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (empty($sortorder)) $sortorder="DESC"; if (empty($sortfield)) $sortfield="t.rowid"; if (empty($arch)) $arch = 0; @@ -72,12 +69,20 @@ $pagenext = $page + 1; if( ! $user->rights->resource->read) accessforbidden(); -/*************************************************** - * VIEW -* -* Put here all code to build page -****************************************************/ +/* + * Action + */ + +$parameters=array(); +$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 + */ $pagetitle=$langs->trans('ResourcePageIndex'); llxHeader('',$pagetitle,''); @@ -129,7 +134,7 @@ else print ''; - + print ''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index b25129580ff..742039176b8 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -47,8 +47,7 @@ $hookmanager->initHooks(array('agendathirdparty')); $parameters=array('id'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); - +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 14eab2ee038..5436e03274b 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -57,8 +57,7 @@ if($_GET["socid"] && $_GET["commid"]) $parameters=array('id'=>$_GET["commid"]); $reshook=$hookmanager->executeHooks('doActions',$parameters,$soc,$action); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); - + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]); @@ -84,8 +83,7 @@ if($_GET["socid"] && $_GET["delcommid"]) $parameters=array('id'=>$_GET["delcommid"]); $reshook=$hookmanager->executeHooks('doActions',$parameters,$soc,$action); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); - + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]); diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 446a4f415fb..305936e6f56 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -48,7 +48,7 @@ $hookmanager->initHooks(array('infothirdparty')); $parameters=array('id'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cf801c0b3dd..e45ce6eee7b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -86,7 +86,7 @@ $hookmanager->initHooks(array('thirdpartycard')); $parameters=array('id'=>$socid, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { From 0997a7960de65df903263506e0d944a6c2cf2069 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 28 Sep 2014 12:52:35 +0200 Subject: [PATCH 22/30] Fix: uniformize code --- htdocs/admin/commande.php | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 1d05efa8e99..e5b2e5e6b1d 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Andre Cianfarani - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2013 Philippe Grand @@ -117,6 +117,35 @@ else if ($action == 'specimen') } } +// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) +if ($action == 'setModuleOptions') +{ + $post_size=count($_POST); + + $db->begin(); + + for($i=0;$i < $post_size;$i++) + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); + } +} + // Activate a model if ($action == 'set') { @@ -192,14 +221,6 @@ else if ($action == 'set_COMMANDE_FREE_TEXT') setEventMessage($langs->trans("Error"),'errors'); } } -else if ($action=='setModuleOptions') { - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) - { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1'); - } -} /* From f527602753c1f2b2fd43ae65aee6e9913432359d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 28 Sep 2014 13:12:04 +0200 Subject: [PATCH 23/30] Fix: use specific css style instead, this causes a shift problem --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2658f292913..8b6b656417e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2830,8 +2830,8 @@ class Form } else if ($input['type'] == 'select') { - $more.=''."\n"; } From 52340e9176aa011feaf37db5a62816bbd1308c79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2014 14:18:04 +0200 Subject: [PATCH 24/30] Fix: Missing fields into select --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fa7130ec018..773fdb48b0f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -310,7 +310,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_element, a.elementtype,"; - $sql.= " a.priority, a.fulldayevent, a.location, a.transparency,"; + $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle,"; $sql.= " s.nom as socname,"; $sql.= " u.firstname, u.lastname as lastname"; @@ -961,7 +961,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_element, a.elementtype,"; - $sql.= " a.priority, a.fulldayevent, a.location,"; + $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " u.firstname, u.lastname,"; $sql.= " s.nom as socname,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle"; From eea034e0e5dce82b20d4a86a6382a7ac1910a5ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2014 15:33:13 +0200 Subject: [PATCH 25/30] Fix: 1 second missing into lastdaytoshow. --- htdocs/comm/action/index.php | 24 ++++++++++++------------ htdocs/comm/action/peruser.php | 21 ++++++++------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 8f3d82f5f9b..24502897ec1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -218,9 +218,9 @@ if (empty($action) || $action=='show_month') $tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2; $tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1); if ($tmpday >= 1) $tmpday -= 7; - // Define firstdaytoshow and lastdaytoshow + // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year); - $next_day=7-($max_day_in_month+1-$tmpday)%7; + $next_day=7 - ($max_day_in_month+1-$tmpday) % 7; if ($next_day < 6) $next_day+=7; $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); } @@ -242,9 +242,9 @@ if ($action=='show_week') $next_month = $next['month']; $next_day = $next['day']; - // Define firstdaytoshow and lastdaytoshow + // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); - $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); + $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd'); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); @@ -261,7 +261,7 @@ if ($action == 'show_day') $next_month = $next['month']; $next_day = $next['day']; - // Define firstdaytoshow and lastdaytoshow + // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$prev_day,$prev_year); $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); } @@ -522,14 +522,14 @@ if ($resql) // Check values if ($event->date_end_in_calendar < $firstdaytoshow || - $event->date_start_in_calendar > $lastdaytoshow) + $event->date_start_in_calendar >= $lastdaytoshow) { // This record is out of visible range } else { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1); // Add an entry in actionarray for each day $daycursor=$event->date_start_in_calendar; @@ -659,7 +659,7 @@ if (count($listofextcals)) if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event { //if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1); if ($icalevent['DTSTART;VALUE=DATE']) //fullday event { $datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1); @@ -698,10 +698,10 @@ if (count($listofextcals)) $until=empty($icalevent['RRULE']['UNTIL'])?0:dol_stringtotime($icalevent['RRULE']['UNTIL'],1); $maxrepeat=empty($icalevent['RRULE']['COUNT'])?0:$icalevent['RRULE']['COUNT']; if ($until && ($until+($datecurend-$datecurstart)) < $firstdaytoshow) continue; // We discard repeatable event that end before start date to show - if ($datecurstart > $lastdaytoshow) continue; // We discard repeatable event that start after end date to show + if ($datecurstart >= $lastdaytoshow) continue; // We discard repeatable event that start after end date to show $numofevent=0; - while (($datecurstart <= $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) + while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) { if ($datecurend >= $firstdaytoshow) // We add event { @@ -833,7 +833,7 @@ if (count($listofextcals)) } // Add event into $eventarray if date range are ok. - if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow) + if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow) { //print 'x'.$datestart.'-'.$dateend;exit; //print 'x'.$datestart.'-'.$dateend;exit; @@ -843,7 +843,7 @@ if (count($listofextcals)) else { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1); // Add an entry in actionarray for each day $daycursor=$event->date_start_in_calendar; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index d66765b139b..a8629f57d68 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -179,17 +179,11 @@ $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; -// Define firstdaytoshow and lastdaytoshow -$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); -$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); - $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $tmpday = $first_day; //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; -//print dol_print_date($firstdaytoshow,'day'); -//print dol_print_date($lastdaytoshow,'day'); $title=$langs->trans("DoneAndToDoActions"); if ($status == 'done') $title=$langs->trans("DoneActions"); @@ -225,9 +219,11 @@ $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; -// Define firstdaytoshow and lastdaytoshow +// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); -$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); +$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd'); +//print dol_print_date($firstdaytoshow,'dayhour'); +//print dol_print_date($lastdaytoshow,'dayhour'); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); @@ -440,14 +436,14 @@ if ($resql) // Check values if ($event->date_end_in_calendar < $firstdaytoshow || - $event->date_start_in_calendar > $lastdaytoshow) + $event->date_start_in_calendar >= $lastdaytoshow) { // This record is out of visible range } else { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1); // Add an entry in actionarray for each day $daycursor=$event->date_start_in_calendar; @@ -459,7 +455,7 @@ if ($resql) $loop=true; $j=0; $daykey=dol_mktime(0,0,0,$mois,$jour,$annee); do - { + { //if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
'; $eventarray[$daykey][]=$event; @@ -482,7 +478,6 @@ else dol_print_error($db); } - $maxnbofchar=18; $cachethirdparties=array(); $cachecontacts=array(); @@ -647,7 +642,7 @@ foreach ($usernames as $username) } echo "
'.$langs->trans("ResourceFormLabel_ref").'
'.$langs->trans("ResourceType").''; - $ret = $formresource->select_types_resource($object->fk_code_type_resource,'fk_code_type_resource','',2); + $ret = $formresource->select_types_resource($object->fk_code_type_resource,'fk_code_type_resource','',2); print '
'.$langs->trans("Description").''; @@ -194,7 +195,7 @@ if ( $object->fetch($id) > 0 ) print $object->type_label; print '
' . $langs->trans("ResourceFormLabel_description") . ''; print $resource->ref; print ''; print $resource->type_label; print '
'; - if (! empty($input['label'])) $more.=$input['label'].''; + $more.='
'; + if (! empty($input['label'])) $more.=$input['label'].''; $more.=$this->selectarray($input['name'],$input['values'],$input['default'],1); $more.='
\n"; - +var_dump($eventarray);exit; // Add js code to manage click on a box print '