Uniformize code

This commit is contained in:
Laurent Destailleur 2016-10-28 18:40:26 +02:00
parent 22d2557a48
commit f1ec2c04ed
7 changed files with 242 additions and 167 deletions

View File

@ -1710,7 +1710,7 @@ if ($action == 'create')
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1);
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net> /* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net> * Copyright (C) 2005-2016 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* *
@ -149,66 +149,61 @@ $formother = new FormOther($db);
if ($object->id > 0) if ($object->id > 0)
{ {
$head = propal_prepare_head($object); $head = propal_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal'); dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal');
/*
* Propal synthese pour rappel
*/
print '<table class="border" width="100%">';
$linkback='<a href="'.DOL_URL_ROOT.'/comm/propal/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; // Proposal card
// Ref $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print '</td></tr>'; $morehtmlref='<div class="refidno">';
// Ref customer
// Ref client $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
print '<tr><td>'; $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">'; // Thirdparty
print $langs->trans('RefCustomer').'</td><td align="left">'; $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
print '</td>'; // Project
print '</tr></table>'; if (! empty($conf->projet->enabled))
print '</td><td colspan="3">';
print $object->ref_client;
print '</td>';
print '</tr>';
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
// Delivery address
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
{ {
print '<tr><td>'; $langs->load("projects");
print '<table class="nobordernopadding" width="100%"><tr><td>'; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
print $langs->trans('DeliveryAddress'); if ($user->rights->propal->creer)
print '</td>'; {
if ($action != 'classify')
if ($action != 'editdelivery_address' && ! empty($object->brouillon)) //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>'; $morehtmlref.=' : ';
print '</tr></table>'; if ($action == 'classify') {
print '</td><td colspan="3">'; //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
if ($action == 'editdelivery_address') $morehtmlref.='<input type="hidden" name="action" value="classin">';
{ $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','propal',$object->id); $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
} $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
else $morehtmlref.='</form>';
{ } else {
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','propal',$object->id); $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
} }
print '</td></tr>'; } else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
} }
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
print "</table>"; dol_fiche_end();
print '</div>';
print '<br>';
// Contacts lines (modules that overwrite templates must declare this into descriptor) // Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir) foreach($dirtpls as $reldir)

View File

@ -100,36 +100,70 @@ if ($object->id > 0)
} }
print '<table class="border"width="100%">'; // Proposal card
$linkback='<a href="'.DOL_URL_ROOT.'/comm/propal/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'; $morehtmlref='<div class="refidno">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref',''); // Ref customer
print '</td></tr>'; $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Ref client // Thirdparty
print '<tr><td>'; $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">'; // Project
print $langs->trans('RefCustomer').'</td><td align="left">'; if (! empty($conf->projet->enabled))
print '</td>'; {
print '</tr></table>'; $langs->load("projects");
print '</td><td colspan="3">'; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
print $object->ref_client; if ($user->rights->propal->creer)
print '</td>'; {
print '</tr>'; if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
// Customer $morehtmlref.=' : ';
print "<tr><td>".$langs->trans("Company")."</td>"; if ($action == 'classify') {
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>'; //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; $morehtmlref.='<input type="hidden" name="action" value="classin">';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
print '</table>'; $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Files infos
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n";
print '</div>'; print '</div>';
dol_fiche_end();
$modulepart = 'propal'; $modulepart = 'propal';
$permission = $user->rights->propal->creer; $permission = $user->rights->propal->creer;

View File

@ -54,12 +54,66 @@ dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal');
$object->info($object->id); $object->info($object->id);
print '<table width="100%"><tr><td>';
// Proposal card
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
dol_print_object_info($object); dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
print '</div>'; print '</div>';
dol_fiche_end();
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
@ -45,10 +45,9 @@ $result = restrictedArea($user, 'propale', $id, 'propal');
$object = new Propal($db); $object = new Propal($db);
/*
/******************************************************************************/ * Actions
/* Actions */ */
/******************************************************************************/
$permissionnote=$user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php $permissionnote=$user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
@ -56,9 +55,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
/******************************************************************************/ /*
/* Affichage fiche */ * View
/******************************************************************************/ */
llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
@ -70,10 +69,9 @@ if ($id > 0 || ! empty($ref))
$now=dol_now(); $now=dol_now();
if ($object->fetch($id, $ref)) if ($object->fetch($id, $ref) > 0)
{ {
$societe = new Societe($db); if ($object->fetch_thirdparty() > 0)
if ( $societe->fetch($object->socid) )
{ {
$head = propal_prepare_head($object); $head = propal_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal'); dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal');
@ -81,71 +79,64 @@ if ($id > 0 || ! empty($ref))
$cssclass='titlefield'; $cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate';
//if ($action == 'editnote_private') $cssclass='titlefieldcreate'; //if ($action == 'editnote_private') $cssclass='titlefieldcreate';
print '<table class="border" width="100%">';
// Proposal card
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans('BackToList').'</a>';
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref',''); $morehtmlref='<div class="refidno">';
print '</td></tr>'; // Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
// Ref client $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
print '<tr><td>'; // Thirdparty
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">'; $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
print $langs->trans('RefCustomer').'</td><td align="left">'; // Project
print '</td>'; if (! empty($conf->projet->enabled))
print '</tr></table>';
print '</td><td colspan="3">';
print $object->ref_client;
print '</td>';
print '</tr>';
// Customer
if ( is_null($object->thirdparty) )
$object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
// 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");
$absolute_discount=$societe->getAvailableDiscounts();
print '. ';
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
print '.';
print '</td></tr>';
// Date
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
print dol_print_date($object->date,'daytext');
print '</td>';
print '</tr>';
// Date fin propal
print '<tr>';
print '<td>'.$langs->trans('DateEndPropal').'</td><td colspan="3">';
if ($object->fin_validite)
{ {
print dol_print_date($object->fin_validite,'daytext'); $langs->load("projects");
if ($object->statut == Propal::STATUS_VALIDATED && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
} }
else $morehtmlref.='</div>';
{
print $langs->trans("Unknown"); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
}
print '</td>';
print '</tr>';
print "</table>";
//print '<br>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print '</div>';
print '</div>';
dol_fiche_end(); dol_fiche_end();
} }
} }

View File

@ -740,7 +740,7 @@ if ($resql)
{ {
// Ref // Ref
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">'; print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['m.datem']['checked'])) if (! empty($arrayfields['m.datem']['checked']))
@ -758,20 +758,20 @@ if ($resql)
{ {
// Product Ref // Product Ref
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="6" name="search_product_ref" value="'.($idproduct?$product->ref:$search_product_ref).'">'; print '<input class="flat" type="text" size="6" name="search_product_ref" value="'.dol_escape_htmltag($idproduct?$product->ref:$search_product_ref).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['p.label']['checked'])) if (! empty($arrayfields['p.label']['checked']))
{ {
// Product label // Product label
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="search_product" value="'.($idproduct?$product->label:$search_product).'">'; print '<input class="flat" type="text" size="10" name="search_product" value="'.dol_escape_htmltag($idproduct?$product->label:$search_product).'">';
print '</td>'; print '</td>';
} }
// Batch // Batch
if (! empty($arrayfields['m.batch']['checked'])) if (! empty($arrayfields['m.batch']['checked']))
{ {
print '<td align="center"><input class="flat" type="text" size="5" name="search_batch" value="'.($search_batch).'"></td>'; print '<td align="center"><input class="flat" type="text" size="5" name="search_batch" value="'.dol_escape_htmltag($search_batch).'"></td>';
} }
if (! empty($arrayfields['pl.eatby']['checked'])) if (! empty($arrayfields['pl.eatby']['checked']))
{ {
@ -795,21 +795,21 @@ if ($resql)
{ {
// Author // Author
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="6" name="search_user" value="'.($search_user).'">'; print '<input class="flat" type="text" size="6" name="search_user" value="'.dol_escape_htmltag($search_user).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['m.inventorycode']['checked'])) if (! empty($arrayfields['m.inventorycode']['checked']))
{ {
// Inventory code // Inventory code
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="4" name="search_inventorycode" value="'.$search_inventorycode.'">'; print '<input class="flat" type="text" size="4" name="search_inventorycode" value="'.dol_escape_htmltag($search_inventorycode).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['m.label']['checked'])) if (! empty($arrayfields['m.label']['checked']))
{ {
// Label of movement // Label of movement
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="8" name="search_movement" value="'.$search_movement.'">'; print '<input class="flat" type="text" size="8" name="search_movement" value="'.dol_escape_htmltag($search_movement).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['origin']['checked'])) if (! empty($arrayfields['origin']['checked']))
@ -823,7 +823,7 @@ if ($resql)
{ {
// Qty // Qty
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="4" name="search_qty" value="'.$search_qty.'">'; print '<input class="flat" type="text" size="4" name="search_qty" value="'.dol_escape_htmltag($search_qty).'">';
print '</td>'; print '</td>';
} }
// Extra fields // Extra fields

View File

@ -143,6 +143,7 @@ if ($object->id > 0)
print "</table>\n"; print "</table>\n";
print '</div>'; print '</div>';
dol_fiche_end(); dol_fiche_end();