From a33241f487744dcdcf4ca5aa94cde8edb41a4168 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 5 Jun 2015 14:46:30 +0200 Subject: [PATCH] Maxi debug of 3.8. Nearly ready for freeze. --- htdocs/comm/propal/document.php | 1 + htdocs/comm/propal/note.php | 5 +++-- htdocs/compta/facture/document.php | 1 + htdocs/compta/facture/prelevement.php | 3 ++- htdocs/core/class/commonobject.class.php | 11 ++++++----- htdocs/core/class/html.form.class.php | 20 ++++++++++---------- htdocs/langs/en_US/companies.lang | 8 ++++---- htdocs/product/class/product.class.php | 6 +++--- htdocs/projet/card.php | 24 ++++++++++++------------ htdocs/societe/soc.php | 17 +++++++++++------ htdocs/theme/eldy/style.css.php | 2 +- 11 files changed, 54 insertions(+), 44 deletions(-) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index d224c20bc97..af603d0606b 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -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'); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 05cd2db3f04..1e5ace7353e 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -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"); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 60c47564743..e4f9846309a 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -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 diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 6954ad46249..0e1763d4b86 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -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>'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bb481807e16..c747f008d8b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1ecdb9b61f4..57d28784f66 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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"; } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index e700271368d..ec58f3eab05 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -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. \ No newline at end of file diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d2c3deeb2e4..dbb42a4e5bc 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -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) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6a36d59b3b2..d05e727d699 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -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>'; } } } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 2414b41c3fe..bfda31e6115 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -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)) { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 2563440cf8c..01caa7a7282 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -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; -- GitLab