Index: /WAeUP_SRP/trunk/Widgets.py
===================================================================
--- /WAeUP_SRP/trunk/Widgets.py	(revision 5504)
+++ /WAeUP_SRP/trunk/Widgets.py	(revision 5505)
@@ -9,5 +9,5 @@
 ##from Products.CPSSchemas.Widget import CPSWidgetType
 from Products.CMFCore.utils import getToolByName
-from Products.CPSSchemas.BasicWidgets import CPSBooleanWidget, CPSWidget, CPSStringWidget, CPSEmailWidget,CPSImageWidget
+from Products.CPSSchemas.BasicWidgets import CPSBooleanWidget, CPSWidget, CPSStringWidget, CPSEmailWidget,CPSImageWidget,CPSIntWidget
 from Products.CPSSchemas.BasicWidgets import CPSFileWidget, CPSPasswordWidget
 from Products.CPSSchemas.BasicWidgets import renderHtmlTag,CPSSelectWidget, CPSStringWidget
@@ -2553,4 +2553,55 @@
 ###)
 
+class PhoneWidget(CPSIntWidget): ###(
+    """ Phone Widget"""
+    meta_type = "Phone Widget"
+    
+    def validate(self, datastructure, **kw):
+        """Validate datastructure and update datamodel."""
+
+        valid = CPSIntWidget.validate(self, datastructure, **kw)
+        if not valid:
+            return 0
+        else:
+            widget_id = self.getWidgetId()
+            value = datastructure[widget_id]
+            #import pdb;pdb.set_trace()
+            if value == '234':
+                value = ''
+                datamodel = datastructure.getDataModel()
+                datamodel[self.fields[0]] = value
+            elif value.startswith('2340'):
+                err = 'Wrong Nigerian phone format'
+                datastructure.setError(widget_id, err)
+                return 0
+            return 1
+
+    def render(self, mode, datastructure, **kw):
+        """Render in mode from datastructure."""
+        value = datastructure[self.getWidgetId()]
+        #import pdb;pdb.set_trace()
+        if mode == 'view':
+            if value == '':
+                return ''
+            else:
+                return '+' + escape(value)
+        elif mode == 'edit':
+            if value == '':
+                value = 234
+            tag = renderHtmlTag('input',
+                                 type='text',
+                                 name=self.getHtmlWidgetId(),
+                                 value=value)
+            return '<strong>+</strong>' + tag
+        raise RuntimeError('unknown mode %s' % mode)
+
+
+InitializeClass(PhoneWidget)
+
+widgetRegistry.register(PhoneWidget)
+
+
+
+
 ###########
 
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_cest.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_cest.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_cest.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_cest_2.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_cest_2.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_cest_2.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_ct.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_ct.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_ct.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_dp.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_dp.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_dp.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_manage.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_manage.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_manage.xml	(revision 5505)
@@ -448,5 +448,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_pce.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_pce.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_pce.xml	(revision 5505)
@@ -284,5 +284,5 @@
   <property name="allow_resize">True</property>
  </widget>
- <widget name="phone" meta_type="String Widget">
+ <widget name="phone" meta_type="Phone Widget">
   <property name="title">Phone</property>
   <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_pde.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_pde.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_pde.xml	(revision 5505)
@@ -489,5 +489,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_prence.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_prence.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_prence.xml	(revision 5505)
@@ -428,5 +428,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_pt.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_pt.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_pt.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_pume.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_pume.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_pume.xml	(revision 5505)
@@ -281,5 +281,5 @@
   <property name="allow_resize">True</property>
  </widget>
- <widget name="phone" meta_type="String Widget">
+ <widget name="phone" meta_type="Phone Widget">
   <property name="title">Phone</property>
   <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_pume2.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_pume2.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_pume2.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_sandwich.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_sandwich.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_sandwich.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/application_sandwich2008.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/application_sandwich2008.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/application_sandwich2008.xml	(revision 5505)
@@ -329,5 +329,5 @@
     <property name="allow_resize">True</property>
   </widget>
-  <widget name="phone" meta_type="String Widget">
+  <widget name="phone" meta_type="Phone Widget">
     <property name="title">Phone</property>
     <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_firsttime_login.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_firsttime_login.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_firsttime_login.xml	(revision 5505)
@@ -73,5 +73,5 @@
   <property name="check_digit">True</property>
  </widget>
- <widget name="phone_nr" meta_type="String Widget">
+ <widget name="phone_nr" meta_type="Phone Widget">
   <property name="title">Phone Number</property>
   <property name="fields">
@@ -85,6 +85,4 @@
   </property>
   <property name="hidden_readonly_layout_modes"/>
-  <property name="display_width">15</property>
-  <property name="size_max">15</property>
  </widget>
  <widget name="repeat_password" meta_type="Password Widget">
Index: /WAeUP_SRP/trunk/profiles/uniben/layouts/student_personal_fe.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/uniben/layouts/student_personal_fe.xml	(revision 5504)
+++ /WAeUP_SRP/trunk/profiles/uniben/layouts/student_personal_fe.xml	(revision 5505)
@@ -230,5 +230,5 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="next_kin_phone" meta_type="String Widget">
+ <widget name="next_kin_phone" meta_type="Phone Widget">
   <property name="title">Next of Kin Phone</property>
   <property name="fields">
@@ -296,5 +296,5 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="phone" meta_type="String Widget">
+ <widget name="phone" meta_type="Phone Widget">
   <property name="title">Phone</property>
   <property name="fields">
@@ -423,5 +423,5 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="sponsor_phone" meta_type="String Widget">
+ <widget name="sponsor_phone" meta_type="Phone Widget">
   <property name="title">Sponsor Phone</property>
   <property name="fields">
