Skip to content
Snippets Groups Projects
Commit 46ce1d3a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Uniformize code

parent 537c6b0c
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,10 @@ if ($id > 0)
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
$cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
//if ($action == 'editnote_private') $cssclass='titlefieldcreate';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
......@@ -98,19 +102,19 @@ if ($id > 0)
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
print '<tr><td class="'.$cssclass.'">'.$langs->trans("ThirdParty").'</td><td>'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
print '<tr><td class="'.$cssclass.'">'.$langs->trans("ThirdParty").'</td><td>';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
// Civility
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print '<tr><td class="'.$cssclass.'">'.$langs->trans("UserTitle").'</td><td>';
print $object->getCivilityLabel();
print '</td></tr>';
......@@ -120,7 +124,7 @@ if ($id > 0)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
print '<td class="titlefield">'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");
print '<td>'.$langs->trans("DateToBirth").'</td><td>'.dol_print_date($object->birthday,"day");
print ' &nbsp; ';
//var_dump($birthdatearray);
......@@ -138,17 +142,16 @@ if ($id > 0)
}
else
{
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.$langs->trans("Unknown")."</td>";
print '<td>'.$langs->trans("DateToBirth").'</td><td>'.$langs->trans("Unknown")."</td>";
}
print "</tr>";
print "</table>";
print '<div>';
//print '<div>';
print '<br>';
//print '<br>';
$cssclass='titlefield';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
......
......@@ -69,17 +69,17 @@ else $typeofdata='textarea:12:100';
?>
<!-- BEGIN PHP TEMPLATE NOTES -->
<div class="border table-border centpercent">
<div class="tagtable border table-border centpercent">
<?php if ($module != 'product') { // No public note yet on products ?>
<div class="table-border-row">
<div class="table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?></div>
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
<div class="tagtr table-border-row">
<div class="tagtd table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?></div>
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
</div>
<?php } ?>
<?php if (empty($user->societe_id)) { ?>
<div class="table-border-row">
<div class="table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?></div>
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
<div class="tagtr table-border-row">
<div class="tagtd table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?></div>
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
</div>
<?php } ?>
</div>
......
......@@ -113,10 +113,9 @@ if ($socid)
print '</table>';
print '<br>';
//print '<br>';
print '<div class="underbanner clearboth"></div>';
//print '<div class="underbanner clearboth"></div>';
$object->info($socid);
print dol_print_object_info($object, 1);
......
......@@ -78,7 +78,11 @@ if ($id > 0)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
//if ($action == 'editnote_private') $cssclass='titlefieldcreate';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
......@@ -86,12 +90,12 @@ if ($id > 0)
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
print '<tr><td class="'.$cssclass.'">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client)
{
print '<tr><td class="titlefield">';
print '<tr><td class="'.$cssclass.'">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
......@@ -100,7 +104,7 @@ if ($id > 0)
if ($object->fournisseur)
{
print '<tr><td class="titlefield">';
print '<tr><td class="'.$cssclass.'">';
print $langs->trans('SupplierCode').'</td><td colspan="3">';
print $object->code_fournisseur;
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
......@@ -111,10 +115,9 @@ if ($id > 0)
print '</div>';
print '<br>';
//print '<br>';
//$colwidth='25';
$cssclass='titlefield';
//print '<div class="underbanner clearboth"></div>';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
......
......@@ -165,12 +165,12 @@ if ($result > 0)
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client)
{
print '<tr><td>';
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
......@@ -179,14 +179,14 @@ if ($result > 0)
if ($object->fournisseur)
{
print '<tr><td>';
print '<tr><td class="titlefield">';
print $langs->trans('SupplierCode').'</td><td colspan="3">';
print $object->code_fournisseur;
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
print '</td></tr>';
}
print '<tr><td>'.$langs->trans("NbOfActiveNotifications").'</td>';
print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>';
print '<td colspan="3">';
$notify=new Notify($db);
$tmparray = $notify->getNotificationsArray('', $object->id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment