Project.class.php

gehe zur Dokumentation dieser Datei
00001 <?php
00002 // ---------------------------------------------------------------------------
00003 // $Id$
00004 // ---------------------------------------------------------------------------
00005 // OpenRat Content Management System
00006 // Copyright (C) 2002-2004 Jan Dankert, jandankert@jandankert.de
00007 //
00008 // This program is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU General Public License
00010 // as published by the Free Software Foundation; either version 2
00011 // of the License, or (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021 // ---------------------------------------------------------------------------
00022 // $Log$
00023 // Revision 1.18  2007-12-21 23:27:23  dankert
00024 // Neue Methode "getTemplates"
00025 //
00026 // Revision 1.17  2007-12-04 22:57:20  dankert
00027 // Beispiel-Vorlage mit "Hello, World".
00028 //
00029 // Revision 1.16  2007-11-24 12:16:15  dankert
00030 // Methoden "available()" zum Pr?fen auf die Existenz der Id.
00031 //
00032 // Revision 1.15  2007-05-24 19:47:48  dankert
00033 // Direktes Ausw?hlen von Sprache/Modell in der Projektauswahlliste.
00034 //
00035 // Revision 1.14  2007-04-22 00:17:30  dankert
00036 // Neue Methode "export()" - fertiggestellt :)
00037 //
00038 // Revision 1.13  2007-04-21 11:53:09  dankert
00039 // Neue Methode "export()" - in Arbeit, TODO!
00040 //
00041 // Revision 1.12  2007-04-06 01:37:49  dankert
00042 // Verhindern einer Warnung bei modernen PHP-Versionen.
00043 //
00044 // Revision 1.11  2007/02/26 22:05:08  dankert
00045 // Neue Methode "loadByName()"
00046 //
00047 // Revision 1.10  2006/07/19 21:30:32  dankert
00048 // Beim Speichern auch ?ndern des Root-Folders
00049 //
00050 // Revision 1.9  2006/06/01 20:58:11  dankert
00051 // Projektwartung: Suche nach verlorenen Dateien.
00052 //
00053 // Revision 1.8  2004/12/29 20:18:20  dankert
00054 // Konstruktor geaendert
00055 //
00056 // Revision 1.7  2004/12/19 15:23:56  dankert
00057 // Anpassung Session-Funktionen
00058 //
00059 // Revision 1.6  2004/12/15 23:16:58  dankert
00060 // Anpassung an Session-Funktionen
00061 //
00062 // Revision 1.5  2004/11/10 22:47:57  dankert
00063 // Methoden zum Lesen von Standardmodell, Standardsprache dieses Projektes
00064 //
00065 // Revision 1.4  2004/10/14 21:13:56  dankert
00066 // *** empty log message ***
00067 //
00068 // Revision 1.3  2004/05/02 14:41:31  dankert
00069 // Einf?gen package-name (@package)
00070 //
00071 // ---------------------------------------------------------------------------
00072 
00073 
00081 class Project
00082 {
00083      // Eigenschaften
00084      var $projectid;
00085      var $name;
00086      var $target_dir;
00087      var $ftp_url;
00088      var $ftp_passive;
00089      var $cmd_after_publish;
00090      var $content_negotiation;
00091      var $cut_index;
00092      
00093      // Konstruktor
00094      function Project( $projectid='' )
00095      {
00096           if   ( intval($projectid) != 0 )
00097                $this->projectid = $projectid;
00098      }
00099 
00100      
00104      function available( $id )
00105      {
00106           $db = db_connection();
00107 
00108           $sql = new Sql('SELECT 1 FROM {t_project} '.
00109                          ' WHERE id={id}');
00110           $sql->setInt('id' ,$id  );
00111 
00112           return intval($db->getOne($sql->query)) == 1;
00113      }
00114      
00115 
00116      // Liefert alle verf?gbaren Projekte
00117      function getAll()
00118      {
00119           return Project::getAllProjects();
00120      }
00121 
00122 
00123      // Liefert alle verf?gbaren Projekte
00124      function getAllProjects()
00125      {
00126           $db = db_connection();
00127           $sql = new Sql( 'SELECT id,name FROM {t_project} '.
00128                           '   ORDER BY name' );
00129 
00130           return $db->getAssoc( $sql->query );
00131      }
00132 
00133 
00134      // Liefert alle verf?gbaren Projekt-Ids
00135      function getAllProjectIds()
00136      {
00137           $db = db_connection();
00138           $sql = new Sql( 'SELECT id FROM {t_project} '.
00139                           '   ORDER BY name' );
00140 
00141           return $db->getCol( $sql->query );
00142      }
00143 
00144 
00145      function getLanguages()
00146      {
00147           $db = db_connection();
00148 
00149           $sql = new Sql( 'SELECT id,name FROM {t_language}'.
00150                           '  WHERE projectid={projectid} '.
00151                           '  ORDER BY name' );
00152           $sql->setInt   ('projectid',$this->projectid);
00153 
00154           return $db->getAssoc( $sql->query );
00155      }
00156 
00157 
00158      function getLanguageIds()
00159      {
00160           return array_keys( $this->getLanguages() );
00161      }
00162 
00163 
00164      function getModels()
00165      {
00166           $db = db_connection();
00167 
00168           $sql = new Sql( 'SELECT id,name FROM {t_projectmodel}'.
00169                           '  WHERE projectid= {projectid} '.
00170                           '  ORDER BY name' );
00171           $sql->setInt   ('projectid',$this->projectid);
00172 
00173           return $db->getAssoc( $sql->query );
00174      }
00175 
00176 
00177      function getModelIds()
00178      {
00179           return array_keys( $this->getModels() );
00180      }
00181 
00182 
00183      function getTemplateIds()
00184      {
00185           $db = db_connection();
00186 
00187           $sql = new Sql( 'SELECT id FROM {t_template}'.
00188                           '  WHERE projectid= {projectid} ' );
00189           $sql->setInt   ('projectid',$this->projectid);
00190 
00191           return $db->getCol( $sql->query );
00192      }
00193 
00194 
00195      function getTemplates()
00196      {
00197           $db = db_connection();
00198 
00199           $sql = new Sql( 'SELECT id,name FROM {t_template}'.
00200                           '  WHERE projectid= {projectid} ' );
00201           $sql->setInt   ('projectid',$this->projectid);
00202 
00203           return $db->getAssoc( $sql->query );
00204      }
00205 
00206 
00210      function getRootObjectId()
00211      {
00212           $db = db_connection();
00213           
00214           $sql = new Sql('SELECT id FROM {t_object}'.
00215                          '  WHERE parentid IS NULL'.
00216                          '    AND projectid={projectid}' );
00217 
00218           $sql->setInt('projectid',$this->projectid);
00219           
00220           return( $db->getOne( $sql->query ) );
00221      }
00222 
00223      
00224 
00225      // Laden
00226      function load()
00227      {
00228           $db = db_connection();
00229 
00230           $sql = new Sql( 'SELECT * FROM {t_project} '.
00231                           '   WHERE id={projectid}' );
00232           $sql->setInt( 'projectid',$this->projectid );
00233 
00234           $row = $db->getRow( $sql->query );
00235 
00236           $this->name                = $row['name'               ];
00237           $this->target_dir          = $row['target_dir'         ];
00238           $this->ftp_url             = $row['ftp_url'            ];
00239           $this->ftp_passive         = $row['ftp_passive'        ];
00240           $this->cmd_after_publish   = $row['cmd_after_publish'  ];
00241           $this->content_negotiation = $row['content_negotiation'];
00242           $this->cut_index           = $row['cut_index'          ];
00243      }
00244 
00245 
00246      // Laden
00247      function loadByName()
00248      {
00249           $db = db_connection();
00250 
00251           $sql = new Sql( 'SELECT * FROM {t_project} '.
00252                           '   WHERE name={projectname}' );
00253           $sql->setString( 'projectname',$this->name );
00254 
00255           $row = $db->getRow( $sql->query );
00256 
00257           $this->projectid           = $row['id'                 ];
00258           $this->target_dir          = $row['target_dir'         ];
00259           $this->ftp_url             = $row['ftp_url'            ];
00260           $this->ftp_passive         = $row['ftp_passive'        ];
00261           $this->cmd_after_publish   = $row['cmd_after_publish'  ];
00262           $this->content_negotiation = $row['content_negotiation'];
00263           $this->cut_index           = $row['cut_index'          ];
00264      }
00265 
00266 
00267      // Speichern
00268      function save()
00269      {
00270           $db = db_connection();
00271 
00272           $sql = new Sql( 'UPDATE {t_project}'.
00273                           '  SET name                = {name},'.
00274                           '      target_dir          = {target_dir},'.
00275                           '      ftp_url             = {ftp_url}, '.
00276                           '      ftp_passive         = {ftp_passive}, '.
00277                           '      cut_index           = {cut_index}, '.
00278                           '      content_negotiation = {content_negotiation}, '.
00279                           '      cmd_after_publish   = {cmd_after_publish} '.
00280                           'WHERE id= {projectid} ' );
00281 
00282           $sql->setString('name'               ,$this->name );
00283           $sql->setString('target_dir'         ,$this->target_dir );
00284           $sql->setString('ftp_url'            ,$this->ftp_url );
00285           $sql->setInt   ('ftp_passive'        ,$this->ftp_passive );
00286           $sql->setString('cmd_after_publish'  ,$this->cmd_after_publish );
00287           $sql->setInt   ('content_negotiation',$this->content_negotiation );
00288           $sql->setInt   ('cut_index'          ,$this->cut_index );
00289           $sql->setInt   ('projectid'          ,$this->projectid );
00290 
00291           $db->query( $sql->query );
00292           
00293           $rootFolder = new Folder( $this->getRootObjectId() );
00294           $rootFolder->load();
00295           $rootFolder->filename = $this->name;
00296           $rootFolder->save();
00297      }
00298 
00299 
00300      // Speichern
00301      function getProperties()
00302      {
00303           return Array( 'name'               =>$this->name,
00304                         'target_dir'         =>$this->target_dir,
00305                         'ftp_url'            =>$this->ftp_url,
00306                         'ftp_passive'        =>$this->ftp_passive,
00307                         'cmd_after_publish'  =>$this->cmd_after_publish,
00308                         'content_negotiation'=>$this->content_negotiation,
00309                         'cut_index'          =>$this->cut_index,
00310                         'projectid'          =>$this->projectid );
00311      }
00312 
00313 
00314      // Projekt hinzufuegen
00315      function add()
00316      {
00317           $db = db_connection();
00318 
00319           $sql = new Sql('SELECT MAX(id) FROM {t_project}');
00320           $this->projectid = intval($db->getOne($sql->query))+1;
00321 
00322 
00323           // Projekt hinzuf?gen
00324           $sql = new Sql( 'INSERT INTO {t_project} (id,name,target_dir,ftp_url,ftp_passive,cmd_after_publish,content_negotiation,cut_index) '.
00325                           "  VALUES( {projectid},{name},'','',0,'',0,0 ) " );
00326           $sql->setString('name'     ,$this->name );
00327           $sql->setInt   ('projectid',$this->projectid );
00328 
00329           $db->query( $sql->query );
00330 
00331           // Modell anlegen
00332           $model = new Model();
00333           $model->projectid = $this->projectid;
00334           $model->name = 'html';
00335           $model->add();
00336           
00337           // Sprache anlegen
00338           $language = new Language();
00339           $language->projectid = $this->projectid;
00340           $language->isoCode = 'en';
00341           $language->name    = 'english';
00342           $language->add();
00343           
00344           // Haupt-Ordner anlegen
00345           $folder = new Folder();
00346           $folder->isRoot     = true;
00347           $folder->projectid  = $this->projectid;
00348           $folder->languageid = $language->languageid;
00349           $folder->filename   = $this->name;
00350           $folder->name       = $this->name;
00351           $folder->isRoot     = true;
00352           $folder->add();
00353 
00354           // Template anlegen
00355           $template = new Template();
00356           $template->projectid  = $this->projectid;
00357           $template->name       = '';
00358           $template->modelid    = $model->modelid;
00359           $template->languageid = $language->languageid;
00360           $template->extension  = 'html';
00361           $template->src        = '<html><body><h1>Hello world</h1><hr><p>Hello, World.</p></body></html>';
00362           $template->add();
00363           $template->save();
00364 
00365           // Beispiel-Seite anlegen
00366           $page = new Page();
00367           $page->parentid   = $folder->objectid;
00368           $page->projectid  = $this->projectid;
00369           $page->languageid = $language->languageid;
00370           $page->templateid = $template->templateid;
00371           $page->filename   = '';
00372           $page->name       = 'OpenRat';
00373           $page->add();
00374      }
00375 
00376 
00377      // Projekt aus Datenbank entfernen
00378      function delete()
00379      {
00380           $db = db_connection();
00381 
00382           // Root-Ordner rekursiv samt Inhalten loeschen
00383           $folder = new Folder( $this->getRootObjectId() );
00384           $folder->deleteAll();
00385 
00386 
00387           foreach( $this->getLanguageIds() as $languageid )
00388           {
00389                $language = new Language( $languageid );
00390                $language->delete();
00391           }
00392           
00393 
00394           foreach( $this->getTemplateIds() as $templateid )
00395           {
00396                $template = new Template( $templateid );
00397                $template->delete();
00398           }
00399           
00400 
00401           foreach( $this->getModelIds() as $modelid )
00402           {
00403                $model = new Model( $modelid );
00404                $model->delete();
00405           }
00406           
00407 
00408           // Projekt l?schen
00409           $sql = new Sql( 'DELETE FROM {t_project}'.
00410                           '  WHERE id= {projectid} ' );
00411           $sql->setInt( 'projectid',$this->projectid );
00412           $db->query( $sql->query );
00413      }
00414      
00415      function getDefaultLanguageId()
00416      {
00417           $db = Session::getDatabase();
00418 
00419           // ORDER BY deswegen, damit immer mind. eine Sprache
00420           // gelesen wird
00421           $sql = new Sql( 'SELECT id FROM {t_language} '.
00422                           '  WHERE projectid={projectid}'.
00423                           '   ORDER BY is_default DESC' );
00424 
00425           $sql->setInt('projectid',$this->projectid );
00426           
00427           return $db->getOne( $sql->query );
00428      }
00429 
00430 
00431      function getDefaultModelId()
00432      {
00433           $db = Session::getDatabase();
00434 
00435           // ORDER BY deswegen, damit immer mind. eine Sprache
00436           // gelesen wird
00437           $sql = new Sql( 'SELECT id FROM {t_model} '.
00438                           '  WHERE projectid={projectid}'.
00439                           '   ORDER BY is_default DESC' );
00440           $sql->setInt('projectid',$this->projectid );
00441           
00442           return $db->getOne( $sql->query );
00443      }
00444      
00445      
00446      function checkLostFiles()
00447      {
00448           $db = &Session::getDatabase();
00449           
00450           $sql = new Sql( <<<EOF
00451 SELECT thistab.id FROM {t_object} AS thistab
00452  LEFT JOIN {t_object} AS parenttab
00453         ON parenttab.id = thistab.parentid
00454   WHERE thistab.projectid={projectid} AND thistab.parentid IS NOT NULL AND parenttab.id IS NULL
00455 EOF
00456 );
00457           $sql->setInt('projectid',$this->projectid);
00458 
00459           $lostAndFoundFolder = new Folder();
00460           $lostAndFoundFolder->projectid = $this->projectid;
00461           $lostAndFoundFolder->languageid = $this->getDefaultLanguageId();
00462           $lostAndFoundFolder->filename = "lostandfound";
00463           $lostAndFoundFolder->name     = 'Lost+found';
00464           $lostAndFoundFolder->parentid = $this->getRootObjectId();
00465           $lostAndFoundFolder->add();
00466 
00467           foreach( $db->getCol($sql->query) as $id )
00468           {
00469                echo 'Lost file! moving '.$id.' to lost+found.';
00470                $obj = new Object( $id );
00471                $obj->setParentId( $lostAndFoundFolder->objectid );
00472           }
00473      }
00474      
00475      
00484      function export( $dbid_destination )
00485      {
00486           global $conf;
00487           $zeit = date('Y-m-d\TH:i:sO');
00488           
00489           $db_src  = db_connection();
00490           $db_dest = new DB( $conf['database'][$dbid_destination] );
00491           
00492 //        $aa = 5000; // Bisher nicht erreichte ID in der Zieldatenbank
00493 
00494           // -------------------------------------------------------
00495 //        $prefix = 'a24_';
00496           $mapping = array();
00497           $ids = array('project'      => array('foreign_keys'=>array(),
00498                                                'primary_key' =>'id',
00499                                                'unique_idx'  =>'name',
00500                                                'erase'       =>array()
00501                                               ),
00502                        'language'     => array('foreign_keys'=>array('projectid'=>'project'),
00503                                                'primary_key' =>'id'
00504                                               ),
00505                        'projectmodel' => array('foreign_keys'=>array('projectid'=>'project'),
00506                                                'primary_key' =>'id'
00507                                               ),
00508                        'template'     => array('foreign_keys'=>array('projectid'=>'project'),
00509                                                'primary_key' =>'id'
00510                                                ),
00511                        'object'       => array('foreign_keys'=>array('projectid'  =>'project' ),
00512                                                'self_key'    =>'parentid',
00513                                                'primary_key' =>'id',
00514                                                'erase'       =>array('create_userid','lastchange_userid')
00515                                                ),
00516                        'element'      => array('foreign_keys'=>array('templateid'      =>'template',
00517                                                                       'folderobjectid'  =>'object',
00518                                                                      'default_objectid'=>'object'   ),
00519                                                'primary_key' =>'id'
00520                                                ),
00521                        'templatemodel'=> array('foreign_keys'=>array('projectmodelid'=>'projectmodel',
00522                                                                      'templateid'    =>'template'     ),
00523                                                'primary_key' =>'id',
00524                                                'replace'     =>array('text'=>'element')
00525                                                ),
00526                        'name'         => array('foreign_keys'=>array('objectid'  =>'object',
00527                                                                      'languageid'=>'language'   ),
00528                                                'primary_key' =>'id'
00529                                                ),
00530                        'page'         => array('foreign_keys'=>array('objectid'  =>'object',
00531                                                                      'templateid'=>'template' ),
00532                                                'primary_key' =>'id'
00533                                                ),
00534                        'value'         => array('foreign_keys'=>array('pageid'   =>'page',
00535                                                                      'languageid'=>'language',
00536                                                                      'elementid'=>'element',
00537                                                                      'linkobjectid'=>'object'  ),
00538                                                'erase'       =>array('lastchange_userid'),
00539                                                'replace'     =>array('text'=>'object'),
00540                                                'primary_key' =>'id'
00541                                                ),
00542                        'link'         => array('foreign_keys'=>array('objectid'     =>'object',
00543                                                                      'link_objectid'=>'object'   ),
00544                                                'primary_key' =>'id'
00545                                                ),
00546                        'folder'         => array('foreign_keys'=>array('objectid'  =>'object' ),
00547                                                'primary_key' =>'id'
00548                                                ),
00549                        'file'         => array('foreign_keys'=>array('objectid'  =>'object'   ),
00550                                                'primary_key' =>'id',
00551                                                'binary'      =>'value'
00552                                                ),
00553                        
00554           );
00555           foreach( $ids as $tabelle=>$data )
00556           {
00557 //             Html::debug($tabelle,"Tabelle");
00558                
00559                $mapping[$tabelle] = array();
00560                $idcolumn = $data['primary_key'];
00561 
00562                // Nächste freie Id in der Zieltabelle ermitteln.
00563                $sql = new Sql( 'SELECT MAX('.$idcolumn.') FROM {t_'.$tabelle.'}',$dbid_destination);
00564                $maxid = intval($db_dest->getOne($sql->query));
00565                $nextid = $maxid;
00566 
00567                // Zu übertragende IDs ermitteln.
00568                if   ( count($data['foreign_keys'])==0 )
00569                {
00570                     $where = ' WHERE id='.$this->projectid;
00571                }
00572                else
00573                {
00574                     foreach( $data['foreign_keys'] as $fkey_column=>$target_tabelle )
00575                     {
00576                          $where = ' WHERE '.$fkey_column.' IN ('.join(array_keys($mapping[$target_tabelle]),',').')';
00577                          break;
00578                     }
00579                }
00580                $sql = new Sql( 'SELECT '.$idcolumn.' FROM {t_'.$tabelle.'} '.$where);
00581 
00582                foreach( $db_src->getCol($sql->query) as $srcid )
00583                {
00584                     $mapping[$tabelle][$srcid] = ++$nextid;
00585 
00586 //                  Html::debug($mapping,"Mapping");
00587                     
00588                     $sql = new Sql( 'SELECT * FROM {t_'.$tabelle.'} WHERE id={id}');
00589                     $sql->setInt('id',$srcid);
00590                     $row = $db_src->getRow( $sql->query );
00591 
00592                     // Wert des Primärschlüssels ändern.
00593                     $row[$idcolumn] = $mapping[$tabelle][$srcid];
00594 
00595                     // Fremdschlüsselbeziehungen auf neue IDn korrigieren.
00596                     foreach( $data['foreign_keys'] as $fkey_column=>$target_tabelle)
00597                     {
00598                          if   ( intval($row[$fkey_column]) != 0 )
00599                               $row[$fkey_column] = $mapping[$target_tabelle][$row[$fkey_column]];
00600 //                       if   ( !isset($mapping[$target_tabelle][$row[$fkey_column]]))
00601 //                            Html::debug('Fehler: T='.$target_tabelle.', Column='.$fkey_column);
00602                               
00603                     }
00604                     
00605                     foreach( array_keys($row) as $key )
00606                     {
00607                          if   ( isset($data['unique_idx']) && $key == $data['unique_idx'] )
00608                          {
00609                               // Nachschauen, ob es einen UNIQUE-Key in der Zieltabelle schon gibt.
00610                               $sql = new Sql( 'SELECT 1 FROM {t_'.$tabelle.'} WHERE '.$key."='".$row[$key]."'",$dbid_destination);
00611 //                            Html::debug($sql->query);
00612                               
00613                               if   ( intval($db_dest->getOne( $sql->query )) == 1 )
00614                                    $row[$key] = $row[$key].$zeit;
00615 
00616                          }
00617 
00618                          if   ( isset($data['erase']) && in_array($key,$data['erase']) )
00619                               $row[$key] = null;
00620 
00621                          if   ( isset($data['self_key']) && $key == $data['self_key'] && intval($row[$key]) > 0 )
00622                               $row[$key] = $row[$key]+$maxid;
00623                     }
00624                     
00625                     if   ( isset($data['replace']) )
00626                     {
00627                          foreach( $data['replace'] as $repl_column=>$repl_tabelle)
00628                               foreach( $mapping[$repl_tabelle] as $oldid=>$newid)
00629                               {
00630                                    $row[$repl_column] = str_replace('{'.$oldid.'}','{'.$newid.'}'  ,$row[$repl_column]);
00631                                    $row[$repl_column] = str_replace('"'.$oldid.'"','"'.$newid.'"'  ,$row[$repl_column]);
00632                                    $row[$repl_column] = str_replace('->'.$oldid   ,'->"'.$newid.'"',$row[$repl_column]);
00633                               }
00634                     }
00635                     
00636                     if   ( isset($data['binary']) )
00637                     {
00638                          if   ( !$db_src->conf['base64'] && $db_dest->conf['base64'] )
00639                               $row[$data['binary']] = base64_encode($row[$data['binary']]);
00640                          elseif    ( $db_src->conf['base64'] && !$db_dest->conf['base64'] )
00641                               $row[$data['binary']] = base64_decode($row[$data['binary']]);
00642                     }
00643                     
00644 //                  Html::debug($row,'Zeile');
00645                     
00646                     // Daten in Zieltabelle einfügen.
00647                     $sql = new Sql( 'INSERT INTO {t_'.$tabelle.'} ('.join(array_keys($row),',').') VALUES({'.join(array_keys($row),'},{').'})',$dbid_destination);
00648                     foreach( $row as $key=>$value )
00649                     {
00650                          if   ( isset($data['erase']) && in_array($key,$data['erase']) )
00651                               $sql->setNull($key);
00652                          else
00653                               $sql->setVar($key,$value);
00654                     }
00655                     //$sql = new Sql( 'INSERT INTO {t_'.$tabelle.'} ('.join(array_keys($row),',').') VALUES('.join($row,',').')',$dbid_destination);
00656                     $db_dest->query( $sql->query );
00657                }
00658 
00659                if   ( isset($data['self_key']) )
00660                {
00661                     foreach( $mapping[$tabelle] as $oldid=>$newid )
00662                     {
00663                          $sql = new Sql( 'UPDATE {t_'.$tabelle.'} SET '.$data['self_key'].'='.$newid.' WHERE '.$data['self_key'].'='.($oldid+$maxid),$dbid_destination );
00664                          $db_dest->query( $sql->query );
00665                     }
00666                }
00667           }
00668      }
00669 }
00670 
00671 ?>

Erzeugt am Thu May 14 00:55:48 2009 für OpenRat von  doxygen 1.5.8