Show payment details in CSV (Closes #728)
[platal.git] / modules / profile / page.inc.php
index a7dada8..d1a8d85 100644 (file)
@@ -172,7 +172,7 @@ abstract class ProfileGeoloc implements ProfileSetting
             } else if (@$address['parsevalid']) {
                 $address = array_merge($address, cut_address(@$address['text']));
                 $address['checked'] = true;
-                $mailer = new PlMailer('geoloc/mail_geoloc.tpl');
+                $mailer = new PlMailer('geoloc/geoloc.mail.tpl');
                 $mailer->assign('text', get_address_text($address));
                 $mailer->assign('geoloc', $geotxt);
                 $mailer->send();
@@ -187,6 +187,8 @@ abstract class ProfileGeoloc implements ProfileSetting
                 $address['checked'] = true;
             }
         }
+        $address['precise_lat'] = rtrim($address['precise_lat'], '.0');
+        $address['precise_lon'] = rtrim($address['precise_lon'], '.0'); 
         $address['text'] = get_address_text($address);
     }
 }
@@ -199,6 +201,7 @@ abstract class ProfilePage implements PlWizardPage
     protected $settings = array();  // A set ProfileSetting objects
     protected $errors   = array();  // A set of boolean with the value check errors
     protected $changed  = array();  // A set of boolean indicating wether the value has been changed
+    protected $watched  = array();  // A set of boolean indicating the fields that are watched
 
     public $orig     = array();
     public $values   = array();
@@ -238,16 +241,23 @@ abstract class ProfilePage implements PlWizardPage
 
     protected function saveData()
     {
+        require_once 'notifs.inc.php';
         foreach ($this->settings as $field=>&$setting) {
             if (!is_null($setting) && $this->changed[$field]) {
                 $setting->save($this, $field, $this->values[$field]);
             }
+            if ($this->changed[$field] && @$this->watched[$field]) {
+                register_profile_update(S::i('uid'), $field);
+            }
         }
         $this->_saveData();
 
         // Update the last modification date
         XDB::execute('REPLACE INTO  user_changes
                                SET  user_id = {?}', S::v('uid'));
+        if (!S::has('suid')) {
+            register_watch_op(S::i('uid'), WATCH_FICHE);
+        }
         global $platal;
         $log =& $_SESSION['log'];
         $log->log('profil', $platal->pl_self(1));