From 59f99c416b8307a8d6ca6aa19fa7455f0054e566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Wed, 26 Jun 2013 15:19:02 +0200 Subject: [PATCH 1/4] CRLF to LF --- htdocs/paybox/admin/paybox.php | 30 +++++++++++++++--------------- htdocs/paypal/admin/paypal.php | 12 ++++++------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index c55574d363a..0871aaf71e0 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -61,8 +61,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYBOX_MESSAGE_KO",GETPOST('PAYBOX_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_PAYONLINE_SENDEMAIL",GETPOST('PAYBOX_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); - if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYBOX_PAYONLINE_SENDEMAIL",GETPOST('PAYBOX_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; if (! $error) { @@ -93,12 +93,12 @@ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'setup'); -$h = 0; -$head = array(); - -$head[$h][0] = DOL_URL_ROOT."/paybox/admin/paybox.php"; -$head[$h][1] = $langs->trans("Account"); -$head[$h][2] = 'payboxaccount'; +$h = 0; +$head = array(); + +$head[$h][0] = DOL_URL_ROOT."/paybox/admin/paybox.php"; +$head[$h][1] = $langs->trans("Account"); +$head[$h][2] = 'payboxaccount'; $h++; dol_fiche_head($head, 'payboxaccount', ''); @@ -198,17 +198,17 @@ $doleditor=new DolEditor('PAYBOX_MESSAGE_KO',$conf->global->PAYBOX_MESSAGE_KO,'' $doleditor->Create(); print ''; -$var=!$var; -print ''; -print $langs->trans("PAYBOX_PAYONLINE_SENDEMAIL").''; -print ''; -print '   '.$langs->trans("Example").': myemail@myserver.com'; -print ''; +$var=!$var; +print ''; +print $langs->trans("PAYBOX_PAYONLINE_SENDEMAIL").''; +print ''; +print '   '.$langs->trans("Example").': myemail@myserver.com'; +print ''; print '
'; print ''; -dol_fiche_end(); +dol_fiche_end(); print '

'; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 998f724dc68..c91e2ff0c80 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -67,8 +67,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_KO",GETPOST('PAYPAL_MESSAGE_KO'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_PAYONLINE_SENDEMAIL",GETPOST('PAYPAL_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); - if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYPAL_PAYONLINE_SENDEMAIL",GETPOST('PAYPAL_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; if (! $error) { @@ -203,12 +203,12 @@ $doleditor=new DolEditor('PAYPAL_MESSAGE_KO',$conf->global->PAYPAL_MESSAGE_KO,'' $doleditor->Create(); print ''; -$var=!$var; -print ''; -print $langs->trans("PAYPAL_PAYONLINE_SENDEMAIL").''; +$var=!$var; +print ''; +print $langs->trans("PAYPAL_PAYONLINE_SENDEMAIL").''; print ''; print '   '.$langs->trans("Example").': myemail@myserver.com'; -print ''; +print ''; $var=true; print ''; From df94f3816c7a0058d343ba174efeac030f8650e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Thu, 20 Jun 2013 17:01:30 +0200 Subject: [PATCH 2/4] add hook to add line options in html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d33f8546f8a..082080a0316 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -529,6 +529,7 @@ class FormFile $out.= ($param?'&'.$param:''); $out.= '">'.img_printer().''; } + if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); } $out.= ''; From bfedddd95ec5ba8420380bc1bd18dcef349d1f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Thu, 20 Jun 2013 19:01:32 +0200 Subject: [PATCH 3/4] init hook --- htdocs/core/class/html.formfile.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 082080a0316..8d8022a0264 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -207,7 +207,7 @@ class FormFile return $this->getDocumentsLink($modulepart, $filename, $filedir); } $printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false; - + $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; $var=true; @@ -450,9 +450,7 @@ class FormFile $langs->load("errors"); $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } - if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; - $out.= $genbutton; $out.= ''; From 117ddbdff2acfa4a95f3d568dc6e0f25f7b16105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Wed, 26 Jun 2013 11:09:03 +0200 Subject: [PATCH 4/4] add columns if active hooks use the formBuilddocLineOptions method --- htdocs/core/class/html.formfile.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8d8022a0264..0d2e3163be6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -455,7 +455,13 @@ class FormFile $out.= ''; if ($printer) $out.= ''; - + if($hookmanager->hooks['formfile']) + { + foreach($hookmanager->hooks['formfile'] as $module) + { + if(method_exists($module, 'formBuilddocLineOptions')) $out .= ''; + } + } $out.= ''; // Execute hooks