diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e1d357b6c3a..3bca65a3ee7 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2016 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 @@ -222,6 +222,8 @@ if (empty($reshook)) $tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); $tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); $tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $signature = ((!empty($user->signature) && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''); + // Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions) $substitutionarray=array( '__ID__' => $obj->source_id, @@ -234,6 +236,7 @@ if (empty($reshook)) '__OTHER3__' => $other3, '__OTHER4__' => $other4, '__OTHER5__' => $other5, + '__SIGNATURE__' => $signature, // Signature is empty when ran from command line or taken from user in parameter) '__CHECK_READ__' => '', '__UNSUBSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'' ); @@ -1093,10 +1096,10 @@ else } print ''; - + dol_fiche_end(); - - + + print "\n"; print '
'."\n"; @@ -1108,7 +1111,7 @@ else print_fiche_titre($langs->trans("EMail"),'',''); dol_fiche_head(); - + print ''; // Subject @@ -1175,7 +1178,7 @@ else print '
'; dol_fiche_end(); - + print '
'; print ''; print '     '; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index fd6794c3d44..fa5619ca204 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -286,7 +286,7 @@ if (empty($reshook)) { $db->begin(); - // Si on a selectionne une propal a copier, on realise la copie + // If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on) if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) { if ($object->fetch(GETPOST('copie_propal')) > 0) { @@ -314,7 +314,8 @@ if (empty($reshook)) $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); - $id = $object->create_from($user); + // the create is done below and further more the existing create_from function is quite hilarating + //$id = $object->create_from($user); } else { setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors'); } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 8b9926e6458..0159e767ff3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1048,6 +1048,7 @@ class Propal extends CommonObject */ function create_from($user) { + // i love this function because $this->products is not used in create function... $this->products=$this->lines; return $this->create($user); diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 45b10f2363c..6e136be1b25 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2011-2014 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * @@ -86,7 +86,7 @@ if (GETPOST("mode") != 'sconly') } // Payment Salary -if ($conf->salaries->enabled) +if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) { if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') { @@ -167,7 +167,7 @@ if ($conf->salaries->enabled) } -if ($conf->tax->enabled) +if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { // Social contributions only if (GETPOST("mode") != 'sconly') @@ -278,7 +278,7 @@ if ($conf->tax->enabled) } // VAT -if ($conf->tax->enabled) +if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') { diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index ef854a2452e..f9f2e3c889f 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -69,8 +69,6 @@ abstract class CommonObjectLine extends CommonObject $langs->load('products'); - $this->db->begin(); - $label_type = 'label'; if ($type == 'short') diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index fb8623695e6..ab48d6807ec 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -297,7 +297,11 @@ class modSociete extends DolibarrModules case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); + if ($tmpparam['options'] && is_array($tmpparam['options'])) + { + $stack=array_keys($tmpparam['options']); + $tmp=array_shift($stack); + } if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; break; } diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 77ba2788d99..7bf8271606d 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -30,7 +30,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.3'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.4'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 86228db70c5..f2adc298a76 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -346,6 +346,8 @@ class Productcustomerprice extends CommonObject $sql .= ' AND ' . $key . ' = \'' . $value . '\''; } elseif ($key == 'soc.nom') { $sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\''; + } elseif ($key == 'prod.ref') { + $sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\''; } else { $sql .= ' AND ' . $key . ' = ' . $value; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 82adbd96607..0259150ccc4 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -241,9 +241,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { 't.fk_soc' => $object->id ); - $search_soc = GETPOST('search_soc'); - if (! empty($search_soc)) { - $filter ['soc.nom'] = $search_soc; + $search_prod = GETPOST('search_prod'); + if (! empty($search_prod)) { + $filter ['prod.ref'] = $search_prod; } if ($action == 'add_customer_price') { @@ -487,7 +487,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { setEventMessage($prodcustprice->error, 'errors'); } - $option = '&search_soc=' . $search_soc . '&id=' . $object->id; + $option = '&search_prod=' . $search_prod . '&id=' . $object->id; print_barre_liste($langs->trans('PriceByCustomer'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); @@ -512,7 +512,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; - print ''; + print ''; print ' '; // Print the search button print ''; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 9896db73352..8baf85ee5fe 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -1,8 +1,9 @@ #!/usr/bin/php - * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2005-2016 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 @@ -142,17 +143,17 @@ if ($resql) // Make subtsitutions on topic and body $other=explode(';',$obj2->other); - $other1=$other[0]; - $other2=$other[1]; - $other3=$other[2]; - $other4=$other[3]; - $other5=$other[4]; - // Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions) - $signature = (!empty($user->signature))?$user->signature:''; - + $tmpfield=explode('=',$other[0],2); $other1=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $signature = ((!empty($user->signature) && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''); + + // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) $substitutionarray=array( - '__ID__' => $obj->source_id, - '__EMAIL__' => $obj->email, + '__ID__' => $obj2->source_id, + '__EMAIL__' => $obj2->email, '__LASTNAME__' => $obj2->lastname, '__FIRSTNAME__' => $obj2->firstname, '__MAILTOEMAIL__' => ''.$obj2->email.'', @@ -251,7 +252,7 @@ if ($resql) $error++; } } - + if (!empty($conf->global->MAILING_DELAY)) { sleep($conf->global->MAILING_DELAY); }