Создаём *.xls файл в Drupal 7
Мне необходимо было генерировать exel-файл из ранее хранимых данных и сохранять на сервере. При...
Index: user_reference/user_reference.module =================================================================== --- user_reference/user_reference.module (revision 205) +++ user_reference/user_reference.module (working copy) @@ -557,6 +557,10 @@ $query->fields('u', array('uid', 'name')); $query->addMetaData('id', ' _user_reference_potential_references_standard'); + if (module_exists('realname')) { + $query->join('realname', 'rn', 'u.uid = rn.uid'); + } + // Enable this filter only if any statuses checked (and not both). if (count($filter_status) == 1) { $query->condition('u.status', array_keys($filter_status), 'IN'); @@ -571,7 +575,12 @@ if ($options['string'] !== '') { switch ($options['match']) { case 'contains': - $query->condition('u.name', '%' . $options['string'] . '%', 'LIKE'); + if (module_exists('realname')) { + $query->condition('rn.realname', '%' . $options['string'] . '%', 'LIKE'); + } + else { + $query->condition('u.name', '%' . $options['string'] . '%', 'LIKE'); + } break; case 'starts_with':