Fix link and selection of status of purchase order.
This commit is contained in:
parent
22c2cfd9ec
commit
b043442b91
@ -62,7 +62,10 @@ class FormOrder extends Form
|
|||||||
$options[$value] = $tmpsupplierorder->getLibStatut($short);
|
$options[$value] = $tmpsupplierorder->getLibStatut($short);
|
||||||
}
|
}
|
||||||
|
|
||||||
print Form::selectarray($hmlname, $options, $selected, 1);
|
if (is_array($selected)) $selectedarray = $selected;
|
||||||
|
else $selectedarray = explode(',', $selected);
|
||||||
|
|
||||||
|
print Form::multiselectarray($hmlname, $options, $selectedarray, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -73,7 +73,6 @@ $search_user = GETPOST('search_user', 'int');
|
|||||||
$search_request_author = GETPOST('search_request_author', 'alpha');
|
$search_request_author = GETPOST('search_request_author', 'alpha');
|
||||||
$search_ht = GETPOST('search_ht', 'alpha');
|
$search_ht = GETPOST('search_ht', 'alpha');
|
||||||
$search_ttc = GETPOST('search_ttc', 'alpha');
|
$search_ttc = GETPOST('search_ttc', 'alpha');
|
||||||
$search_status = (GETPOST('search_status', 'alpha') != '' ?GETPOST('search_status', 'alpha') : GETPOST('statut', 'alpha')); // alpha and not intbecause it can be '6,7'
|
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
$search_sale = GETPOST('search_sale', 'int');
|
$search_sale = GETPOST('search_sale', 'int');
|
||||||
@ -91,8 +90,11 @@ $search_project_ref = GETPOST('search_project_ref', 'alpha');
|
|||||||
$search_btn = GETPOST('button_search', 'alpha');
|
$search_btn = GETPOST('button_search', 'alpha');
|
||||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||||
|
|
||||||
$status = GETPOST('statut', 'alpha');
|
if (is_array(GETPOST('search_status', 'intcomma'))) {
|
||||||
$search_status = GETPOST('search_status');
|
$search_status = join(',', GETPOST('search_status', 'intcomma'));
|
||||||
|
} else {
|
||||||
|
$search_status = (GETPOST('search_status', 'intcomma') != '' ? GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma'));
|
||||||
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$orderid = GETPOST('orderid', 'int');
|
$orderid = GETPOST('orderid', 'int');
|
||||||
@ -173,6 +175,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
|
|||||||
$object->fields = dol_sort_array($object->fields, 'position');
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -475,18 +478,21 @@ $formorder = new FormOrder($db);
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
$title = $langs->trans("SuppliersOrders");
|
$title = $langs->trans("ListOfSupplierOrders");
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
$fourn = new Fournisseur($db);
|
$fourn = new Fournisseur($db);
|
||||||
$fourn->fetch($socid);
|
$fourn->fetch($socid);
|
||||||
$title .= ' - '.$fourn->name;
|
$title .= ' - '.$fourn->name;
|
||||||
}
|
}
|
||||||
if ($status)
|
|
||||||
|
if ($search_status)
|
||||||
{
|
{
|
||||||
if ($status == '1,2,3') $title .= ' - '.$langs->trans("StatusOrderToProcessShort");
|
if ($search_status == '1,2') $title .= ' - '.$langs->trans("SuppliersOrdersToProcess");
|
||||||
if ($status == '6,7') $title .= ' - '.$langs->trans("StatusOrderCanceled");
|
elseif ($search_status == '3,4') $title .= ' - '.$langs->trans("SuppliersOrdersAwaitingReception");
|
||||||
else $title .= ' - '.$commandestatic->LibStatut($status);
|
elseif ($search_status == '1,2,3') $title .= ' - '.$langs->trans("StatusOrderToProcessShort");
|
||||||
|
elseif ($search_status == '6,7') $title .= ' - '.$langs->trans("StatusOrderCanceled");
|
||||||
|
elseif(is_numeric($search_status)) $title .= ' - '.$commandestatic->LibStatut($search_status);
|
||||||
}
|
}
|
||||||
if ($search_billed > 0) $title .= ' - '.$langs->trans("Billed");
|
if ($search_billed > 0) $title .= ' - '.$langs->trans("Billed");
|
||||||
|
|
||||||
@ -544,7 +550,7 @@ if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$search_prod
|
|||||||
//Required triple check because statut=0 means draft filter
|
//Required triple check because statut=0 means draft filter
|
||||||
if (GETPOST('statut', 'intcomma') !== '')
|
if (GETPOST('statut', 'intcomma') !== '')
|
||||||
$sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")";
|
$sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")";
|
||||||
if ($search_status != '' && $search_status >= 0)
|
if ($search_status != '' && $search_status != '-1')
|
||||||
$sql .= " AND cf.fk_statut IN (".$db->escape($search_status).")";
|
$sql .= " AND cf.fk_statut IN (".$db->escape($search_status).")";
|
||||||
$sql .= dolSqlDateFilter("cf.date_commande", $search_orderday, $search_ordermonth, $search_orderyear);
|
$sql .= dolSqlDateFilter("cf.date_commande", $search_orderday, $search_ordermonth, $search_orderyear);
|
||||||
$sql .= dolSqlDateFilter("cf.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear);
|
$sql .= dolSqlDateFilter("cf.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear);
|
||||||
@ -591,17 +597,6 @@ $sql .= $db->plimit($limit + 1, $offset);
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($socid > 0)
|
|
||||||
{
|
|
||||||
$soc = new Societe($db);
|
|
||||||
$soc->fetch($socid);
|
|
||||||
$title = $langs->trans('ListOfSupplierOrders').' - '.$soc->name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$title = $langs->trans('ListOfSupplierOrders');
|
|
||||||
}
|
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
@ -640,7 +635,7 @@ if ($resql)
|
|||||||
if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
|
if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
|
||||||
if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
|
if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
|
||||||
if ($search_refsupp) $param .= "&search_refsupp=".urlencode($search_refsupp);
|
if ($search_refsupp) $param .= "&search_refsupp=".urlencode($search_refsupp);
|
||||||
if ($search_status >= 0) $param .= "&search_status=".urlencode($search_status);
|
if ($search_status != '' && $search_status != '-1') $param .= "&search_status=".urlencode($search_status);
|
||||||
if ($search_project_ref >= 0) $param .= "&search_project_ref=".urlencode($search_project_ref);
|
if ($search_project_ref >= 0) $param .= "&search_project_ref=".urlencode($search_project_ref);
|
||||||
if ($search_billed != '') $param .= "&search_billed=".urlencode($search_billed);
|
if ($search_billed != '') $param .= "&search_billed=".urlencode($search_billed);
|
||||||
if ($show_files) $param .= '&show_files='.urlencode($show_files);
|
if ($show_files) $param .= '&show_files='.urlencode($show_files);
|
||||||
@ -927,7 +922,7 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['cf.fk_statut']['checked']))
|
if (!empty($arrayfields['cf.fk_statut']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre right">';
|
print '<td class="liste_titre right">';
|
||||||
$formorder->selectSupplierOrderStatus((strstr($search_status, ',') ?-1 : $search_status), 1, 'search_status');
|
$formorder->selectSupplierOrderStatus($search_status, 1, 'search_status');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Status billed
|
// Status billed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user