public function index() { $feedUsers = $this->_userConnections(); $feedUsers[] = User::get('id'); $Workspace = ClassRegistry::init('Workspace'); $workspaces = $Workspace->find('all', $this->Acl->conditions(array('fields' => 'id'), array('cache' => false))); $workspaceIds = Set::extract('/Workspace/id', $workspaces); if (empty($workspaceIds)) { $workspaceIds = -1; } $conditions = array(); switch (true) { case !empty($this->params['named']['view']): // keep conditions empty break; case $this->Session->check('Stack.id'): $conditions = array('conditions' => array('Feed.stack_id' => $this->Session->read('Stack.id'))); break; case $this->Session->check('Milestone.id'): $conditions = array('conditions' => array('Feed.milestone_id' => $this->Session->read('Milestone.id'))); break; case $this->Session->check('Workspace.id'): $conditions = array('conditions' => array('Feed.workspace_id' => $this->Session->read('Workspace.id'))); break; default: $conditions = array('conditions' => array('OR' => array('Feed.user_id' => $feedUsers, 'Feed.workspace_id' => $workspaceIds))); } $conditions = Set::merge($conditions, array('order' => array('Feed.id DESC'), 'contain' => array('User' => array('fields' => array('id', 'name', 'email', 'facebook_id')), 'Milestone' => array('fields' => array('id', 'name')), 'Stack' => array('fields' => array('id', 'name')), 'Workspace' => array('fields' => array('id', 'name'))), 'limit' => 20)); if (isset($this->params['named']['user'])) { $conditions['conditions'][] = array('User.id' => $this->params['named']['user']); } $this->paginate = $conditions; $this->set('title_for_layout', 'Feed'); parent::index(); }
public function index() { $this->paginate = array('conditions' => array('Notification.receiver_id' => User::get('id')), 'contain' => array('NotificationType', 'User'), 'order' => array('Notification.id' => 'DESC')); parent::index(); $this->Notification->updateAll(array('is_read' => 1), array('Notification.receiver_id' => User::get('id'))); $this->Notification->User->id = User::get('id'); $this->Notification->User->saveField('notification_count', 0); }
function index() { parent::index(); $q = $this->Ingredient->find('list', array('fields' => array('Ingre'), 'empty' => 'Selection d\'un ingrédient')); $this->set('ingredients', $q); $u = $this->Unity->find('list', array('fields' => array('nom_unite'), 'empty' => 'Selection d\'une unité')); $this->set('unitys', $u); $this->layout = 'default'; }
public function index() { if (isset($this->params['page'])) { $this->data->appendTo('pageTitle', ' ' . __('Seite :1', (int) $this->params['page'])); } if (in_array($this->layout, array('rss', 'ical', 'txt'))) { $this->BlogPost->unbind('Comment'); } parent::index(); }
public function index() { // if they are not in a workspace, let's refresh their cache // and merge the aclConditions in if ($this->Session->check('Workspace.id')) { $aclOptions = array('cache' => false, 'merge' => false); } else { $aclOptions = array('cache' => true, 'merge' => true); } // setup our conditions and filter them $this->paginate = $this->_filterLevel($this->Acl->conditions(array('contain' => array('User' => array('fields' => array('id', 'name')))), $aclOptions)); parent::index(true); }
public function index() { if ($this->RequestHandler->prefers('json')) { $conditions = array('fields' => array('id', 'name'), 'conditions' => array('id' => $this->_userConnections())); $results = $this->Connection->User->find('all', $conditions); $connections = array(); foreach ($results as $result) { $result = $result['User']; $connections[] = array('value' => $result['id'], 'caption' => $result['name']); } $this->set(compact('connections')); } else { $this->paginate = array('conditions' => array('or' => array('User.id' => User::get('id'), 'Receiver.id' => User::get('id'))), 'order' => array('Connection.is_approved' => 'ASC', 'Connection.id' => 'DESC'), 'contain' => array('User' => array('fields' => array('id', 'name', 'email', 'facebook_id', 'username')), 'Receiver' => array('fields' => array('id', 'name', 'email', 'facebook_id', 'username')))); parent::index(); } }
public function index() { // if they are not in a workspace, let's refresh their cache // and merge the aclConditions in if ($this->Session->check('Workspace.id')) { $aclOptions = array('cache' => false, 'merge' => false); } else { $aclOptions = array('cache' => true, 'merge' => true); } // setup our conditions $conditions = array('TaskGroup' => $this->Acl->conditions(array('order' => array('TaskGroup.order' => 'ASC'), 'limit' => null), $aclOptions)); // if they pass a stack only show them task groups under that stack if (!empty($this->params['named']['stack'])) { $conditions['TaskGroup']['conditions'] = array('TaskGroup.stack_id' => $this->params['named']['stack']); } // filter our conditions $this->paginate = $this->_filterLevel($conditions, 'TaskGroup'); parent::index(); }
public function index() { // if they are not in a workspace, let's refresh their cache // and merge the aclConditions in if ($this->Session->check('Workspace.id')) { $aclOptions = array('cache' => false, 'merge' => false); } else { $aclOptions = array('cache' => true, 'merge' => true); } // the calendar is requesting milestones if ($this->RequestHandler->prefers('json')) { // setup our conditions $conditions = $this->Acl->conditions(array('fields' => array('id', 'name', 'starts', 'ends')), $aclOptions); // filter our conditions $conditions = $this->_filterLevel($conditions); $this->__calendarResponse($conditions); return; } // setup our conditions and filter them $this->paginate = $this->_filterLevel($this->Acl->conditions(null, $aclOptions)); parent::index(true); }
public function index() { // if they are not in a workspace, let's refresh their cache // and merge the aclConditions in if ($this->Session->check('Workspace.id')) { $aclOptions = array('cache' => false, 'merge' => false); } else { $aclOptions = array('cache' => true, 'merge' => true); } // the calendar is requesting tasks if ($this->RequestHandler->prefers('json')) { // setup our conditions $conditions = $this->Acl->conditions(array('fields' => array('id', 'name', 'due'), 'conditions' => array('NOT' => array('Task.due' => NULL), 'is_complete' => NULL)), $aclOptions); // filter our conditions $this->paginate = $this->_filterLevel($conditions); parent::index(); return; } // the request is for a stack if (!empty($this->params['named']['stack'])) { // setup our conditions $conditions = $this->Acl->conditions(array('conditions' => array('Task.is_complete' => NULL, 'Task.stack_id' => $this->params['named']['stack'])), $aclOptions); // filter our conditions $this->paginate = $conditions; parent::index(); return; } // setup our conditions $conditions = array('TaskGroup' => $this->Acl->conditions(array('contain' => array('Task' => array('conditions' => array('is_complete' => NULL), 'order' => array('Task.order' => 'ASC'), 'AssignedTo' => array('fields' => array('id', 'name')), 'Stack' => array('fields' => array('id', 'name')))), 'order' => array('TaskGroup.order' => 'ASC')), $aclOptions)); // if they pass a task-group show them only that task group if (!empty($this->params['named']['task-group'])) { $conditions['TaskGroup']['conditions'] = array('TaskGroup.id' => $this->params['named']['task-group']); } // filter our conditions $this->paginate = $this->_filterLevel($conditions, 'TaskGroup'); parent::index(array('controller' => 'task_groups', 'action' => 'add'), 'TaskGroup'); }
public function index() { $this->setRelated(); parent::index(); }
public function index() { // setup our conditions $this->paginate = $this->Acl->conditions(); parent::index(array('controller' => 'workspaces', 'action' => 'add'), 'Workspace'); }
public function index() { $this->paginate = array('conditions' => array('Dashboard.user_id' => User::get('id')), 'order' => array('Dashboard.order' => 'ASC')); parent::index(); }
<?php function check_logged_in() { BaseController::check_logged_in(); } $routes->get('/', function () { if ($user = AuthController::get_user_logged_in()) { AppController::index(); } else { AuthController::index(); } }); $routes->post('/login', function () { // Kirjautumisen käsittely AuthController::handle_login(); }); $routes->get('/logout', function () { AuthController::signout(); }); $routes->get('/signup', function () { AuthController::signup(); }); $routes->post('/signup', function () { AuthController::handle_signup(); }); $routes->get('/tasks/create', 'check_logged_in', function () { AppController::createTask(); }); $routes->post('/tasks/create', 'check_logged_in', function () { AppController::storeTask();
public function index() { parent::index(); }
public function index() { AppController::index(); $this->set('zeitzonenliste', timezone_identifiers_list()); }
public function index() { $this->paginate = array('conditions' => array('user_id' => User::get('id'))); parent::index(); }