Work on MO
This commit is contained in:
parent
66337ec234
commit
beb85ee3a8
@ -108,7 +108,6 @@ if ($action == 'update' && ! empty($permissiontoadd))
|
|||||||
{
|
{
|
||||||
if (! GETPOSTISSET($key)) continue; // The field was not submited to be edited
|
if (! GETPOSTISSET($key)) continue; // The field was not submited to be edited
|
||||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
|
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
|
||||||
var_dump($object->fields[$key]['type']);
|
|
||||||
// Set value to update
|
// Set value to update
|
||||||
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
||||||
$value = GETPOST($key, 'none');
|
$value = GETPOST($key, 'none');
|
||||||
|
|||||||
@ -5,6 +5,7 @@ MRPArea=MRP Area
|
|||||||
MrpSetupPage=Setup of module MO
|
MrpSetupPage=Setup of module MO
|
||||||
MenuBOM=Bills of material
|
MenuBOM=Bills of material
|
||||||
LatestBOMModified=Latest %s Bills of materials modified
|
LatestBOMModified=Latest %s Bills of materials modified
|
||||||
|
LatestMOModified=Latest %s Manufacturing Orders modified
|
||||||
Bom=Bills of Material
|
Bom=Bills of Material
|
||||||
BillOfMaterials=Bill of Material
|
BillOfMaterials=Bill of Material
|
||||||
BOMsSetup=Setup of module BOM
|
BOMsSetup=Setup of module BOM
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -130,6 +130,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
/*
|
/*
|
||||||
* Last modified BOM
|
* Last modified BOM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$max=5;
|
$max=5;
|
||||||
|
|
||||||
$sql = "SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
|
$sql = "SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
|
||||||
@ -179,12 +180,63 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Last modified MOs
|
||||||
|
*/
|
||||||
|
|
||||||
|
$max=5;
|
||||||
|
|
||||||
|
$sql = "SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."mrp_mo as a";
|
||||||
|
$sql.= " WHERE a.entity IN (".getEntity('mo').")";
|
||||||
|
$sql.= $db->order("a.tms", "DESC");
|
||||||
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th colspan="4">'.$langs->trans("LatestMOModified", $max).'</th></tr>';
|
||||||
|
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$staticmo->id=$obj->rowid;
|
||||||
|
$staticmo->ref=$obj->ref;
|
||||||
|
$staticmo->date_modification=$obj->datem;
|
||||||
|
$staticmo->status=$obj->status;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$staticmo->getNomUrl(1, 32).'</td>';
|
||||||
|
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
|
||||||
|
print '<td class="right">'.$staticmo->getLibStatut(5).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td><span class="opacitymedium">' . $langs->trans("None") . '</span></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
print "</table></div>";
|
||||||
|
print "<br>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
$parameters = array('type' => $type, 'user' => $user);
|
$parameters = array('type' => $type, 'user' => $user);
|
||||||
$reshook = $hookmanager->executeHooks('dashboardMRP', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('dashboardMRP', $parameters, null); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -463,6 +463,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate
|
||||||
|
if ($user->rights->mrp->write && $object->status == MO::STATUS_DRAFT)
|
||||||
|
{
|
||||||
|
if (is_array($object->lines) && count($object->lines) > 0)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=validate">' . $langs->trans("Validate") . '</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">' . $langs->trans("Validate") . '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if (! empty($user->rights->mrp->write))
|
if (! empty($user->rights->mrp->write))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user