Complete work on dol_banner

This commit is contained in:
Laurent Destailleur 2016-12-09 11:16:04 +01:00
parent 612c7fde5e
commit d5e417010f
10 changed files with 302 additions and 214 deletions

View File

@ -142,10 +142,6 @@ if ($id > 0 || ! empty($ref))
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$soc = new Societe($db);
$soc->fetch($object->socid);
$head = commande_prepare_head($object); $head = commande_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), 0, 'order'); dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), 0, 'order');
@ -160,7 +156,7 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $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); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, '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))
{ {
@ -196,10 +192,6 @@ if ($id > 0 || ! empty($ref))
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
// Order card
$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end(); dol_fiche_end();
@ -216,7 +208,7 @@ if ($id > 0 || ! empty($ref))
} }
else else
{ {
// Contrat non trouve // Contact not found
print "ErrorRecordNotFound"; print "ErrorRecordNotFound";
} }
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
@ -159,7 +159,7 @@ if ($id > 0 || ! empty($ref))
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; print '<tr><td class="titlefield">'.$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>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n"; print "</table>\n";

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-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <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) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* *

View File

@ -1813,7 +1813,7 @@ elseif (! empty($object->id))
// Author // Author
print '<tr><td class="titlefield">'.$langs->trans("AuthorRequest").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("AuthorRequest").'</td>';
print '<td>'.$author->getNomUrl(1).'</td>'; print '<td>'.$author->getNomUrl(1, '', 0, 0, 0).'</td>';
print '</tr>'; print '</tr>';
// Conditions de reglement par defaut // Conditions de reglement par defaut
@ -2672,15 +2672,13 @@ elseif (! empty($object->id))
if ($user->rights->fournisseur->commande->commander && $object->statut == 2) if ($user->rights->fournisseur->commande->commander && $object->statut == 2)
{ {
/* // Set status to ordered (action=commande)
* Commander (action=commande)
*/
print '<!-- form to record supplier order -->'."\n"; print '<!-- form to record supplier order -->'."\n";
print '<form name="commande" action="card.php?id='.$object->id.'&amp;action=commande" method="post">'; print '<form name="commande" action="card.php?id='.$object->id.'&amp;action=commande" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="commande">'; print '<input type="hidden" name="action" value="commande">';
print load_fiche_titre($langs->trans("ToOrder"),'',''); print load_fiche_titre($langs->trans("ToOrder"),'','');
print '<table class="border" width="100%">'; print '<table class="noborder" width="100%">';
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>'; //print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>'; print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
$date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
@ -2700,15 +2698,14 @@ elseif (! empty($object->id))
if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4)) if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4))
{ {
/* // Set status to received (action=livraison)
* Receptionner (action=livraison)
*/
print '<!-- form to record supplier order received -->'."\n"; print '<!-- form to record supplier order received -->'."\n";
print '<form action="card.php?id='.$object->id.'" method="post">'; print '<form action="card.php?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="livraison">'; print '<input type="hidden" name="action" value="livraison">';
print load_fiche_titre($langs->trans("Receive"),'',''); print load_fiche_titre($langs->trans("Receive"),'','');
print '<table class="border" width="100%">';
print '<table class="noborder" width="100%">';
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>'; //print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>';
print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>'; print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
print $form->select_date('','',1,1,'',"commande",1,0,1); print $form->select_date('','',1,1,'',"commande",1,0,1);

View File

@ -133,38 +133,60 @@ if ($id > 0 || ! empty($ref))
if ($object->fetch($id, $ref) > 0) if ($object->fetch($id, $ref) > 0)
{ {
$soc = new Societe($db); $object->fetch_thirdparty();
$soc->fetch($object->socid);
$head = ordersupplier_prepare_head($object); $head = ordersupplier_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("SupplierOrder"), 0, 'order'); dol_fiche_head($head, 'contact', $langs->trans("SupplierOrder"), 0, 'order');
// Supplier order card
/*
* Facture synthese pour rappel
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref $morehtmlref='<div class="refidno">';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>'; // Ref supplier
print '<td colspan="2">'; $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1);
print '</td>'; // Thirdparty
print '</tr>'; $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->fournisseur->commande->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>';
// Supplier
print '<tr><td>'.$langs->trans("Supplier")."</td>";
print '<td colspan="2">'.$soc->getNomUrl(1,'supplier').'</td>';
print '</tr>';
print "</table>"; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '</div>'; dol_fiche_end();
print '<br>';
// Contacts lines // Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
@ -65,16 +65,16 @@ $projectid = 0;
if ($_GET["projectid"]) if ($_GET["projectid"])
$projectid = GETPOST("projectid", 'int'); $projectid = GETPOST("projectid", 'int');
$commande = new CommandeFournisseur($db); $object = new CommandeFournisseur($db);
if ($id > 0 || ! empty($ref)) { if ($id > 0 || ! empty($ref)) {
$result = $commande->fetch($id, $ref); $result = $object->fetch($id, $ref);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
$result = $commande->fetch_thirdparty(); $result = $object->fetch_thirdparty();
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -94,9 +94,9 @@ if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED
$error ++; $error ++;
$action = ''; $action = '';
} else { } else {
$result = $commande->calcAndSetStatusDispatch($user); $result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
$action = ''; $action = '';
} }
@ -114,9 +114,9 @@ if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANC
$error ++; $error ++;
$action = ''; $action = '';
} else { } else {
$result = $commande->calcAndSetStatusDispatch($user); $result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
$action = ''; $action = '';
} }
@ -134,9 +134,9 @@ if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_
$error ++; $error ++;
$action = ''; $action = '';
} else { } else {
$result = $commande->calcAndSetStatusDispatch($user); $result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
$action = ''; $action = '';
} }
@ -174,9 +174,9 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
} }
if (! $error) { if (! $error) {
$result = $commande->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger); $result = $object->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
} }
} }
@ -218,9 +218,9 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
} }
if (! $error) { if (! $error) {
$result = $commande->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), $dDLC, $dDLUO, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger); $result = $object->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), $dDLC, $dDLUO, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
} }
} }
@ -229,9 +229,9 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
} }
if (! $error) { if (! $error) {
$result = $commande->calcAndSetStatusDispatch($user, GETPOST('closeopenorder')?1:0); $result = $object->calcAndSetStatusDispatch($user, GETPOST('closeopenorder')?1:0);
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
} }
} }
@ -240,11 +240,11 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
global $conf, $langs, $user; global $conf, $langs, $user;
// Call trigger // Call trigger
$result = $commande->call_trigger('ORDER_SUPPLIER_DISPATCH', $user); $result = $object->call_trigger('ORDER_SUPPLIER_DISPATCH', $user);
// End call triggers // End call triggers
if ($result < 0) { if ($result < 0) {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
} }
} }
@ -275,25 +275,75 @@ llxHeader('', $langs->trans("Order"), $help_url, '', 0, 0, array('/fourn/js/lib_
if ($id > 0 || ! empty($ref)) { if ($id > 0 || ! empty($ref)) {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socid); $soc->fetch($object->socid);
$author = new User($db); $author = new User($db);
$author->fetch($commande->user_author_id); $author->fetch($object->user_author_id);
$head = ordersupplier_prepare_head($commande); $head = ordersupplier_prepare_head($object);
$title = $langs->trans("SupplierOrder"); $title = $langs->trans("SupplierOrder");
dol_fiche_head($head, 'dispatch', $title, 0, 'order'); dol_fiche_head($head, 'dispatch', $title, 0, 'order');
/*
* Commande
*/
print '<table class="border" width="100%">';
// Supplier order card
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $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->fournisseur->commande->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 '<table class="border" width="100%">';
/*
// Ref // Ref
print '<tr><td class="titlefield">' . $langs->trans("Ref") . '</td>'; print '<tr><td class="titlefield">' . $langs->trans("Ref") . '</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->showrefnav($commande, 'ref', '', 1, 'ref', 'ref'); print $form->showrefnav($object, 'ref', '', 1, 'ref', 'ref');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -306,29 +356,31 @@ if ($id > 0 || ! empty($ref)) {
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("Status") . '</td>'; print '<td>' . $langs->trans("Status") . '</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print $commande->getLibStatut(4); print $object->getLibStatut(4);
print "</td></tr>"; print "</td></tr>";
*/
// Date // Date
if ($commande->methode_commande_id > 0) { if ($object->methode_commande_id > 0) {
print '<tr><td>' . $langs->trans("Date") . '</td><td colspan="2">'; print '<tr><td class="titlefield">' . $langs->trans("Date") . '</td><td>';
if ($commande->date_commande) { if ($object->date_commande) {
print dol_print_date($commande->date_commande, "dayhourtext") . "\n"; print dol_print_date($object->date_commande, "dayhourtext") . "\n";
} }
print "</td></tr>"; print "</td></tr>";
if ($commande->methode_commande) { if ($object->methode_commande) {
print '<tr><td>' . $langs->trans("Method") . '</td><td colspan="2">' . $commande->methode_commande . '</td></tr>'; print '<tr><td>' . $langs->trans("Method") . '</td><td>' . $object->methode_commande . '</td></tr>';
} }
} }
// Auteur // Auteur
print '<tr><td>' . $langs->trans("AuthorRequest") . '</td>'; print '<tr><td>' . $langs->trans("AuthorRequest") . '</td>';
print '<td colspan="2">' . $author->getNomUrl(1) . '</td>'; print '<td>' . $author->getNomUrl(1, '', 0, 0, 0) . '</td>';
print '</tr>'; print '</tr>';
print "</table>"; print "</table>";
print '</div>';
// if ($mesg) print $mesg; // if ($mesg) print $mesg;
print '<br>'; print '<br>';
@ -336,20 +388,20 @@ if ($id > 0 || ! empty($ref)) {
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
$disabled = 0; $disabled = 0;
/* // Line of orders
* Lignes de commandes if ($object->statut <= 2 || $object->statut >= 6) {
*/
if ($commande->statut <= 2 || $commande->statut >= 6) {
print $langs->trans("OrderStatusNotReadyToDispatch"); print $langs->trans("OrderStatusNotReadyToDispatch");
} }
if ($commande->statut == 3 || $commande->statut == 4 || $commande->statut == 5) { if ($object->statut == 3 || $object->statut == 4 || $object->statut == 5) {
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$listwarehouses = $entrepot->list_array(1); $listwarehouses = $entrepot->list_array(1);
print '<form method="POST" action="dispatch.php?id=' . $commande->id . '">'; print '<form method="POST" action="dispatch.php?id=' . $object->id . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="dispatch">'; print '<input type="hidden" name="action" value="dispatch">';
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Set $products_dispatched with qty dispatched for each product id // Set $products_dispatched with qty dispatched for each product id
@ -357,7 +409,7 @@ if ($id > 0 || ! empty($ref)) {
$sql = "SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty"; $sql = "SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur_dispatch as cfd"; $sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur_dispatch as cfd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "commande_fournisseurdet as l on l.rowid = cfd.fk_commandefourndet"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "commande_fournisseurdet as l on l.rowid = cfd.fk_commandefourndet";
$sql .= " WHERE cfd.fk_commande = " . $commande->id; $sql .= " WHERE cfd.fk_commande = " . $object->id;
$sql .= " GROUP BY l.rowid, cfd.fk_product"; $sql .= " GROUP BY l.rowid, cfd.fk_product";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -379,7 +431,7 @@ if ($id > 0 || ! empty($ref)) {
$sql .= " p.ref, p.label, p.tobatch"; $sql .= " p.ref, p.label, p.tobatch";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l"; $sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid";
$sql .= " WHERE l.fk_commande = " . $commande->id; $sql .= " WHERE l.fk_commande = " . $object->id;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
$sql .= " AND l.product_type = 0"; $sql .= " AND l.product_type = 0";
$sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product $sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
@ -414,8 +466,9 @@ if ($id > 0 || ! empty($ref)) {
} }
} }
$nbfreeproduct = 0; $nbfreeproduct = 0; // Nb of lins of free products/services
$nbproduct = 0; $nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
$var = false; $var = false;
while ( $i < $num ) { while ( $i < $num ) {
@ -546,30 +599,35 @@ if ($id > 0 || ! empty($ref)) {
} }
print "</table>\n"; print "</table>\n";
print "<br/>\n"; print '</div>';
print "<br>\n";
if ($nbproduct) if ($nbproduct)
{ {
$checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($commande->statuts[5])); $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5]));
print '<br><div class="center">'; print '<br><div class="center">';
print $langs->trans("Comment") . ' : '; print $langs->trans("Comment") . ' : ';
print '<input type="text" size="60" maxlength="128" name="comment" value="'; print '<input type="text" class="minwidth200" maxlength="128" name="comment" value="';
print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $commande->ref); print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
// print ' / '.$commande->ref_supplier; // Not yet available // print ' / '.$object->ref_supplier; // Not yet available
print '" class="flat"><br>'; print '" class="flat"><br>';
print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel; print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel;
// print '<div class="center">';
print '<br><input type="submit" class="button" value="' . $langs->trans("DispatchVerb") . '"'; print '<br><input type="submit" class="button" value="' . $langs->trans("DispatchVerb") . '"';
if (count($listwarehouses) <= 0) if (count($listwarehouses) <= 0)
print ' disabled'; print ' disabled';
print '>'; print '>';
// print '</div>'; print '</div>';
} }
if (! $nbproduct && $nbfreeproduct) {
print $langs->trans("NoPredefinedProductToDispatch"); // Message if nothing to dispatch
if (! $nbproduct) {
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
print $langs->trans("NoPredefinedProductToDispatch"); // No predefined line at all
else
print $langs->trans("NoMorePredefinedProductToDispatch"); // No predefined line that remain to be dispatched.
} }
print '</form>'; print '</form>';
@ -577,6 +635,7 @@ if ($id > 0 || ! empty($ref)) {
dol_fiche_end(); dol_fiche_end();
// List of lines already dispatched // List of lines already dispatched
$sql = "SELECT p.ref, p.label,"; $sql = "SELECT p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.label as entrepot,"; $sql .= " e.rowid as warehouse_id, e.label as entrepot,";
@ -584,7 +643,7 @@ if ($id > 0 || ! empty($ref)) {
$sql .= " FROM " . MAIN_DB_PREFIX . "product as p,"; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p,";
$sql .= " " . MAIN_DB_PREFIX . "commande_fournisseur_dispatch as cfd"; $sql .= " " . MAIN_DB_PREFIX . "commande_fournisseur_dispatch as cfd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "entrepot as e ON cfd.fk_entrepot = e.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "entrepot as e ON cfd.fk_entrepot = e.rowid";
$sql .= " WHERE cfd.fk_commande = " . $commande->id; $sql .= " WHERE cfd.fk_commande = " . $object->id;
$sql .= " AND cfd.fk_product = p.rowid"; $sql .= " AND cfd.fk_product = p.rowid";
$sql .= " ORDER BY cfd.rowid ASC"; $sql .= " ORDER BY cfd.rowid ASC";
@ -594,10 +653,11 @@ if ($id > 0 || ! empty($ref)) {
$i = 0; $i = 0;
if ($num > 0) { if ($num > 0) {
print "<br/>\n"; print "<br>\n";
print load_fiche_titre($langs->trans("ReceivingForSameOrder")); print load_fiche_titre($langs->trans("ReceivingForSameOrder"));
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -666,7 +726,7 @@ if ($id > 0 || ! empty($ref)) {
} }
} else { } else {
$disabled = ''; $disabled = '';
if ($commande->statut == 5) if ($object->statut == 5)
$disabled = 1; $disabled = 1;
if (empty($objp->status)) { if (empty($objp->status)) {
print '<a class="button' . ($disabled ? ' buttonRefused' : '') . '" href="' . $_SERVER["PHP_SELF"] . "?id=" . $id . "&action=checkdispatchline&lineid=" . $objp->dispatchlineid . '">' . $langs->trans("Approve") . '</a>'; print '<a class="button' . ($disabled ? ' buttonRefused' : '') . '" href="' . $_SERVER["PHP_SELF"] . "?id=" . $id . "&action=checkdispatchline&lineid=" . $objp->dispatchlineid . '">' . $langs->trans("Approve") . '</a>';
@ -692,6 +752,7 @@ if ($id > 0 || ! empty($ref)) {
$db->free($resql); $db->free($resql);
print "</table>\n"; print "</table>\n";
print '</div>';
} }
} else { } else {
dol_print_error($db); dol_print_error($db);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
@ -74,6 +74,7 @@ if ($object->fetch($id,$ref) < 0)
$upload_dir = $conf->fournisseur->dir_output.'/commande/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->fournisseur->dir_output.'/commande/'.dol_sanitizeFileName($object->ref);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
/* /*
* Actions * Actions
*/ */
@ -92,6 +93,8 @@ if ($object->id > 0)
$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; $help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
llxHeader('',$langs->trans("Order"),$help_url); llxHeader('',$langs->trans("Order"),$help_url);
$object->fetch_thirdparty();
$author = new User($db); $author = new User($db);
$author->fetch($object->user_author_id); $author->fetch($object->user_author_id);
@ -108,57 +111,67 @@ if ($object->id > 0)
$totalsize+=$file['size']; $totalsize+=$file['size'];
} }
// Supplier order card
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref $morehtmlref='<div class="refidno">';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>'; // Ref supplier
print '<td colspan="2">'; $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1);
print '</td>'; // Thirdparty
print '</tr>'; $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
// Fournisseur if (! empty($conf->projet->enabled))
print '<tr><td>'.$langs->trans("Supplier")."</td>";
print '<td colspan="2">'.$object->thirdparty->getNomUrl(1,'supplier').'</td>';
print '</tr>';
// Statut
print '<tr>';
print '<td>'.$langs->trans("Status").'</td>';
print '<td colspan="2">';
print $object->getLibStatut(4);
print "</td></tr>";
// Date
if ($object->methode_commande_id > 0)
{ {
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">'; $langs->load("projects");
if ($object->date_commande) $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->fournisseur->commande->creer)
{ {
print dol_print_date($object->date_commande,"dayhourtext")."\n"; 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);
} }
print "</td></tr>"; } else {
if (! empty($object->fk_project)) {
if ($object->methode_commande) $proj = new Project($db);
{ $proj->fetch($object->fk_project);
print '<tr><td>'.$langs->trans("Method").'</td><td colspan="2">'.$object->getInputMethod().'</td></tr>'; $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>';
// Auteur dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '</tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
print '<tr><td class="titlefield">'.$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>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n"; print "</table>\n";
print "</div>\n"; print "</div>\n";
dol_fiche_end();
$modulepart = 'commande_fournisseur'; $modulepart = 'commande_fournisseur';
$permission = $user->rights->fournisseur->commande->creer; $permission = $user->rights->fournisseur->commande->creer;
$permtoedit = $user->rights->fournisseur->commande->creer; $permtoedit = $user->rights->fournisseur->commande->creer;
@ -169,6 +182,7 @@ if ($object->id > 0)
else else
{ {
header('Location: index.php'); header('Location: index.php');
exit;
} }

View File

@ -130,7 +130,7 @@ if (empty($user->socid)) $fieldstosearchall["cf.note_private"]="NotePrivate";
$checkedtypetiers=0; $checkedtypetiers=0;
$arrayfields=array( $arrayfields=array(
'cf.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'cf.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'cf.ref_supplier'=>array('label'=>$langs->trans("RefOrderSupplier"), 'checked'=>1, 'enabled'=>1), 'cf.ref_supplier'=>array('label'=>$langs->trans("RefOrderSupplierShort"), 'checked'=>1, 'enabled'=>1),
'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0, 'enabled'=>1), 'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0, 'enabled'=>1),
'u.login'=>array('label'=>$langs->trans("AuthorRequest"), 'checked'=>1), 'u.login'=>array('label'=>$langs->trans("AuthorRequest"), 'checked'=>1),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* *
@ -74,8 +74,7 @@ if ($id > 0 || ! empty($ref))
{ {
if ($result >= 0) if ($result >= 0)
{ {
$soc = new Societe($db); $object->fetch_thirdparty();
$soc->fetch($object->socid);
$author = new User($db); $author = new User($db);
$author->fetch($object->user_author_id); $author->fetch($object->user_author_id);
@ -85,61 +84,63 @@ if ($id > 0 || ! empty($ref))
$title=$langs->trans("SupplierOrder"); $title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'note', $title, 0, 'order'); dol_fiche_head($head, 'note', $title, 0, 'order');
// Supplier order card
/*
* Commande
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref $morehtmlref='<div class="refidno">';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>'; // Ref supplier
print '<td colspan="2">'; $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1);
print '</td>'; // Thirdparty
print '</tr>'; $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
// Fournisseur if (! empty($conf->projet->enabled))
print '<tr><td>'.$langs->trans("Supplier")."</td>";
print '<td colspan="2">'.$soc->getNomUrl(1,'supplier').'</td>';
print '</tr>';
// Statut
print '<tr>';
print '<td>'.$langs->trans("Status").'</td>';
print '<td colspan="2">';
print $object->getLibStatut(4);
print "</td></tr>";
// Date
if ($object->methode_commande_id > 0)
{ {
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">'; $langs->load("projects");
if ($object->date_commande) $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->fournisseur->commande->creer)
{ {
print dol_print_date($object->date_commande,"dayhourtext")."\n"; 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);
} }
print "</td></tr>"; } else {
if (! empty($object->fk_project)) {
if ($object->methode_commande) $proj = new Project($db);
{ $proj->fetch($object->fk_project);
print '<tr><td>'.$langs->trans("Method").'</td><td colspan="2">'.$object->getInputMethod().'</td></tr>'; $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>';
// Author dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '</tr>';
print "</table>";
print '<br>'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$colwidth=20;
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print '</div>';
dol_fiche_end(); dol_fiche_end();
} }
else else

View File

@ -101,6 +101,7 @@ OnProcessOrders=In process orders
RefOrder=Ref. order RefOrder=Ref. order
RefCustomerOrder=Ref. order for customer RefCustomerOrder=Ref. order for customer
RefOrderSupplier=Ref. order for supplier RefOrderSupplier=Ref. order for supplier
RefOrderSupplierShort=Ref. order supplier
SendOrderByMail=Send order by mail SendOrderByMail=Send order by mail
ActionsOnOrder=Events on order ActionsOnOrder=Events on order
NoArticleOfTypeProduct=No article of type 'product' so no shippable article for this order NoArticleOfTypeProduct=No article of type 'product' so no shippable article for this order