Maxi debug of 3.8. Nearly ready for freeze.
This commit is contained in:
parent
5e2d9efa07
commit
a33241f487
@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
$langs->load('compta');
|
||||
$langs->load('other');
|
||||
$langs->load('companies');
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
$langs->load('propal');
|
||||
$langs->load('compta');
|
||||
$langs->load('bills');
|
||||
$langs->load("companies");
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$ref=GETPOST('ref','alpha');
|
||||
@ -103,7 +104,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
// Discounts
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
|
||||
if ($societe->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_percent);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
|
||||
@ -37,6 +37,7 @@ $langs->load('propal');
|
||||
$langs->load('compta');
|
||||
$langs->load('other');
|
||||
$langs->load("bills");
|
||||
$langs->load('companies');
|
||||
|
||||
|
||||
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
|
||||
|
||||
@ -36,6 +36,7 @@ if (!$user->rights->facture->lire) accessforbidden();
|
||||
$langs->load("bills");
|
||||
$langs->load("banks");
|
||||
$langs->load("withdrawals");
|
||||
$langs->load('companies');
|
||||
|
||||
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
|
||||
$ref=GETPOST('ref','alpha');
|
||||
@ -396,7 +397,7 @@ if ($object->id > 0)
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Montants
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2" class="nowrap">'.price($object->total_ht).'</td>';
|
||||
|
||||
@ -3960,15 +3960,16 @@ abstract class CommonObject
|
||||
* This function is meant to be called from replaceThirdparty with the appropiate tables
|
||||
* Column name fk_soc MUST be used to identify thirdparties
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @param array $tables Tables that need to be changed
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id (the thirdparty to delete)
|
||||
* @param int $dest_id New thirdparty id (the thirdparty that will received element of the other)
|
||||
* @param array $tables Tables that need to be changed
|
||||
* @return bool
|
||||
*/
|
||||
public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables)
|
||||
{
|
||||
foreach ($tables as $table) {
|
||||
foreach ($tables as $table)
|
||||
{
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$table.' SET fk_soc = '.$dest_id.' WHERE fk_soc = '.$origin_id;
|
||||
|
||||
if (!$db->query($sql)) {
|
||||
|
||||
@ -3092,7 +3092,7 @@ class Form
|
||||
|
||||
// Now add questions
|
||||
$more.='<table class="paddingrightonly" width="100%">'."\n";
|
||||
$more.='<tr><td colspan="3" valign="top">'.(! empty($formquestion['text'])?$formquestion['text']:'').'</td></tr>'."\n";
|
||||
$more.='<tr><td colspan="3">'.(! empty($formquestion['text'])?$formquestion['text']:'').'</td></tr>'."\n";
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
if (is_array($input) && ! empty($input))
|
||||
@ -3101,15 +3101,15 @@ class Form
|
||||
|
||||
if ($input['type'] == 'text')
|
||||
{
|
||||
$more.='<tr><td valign="top">'.$input['label'].'</td><td valign="top" colspan="2" align="left"><input type="text" class="flat" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'" /></td></tr>'."\n";
|
||||
$more.='<tr><td>'.$input['label'].'</td><td colspan="2" align="left"><input type="text" class="flat" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'" /></td></tr>'."\n";
|
||||
}
|
||||
else if ($input['type'] == 'password')
|
||||
{
|
||||
$more.='<tr><td valign="top">'.$input['label'].'</td><td valign="top" colspan="2" align="left"><input type="password" class="flat" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'" /></td></tr>'."\n";
|
||||
$more.='<tr><td>'.$input['label'].'</td><td colspan="2" align="left"><input type="password" class="flat" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'" /></td></tr>'."\n";
|
||||
}
|
||||
else if ($input['type'] == 'select')
|
||||
{
|
||||
$more.='<tr><td valign="top">';
|
||||
$more.='<tr><td>';
|
||||
if (! empty($input['label'])) $more.=$input['label'].'</td><td valign="top" colspan="2" align="left">';
|
||||
$more.=$this->selectarray($input['name'],$input['values'],$input['default'],1);
|
||||
$more.='</td></tr>'."\n";
|
||||
@ -3117,13 +3117,13 @@ class Form
|
||||
else if ($input['type'] == 'checkbox')
|
||||
{
|
||||
$more.='<tr>';
|
||||
$more.='<td valign="top">'.$input['label'].' </td><td valign="top" align="left">';
|
||||
$more.='<td>'.$input['label'].' </td><td align="left">';
|
||||
$more.='<input type="checkbox" class="flat" id="'.$input['name'].'" name="'.$input['name'].'"';
|
||||
if (! is_bool($input['value']) && $input['value'] != 'false') $more.=' checked';
|
||||
if (is_bool($input['value']) && $input['value']) $more.=' checked';
|
||||
if (isset($input['disabled'])) $more.=' disabled';
|
||||
$more.=' /></td>';
|
||||
$more.='<td valign="top" align="left"> </td>';
|
||||
$more.='<td align="left"> </td>';
|
||||
$more.='</tr>'."\n";
|
||||
}
|
||||
else if ($input['type'] == 'radio')
|
||||
@ -3134,10 +3134,10 @@ class Form
|
||||
$more.='<tr>';
|
||||
if ($i==0) $more.='<td valign="top">'.$input['label'].'</td>';
|
||||
else $more.='<td> </td>';
|
||||
$more.='<td valign="top" width="20"><input type="radio" class="flat" id="'.$input['name'].'" name="'.$input['name'].'" value="'.$selkey.'"';
|
||||
$more.='<td width="20"><input type="radio" class="flat" id="'.$input['name'].'" name="'.$input['name'].'" value="'.$selkey.'"';
|
||||
if ($input['disabled']) $more.=' disabled';
|
||||
$more.=' /></td>';
|
||||
$more.='<td valign="top" align="left">';
|
||||
$more.='<td align="left">';
|
||||
$more.=$selval;
|
||||
$more.='</td></tr>'."\n";
|
||||
$i++;
|
||||
@ -3145,8 +3145,8 @@ class Form
|
||||
}
|
||||
else if ($input['type'] == 'other')
|
||||
{
|
||||
$more.='<tr><td valign="top">';
|
||||
if (! empty($input['label'])) $more.=$input['label'].'</td><td valign="top" colspan="2" align="left">';
|
||||
$more.='<tr><td>';
|
||||
if (! empty($input['label'])) $more.=$input['label'].'</td><td colspan="2" align="left">';
|
||||
$more.=$input['value'];
|
||||
$more.='</td></tr>'."\n";
|
||||
}
|
||||
|
||||
@ -410,10 +410,10 @@ OutstandingBillReached=Reached max. for outstanding bill
|
||||
MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0.
|
||||
LeopardNumRefModelDesc=The code is free. This code can be modified at any time.
|
||||
ManagingDirectors=Manager(s) name (CEO, director, president...)
|
||||
SearchThirdparty=Search thirdparty
|
||||
SearchThirdparty=Search third party
|
||||
SearchContact=Search contact
|
||||
MergeOriginThirdparty=Origin thirdparty
|
||||
MergeThirdparties=Merge thirdparties
|
||||
ConfirmMergeThirdparties=Are you sure you want to merge this thirdparty? All linked objects (invoices...) will be linked with the destination thirdparty
|
||||
MergeOriginThirdparty=Duplicate third party (third party you want to delete)
|
||||
MergeThirdparties=Merge third parties
|
||||
ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one ? All linked objects (invoices, orders, ...) will be linked with the current third party so you will be able to delete the duplicate one.
|
||||
ThirdpartiesMergeSuccess=Thirdparties have been merged
|
||||
ErrorThirdpartiesMerge=There was an error when deleting the thirdparties. Please check the log. Changes have been reverted.
|
||||
@ -3915,9 +3915,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Function used to replace a thirdparty id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @return bool
|
||||
*/
|
||||
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
|
||||
|
||||
@ -737,11 +737,11 @@ else
|
||||
{
|
||||
if ($userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Modify').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Modify').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,11 +750,11 @@ else
|
||||
{
|
||||
if ($userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Validate').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Validate').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -763,11 +763,11 @@ else
|
||||
{
|
||||
if ($userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=close">'.$langs->trans("Close").'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=close">'.$langs->trans("Close").'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Close').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Close').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -776,11 +776,11 @@ else
|
||||
{
|
||||
if ($userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ReOpen').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ReOpen').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -789,11 +789,11 @@ else
|
||||
{
|
||||
if ($userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=clone">'.$langs->trans('ToClone').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=clone">'.$langs->trans('ToClone').'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ToClone').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ToClone').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -802,11 +802,11 @@ else
|
||||
{
|
||||
if ($userDelete > 0)
|
||||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Delete').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Delete').'</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,18 +102,23 @@ if (empty($reshook))
|
||||
$soc_origin_id = GETPOST('soc_origin', 'int');
|
||||
$soc_origin = new Societe($db);
|
||||
|
||||
if ($soc_origin_id < 1) {
|
||||
if ($soc_origin_id < 1)
|
||||
{
|
||||
$langs->load('errors');
|
||||
$langs->load('companies');
|
||||
setEventMessage($langs->trans('ErrorProdIdIsMandatory', $langs->trans('MergeOriginThirdparty')), 'errors');
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (!$errors && $soc_origin->fetch($soc_origin_id) < 1) {
|
||||
if (!$errors && $soc_origin->fetch($soc_origin_id) < 1)
|
||||
{
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
$errors++;
|
||||
}
|
||||
|
||||
if (!$errors) {
|
||||
if (!$errors)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$objects = array(
|
||||
@ -141,8 +146,8 @@ if (empty($reshook))
|
||||
);
|
||||
|
||||
//First, all core objects must update their tables
|
||||
foreach ($objects as $object_name => $object_file) {
|
||||
|
||||
foreach ($objects as $object_name => $object_file)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.$object_file;
|
||||
|
||||
if (!$errors && !$object_name::replaceThirdparty($db, $soc_origin->id, $object->id)) {
|
||||
|
||||
@ -1833,7 +1833,7 @@ div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border
|
||||
div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col {
|
||||
vertical-align: middle;
|
||||
}
|
||||
div.tabBar .tdtop {
|
||||
div .tdtop {
|
||||
vertical-align: top;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 0px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user