From a33d0d20b4c7bd852272d8f7734138b64281b54a Mon Sep 17 00:00:00 2001
From: goujonpa <goujonpa@gmail.com>
Date: Thu, 19 Jun 2014 00:24:22 +0200
Subject: [PATCH] phonefield

---
 class/client.php     | 8 ++++++++
 class/phonefield.php | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/class/client.php b/class/client.php
index 71a7747..f4caeb1 100644
--- a/class/client.php
+++ b/class/client.php
@@ -2,6 +2,13 @@
 
 class Client extends Personne
 {
+
+    public $_specialFields = array(
+    "num_tel" => array(
+        "t" => "PhoneField",
+        "label" => "Numero de telephone",
+    ));
+
     protected $num_tel;
 
     public function num_tel()
@@ -13,4 +20,5 @@ class Client extends Personne
     {
         $this->num_tel = $num_tel;
     }
+
 }
\ No newline at end of file
diff --git a/class/phonefield.php b/class/phonefield.php
index 838b2e1..ca81098 100644
--- a/class/phonefield.php
+++ b/class/phonefield.php
@@ -25,4 +25,13 @@ class PhoneField extends Field
         return false;
     }
 
+    public function show() {
+        $num = $this->value;
+        $html = "";
+        for($i = 0; i < 5; i++) {
+            $html += substr($num, 2*$i, 2);
+            $html += ".";
+        }
+        return $html;
+    }
 }
-- 
GitLab