Switch to latest core
[platal.git] / modules / profile / addresses.inc.php
index 11220b4..8a9e2f2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-class ProfileAddress extends ProfileGeocoding
+class ProfileSettingAddress extends ProfileSettingGeocoding
 {
     private $bool;
     private $pub;
 
     public function __construct()
     {
-        $this->bool = new ProfileBool();
-        $this->pub  = new ProfilePub();
+        $this->bool = new ProfileSettingBool();
+        $this->pub  = new ProfileSettingPub();
     }
 
     private function cleanAddress(ProfilePage &$page, $addrid, array &$address)
@@ -35,7 +35,7 @@ class ProfileAddress extends ProfileGeocoding
         if (!isset($address['tel'])) {
             $address['tel'] = array();
         }
-        $profiletel           = new ProfilePhones('address', $addrid);
+        $profiletel           = new ProfileSettingPhones('address', $addrid);
         $address['tel']       = $profiletel->value($page, 'tel',       $address['tel'],       $s);
         $address['current']   = $this->bool->value($page, 'current',   $address['current'],   $s);
         $address['temporary'] = $this->bool->value($page, 'temporary', $address['temporary'], $s);
@@ -119,24 +119,24 @@ class ProfileAddress extends ProfileGeocoding
                             WHERE  pid = {?} AND type = 'home'",
                      $page->pid());
         XDB::execute("DELETE FROM  profile_phones
-                            WHERE  uid = {?} AND link_type = 'address'",
+                            WHERE  pid = {?} AND link_type = 'address'",
                      $page->pid());
         foreach ($value as $addrid => &$address) {
             $this->saveAddress($page->pid(), $addrid, $address, 'home');
-            $profiletel = new ProfilePhones('address', $addrid);
+            $profiletel = new ProfileSettingPhones('address', $addrid);
             $profiletel->saveTels($page->pid(), 'tel', $address['tel']);
         }
     }
 }
 
-class ProfileAddresses extends ProfilePage
+class ProfileSettingAddresses extends ProfilePage
 {
     protected $pg_template = 'profile/adresses.tpl';
 
     public function __construct(PlWizard &$wiz)
     {
         parent::__construct($wiz);
-        $this->settings['addresses'] = new ProfileAddress();
+        $this->settings['addresses'] = new ProfileSettingAddress();
         $this->watched['addresses']  = true;
     }
 
@@ -163,7 +163,7 @@ class ProfileAddresses extends ProfilePage
 
         $res = XDB::iterator("SELECT  link_id AS addrid, tel_type AS type, pub, display_tel AS tel, comment
                                 FROM  profile_phones
-                               WHERE  uid = {?} AND link_type = 'address'
+                               WHERE  pid = {?} AND link_type = 'address'
                             ORDER BY  link_id",
                              $this->pid());
         $i = 0;