HomeHelpTrac

Ignore:
Timestamp:
10/31/08 11:35:27 (4 years ago)
Author:
nell
Message:

Changed alerts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/base/scripts/BxBaseUserAlertsView.php

    r7227 r7387  
    11<?php 
    22 
    3 require_once('inc/header.inc.php'); 
    4 require_once(BX_DIRECTORY_PATH_INC . 'db.inc.php'); 
    5 require_once(BX_DIRECTORY_PATH_INC . 'languages.inc.php'); 
    6 require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php'); 
     3require_once(BX_DIRECTORY_PATH_INC . 'header.inc.php'); 
    74require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'); 
    85 
     
    2421        $this->oConf = new BxDolAlerts('', '', 0, 0); 
    2522         
    26         if (is_array($aInActive)) { 
     23        if (is_array($aInActive) && !empty($aInActive)) { 
    2724            foreach ($aInActive as $iKey => $sValue) 
    2825                $sAdd .= " AND `{$this->oConf->aAlrFields['actionUnit']}` <> '$sValue'"; 
     
    4138        $sqlQuery = str_replace('__mainFields__', trim($sMainFields, ', '), $sqlTempl); 
    4239        $rData = db_res($sqlQuery); 
    43      
     40         
    4441        if (mysql_num_rows($rData) > 0) { 
    4542            while ($aMess = mysql_fetch_assoc($rData)) { 
    4643                $this->aList[$aMess['alertId']] = $aMess; 
    47                 $sqlDelCond .= $aMess['alertId'] . ","; 
    4844            } 
    49             $sqlQuery = "DELETE FROM `{$this->oConf->sAlrTable}`  
    50                          WHERE `{$this->oConf->aAlrFields['alertId']}` NOT IN (".trim($sqlDelCond,",").")  
    51                          AND `{$this->oConf->aAlrFields['alertRcpId']}`='{$this->iOwner}'"; 
    52             db_res($sqlQuery); 
    5345        } 
    5446    } 
     
    8577            WHERE `{$this->oConf->aAlrFields['alertRcpId']}`='$this->iOwner' AND `{$this->oConf->aAlrFields['alertNew']}`=1 
    8678            GROUP BY `{$this->oConf->aAlrFields['actionUnit']}`"; 
    87          
     79 
    8880        $rData = db_res($sqlQuery); 
    8981        while ($aUnit = mysql_fetch_assoc($rData)) 
     
    9688        $sCode = '<div id="alertsMenu">'; 
    9789        if (is_array($aUnits)) { 
     90            $oUnits = new BxDolAlertsResponseUser(); 
    9891            foreach ($aUnits as $iKey => $sValue) 
    9992                $sCode .= ' 
    10093                    <input type="checkbox" name="' . $sValue . '" id="' . $sValue . '"> 
    101                     <label for="' . $sValue . '"><img src="'.getTemplateIcon($this->oConf->aSupportUnits[$sValue]['picFile']).'" alt="'._t($this->oConf->aSupportUnits[$sValue]['caption']).'"></label> 
     94                    <label for="' . $sValue . '"><img src="'.getTemplateIcon($oUnits->aSupportUnits[$sValue]['picFile']).'" alt="'._t($oUnits->aSupportUnits[$sValue]['caption']).'"></label> 
    10295                '; 
    10396        } 
Note: See TracChangeset for help on using the changeset viewer.