Dotclear

Changeset 294:5d67ddc42592


Ignore:
Timestamp:
05/18/11 11:47:37 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
2.3
Message:

Fix full flat import : detecting existing prefs (will be not overwritten)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/importExport/inc/flat/class.dc.import.php

    r270 r294  
    371371     private function insertPref($pref) 
    372372     { 
     373          if ($this->prefExists($pref->pref_ws,$pref->pref_id,$pref->user_id)) { 
     374               return; 
     375          } 
     376           
    373377          $this->cur_pref->clean(); 
    374378           
     
    751755          $this->stack['users'][$user_id] = !$rs->isEmpty(); 
    752756          return $this->stack['users'][$user_id]; 
     757     } 
     758      
     759     private function prefExists($pref_id,$pref_ws,$user_id) 
     760     { 
     761          $strReq = 'SELECT pref_id,pref_ws,user_id '. 
     762                    'FROM '.$this->prefix.'pref '. 
     763                    "WHERE pref_id = '".$this->con->escape($pref_id)."' ". 
     764                    "AND pref_ws = '".$this->con->escape($pref_ws)."' "; 
     765          if (!$user_id) { 
     766               $strReq .= "AND user_id IS NULL "; 
     767          } else { 
     768               $strReq .= "AND user_id = '".$this->con->escape($user_id)."' "; 
     769          } 
     770           
     771          $rs = $this->con->select($strReq); 
     772           
     773          return !$rs->isEmpty(); 
    753774     } 
    754775      
Note: See TracChangeset for help on using the changeset viewer.

Sites map