Close #16395 - Can filter on proposal source in list
This commit is contained in:
parent
d4512c48cd
commit
f1f950e8b7
@ -2113,6 +2113,24 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Payment mode
|
||||
print '<tr>';
|
||||
print '<td class="valuefield">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefieldcreate">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Delivery date
|
||||
$langs->load('deliveries');
|
||||
print '<tr><td>';
|
||||
@ -2200,24 +2218,6 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Payment mode
|
||||
print '<tr>';
|
||||
print '<td class="valuefield">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefieldcreate">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
// Multicurrency code
|
||||
|
||||
@ -95,6 +95,7 @@ $search_availability = GETPOST('search_availability', 'int');
|
||||
$search_categ_cus = GETPOST("search_categ_cus", 'int');
|
||||
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
|
||||
$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int');
|
||||
$search_fk_input_reason = GETPOST("search_fk_input_reason", 'int');
|
||||
$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int');
|
||||
$search_btn = GETPOST('button_search', 'alpha');
|
||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||
@ -189,6 +190,7 @@ $arrayfields = array(
|
||||
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
|
||||
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
|
||||
'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>!empty($conf->expedition->enabled)),
|
||||
'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1),
|
||||
'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0),
|
||||
'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
|
||||
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||
@ -277,6 +279,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_categ_cus = 0;
|
||||
$search_fk_cond_reglement = '';
|
||||
$search_fk_shipping_method = '';
|
||||
$search_fk_input_reason = '';
|
||||
$search_fk_mode_reglement = '';
|
||||
}
|
||||
if ($object_statut != '') {
|
||||
@ -414,7 +417,7 @@ $sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_tt
|
||||
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
|
||||
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
|
||||
$sql .= ' p.note_public, p.note_private,';
|
||||
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,';
|
||||
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
|
||||
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||
$sql .= ' u.login';
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
@ -547,6 +550,9 @@ if ($search_fk_cond_reglement > 0) {
|
||||
if ($search_fk_shipping_method > 0) {
|
||||
$sql .= " AND p.fk_shipping_method = ".$db->escape($search_fk_shipping_method);
|
||||
}
|
||||
if ($search_fk_input_reason > 0) {
|
||||
$sql .= " AND p.fk_input_reason = ".$db->escape($search_fk_input_reason);
|
||||
}
|
||||
if ($search_fk_mode_reglement > 0) {
|
||||
$sql .= " AND p.fk_mode_reglement = ".$db->escape($search_fk_mode_reglement);
|
||||
}
|
||||
@ -735,6 +741,9 @@ if ($resql) {
|
||||
if ($search_fk_shipping_method > 0) {
|
||||
$param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
|
||||
}
|
||||
if ($search_fk_input_reason > 0) {
|
||||
$param .= '&search_fk_input_reason='.$search_fk_input_reason;
|
||||
}
|
||||
if ($search_fk_mode_reglement > 0) {
|
||||
$param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
|
||||
}
|
||||
@ -983,6 +992,12 @@ if ($resql) {
|
||||
$form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Source - Input reason
|
||||
if (!empty($arrayfields['p.fk_input_reason']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
$form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, 'maxwidth125', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Payment term
|
||||
if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
@ -1169,6 +1184,9 @@ if ($resql) {
|
||||
if (!empty($arrayfields['p.fk_shipping_method']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "p.fk_shipping_method", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['p.fk_input_reason']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_input_reason']['label'], $_SERVER["PHP_SELF"], "p.fk_input_reason", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -1473,7 +1491,7 @@ if ($resql) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
//Shipping Method
|
||||
// Shipping Method
|
||||
if (!empty($arrayfields['p.fk_shipping_method']['checked'])) {
|
||||
print '<td>';
|
||||
$form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1);
|
||||
@ -1482,6 +1500,17 @@ if ($resql) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Source - input reason
|
||||
if (!empty($arrayfields['p.fk_input_reason']['checked'])) {
|
||||
print '<td class="tdoverflowmax125" title="'.dol_escape_htmltag($form->cache_demand_reason[$obj->fk_input_reason]['label']).'">';
|
||||
if ($obj->fk_input_reason > 0) {
|
||||
print $form->cache_demand_reason[$obj->fk_input_reason]['label'];
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Payment terms
|
||||
if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) {
|
||||
print '<td>';
|
||||
|
||||
@ -3729,15 +3729,17 @@ class Form
|
||||
* @param string $htmlname Nom de la zone select
|
||||
* @param string $exclude To exclude a code value (Example: SRC_PROP)
|
||||
* @param int $addempty Add an empty entry
|
||||
* @param string $morecss Add more css to the HTML select component
|
||||
* @param int $notooltip Do not show the tooltip for admin
|
||||
* @return void
|
||||
*/
|
||||
public function selectInputReason($selected = '', $htmlname = 'demandreasonid', $exclude = '', $addempty = 0)
|
||||
public function selectInputReason($selected = '', $htmlname = 'demandreasonid', $exclude = '', $addempty = 0, $morecss = '', $notooltip = 0)
|
||||
{
|
||||
global $langs, $user;
|
||||
|
||||
$this->loadCacheInputReason();
|
||||
|
||||
print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($addempty) {
|
||||
print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>';
|
||||
}
|
||||
@ -3756,7 +3758,7 @@ class Form
|
||||
print '</option>';
|
||||
}
|
||||
print '</select>';
|
||||
if ($user->admin) {
|
||||
if ($user->admin && empty($notooltip)) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
print ajax_combobox('select_'.$htmlname);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user