fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7562] Merge 7551:7561 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7562] Merge 7551:7561 from trunk
Date: Thu, 08 Sep 2011 06:29:00 +0000

Revision: 7562
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7562
Author:   sigurdne
Date:     2011-09-08 06:28:58 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Merge 7551:7561 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php
    branches/Version-1_0-branch/booking/templates/base/datatable.xsl
    branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
    branches/Version-1_0-branch/demo/inc/class.bodemo.inc.php
    branches/Version-1_0-branch/demo/inc/class.menu.inc.php
    branches/Version-1_0-branch/demo/inc/class.sodemo.inc.php
    branches/Version-1_0-branch/demo/inc/class.uidemo.inc.php
    branches/Version-1_0-branch/demo/templates/base/demo.xsl
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/js/yahoo/property.js
    branches/Version-1_0-branch/property/js/yahoo/request.index.js
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/request.xsl
    branches/Version-1_0-branch/rental/templates/base/composite_list_partial.php
    branches/Version-1_0-branch/rental/templates/base/config.tpl

Added Paths:
-----------
    branches/Version-1_0-branch/controller/
    branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control_group.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
    
branches/Version-1_0-branch/controller/inc/model/class.control_item_list.inc.php
    branches/Version-1_0-branch/demo/js/

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561

Modified: branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php 
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php 
2011-09-08 06:28:58 UTC (rev 7562)
@@ -278,7 +278,7 @@
                        } else {
                                if (phpgw::get_var('status') == 'none')
                                {
-                                       $filters['status'] = array('NEW', 
'PENDING','REJECTED', 'ACCEPTED');
+                                       $filters['status'] = array('NEW', 
'PENDING', 'REJECTED', 'ACCEPTED');
                                } 
                                else
                                {
@@ -311,6 +311,12 @@
 
                        foreach($applications['results'] as &$application)
                        {
+                               if (strstr($application['building_name'],"%")){
+                                       $search = array('%2C','%C3%85', 
'%C3%A5', '%C3%98', '%C3%B8', '%C3%86', '%C3%A6');
+                                       $replace = array 
(',','Å','å','Ø','ø','Æ','æ');
+                                       $application['building_name'] = 
str_replace($search, $replace, $application['building_name']);
+                               }
+
                                $application['status'] = 
lang($application['status']);
                                $application['created'] = 
pretty_timestamp($application['created']);
                                $application['modified'] = 
pretty_timestamp($application['modified']);

Modified: branches/Version-1_0-branch/booking/templates/base/datatable.xsl
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/datatable.xsl    
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/booking/templates/base/datatable.xsl    
2011-09-08 06:28:58 UTC (rev 7562)
@@ -115,7 +115,16 @@
                        <select name="{$name}" 
onMouseout="window.status='';return true;">
                         <xsl:for-each select="list">
                                <xsl:variable name="id"><xsl:value-of 
select="id"/></xsl:variable>
-                                   <option value="{$id}"><xsl:value-of 
select="name"/></option>
+                                                       <xsl:if test="id = 
'NEW'">
+                                       <option value="{$id}" 
selected="selected">
+                                                                       
<xsl:value-of select="name"/>
+                                                               </option>
+                                                       </xsl:if>
+                                                       <xsl:if test="id != 
'NEW'">
+                                       <option value="{$id}">
+                                                                       
<xsl:value-of select="name"/>
+                                                               </option>
+                                                       </xsl:if>
                         </xsl:for-each>
                        </select>
                     </td>

Modified: 
branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
===================================================================
--- trunk/controller/inc/model/class.check_item.inc.php 2011-09-05 06:29:33 UTC 
(rev 7552)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php   
2011-09-08 06:28:58 UTC (rev 7562)
@@ -4,14 +4,11 @@
        class controller_check_item extends controller_model
        {
                public static $so;
-               
+
                protected $id;
-               protected $title;
-               protected $required;
-               protected $what_to_desc;
-               protected $how_to_desc;
-               protected $control_group_id;
-               protected $control_type_id;
+               protected $control_item_id;
+               protected $status;
+               protected $check_list_id;
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -31,49 +28,28 @@
                
                public function get_id() { return $this->id; }
 
-               public function set_title($title)
+               public function set_control_item_id($control_item_id)
                {
-                       $this->title = $title;
+                       $this->control_item_id = $control_item_id;
                }
                
-               public function get_title() { return $this->title; }
-               
-               public function set_required($required)
+               public function get_control_item_id() { return 
$this->control_item_id; }
+                               
+               public function set_status($status)
                {
-                       $this->required = $required;
+                       $this->status = $status;
                }
                
-               public function get_required() { return $this->required; }
+               public function get_status() { return $this->status; }
                
-               public function set_what_to_desc($what_to_desc)
+               public function set_check_list_id($check_list_id)
                {
-                       $this->what_to_desc = $what_to_desc;
+                       $this->check_list_id = $check_list_id;
                }
                
-               public function get_what_to_desc() { return 
$this->what_to_desc; }
-               
-               public function set_how_to_desc($how_to_desc)
-               {
-                       $this->how_to_desc = $how_to_desc;
-               }
-               
-               public function get_how_to_desc() { return $this->how_to_desc; }
-               
-               public function set_control_group_id($control_group_id)
-               {
-                       $this->control_group_id = $control_group_id;
-               }
-               
-               public function get_control_group_id() { return 
$this->control_group_id; }
-               
-               public function set_control_type_id($control_type_id)
-               {
-                       $this->control_type_id = $control_type_id;
-               }
-               
-               public function get_control_type_id() { return 
$this->control_type_id; }
-               
+               public function get_check_list_id() { return 
$this->check_list_id; }
                        
+                       
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 

Copied: 
branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php (from 
rev 7561, trunk/controller/inc/model/class.check_list.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php   
                        (rev 0)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php   
2011-09-08 06:28:58 UTC (rev 7562)
@@ -0,0 +1,70 @@
+<?php
+       include_class('controller', 'model', 'inc/model/');
+       
+       class controller_check_item extends controller_model
+       {
+               public static $so;
+
+               protected $id;
+               protected $control_id;
+               protected $check_list_id;
+               protected $status;
+               protected $comment;
+               protected $deadline;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+
+               public function set_control_id($control_id)
+               {
+                       $this->control_id = $control_id;
+               }
+               
+               public function get_control_id() { return $this->control_id; }
+               
+               public function set_check_list_id($check_list_id)
+               {
+                       $this->check_list_id = $check_list_id;
+               }
+               
+               public function get_check_list_id() { return 
$this->check_list_id; }
+               
+               public function set_status($status)
+               {
+                       $this->status = $status;
+               }
+               
+               public function get_status() { return $this->status; }
+               
+               public function set_comment($comment)
+               {
+                       $this->comment = $comment;
+               }
+               
+               public function get_comment() { return $this->comment; }
+               
+               public function set_deadline($deadline)
+               {
+                       $this->deadline = $deadline;
+               }
+               
+               public function get_deadline() { return $this->deadline; }
+               
+               
+       }
+?>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/inc/model/class.control_group.inc.php 
(from rev 7561, trunk/controller/inc/model/class.control_group.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/model/class.control_group.inc.php    
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/inc/model/class.control_group.inc.php    
    2011-09-08 06:28:58 UTC (rev 7562)
@@ -0,0 +1,50 @@
+<?php
+       include_class('controller', 'model', 'inc/model/');
+       
+       class controller_check_item extends controller_model
+       {
+               public static $so;
+
+               protected $id;
+               protected $group_name;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+
+               public function set_control_group($control_group)
+               {
+                       $this->control_group = $control_group;
+               }
+               
+               public function get_control_group(){ return 
$this->control_group; }
+                       
+               /**
+                * Get a static reference to the storage object associated with 
this model object
+                * 
+                * @return the storage object
+                */
+               public static function get_so()
+               {
+                       if (self::$so == null) {
+                               self::$so = 
CreateObject('controller_check_item');
+                       }
+                       
+                       return self::$so;
+               }
+       }
+?>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php 
(from rev 7561, trunk/controller/inc/model/class.control_item.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php 
                        (rev 0)
+++ branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php 
2011-09-08 06:28:58 UTC (rev 7562)
@@ -0,0 +1,91 @@
+<?php
+       include_class('controller', 'model', 'inc/model/');
+       
+       class controller_control_item extends controller_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $title;
+               protected $required;
+               protected $what_to_desc;
+               protected $how_to_desc;
+               protected $control_group_id;
+               protected $control_type_id;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+
+               public function set_title($title)
+               {
+                       $this->title = $title;
+               }
+               
+               public function get_title() { return $this->title; }
+               
+               public function set_required($required)
+               {
+                       $this->required = $required;
+               }
+               
+               public function get_required() { return $this->required; }
+               
+               public function set_what_to_desc($what_to_desc)
+               {
+                       $this->what_to_desc = $what_to_desc;
+               }
+               
+               public function get_what_to_desc() { return 
$this->what_to_desc; }
+               
+               public function set_how_to_desc($how_to_desc)
+               {
+                       $this->how_to_desc = $how_to_desc;
+               }
+               
+               public function get_how_to_desc() { return $this->how_to_desc; }
+               
+               public function set_control_group_id($control_group_id)
+               {
+                       $this->control_group_id = $control_group_id;
+               }
+               
+               public function get_control_group_id() { return 
$this->control_group_id; }
+               
+               public function set_control_type_id($control_type_id)
+               {
+                       $this->control_type_id = $control_type_id;
+               }
+               
+               public function get_control_type_id() { return 
$this->control_type_id; }
+               
+                       
+               /**
+                * Get a static reference to the storage object associated with 
this model object
+                * 
+                * @return the storage object
+                */
+               public static function get_so()
+               {
+                       if (self::$so == null) {
+                               self::$so = 
CreateObject('controller.sopurpose');
+                       }
+                       
+                       return self::$so;
+               }
+       }
+?>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/inc/model/class.control_item_list.inc.php
 (from rev 7561, trunk/controller/inc/model/class.control_item_list.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/model/class.control_item_list.inc.php
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/inc/model/class.control_item_list.inc.php
    2011-09-08 06:28:58 UTC (rev 7562)
@@ -0,0 +1,58 @@
+<?php
+       include_class('controller', 'model', 'inc/model/');
+       
+       class controller_control_item extends controller_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $control_id;
+               protected $control_item_id;
+                               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+
+               public function set_control_id($control_id)
+               {
+                       $this->control_id = $control_id;
+               }
+               
+               public function get_control_id() { return $this->control_id; }
+               
+               public function set_control_item_id($control_item_id)
+               {
+                       $this->control_item_id = $control_item_id;
+               }
+               
+               public function get_control_item_id() { return 
$this->control_item_id; }
+                               
+               /**
+                * Get a static reference to the storage object associated with 
this model object
+                * 
+                * @return the storage object
+                */
+               public static function get_so()
+               {
+                       if (self::$so == null) {
+                               self::$so = 
CreateObject('controller.sopurpose');
+                       }
+                       
+                       return self::$so;
+               }
+       }
+?>
\ No newline at end of file

Modified: branches/Version-1_0-branch/demo/inc/class.bodemo.inc.php
===================================================================
--- branches/Version-1_0-branch/demo/inc/class.bodemo.inc.php   2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/demo/inc/class.bodemo.inc.php   2011-09-08 
06:28:58 UTC (rev 7562)
@@ -122,9 +122,8 @@
                *
                * @return array Array with records.
                */
-               public function read2()
+               public function read2($dry_run = false)
                {
-                       $custom_attributes = 
$this->custom->find($this->currentapp, $this->acl_location, 0, '', 'ASC', 
'attrib_sort', true, true);
                        $lookup = array
                        (
                                'start'         => $this->start,
@@ -134,13 +133,13 @@
                                'cat_id'        => $this->cat_id,
                                'allrows'       => $this->allrows,
                                'filter'        => $this->filter,
-                               'custom_attributes' => $custom_attributes
+                               'dry_run'       => $dry_run
                        );
 
-                       $demo_info = $this->so->read2($lookup);
+                       $values = $this->so->read2($lookup);
                        $this->total_records = $this->so->total_records;
                        $this->uicols   = $this->so->uicols;
-                       return $demo_info;
+                       return $values;
                }
 
                public function read_single($id = 0)

Modified: branches/Version-1_0-branch/demo/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/demo/inc/class.menu.inc.php     2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/demo/inc/class.menu.inc.php     2011-09-08 
06:28:58 UTC (rev 7562)
@@ -125,8 +125,8 @@
                                ),
                                'alternative'   => array
                                (
-                                       'text'  => lang('Alternative'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'demo.uidemo.index2', 'output' => 'html'))
+                                       'text'  => 'YAHOO-table',
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'demo.uidemo.index2'))
                                )
                        );
                        return $menus;

Modified: branches/Version-1_0-branch/demo/inc/class.sodemo.inc.php
===================================================================
--- branches/Version-1_0-branch/demo/inc/class.sodemo.inc.php   2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/demo/inc/class.sodemo.inc.php   2011-09-08 
06:28:58 UTC (rev 7562)
@@ -49,14 +49,16 @@
 
                function demo_sodemo($acl_location)
                {
-                       $this->account                  =& 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->db                               = 
clone($GLOBALS['phpgw']->db);
+                       $this->account                  = & 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->db                               = & 
$GLOBALS['phpgw']->db;
 
-                       $this->like                     =& $this->db->like;
-                       $this->join                     =& $this->db->join;
-                       $this->left_join                =& $this->db->left_join;
+                       $this->like                     = & $this->db->like;
+                       $this->join                     = & $this->db->join;
+                       $this->left_join                = & 
$this->db->left_join;
                        $this->acl_location     = $acl_location;
 
+                       $this->custom   = 
createObject('property.custom_fields');
+
                        $this->grants                   = 
$GLOBALS['phpgw']->acl->get_grants('demo', $this->acl_location);
                }
 
@@ -157,24 +159,25 @@
 
                function read2($data)
                {
-                       $db2 = clone($this->db);
+//_debug_array($data);
+                       $start          = isset($data['start']) && 
$data['start'] ? (int)$data['start'] : 0;
+                       $query          = isset($data['query']) ? 
$data['query'] : '';
+                       $query          = isset($data['query']) ? 
$data['query'] : '';
+                       $sort           = isset($data['sort']) ? $data['sort'] 
: 'DESC';
+                       $order          = isset($data['order']) ? 
$data['order'] : '';
+                       $allrows        = isset($data['allrows']) ? 
$data['allrows'] : '';
+                       $cat_id         = isset($data['cat_id']) && 
$data['cat_id'] ? (int)$data['cat_id'] : 0;
+                       $filter         = isset($data['filter']) ? 
$data['filter'] : '';
+                       $dry_run        = isset($data['dry_run']) ? 
$data['dry_run'] : '';
 
-                       if(is_array($data))
-                       {
-                               $start          = isset($data['start']) && 
$data['start'] ? $data['start'] : 0;
-                               $query          = isset($data['query']) ? 
$data['query'] : '';
-                               $query          = isset($data['query']) ? 
$data['query'] : '';
-                               $sort           = isset($data['sort']) ? 
$data['sort'] : 'DESC';
-                               $order          = isset($data['order']) ? 
$data['order'] : '';
-                               $allrows        = isset($data['allrows']) ? 
$data['allrows'] : '';
-                               $cat_id         = isset($data['cat_id']) && 
$data['cat_id'] ? $data['cat_id'] : 0;
-                               $filter         = isset($data['filter']) ? 
$data['filter'] : '';
-                               $custom_attributes      = 
(isset($data['custom_attributes'])?$data['custom_attributes']:'');
-                       }
+//                     $custom_attributes = $this->custom->find('demo', 
$this->acl_location, 0, '', 'ASC', 'attrib_sort', true, true);
 
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
-
                        $table = 'phpgw_demo_table';
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
+                       $location_id = 
$GLOBALS['phpgw']->locations->get_id('demo', $this->acl_location);
+                       $attribute_filter = " location_id = {$location_id}";
+
                        $where= 'WHERE';
                        $filtermethod = '';
 
@@ -230,6 +233,13 @@
                        $uicols['statustext'][]         = 'Demo ID';
                        $uicols['datatype'][]           = 'I';
 
+                       $cols_return[]                          = 'name';
+                       $uicols['input_type'][]         = 'text';
+                       $uicols['name'][]                       = 'name';
+                       $uicols['descr'][]                      = 'Name';
+                       $uicols['statustext'][]         = 'Name';
+                       $uicols['datatype'][]           = 'V';
+
                        $cols_return[]                          = 'entry_date';
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'entry_date';
@@ -255,36 +265,55 @@
                                                                );
 
 
-                       $i      = count($uicols['name']);
-                       if(isset($custom_attributes) && 
is_array($custom_attributes))
-                       {
-                               foreach($custom_attributes as $column_info)
+                               $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences']['demo']['columns'])?$GLOBALS['phpgw_info']['user']['preferences']['demo']['columns']:array();
+                               
+                               $_user_columns = array();
+                               foreach ($user_columns as $user_column_id)
                                {
-                                       if($column_info['list'])
+                                       if(ctype_digit($user_column_id))
                                        {
-                                               if($column_info['datatype'] == 
'link')
-                                               {
-                                                       $uicols['input_type'][] 
        = 'link';
-                                               }
-                                               else
-                                               {
-                                                       $uicols['input_type'][] 
        = 'text';
-                                               }
-                                               $cols_return[]                  
        = $column_info['column_name'];
-                                               $uicols['name'][]               
        = $column_info['column_name'];
-                                               $uicols['descr'][]              
        = $column_info['input_text'];
-                                               $uicols['statustext'][]         
= $column_info['statustext'];
-                                               $uicols['datatype'][$i]         
= $column_info['datatype'];
-                                               $cols_return_extra[]= array(
-                                                       'name'  => 
$column_info['column_name'],
-                                                       'datatype'      => 
$column_info['datatype'],
-                                                       'attrib_id'     => 
$column_info['id']
-                                               );
-                                               $i++;
+                                               $_user_columns[] = 
$user_column_id;
                                        }
                                }
-                       }
+                               $user_column_filter = '';
+                               if (isset($user_columns) AND 
is_array($user_columns) AND $user_columns[0])
+                               {
+                                       $user_column_filter = " OR 
($attribute_filter AND id IN (" . implode(',',$_user_columns) .'))';
+                               }
 
+                               $this->db->query("SELECT * FROM 
$attribute_table WHERE list=1 AND $attribute_filter $user_column_filter ORDER 
BY group_id, attrib_sort ASC");
+
+                               $i      = count($uicols['name']);
+                               while ($this->db->next_record())
+                               {
+                                       $uicols['input_type'][]         = 
'text';
+                                       $uicols['name'][]                       
= $this->db->f('column_name');
+                                       $uicols['descr'][]                      
= $this->db->f('input_text');
+                                       $uicols['statustext'][]         = 
$this->db->f('statustext');
+                                       $uicols['datatype'][$i]         = 
$this->db->f('datatype');
+                                       $uicols['sortable'][$i]         = true;
+                                       $uicols['exchange'][$i]         = false;
+                                       $uicols['formatter'][$i]        = '';
+                                       $uicols['classname'][$i]        = '';
+
+                                       $uicols['cols_return_extra'][$i] = array
+                                               (
+                                                       'name'  => 
$this->db->f('column_name'),
+                                                       'datatype'      => 
$this->db->f('datatype'),
+                                                       'attrib_id'     => 
$this->db->f('id')                                   
+                                               );
+
+
+                                       $cols_return_extra[]= array(
+                                               'name'  => 
$this->db->f('column_name'),
+                                               'datatype'      => 
$this->db->f('datatype'),
+                                               'attrib_id'     => 
$this->db->f('id')
+                                       );
+
+                                       $i++;
+                               }
+
+
                        $this->uicols   = $uicols;
 
                        $sql = "SELECT COUNT(phpgw_demo_table.id) as cnt FROM 
$table $filtermethod $querymethod";
@@ -292,6 +321,11 @@
                        $this->db->next_record();
                        $this->total_records = $this->db->f('cnt');
 
+                       if($dry_run)
+                       {
+                               return array();
+                       }
+
                        $sql = "SELECT * FROM $table $filtermethod $querymethod 
$ordermethod";
                        if ( $allrows )
                        {
@@ -302,84 +336,28 @@
                                $this->db->limit_query($sql, $start, __LINE__, 
__FILE__);
                        }
 
-                       $demo_info = '';
+                       $values = array();
+                       $cols_return = $uicols['name'];
 
-                       $j=0;
-                       $n=count($cols_return);
-
+                       $dataset = array();
+                       $row = 0;
                        while ($this->db->next_record())
                        {
-                               for ($i=0;$i<$n;$i++)
+                               foreach($cols_return as $key => $field)
                                {
-                                       $demo_info[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
-                                       $demo_info[$j]['grants'] = 
(int)$this->grants[$this->db->f('user_id')];
+                                       $dataset[$row][$field] = array
+                                       (
+                                               'value'         => 
$this->db->f($field),
+                                               'datatype'      => 
$uicols['datatype'][$key],
+                                               'attrib_id'     => 
$uicols['cols_return_extra'][$key]['attrib_id']
+                                       );
                                }
+                               $row ++;
+                       }
 
-                               for ($i=0;$i<count($cols_return_extra);$i++)
-                               {
-                                       $value='';
-                                       
$value=$this->db->f($cols_return_extra[$i]['name']);
+                       $values = $this->custom->translate_value($dataset, 
$location_id);
 
-                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
-                                       {
-                                               $sql="SELECT value FROM 
phpgw_cust_choice WHERE appname= 'demo' AND location= '{$this->acl_location}' 
AND attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
-                                               $db2->query($sql);
-                                               $db2->next_record();
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']] = $db2->f('value');
-                                       }
-                                       else 
if($cols_return_extra[$i]['datatype']=='AB' && $value)
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']]  = $contact_data[0]['n_family'] 
. ', ' . $contact_data[0]['n_given'];
-                                       }
-                                       else 
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
-                                       {
-                                               $sql="SELECT org_name FROM 
fm_vendor where id=$value";
-                                               $db2->query($sql);
-                                               $db2->next_record();
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']] = $db2->f('org_name', true);
-                                       }
-                                       else 
if($cols_return_extra[$i]['datatype']=='CH' && $value)
-                                       {
-                                               $ch= unserialize($value);
-
-                                               if (isset($ch) AND 
is_array($ch))
-                                               {
-                                                       for 
($k=0;$k<count($ch);$k++)
-                                                       {
-                                                               $sql="SELECT 
value FROM phpgw_cust_choice WHERE appname= '{'demo'}' AND location= 
'{$this->acl_location}' AND attrib_id=" .$cols_return_extra[$i]['attrib_id']. " 
 AND id=" . $ch[$k];
-                                                               
$db2->query($sql);
-                                                               while 
($db2->next_record())
-                                                               {
-                                                                       
$ch_value[] = $db2->f('value');
-                                                               }
-                                                       }
-                                                       
$demo_info[$j][$cols_return_extra[$i]['name']] = @implode(",", $ch_value);
-                                                       unset($ch_value);
-                                               }
-                                       }
-                                       else 
if($cols_return_extra[$i]['datatype']=='D' && $value)
-                                       {
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
-                                       }
-                                       else 
if($cols_return_extra[$i]['datatype']=='timestamp' && $value)
-                                       {
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$value);
-                                       }
-                                       else 
if($cols_return_extra[$i]['datatype']=='user_id' && $value)
-                                       {
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']]= 
$GLOBALS['phpgw']->accounts->get($value)->__toString();
-                                       }
-                                       else
-                                       {
-                                               
$demo_info[$j][$cols_return_extra[$i]['name']]=$value;
-                                       }
-                               }
-
-                               $j++;
-                       }
-//_debug_array($demo_info);
-                       return $demo_info;
+                       return $values;
                }
 
                /**

Modified: branches/Version-1_0-branch/demo/inc/class.uidemo.inc.php
===================================================================
--- branches/Version-1_0-branch/demo/inc/class.uidemo.inc.php   2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/demo/inc/class.uidemo.inc.php   2011-09-08 
06:28:58 UTC (rev 7562)
@@ -26,6 +26,7 @@
           along with this program.  If not, see <http://www.gnu.org/licenses/>.
         */
 
+       phpgw::import_class('phpgwapi.yui');
        /**
         * Description
         * @package demo
@@ -153,6 +154,7 @@
                        $this->cat_id                   = $this->bo->cat_id;
                        $this->filter                   = $this->bo->filter;
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'demo';
+                       $this->bocommon         = 
CreateObject('property.bocommon');
                }
 
                private function save_sessiondata()
@@ -326,171 +328,333 @@
                                $this->no_access();
                                return;
                        }
+                       if(!$this->acl_read)
+                       {
+                               $this->bocommon->no_access();
+                               return;
+                       }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('demo','nextmatchs',
-                                                                               
'search_field'));
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data', "demo_receipt");
+                       $this->save_sessiondata();
 
-                       $demo_info = $this->bo->read2();
+                       $datatable = array();
 
-                       $uicols = $this->bo->uicols;
-//_debug_array($uicols);
-                       $j=0;
+                       $dry_run = false;
 
-                       if (isset($demo_info) && is_array($demo_info))
+                       if( phpgw::get_var('phpgw_return_as') != 'json' )
                        {
-                               foreach($demo_info as $entry)
-                               {
-                                       for 
($i=0;$i<count($uicols['name']);$i++)
-                                       {
-                                               
if($uicols['input_type'][$i]!='hidden')
-                                               {
-                                                       
$content[$j]['row'][$i]['value']                = $entry[$uicols['name'][$i]];
-                                                       
$content[$j]['row'][$i]['name']                 = $uicols['name'][$i];
-                                                       
if($uicols['input_type'][$i]=='link')
-                                                       {
-                                                               
$content[$j]['row'][$i]['text']         = lang('link');
-                                                               
$content[$j]['row'][$i]['link']         = $entry[$uicols['name'][$i]];
-                                                               
$content[$j]['row'][$i]['target']       = '_blank';
-                                                       }
-                                               }
-                                       }
+                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
+                               (
+                                       'menuaction'    => 'demo.uidemo.index2'
+                               ));
 
-                                       if($this->acl_read)
-                                       {
-                                               
$content[$j]['row'][$i]['statustext']                   = lang('view the 
record');
-                                               $content[$j]['row'][$i]['text'] 
                                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'demo.uidemo.view','demo_id'=> $entry['id']));
-                                       }
-                                       if($this->acl_edit)
-                                       {
-                                               
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
record');
-                                               $content[$j]['row'][$i]['text'] 
                                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'demo.uidemo.edit', 
'demo_id'=> $entry['id']));
-                                       }
-                                       if($this->acl_delete)
-                                       {
-                                               
$content[$j]['row'][$i]['statustext']                   = lang('delete the 
record');
-                                               $content[$j]['row'][$i]['text'] 
                                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'demo.uidemo.delete', 'demo_id'=> $entry['id']));
-                                       }
+                               $datatable['config']['base_java_url'] = 
"menuaction:'demo.uidemo.index2'";
 
-                                       $j++;
-                               }
+                               $link_data = array
+                               (
+                                       'menuaction'    => 'demo.uidemo.index2'
+                               );
+
+
+                               $datatable['config']['allow_allrows'] = true;
+
+                               $values_combo_box = array();
+                               $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$this->cat_id,'globals' => true,'use_acl' => $this->_category_acl));
+                               $default_value = array ('cat_id'=>'','name'=> 
lang('no category'));
+                               array_unshift 
($values_combo_box[0]['cat_list'],$default_value);
+
+                               $datatable['actions']['form'] = array
+                                       (
+                                               array
+                                               (
+                                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
+                                                       array
+                                                       (
+                                                               'menuaction'    
=> 'demo.uidemo.index2'
+                                                       )
+                                               ),
+                                               'fields'        => array
+                                               (
+                                                       'field' => array
+                                                       (
+                                                               array
+                                                               ( //boton       
CATEGORY
+                                                                       'id' => 
'btn_cat_id',
+                                                                       'name' 
=> 'cat_id',
+                                                                       'value' 
=> lang('Category'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 1
+                                                               ),
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'button',
+                                                                       'id'    
=> 'btn_export',
+                                                                       'value' 
=> lang('download'),
+                                                                       
'tab_index' => 10
+                                                               ),
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'button',
+                                                                       'id'    
=> 'btn_done',
+                                                                       'value' 
=> lang('done'),
+                                                                       
'tab_index' => 9
+                                                               ),
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'button',
+                                                                       'id'    
=> 'btn_new',
+                                                                       'value' 
=> lang('add'),
+                                                                       
'tab_index' => 8
+                                                               ),
+                                                               array
+                                                               ( //button     
SEARCH
+                                                                       'id' => 
'btn_search',
+                                                                       'name' 
=> 'search',
+                                                                       'value' 
   => lang('search'),
+                                                                       'type' 
=> 'button',
+                                                                       
'tab_index' => 7
+                                                               ),
+                                                               array
+                                                               ( // TEXT INPUT
+                                                                       'name'  
   => 'query',
+                                                                       'id'    
 => 'txt_query',
+                                                                       'value' 
   => $this->query,
+                                                                       'type' 
=> 'text',
+                                                                       
'onkeypress' => 'return pulsar(event)',
+                                                                       'size'  
  => 28,
+                                                                       
'tab_index' => 6
+                                                               )
+                                                       ),
+                                                       'hidden_value' => array
+                                                       (
+                                                               array
+                                                               ( //div values  
combo_box_0
+                                                                       'id' => 
'values_combo_box_0',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[0]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
+                                                               )
+                                                       )
+                                               )
+                                       )
+                               );
+
+//                             $dry_run = false;
                        }
 
-                       for ($i=0;$i<count($uicols['descr']);$i++)
+                       $values = $this->bo->read2($dry_run);
+
+                       $uicols = $this->bo->uicols;
+
+                       $j = 0;
+                       $count_uicols_name = count($uicols['name']);
+
+                       foreach($values as $entry)
                        {
-                               if($uicols['input_type'][$i]!='hidden')
+                               for ($k=0;$k<$count_uicols_name;$k++)
                                {
-                                       $table_header[$i]['header']     = 
$uicols['descr'][$i];
-                                       $table_header[$i]['width']              
= '5%';
-                                       $table_header[$i]['align']              
= 'center';
-                                       if($uicols['datatype'][$i]!='T' && 
$uicols['datatype'][$i]!='CH')
+                                       if($uicols['input_type'][$k]!='hidden')
                                        {
-                                               $table_header[$i]['sort_link']  
=true;
-                                               $table_header[$i]['sort']       
        = $this->nextmatches->show_sort_order(array
-                                               (
-                                                       'sort'  => $this->sort,
-                                                       'var'   => 
$uicols['name'][$i],
-                                                       'order' => $this->order,
-                                                       'extra' => array
-                                                       (
-                                                                'menuaction'   
=> 'demo.uidemo.index2',
-                                                                'query'        
                => $this->query,
-                                                                'cat_id'       
        => $this->cat_id,
-                                                                'filter'       
        => $this->filter,
-                                                                'output'       
        => $output,
-                                                                'allrows'      
        => $this->allrows
-                                                       )
-                                               ));
+                                               
$datatable['rows']['row'][$j]['column'][$k]['name']             = 
$uicols['name'][$k];
+                                               
$datatable['rows']['row'][$j]['column'][$k]['value']            = 
$entry[$uicols['name'][$k]];
+                                               
$datatable['rows']['row'][$j]['column'][$k]['format']           = 
$uicols['datatype'][$k];
                                        }
                                }
+                               $j++;
                        }
 
-                       if($this->acl_read)
-                       {
-                               $table_header[$i]['width']                      
= '5%';
-                               $table_header[$i]['align']                      
= 'center';
-                               $table_header[$i]['header']                     
= lang('view');
-                               $i++;
-                       }
+                       $datatable['rowactions']['action'] = array();
+
+                       $parameters = array
+                               (
+                                       'parameter' => array
+                                       (
+                                               array
+                                               (
+                                                       'name'          => 
'demo_id',
+                                                       'source'        =>  'id'
+                                               ),
+                                       )
+                               );
+
                        if($this->acl_edit)
                        {
-                               $table_header[$i]['width']                      
= '5%';
-                               $table_header[$i]['align']                      
= 'center';
-                               $table_header[$i]['header']                     
= lang('edit');
-                               $i++;
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'               => 
'edit',
+                                               'statustext'    => lang('edit 
the entry'),
+                                               'text'                  => 
lang('edit'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'            
=> 'demo.uidemo.edit'
+                                               )),
+                                               'parameters'    => $parameters
+                                       );
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'               => 
'edit',
+                                               'text'                  => 
lang('open edit in new window'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'            
=> 'demo.uidemo.edit',
+                                                       'target'                
        => '_blank'
+                                               )),
+                                               'parameters'    => $parameters
+                                       );
                        }
+
                        if($this->acl_delete)
                        {
-                               $table_header[$i]['width']                      
= '5%';
-                               $table_header[$i]['align']                      
= 'center';
-                               $table_header[$i]['header']                     
= lang('delete');
-                               $i++;
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'               => 
'delete',
+                                               'statustext'    => lang('delete 
the entry'),
+                                               'text'                  => 
lang('delete'),
+                                               'confirm_msg'   => lang('do you 
really want to delete this entry'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'demo.uidemo.delete'
+                                               )),
+                                               'parameters'    => $parameters
+                                       );
                        }
+                       unset($parameters);
 
-
                        if($this->acl_add)
                        {
-                               $table_add[] = array
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'                       
=> 'add',
+                                               'statustext'    => lang('add'),
+                                               'text'                  => 
lang('add'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'demo.uidemo.edit',
+                                                       'type'                  
=> $this->type,
+                                                       'type_id'               
=> $this->type_id
+                                               ))
+                                       );
+                       }
+
+                       for ($i=0;$i<$count_uicols_name;$i++)
+                       {
+                               if($uicols['input_type'][$i]!='hidden')
+                               {
+                                       
$datatable['headers']['header'][$i]['formatter']                = 
($uicols['formatter'][$i]==''?  '""' : $uicols['formatter'][$i]);
+                                       
$datatable['headers']['header'][$i]['name']                     = 
$uicols['name'][$i];
+                                       
$datatable['headers']['header'][$i]['text']                     = 
$uicols['descr'][$i];
+                                       
$datatable['headers']['header'][$i]['visible']                  = true;
+                                       
$datatable['headers']['header'][$i]['sortable']                 = 
$uicols['sortable'][$i];
+                                       
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
+                               }
+                       }
+
+                       //path for property.js
+                       $datatable['property_js'] = 
$GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property.js";
+
+                       // Pagination and sort values
+                       $datatable['pagination']['records_start']       = 
(int)$this->bo->start;
+                       $datatable['pagination']['records_limit']       = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       $datatable['pagination']['records_returned']= 
count($values);
+                       $datatable['pagination']['records_total']       = 
$this->bo->total_records;
+
+                       $appname                        =  
$this->location_info['name'];
+                       $function_msg           = lang('list %1', $appname);
+
+                       if ( ($this->start == 0) && (!$this->order))
+                       {
+                               $datatable['sorting']['order']                  
=  $this->location_info['id']['name']; // name key Column in myColumnDef
+                               $datatable['sorting']['sort']                   
= 'asc'; // ASC / DESC
+                       }
+                       else
+                       {
+                               $datatable['sorting']['order']                  
= $this->order; // name of column of Database
+                               $datatable['sorting']['sort']                   
= $this->sort; // ASC / DESC
+                       }
+
+                       //-- BEGIN----------------------------- JSON CODE 
------------------------------
+                       //values for Pagination
+                       $json = array
                                (
-                                       'lang_add'                              
=> lang('add'),
-                                       'lang_add_statustext'   => lang('add a 
demo'),
-                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'demo.uidemo.edit','output'=>$output)),
+                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'            => 
$datatable['pagination']['records_start'],
+                                       'sort'                          => 
$datatable['sorting']['order'],
+                                       'dir'                           => 
$datatable['sorting']['sort'],
+                                       'records'                       => 
array()
                                );
+
+                       // values for datatable
+                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
+                       {
+                               foreach( $datatable['rows']['row'] as $row )
+                               {
+                                       $json_row = array();
+                                       foreach( $row['column'] as $column)
+                                       {
+                                               if(isset($column['format']) && 
$column['format']== 'link' && $column['java_link']==true)
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='#' id='{$column['link']}' 
onclick='javascript:filter_data(this.id);'>{$column['value']}</a>";
+                                               }
+                                               else 
if(isset($column['format']) && $column['format']== 'link')
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='{$column['value']}' target='_blank'>" 
.lang('link') . '</a>';
+                                               }
+                                               else 
if(isset($column['format']) && $column['format']== 'text')
+                                               {
+                                                       
$json_row[$column['name']] = nl2br($column['value']);
+                                               }
+                                               else
+                                               {
+                                                       
$json_row[$column['name']] = $column['value'];
+                                               }
+                                       }
+                                       $json['records'][] = $json_row;
+                               }
                        }
 
-                       if(!$this->allrows)
+                       // right in datatable
+                       if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
                        {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                               $json['rights'] = 
$datatable['rowactions']['action'];
                        }
-                       else
+
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
                        {
-                               $record_limit   = $this->bo->total_records;
+                               return $json;
                        }
 
-                       $link_data = array
-                       (
-                               'menuaction'    => 'demo.uidemo.index2',
-                               'sort'                  => $this->sort,
-                               'order'                 => $this->order,
-                               'cat_id'                => $this->cat_id,
-                               'filter'                => $this->filter,
-                               'query'                 => $this->query,
-                               'output'                => $output
-                       );
+                       phpgwapi_yui::load_widget('dragdrop');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('tabview');
+                       phpgwapi_yui::load_widget('paginator');
+                       phpgwapi_yui::load_widget('animation');
 
-                       $msgbox_data = 
(isset($receipt)?$GLOBALS['phpgw']->common->msgbox_data($receipt):'');
+                       $datatable['json_data'] = json_encode($json);
+                       //-------------------- JSON CODE ----------------------
 
-                       $data = array
-                       (
-                               'msgbox_data'                                   
                => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'cat_filter'                                    
                => $this->cats->formatted_xslt_list(array('select_name' => 
'cat_id','selected' => $this->cat_id,'globals' => true,'link_data' => 
$link_data)),
-                               'filter_data'                                   
                => $this->nextmatches->xslt_filter(array('filter' => 
$this->filter,'link_data' => $link_data)),
-                               'allow_allrows'                                 
                => true,
-                               'allrows'                                       
                        => $this->allrows,
-                               'start_record'                                  
                => $this->start,
-                               'record_limit'                                  
                => $record_limit,
-                               'num_records'                                   
                => ($demo_info?count($demo_info):0),
-                               'all_records'                                   
                => $this->bo->total_records,
-                               'link_url'                                      
                        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                                      
                        => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               'lang_searchfield_statustext'                   
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
-                               'lang_searchbutton_statustext'                  
=> lang('Submit the search string'),
-                               'query'                                         
                        => $this->query,
-                               'lang_search'                                   
                => lang('search'),
-                               'table_header'                                  
                => $table_header,
-                               'table_add'                                     
                        => $table_add,
-                               'values'                                        
                        => (isset($content)?$content:'')
-                       );
+                       $template_vars = array();
+                       $template_vars['datatable'] = $datatable;
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
 
-//_debug_array($data);
-                       $function_msg= lang('list demo values');
+                       if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
+                       {
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                       }
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('demo'). ": {$function_msg}";
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
 
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array("list2_{$output}" => $data));
-                       $this->save_sessiondata();
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw']->translation->translate($this->location_info['acl_app'], 
array(), false, $this->location_info['acl_app']) . 
"::{$appname}::{$function_msg}";
+
+                       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'demo.index', 'demo' );
                }
 
 
@@ -625,6 +789,28 @@
                                'output'                => $output
                        );
 
+                       $generic_list_1 = array();
+                       for ($i=1;$i<9;$i++)
+                       {
+                               $generic_list_1[] = array
+                               (
+                                       'id'    => $i,
+                                       'name'  => "Element A {$i}"
+                               );
+                       }
+                       $generic_list_1[2]['selected'] = 1;
+
+                       $generic_list_2 = array();
+                       for ($i=1;$i<4;$i++)
+                       {
+                               $generic_list_2[] = array
+                               (
+                                       'id'    => $i,
+                                       'name'  => "Element B {$i}"
+                               );
+                       }
+
+                       
                        $msgbox_data = 
(isset($receipt)?$GLOBALS['phpgw']->common->msgbox_data($receipt):'');
 
                        $data = array
@@ -636,35 +822,20 @@
                                'value_town'                                    
=> (isset($values['town'])?$values['town']:''),
                                'value_remark'                                  
=> (isset($values['remark'])?$values['remark']:''),
 
-                               'lang_entry_date'                               
=> lang('Entry date'),
-                               'lang_name'                                     
        => lang('name'),
-                               'lang_address'                                  
=> lang('address'),
-                               'lang_zip'                                      
        => lang('zip'),
-                               'lang_town'                                     
        => lang('town'),
-                               'lang_remark'                                   
=> lang('remark'),
-
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_id'                                       
        => lang('training ID'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_cancel'                                   
=> lang('cancel'),
                                'value_id'                                      
        => $demo_id,
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
-                               'lang_apply'                                    
=> lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
 
-                               'lang_category'                                 
=> lang('category'),
-                               'lang_no_cat'                                   
=> lang('no category'),
                                'cat_select'                                    
=> $this->cats->formatted_xslt_list(array('select_name' => 
'values[cat_id]','selected' => 
(isset($values['cat_id'])?$values['cat_id']:''))),
                                'attributes_values'                             
=> $values['attributes'],
-
-                               'lang_access'                                   
=> lang('private'),
-                               'value_access'                                  
=> (isset($values['access'])?$values['access']:''),
-                               'lang_access_off_statustext'    => lang('The 
note is public. If the note should be private, check this box'),
-                               'lang_access_on_statustext'             => 
lang('The note is private. If the note should be public, uncheck this box')
+                               'value_access'                                  
=> isset($values['access'])?$values['access']:'',
+                               'generic_list_1'                                
=> array('options' => $generic_list_1),
+                               'generic_list_2'                                
=> array('options' => $generic_list_2),
                        );
 
+                       $GLOBALS['phpgw']->richtext->replace_element('remark');
+                       $GLOBALS['phpgw']->richtext->generate_script();
+
                        $appname                = lang('demo');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('demo') . " - {$appname}: {$function_msg}";

Modified: branches/Version-1_0-branch/demo/templates/base/demo.xsl
===================================================================
--- branches/Version-1_0-branch/demo/templates/base/demo.xsl    2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/demo/templates/base/demo.xsl    2011-09-08 
06:28:58 UTC (rev 7562)
@@ -284,11 +284,11 @@
 
 
 <!-- add / edit  -->
-       <xsl:template match="edit">
+       <xsl:template match="edit" xmlns:php="http://php.net/xsl";>
                <div align="left">
                <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                <form method="post" action="{$form_action}">
-               <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
+               <table cellpadding="2" cellspacing="2" width="90%" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
                                        <tr>
@@ -301,8 +301,8 @@
                        <xsl:choose>
                                <xsl:when test="value_id != ''">
                                <tr>
-                               <td valign="top" width="30%">
-                                               <xsl:value-of select="lang_id"/>
+                               <td valign="top" width="40%">
+                                               <xsl:value-of 
select="php:function('lang', 'id')" />
                                        </td>
                                        <td align="left">
                                                <xsl:value-of 
select="value_id"/>
@@ -310,7 +310,7 @@
                                </tr>
                                <tr>
                                        <td valign="top">
-                                               <xsl:value-of 
select="lang_entry_date"/>
+                                               <xsl:value-of 
select="php:function('lang', 'entry_date')" />
                                        </td>
                                        <td>
                                                <xsl:value-of 
select="value_entry_date"/>
@@ -320,7 +320,7 @@
                        </xsl:choose>   
                        <tr>
                                <td>
-                                       <xsl:value-of select="lang_category"/>
+                                       <xsl:value-of 
select="php:function('lang', 'category')" />
                                </td>
                                <td>
                                        <xsl:call-template name="categories"/>
@@ -328,64 +328,54 @@
                        </tr>
                        <tr>
                                <td valign="top" width="10%">
-                                       <xsl:value-of select="lang_name"/>
+                                       <xsl:value-of 
select="php:function('lang', 'name')" />
                                </td>
                                <td>
-                                       <input type="text" size="60" 
name="values[name]" value="{value_name}" onMouseout="window.status='';return 
true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
+                                       <input type="text" size="60" 
name="values[name]" value="{value_name}">
+                                               <xsl:attribute name="title">
                                                                <xsl:value-of 
select="lang_name_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
                                </td>
                        </tr>
                        <tr>
                                <td valign="top">
-                                       <xsl:value-of select="lang_address"/>
+                                       <xsl:value-of 
select="php:function('lang', 'address')" />
                                </td>
                                <td>
-                                       <input type="text" size="60" 
name="values[address]" value="{value_address}" 
onMouseout="window.status='';return true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_address_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <input type="text" size="60" 
name="values[address]" value="{value_address}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_address_status_text"/>
                                                </xsl:attribute>
                                        </input>
                                </td>
                        </tr>
                        <tr>
                                <td valign="top">
-                                       <xsl:value-of select="lang_zip"/>
+                                       <xsl:value-of 
select="php:function('lang', 'zip')" />
                                </td>
                                <td>
-                                       <input type="text" size="6" 
name="values[zip]" value="{value_zip}" onMouseout="window.status='';return 
true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_zip_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <input type="text" size="6" 
name="values[zip]" value="{value_zip}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_zip_status_text"/>
                                                </xsl:attribute>
                                        </input>
                                        <xsl:value-of select="lang_town"/>
-                                       <input type="text" size="40" 
name="values[town]" value="{value_town}" onMouseout="window.status='';return 
true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_town_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <input type="text" size="40" 
name="values[town]" value="{value_town}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_town_status_text"/>
                                                </xsl:attribute>
                                        </input>
                                </td>
                        </tr>
                        <tr>
                                <td valign="top">
-                                       <xsl:value-of select="lang_remark"/>
+                                       <xsl:value-of 
select="php:function('lang', 'remark')" />
                                </td>
                                <td>
-                                       <textarea cols="60" rows="10" 
name="values[remark]" wrap="virtual" onMouseout="window.status='';return true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_remark_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <textarea cols="60" rows="10" 
name="values[remark]" id="remark" wrap="virtual">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_remark_status_text"/>
                                                </xsl:attribute>
                                                <xsl:value-of 
select="value_remark"/>           
                                        </textarea>
@@ -402,25 +392,21 @@
                        </xsl:choose>
                        <tr>
                                <td>
-                                       <xsl:value-of select="lang_access"/>
+                                       <xsl:value-of 
select="php:function('lang', 'private')" />
                                </td>
                                <td>
                                        <xsl:choose>
                                                        <xsl:when 
test="value_access = 'private'">
-                                                               <input 
type="checkbox" name="values[access]" value="True" checked="checked" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="lang_access_on_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
+                                                               <input 
type="checkbox" name="values[access]" value="True" checked="checked">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'The note is private. If the note 
should be public, uncheck this box')" />
                                                                        
</xsl:attribute>
                                                                </input>
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <input 
type="checkbox" name="values[access]" value="True" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="lang_access_off_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
+                                                               <input 
type="checkbox" name="values[access]" value="True">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'The note is public. If the note 
should be private, check this box')" />
                                                                        
</xsl:attribute>
                                                                </input>
                                                        </xsl:otherwise>
@@ -428,35 +414,64 @@
                                </td>
                        </tr>
 
+                       <tr>
+                               <td valign="top">
+                                       <xsl:value-of 
select="php:function('lang', 'generic list 1')" />
+                               </td>
+                               <td>
+                                       <select name="values[generic_list_1]" >
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'Set a value')" />
+                                               </xsl:attribute>
+                                               <option value="0">
+                                                       <xsl:value-of 
select="php:function('lang', 'Set a value')" />
+                                               </option>
+                                               <xsl:apply-templates 
select="generic_list_1/options"/>
+                                       </select>                       
+                               </td>
+                       </tr>
+
+                       <tr>
+                               <td valign="top">
+                                       <xsl:value-of 
select="php:function('lang', 'generic list 2')" />
+                               </td>
+                               <td>
+                                       <select name="values[generic_list_2]" >
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'Set a value')" />
+                                               </xsl:attribute>
+                                               <option value="0">
+                                                       <xsl:value-of 
select="php:function('lang', 'Set a value')" />
+                                               </option>
+                                               <xsl:apply-templates 
select="generic_list_2/options"/>
+                                       </select>                       
+                               </td>
+                       </tr>
+
+
                        <tr height="50">
                                <td colspan = "2" align = "center"><table><tr>
                                <td valign="bottom">
-                                       <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
-                                       <input type="submit" 
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return 
true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_save_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
+                                       <input type="submit" 
name="values[save]" value="{$lang_save}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'save')" />
                                                </xsl:attribute>
                                        </input>
                                </td>
                                <td valign="bottom">
-                                       <xsl:variable 
name="lang_apply"><xsl:value-of select="lang_apply"/></xsl:variable>
-                                       <input type="submit" 
name="values[apply]" value="{$lang_apply}" onMouseout="window.status='';return 
true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_apply_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <xsl:variable 
name="lang_apply"><xsl:value-of select="php:function('lang', 'apply')" 
/></xsl:variable>
+                                       <input type="submit" 
name="values[apply]" value="{$lang_apply}">
+                                               <xsl:attribute name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'apply the values')" />
                                                </xsl:attribute>
                                        </input>
                                </td>
                                <td align="left" valign="bottom">
-                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
-                                       <input type="submit" 
name="values[cancel]" value="{$lang_cancel}" 
onMouseout="window.status='';return true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_cancel_status_text"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
+                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
+                                       <input type="submit" 
name="values[cancel]" value="{$lang_cancel}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'Back to the list')" />
                                                </xsl:attribute>
                                        </input>
                                </td>
@@ -558,7 +573,7 @@
                        <tr height="50">
                                <td align="left" valign="bottom">
                                        <xsl:variable 
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
-                                       <input type="submit" 
name="values[cancel]" value="{$lang_cancel}" 
onMouseout="window.status='';return true;">
+                                       <input type="submit" 
name="values[cancel]" value="{$lang_cancel}">
                                                <xsl:attribute 
name="onMouseover">
                                                        
<xsl:text>window.status='</xsl:text>
                                                                <xsl:value-of 
select="lang_cancel_status_text"/>
@@ -571,3 +586,14 @@
                </form>
                </div>
        </xsl:template>
+       
+       
+       <xsl:template match="options">
+               <option value="{id}">
+                       <xsl:if test="selected != 0">
+                               <xsl:attribute name="selected" value="selected" 
/>
+                       </xsl:if>
+                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+               </option>
+       </xsl:template>
+

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-09-08 06:28:58 UTC (rev 7562)
@@ -78,6 +78,9 @@
                        $allrows                = phpgw::get_var('allrows', 
'bool');
                        $this->p_num    = phpgw::get_var('p_num');
 
+                       $start_date             = phpgw::get_var('start_date');
+                       $end_date               = phpgw::get_var('end_date');
+
                        if(isset($_POST['start']) || isset($_GET['start']))
                        {
                                $this->start = $start;
@@ -118,6 +121,16 @@
                        {
                                $this->allrows = $allrows;
                        }
+
+                       if(array_key_exists('start_date',$_POST) || 
array_key_exists('start_date',$_GET))
+                       {
+                               $this->start_date = $start_date;
+                       }
+                       if(array_key_exists('end_date',$_POST) || 
array_key_exists('end_date',$_GET))
+                       {
+                               $this->end_date = $end_date;
+                       }
+
                }
 
                function save_sessiondata($data)
@@ -140,6 +153,9 @@
                        $this->district_id      = $data['district_id'];
                        $this->cat_id           = $data['cat_id'];
                        $this->status_id        = $data['status_id'];
+                       $this->start_date               = 
isset($data['start_date']) ? $data['start_date']: '';
+                       $this->end_date                 = 
isset($data['end_date']) ? $data['end_date']: '';
+
                }
 
 
@@ -378,7 +394,7 @@
                        $request = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                'filter' => $this->filter,'district_id' => 
$this->district_id,'cat_id' => $this->cat_id,'status_id' => $this->status_id,
                                'project_id' => 
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' => 
$data['list_descr'],
-                               'dry_run'=>$data['dry_run'], 'p_num' => 
$this->p_num));
+                               'dry_run'=>$data['dry_run'], 'p_num' => 
$this->p_num,'start_date'=>$this->start_date,'end_date'=>$this->end_date));
                        $this->total_records = $this->so->total_records;
 
                        $this->uicols   = $this->so->uicols;

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-09-08 06:28:58 UTC (rev 7562)
@@ -27,6 +27,8 @@
        * @version $Id$
        */
 
+       phpgw::import_class('phpgwapi.datetime');
+
        /**
         * Description
         * @package property
@@ -190,7 +192,7 @@
 
                function read($data)
                {
-                       $start                  = isset($data['start']) && 
$data['start'] ? $data['start'] : 0;
+                       $start                  = isset($data['start']) && 
$data['start'] ? (int)$data['start'] : 0;
                        $filter                 = 
isset($data['filter'])?$data['filter']:'';
                        $query                  = 
isset($data['query'])?$data['query']:'';
                        $sort                   = isset($data['sort']) && 
$data['sort'] ? $data['sort'] : 'DESC';
@@ -203,6 +205,8 @@
                        $list_descr             = 
isset($data['list_descr'])?$data['list_descr']:'';
                        $dry_run                = isset($data['dry_run']) ? 
$data['dry_run'] : '';
                        $p_num                  = isset($data['p_num']) ? 
$data['p_num'] : '';
+                       $start_date             = isset($data['start_date']) && 
$data['start_date'] ? phpgwapi_datetime::date_to_timestamp($data['start_date']) 
: 0;
+                       $end_date               = isset($data['end_date']) && 
$data['end_date'] ? phpgwapi_datetime::date_to_timestamp($data['end_date']) : 0;
 
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.project.request');
                        $attribute_table = 'phpgw_cust_attribute';
@@ -298,7 +302,7 @@
                        $uicols['exchange'][]           = '';
                        $uicols['align'][]                      = '';
                        $uicols['datatype'][]           = '';
-                       $uicols['formatter'][]          = '';
+                       $uicols['formatter'][]          = 'FormatterRight';
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = true;
 
@@ -325,7 +329,7 @@
                        $uicols['exchange'][]           = '';
                        $uicols['align'][]                      = '';
                        $uicols['datatype'][]           = '';
-                       $uicols['formatter'][]          = '';
+                       $uicols['formatter'][]          = 'FormatterRight';
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = true;
 
@@ -388,6 +392,15 @@
                                $where = 'AND';
                        }
 
+                       if ($start_date)
+                       {
+                               $end_date       = $end_date + 3600 * 16 + 
phpgwapi_datetime::user_timezone();
+                               $start_date     = $start_date - 3600 * 8 + 
phpgwapi_datetime::user_timezone();
+
+                               $filtermethod .= " $where fm_request.start_date 
>= $start_date AND fm_request.start_date <= $end_date ";
+                               $where= 'AND';
+                       }
+
                        if ($filter)
                        {
                                $filtermethod .= " $where 
fm_request.coordinator='$filter' ";

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-09-08 06:28:58 UTC (rev 7562)
@@ -87,6 +87,8 @@
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->status_id                        = 
$this->bo->status_id;
                        $this->district_id                      = 
$this->bo->district_id;
+                       $this->start_date                       = 
$this->bo->start_date;
+                       $this->end_date                         = 
$this->bo->end_date;
 
                        $this->allrows                          = 
$this->bo->allrows;
                        $this->p_num                            = 
$this->bo->p_num;
@@ -104,7 +106,9 @@
                                        'cat_id'                => 
$this->cat_id,
                                        'status_id'             => 
$this->status_id,
                                        'district_id'   => $this->district_id,
-                                       'allrows'               => 
$this->allrows
+                                       'allrows'               => 
$this->allrows,
+                                       'start_date'    => $this->start_date,
+                                       'end_date'              => 
$this->end_date,
                                );
                        $this->bo->save_sessiondata($data);
                }
@@ -193,6 +197,9 @@
                                $lookup = true;
                        }
 
+                       $start_date     = urldecode($this->start_date);
+                       $end_date               = urldecode($this->end_date);
+
                        $this->save_sessiondata();
 
                        $dry_run = false;
@@ -215,6 +222,9 @@
                                                'project_id'    => $project_id,
                //                              'query'         => $this->query,
                                                'p_num'         => $this->p_num,
+                                               'start_date'=> 
$this->start_date,
+                                               'end_date'      => 
$this->end_date
+
                                        ));
                                $datatable['config']['allow_allrows'] = true;
 
@@ -226,6 +236,8 @@
                                        ."filter:'{$this->filter}',"
                                        ."status_id:'{$this->status_id}',"
                                        ."district_id: '{$this->district_id}',"
+                                       ."start_date:'{$this->start_date}',"
+                                       ."end_date: '{$this->end_date}',"
                                        ."cat_id:'{$this->cat_id}'";
 
                                $values_combo_box[0]  = 
$this->bocommon->select_district_list('filter',$this->district_id);
@@ -259,7 +271,10 @@
                                                                'status_id'     
                => $this->status_id,
                                                                'project_id'    
        => $project_id,
                                                                'district_id'   
    => $this->district_id,
-                                                               'query'         
                => $this->query
+                                                               'query'         
                => $this->query,
+                                                               'start_date'    
        => $this->start_date,
+                                                               'end_date'      
                => $this->end_date
+
                                                        )
                                                ),
                                                'fields'        => array
@@ -325,6 +340,35 @@
                                                                        
'tab_index' => 7
                                                                ),
                                                                array
+                                                               (
+                                                                       'type'  
=> 'hidden',
+                                                                       'id'    
=> 'start_date',
+                                                                       'value' 
=> $start_date
+                                                               ),
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'hidden',
+                                                                       'id'    
=> 'end_date',
+                                                                       'value' 
=> $end_date
+                                                               ),
+                                                               array
+                                                               (
+                                                                       
'type'=> 'label_date'
+                                                               ),
+                                                               array
+                                                               (
+                                                                       
'type'=> 'link',
+                                                                       'id'  
=> 'btn_date_search',
+                                                                       'url' 
=> "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
+                                                                       array
+                                                                       (
+                                                                               
'menuaction' => 'property.uiproject.date_search')
+                                                                       
)."','','width=350,height=250')",
+                                                                       'value' 
=> lang('Date search'),
+                                                                       
'tab_index' => 9
+                                                               ),
+
+                                                               array
                                                                ( //boton     
SEARCH
                                                                        'id' => 
'btn_search',
                                                                        'name' 
=> 'search',
@@ -1270,19 +1314,19 @@
                                );
 
 
-
-                       $_predisposed = 0;
+                       $_consume_amount = 0;
+                       $_planning_amount = 0;
                        if($this->acl_edit)
                        {
                                $_lang_delete = lang('Check to delete');
                                foreach($values['consume'] as & $consume)
                                {
-                                       $_predisposed = $_predisposed + 
$consume['amount'];
+                                       $_consume_amount = $_consume_amount + 
$consume['amount'];
                                        $consume['delete'] = "<input 
type='checkbox' name='values[delete_consume][]' value='{$consume['id']}' 
title='{$_lang_delete}'>";
                                }
                                foreach($values['planning'] as & $planning)
                                {
-                                       $_predisposed = $_predisposed + 
$planning['amount'];
+                                       $_planning_amount = $_planning_amount + 
$planning['amount'];
                                        $planning['delete'] = "<input 
type='checkbox' name='values[delete_planning][]' value='{$planning['id']}' 
title='{$_lang_delete}'>";
                                }
 
@@ -1437,7 +1481,8 @@
                                        'lang_budget'                           
                => lang('Budget'),
                                        'value_budget'                          
                => number_format($values['budget'], 0, ',', ' '),
                                        'lang_budget_statustext'                
        => lang('Enter the budget'),
-                                       'value_diff'                            
                => number_format(((int)$values['budget'] - $_predisposed), 0, 
',', ' '),
+                                       'value_diff'                            
                => number_format(((int)$values['budget'] - ($_consume_amount + 
$_planning_amount)), 0, ',', ' '),
+                                       'value_diff2'                           
                => number_format(((int)$values['budget'] - $_consume_amount), 
0, ',', ' '),
 
                                        'location_data'                         
                => $location_data,
                                        'location_type'                         
                => 'form',

Modified: branches/Version-1_0-branch/property/js/yahoo/property.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/property.js   2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/js/yahoo/property.js   2011-09-08 
06:28:58 UTC (rev 7562)
@@ -893,15 +893,22 @@
                                                        }
                myPaginator = new YAHOO.widget.Paginator(myPaginatorConfig);
 
+               var tableHeight = 
(YAHOO.layout.getUnitByPosition('center').getSizes().wrap.h)/22 + "em"; 
+//             
console.log(YAHOO.layout.getUnitByPosition('center').getSizes());
+//             alert(tableHeight);
+
                var myTableConfig = {
                                                        initialRequest          
: '',//la primera vez ya viene ordenado, por la columna respectiva y solo 15 
registros
                                                        generateRequest         
: buildQueryString,
                                                        dynamicData             
        : true,
                                                        sortedBy                
        : {key:values_ds.sort, 
dir:values_ds.dir/*dir:YAHOO.widget.DataTable.CLASS_DESC*/},
-                                                       paginator               
        : myPaginator
+                                                       paginator               
        : myPaginator,
+                                                       width                   
        : "100%",
+                                                       height                  
        : tableHeight //"30em",
                };
                //Create DataTable ; Second call JSON (GET)
-               myDataTable = new YAHOO.widget.DataTable(container[0], 
myColumnDefs, myDataSource, myTableConfig);
+       //      myDataTable = new YAHOO.widget.DataTable(container[0], 
myColumnDefs, myDataSource, myTableConfig);
+               myDataTable = new YAHOO.widget.ScrollingDataTable(container[0], 
myColumnDefs, myDataSource, myTableConfig);
 
                myDataTable.on('cellMouseoverEvent', function (oArgs)
                {

Modified: branches/Version-1_0-branch/property/js/yahoo/request.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/request.index.js      
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/js/yahoo/request.index.js      
2011-09-08 06:28:58 UTC (rev 7562)
@@ -31,15 +31,21 @@
 
        var linktoolTips =
        [
-           {name:'btn_priority_key', title:'Priority key', description:'To 
alter the Priority key'}
+           {name:'btn_priority_key', title:'Priority key', description:'To 
alter the Priority key'},
+               {name:'btn_date_search', title:'Date search', 
description:'Narrow the search by dates'}
        ]
 
        // define the hidden column in datatable
        var config_values = {
-               date_search : 0 //if search has link "Data search"
+               date_search : 1 //if search has link "Data search"
        };
 
/****************************************************************************************/
 
+       var FormatterRight = function(elCell, oRecord, oColumn, oData)
+       {
+               elCell.innerHTML = "<div 
align=\"right\">"+YAHOO.util.Number.format(oData, {thousandsSeparator:" 
"})+"</div>";
+       }
+
        this.particular_setting = function()
        {
                if(flag_particular_setting=='init')

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-09-08 
06:28:58 UTC (rev 7562)
@@ -1098,6 +1098,7 @@
 no status      property        no      Status ikke valgt
 no such order: %1      property        no      Ordre %1 finnes ikke
 no supervisor  property        no      Attestant ikke valgt
+not allocated  property        no      Ikke disponert
 note   property        no      Notat
 nothing to do! property        no      Ingen ting å gjøre
 notify property        no      varsle
@@ -1320,6 +1321,7 @@
 reserve remainder      property        no      rest av reserve
 reset  property        no      Tilbakestill
 residential environment        property        no      Bo-miljø
+residual demand        property        no      Rest behov
 responsible    property        no      Ansvarlig
 responsibility property        no      Ansvar
 responsible matrix     property        no      Ansvarsmatrise
@@ -1376,7 +1378,7 @@
 schedule       property        no      planlegge (tid)
 scheduled events       property        no      Planlagte oppgaver
 schedule the method    property        no      Tidsplanlegging
-score  property        no      poengsum
+score  property        no      Poengsum
 search by bruk. to show all entries, empty all fields and press the submit 
button again        property        no      Søk etter BruksNr
 search by feste. to show all entries, empty all fields and press the submit 
button again       property        no      Søk etter FesteNr
 search by gaards nr. to show all entries, empty all fields and press the 
submit button again   property        no      Søk etter GårdsNr
@@ -1627,7 +1629,7 @@
 subject has been updated       property        no      Overskrift er oppdatert
 submit the search string       property        no      Send søkestrengen
 sum estimated cost     property        no      Sum estimert kostnad
-sum orders     property        no      Sum bestilling
+sum orders     property        no      Forpliktet, ikke betalt
 sum    property        no      Sum
 sum calculation        property        no      Sum kalkulasjon
 sum deviation  property        no      Sum avvik

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2011-09-07 
14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2011-09-08 
06:28:58 UTC (rev 7562)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.623';
+       $setup_info['property']['version']              = '0.9.17.624';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-09-08 06:28:58 UTC (rev 7562)
@@ -1347,7 +1347,8 @@
                                'planned_cost' => array('type' => 
'int','precision' => '4','nullable' => True, 'default' => '0'),
                                'account_id' => array('type' => 
'varchar','precision' => '20','nullable' => True),
                                'ecodimb' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
-                               'contact_id' => array('type' => 
'int','precision' => 4,'nullable' => True)
+                               'contact_id' => array('type' => 
'int','precision' => 4,'nullable' => True),
+                               'account_group' => array('type' => 
'int','precision' => 4,'nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-09-08 06:28:58 UTC (rev 7562)
@@ -5431,6 +5431,32 @@
 
 
        /**
+       * Update property version from 0.9.17.623 to 0.9.17.624
+       * Add column missing from fresh install.
+       * 
+       */
+
+       $test[] = '0.9.17.623';
+       function property_upgrade0_9_17_623()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $metadata = 
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata('fm_project');
+
+               if(!isset($metadata['account_group']))
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project','account_group',array('type'
 => 'int','precision' => '4','nullable' => True));
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.624';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+
+       /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets
        * 

Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl     
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl     
2011-09-08 06:28:58 UTC (rev 7562)
@@ -349,7 +349,7 @@
                                                        </tr>
                                                        <tr>
                                                                <td 
valign="top">
-                                                                       
<xsl:value-of select="php:function('lang', 'at the disposal')" />
+                                                                       
<xsl:value-of select="php:function('lang', 'not allocated')" />
                                                                </td>
                                                                <td>
                                                                        
<xsl:value-of select="value_diff"/>
@@ -357,7 +357,16 @@
                                                                </td>
                                                        </tr>
                                                        <tr>
+                                                               <td 
valign="top">
+                                                                       
<xsl:value-of select="php:function('lang', 'residual demand')" />
+                                                               </td>
                                                                <td>
+                                                                       
<xsl:value-of select="value_diff2"/>
+                                                                       
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
                                                                        
<xsl:value-of select="php:function('lang', 'building part')" />
                                                                </td>
                                                                <td>
@@ -989,7 +998,7 @@
                -->
                        <th width="5%" align="center">
                                        <xsl:attribute name="title">
-                                               <xsl:text>Vekt = konfigurerbar 
verdi for hjelpeberegning av viktighet</xsl:text>
+                                               <xsl:text>Vekt = konfigurerbar 
verdi pr konsekvenstype</xsl:text>
                                        </xsl:attribute>
                                <xsl:value-of select="php:function('lang', 
'weight')" />
                        </th>
@@ -1001,7 +1010,7 @@
                        </th>
                        <th width="5%" align="center">
                                        <xsl:attribute name="title">
-                                               <xsl:text>Verdi for hjelp til 
sortering av viktighet</xsl:text>
+                                               <xsl:text>Poeng = Tilstandsgrad 
x Risiko x Vekt</xsl:text>
                                        </xsl:attribute>
 
                                <xsl:value-of select="php:function('lang', 
'score')" />

Modified: 
branches/Version-1_0-branch/rental/templates/base/composite_list_partial.php
===================================================================
--- 
branches/Version-1_0-branch/rental/templates/base/composite_list_partial.php    
    2011-09-07 14:01:50 UTC (rev 7561)
+++ 
branches/Version-1_0-branch/rental/templates/base/composite_list_partial.php    
    2011-09-08 06:28:58 UTC (rev 7562)
@@ -1,5 +1,9 @@
+<?php
+       $config = CreateObject('phpgwapi.config','rental');
+       $config->read();
+?>
+
 <script type="text/javascript">
-
 function checkAvailabitily()
 { 
        if(document.forms[0].availability_date_to.value == '')
@@ -53,17 +57,31 @@
                        label: "<?php echo lang('status') ?>",
                    sortable: true
                },
+<?php
+       if(isset($config->config_data['contract_future_info']) && 
$config->config_data['contract_future_info'])
+       {
+?>
+                       {
+                               key: "contracts",
+                               label: "<?php echo lang('contract_future_info') 
?>",
+                           sortable: false
+                       },
+<?php
+       }
+       if(isset($config->config_data['contract_furnished_status']) && 
$config->config_data['contract_furnished_status'])
+       {
+
+?>
+
+                       {
+                               key: "furnished_status",
+                               label: "<?php echo lang('furnish_type') ?>",
+                           sortable: false
+                       },
+<?php
+       }
+?>
                {
-                       key: "contracts",
-                       label: "<?php echo lang('contract_future_info') ?>",
-                   sortable: false
-               },
-               {
-                       key: "furnished_status",
-                       label: "<?php echo lang('furnish_type') ?>",
-                   sortable: false
-               },
-               {
                        key: "actions",
                        hidden: true
                },

Modified: branches/Version-1_0-branch/rental/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/rental/templates/base/config.tpl        
2011-09-07 14:01:50 UTC (rev 7561)
+++ branches/Version-1_0-branch/rental/templates/base/config.tpl        
2011-09-08 06:28:58 UTC (rev 7562)
@@ -81,7 +81,25 @@
                         </select>
                        </td>
                </tr>
+               <tr class="row_on">
+                       <td>{lang_contract_future_info}:</td>
+                       <td>
+                               <select 
name="newsettings[contract_future_info]">
+                                       <option value="" 
{selected_contract_future_info_}>NO</option>
+                                       <option value="1" 
{selected_contract_future_info_1}>YES</option>
+                               </select>
+                       </td>
+               </tr>
                <tr class="row_off">
+                       <td>{lang_contract_furnished_status}:</td>
+                       <td>
+                               <select 
name="newsettings[contract_furnished_status]">
+                                       <option value="" 
{selected_contract_furnished_status_}>NO</option>
+                                       <option value="1" 
{selected_contract_furnished_status_1}>YES</option>
+                               </select>
+                       </td>
+               </tr>
+               <tr class="row_off">
                        <td>{lang_use_fellesdata}:</td>
                        <td>
                                <select name="newsettings[use_fellesdata]">




reply via email to

[Prev in Thread] Current Thread [Next in Thread]