From 79d85d5888f016ab3837ea4f70dcf2d92c8ab22a Mon Sep 17 00:00:00 2001 From: syrus34 Date: Wed, 12 Feb 2014 18:58:12 +0100 Subject: [PATCH 1/3] Add fields company_iban and company_bic --- htdocs/core/class/commondocgenerator.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index ee5ab2cbae9..342c6494863 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -143,6 +143,8 @@ abstract class CommonDocGenerator $object->state=getState($object->state_code,0); } + $object->load_ban(); + $array_thirdparty = array( 'company_name'=>$object->name, 'company_email'=>$object->email, @@ -171,7 +173,9 @@ abstract class CommonDocGenerator 'company_idprof5'=>$object->idprof5, 'company_idprof6'=>$object->idprof6, 'company_note_public'=>$object->note_public, - 'company_note_private'=>$object->note_private + 'company_note_private'=>$object->note_private, + 'company_iban'=>$object->bank_account->iban, + 'company_bic'=>$object->bank_account->bic ); // Retrieve extrafields From 6f129c3800f44d856f4b045be8cb0bc8b7078f08 Mon Sep 17 00:00:00 2001 From: philippe Date: Thu, 13 Feb 2014 16:36:34 +0100 Subject: [PATCH 2/3] display adherent module for external user --- htdocs/core/class/conf.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index c068830a4aa..8629d7c73e3 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -412,7 +412,7 @@ class Conf $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024); // Define list of limited modules - if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. + if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later. // Timeouts if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10; From 57153e4de40cd96576825c2e7856c745119f2060 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2014 23:40:39 +0100 Subject: [PATCH 3/3] Try a cleaner javascript escape function. --- htdocs/core/lib/functions.lib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 31e2a1344b4..3f5b90df529 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -437,13 +437,18 @@ function dol_string_nospecial($str,$newstr='_',$badchars='') /** * Returns text escaped for inclusion into javascript code * - * @param string $stringtoescape String to escape - * @return string Escaped string + * @param string $stringtoescape String to escape + * @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string" + * @return string Escaped string. Both ' and " are escaped into ' if they are escaped. */ -function dol_escape_js($stringtoescape) +function dol_escape_js($stringtoescape, $mode=0) { // escape quotes and backslashes, newlines, etc. - $substitjs=array("'"=>"\\'",'\\'=>'\\\\',"'"=>"\\'",'"'=>"\\'","\r"=>'\\r',"\n"=>'\\n',''<\/'); + $substitjs=array("'"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n'); + //$substitjs['