From 8bc68959e1b639cc5c07b24f79a34e667778aed4 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 21 Jun 2013 11:23:53 +0200 Subject: [PATCH 01/11] Merge modif --- htdocs/product/liste.php | 2 +- .../societe/class/companybankaccount.class.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index a8ca8521a65..5c312886313 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -36,7 +36,7 @@ if (! empty($conf->categorie->enabled)) $langs->load("products"); $langs->load("stocks"); -$langs->load("suppliers"); +$langs->load("suppliers"); $action = GETPOST('action'); $sref=GETPOST("sref"); diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 5a18c9b9bcc..ce637588d8a 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -196,15 +196,15 @@ class CompanyBankAccount extends Account { global $langs; - if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib) - { - $rib = $this->code_banque." ".$this->code_guichet." ".$this->number; - $rib.=($this->cle_rib?" (".$this->cle_rib.")":""); - } - else - { - $rib=$langs->trans("NoRIB"); - } + if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib) + { + $rib = $this->code_banque." ".$this->code_guichet." ".$this->number; + $rib.=($this->cle_rib?" (".$this->cle_rib.")":""); + } + else + { + $rib=$langs->trans("NoRIB"); + } return $rib; } From d6a7a0ed71d8438e2d3efe13497328ad70286ed8 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 21 Jun 2013 15:14:32 +0200 Subject: [PATCH 02/11] Commit --- htdocs/adherents/index.php | 2 +- htdocs/comm/action/index.php | 2 +- .../class/bonprelevement.class.php | 4 +- htdocs/core/lib/functions2.lib.php | 154 +++++++++--------- 4 files changed, 81 insertions(+), 81 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 6c0b0dc4019..fd10d0e14de 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php'; $langs->load("companies"); $langs->load("members"); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 165101e3cfa..7facb9b5459 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -971,7 +971,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { - $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a1ac8052222..54439aea9a3 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -795,7 +795,7 @@ class BonPrelevement extends CommonObject { require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; $soc = new Societe($this->db); - $bac = new CompanyBankAccount($this->db); + $bac = new CompanyBankAccount($this->db); // Check RIB $i = 0; @@ -810,7 +810,7 @@ class BonPrelevement extends CommonObject { if ($soc->fetch($fact->socid) >= 0) { - $bac->fetch(0,$soc->id); + $bac->fetch(0,$soc->id); if ($bac->verif() >= 1) { $factures_prev[$i] = $fac; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 469b9f2ac94..eac148deaa4 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1423,87 +1423,87 @@ function getSoapParams() return $params; } - -/** - * List urls of element - * - * @param int $objectid Id of record - * @param string $objecttype Type of object ('invoice', 'order', 'expedition_bon', ...) - * @param int $withpicto Picto to show - * @param string $option More options - * @return string URL of link to object id/type - */ -function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') -{ - global $db,$conf; + +/** + * List urls of element + * + * @param int $objectid Id of record + * @param string $objecttype Type of object ('invoice', 'order', 'expedition_bon', ...) + * @param int $withpicto Picto to show + * @param string $option More options + * @return string URL of link to object id/type + */ +function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') +{ + global $db,$conf; $ret=''; - - // Parse element/subelement (ex: project_task) - $module = $element = $subelement = $objecttype; - if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs)) - { - $module = $element = $regs[1]; - $subelement = $regs[2]; - } - - $classpath = $element.'/class'; - - // To work with non standard path - if ($objecttype == 'facture' || $objecttype == 'invoice') { - $classpath = 'compta/facture/class'; $module='facture'; $subelement='facture'; - } - if ($objecttype == 'commande' || $objecttype == 'order') { - $classpath = 'commande/class'; $module='commande'; $subelement='commande'; - } - if ($objecttype == 'propal') { - $classpath = 'comm/propal/class'; - } - if ($objecttype == 'shipping') { - $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; - } - if ($objecttype == 'delivery') { - $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; - } - if ($objecttype == 'invoice_supplier') { - $classpath = 'fourn/class'; - } - if ($objecttype == 'order_supplier') { - $classpath = 'fourn/class'; - } - if ($objecttype == 'contract') { - $classpath = 'contrat/class'; $module='contrat'; $subelement='contrat'; - } - if ($objecttype == 'member') { - $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent'; - } - if ($objecttype == 'cabinetmed_cons') { - $classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons'; - } - if ($objecttype == 'fichinter') { - $classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter'; - } - - //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; - - $classfile = strtolower($subelement); $classname = ucfirst($subelement); - if ($objecttype == 'invoice_supplier') { - $classfile = 'fournisseur.facture'; $classname='FactureFournisseur'; - } - if ($objecttype == 'order_supplier') { - $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur'; - } - - if (! empty($conf->$module->enabled)) - { - $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); - if ($res) - { - $object = new $classname($db); - $res=$object->fetch($objectid); + + // Parse element/subelement (ex: project_task) + $module = $element = $subelement = $objecttype; + if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs)) + { + $module = $element = $regs[1]; + $subelement = $regs[2]; + } + + $classpath = $element.'/class'; + + // To work with non standard path + if ($objecttype == 'facture' || $objecttype == 'invoice') { + $classpath = 'compta/facture/class'; $module='facture'; $subelement='facture'; + } + if ($objecttype == 'commande' || $objecttype == 'order') { + $classpath = 'commande/class'; $module='commande'; $subelement='commande'; + } + if ($objecttype == 'propal') { + $classpath = 'comm/propal/class'; + } + if ($objecttype == 'shipping') { + $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; + } + if ($objecttype == 'delivery') { + $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; + } + if ($objecttype == 'invoice_supplier') { + $classpath = 'fourn/class'; + } + if ($objecttype == 'order_supplier') { + $classpath = 'fourn/class'; + } + if ($objecttype == 'contract') { + $classpath = 'contrat/class'; $module='contrat'; $subelement='contrat'; + } + if ($objecttype == 'member') { + $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent'; + } + if ($objecttype == 'cabinetmed_cons') { + $classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons'; + } + if ($objecttype == 'fichinter') { + $classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter'; + } + + //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; + + $classfile = strtolower($subelement); $classname = ucfirst($subelement); + if ($objecttype == 'invoice_supplier') { + $classfile = 'fournisseur.facture'; $classname='FactureFournisseur'; + } + if ($objecttype == 'order_supplier') { + $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur'; + } + + if (! empty($conf->$module->enabled)) + { + $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); + if ($res) + { + $object = new $classname($db); + $res=$object->fetch($objectid); if ($res > 0) $ret=$object->getNomUrl($withpicto,$option); unset($object); } } - return $ret; + return $ret; } \ No newline at end of file From 0d3b7f1a0f88eca590e50adb56969c1d4773ec6d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 24 Jun 2013 10:01:23 +0200 Subject: [PATCH 03/11] merge --- htdocs/compta/bank/account.php | 2 +- htdocs/core/lib/cron.lib.php | 92 +++++++++---------- htdocs/cron/card.php | 2 +- htdocs/cron/list.php | 10 +- htdocs/main.inc.php | 22 ++--- htdocs/opensurvey/public/index.php | 10 +- htdocs/public/cron/cron_run_jobs.php | 14 +-- htdocs/theme/bureau2crea/style.css.php | 6 +- .../email_expire_services_to_customers.php | 10 +- ...ail_expire_services_to_representatives.php | 10 +- .../email_unpaid_invoices_to_customers.php | 4 +- 11 files changed, 91 insertions(+), 91 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 80b71d1d919..ac36247fdba 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -762,7 +762,7 @@ if ($id > 0 || ! empty($ref)) print ""; - print "\n"; + print "\n"; dol_fiche_end(); diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index b66060e3607..4a81457afe1 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -75,53 +75,53 @@ function cron_prepare_head($object) return $head; } - -/** - * Show information with URLs to launch jobs - * - * @return int 0 - */ -function dol_print_cron_urls() -{ - global $conf, $langs, $user; - global $dolibarr_main_url_root; - - // Define $urlwithroot - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - - // Cron launch - print ''.$langs->trans("URLToLaunchCronJobs").':
'; - $url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login; - print img_picto('','object_globe.png').' '.$url."
\n"; - print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; - $url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; - print img_picto('','object_globe.png').' '.$url."
\n"; - print '
'; - - - print ''.$langs->trans("FileToLaunchCronJobs").':
'; - - $file='/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$user->login.' [cronjobid]'; - print '
\n"; - print '
'; + +/** + * Show information with URLs to launch jobs + * + * @return int 0 + */ +function dol_print_cron_urls() +{ + global $conf, $langs, $user; + global $dolibarr_main_url_root; + + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + // Cron launch + print ''.$langs->trans("URLToLaunchCronJobs").':
'; + $url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login; + print img_picto('','object_globe.png').' '.$url."
\n"; + print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; + $url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; + print img_picto('','object_globe.png').' '.$url."
\n"; + print '
'; + + + print ''.$langs->trans("FileToLaunchCronJobs").':
'; + + $file='/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$user->login.' [cronjobid]'; + print '
\n"; + print '
'; // Add note - $linuxlike=1; - if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; - if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; - print $langs->trans("Note").': '; - if ($linuxlike) - { - print $langs->trans("CronExplainHowToRunUnix"); - } - else - { - print $langs->trans("CronExplainHowToRunWin"); - } - - return 0; -} + $linuxlike=1; + if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; + if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; + print $langs->trans("Note").': '; + if ($linuxlike) + { + print $langs->trans("CronExplainHowToRunUnix"); + } + else + { + print $langs->trans("CronExplainHowToRunWin"); + } + + return 0; +} diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 2cdd27862b3..bad9171d5d4 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -456,7 +456,7 @@ if (($action=="create") || ($action=="edit")) print ""; print "\n"; - print ''; + print ''; print '

'; print ''; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 09e1f2fb1a8..7eb253c9ade 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -144,8 +144,8 @@ if ($result < 0) print "

"; -print '
'."\n"; -print ''; +print ''."\n"; +print ''; print ''; print ''; @@ -190,8 +190,8 @@ print ''; print ''; -if (count($object->lines) > 0) -{ +if (count($object->lines) > 0) +{ // Loop on each active job $style='impair'; foreach($object->lines as $line) @@ -291,7 +291,7 @@ else print '
'; -print ''; +print ''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9c942cf2b99..e4a22c97285 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -679,7 +679,7 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme','alpha',1); $conf->css = "/theme/".$conf->theme."/style.css.php"; } - + // Set javascript option if (! GETPOST('nojs')) // If javascript was not disabled on URL @@ -703,18 +703,18 @@ if (! empty($conf->browser->phone)) $conf->dol_no_mouse_hover=1; } -// Disabled bugged themes -if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) -{ - $conf->theme='eldy'; - $conf->css = "/theme/".$conf->theme."/style.css.php"; +// Disabled bugged themes +if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) +{ + $conf->theme='eldy'; + $conf->css = "/theme/".$conf->theme."/style.css.php"; } -// Disabled bugged themes -if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) -{ - $conf->theme='eldy'; - $conf->css = "/theme/".$conf->theme."/style.css.php"; +// Disabled bugged themes +if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) +{ + $conf->theme='eldy'; + $conf->css = "/theme/".$conf->theme."/style.css.php"; } if (! defined('NOREQUIRETRAN')) diff --git a/htdocs/opensurvey/public/index.php b/htdocs/opensurvey/public/index.php index 73e7c672e20..2c78a86cb9d 100755 --- a/htdocs/opensurvey/public/index.php +++ b/htdocs/opensurvey/public/index.php @@ -50,12 +50,12 @@ print '

'.$langs->trans("OpenSurveyDesc").' '.$langs->trans("OpenSurveyNoRegistration").'


'; -print $langs->trans("OrganizeYourMeetingEasily").' -
-
+print $langs->trans("OrganizeYourMeetingEasily").' +
+
-
-
+
+
'; llxFooterSurvey(); diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 79eaf5e7013..8fc1d97d23d 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -43,10 +43,10 @@ dol_include_once("/cron/class/cronjob.class.php"); global $langs, $conf; -// Language Management -$langs->load("admin"); -$langs->load("cron"); - +// Language Management +$langs->load("admin"); +$langs->load("cron"); + @@ -101,9 +101,9 @@ if (! empty($id)) { if (! is_numeric($id)) { - echo "Error: Bad value for parameter job id"; - dol_syslog("cron_run_jobs.php Bad value for parameter job id", LOG_WARNING); - exit; + echo "Error: Bad value for parameter job id"; + dol_syslog("cron_run_jobs.php Bad value for parameter job id", LOG_WARNING); + exit; } $filter=array(); $filter['t.rowid']=$id; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 08f6198da6b..869c1976ffd 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -58,9 +58,9 @@ $fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; -$path=''; // This value may be used in future for external module to overwrite theme -$theme='bureau2crea'; // Value of theme -if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } +$path=''; // This value may be used in future for external module to overwrite theme +$theme='bureau2crea'; // Value of theme +if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } // Define image path files $fontlist='arial, sans-serif, verdana, helvetica'; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 63d9c1b8733..96e97e13771 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -124,12 +124,12 @@ if ($resql) if (empty($obj->email)) print "Warning: Customer ".$customer." has no email. Notice disabled.\n"; } - // Define line content - $outputlangs=new Translate('',$conf); - $outputlangs->setDefaultLang(empty($obj->default_lang)?$langs->defaultlang:$obj->default_lang); // By default language of customer - $outputlangs->load("bills"); + // Define line content + $outputlangs=new Translate('',$conf); + $outputlangs->setDefaultLang(empty($obj->default_lang)?$langs->defaultlang:$obj->default_lang); // By default language of customer + $outputlangs->load("bills"); $outputlangs->load("main"); - $outputlangs->load("contracts"); + $outputlangs->load("contracts"); if (dol_strlen($oldemail)) { diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index ace84fa0582..08d068685e3 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -125,11 +125,11 @@ if ($resql) if (empty($obj->email)) print "Warning: Sale representative ".$salerepresentative." has no email. Notice disabled.\n"; } - // Define line content - $outputlangs=new Translate('',$conf); - $outputlangs->setDefaultLang(empty($obj->lang)?$langs->defaultlang:$obj->lang); // By default language of sale representative - $outputlangs->load("bills"); - $outputlangs->load("main"); + // Define line content + $outputlangs=new Translate('',$conf); + $outputlangs->setDefaultLang(empty($obj->lang)?$langs->defaultlang:$obj->lang); // By default language of sale representative + $outputlangs->load("bills"); + $outputlangs->load("main"); if (dol_strlen($obj->email)) { diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 0b2b9413002..c4051728aab 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -69,8 +69,8 @@ $error=0; print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; $now=dol_now('tzserver'); -$duration_value=isset($argv[3])?$argv[3]:'none'; -$duration_value2=isset($argv[4])?$argv[4]:'none'; +$duration_value=isset($argv[3])?$argv[3]:'none'; +$duration_value2=isset($argv[4])?$argv[4]:'none'; $error = 0; print $script_file." launched with mode ".$mode." default lang=".$langs->defaultlang.(is_numeric($duration_value)?" delay=".$duration_value:"").(is_numeric($duration_value2)?" after=".$duration_value2:"")."\n"; From ac205aac2d71aaec65736ca2ba6a3872d2a61216 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 24 Jun 2013 10:05:29 +0200 Subject: [PATCH 04/11] Add search on siren (idprof1) --- htdocs/societe/societe.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 8253c98860d..97b18be18d3 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -226,6 +226,7 @@ if ($search_all) $sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($search_all)."%'"; $sql.= ")"; } if ($search_nom) @@ -235,6 +236,7 @@ if ($search_nom) $sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($search_nom)."%'"; $sql.= ")"; } if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'"; From 109d1a71cb72d0abbb2a97b463a0889d888a3d06 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 25 Jun 2013 11:00:48 +0200 Subject: [PATCH 05/11] Merge --- htdocs/install/mysql/tables/llx_cronjob.sql | 100 ++++++++++---------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index ae7fddc28be..6c83994a936 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -1,51 +1,51 @@ --- =================================================================== --- Copyright (C) 2013 Laurent Destailleur --- Copyright (C) 2013 Florian Henry --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =================================================================== - - -CREATE TABLE llx_cronjob -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - datec datetime, - jobtype varchar(10) NOT NULL, - label text NOT NULL, - command varchar(255), - classesname varchar(255), - objectname varchar(255), - methodename varchar(255), - params text NOT NULL, - md5params varchar(32), - module_name varchar(255), - priority integer DEFAULT 0, - datelastrun datetime, - datenextrun datetime, - datestart datetime, - dateend datetime, - datelastresult datetime, - lastresult text, - lastoutput text, - unitfrequency integer NOT NULL DEFAULT 0, - frequency integer NOT NULL DEFAULT 0, - nbrun integer, - status integer NOT NULL DEFAULT 1, - fk_user_author integer DEFAULT NULL, - fk_user_mod integer DEFAULT NULL, - note text - +-- =================================================================== +-- Copyright (C) 2013 Laurent Destailleur +-- Copyright (C) 2013 Florian Henry +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +CREATE TABLE llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text + )ENGINE=innodb; \ No newline at end of file From b22b604d02405e868f40c108317cce3c7fa54f55 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 25 Jun 2013 11:14:00 +0200 Subject: [PATCH 06/11] Accountancy code on user object in prevision of the complete accountancy module --- .../install/mysql/migration/3.4.0-3.5.0.sql | 2 +- htdocs/install/mysql/tables/llx_user.sql | 3 ++- htdocs/user/class/user.class.php | 6 ++++++ htdocs/user/fiche.php | 21 +++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index b7a12f34262..5ab46b6c4f2 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -66,4 +66,4 @@ ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_ob DROP table llx_adherent_options; DROP table llx_adherent_options_label; - +ALTER TABLE `llx_user` ADD `accountancy_code` VARCHAR( 24 ) NULL; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 6042b0906ce..9fd1db59c91 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -62,5 +62,6 @@ create table llx_user statut tinyint DEFAULT 1, photo varchar(255), -- filename or url of photo lang varchar(6), - color varchar(6) + color varchar(6), + accountancy_code varchar(24) NULL )ENGINE=innodb; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a98e5c5dbd8..39fc2132042 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -96,6 +96,8 @@ class User extends CommonObject var $users; // To store all tree of users hierarchy var $parentof; // To store an array of all parents for all ids. + + var $accountancy_code; // Accountancy code in prevision of the complete accountancy module /** @@ -149,6 +151,7 @@ class User extends CommonObject $sql.= " u.datepreviouslogin as datep,"; $sql.= " u.photo as photo,"; $sql.= " u.openid as openid,"; + $sql.= " u.accountancy_code,"; $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -209,6 +212,7 @@ class User extends CommonObject $this->openid = $obj->openid; $this->lang = $obj->lang; $this->entity = $obj->entity; + $this->accountancy_code = $obj->accountancy_code; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -1114,6 +1118,7 @@ class User extends CommonObject $this->address = empty($this->address)?'':$this->address; $this->zip = empty($this->zip)?'':$this->zip; $this->town = empty($this->town)?'':$this->town; + $this->accountancy_code = trim($this->accountancy_code); // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1142,6 +1147,7 @@ class User extends CommonObject $sql.= ", email = '".$this->db->escape($this->email)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; + $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 53de51df268..66cb62ef362 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -188,6 +188,7 @@ if ($action == 'add' && $canadduser) $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->note = GETPOST("note"); $object->ldap_sid = GETPOST("ldap_sid"); @@ -324,6 +325,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->openid = GETPOST("openid"); $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; @@ -1192,6 +1194,10 @@ else } print ''; print "\n"; + + // Accountancy code + print ''.$langs->trans("AccountancyCode").''; + print ''.$object->accountancy_code.''; // Status print ''.$langs->trans("Status").''; @@ -1821,6 +1827,21 @@ else } print ''; print "\n"; + + // Accountancy code + print ""; + print ''.$langs->trans("AccountancyCode").''; + print ''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print ''; // Status print ''.$langs->trans("Status").''; From 76870622e46ebaa5f3e74adb9e12aaee62d37551 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 25 Jun 2013 14:54:29 +0200 Subject: [PATCH 07/11] Add turnover report by product / serv --- htdocs/compta/stats/cabyprodserv.php | 13 ++++++----- htdocs/core/menus/init_menu_auguria.sql | 1 + htdocs/paybox/admin/paybox.php | 30 ++++++++++++------------- htdocs/paypal/admin/paypal.php | 12 +++++----- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ebfe0c4834b..3ae699709af 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -327,7 +327,7 @@ if ($modecompta == 'CREANCES-DETTES') { $var=!$var; print ""; - // Third party + // Product $fullname=$name[$key]; if ($key >= 0) { $linkname=''.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.''; @@ -339,23 +339,24 @@ if ($modecompta == 'CREANCES-DETTES') { // Amount w/o VAT print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount_ht[$key]); + //print ''; print ''; // Amount with VAT print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount[$key]); - print ''; + //print ''; print ''; // Percent; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index ceaa41b404c..fa0e48556c8 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -198,6 +198,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -- Check deposit 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 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 08/11] 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 09/11] 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 10/11] 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 11/11] 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