|
@@ -204,7 +204,7 @@ if (empty($user->socid)) {
|
|
|
$checkedtypetiers = 0;
|
|
|
$arrayfields = array(
|
|
|
'p.ref'=>array('label'=>"Ref", 'checked'=>1),
|
|
|
- 'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1),
|
|
|
+ 'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1),
|
|
|
'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1)),
|
|
|
'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1)),
|
|
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
|
@@ -249,6 +249,28 @@ $arrayfields = array(
|
|
|
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
|
|
);
|
|
|
|
|
|
+// List of fields to search into when doing a "search in all"
|
|
|
+/*$fieldstosearchall = array();
|
|
|
+foreach ($object->fields as $key => $val) {
|
|
|
+ if (!empty($val['searchall'])) {
|
|
|
+ $fieldstosearchall['t.'.$key] = $val['label'];
|
|
|
+ }
|
|
|
+}*/
|
|
|
+// Definition of array of fields for columns
|
|
|
+/*$arrayfields = array();
|
|
|
+foreach ($object->fields as $key => $val) {
|
|
|
+ // If $val['visible']==0, then we never show the field
|
|
|
+ if (!empty($val['visible'])) {
|
|
|
+ $visible = (int) dol_eval($val['visible'], 1);
|
|
|
+ $arrayfields['t.'.$key] = array(
|
|
|
+ 'label'=>$val['label'],
|
|
|
+ 'checked'=>(($visible < 0) ? 0 : 1),
|
|
|
+ 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
|
|
|
+ 'position'=>$val['position'],
|
|
|
+ 'help'=> isset($val['help']) ? $val['help'] : ''
|
|
|
+ );
|
|
|
+ }
|
|
|
+}*/
|
|
|
// Extra fields
|
|
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|
|
|
|
@@ -529,7 +551,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.name_alias as alias, s.email, s.phone, s.fax , s.address, 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.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, ';
|
|
|
$sql .= " typent.code as typent_code,";
|
|
|
$sql .= " ava.rowid as availability,";
|
|
|
$sql .= " country.code as country_code,";
|
|
@@ -1520,6 +1542,7 @@ if ($resql) {
|
|
|
'sortorder' => $sortorder,
|
|
|
'totalarray' => &$totalarray,
|
|
|
);
|
|
|
+
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
|
|
print $hookmanager->resPrint;
|
|
|
if (!empty($arrayfields['p.datec']['checked'])) {
|
|
@@ -1562,8 +1585,11 @@ if ($resql) {
|
|
|
$total_ht = 0;
|
|
|
$total_margin = 0;
|
|
|
|
|
|
- $last_num = min($num, $limit);
|
|
|
- while ($i < $last_num) {
|
|
|
+ $savnbfield = $totalarray['nbfield'];
|
|
|
+ $totalarray = array();
|
|
|
+ $totalarray['nbfield'] = 0;
|
|
|
+ $imaxinloop = ($limit ? min($num, $limit) : $num);
|
|
|
+ while ($i < $imaxinloop) {
|
|
|
$obj = $db->fetch_object($resql);
|
|
|
|
|
|
$objectstatic->id = $obj->rowid;
|
|
@@ -1578,6 +1604,7 @@ if ($resql) {
|
|
|
$companystatic->name = $obj->name;
|
|
|
$companystatic->name_alias = $obj->alias;
|
|
|
$companystatic->client = $obj->client;
|
|
|
+ $companystatic->fournisseur = $obj->fournisseur;
|
|
|
$companystatic->code_client = $obj->code_client;
|
|
|
$companystatic->email = $obj->email;
|
|
|
$companystatic->phone = $obj->phone;
|
|
@@ -1671,7 +1698,7 @@ if ($resql) {
|
|
|
if (!empty($arrayfields['p.ref_client']['checked'])) {
|
|
|
// Customer ref
|
|
|
print '<td class="nowrap tdoverflowmax200">';
|
|
|
- print $obj->ref_client;
|
|
|
+ print dol_escape_htmltag($obj->ref_client);
|
|
|
print '</td>';
|
|
|
if (!$i) {
|
|
|
$totalarray['nbfield']++;
|
|
@@ -1694,7 +1721,7 @@ if ($resql) {
|
|
|
// Project label
|
|
|
print '<td class="nowrap">';
|
|
|
if ($obj->project_id > 0) {
|
|
|
- print $projectstatic->title;
|
|
|
+ print dol_escape_htmltag($projectstatic->title);
|
|
|
}
|
|
|
print '</td>';
|
|
|
if (!$i) {
|
|
@@ -1704,7 +1731,7 @@ if ($resql) {
|
|
|
|
|
|
// Thirdparty
|
|
|
if (!empty($arrayfields['s.nom']['checked'])) {
|
|
|
- print '<td class="tdoverflowmax200">';
|
|
|
+ print '<td class="tdoverflowmax150">';
|
|
|
print $companystatic->getNomUrl(1, 'customer');
|
|
|
print '</td>';
|
|
|
if (!$i) {
|
|
@@ -1988,7 +2015,7 @@ if ($resql) {
|
|
|
|
|
|
// Author
|
|
|
if (!empty($arrayfields['u.login']['checked'])) {
|
|
|
- print '<td class="tdoverflowmax200">';
|
|
|
+ print '<td class="tdoverflowmax150">';
|
|
|
if ($userstatic->id) {
|
|
|
print $userstatic->getNomUrl(-1);
|
|
|
}
|
|
@@ -2080,7 +2107,7 @@ if ($resql) {
|
|
|
if (!$i) {
|
|
|
$totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate';
|
|
|
}
|
|
|
- if ($i >= $last_num - 1) {
|
|
|
+ if ($i >= $imaxinloop - 1) {
|
|
|
if (!empty($total_ht)) {
|
|
|
$totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT');
|
|
|
} else {
|