Skip to content

Commit

Permalink
Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry committed Feb 16, 2016
2 parents 23e35a6 + be77887 commit 49a33cb
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 34 deletions.
15 changes: 9 additions & 6 deletions htdocs/comm/mailing/card.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
Expand Down Expand Up @@ -222,6 +222,8 @@
$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,
Expand All @@ -234,6 +236,7 @@
'__OTHER3__' => $other3,
'__OTHER4__' => $other4,
'__OTHER5__' => $other5,
'__SIGNATURE__' => $signature, // Signature is empty when ran from command line or taken from user in parameter)
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>'
);
Expand Down Expand Up @@ -1093,10 +1096,10 @@
}

print '</table>';

dol_fiche_end();



print "\n";
print '<form name="edit_mailing" action="card.php" method="post" enctype="multipart/form-data">'."\n";
Expand All @@ -1108,7 +1111,7 @@
print_fiche_titre($langs->trans("EMail"),'','');

dol_fiche_head();

print '<table class="border" width="100%">';

// Subject
Expand Down Expand Up @@ -1175,7 +1178,7 @@
print '</table>';

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'" name="save">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
Expand Down
5 changes: 3 additions & 2 deletions htdocs/comm/propal.php
Expand Up @@ -286,7 +286,7 @@
{
$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) {
Expand Down Expand Up @@ -314,7 +314,8 @@
$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');
}
Expand Down
1 change: 1 addition & 0 deletions htdocs/comm/propal/class/propal.class.php
Expand Up @@ -1048,6 +1048,7 @@ function create($user, $notrigger=0)
*/
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);
Expand Down
8 changes: 4 additions & 4 deletions htdocs/compta/charges/index.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
Expand Down Expand Up @@ -86,7 +86,7 @@
}

// Payment Salary
if ($conf->salaries->enabled)
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
Expand Down Expand Up @@ -167,7 +167,7 @@
}


if ($conf->tax->enabled)
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
// Social contributions only
if (GETPOST("mode") != 'sconly')
Expand Down Expand Up @@ -278,7 +278,7 @@
}

// VAT
if ($conf->tax->enabled)
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
Expand Down
2 changes: 0 additions & 2 deletions htdocs/core/class/commonobjectline.class.php
Expand Up @@ -69,8 +69,6 @@ public function getLabelOfUnit($type='long')

$langs->load('products');

$this->db->begin();

$label_type = 'label';

if ($type == 'short')
Expand Down
6 changes: 5 additions & 1 deletion htdocs/core/modules/modSociete.class.php
Expand Up @@ -297,7 +297,11 @@ function __construct($db)
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;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/filefunc.inc.php
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions htdocs/product/class/productcustomerprice.class.php
Expand Up @@ -346,6 +346,8 @@ function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $f
$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;
}
Expand Down
10 changes: 5 additions & 5 deletions htdocs/societe/price.php
Expand Up @@ -241,9 +241,9 @@
'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') {
Expand Down Expand Up @@ -487,7 +487,7 @@
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);

Expand All @@ -512,7 +512,7 @@
print '</tr>';

print '<tr class="liste_titre">';
print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
print '<td><input type="text" class="flat" name="search_prod" value="' . $search_prod . '" size="20"></td>';
print '<td colspan="8">&nbsp;</td>';
// Print the search button
print '<td class="liste_titre" align="right">';
Expand Down
27 changes: 14 additions & 13 deletions scripts/emailings/mailing-send.php
@@ -1,8 +1,9 @@
#!/usr/bin/php
<?php
/*
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
Expand Down Expand Up @@ -142,17 +143,17 @@

// 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__' => '<a href="mailto:'.$obj2->email.'">'.$obj2->email.'</a>',
Expand Down Expand Up @@ -251,7 +252,7 @@
$error++;
}
}

if (!empty($conf->global->MAILING_DELAY)) {
sleep($conf->global->MAILING_DELAY);
}
Expand Down

0 comments on commit 49a33cb

Please sign in to comment.