function _pmperson_migrate_get_conflicting_email_with_attached_users_table in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmperson/includes/pmperson.migrate.inc \_pmperson_migrate_get_conflicting_email_with_attached_users_table()
- 7.2 pmperson/includes/pmperson.migrate.inc \_pmperson_migrate_get_conflicting_email_with_attached_users_table()
Get list of pmnodes that has conflicting email with the attached drupal user.
1 call to _pmperson_migrate_get_conflicting_email_with_attached_users_table()
- pmperson_migrate_page_callback in pmperson/
includes/ pmperson.migrate.inc - Page callback for PM_PMPERSON_RESOLVE_DEPENDENCIES_LINK.
File
- pmperson/
includes/ pmperson.migrate.inc, line 222 - Migration functions for the PM Person module.
Code
function _pmperson_migrate_get_conflicting_email_with_attached_users_table() {
$header = array(
'person' => array(
'data' => t('PM Person'),
'field' => 'email',
),
'user' => array(
'data' => t('Drupal User'),
'field' => 'mail',
),
'help' => array(
'data' => t('Help'),
),
);
if (db_table_exists('pmperson')) {
$query = db_select('pmperson', 'p')
->extend('PagerDefault')
->limit(10);
$query
->join('users', 'u', 'p.user_uid = u.uid AND p.email <> u.mail');
$query
->fields('p', array(
'nid',
'email',
))
->fields('u', array(
'mail',
'uid',
'name',
))
->condition('u.uid', '', '!=');
$query = $query
->extend('TableSort')
->orderByHeader($header);
$result = $query
->execute()
->fetchAllAssoc('nid');
}
else {
$result = array();
}
$render = array(
'table' => array(
'#theme' => 'table',
'#header' => $header,
'#rows' => array_map(function ($row) {
return _pmperson_migrate_adjust_row($row);
}, $result),
'#sticky' => TRUE,
'#caption' => t('Conflicts.'),
'#empty' => t('No issues found.'),
),
'pager' => array(
'#theme' => 'pager',
),
);
return $render;
}