예제 #1
0
 /**
  * Overrides the generic process to include custom logic for email addresses,
  * since they are no longer stored in  a list view friendly manner.
  * (A record may have an undetermined number of email addresses).
  *
  * @param array $lvsParams
  */
 function process($lvsParams = array())
 {
     if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) {
         $lvsParams['custom_select'] = ', email_address as email1';
         $lvsParams['custom_from'] = "LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = 'Accounts' " . "AND eabr.bean_id = accounts.id AND primary_address = 1 " . "LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id";
     }
     parent::process($lvsParams);
 }
예제 #2
0
 function process($lvsParams = array())
 {
     global $current_language, $app_list_strings, $current_user;
     $mod_strings = return_module_language($current_language, 'Meetings');
     // handle myitems only differently --  set the custom query to show assigned meetings and invitee meetings
     if ($this->myItemsOnly) {
         //join with meeting_users table to process related users
         $this->seedBean->listview_inner_join = array('LEFT JOIN  meetings_users m_u on  m_u.meeting_id = meetings.id');
         //set the custom query to retrieve invitees AND assigned meetings
         $lvsParams['custom_where'] = ' AND (meetings.assigned_user_id = \'' . $current_user->id . '\' OR (m_u.user_id = \'' . $current_user->id . '\' AND m_u.deleted=0)) ';
     }
     $this->myItemsOnly = false;
     //query needs to be distinct to avoid multiple records being returned for the same meeting (one for each invited user),
     //so we need to make sure date entered is also set so the sort can work with the group by
     $lvsParams['custom_select'] = ', meetings.date_entered ';
     $lvsParams['distinct'] = true;
     parent::process($lvsParams);
     $keys = array();
     foreach ($this->lvs->data['data'] as $num => $row) {
         $keys[] = $row['ID'];
     }
     // grab meeting status
     if (!empty($keys)) {
         $query = "SELECT meeting_id, accept_status FROM meetings_users WHERE deleted = 0 AND user_id = '" . $current_user->id . "' AND meeting_id IN ('" . implode("','", $keys) . "')";
         $result = $GLOBALS['db']->query($query);
         while ($row = $GLOBALS['db']->fetchByAssoc($result)) {
             $rowNums = $this->lvs->data['pageData']['idIndex'][$row['meeting_id']];
             // figure out which rows have this guid
             foreach ($rowNums as $rowNum) {
                 $this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] = $row['accept_status'];
             }
         }
     }
     foreach ($this->lvs->data['data'] as $rowNum => $row) {
         if (empty($this->lvs->data['data'][$rowNum]['DURATION_HOURS'])) {
             $this->lvs->data['data'][$rowNum]['DURATION'] = '0' . $mod_strings['LBL_HOURS_ABBREV'];
         } else {
             $this->lvs->data['data'][$rowNum]['DURATION'] = $this->lvs->data['data'][$rowNum]['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'];
         }
         if (empty($this->lvs->data['data'][$rowNum]['DURATION_MINUTES']) || empty($this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']])) {
             $this->lvs->data['data'][$rowNum]['DURATION'] .= '00';
         } else {
             $this->lvs->data['data'][$rowNum]['DURATION'] .= $this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']];
         }
         $this->lvs->data['data'][$rowNum]['DURATION'] .= $mod_strings['LBL_MINSS_ABBREV'];
         if (!empty($this->lvs->data['data'][$rowNum]['STATUS']) && $this->lvs->data['data'][$rowNum]['STATUS'] == $app_list_strings['meeting_status_dom']['Planned']) {
             if ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == '') {
                 //if no status has been set, then do not show accept options
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\" class=\"acceptMeeting\"></div>";
             } elseif ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == 'none') {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\" class=\"acceptMeeting\"><a title=\"" . $app_list_strings['dom_meeting_accept_options']['accept'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=accept', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("accept_inline", "border='0'", null, null, '.gif', $app_list_strings['dom_meeting_accept_options']['accept']) . "</a>&nbsp;<a title=\"" . $app_list_strings['dom_meeting_accept_options']['tentative'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=tentative', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("tentative_inline", "border='0'", null, null, '.gif', $app_list_strings['dom_meeting_accept_options']['tentative']) . "</a>&nbsp;<a title=\"" . $app_list_strings['dom_meeting_accept_options']['decline'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=decline', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("decline_inline", "border='0'", null, null, '.gif', $app_list_strings['dom_meeting_accept_options']['decline']) . "</a></div>";
             } else {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS']];
             }
         }
     }
     $this->displayColumns[] = "set_accept_links";
 }
 function process($lvsParams = array())
 {
     if (!empty($this->displayColumns)) {
         if (array_search('amount', $this->displayColumns)) {
             $this->displayColumns[array_search('amount', $this->displayColumns)] = 'amount_usdollar';
         }
     }
     parent::process($lvsParams);
 }
 function process()
 {
     global $current_language, $app_list_strings, $image_path, $current_user;
     //$where = 'emails.deleted = 0 AND emails.assigned_user_id = \''.$current_user->id.'\' AND emails.type = \'inbound\' AND emails.status = \'unread\'';
     $mod_strings = return_module_language($current_language, 'Emails');
     $this->filters['assigned_user_id'] = $current_user->id;
     $this->filters['type'] = array("inbound");
     $this->filters['status'] = array("unread");
     parent::process();
 }
예제 #5
0
 /**
  * Overrides the generic process to include custom logic for email addresses,
  * since they are no longer stored in  a list view friendly manner.
  * (A record may have an undetermined number of email addresses).
  *
  * @param array $lvsParams
  */
 function process($lvsParams = array())
 {
     if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) {
         $lvsParams['custom_select'] = ', email_address as email1';
         $lvsParams['custom_from'] = ' LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = \'Accounts\'' . ' AND eabr.bean_id = accounts.id AND primary_address = 1' . ' LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id';
     }
     if (isset($this->displayColumns) && array_search('parent_name', $this->displayColumns) !== false) {
         $lvsParams['custom_select'] = empty($lvsParams['custom_select']) ? ', a1.name as parent_name ' : $lvsParams['custom_select'] . ', a1.name as parent_name ';
         $lvsParams['custom_from'] = empty($lvsParams['custom_from']) ? ' LEFT JOIN accounts a1 on a1.id = accounts.parent_id' : $lvsParams['custom_from'] . ' LEFT JOIN accounts a1 on a1.id = accounts.parent_id';
     }
     parent::process($lvsParams);
 }
 function process()
 {
     global $current_language, $app_list_strings, $image_path, $current_user;
     //$where = 'emails.deleted = 0 AND emails.assigned_user_id = \''.$current_user->id.'\' AND emails.type = \'inbound\' AND emails.status = \'unread\'';
     $mod_strings = return_module_language($current_language, 'Emails');
     $this->filters['assigned_user_id'] = $current_user->id;
     $this->filters['type'] = array("inbound");
     $this->filters['status'] = array("unread");
     $lvsParams = array();
     $lvsParams['custom_select'] = " ,emails_text.from_addr as from_addr ";
     $lvsParams['custom_from'] = " join emails_text on emails.id = emails_text.email_id ";
     parent::process($lvsParams);
 }
 function process()
 {
     global $current_language, $app_list_strings, $image_path, $current_user;
     $mod_strings = return_module_language($current_language, 'Meetings');
     if ($this->myItemsOnly) {
         // handle myitems only differently
         $lvsParams = array('custom_from' => ' INNER JOIN meetings_users ON meetings.id = meetings_users.meeting_id ', 'custom_where' => ' AND meetings_users.deleted = 0 AND (meetings.assigned_user_id = \'' . $current_user->id . '\' OR meetings_users.user_id = \'' . $current_user->id . '\') ', 'distinct' => true);
     } else {
         $lvsParams = array();
     }
     $this->myItemsOnly = false;
     parent::process($lvsParams);
     $keys = array();
     foreach ($this->lvs->data['data'] as $num => $row) {
         $keys[] = $row['ID'];
     }
     // grab meeting status
     if (!empty($keys)) {
         $query = "SELECT meeting_id, accept_status FROM meetings_users WHERE user_id = '" . $current_user->id . "' AND meeting_id IN ('" . implode("','", $keys) . "')";
         $result = $GLOBALS['db']->query($query);
     }
     while ($row = $GLOBALS['db']->fetchByAssoc($result)) {
         $rowNums = $this->lvs->data['pageData']['idIndex'][$row['meeting_id']];
         // figure out which rows have this guid
         foreach ($rowNums as $rowNum) {
             $this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] = $row['accept_status'];
         }
     }
     foreach ($this->lvs->data['data'] as $rowNum => $row) {
         if (empty($this->lvs->data['data'][$rowNum]['DURATION_HOURS'])) {
             $this->lvs->data['data'][$rowNum]['DURATION'] = '0' . $mod_strings['LBL_HOURS_ABBREV'];
         } else {
             $this->lvs->data['data'][$rowNum]['DURATION'] = $this->lvs->data['data'][$rowNum]['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'];
         }
         if (empty($this->lvs->data['data'][$rowNum]['DURATION_MINUTES']) || empty($this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']])) {
             $this->lvs->data['data'][$rowNum]['DURATION'] .= '00';
         } else {
             $this->lvs->data['data'][$rowNum]['DURATION'] .= $this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']];
         }
         $this->lvs->data['data'][$rowNum]['DURATION'] .= $mod_strings['LBL_MINSS_ABBREV'];
         if ($this->lvs->data['data'][$rowNum]['STATUS'] == "Planned") {
             if ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == '' || $this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == 'none') {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\"><a title=\"" . $app_list_strings['dom_meeting_accept_options']['accept'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=accept', null, null, SUGAR.sugarHome.retrieveDashlet, '{$this->id}');\">" . get_image($image_path . "accept_inline", "alt='" . $app_list_strings['dom_meeting_accept_options']['accept'] . "' border='0'") . "</a>&nbsp;<a title=\"" . $app_list_strings['dom_meeting_accept_options']['tentative'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=tentative', null, null, SUGAR.sugarHome.retrieveDashlet, '{$this->id}');\">" . get_image($image_path . "tentative_inline", "alt='" . $app_list_strings['dom_meeting_accept_options']['tentative'] . "' border='0'") . "</a>&nbsp;<a title=\"" . $app_list_strings['dom_meeting_accept_options']['decline'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=decline', null, null, SUGAR.sugarHome.retrieveDashlet, '{$this->id}');\">" . get_image($image_path . "decline_inline", "alt='" . $app_list_strings['dom_meeting_accept_options']['decline'] . "' border='0'") . "</a></div>";
             } else {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS']];
             }
         }
     }
     $this->displayColumns[] = "set_accept_links";
 }
 function process($lvsParams = array())
 {
     global $current_language, $app_list_strings, $current_user;
     $mod_strings = return_module_language($current_language, 'oqc_Task');
     // handle myitems only differently --  set the custom query to show assigned meetings and invitee meetings
     if ($this->myItemsOnly) {
         //join with meeting_users table to process related users
         $this->seedBean->listview_inner_join = array('LEFT JOIN  oqc_task_users m_u on  m_u.oqc_task_id = oqc_task.id');
         //set the custom query to retrieve invitees AND assigned meetings
         $lvsParams['custom_where'] = ' AND (oqc_task.assigned_user_id = \'' . $current_user->id . '\' OR m_u.user_id = \'' . $current_user->id . '\') AND m_u.deleted=0 ';
     }
     $this->myItemsOnly = false;
     //query needs to be distinct to avoid multiple records being returned for the same meeting (one for each invited user),
     //so we need to make sure date entered is also set so the sort can work with the group by
     $lvsParams['custom_select'] = ', oqc_task.date_entered ';
     $lvsParams['distinct'] = true;
     parent::process($lvsParams);
     $keys = array();
     foreach ($this->lvs->data['data'] as $num => $row) {
         $keys[] = $row['ID'];
     }
     // grab meeting status
     if (!empty($keys)) {
         $query = "SELECT oqc_task_id, accept_status FROM oqc_task_users WHERE deleted = 0 AND user_id = '" . $current_user->id . "' AND oqc_task_id IN ('" . implode("','", $keys) . "')";
         $result = $GLOBALS['db']->query($query);
     }
     while ($row = $GLOBALS['db']->fetchByAssoc($result)) {
         $rowNums = $this->lvs->data['pageData']['idIndex'][$row['oqc_task_id']];
         // figure out which rows have this guid
         foreach ($rowNums as $rowNum) {
             $this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] = $row['accept_status'];
         }
     }
     foreach ($this->lvs->data['data'] as $rowNum => $row) {
         // $GLOBALS['log']->error("Is Done row is ". var_export($this->lvs->data['data'][$rowNum]['ISDONE'],true));
         if (isset($this->lvs->data['data'][$rowNum]['ISDONE']) && $this->lvs->data['data'][$rowNum]['ISDONE'] != "1") {
             if ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == '') {
                 //if no status has been set, then do not show accept options
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\" class=\"acceptMeeting\"></div>";
             } elseif ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == 'notAccepted') {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\" class=\"acceptMeeting\"><a title=\"" . $app_list_strings['oqc_task_accepted_list']['accepted'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=oqc_Task&action=SetAcceptStatus&id=" . $this->id . "&object_type=oqc_Task&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=accept', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("accept_inline", "alt='" . $app_list_strings['oqc_task_accepted_list']['accepted'] . "' border='0'") . "</a>&nbsp;<a title=\"" . $app_list_strings['oqc_task_accepted_list']['decline'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=oqc_Task&action=SetAcceptStatus&id=" . $this->id . "&object_type=oqc_Task&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=decline', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("decline_inline", "alt='" . $app_list_strings['oqc_task_accepted_list']['decline'] . "' border='0'") . "</a></div>";
             } else {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = $app_list_strings['oqc_task_accepted_list'][$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS']];
             }
         }
     }
     $this->displayColumns[] = "set_accept_links";
 }
예제 #9
0
    function process($lvsParams = array())
    {
        global $current_user;

        if ((is_admin($current_user) AND $current_user->employee_duty_c != "106") OR $current_user->employee_duty_c == "103")
        {
            $lvsParams['custom_where'] = " AND jrmis_borrowers_cstm.application_status_c < 400 ";
        }
        else
        {
            $lvsParams['custom_where'] = " AND jrmis_borrowers_cstm.application_status_c < 400 AND jrmis_borrowers_cstm.jrmis_departments_id_c='{$current_user->jrmis_departments_id_c}'"; 

        }
         
        parent::process($lvsParams);
    }
예제 #10
0
 public function process()
 {
     $this->lvs->quickViewLinks = false;
     parent::process();
 }