Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8
This commit is contained in:
commit
49a33cb8f9
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@uers.sourceforge.net>
|
* 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
|
* 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
|
* 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[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[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
$tmpfield=explode('=',$other[4],2); $other5=(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)
|
// Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions)
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => $obj->source_id,
|
'__ID__' => $obj->source_id,
|
||||||
@ -234,6 +236,7 @@ if (empty($reshook))
|
|||||||
'__OTHER3__' => $other3,
|
'__OTHER3__' => $other3,
|
||||||
'__OTHER4__' => $other4,
|
'__OTHER4__' => $other4,
|
||||||
'__OTHER5__' => $other5,
|
'__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"/>',
|
'__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>'
|
'__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>'
|
||||||
);
|
);
|
||||||
|
|||||||
@ -286,7 +286,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$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 (GETPOST('createmode') == 'copy' && GETPOST('copie_propal'))
|
||||||
{
|
{
|
||||||
if ($object->fetch(GETPOST('copie_propal')) > 0) {
|
if ($object->fetch(GETPOST('copie_propal')) > 0) {
|
||||||
@ -314,7 +314,8 @@ if (empty($reshook))
|
|||||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
$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 {
|
} else {
|
||||||
setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors');
|
setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1048,6 +1048,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function create_from($user)
|
function create_from($user)
|
||||||
{
|
{
|
||||||
|
// i love this function because $this->products is not used in create function...
|
||||||
$this->products=$this->lines;
|
$this->products=$this->lines;
|
||||||
|
|
||||||
return $this->create($user);
|
return $this->create($user);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
* 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) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
*
|
*
|
||||||
@ -86,7 +86,7 @@ if (GETPOST("mode") != 'sconly')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Payment Salary
|
// Payment Salary
|
||||||
if ($conf->salaries->enabled)
|
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||||
{
|
{
|
||||||
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
|
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
|
// Social contributions only
|
||||||
if (GETPOST("mode") != 'sconly')
|
if (GETPOST("mode") != 'sconly')
|
||||||
@ -278,7 +278,7 @@ if ($conf->tax->enabled)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
if ($conf->tax->enabled)
|
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||||
{
|
{
|
||||||
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
|
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,8 +69,6 @@ abstract class CommonObjectLine extends CommonObject
|
|||||||
|
|
||||||
$langs->load('products');
|
$langs->load('products');
|
||||||
|
|
||||||
$this->db->begin();
|
|
||||||
|
|
||||||
$label_type = 'label';
|
$label_type = 'label';
|
||||||
|
|
||||||
if ($type == 'short')
|
if ($type == 'short')
|
||||||
|
|||||||
@ -297,7 +297,11 @@ class modSociete extends DolibarrModules
|
|||||||
case 'sellist':
|
case 'sellist':
|
||||||
$tmp='';
|
$tmp='';
|
||||||
$tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
$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;
|
if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
* \brief File that include conf.php file and commons lib like functions.lib.php
|
* \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));
|
if (! defined('EURO')) define('EURO',chr(128));
|
||||||
|
|
||||||
// Define syslog constants
|
// Define syslog constants
|
||||||
|
|||||||
@ -346,6 +346,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
$sql .= ' AND ' . $key . ' = \'' . $value . '\'';
|
$sql .= ' AND ' . $key . ' = \'' . $value . '\'';
|
||||||
} elseif ($key == 'soc.nom') {
|
} elseif ($key == 'soc.nom') {
|
||||||
$sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\'';
|
$sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\'';
|
||||||
|
} elseif ($key == 'prod.ref') {
|
||||||
|
$sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\'';
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND ' . $key . ' = ' . $value;
|
$sql .= ' AND ' . $key . ' = ' . $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,9 +241,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
't.fk_soc' => $object->id
|
't.fk_soc' => $object->id
|
||||||
);
|
);
|
||||||
|
|
||||||
$search_soc = GETPOST('search_soc');
|
$search_prod = GETPOST('search_prod');
|
||||||
if (! empty($search_soc)) {
|
if (! empty($search_prod)) {
|
||||||
$filter ['soc.nom'] = $search_soc;
|
$filter ['prod.ref'] = $search_prod;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add_customer_price') {
|
if ($action == 'add_customer_price') {
|
||||||
@ -487,7 +487,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
setEventMessage($prodcustprice->error, 'errors');
|
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);
|
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 '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
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"> </td>';
|
print '<td colspan="8"> </td>';
|
||||||
// Print the search button
|
// Print the search button
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* 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
|
* 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
|
* 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
|
// Make subtsitutions on topic and body
|
||||||
$other=explode(';',$obj2->other);
|
$other=explode(';',$obj2->other);
|
||||||
$other1=$other[0];
|
$tmpfield=explode('=',$other[0],2); $other1=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
$other2=$other[1];
|
$tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
$other3=$other[2];
|
$tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
$other4=$other[3];
|
$tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
$other5=$other[4];
|
$tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
// Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions)
|
$signature = ((!empty($user->signature) && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:'');
|
||||||
$signature = (!empty($user->signature))?$user->signature:'';
|
|
||||||
|
|
||||||
|
// Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => $obj->source_id,
|
'__ID__' => $obj2->source_id,
|
||||||
'__EMAIL__' => $obj->email,
|
'__EMAIL__' => $obj2->email,
|
||||||
'__LASTNAME__' => $obj2->lastname,
|
'__LASTNAME__' => $obj2->lastname,
|
||||||
'__FIRSTNAME__' => $obj2->firstname,
|
'__FIRSTNAME__' => $obj2->firstname,
|
||||||
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj2->email.'">'.$obj2->email.'</a>',
|
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj2->email.'">'.$obj2->email.'</a>',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user