commit
b7a99463a6
@ -93,6 +93,7 @@ $search_product_category = GETPOST('search_product_category', 'int');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_refsupp = GETPOST('search_refsupp', 'alpha');
|
||||
$search_company = GETPOST('search_company', 'alpha');
|
||||
$search_company_alias = GETPOST('search_company_alias', 'alpha');
|
||||
$search_town = GETPOST('search_town', 'alpha');
|
||||
$search_zip = GETPOST('search_zip', 'alpha');
|
||||
$search_state = GETPOST("search_state", 'alpha');
|
||||
@ -181,6 +182,7 @@ $checkedtypetiers = 0;
|
||||
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array(
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>47, 'checked'=>0),
|
||||
's.town'=>array('label'=>"Town", 'enabled'=>1, 'position'=>47, 'checked'=>1),
|
||||
's.zip'=>array('label'=>"Zip", 'enabled'=>1, 'position'=>47, 'checked'=>1),
|
||||
'state.nom'=>array('label'=>"StateShort", 'enabled'=>1, 'position'=>48),
|
||||
@ -246,6 +248,7 @@ if (empty($reshook)) {
|
||||
$search_ref = '';
|
||||
$search_refsupp = '';
|
||||
$search_company = '';
|
||||
$search_company_alias = '';
|
||||
$search_town = '';
|
||||
$search_zip = "";
|
||||
$search_state = "";
|
||||
@ -657,6 +660,9 @@ if (empty($reshook)) {
|
||||
if ($search_company) {
|
||||
$param .= '&search_company='.urlencode($search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$param .= '&search_company_alias='.urlencode($search_company_alias);
|
||||
}
|
||||
//if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer);
|
||||
if ($search_user > 0) {
|
||||
$param .= '&search_user='.urlencode($search_user);
|
||||
@ -741,7 +747,7 @@ $sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_livraison,cf.date_valid, cf.date_approve,";
|
||||
@ -803,6 +809,9 @@ if ($sall) {
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
}
|
||||
if ($search_request_author) {
|
||||
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author);
|
||||
}
|
||||
@ -861,6 +870,9 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
}
|
||||
if ($search_sale > 0) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
|
||||
}
|
||||
@ -1032,6 +1044,9 @@ if ($resql) {
|
||||
if ($search_company) {
|
||||
$param .= '&search_company='.urlencode($search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$param .= '&search_company_alias='.urlencode($search_company_alias);
|
||||
}
|
||||
if ($search_user > 0) {
|
||||
$param .= '&search_user='.urlencode($search_user);
|
||||
}
|
||||
@ -1275,6 +1290,10 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cf.fk_soc']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" size="6" class="flat" name="search_company" value="'.$search_company.'"></td>';
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" size="6" class="flat" name="search_company_alias" value="'.$search_company_alias.'"></td>';
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.'"></td>';
|
||||
@ -1447,6 +1466,9 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cf.fk_soc']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cf.fk_soc']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -1623,7 +1645,17 @@ if ($resql) {
|
||||
$thirdpartytmp->id = $obj->socid;
|
||||
$thirdpartytmp->name = $obj->name;
|
||||
$thirdpartytmp->email = $obj->email;
|
||||
print $thirdpartytmp->getNomUrl(1, 'supplier');
|
||||
$thirdpartytmp->name_alias = $obj->alias;
|
||||
print $thirdpartytmp->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
print '</td>'."\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
//alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $obj->alias;
|
||||
print '</td>'."\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -77,6 +77,7 @@ $search_refsupplier = GETPOST('search_refsupplier', 'alpha');
|
||||
$search_type = GETPOST('search_type', 'int');
|
||||
$search_project = GETPOST('search_project', 'alpha');
|
||||
$search_company = GETPOST('search_company', 'alpha');
|
||||
$search_company_alias = GETPOST('search_company_alias', 'alpha');
|
||||
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
|
||||
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
|
||||
$search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha');
|
||||
@ -178,6 +179,7 @@ $arrayfields = array(
|
||||
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1),
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>0),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>-1),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||
@ -252,6 +254,7 @@ if (empty($reshook)) {
|
||||
$search_label = "";
|
||||
$search_project = '';
|
||||
$search_company = "";
|
||||
$search_company_alias = "";
|
||||
$search_amount_no_tax = "";
|
||||
$search_amount_all_tax = "";
|
||||
$search_montant_ht = '';
|
||||
@ -413,7 +416,7 @@ $sql .= " f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
|
||||
$sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
|
||||
$sql .= " f.note_public, f.note_private,";
|
||||
$sql .= " f.fk_user_author,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql .= " country.code as country_code,";
|
||||
@ -518,6 +521,9 @@ if ($search_project) {
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
}
|
||||
if ($search_town) {
|
||||
$sql .= natural_search('s.town', $search_town);
|
||||
}
|
||||
@ -693,6 +699,7 @@ if ($resql) {
|
||||
$soc->fetch($socid);
|
||||
if (empty($search_company)) {
|
||||
$search_company = $soc->name;
|
||||
$search_company_alias = $soc->name_alias;
|
||||
}
|
||||
}
|
||||
|
||||
@ -757,6 +764,9 @@ if ($resql) {
|
||||
if ($search_company) {
|
||||
$param .= '&search_company='.urlencode($search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$param .= '&search_company_alias='.urlencode($search_company_alias);
|
||||
}
|
||||
if ($search_login) {
|
||||
$param .= '&search_login='.urlencode($search_login);
|
||||
}
|
||||
@ -1004,6 +1014,10 @@ if ($resql) {
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'"></td>';
|
||||
@ -1181,6 +1195,9 @@ if ($resql) {
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER['PHP_SELF'], 's.name_alias', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -1188,7 +1205,10 @@ if ($resql) {
|
||||
print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['state.nom']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.name_alias", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['state.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['state.name_alias']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
@ -1293,6 +1313,7 @@ if ($resql) {
|
||||
|
||||
$thirdparty->id = $obj->socid;
|
||||
$thirdparty->name = $obj->name;
|
||||
$thirdparty->name_alias = $obj->alias;
|
||||
$thirdparty->client = $obj->client;
|
||||
$thirdparty->fournisseur = $obj->fournisseur;
|
||||
$thirdparty->code_client = $obj->code_client;
|
||||
@ -1417,7 +1438,16 @@ if ($resql) {
|
||||
// Third party
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print $thirdparty->getNomUrl(1, 'supplier');
|
||||
print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print $thirdparty->name_alias;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -91,6 +91,7 @@ $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alph
|
||||
$search_ref = GETPOST("search_ref", 'alpha');
|
||||
$search_label = GETPOST("search_label", 'alpha');
|
||||
$search_societe = GETPOST("search_societe", 'alpha');
|
||||
$search_societe_alias = GETPOST("search_societe_alias", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'int');
|
||||
$search_opp_status = GETPOST("search_opp_status", 'alpha');
|
||||
$search_opp_percent = GETPOST("search_opp_percent", 'alpha');
|
||||
@ -199,6 +200,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
// Add non object fields to fields for list
|
||||
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
|
||||
$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>22);
|
||||
$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23);
|
||||
$arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120);
|
||||
$arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'position'=> 116, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106);
|
||||
@ -248,6 +250,7 @@ if (empty($reshook)) {
|
||||
$search_ref = "";
|
||||
$search_label = "";
|
||||
$search_societe = "";
|
||||
$search_societe_alias = '';
|
||||
$search_status = -1;
|
||||
$search_opp_status = -1;
|
||||
$search_opp_amount = '';
|
||||
@ -452,6 +455,9 @@ if ($search_label) {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
if ($search_opp_amount) {
|
||||
$sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
|
||||
}
|
||||
@ -695,6 +701,9 @@ if ($search_label != '') {
|
||||
if ($search_societe != '') {
|
||||
$param .= '&search_societe='.urlencode($search_societe);
|
||||
}
|
||||
if ($search_societe_alias != '') {
|
||||
$param .= '&search_societe_alias='.urlencode($search_societe_alias);
|
||||
}
|
||||
if ($search_status >= 0) {
|
||||
$param .= '&search_status='.urlencode($search_status);
|
||||
}
|
||||
@ -905,6 +914,18 @@ if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).'">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
if ($socid > 0) {
|
||||
$tmpthirdparty = new Societe($db);
|
||||
$tmpthirdparty->fetch($socid);
|
||||
$search_societe_alias = $tmpthirdparty->name_alias;
|
||||
}
|
||||
print '<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Sale representative
|
||||
if (!empty($arrayfields['commercial']['checked'])) {
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@ -1078,6 +1099,9 @@ if (!empty($arrayfields['p.title']['checked'])) {
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, "", $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['commercial']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['commercial']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder, 'tdoverflowmax100imp ');
|
||||
}
|
||||
@ -1232,7 +1256,20 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
if ($obj->socid) {
|
||||
print $companystatic->getNomUrl(1);
|
||||
print $companystatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
if ($obj->socid) {
|
||||
print $companystatic->name_alias;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
@ -68,6 +68,7 @@ $search_task_user = GETPOST('search_task_user', 'int');
|
||||
$search_task_progress = GETPOST('search_task_progress');
|
||||
$search_task_budget_amount = GETPOST('search_task_budget_amount');
|
||||
$search_societe = GETPOST('search_societe');
|
||||
$search_societe_alias = GETPOST('search_societe_alias');
|
||||
$search_opp_status = GETPOST("search_opp_status", 'alpha');
|
||||
|
||||
$mine = GETPOST('mode', 'alpha') == 'mine' ? 1 : 0;
|
||||
@ -154,6 +155,7 @@ $arrayfields = array(
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1),
|
||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>0),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1),
|
||||
'p.fk_statut'=>array('label'=>"ProjectStatus", 'checked'=>1),
|
||||
't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>102),
|
||||
't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>103),
|
||||
@ -205,6 +207,8 @@ if (empty($reshook)) {
|
||||
$search_categ = "";
|
||||
$search_projectstatus = -1;
|
||||
$search_project_ref = "";
|
||||
$search_societe = "";
|
||||
$search_societe_alias = "";
|
||||
$search_project_title = "";
|
||||
$search_task_ref = "";
|
||||
$search_task_label = "";
|
||||
@ -326,7 +330,7 @@ if (count($listoftaskcontacttype) == 0) {
|
||||
|
||||
$distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is assigned only once.
|
||||
$sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,";
|
||||
$sql .= " s.nom as name, s.rowid as socid,";
|
||||
$sql .= " s.nom as name, s.name_alias as alias, s.rowid as socid,";
|
||||
$sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,";
|
||||
$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut, ";
|
||||
$sql .= " t.description, t.fk_task_parent";
|
||||
@ -413,6 +417,9 @@ if ($search_task_budget_amount) {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND t.dateo >= '".$db->idate($search_date_start)."'";
|
||||
}
|
||||
@ -579,6 +586,9 @@ if ($search_task_progress != '') {
|
||||
if ($search_societe != '') {
|
||||
$param .= '&search_societe='.urlencode($search_societe);
|
||||
}
|
||||
if ($search_societe != '') {
|
||||
$param .= '&search_societe_alias='.urlencode($search_societe_alias);
|
||||
}
|
||||
if ($search_projectstatus != '') {
|
||||
$param .= '&search_projectstatus='.urlencode($search_projectstatus);
|
||||
}
|
||||
@ -775,6 +785,11 @@ if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<input type="text" class="flat" name="search_societe" value="'.dol_escape_htmltag($search_societe).'" size="4">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).'" size="4">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['p.fk_statut']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
$arrayofstatus = array();
|
||||
@ -902,6 +917,10 @@ if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['p.fk_statut']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
$totalarray['nbfield']++;
|
||||
@ -1006,6 +1025,11 @@ while ($i < $imaxinloop) {
|
||||
$projectstatic->statut = $obj->projectstatus;
|
||||
$projectstatic->datee = $db->jdate($obj->projectdatee);
|
||||
|
||||
if ($obj->socid) {
|
||||
$socstatic->id = $obj->socid;
|
||||
$socstatic->name = $obj->name;
|
||||
$socstatic->name_alias = $obj->alias;
|
||||
}
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="'.$savnbfield.'">';
|
||||
@ -1127,9 +1151,20 @@ while ($i < $imaxinloop) {
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->socid) {
|
||||
$socstatic->id = $obj->socid;
|
||||
$socstatic->name = $obj->name;
|
||||
print $socstatic->getNomUrl(1);
|
||||
print $socstatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->socid) {
|
||||
print $socstatic->name_alias;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ $search_user = GETPOST('search_user', 'int');
|
||||
$search_sale = GETPOST('search_sale', 'int');
|
||||
$search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
|
||||
$search_societe = GETPOST('search_societe', 'alpha');
|
||||
$search_societe_alias = GETPOST('search_societe_alias', 'alpha');
|
||||
$search_login = GETPOST('search_login', 'alpha');
|
||||
$search_town = GETPOST('search_town', 'alpha');
|
||||
$search_zip = GETPOST('search_zip', 'alpha');
|
||||
@ -168,6 +169,7 @@ $checkedtypetiers = 0;
|
||||
$arrayfields = array(
|
||||
'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||
's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0),
|
||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
|
||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
|
||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
||||
@ -224,6 +226,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_sale = '';
|
||||
$search_ref = '';
|
||||
$search_societe = '';
|
||||
$search_societe_alias = '';
|
||||
$search_montant_ht = '';
|
||||
$search_montant_vat = '';
|
||||
$search_montant_ttc = '';
|
||||
@ -294,7 +297,7 @@ $sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql .= ' sp.rowid, sp.note_public, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
|
||||
@ -365,6 +368,9 @@ if ($search_ref) {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
if ($search_login) {
|
||||
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login);
|
||||
}
|
||||
@ -521,6 +527,9 @@ if ($resql) {
|
||||
if ($search_societe) {
|
||||
$param .= '&search_societe='.urlencode($search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$param .= '&search_societe_alias='.urlencode($search_societe_alias);
|
||||
}
|
||||
if ($search_user > 0) {
|
||||
$param .= '&search_user='.urlencode($search_user);
|
||||
}
|
||||
@ -677,6 +686,11 @@ if ($resql) {
|
||||
print '<input class="flat" type="text" size="12" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="12" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
|
||||
}
|
||||
@ -816,6 +830,9 @@ if ($resql) {
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -904,6 +921,7 @@ if ($resql) {
|
||||
// Company
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->name_alias = $obj->alias;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
|
||||
@ -942,7 +960,17 @@ if ($resql) {
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print $companystatic->getNomUrl(1, 'supplier');
|
||||
print $companystatic->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print $companystatic->name_alias;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user