Ejemplo n.º 1
0
 function _buildContentWhereArray()
 {
     $state = $this->getState();
     $where = parent::_buildContentWhereArray();
     if ($state->parent_id > 0) {
         $where[] = ' a.parent_id=' . $state->parent_id;
     }
     return $where;
 }
Ejemplo n.º 2
0
 function _buildContentWhereArray()
 {
     $state = $this->getState();
     $where = parent::_buildContentWhereArray();
     if ($state->category_id > 0) {
         $where[] = ' (a.category_id=-1 OR a.id IN (SELECT field_id FROM #__helpdeskpro_field_categories WHERE category_id=' . $state->category_id . '))';
     }
     return $where;
 }
Ejemplo n.º 3
0
 function _buildContentWhereArray()
 {
     $state = $this->getState();
     $where = parent::_buildContentWhereArray();
     if ($state->plugin_type != -1) {
         $where[] = ' a.plugin_type=' . $state->plugin_type;
     }
     return $where;
 }
Ejemplo n.º 4
0
 function _buildContentWhereArray()
 {
     $where = parent::_buildContentWhereArray();
     $state = $this->getState();
     if ($state->filter_country_id) {
         $where[] = ' a.country_id = ' . $state->filter_country_id;
     }
     return $where;
 }
Ejemplo n.º 5
0
 function _buildContentWhereArray()
 {
     $where = parent::_buildContentWhereArray();
     $where[] = 'a.is_profile = 1';
     if ($this->getState('id')) {
         $where[] = ' a.plan_id = ' . (int) $this->state->get('id');
     }
     $where[] = ' a.id IN (SELECT DISTINCT profile_id FROM #__osmembership_subscribers WHERE published = 1)';
     return $where;
 }
Ejemplo n.º 6
0
 function _buildContentWhereArray()
 {
     $state = $this->getState();
     $where = parent::_buildContentWhereArray();
     if ($state->from_plan_id) {
         $where[] = ' a.from_plan_id = ' . $state->from_plan_id;
     }
     if ($state->to_plan_id) {
         $where[] = ' a.to_plan_id = ' . $state->to_plan_id;
     }
     return $where;
 }
Ejemplo n.º 7
0
 function _buildContentWhereArray()
 {
     $state = $this->getState();
     $where = parent::_buildContentWhereArray();
     if ($state->plan_id > 0) {
         $where[] = ' a.plan_id=' . $state->plan_id;
     }
     if ($state->country) {
         $where[] = ' a.country=' . $this->getDbo()->quote($state->country);
     }
     if ($state->vies != -1) {
         $where[] = ' a.vies=' . $state->vies;
     }
     return $where;
 }
Ejemplo n.º 8
0
 function _buildContentWhereArray()
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $config = HelpdeskProHelper::getConfig();
     $managedCategoryIds = HelpdeskProHelper::getTicketCategoryIds($user->get('username'));
     $where = parent::_buildContentWhereArray();
     $state = $this->getState();
     if ($state->category_id) {
         $where[] = ' a.category_id = ' . $state->category_id;
     }
     if ($state->status_id) {
         if ($state->status_id == -1) {
             if (!$user->authorise('core.admin')) {
                 if (count($managedCategoryIds)) {
                     //Show open and pending tickets to managers by default
                     $where[] = ' (a.status_id=' . $config->new_ticket_status_id . ' OR a.status_id=' . $config->ticket_status_when_customer_add_comment . ') ';
                 } else {
                     //Show open tickets and require feedback tickets to customers
                     //$where[] = ' (a.status_id='.$config->new_ticket_status_id.' OR a.status_id='.$config->ticket_status_when_admin_add_comment.') ';
                     $where[] = " a.status_id != {$config->closed_ticket_status} ";
                 }
             } else {
                 //Show open and pending tickets to managers by default
                 $where[] = ' (a.status_id=' . $config->new_ticket_status_id . ' OR a.status_id=' . $config->ticket_status_when_customer_add_comment . ') ';
             }
         } else {
             $where[] = ' a.status_id = ' . $state->status_id;
         }
     }
     if ($state->priority_id) {
         $where[] = ' a.priority_id = ' . $state->priority_id;
     }
     if (!$user->authorise('core.admin')) {
         //Super administrator can view all tickets
         if ($managedCategoryIds) {
             //He is ticket managers, so all tickets belong to him
             $where[] = ' a.category_id IN (' . implode(',', $managedCategoryIds) . ')';
         } else {
             //Registered user, only show tickets submitted by himself
             $userId = $user->get('id');
             $email = $user->get('email');
             //				$where[] = "(a.user_id=$userId OR a.email='$email') " ;
             $where[] = ' a.status_id = 4';
         }
     }
     return $where;
 }
Ejemplo n.º 9
0
 function _buildContentWhereArray()
 {
     $where = parent::_buildContentWhereArray();
     $state = $this->getState();
     if ($state->plan_id) {
         $where[] = ' a.plan_id = ' . $state->plan_id;
     }
     if ($state->published != -1) {
         $where[] = ' a.published = ' . $state->published;
     }
     switch ($state->subscription_type) {
         case 1:
             $where[] = ' a.act = "subscribe"';
             break;
         case 2:
             $where[] = ' a.act = "renew"';
             break;
         case 3:
             $where[] = ' a.act = "upgrade"';
             break;
     }
     return $where;
 }
Ejemplo n.º 10
0
 function _buildContentWhereArray()
 {
     $where = parent::_buildContentWhereArray();
     $where[] = 'a.is_profile = 1';
     return $where;
 }