From abb106d7c2ae427b33431f53ecd0202fc2e0d4d4 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Mon, 18 Sep 2017 16:04:53 +0200 Subject: [PATCH] optmized industriels esport --- .../gui/materiobasemod/materio_contactops.pages.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sites/all/modules/gui/materiobasemod/materio_contactops.pages.inc b/sites/all/modules/gui/materiobasemod/materio_contactops.pages.inc index fcdfa613..77cf8df5 100644 --- a/sites/all/modules/gui/materiobasemod/materio_contactops.pages.inc +++ b/sites/all/modules/gui/materiobasemod/materio_contactops.pages.inc @@ -217,14 +217,20 @@ function materio_contactops_export(){ $users = user_load_multiple($uids); // dsm($users, "users"); - $companies_material_cache = array(); + $companies = array(); // cache array + $companies_material_cache = array(); // cache array $items = []; $headers = ['company', 'mail', 'materials']; foreach ($users as $uid => $user) { // $item = []; // TODO: get company from $company_tid = $user->field_company['und'][0]['tid']; - $company = taxonomy_term_load($company_tid); + if(isset($companies[$company_tid])){ + $company = $companies[$company_tid]; + }else{ + $company = taxonomy_term_load($company_tid); + $companies[$company_tid] = $company; + } // avoid users withour company if(!isset($company->name)){