瀏覽代碼

MMI Add phone field in propal list

Mathieu Moulin 11 月之前
父節點
當前提交
0aa5e0b150
共有 1 個文件被更改,包括 25 次插入1 次删除
  1. 25 1
      htdocs/comm/propal/list.php

+ 25 - 1
htdocs/comm/propal/list.php

@@ -100,6 +100,7 @@ $search_zip = GETPOST('search_zip', 'alpha');
 $search_state = GETPOST("search_state");
 $search_country = GETPOST("search_country", 'int');
 $search_email = GETPOST('search_email', 'alpha');
+$search_phone = GETPOST('search_phone', 'alpha');
 $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
 $search_date_startday = GETPOST('search_date_startday', 'int');
 $search_date_startmonth = GETPOST('search_date_startmonth', 'int');
@@ -220,6 +221,7 @@ $arrayfields = array(
 	'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
 	'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
 	's.email'=>array('label'=>"Email", 'checked'=>0),
+	's.phone'=>array('label'=>"Phone", 'checked'=>0),
 	'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
 	'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
 	'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
@@ -351,6 +353,7 @@ if (empty($reshook)) {
 		$search_type = '';
 		$search_country = '';
 		$search_email = '';
+		$search_phone = '';
 		$search_type_thirdparty = '';
 		$search_date_startday = '';
 		$search_date_startmonth = '';
@@ -645,6 +648,9 @@ if ($search_country) {
 if ($search_email) {
 	$sql .= natural_search("s.email", $search_email);
 }
+if ($search_phone) {
+	$sql .= natural_search("s.phone", $search_phone);
+}
 if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
 	$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
 }
@@ -1057,6 +1063,9 @@ if ($search_country) {
 if ($search_email) {
 	$param .= '&search_email='.urlencode($search_email);
 }
+if ($search_phone) {
+	$param .= '&search_phone='.urlencode($search_phone);
+}
 if ($search_date_signature_startday) {
 	$param .= '&search_date_signature_startday='.urlencode($search_date_signature_startday);
 }
@@ -1283,6 +1292,10 @@ if ($search_date_signature_endyear) {
 	if (!empty($arrayfields['s.email']['checked'])) {
 		print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_email" value="'.$search_email.'"></td>';
 	}
+	// Phone
+	if (!empty($arrayfields['s.phone']['checked'])) {
+		print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_phone" value="'.$search_phone.'"></td>';
+	}
 	// Company type
 	if (!empty($arrayfields['typent.code']['checked'])) {
 		print '<td class="liste_titre maxwidth100onsmartphone" align="center">';
@@ -1563,6 +1576,9 @@ if ($search_date_signature_endyear) {
 	if (!empty($arrayfields['s.email']['checked'])) {
 		print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], 's.email', '', $param, '', $sortfield, $sortorder);
 	}
+	if (!empty($arrayfields['s.phone']['checked'])) {
+		print_liste_field_titre($arrayfields['s.phone']['label'], $_SERVER["PHP_SELF"], 's.phone', '', $param, '', $sortfield, $sortorder);
+	}
 	if (!empty($arrayfields['typent.code']['checked'])) {
 		print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder);
 		$totalarray['nbfield']++;
@@ -1768,7 +1784,6 @@ if ($search_date_signature_endyear) {
 		$companystatic->zip = $obj->zip;
 		$companystatic->town = $obj->town;
 		$companystatic->country_code = $obj->country_code;
-		$companystatic->email = $obj->email;
 
 		$projectstatic->id = $obj->project_id;
 		$projectstatic->ref = $obj->project_ref;
@@ -1967,6 +1982,15 @@ if ($search_date_signature_endyear) {
 					$totalarray['nbfield']++;
 				}
 			}
+			// Phone (MMI Hack)
+			if (!empty($arrayfields['s.phone']['checked'])) {
+				print '<td class="nocellnopadd">';
+				print $obj->phone;
+				print '</td>';
+				if (!$i) {
+					$totalarray['nbfield']++;
+				}
+			}
 			// Type ent
 			if (!empty($arrayfields['typent.code']['checked'])) {
 				if (!is_array($typenArray) || empty($typenArray)) {