public static function notifications() { $count = 0; if (isset($_SESSION['current'])) { $count = count(TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id'], 'status' => array(TasksModel::STATUS_FINISHED, TasksModel::STATUS_REVERTED), 'viewed' => '0'))); } echo $count; }
public static function feed() { $tasks = TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'type' => TasksModel::TYPE_BACKUP)); if ($tasks) { $output = \Render::view('backup/table', compact('tasks'), 'return'); } else { $output = \Render::view('common/empty', false, 'return'); } echo $output; }
public static function details($accountKey = false) { if ($accountKey) { $account = $_SESSION['usernames'][$accountKey]; } else { $account = $_SESSION['current']; } $templateData = array('template' => 'accounts/details', 'title' => 'Migrate - Account details', 'bodyId' => 'accounts-details', 'styles' => array('accounts.css'), 'scripts' => array('accounts.js'), 'account' => $account, 'services' => ServicesModel::withPermissions(), 'selectedServices' => UsersServicesModel::all(array('user_id' => $account['username']['id']))->column('service_id'), 'tasks' => TasksModel::listingFor(array('user_id' => $account['username']['id'], 'user_affected_id' => $account['username']['id'])), 'intro' => (bool) IntroModel::first(array('page' => 'profile', 'group' => $_SESSION['current']['username']['group']))); if (!$templateData['intro']) { IntroModel::create(array('page' => 'profile', 'group' => $_SESSION['current']['username']['group']))->save(); } \Render::layout('template', $templateData); }
/** * Dashboard index page */ public static function index($finish = false) { if ($finish) { \Auth::showWizard('finish'); } else { if (\Auth::showWizard()) { \Router::redirect('accounts/permissions'); } } $templateData = array('template' => 'dashboard/content', 'title' => 'Migrate - Dashboard', 'bodyId' => 'dashboard', 'styles' => array('dashboard.css'), 'scripts' => array(), 'queue' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id']), 4), 'services' => ServicesModel::forUser(array('id' => $_SESSION['current']['username']['id'], 'limit' => 4)), 'usernames' => $_SESSION['usernames'], 'intro' => (bool) IntroModel::first(array('page' => 'dashboard', 'group' => $_SESSION['current']['username']['group']))); if (!$templateData['intro']) { IntroModel::create(array('page' => 'dashboard', 'group' => $_SESSION['current']['username']['group']))->save(); } \Render::layout('template', $templateData); }
public static function feed() { $tasks = TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id'], 'type' => array(TasksModel::TYPE_SYNC, TasksModel::TYPE_MIGRATE, TasksModel::TYPE_MOVE))); if ($tasks) { $output = \Render::view('migrate/table', compact('tasks'), 'return'); } else { $output = \Render::view('common/empty', false, 'return'); } echo $output; }
/** * Listing accounts */ public static function index($selectedService = 0) { $templateData = array('template' => 'import/content', 'title' => 'Migrate - Import', 'bodyId' => 'import', 'styles' => array('import.css'), 'scripts' => array(), 'history' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'type' => TasksModel::TYPE_IMPORT)), 'services' => $_SESSION['current']['services']); \Render::layout('template', $templateData); }