From aad4380689d25f32690fb2587c1a8806e5b5c9d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Mon, 24 Oct 2016 20:52:21 +0200 Subject: [PATCH] Uniformise code --- htdocs/core/lib/sendings.lib.php | 10 +- htdocs/expedition/card.php | 14 +- htdocs/expedition/contact.php | 150 ++++++++++-------- htdocs/expedition/note.php | 116 +++++++------- .../product/class/html.formproduct.class.php | 2 +- htdocs/product/composition/card.php | 5 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stock/card.php | 90 ++--------- htdocs/product/stock/info.php | 26 ++- htdocs/product/stock/mouvement.php | 85 +++++----- htdocs/product/stock/replenish.php | 14 +- htdocs/projet/document.php | 4 +- htdocs/user/info.php | 1 - 13 files changed, 231 insertions(+), 288 deletions(-) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index a6091f8ebb0..06eb19de48e 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; */ function shipping_prepare_head($object) { - global $langs, $conf, $user; + global $db, $langs, $conf, $user; $langs->load("sendings"); $langs->load("deliveries"); @@ -64,7 +64,13 @@ function shipping_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { - $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $objectsrc = $object; + if ($object->origin == 'commande' && $object->origin_id > 0) + { + $objectsrc = new Commande($db); + $objectsrc->fetch($object->origin_id); + } + $nbContact = count($objectsrc->liste_contact(-1,'internal')) + count($objectsrc->liste_contact(-1,'external')); $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; $head[$h][1] = $langs->trans("ContactsAddresses"); if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 37b9f8a7248..fb45993f567 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1295,7 +1295,7 @@ else if ($id || $ref) $totalVolume=$tmparray['volume']; - // Warehouse card + // Shipment card $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>'; $morehtmlref='<div class="refidno">'; @@ -1348,18 +1348,6 @@ else if ($id || $ref) print '<table class="border" width="100%">'; - // Ref - /* - print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; - print '<td colspan="3">'; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '</td></tr>'; - - // Customer - print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; - print '<td colspan="3">'.$soc->getNomUrl(1).'</td>'; - print "</tr>";*/ - // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 039af2cd0ec..65a44cb64f9 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -155,83 +155,99 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'contact', $langs->trans("Shipment"), 0, 'sending'); - /* - * Facture synthese pour rappel - */ - print '<table class="border" width="100%">'; - + // Shipment card $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>'; + + $morehtmlref='<div class="refidno">'; + // Ref customer shipment + $morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, '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->supplier_proposal->creer) { + if ($action != 'classify') { + $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + } + 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" 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="fichehalfleft">'; + print '<div class="underbanner clearboth"></div>'; + + print '<table class="border centpercent">'; - // Ref - print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">'; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print "</td></tr>"; - - // Customer - print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; - print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td>'; - print "</tr>"; - - // Linked documents + // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { - print '<tr><td>'; - $objectsrc=new Commande($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefOrder").'</td>'; - print '<td colspan="3">'; - print $objectsrc->getNomUrl(1,'commande'); - print "</td>\n"; - print '</tr>'; + print '<tr><td class="titlefield">'; + $objectsrc=new Commande($db); + $objectsrc->fetch($object->$typeobject->id); + print $langs->trans("RefOrder").'</td>'; + print '<td colspan="3">'; + print $objectsrc->getNomUrl(1,'commande'); + print "</td>\n"; + print '</tr>'; } if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { - print '<tr><td>'; - $objectsrc=new Propal($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefProposal").'</td>'; - print '<td colspan="3">'; - print $objectsrc->getNomUrl(1,'expedition'); - print "</td>\n"; - print '</tr>'; - } - - // Ref expedition client - print '<tr><td>'; - print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">'; - print $langs->trans('RefCustomer').'</td><td align="left">'; - print '</td>'; - print '</tr></table>'; - print '</td><td colspan="3">'; - print $objectsrc->ref_client; - print '</td>'; - print '</tr>'; - - // Delivery address - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) - { - print '<tr><td>'; - print '<table class="nobordernopadding" width="100%"><tr><td>'; - print $langs->trans('DeliveryAddress'); - print '</td>'; - - if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&socid='.$object->socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td colspan="3">'; - - if ($action == 'editdelivery_address') - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','shipping',$object->id); - } - else - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','shipping',$object->id); - } - print '</td></tr>'; + print '<tr><td class="titlefield">'; + $objectsrc=new Propal($db); + $objectsrc->fetch($object->$typeobject->id); + print $langs->trans("RefProposal").'</td>'; + print '<td colspan="3">'; + print $objectsrc->getNomUrl(1,'expedition'); + print "</td>\n"; + print '</tr>'; } - + print "</table>"; + + //print '</div>'; + //print '<div class="fichehalfright">'; + //print '<div class="ficheaddleft">'; + //print '<div class="underbanner clearboth"></div>'; + + + //print '</div>'; + //print '</div>'; + print '</div>'; + + print '<div class="clearboth"></div>'; + + dol_fiche_end(); // Lignes de contacts diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 652b09453f7..849ec6e66bc 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -20,9 +20,9 @@ /** * \file htdocs/expedition/note.php -* \ingroup expedition -* \brief Note card expedition -*/ + * \ingroup expedition + * \brief Note card expedition + */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -99,65 +99,57 @@ if ($id > 0 || ! empty($ref)) $head=shipping_prepare_head($object); dol_fiche_head($head, 'note', $langs->trans("Shipment"), 0, 'sending'); - print '<table class="border" width="100%">'; - - $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>'; - - // Ref - print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; - print '<td colspan="3">'; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '</td></tr>'; - - // Customer - print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; - print '<td colspan="3">'.$soc->getNomUrl(1).'</td>'; - print "</tr>"; - - // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) - { - print '<tr><td>'; - $objectsrc=new Commande($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefOrder").'</td>'; - print '<td colspan="3">'; - print $objectsrc->getNomUrl(1,'commande'); - print "</td>\n"; - print '</tr>'; - } - if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) - { - print '<tr><td>'; - $objectsrc=new Propal($db); - $objectsrc->fetch($object->$typeobject->id); - print $langs->trans("RefProposal").'</td>'; - print '<td colspan="3">'; - print $objectsrc->getNomUrl(1,'expedition'); - print "</td>\n"; - print '</tr>'; - } - - // Ref customer - print '<tr><td>'.$langs->trans("RefCustomer").'</td>'; - print '<td colspan="3">'.$object->ref_customer."</a></td>\n"; - print '</tr>'; - - // Date creation - print '<tr><td>'.$langs->trans("DateCreation").'</td>'; - print '<td colspan="3">'.dol_print_date($object->date_creation,"day")."</td>\n"; - print '</tr>'; - - // Delivery date planed - print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>'; - print '<td colspan="3">'.dol_print_date($object->date_delivery,"dayhourtext")."</td>\n"; - print '</tr>'; - - print '</table>'; - - print '<br>'; - - $colwidth=20; + + // Shipment card + $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>'; + + $morehtmlref='<div class="refidno">'; + // Ref customer shipment + $morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, '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->supplier_proposal->creer) { + if ($action != 'classify') { + $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + } + 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" 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="underbanner clearboth"></div>'; + + $cssclass='titlefield'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; dol_fiche_end(); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index d1fe225ba0e..8ae04e61c91 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -105,7 +105,7 @@ class FormProduct if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.implode(',', $exclude).')'; - if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description"; + if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent"; $sql.= " ORDER BY e.label"; dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index e1644c241e5..3e3fc2d4414 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -207,12 +207,13 @@ if ($id > 0 || ! empty($ref)) dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - print '<table class="noborder tableforfield" width="100%">'; + print '<div class="underbanner clearboth"></div>'; + print '<table class="border tableforfield" width="100%">'; // Nature if($object->type!=Product::TYPE_SERVICE) { - print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="2">'; + print '<tr><td>'.$langs->trans("Nature").'</td><td>'; print $object->getLibFinished(); print '</td></tr>'; } diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index ebb28b48287..3f92cd11b18 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -124,7 +124,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') $linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>'; - dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); dol_fiche_end(); } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 5adff357db1..f1097b331b9 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -191,7 +191,7 @@ if ($action == 'create') print '<table class="border" width="100%">'; // Ref - print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="20" value=""></td></tr>'; + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input name="libelle" size="20" value=""></td></tr>'; print '<tr><td >'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.(!empty($object->lieu)?$object->lieu:'').'"></td></tr>'; @@ -201,31 +201,32 @@ if ($action == 'create') print '</td></tr>'; // Description - print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">'; + print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('desc',(!empty($object->description)?$object->description:''),'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); $doleditor->Create(); print '</td></tr>'; - print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">'; + print '<tr><td>'.$langs->trans('Address').'</td><td><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">'; print (!empty($object->address)?$object->address:''); print '</textarea></td></tr>'; // Zip / Town print '<tr><td>'.$langs->trans('Zip').'</td><td>'; print $formcompany->select_ziptown((!empty($object->zip)?$object->zip:''),'zipcode',array('town','selectcountry_id','state_id'),6); - print '</td><td>'.$langs->trans('Town').'</td><td>'; + print '</td></tr>'; + print '<tr><td>'.$langs->trans('Town').'</td><td>'; print $formcompany->select_ziptown((!empty($object->town)?$object->town:''),'town',array('zipcode','selectcountry_id','state_id')); print '</td></tr>'; // Country - print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; + print '<tr><td>'.$langs->trans('Country').'</td><td>'; print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '</td></tr>'; // Status - print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; + print '<tr><td>'.$langs->trans("Status").'</td><td>'; print '<select name="statut" class="flat">'; foreach ($object->statuts as $key => $value) { @@ -295,51 +296,12 @@ else // Warehouse card $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>'; - $morehtmlref='<div class="refidno">'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; - /* - // Ref supplier - //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); - //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); - // Thirdparty - //$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='<br>'.$langs->trans('Project') . ' '; - if ($user->rights->supplier_proposal->creer) - { - if ($action != 'classify') - $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; - 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, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); - + print '<div class="fichecenter">'; print '<div class="fichehalfleft">'; @@ -347,15 +309,6 @@ else print '<table class="border" width="100%">'; - - // Ref - /* - print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'; - print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle'); - print '</td>';*/ - - //print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$object->lieu.'</td></tr>'; - // Parent entrepot $e = new Entrepot($db); if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) { @@ -367,30 +320,7 @@ else } // Description - print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>'; - - // Address - /* - print '<tr><td>'.$langs->trans('Address').'</td><td>'; - print $object->address; - print '</td></tr>'; - - // Town - print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$object->zip.'</td></tr>'; - print '<tr><td>'.$langs->trans('Town').'</td><td>'.$object->town.'</td></tr>'; - - // Country - print '<tr><td>'.$langs->trans('Country').'</td><td>'; - if (! empty($object->country_code)) - { - $img=picto_from_langcode($object->country_code); - print ($img?$img.' ':''); - } - print $object->country; - print '</td></tr>';*/ - - // Status - //print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>'; + print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>'; $calcproductsunique=$object->nb_different_products(); $calcproducts=$object->nb_products(); @@ -415,7 +345,7 @@ else print '<table class="border centpercent">'; // Value - print '<tr><td>'.$langs->trans("EstimatedStockValueShort").'</td><td>'; + print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>'; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print "</td></tr>"; diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index f9c5e163f4d..7f6a9f6031b 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -39,18 +39,30 @@ $result=restrictedArea($user,'stock'); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("",$langs->trans("Stocks"),$help_url); -$entrepot = new Entrepot($db); -$entrepot->fetch($_GET["id"]); -$entrepot->info($_GET["id"]); +$object = new Entrepot($db); +$object->fetch($_GET["id"]); +$object->info($_GET["id"]); -$head = stock_prepare_head($entrepot); +$head = stock_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Warehouse"), 0, 'stock'); -print '<table width="100%"><tr><td>'; -dol_print_object_info($entrepot); -print '</td></tr></table>'; +$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>'; + +$morehtmlref='<div class="refidno">'; +$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; +$morehtmlref.='</div>'; + +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); + + +print '<div class="fichecenter">'; +print '<div class="underbanner clearboth"></div>'; + +print '<br>'; + +dol_print_object_info($object); print '</div>'; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 49b27e0fc74..aa9c7c2f566 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -410,8 +410,8 @@ if ($resql) if ($id > 0) { - $entrepot = new Entrepot($db); - $result = $entrepot->fetch($id); + $object = new Entrepot($db); + $result = $object->fetch($id); if ($result < 0) { dol_print_error($db); @@ -430,69 +430,60 @@ if ($resql) */ if ($id) { - $head = stock_prepare_head($entrepot); + $head = stock_prepare_head($object); dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), 0, 'stock'); - - print '<table class="border" width="100%">'; - + $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>'; - - // Ref - print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'; - print $form->showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle'); - print '</td>'; - - print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>'; + + $morehtmlref='<div class="refidno">'; + $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; + $morehtmlref.='</div>'; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); + + + print '<div class="fichecenter">'; + print '<div class="fichehalfleft">'; + print '<div class="underbanner clearboth"></div>'; + + print '<table class="border" width="100%">'; // Description - print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.dol_htmlentitiesbr($entrepot->description).'</td></tr>'; - - // Address - print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">'; - print $entrepot->address; - print '</td></tr>'; - - // Town - print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$entrepot->zip.'</td>'; - print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$entrepot->town.'</td></tr>'; + print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'.dol_htmlentitiesbr($object->description).'</td></tr>'; - // Country - print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; - if (! empty($entrepot->country_code)) - { - $img=picto_from_langcode($entrepot->country_code); - print ($img?$img.' ':''); - print $entrepot->country; - } - print '</td></tr>'; - - // Status - print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>'; - - $calcproductsunique=$entrepot->nb_different_products(); - $calcproducts=$entrepot->nb_products(); + $calcproductsunique=$object->nb_different_products(); + $calcproducts=$object->nb_products(); // Total nb of different products - print '<tr><td valign="top">'.$langs->trans("NumberOfDifferentProducts").'</td><td colspan="3">'; + print '<tr><td>'.$langs->trans("NumberOfDifferentProducts").'</td><td>'; print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; print "</td></tr>"; // Nb of products - print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">'; + print '<tr><td>'.$langs->trans("NumberOfProducts").'</td><td>'; print empty($calcproducts['nb'])?'0':$calcproducts['nb']; print "</td></tr>"; + print '</table>'; + + print '</div>'; + print '<div class="fichehalfright">'; + print '<div class="ficheaddleft">'; + print '<div class="underbanner clearboth"></div>'; + + print '<table class="border centpercent">'; + // Value - print '<tr><td valign="top">'.$langs->trans("EstimatedStockValueShort").'</td><td colspan="3">'; + print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>'; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print "</td></tr>"; // Last movement $sql = "SELECT MAX(m.datem) as datem"; $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; - $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."'"; + $sql .= " WHERE m.fk_entrepot = '".$object->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) { @@ -504,7 +495,7 @@ if ($resql) dol_print_error($db); } - print '<tr><td valign="top">'.$langs->trans("LastMovement").'</td><td colspan="3">'; + print '<tr><td>'.$langs->trans("LastMovement").'</td><td>'; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour'); @@ -517,6 +508,12 @@ if ($resql) print "</table>"; + print '</div>'; + print '</div>'; + print '</div>'; + + print '<div class="clearboth"></div>'; + dol_fiche_end(); } @@ -526,7 +523,6 @@ if ($resql) */ if ($action == "correction") { - if ($id) $object=$entrepot; include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stockcorrection.tpl.php'; print '<br>'; } @@ -536,7 +532,6 @@ if ($resql) */ if ($action == "transfert") { - if ($id) $object=$entrepot; include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stocktransfer.tpl.php'; print '<br>'; } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 3a9b601c2ec..a9b2dc57b1b 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -438,11 +438,15 @@ print '<input type="hidden" name="sref" value="'.$sref.'">'; print '<input type="hidden" name="snom" value="'.$snom.'">'; print '<input type="hidden" name="salert" value="'.$salert.'">'; print '<input type="hidden" name="mode" value="'.$mode.'">'; -print $langs->trans('Warehouse').' : '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); -print '<br />'; -print $langs->trans('Supplier').' : '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1); -print '<br />'; -print ' <input class="button" type="submit" name="valid" value="'.$langs->trans('ToFilter').'">'; +print '<div class="inline-block valignmiddle" style="padding-right: 20px;">'; +print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); +print '</div>'; +print '<div class="inline-block valignmiddle" style="padding-right: 20px;">'; +print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1); +print '</div>'; +print '<div class="inline-block valignmiddle">'; +print '<input class="button" type="submit" name="valid" value="'.$langs->trans('ToFilter').'">'; +print '</div>'; print '</form>'; if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) { diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index c4f1f7df615..d5768c355a2 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -137,8 +137,8 @@ if ($object->id > 0) print '<table class="border" width="100%">'; // Files infos - print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; - print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; + 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"; diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 1d10875b3eb..e27fcf56266 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -76,7 +76,6 @@ $object->info($id); // This overwrite ->ref with login instead of id print '<div class="fichecenter">'; - print '<div class="underbanner clearboth"></div>'; print '<br>'; -- GitLab