fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14573] clean up from yui


From: Sigurd Nes
Subject: [Fmsystem-commits] [14573] clean up from yui
Date: Fri, 11 Dec 2015 12:16:51 +0000

Revision: 14573
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14573
Author:   sigurdne
Date:     2015-12-11 12:16:51 +0000 (Fri, 11 Dec 2015)
Log Message:
-----------
clean up from yui

Modified Paths:
--------------
    branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php
    branches/dev-syncromind/messenger/inc/class.uimessenger.inc.php
    branches/dev-syncromind/property/inc/class.boadmin_entity.inc.php
    branches/dev-syncromind/property/inc/class.uiadmin_entity.inc.php
    branches/dev-syncromind/registration/inc/class.uipending.inc.php
    branches/dev-syncromind/rental/inc/class.uicommon.inc.php

Modified: branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php
===================================================================
--- branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php 
2015-12-11 12:15:30 UTC (rev 14572)
+++ branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php 
2015-12-11 12:16:51 UTC (rev 14573)
@@ -1,5 +1,4 @@
 <?php
-       //phpgw::import_class('phpgwapi.yui');
        phpgw::import_class('phpgwapi.uicommon_jquery');
 
        //define("ACTIVITYCALENDAR_TEMPLATE_PATH", 
"activitycalendar/templates/base/");

Modified: branches/dev-syncromind/messenger/inc/class.uimessenger.inc.php
===================================================================
--- branches/dev-syncromind/messenger/inc/class.uimessenger.inc.php     
2015-12-11 12:15:30 UTC (rev 14572)
+++ branches/dev-syncromind/messenger/inc/class.uimessenger.inc.php     
2015-12-11 12:16:51 UTC (rev 14573)
@@ -1,125 +1,137 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - Messenger                                              
   *
-       * http://www.phpgroupware.org                                           
   *
-       * This application written by Joseph Engo <address@hidden>         *
-       * --------------------------------------------                          
   *
-       * Funding for this program was provided by http://www.checkwithmom.com  
   *
-       * --------------------------------------------                          
   *
-       *  This program is free software; you can redistribute it and/or modify 
it *
-       *  under the terms of the GNU General Public License as published by 
the   *
-       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
-       *  option) any later version.                                           
   *
-       
\**************************************************************************/
-       phpgw::import_class('phpgwapi.yui');
-       class uimessenger
+       /*       * 
************************************************************************\
+        * phpGroupWare - Messenger                                             
    *
+        * http://www.phpgroupware.org                                          
    *
+        * This application written by Joseph Engo <address@hidden>         *
+        * --------------------------------------------                         
    *
+        * Funding for this program was provided by http://www.checkwithmom.com 
    *
+        * --------------------------------------------                         
    *
+        *  This program is free software; you can redistribute it and/or 
modify it *
+        *  under the terms of the GNU General Public License as published by 
the   *
+        *  Free Software Foundation; either version 2 of the License, or (at 
your  *
+        *  option) any later version.                                          
    *
+         
\************************************************************************* */
+       phpgw::import_class('phpgwapi.uicommon_jquery');
+
+       class uimessenger extends phpgwapi_uicommon_jquery
        {
+
                var $bo;
                var $template;
                var $public_functions = array
-               (
-                       'index'                         => true,
-                       'inbox'                         => true,
-                       'compose'                       => true,
-                       'compose_groups'        => true,
-                       'compose_global'        => true,
-                       'read_message'          => true,
-                       'reply'                         => true,
-                       'forward'                       => true,
-                       'delete'                        => true
+                       (
+                       'index'                  => true,
+                       'inbox'                  => true,
+                       'compose'                => true,
+                       'compose_groups' => true,
+                       'compose_global' => true,
+                       'read_message'   => true,
+                       'reply'                  => true,
+                       'forward'                => true,
+                       'delete'                 => true
                );
 
                function __construct()
                {
-                       $this->template   = $GLOBALS['phpgw']->template;
-                       $this->bo         = 
CreateObject('messenger.bomessenger');
-                       $this->nextmatchs = createobject('phpgwapi.nextmatchs');
-                       if ( !$this->bo->is_connected() )
+                       parent::__construct();
+
+                       $this->template          = $GLOBALS['phpgw']->template;
+                       $this->bo                        = 
CreateObject('messenger.bomessenger');
+                       $this->nextmatchs        = 
createobject('phpgwapi.nextmatchs');
+                       if(!$this->bo->is_connected())
                        {
                                $this->_error_not_connected();
                        }
+                       $this->acl_location      = 'run';
+                       $this->acl                       = & 
$GLOBALS['phpgw']->acl;
+                       $this->acl_read          = 
$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'messenger');
+                       $this->acl_add           = 
$this->acl->check($this->acl_location, PHPGW_ACL_ADD, 'messenger');
+                       $this->acl_edit          = 
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'messenger');
+                       $this->acl_delete        = 
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'messenger');
                }
 
                function compose($errors = '')
                {
-                       if (!$GLOBALS['phpgw']->acl->check('.compose', 
PHPGW_ACL_ADD, 'messenger'))
+                       if(!$GLOBALS['phpgw']->acl->check('.compose', 
PHPGW_ACL_ADD, 'messenger'))
                        {
                                $this->_no_access('compose');
                        }
 
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'messenger::compose';
 
-                       $message = isset($_POST['message']) ? $_POST['message'] 
: array('subject' => '', 'content' => '');
+                       $message = isset($_POST['message']) ? $_POST['message'] 
: array('subject'        => '',
+                               'content'        => '');
 
                        $this->_display_headers();
                        $this->_set_compose_read_blocks();
 
-                       if (is_array($errors))
+                       if(is_array($errors))
                        {
-                               
$this->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
+                               $this->template->set_var('errors', 
$GLOBALS['phpgw']->common->error_list($errors));
                        }
 
                        $this->_set_common_langs();
-                       $this->template->set_var('header_message',lang('Compose 
message'));
+                       $this->template->set_var('header_message', 
lang('Compose message'));
 
                        $users = $this->bo->get_available_users();
-                       foreach ( $users as $uid => $name )
+                       foreach($users as $uid => $name)
                        {
                                $this->template->set_var(array
-                               (
-                                       'uid'           => $uid,
-                                       'full_name'     => $name
+                                       (
+                                       'uid'            => $uid,
+                                       'full_name'      => $name
                                ));
                                $this->template->parse('select_tos', 
'select_to', true);
                        }
 
-                       
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.bomessenger.send_message') ) );
+                       $this->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/index.php', array(
+                               'menuaction' => 
'messenger.bomessenger.send_message')));
                        //$this->template->set_var('value_to','<input 
name="message[to]" value="' . $message['to'] . '" size="30">');
-                       $this->template->set_var('value_subject','<input 
name="message[subject]" value="' . $message['subject'] . '" size="30">');
-                       $this->template->set_var('value_content','<textarea 
name="message[content]" rows="20" wrap="hard" cols="76">' . $message['content'] 
. '</textarea>');
+                       $this->template->set_var('value_subject', '<input 
name="message[subject]" value="' . $message['subject'] . '" size="30">');
+                       $this->template->set_var('value_content', '<textarea 
name="message[content]" rows="20" wrap="hard" cols="76">' . $message['content'] 
. '</textarea>');
 
-                       $this->template->set_var('button_send','<input 
type="submit" name="send" value="' . lang('Send') . '">');
-                       $this->template->set_var('button_cancel','<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
+                       $this->template->set_var('button_send', '<input 
type="submit" name="send" value="' . lang('Send') . '">');
+                       $this->template->set_var('button_cancel', '<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
 
-                       $this->template->fp('to','form_to');
-                       $this->template->fp('buttons','form_buttons');
-                       $this->template->pfp('out','form');
+                       $this->template->fp('to', 'form_to');
+                       $this->template->fp('buttons', 'form_buttons');
+                       $this->template->pfp('out', 'form');
                }
 
                function compose_groups()
                {
-                       if (!$GLOBALS['phpgw']->acl->check('.compose_groups', 
PHPGW_ACL_ADD, 'messenger'))
+                       if(!$GLOBALS['phpgw']->acl->check('.compose_groups', 
PHPGW_ACL_ADD, 'messenger'))
                        {
                                $this->_no_access('compose_groups');
                        }
 
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
-                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'messenger::compose_groups';
+                       $GLOBALS['phpgw_info']['flags']['xslt_app']             
         = true;
+                       $GLOBALS['phpgw_info']['flags']['menu_selection']       
 = 'messenger::compose_groups';
 
-                       $values = phpgw::get_var('values');
-                       $values['account_groups'] = (array) 
phpgw::get_var('account_groups', 'int', 'POST');
-                       $receipt = array();
+                       $values                                          = 
phpgw::get_var('values');
+                       $values['account_groups']        = 
(array)phpgw::get_var('account_groups', 'int', 'POST');
+                       $receipt                                         = 
array();
 
-                       if (isset($values['save']))
+                       if(isset($values['save']))
                        {
                                if(!$values['account_groups'])
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('Missing groups'));
+                                       $receipt['error'][] = array('msg' => 
lang('Missing groups'));
                                }
 
                                if($GLOBALS['phpgw']->session->is_repost())
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('repost'));
+                                       $receipt['error'][] = array('msg' => 
lang('repost'));
                                }
 
                                if(!isset($values['subject']) || 
!$values['subject'])
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('Missing subject'));
+                                       $receipt['error'][] = array('msg' => 
lang('Missing subject'));
                                }
 
                                if(!isset($values['content']) || 
!$values['content'])
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('Missing content'));
+                                       $receipt['error'][] = array('msg' => 
lang('Missing content'));
                                }
 
                                if(isset($values['save']) && 
$values['account_groups'] && !$receipt['error'])
@@ -133,13 +145,13 @@
 
                        if(!$GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
                        {
-                               $available_apps = 
$GLOBALS['phpgw_info']['apps'];
-                               $valid_groups = array();
+                               $available_apps  = 
$GLOBALS['phpgw_info']['apps'];
+                               $valid_groups    = array();
                                foreach($available_apps as $_app => $dummy)
                                {
                                        
if($GLOBALS['phpgw']->acl->check('admin', phpgwapi_acl::ADD, $_app))
                                        {
-                                               $valid_groups   = 
array_merge($valid_groups,$GLOBALS['phpgw']->acl->get_ids_for_location('run', 
phpgwapi_acl::READ, $_app));
+                                               $valid_groups = 
array_merge($valid_groups, $GLOBALS['phpgw']->acl->get_ids_for_location('run', 
phpgwapi_acl::READ, $_app));
                                        }
                                }
 
@@ -150,34 +162,33 @@
                                $valid_groups = array_keys($all_groups);
                        }
 
-                       foreach ( $all_groups as $group )
+                       foreach($all_groups as $group)
                        {
                                $group_list[$group->id] = array
-                               (
-                                       'account_id'    => $group->id,
-                                       'account_lid'   => $group->__toString(),
-                                       'i_am_admin'    => in_array($group->id, 
$valid_groups),
-                                       'selected'              => 
in_array($group->id, $values['account_groups'])
+                                       (
+                                       'account_id'     => $group->id,
+                                       'account_lid'    => 
$group->__toString(),
+                                       'i_am_admin'     => 
in_array($group->id, $valid_groups),
+                                       'selected'               => 
in_array($group->id, $values['account_groups'])
                                );
                        }
 
                        $data = array
-                       (
-                               'msgbox_data'   => 
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($receipt)),
-                               'form_action'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'messenger.uimessenger.compose_groups')),
-                               'group_list'    => $group_list,
-                               'value_subject' => isset($values['subject']) ? 
$values['subject'] : '',
-                               'value_content' => isset($values['content']) ? 
$values['content'] : ''
+                               (
+                               'msgbox_data'    => 
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($receipt)),
+                               'form_action'    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.compose_groups')),
+                               'group_list'     => $group_list,
+                               'value_subject'  => isset($values['subject']) ? 
$values['subject'] : '',
+                               'value_content'  => isset($values['content']) ? 
$values['content'] : ''
                        );
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('messenger'));
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('compose_groups' => $data));
-
                }
 
                function compose_global($errors = '')
                {
-                       if (!$GLOBALS['phpgw']->acl->check('.compose_global', 
PHPGW_ACL_ADD, 'messenger'))
+                       if(!$GLOBALS['phpgw']->acl->check('.compose_global', 
PHPGW_ACL_ADD, 'messenger'))
                        {
                                $this->_no_access('compose_global');
                        }
@@ -189,23 +200,24 @@
                        $this->_display_headers();
                        $this->_set_compose_read_blocks();
 
-                       if (is_array($errors))
+                       if(is_array($errors))
                        {
-                               
$this->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
+                               $this->template->set_var('errors', 
$GLOBALS['phpgw']->common->error_list($errors));
                        }
 
                        $this->_set_common_langs();
-                       $this->template->set_var('header_message',lang('Compose 
global message'));
+                       $this->template->set_var('header_message', 
lang('Compose global message'));
 
-                       
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.bomessenger.send_global_message') ) );
-                       $this->template->set_var('value_subject','<input 
name="message[subject]" value="' . $message['subject'] . '">');
-                       $this->template->set_var('value_content','<textarea 
name="message[content]" rows="20" wrap="hard" cols="76">' . $message['content'] 
. '</textarea>');
+                       $this->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/index.php', array(
+                               'menuaction' => 
'messenger.bomessenger.send_global_message')));
+                       $this->template->set_var('value_subject', '<input 
name="message[subject]" value="' . $message['subject'] . '">');
+                       $this->template->set_var('value_content', '<textarea 
name="message[content]" rows="20" wrap="hard" cols="76">' . $message['content'] 
. '</textarea>');
 
-                       $this->template->set_var('button_send','<input 
type="submit" name="send" value="' . lang('Send') . '">');
-                       $this->template->set_var('button_cancel','<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
+                       $this->template->set_var('button_send', '<input 
type="submit" name="send" value="' . lang('Send') . '">');
+                       $this->template->set_var('button_cancel', '<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
 
-                       $this->template->fp('buttons','form_buttons');
-                       $this->template->pfp('out','form');
+                       $this->template->fp('buttons', 'form_buttons');
+                       $this->template->pfp('out', 'form');
                }
 
                function delete()
@@ -213,505 +225,321 @@
                        $messages = $_REQUEST['messages'];
                        $this->bo->delete_message($messages);
 
-                       $this->inbox();
+//                     $this->inbox();
                }
 
-               function index()
+               public function query()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
-                       $this->acl_location = 'run';
-                       $this->acl                              = & 
$GLOBALS['phpgw']->acl;
-                       if (!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'property') )
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
-                       }
 
-                       $this->acl_read                         = 
$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'messenger');
-                       $this->acl_add                          = 
$this->acl->check($this->acl_location, PHPGW_ACL_ADD, 'messenger');
-                       $this->acl_edit                         = 
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'messenger');
-                       $this->acl_delete                       = 
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'messenger');
+                       $search  = phpgw::get_var('search');
+                       $order   = phpgw::get_var('order');
+                       $draw    = phpgw::get_var('draw', 'int');
+                       $columns = phpgw::get_var('columns');
 
-                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"messenger::inbox";
-//                     $this->save_sessiondata();
+                       $params = array(
+                               'start'          => $this->start,
+                               'results'        => phpgw::get_var('length', 
'int', 'REQUEST', 0),
+                               'query'          => $search['value'],
+                               'sort'           => $order[0]['dir'],
+                               'order'          => 
$columns[$order[0]['column']]['data'],
+                               'allrows'        => phpgw::get_var('length', 
'int') == -1,
+                               'entity_id'      => $entity_id,
+                               'cat_id'         => $cat_id
+                       );
 
-                       $values = phpgw::get_var('values');
-_Debug_Array($values);
-                       $receipt = array();
-                       if($values && $this->acl_edit)
+                       switch($columns[$order[0]['column']]['data'])
                        {
-                               $receipt = $this->bo->delete_message($values);
+                               case 'id':
+                                       $params['order'] = 'message_id';
+                                       break;
+                               case 'from':
+                                       $params['order'] = 'message_from';
+                                       break;
+                               case 'subject':
+                                       $params['order'] = 'message_subject';
+                                       break;
+                               default:
+                                       $params['order'] = 
$columns[$order[0]['column']]['data'];
+                                       break;
                        }
 
-                       $datatable = array();
+                       $result_objects  = array();
+                       $result_count    = 0;
 
-                       if( phpgw::get_var('phpgw_return_as') != 'json' )
+                       $values = $this->bo->read_inbox($params);
+
+                       $new_values = array();
+                       foreach($values as &$value)
                        {
-                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                       (
-                               'menuaction'    => 'messenger.uimessenger.index'
-                               ));
+                               $value['status']                 = 
$value['status'] == '&nbsp;' ? '' : $value['status'];
+                               $value['message_date']   = $value['date'];
+                               $value['subject']                = "<a href='" 
. $GLOBALS['phpgw']->link('/index.php', array(
+                                       'menuaction' => 
'messenger.uimessenger.read_message', 'message_id' => $value['id'])) . "'>" . 
$value['subject'] . "</a>";
+                               $new_values[]                    = $value;
+                       }
 
-                               $datatable['config']['base_java_url'] = 
"menuaction:'messenger.uimessenger.index'";
-
-                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                       (
-                               'menuaction'    => 'messenger.uimessenger.index'
-                               ));
-
-                               $datatable['config']['allow_allrows'] = true;
-
-                               $datatable['actions']['form'] = array
-                               (
-                                       array
-                                       (
-                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
-                                                               array
-                                                               (
-                                                                       
'menuaction'    => 'property.uicategory.index',
-                                                                       'type'  
                => $type,
-                                                                       
'type_id'               => $type_id
-                                                               )
-                                                       ),
-                                       'fields'        => array
-                                       (
-                                       'field' => array
-                                       (
-                                                               array(
-                                                                       'id'    
=> 'btn_compose',
-                                                                       'name' 
=> 'compose',
-                                                                       'value' 
=> lang('compose'),
-                                                                       
'tab_index' => 9,
-                                                                       'type'  
=> 'button'
-                                           ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'button',
-                                                                       'id'    
=> 'btn_delete',
-                                                                       'value' 
=> lang('delete'),
-                                                                       
'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
-                                                               )
-                                                       )
-                                               )
-                                       )
-                               );
-//                             $dry_run = true;
+                       if(phpgw::get_var('export', 'bool'))
+                       {
+                               return $new_values;
                        }
 
-                       $start          = phpgw::get_var('start', 'int', 
'REQUEST', 0);
-                       $sort           = phpgw::get_var('sort');
-                       $order          = phpgw::get_var('order');
+                       $result_data                                     = 
array('results' => $new_values);
+                       $result_data['total_records']    = 
$this->bo->total_messages();
+                       $result_data['draw']                     = $draw;
+                       $variable                                               
 = array('menuaction' => 'messenger.uimessenger.read_message');
+                       array_walk($result_data['results'], array($this, 
'_add_links'), $variable);
+                       return $this->jquery_results($result_data);
+               }
 
-                       $params = array(
-                               'start' => $start,
-                               'order' => $order,
-                               'sort'  => $sort
-                       );
-
-                       $values = $this->bo->read_inbox($params);
-                       foreach($values as &$message)
+               function index()
+               {
+                       if(!$this->acl_read)
                        {
-                               $message['status'] = $message['status'] == 
'&nbsp;' ? '' : $message['status'];
-                               $message['message_date'] = $message['date'];
-                               $message['subject'] = "<a href='". 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.read_message', 'message_id' => $message['id']))."'>" 
.$message['subject']."</a>";
+                               phpgw::no_access();
                        }
-                       $uicols = array();
 
-                       $uicols['name'][]               = 'id';
-                       $uicols['descr'][]              = lang('id');
-                       $uicols['sortable'][]   = false;
-                       $uicols['sort_field'][] = '';
-                       $uicols['format'][]             = '';
-                       $uicols['formatter'][]  = '';
-                       $uicols['input_type'][] = '';
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"messenger::inbox";
 
-                       $uicols['name'][]               = 'status';
-                       $uicols['descr'][]              = lang('status');
-                       $uicols['sortable'][]   = false;
-                       $uicols['sort_field'][] = '';
-                       $uicols['format'][]             = '';
-                       $uicols['formatter'][]  = '';
-                       $uicols['input_type'][] = '';
+                       if(phpgw::get_var('phpgw_return_as') == 'json')
+                       {
 
-                       $uicols['name'][]               = 'message_date';
-                       $uicols['descr'][]              = lang('date');
-                       $uicols['sortable'][]   = true;
-                       $uicols['sort_field'][] = 'message_date';
-                       $uicols['format'][]             = '';
-                       $uicols['formatter'][]  = '';
-                       $uicols['input_type'][] = '';
+                               return $this->query();
+                       }
 
-                       $uicols['name'][]               = 'from';
-                       $uicols['descr'][]              = lang('from');
-                       $uicols['sortable'][]   = true;
-                       $uicols['sort_field'][] = 'message_from';
-                       $uicols['format'][]             = '';
-                       $uicols['formatter'][]  = '';
-                       $uicols['input_type'][] = '';
+               //      self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.jeditable.js');
+               //      self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.dataTables.editable.js');
 
-                       $uicols['name'][]               = 'subject';
-                       $uicols['descr'][]              = lang('subject');
-                       $uicols['sortable'][]   = true;
-                       $uicols['sort_field'][] = 'message_subject';
-                       $uicols['format'][]             = '';//'link';
-                       $uicols['formatter'][]  = '';
-                       $uicols['input_type'][] = '';
+                       $appname                 = lang('messenger');
+                       $function_msg    = lang('inbox');
 
-                       $uicols['name'][]               = 'select';
-                       $uicols['descr'][]              = lang('select');
-                       $uicols['sortable'][]   = false;
-                       $uicols['sort_field'][] = '';
-                       $uicols['format'][]             = '';
-                       $uicols['formatter'][]  = 'myFormatterCheck';
-                       $uicols['input_type'][] = '';
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
"{$appname}::{$function_msg}";
 
-                       $j = 0;
-                       $count_uicols_name = count($uicols['name']);
+                       $data = array(
+                               'datatable_name' => $appname,
+                               'form'                   => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array
+                                                               (
+                                                               'type'   => 
'link',
+                                                               'value'  => 
lang('new'),
+                                                               'href'   => 
self::link(array(
+                                                                       
'menuaction' => 'messenger.uimessenger.compose'
+                                                               )),
+                                                               'class'  => 
'new_item'
+                                                       )
+                                               )
+                                       )
+                               ),
+                               'datatable'              => array(
+                                       'source'                 => 
self::link(array(
+                                               'menuaction'             => 
'messenger.uimessenger.index',
+                                               'phpgw_return_as'        => 
'json'
+                                       )),
+                                       'allrows'                => true,
+                                       'editor_action'  => '',
+                                       'field'                  => array(
+                                               array(
+                                                       'key'            => 
'id',
+                                                       'label'          => 
lang('id'),
+                                                       'sortable'       => 
false
+                                               ),
+                                               array(
+                                                       'key'            => 
'status',
+                                                       'label'          => 
lang('status'),
+                                                       'sortable'       => 
false
+                                               ),
+                                               array(
+                                                       'key'            => 
'message_date',
+                                                       'label'          => 
lang('date'),
+                                                       'sortable'       => true
+                                               ),
+                                               array(
+                                                       'key'            => 
'from',
+                                                       'label'          => 
lang('from'),
+                                                       'sortable'       => 
trure
+                                               ),
+                                               array(
+                                                       'key'            => 
'subject',
+                                                       'label'          => 
lang('subject'),
+                                                       'sortable'       => true
+                                               ),
+                                               array(
+                                                       'key'            => 
'select',
+                                                       'label'          => 
lang('select'),
+                                                       'sortable'       => 
false,
+                                                       'formatter'      => 
'JqueryPortico.formatCheckCustom'
+                                               )
+                                       )
+                               )
+                       );
 
-                       foreach($values as $entry)
-                       {
-                               for ($k=0;$k<$count_uicols_name;$k++)
-                               {
-                                       
$datatable['rows']['row'][$j]['column'][$k]['name']                     = 
$uicols['name'][$k];
-                                       
$datatable['rows']['row'][$j]['column'][$k]['value']                    = 
$entry[$uicols['name'][$k]];
-                                       if($uicols['format'][$k]=='link' &&  
$entry[$uicols['name'][$k]])
-                                       {
-                                               
$datatable['rows']['row'][$j]['column'][$k]['format']           = 'link';
-                                               
$datatable['rows']['row'][$j]['column'][$k]['value']            = lang('link');
-                                               
$datatable['rows']['row'][$j]['column'][$k]['link']                     = 
$entry[$uicols['name'][$k]];
-                                       }
-                               }
-                               $j++;
-                       }
-
-                       $datatable['rowactions']['action'] = array();
-
                        $parameters = array
-                       (
-                               'parameter' => array
                                (
-                                       array
+                               'parameter' => array
                                        (
-                                               'name'          => 'id',
-                                               'source'        => 'id'
+                                       array
+                                               (
+                                               'name'   => 'id',
+                                               'source' => 'id'
                                        ),
                                )
                        );
 
                        if($this->acl_edit)
                        {
-                               $datatable['rowactions']['action'][] = array
-                               (
-                                       'my_name'               => 'edit',
-                                       'statustext'    => lang('edit the 
actor'),
-                                       'text'                  => lang('edit'),
-                                       'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
(
-                                                                               
        'menuaction'            => 'messenger.uimessenger.reply'
-                                                                               
)),
-                                       'parameters'    => $parameters
-                               );
-                               $datatable['rowactions']['action'][] = array
-                               (
-                                       'my_name'               => 'edit',
-                                       'text'                  => lang('open 
edit in new window'),
-                                       'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
(
-                                                                               
        'menuaction'            => 'messenger.uimessenger.reply',
-                                                                               
        'target'                        => '_blank'
-                                                                               
)),
-                                       'parameters'    => $parameters
-                               );
-                       }
 
-                       if($this->acl_delete)
-                       {
-                               $datatable['rowactions']['action'][] = array
-                               (
-                                       'my_name'               => 'delete',
-                                       'statustext'    => lang('delete the 
actor'),
-                                       'text'                  => 
lang('delete'),
-                                       'confirm_msg'   => lang('do you really 
want to delete this entry'),
-                                       'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
(
-                                                                               
        'menuaction'    => 'messenger.uimessenger.delete'
-                                                                               
)),
-                                       'parameters'    => $parameters
+                               $data['datatable']['actions'][] = array(
+                                       'my_name'        => 'reply',
+                                       'statustext' => lang('reply'),
+                                       'text'           => lang('reply'),
+                                       'action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.reply'
+                                       )
+                                       ),
+                                       'parameters' => json_encode($parameters)
                                );
                        }
-                       unset($parameters);
 
-                       if($this->acl_add)
+       //              if($this->acl_delete)
                        {
-                               $datatable['rowactions']['action'][] = array
-                               (
-                                       'my_name'                       => 
'add',
-                                       'statustext'    => lang('add'),
-                                       'text'                  => lang('add'),
-                                       'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
(
-                                                                               
        'menuaction'    => 'messenger.uimessenger.compose'
-                                                                               
))
+                               $data['datatable']['actions'][] = array
+                                       (
+                                       'my_name'                => 'delete',
+                                       'statustext'     => lang('Delete'),
+                                       'text'                   => 
lang('Delete'),
+                                       'confirm_msg'    => lang('do you really 
want to delete this entry'),
+                                       'action'                 => 
$GLOBALS['phpgw']->link
+                                       (
+                                       '/index.php', array('menuaction' => 
'messenger.uimessenger.delete'      )
+                                       ),
+                                       'parameters'     => 
json_encode($parameters)
                                );
                        }
 
-                       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']                  = 
$uicols['input_type'][$i]!='hidden';
-                                       
$datatable['headers']['header'][$i]['sortable']                 = 
$uicols['sortable'][$i];
-                                       
$datatable['headers']['header'][$i]['sort_field']       = 
$uicols['sort_field'][$i];
-                       //              
$datatable['headers']['header'][$i]['format']                   = 
$uicols['format'][$i];
-                               }
-                       }
+                       unset($parameters);
 
-                       //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)$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_messages();
-
-                       $appname                        = lang('messenger');
-                       $function_msg           = lang('inbox');
-
-                       if ( ($start == 0) && (!$order))
-                       {
-                               $datatable['sorting']['order']                  
= 'message_date'; // name key Column in myColumnDef
-                               $datatable['sorting']['sort']                   
= 'asc'; // ASC / DESC
-                       }
-                       else
-                       {
-                               $datatable['sorting']['order']                  
= $order; // name of column of Database
-                               $datatable['sorting']['sort']                   
= $sort; // ASC / DESC
-                       }
-
-                       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');
-
-                       //-- BEGIN----------------------------- JSON CODE 
------------------------------
-               //values for Pagination
-                       $json = array
-                       (
-                               '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>";
-                                               }
-                                               elseif(isset($column['format']) 
&& $column['format']== "link")
-                                               {
-                                                 $json_row[$column['name']] = 
"<a href='".$column['link']."'>" .$column['value']."</a>";
-                                               }else
-                                               {
-                                                 $json_row[$column['name']] = 
$column['value'];
-                                               }
-                                       }
-                                       $json['records'][] = $json_row;
-                               }
-                       }
-
-                               // right in datatable
-                               if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
-                               {
-                                       $json ['rights'] = 
$datatable['rowactions']['action'];
-                               }
-
-                               if(isset($receipt) && is_array($receipt) && 
count($receipt))
-                               {
-                                       $json['message'][] = $receipt;
-                               }
-
-                               if( phpgw::get_var('phpgw_return_as') == 'json' 
)
-                               {
-                               return $json;
-                               }
-
-
-                       $datatable['json_data'] = json_encode($json);
-                       //-------------------- JSON CODE ----------------------
-
-                       $template_vars = array();
-                       $template_vars['datatable'] = $datatable;
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars);
-
-               if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
-               {
-                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
-               }
-
-               $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_info']['flags']['app_header'] = 
"{$appname}::{$function_msg}";
-
-                       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'messenger.index', 'messenger' );
+                       self::render_template_xsl('datatable_jquery', $data);
                }
 
 
-
                function inbox()
                {
-                       $start = isset($_REQUEST['start']) ? $_REQUEST['start'] 
: 0;
-                       $order = isset($_REQUEST['order']) ? $_REQUEST['order'] 
: '';
-                       $sort  = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 
'';
-                       $total = $this->bo->total_messages();
+                       $start   = isset($_REQUEST['start']) ? 
$_REQUEST['start'] : 0;
+                       $order   = isset($_REQUEST['order']) ? 
$_REQUEST['order'] : '';
+                       $sort    = isset($_REQUEST['sort']) ? $_REQUEST['sort'] 
: '';
+                       $total   = $this->bo->total_messages();
 
-                       $extra_menuaction = 
'&menuaction=messenger.uimessenger.inbox';
-                       $extra_header_info['nextmatchs_left']  = 
$this->nextmatchs->left('/index.php',$start,$total,$extra_menuaction);
-                       $extra_header_info['nextmatchs_right'] = 
$this->nextmatchs->right('/index.php',$start,$total,$extra_menuaction);
+                       $extra_menuaction                                       
         = '&menuaction=messenger.uimessenger.inbox';
+                       $extra_header_info['nextmatchs_left']    = 
$this->nextmatchs->left('/index.php', $start, $total, $extra_menuaction);
+                       $extra_header_info['nextmatchs_right']   = 
$this->nextmatchs->right('/index.php', $start, $total, $extra_menuaction);
 
                        $this->_display_headers($extra_header_info);
 
-                       $this->template->set_file('_inbox','inbox.tpl');
+                       $this->template->set_file('_inbox', 'inbox.tpl');
                        $this->template->set_block('_inbox', 'row', 'rows');
-                       $this->template->set_block('_inbox','list');
-                       $this->template->set_block('_inbox','row_empty');
+                       $this->template->set_block('_inbox', 'list');
+                       $this->template->set_block('_inbox', 'row_empty');
 
                        $this->_set_common_langs();
-                       $this->template->set_var('sort_date','<a href="' . 
$this->nextmatchs->show_sort_order($sort,'message_date',$order,'/index.php','','&menuaction=messenger.uimessenger.inbox',False)
 . '" class="topsort">' . lang('Date') . '</a>');
-                       $this->template->set_var('sort_subject','<a href="' . 
$this->nextmatchs->show_sort_order($sort,'message_subject',$order,'/index.php','','&menuaction=messenger.uimessenger.inbox',False)
 . '" class="topsort">' . lang('Subject') . '</a>');
-                       $this->template->set_var('sort_from','<a href="' . 
$this->nextmatchs->show_sort_order($sort,'message_from',$order,'/index.php','','&menuaction=messenger.uimessenger.inbox',False)
 . '" class="topsort">' . lang('From') . '</a>');
+                       $this->template->set_var('sort_date', '<a href="' . 
$this->nextmatchs->show_sort_order($sort, 'message_date', $order, '/index.php', 
'', '&menuaction=messenger.uimessenger.inbox', False) . '" class="topsort">' . 
lang('Date') . '</a>');
+                       $this->template->set_var('sort_subject', '<a href="' . 
$this->nextmatchs->show_sort_order($sort, 'message_subject', $order, 
'/index.php', '', '&menuaction=messenger.uimessenger.inbox', False) . '" 
class="topsort">' . lang('Subject') . '</a>');
+                       $this->template->set_var('sort_from', '<a href="' . 
$this->nextmatchs->show_sort_order($sort, 'message_from', $order, '/index.php', 
'', '&menuaction=messenger.uimessenger.inbox', False) . '" class="topsort">' . 
lang('From') . '</a>');
 
-                       $params = array(
-                               'start' => $start,
-                               'order' => $order,
-                               'sort'  => $sort
+                       $params          = array(
+                               'start'  => $start,
+                               'order'  => $order,
+                               'sort'   => $sort
                        );
-                       $messages = $this->bo->read_inbox($params);
+                       $messages        = $this->bo->read_inbox($params);
 
-                       if (! is_array($messages))
+                       if(!is_array($messages))
                        {
-                               $this->template->set_var('lang_empty',lang('You 
have no messages'));
-                               $this->template->fp('rows','row_empty',True);
+                               $this->template->set_var('lang_empty', 
lang('You have no messages'));
+                               $this->template->fp('rows', 'row_empty', True);
                        }
                        else
                        {
-                               
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.delete') ) );
-                               
$this->template->set_var('button_delete','<input type="image" src="' . 
PHPGW_IMAGES . '/delete.gif" name="delete" title="' . lang('Delete selected') . 
'" border="0">');
+                               $this->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/index.php', array(
+                                       'menuaction' => 
'messenger.uimessenger.delete')));
+                               $this->template->set_var('button_delete', 
'<input type="image" src="' . PHPGW_IMAGES . '/delete.gif" name="delete" 
title="' . lang('Delete selected') . '" border="0">');
                                $i = 0;
-                               foreach ( $messages as $message)
+                               foreach($messages as $message)
                                {
                                        $status = $message['status'];
-                                       if ($message['status'] == 'N' || 
$message['status'] == 'O')
+                                       if($message['status'] == 'N' || 
$message['status'] == 'O')
                                        {
                                                $status = '&nbsp;';
                                        }
-       
+
                                        $this->template->set_var(array
-                                       (
-                                               'row_class'             => $i % 
2 ? 'row_on' : 'row_off',
-                                               'row_date'              => 
$message['date'],
-                                               'row_from'              => 
$message['from'],
-                                               'row_msg_id'    => 
$message['id'],
-                                               'row_status'    => $status,
-                                               'row_subject'   => 
$GLOBALS['phpgw']->strip_html($message['subject']),
-                                               'row_url'               => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.read_message', 'message_id' => $message['id']))
+                                               (
+                                               'row_class'              => $i 
% 2 ? 'row_on' : 'row_off',
+                                               'row_date'               => 
$message['date'],
+                                               'row_from'               => 
$message['from'],
+                                               'row_msg_id'     => 
$message['id'],
+                                               'row_status'     => $status,
+                                               'row_subject'    => 
$GLOBALS['phpgw']->strip_html($message['subject']),
+                                               'row_url'                => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.read_message',
+                                                       'message_id' => 
$message['id']))
                                        ));
                                        $this->template->parse('rows', 'row', 
true);
                                        ++$i;
                                }
-
-
                        }
 
-                       $this->template->pfp('out','list');
+                       $this->template->pfp('out', 'list');
                }
 
                function read_message()
                {
-                       $message_id = $_REQUEST['message_id'];
-                       $message = $this->bo->read_message($message_id);
+                       $message_id      = $_REQUEST['message_id'];
+                       $message         = $this->bo->read_message($message_id);
 
                        $this->_display_headers();
                        $this->_set_compose_read_blocks();
                        $this->_set_common_langs();
 
-                       $this->template->set_var('header_message',lang('Read 
message'));
+                       $this->template->set_var('header_message', lang('Read 
message'));
 
                        $this->template->set_var('value_from', 
$message['from']);
                        $this->template->set_var('value_subject', 
$GLOBALS['phpgw']->strip_html($message['subject']));
                        $this->template->set_var('value_date', 
$message['date']);
                        $this->template->set_var('value_content', 
nl2br(wordwrap($GLOBALS['phpgw']->strip_html($message['content']), 80)));
 
-                       $this->template->set_var('link_delete','<a href="'
-                                       . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.delete', 'messages[]' => 
$message['id']) )
-                                       . '">' . lang('Delete') . '</a>');
+                       $this->template->set_var('link_delete', '<a href="'
+                       . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.delete',
+                               'messages[]' => $message['id']))
+                       . '">' . lang('Delete') . '</a>');
 
-                       $this->template->set_var('link_reply','<a href="'
-                                       . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.reply', 'message_id' => 
$message['id']) )
-                                       . '">' . lang('Reply') . '</a>');
+                       $this->template->set_var('link_reply', '<a href="'
+                       . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.reply',
+                               'message_id' => $message['id']))
+                       . '">' . lang('Reply') . '</a>');
 
-                       $this->template->set_var('link_forward','<a href="'
-                                       . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.forward', 'message_id' => 
$message['id']) )
-                                       . '">' . lang('Forward') . '</a>');
+                       $this->template->set_var('link_forward', '<a href="'
+                       . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.uimessenger.forward',
+                               'message_id' => $message['id']))
+                       . '">' . lang('Forward') . '</a>');
 
                        switch($message['status'])
                        {
-                               case 'N': 
$this->template->set_var('value_status',lang('New'));         break;
-                               case 'R': 
$this->template->set_var('value_status',lang('Replied'));     break;
-                               case 'F': 
$this->template->set_var('value_status',lang('Forwarded'));   break;
+                               case 'N': 
$this->template->set_var('value_status', lang('New'));break;
+                               case 'R': 
$this->template->set_var('value_status', lang('Replied'));break;
+                               case 'F': 
$this->template->set_var('value_status', lang('Forwarded'));break;
                        }
 
-                       if ( isset($message['global_message']) && 
$message['global_message'] )
+                       if(isset($message['global_message']) && 
$message['global_message'])
                        {
-                               
$this->template->fp('read_buttons','form_read_buttons_for_global');
+                               $this->template->fp('read_buttons', 
'form_read_buttons_for_global');
                        }
                        else
                        {
-                               
$this->template->fp('read_buttons','form_read_buttons');
+                               $this->template->fp('read_buttons', 
'form_read_buttons');
                        }
 
-                       $this->template->fp('date','form_date');
-                       $this->template->fp('from','form_from');
-                       $this->template->pfp('out','form');
+                       $this->template->fp('date', 'form_date');
+                       $this->template->fp('from', 'form_from');
+                       $this->template->pfp('out', 'form');
                }
 
                function reply($errors = '', $message = '')
@@ -720,38 +548,39 @@
 
                        if(is_array($errors))
                        {
-                               $errors  = $errors['errors'];
+                               $errors  = $errors['errors'];
                                $message = $errors['message'];
                        }
 
-                       if (!$message)
+                       if(!$message)
                        {
-                               $message = 
$this->bo->read_message_for_reply($message_id,'RE');
+                               $message = 
$this->bo->read_message_for_reply($message_id, 'RE');
                        }
 
                        $this->_display_headers();
                        $this->_set_compose_read_blocks();
                        $this->_set_common_langs();
-                       $this->template->set_block('_form','form_reply_to');
+                       $this->template->set_block('_form', 'form_reply_to');
 
-                       if (is_array($errors))
+                       if(is_array($errors))
                        {
-                               
$this->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
+                               $this->template->set_var('errors', 
$GLOBALS['phpgw']->common->error_list($errors));
                        }
 
-                       $this->template->set_var('header_message',lang('Reply 
to a message'));
+                       $this->template->set_var('header_message', lang('Reply 
to a message'));
 
-                       
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.bomessenger.reply', 'message_id' => 
$message['id']) ) );
-                       $this->template->set_var('value_to',"<input type= 
'hidden' name='n_message[to]' 
value={$message['from']}>{$message['from_fullname']}");
-                       $this->template->set_var('value_subject','<input 
name="n_message[subject]" value="' .  
$GLOBALS['phpgw']->strip_html(stripslashes($message['subject'])) . '" 
size="30">');
-                       $this->template->set_var('value_content','<textarea 
name="n_message[content]" rows="20" wrap="hard" cols="76">' .  
$GLOBALS['phpgw']->strip_html(stripslashes($message['content'])) . 
'</textarea>');
+                       $this->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/index.php', array(
+                               'menuaction' => 'messenger.bomessenger.reply', 
'message_id' => $message['id'])));
+                       $this->template->set_var('value_to', "<input type= 
'hidden' name='n_message[to]' 
value={$message['from']}>{$message['from_fullname']}");
+                       $this->template->set_var('value_subject', '<input 
name="n_message[subject]" value="' . 
$GLOBALS['phpgw']->strip_html(stripslashes($message['subject'])) . '" 
size="30">');
+                       $this->template->set_var('value_content', '<textarea 
name="n_message[content]" rows="20" wrap="hard" cols="76">' . 
$GLOBALS['phpgw']->strip_html(stripslashes($message['content'])) . 
'</textarea>');
 
-                       $this->template->set_var('button_send','<input 
type="submit" name="send" value="' . lang('Send') . '">');
-                       $this->template->set_var('button_cancel','<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
+                       $this->template->set_var('button_send', '<input 
type="submit" name="send" value="' . lang('Send') . '">');
+                       $this->template->set_var('button_cancel', '<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
 
-                       $this->template->fp('to','form_reply_to');
-                       $this->template->fp('buttons','form_buttons');
-                       $this->template->pfp('out','form');
+                       $this->template->fp('to', 'form_reply_to');
+                       $this->template->fp('buttons', 'form_buttons');
+                       $this->template->pfp('out', 'form');
                }
 
                function forward($errors = array(), $message = '')
@@ -760,13 +589,13 @@
 
                        if($errors)
                        {
-                               $errors  = $errors['errors'];
+                               $errors = $errors['errors'];
 //                             $message = $errors['message'];
                        }
 
-                       if (!$message)
+                       if(!$message)
                        {
-                               $message = 
$this->bo->read_message_for_reply($message_id,'FW');
+                               $message = 
$this->bo->read_message_for_reply($message_id, 'FW');
                        }
 
                        $this->_display_headers();
@@ -774,55 +603,58 @@
                        $this->_set_common_langs();
 
                        $users = $this->bo->get_available_users();
-                       foreach ( $users as $uid => $name )
+                       foreach($users as $uid => $name)
                        {
                                $this->template->set_var(array
-                               (
-                                       'uid'           => $uid,
-                                       'full_name'     => $name
+                                       (
+                                       'uid'            => $uid,
+                                       'full_name'      => $name
                                ));
                                $this->template->parse('select_tos', 
'select_to', true);
                        }
 
 
-                       if ($errors)
+                       if($errors)
                        {
-                               
$this->template->set_var('errors',$GLOBALS['phpgw']->common->error_list($errors));
+                               $this->template->set_var('errors', 
$GLOBALS['phpgw']->common->error_list($errors));
                        }
 
-                       $this->template->set_var('header_message',lang('Forward 
a message'));
+                       $this->template->set_var('header_message', 
lang('Forward a message'));
 
-                       
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'messenger.bomessenger.forward', 'message_id' => 
$message['id']) ) );
-                       $this->template->set_var('value_to','<input 
name="message[to]" value="' . $message['from'] . '" size="30">');
-                       $this->template->set_var('value_subject','<input 
name="message[subject]" value="' .  
$GLOBALS['phpgw']->strip_html(stripslashes($message['subject'])) . '" 
size="30">');
-                       $this->template->set_var('value_content','<textarea 
name="message[content]" rows="20" wrap="hard" cols="76">' .  
$GLOBALS['phpgw']->strip_html(stripslashes($message['content'])) . 
'</textarea>');
+                       $this->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/index.php', array(
+                               'menuaction' => 
'messenger.bomessenger.forward', 'message_id' => $message['id'])));
+                       $this->template->set_var('value_to', '<input 
name="message[to]" value="' . $message['from'] . '" size="30">');
+                       $this->template->set_var('value_subject', '<input 
name="message[subject]" value="' . 
$GLOBALS['phpgw']->strip_html(stripslashes($message['subject'])) . '" 
size="30">');
+                       $this->template->set_var('value_content', '<textarea 
name="message[content]" rows="20" wrap="hard" cols="76">' . 
$GLOBALS['phpgw']->strip_html(stripslashes($message['content'])) . 
'</textarea>');
 
-                       $this->template->set_var('button_send','<input 
type="submit" name="send" value="' . lang('Send') . '">');
-                       $this->template->set_var('button_cancel','<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
+                       $this->template->set_var('button_send', '<input 
type="submit" name="send" value="' . lang('Send') . '">');
+                       $this->template->set_var('button_cancel', '<input 
type="submit" name="cancel" value="' . lang('Cancel') . '">');
 
-                       $this->template->fp('to','form_to');
-                       $this->template->fp('buttons','form_buttons');
-                       $this->template->pfp('out','form');
+                       $this->template->fp('to', 'form_to');
+                       $this->template->fp('buttons', 'form_buttons');
+                       $this->template->pfp('out', 'form');
                }
 
                function _display_headers($extras = '')
                {
-                       $this->template->set_file('_header','header.tpl');
-                       $this->template->set_block('_header','global_header');
-                       $this->template->set_var('lang_inbox','<a href="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.inbox') ) . '">' . lang('Inbox') . '</a>');
-                       $this->template->set_var('lang_compose','<a href="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'messenger.uimessenger.compose') ) . '">' . lang('Compose') . '</a>');
+                       $this->template->set_file('_header', 'header.tpl');
+                       $this->template->set_block('_header', 'global_header');
+                       $this->template->set_var('lang_inbox', '<a href="' . 
$GLOBALS['phpgw']->link('/index.php', array(
+                               'menuaction' => 'messenger.uimessenger.inbox')) 
. '">' . lang('Inbox') . '</a>');
+                       $this->template->set_var('lang_compose', '<a href="' . 
$GLOBALS['phpgw']->link('/index.php', array(
+                               'menuaction' => 
'messenger.uimessenger.compose')) . '">' . lang('Compose') . '</a>');
 
-                       if ( isset($extras['nextmatchs_left']) && 
$extras['nextmatchs_left'] )
+                       if(isset($extras['nextmatchs_left']) && 
$extras['nextmatchs_left'])
                        {
-                               
$this->template->set_var('nextmatchs_left',$extras['nextmatchs_left']);
+                               $this->template->set_var('nextmatchs_left', 
$extras['nextmatchs_left']);
                        }
 
-                       if ( isset($extras['nextmatchs_right']) && 
$extras['nextmatchs_right'] )
+                       if(isset($extras['nextmatchs_right']) && 
$extras['nextmatchs_right'])
                        {
-                               
$this->template->set_var('nextmatchs_right',$extras['nextmatchs_right']);
+                               $this->template->set_var('nextmatchs_right', 
$extras['nextmatchs_right']);
                        }
 
-                       $this->template->fp('app_header','global_header');
+                       $this->template->fp('app_header', 'global_header');
 
                        $GLOBALS['phpgw']->common->phpgw_header(true);
                }
@@ -830,30 +662,30 @@
                function _error_not_connected()
                {
                        $this->_display_headers();
-                       die( lang('exiting with error!') . "<br />\n" . 
lang('Unable to connect to server, please contact your system administrator') );
+                       die(lang('exiting with error!') . "<br />\n" . 
lang('Unable to connect to server, please contact your system administrator'));
                }
-               
+
                function _set_common_langs()
                {
-                       $this->template->set_var('lang_to',lang('Send message 
to'));
-                       $this->template->set_var('lang_from',lang('Message 
from'));
-                       
$this->template->set_var('lang_subject',lang('Subject'));
-                       
$this->template->set_var('lang_content',lang('Message'));
-                       $this->template->set_var('lang_date',lang('Date'));
+                       $this->template->set_var('lang_to', lang('Send message 
to'));
+                       $this->template->set_var('lang_from', lang('Message 
from'));
+                       $this->template->set_var('lang_subject', 
lang('Subject'));
+                       $this->template->set_var('lang_content', 
lang('Message'));
+                       $this->template->set_var('lang_date', lang('Date'));
                }
 
                function _set_compose_read_blocks()
                {
-                       $this->template->set_file('_form','form.tpl');
+                       $this->template->set_file('_form', 'form.tpl');
 
-                       $this->template->set_block('_form','form');
-                       $this->template->set_block('_form','select_to', 
'select_tos');
-                       $this->template->set_block('_form','form_to');
-                       $this->template->set_block('_form','form_date');
-                       $this->template->set_block('_form','form_from');
-                       $this->template->set_block('_form','form_buttons');
-                       $this->template->set_block('_form','form_read_buttons');
-                       
$this->template->set_block('_form','form_read_buttons_for_global');
+                       $this->template->set_block('_form', 'form');
+                       $this->template->set_block('_form', 'select_to', 
'select_tos');
+                       $this->template->set_block('_form', 'form_to');
+                       $this->template->set_block('_form', 'form_date');
+                       $this->template->set_block('_form', 'form_from');
+                       $this->template->set_block('_form', 'form_buttons');
+                       $this->template->set_block('_form', 
'form_read_buttons');
+                       $this->template->set_block('_form', 
'form_read_buttons_for_global');
                }
 
                function _no_access($location)
@@ -861,10 +693,10 @@
                        $GLOBALS['phpgw']->common->phpgw_header(true);
 
                        $log_args = array
-                       (
-                               'severity'      => 'W',
-                               'text'          => 'W-Permissions, Attempted to 
access %1',
-                               'p1'            => 
"{$GLOBALS['phpgw_info']['flags']['currentapp']}::{$location}"
+                               (
+                               'severity'       => 'W',
+                               'text'           => 'W-Permissions, Attempted 
to access %1',
+                               'p1'             => 
"{$GLOBALS['phpgw_info']['flags']['currentapp']}::{$location}"
                        );
 
                        $GLOBALS['phpgw']->log->warn($log_args);
@@ -875,4 +707,4 @@
 HTML;
                        $GLOBALS['phpgw']->common->phpgw_exit(True);
                }
-       }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind/property/inc/class.boadmin_entity.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.boadmin_entity.inc.php   
2015-12-11 12:15:30 UTC (rev 14572)
+++ branches/dev-syncromind/property/inc/class.boadmin_entity.inc.php   
2015-12-11 12:16:51 UTC (rev 14573)
@@ -304,8 +304,8 @@
                        $template_entity_id      = $template_info[0];
                        $template_cat_id         = $template_info[1];
 
-                       $attrib_group_list = 
$this->read_attrib_group(array('entity_id' => $template_entity_id,
-                               'cat_id' => $template_cat_id, 'allrows' => 
true));
+                       $attrib_group_list = 
$this->read_attrib_group(array('entity_id'  => $template_entity_id,
+                               'cat_id'         => $template_cat_id, 'allrows' 
 => true));
 
                        foreach($attrib_group_list as $attrib_group)
                        {
@@ -320,8 +320,8 @@
                                $this->custom->add_group($group);
                        }
 
-                       $attrib_list = $this->read_attrib(array('entity_id' => 
$template_entity_id, 'cat_id' => $template_cat_id,
-                               'allrows' => true));
+                       $attrib_list = $this->read_attrib(array('entity_id'     
 => $template_entity_id, 'cat_id'        => $template_cat_id,
+                               'allrows'        => true));
 
                        $template_attribs = array();
                        foreach($attrib_list as $attrib)
@@ -386,8 +386,8 @@
 
                function get_attrib_group_list($entity_id, $cat_id, $selected)
                {
-                       $group_list = 
$this->read_attrib_group(array('entity_id' => $entity_id, 'cat_id' => $cat_id,
-                               'allrows' => true));
+                       $group_list = 
$this->read_attrib_group(array('entity_id'         => $entity_id, 'cat_id'      
   => $cat_id,
+                               'allrows'        => true));
 
                        foreach($group_list as &$group)
                        {
@@ -523,21 +523,23 @@
                        }
                }
 
-               function read_custom_function($entity_id = '', $cat_id = '', 
$allrows = '', $acl_location = '')
+               function read_custom_function($data = array())
                {
-                       if($allrows)
+
+                       if(!$data['location'] && $data['entity_id'] && 
$data['cat_id'])
                        {
-                               $this->allrows = $allrows;
+                               $data['location'] = 
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}";
                        }
 
-                       if(!$acl_location && $entity_id && $cat_id)
+                       $data['appname'] = $this->type_app[$this->type];
+                       switch($data['order'])
                        {
-                               $acl_location = 
".{$this->type}.{$entity_id}.{$cat_id}";
+                               case'sorting';
+                                       $data['order'] = 'custom_sort';
+                                       break;
                        }
 
-                       $values = 
$GLOBALS['phpgw']->custom_functions->find(array('start'                => 
$this->start,
-                               'query'          => $this->query, 'sort'        
         => $this->sort, 'order'                 => $this->order,
-                               'appname'        => 
$this->type_app[$this->type], 'location'     => $acl_location, 'allrows'     => 
$this->allrows));
+                       $values = 
$GLOBALS['phpgw']->custom_functions->find($data);
 
                        $this->total_records = 
$GLOBALS['phpgw']->custom_functions->total_records;
 

Modified: branches/dev-syncromind/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiadmin_entity.inc.php   
2015-12-11 12:15:30 UTC (rev 14572)
+++ branches/dev-syncromind/property/inc/class.uiadmin_entity.inc.php   
2015-12-11 12:16:51 UTC (rev 14573)
@@ -26,8 +26,6 @@
         * @subpackage admin
         * @version $Id$
         */
-       #phpgw::import_class('phpgwapi.yui');
-
        /**
         * Description
         * @package property
@@ -270,6 +268,7 @@
                                        break;
                                case 'list_attribute':
                                case 'list_attribute_group':
+                               case 'list_custom_function':
                                        $entity_id       = $data['entity_id'];
                                        $cat_id          = $data['cat_id'];
                                        break;
@@ -302,6 +301,9 @@
                                case 'list_attribute_group':
                                        $values  = 
$this->bo->read_attrib_group($params);
                                        break;
+                               case 'list_custom_function':
+                                       $values  = 
$this->bo->read_custom_function($params);
+                                       break;
                                default:
                                        $values  = $this->bo->read($params);
                                        break;
@@ -343,6 +345,16 @@
                                        );
                                        array_walk($result_data['results'], 
array($this, '_add_links'), $variable);
                                        break;
+                               case 'list_custom_function':
+                                       $variable        = array(
+                                               'menuaction' => 
'property.uiadmin_entity.list_custom_function',
+                                               'entity_id'      => $entity_id,
+                                               'cat_id'         => $cat_id,
+                                               'allrows'        => 
$this->allrows,
+                                               'type'           => $this->type
+                                       );
+                                       array_walk($result_data['results'], 
array($this, '_add_links'), $variable);
+                                       break;
                        }
                        return $this->jquery_results($result_data);
                }
@@ -939,13 +951,15 @@
 
 
                        $myColumnDefs = array(
-                               array('key' => 'attrib_id', 'label' => 
lang('id'), 'sortable' => false, 'resizeable' => true,
-                                       'hidden' => false),
+                               array('key'              => 'attrib_id', 
'label'                 => lang('id'), 'sortable'       => false,
+                                       'resizeable' => true,
+                                       'hidden'         => false),
                                array('key' => 'name', 'label' => lang('name'), 
'sortable' => false, 'resizeable' => true),
-                               array('key' => 'datatype', 'label' => 
lang('datatype'), 'sortable' => false,
+                               array('key'              => 'datatype', 'label' 
         => lang('datatype'), 'sortable'         => false,
                                        'resizeable' => true),
-                               array('key' => 'select', 'label' => 
lang('select'), 'sortable' => false, 'resizeable' => false,
-                                       'formatter' => 'myFormatterCheck', 
'width' => 30)
+                               array('key'              => 'select', 'label'   
         => lang('select'), 'sortable'   => false,
+                                       'resizeable' => false,
+                                       'formatter'      => 'myFormatterCheck', 
'width'          => 30)
                        );
 
                        $datatable_def = array();
@@ -1026,7 +1040,7 @@
                                'value_enable_controller'                       
         => $values['enable_controller'],
                                'jasperupload'                                  
                 => true,
                                'entity_group_list'                             
                 => array('options' => 
execMethod('property.bogeneric.get_list', array(
-                                               'type' => 'entity_group', 
'selected' => $values['entity_group_id'], 'add_empty' => true))),
+                                               'type'           => 
'entity_group', 'selected'   => $values['entity_group_id'], 'add_empty'      => 
true))),
                                'category_list'                                 
                 => $category_list,
                                'parent_list'                                   
                 => $parent_list,
                                'tabs'                                          
                         => phpgwapi_jquery::tabview_generate($tabs, 
$active_tab),
@@ -1062,8 +1076,8 @@
                        $template_entity_id      = $template_info[0];
                        $template_cat_id         = $template_info[1];
 
-                       $attrib_list = $this->bo->read_attrib(array('entity_id' 
=> $template_entity_id,
-                               'cat_id' => $template_cat_id, 'allrows' => 
true));
+                       $attrib_list = $this->bo->read_attrib(array('entity_id' 
 => $template_entity_id,
+                               'cat_id'         => $template_cat_id, 'allrows' 
 => true));
 
                        $content = array();
                        foreach($attrib_list as $_entry)
@@ -2014,171 +2028,135 @@
                {
                        if(!$this->acl_read)
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction'        => 'property.uilocation.stop',
-                                       'perm'                   => 1, 
'acl_location'    => $this->acl_location));
+                               phpgw::no_access();
                        }
 
+
                        $entity_id       = $this->entity_id;
                        $cat_id          = $this->cat_id;
                        $id                      = phpgw::get_var('id', 'int');
                        $resort          = phpgw::get_var('resort');
 
-                       if($resort)
-                       {
-                               $this->bo->resort_custom_function($id, $resort);
-                       }
 
-                       $datatable = array();
+                       $entity          = $this->bo->read_single($entity_id);
+                       $category        = 
$this->bo->read_single_category($entity_id, $cat_id);
 
-                       if(phpgw::get_var('phpgw_return_as') != 'json')
-                       {
-                               $datatable['menu']                              
 = $this->bocommon->get_menu();
-                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                                       (
-                                       'menuaction' => 
'property.uiadmin_entity.list_custom_function',
-                                       'sort'           => $this->sort,
-                                       'order'          => $this->order,
-                                       'query'          => $this->query,
-                                       'entity_id'      => $entity_id,
-                                       'cat_id'         => $cat_id,
-                                       'type'           => $this->type
-                               ));
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::entity_{$entity_id}::entity_{$entity_id}_{$cat_id}";
 
-                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uiadmin_entity.list_custom_function',"
-                               . "sort:'{$this->sort}',"
-                               . "order:'{$this->order}',"
-                               . "query:'{$this->query}',"
-                               . "entity_id:'{$this->entity_id}',"
-                               . "cat_id:'{$this->cat_id}',"
-                               . "type:'{$this->type}'";
 
-                               $datatable['config']['allow_allrows'] = true;
+                       if(phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               if($resort)
+                               {
+                                       $this->bo->resort_custom_function($id, 
$resort);
+                               }
 
-                               $link_data = array
+                               return $this->query(array
                                        (
-                                       'menuaction' => 
'property.uiadmin_entity.list_custom_function',
-                                       'sort'           => $this->sort,
-                                       'order'          => $this->order,
-                                       'query'          => $this->query,
-                                       'entity_id'      => $entity_id,
-                                       'cat_id'         => $cat_id,
-                                       'type'           => $this->type
+                                               'method'         => 
'list_custom_function',
+                                               'entity_id'      => $entity_id,
+                                               'cat_id'         => $cat_id
+                                       )
                                );
+                       }
 
-                               $datatable['actions']['form'] = array(
-                                       array(
-                                               'action' => 
$GLOBALS['phpgw']->link('/index.php', array(
-                                                       'menuaction' => 
'property.uiadmin_entity.list_custom_function',
-                                                       'sort'           => 
$this->sort,
-                                                       'order'          => 
$this->order,
-                                                       'query'          => 
$this->query,
-                                                       'entity_id'      => 
$entity_id,
-                                                       'cat_id'         => 
$cat_id,
-                                                       'type'           => 
$this->type
-                                               )
-                                               ),
-                                               'fields' => array(
-                                                       'field'                 
 => array(
-                                                               array(
-                                                                       'type'  
         => 'button',
-                                                                       'id'    
         => 'btn_done',
-                                                                       'value' 
         => lang('done'),
-                                                                       
'tab_index'      => 1
-                                                               ),
-                                                               array(
-                                                                       'type'  
         => 'button',
-                                                                       'id'    
         => 'btn_new',
-                                                                       'value' 
         => lang('add'),
-                                                                       
'tab_index'      => 2
-                                                               ),
-                                                               array(//boton   
  SEARCH
-                                                                       'id'    
         => 'btn_search',
-                                                                       'name'  
         => 'search',
-                                                                       'value' 
         => lang('search'),
-                                                                       'type'  
         => 'button',
-                                                                       
'tab_index'      => 3
-                                                               ),
-                                                               array(// TEXT 
INPUT
-                                                                       'name'  
         => 'query',
-                                                                       'id'    
         => 'txt_query',
-                                                                       'value' 
         => '', //$query,
-                                                                       'type'  
         => 'text',
-                                                                       
'onkeypress' => 'return pulsar(event)',
-                                                                       'size'  
         => 28,
-                                                                       
'tab_index'      => 4
-                                                               )
+                       self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.jeditable.js');
+                       self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.dataTables.editable.js');
+
+                       $appname                                                
                                 = lang('attribute');
+                       $function_msg                                           
                         = lang('list entity attribute');
+                       $GLOBALS['phpgw_info']['flags']['app_header']    = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+
+                       $data = array(
+                               'datatable_name' => $appname,
+                               'form'                   => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array
+                                                               (
+                                                               'type'   => 
'link',
+                                                               'value'  => 
lang('new'),
+                                                               'href'   => 
self::link(array(
+                                                                       
'menuaction' => 'property.uiadmin_entity.edit_custom_function',
+                                                                       
'entity_id'      => $entity_id,
+                                                                       
'cat_id'         => $cat_id,
+                                                                       'type'  
         => $this->type
+                                                               )),
+                                                               'class'  => 
'new_item'
                                                        ),
-                                                       'hidden_value'   => 
array(
+                                                       array
+                                                               (
+                                                               'type'   => 
'link',
+                                                               'value'  => 
lang('cancel'),
+                                                               'href'   => 
self::link(array
+                                                                       (
+                                                                       
'menuaction' => 'property.uiadmin_entity.category',
+                                                                       
'entity_id'      => $entity_id,
+                                                                       'type'  
         => $this->type
+                                                               )
+                                                               ),
+                                                               'class'  => 
'new_item'
                                                        )
                                                )
                                        )
-                               );
+                               ),
+                               'datatable'              => array(
+                                       'source'                 => 
self::link(array(
+                                               'menuaction'             => 
'property.uiadmin_entity.list_custom_function',
+                                               'entity_id'                     
 => $entity_id,
+                                               'cat_id'                        
 => $cat_id,
+                                               'type'                          
 => $this->type,
+                                               'phpgw_return_as'        => 
'json'
+                                       )),
+                                       'allrows'                => true,
+                                       'editor_action'  => '',
+                                       'field'                  => array(
+                                               array(
+                                                       'key'            => 
'id',
+                                                       'label'          => 
lang('id'),
+                                                       'sortable'       => 
false
+                                               ),
+                                               array(
+                                                       'key'            => 
'descr',
+                                                       'label'          => 
lang('descr'),
+                                                       'sortable'       => 
false
+                                               ),
+                                               array(
+                                                       'key'            => 
'client_side',
+                                                       'label'          => 
lang('client-side'),
+                                                       'sortable'       => 
false
+                                               ),
+                                               array(
+                                                       'key'            => 
'active',
+                                                       'label'          => 
lang('active'),
+                                                       'sortable'       => true
+                                               ),
+                                               array(
+                                                       'key'            => 
'sorting',
+                                                       'label'          => 
lang('sorting'),
+                                                       'sortable'       => true
+                                               ),
+                                               array(
+                                                       'key'            => 
'up',
+                                                       'label'          => 
lang('up'),
+                                                       'sortable'       => 
false,
+                                                       'formatter'      => 
'JqueryPortico.formatLinkGenericLlistAttribute'
+                                               ),
+                                               array(
+                                                       'key'            => 
'down',
+                                                       'label'          => 
lang('down'),
+                                                       'sortable'       => 
false,
+                                                       'formatter'      => 
'JqueryPortico.formatLinkGenericLlistAttribute'
+                                               ),
+                                               array(
+                                                       'key'            => 
'file_name',
+                                                       'label'          => 
lang('file name'),
+                                                       'sortable'       => 
false
+                                               )
+                                       )
+                               )
+                       );
 
-                               //                              $dry_run = true;
-                       }
-
-                       $custom_function_list    = 
$this->bo->read_custom_function($entity_id, $cat_id);
-                       $uicols['name'][0]               = 'name';
-                       $uicols['descr'][0]              = '';//FIXME
-                       $uicols['name'][1]               = 'id';
-                       $uicols['descr'][1]              = lang('id');
-                       $uicols['name'][2]               = 'descr';
-                       $uicols['descr'][2]              = lang('Descr');
-                       $uicols['name'][3]               = 'client_side';
-                       $uicols['descr'][3]              = lang('client-side');
-                       $uicols['name'][4]               = 'active';
-                       $uicols['descr'][4]              = lang('Active');
-                       $uicols['name'][5]               = 'sorting';
-                       $uicols['descr'][5]              = lang('sorting');
-                       $uicols['name'][6]               = 'up';
-                       $uicols['descr'][6]              = lang('up');
-                       $uicols['name'][7]               = 'down';
-                       $uicols['descr'][7]              = lang('down');
-                       $uicols['name'][8]               = 'file_name';
-                       $uicols['descr'][8]              = lang('Name');
-                       $j                                               = 0;
-                       $count_uicols_name               = 
count($uicols['name']);
-
-                       if(isset($custom_function_list) AND 
is_array($custom_function_list))
-                       {
-                               foreach($custom_function_list as $custom_entry)
-                               {
-                                       for($k = 0; $k < $count_uicols_name; 
$k++)
-                                       {
-                                               if($uicols['input_type'][$k] != 
'hidden')
-                                               {
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['name']      = $uicols['name'][$k];
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['value'] = 
$custom_entry[$uicols['name'][$k]];
-                                               }
-
-                                               
if($datatable['rows']['row'][$j]['column'][$k]['name'] == 'up')
-                                               {
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['format']    = 'link';
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['value']     = $uicols['name'][$k];
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['target']    = '_blank';
-                                                       $url                    
                                                                                
 = '"' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin_entity.list_custom_function',
-                                                               'resort'        
 => 'up', 'entity_id'    => $entity_id, 'cat_id'         => $cat_id, 'id'       
         => $custom_entry['id'],
-                                                               'allrows'       
 => $this->allrows, 'type'               => $this->type)) . '"';
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['link']              = 
'move_record(' . $url . ')';
-                                               }
-
-                                               
if($datatable['rows']['row'][$j]['column'][$k]['name'] == 'down')
-                                               {
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['format']    = 'link';
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['value']     = $uicols['name'][$k];
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['target']    = '_blank';
-                                                       $url                    
                                                                                
 = '"' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin_entity.list_custom_function',
-                                                               'resort'        
 => 'down', 'entity_id'  => $entity_id, 'cat_id'         => $cat_id, 'id'       
         => $custom_entry['id'],
-                                                               'allrows'       
 => $this->allrows, 'type'               => $this->type)) . '"';
-                                                       
$datatable['rows']['row'][$j]['column'][$k]['link']              = 
'move_record(' . $url . ')';
-                                               }
-                                       }
-                                       $j++;
-                               }
-                       }
-
-                       $datatable['rowactions']['action'] = array();
-
                        $parameters = array
                                (
                                'parameter' => array
@@ -2203,7 +2181,7 @@
                                )
                        );
 
-                       $datatable['rowactions']['action'][] = array
+                       $data['datatable']['actions'][] = array
                                (
                                'my_name'        => 'edit',
                                'statustext' => lang('Edit'),
@@ -2218,10 +2196,10 @@
                                        'type'           => $this->type
                                )
                                ),
-                               'parameters' => $parameters
+                               'parameters' => json_encode($parameters)
                        );
 
-                       $datatable['rowactions']['action'][] = array
+                       $data['datatable']['actions'][] = array
                                (
                                'my_name'                => 'delete',
                                'statustext'     => lang('Delete'),
@@ -2231,172 +2209,22 @@
                                (
                                '/index.php', array
                                        (
-                                       'menuaction'     => 
'property.uiadmin_entity.delete',
+                                       'menuaction' => 
'property.uiadmin_entity.delete',
                                        'entity_id'              => $entity_id,
                                        'cat_id'                 => $cat_id,
                                        'type'                   => $this->type,
                                        'acl_location'   => 
".{$this->type}.{$entity_id}.{$cat_id}"
                                )
                                ),
-                               'parameters'     => $parameters2
+                               'parameters'     => json_encode($parameters2)
                        );
 
-                       $datatable['rowactions']['action'][] = array(
-                               'my_name'        => 'add',
-                               'statustext' => lang('add'),
-                               'text'           => lang('add'),
-                               'action'         => 
$GLOBALS['phpgw']->link('/index.php', array
-                                       (
-                                       'menuaction' => 
'property.uiadmin_entity.edit_custom_function',
-                                       'entity_id'      => $entity_id,
-                                       'cat_id'         => $cat_id,
-                                       'type'           => $this->type
-                               ))
-                       );
 
+
                        unset($parameters);
                        unset($parameters2);
 
-                       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']  = false;
-                                       /* if($uicols['name'][$i]=='id')
-                                         {
-                                         
$datatable['headers']['header'][$i]['visible']                        = false;
-                                         }
-
-                                         if($uicols['name'][$i]=='name')
-                                         {
-                                         
$datatable['headers']['header'][$i]['sortable']               = true;
-                                         
$datatable['headers']['header'][$i]['sort_field']     = 'name';
-                                         } */
-                               }
-                       }
-
-                       //path for property.js
-                       $property_js = "/property/js/yahoo/property.js";
-
-                       
if(!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) || 
!$GLOBALS['phpgw_info']['server']['no_jscombine'])
-                       {
-                               $cachedir        = 
urlencode($GLOBALS['phpgw_info']['server']['temp_dir']);
-                               $property_js = 
"/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" . 
str_replace('/', '--', ltrim($property_js, '/'));
-                       }
-
-                       $datatable['property_js'] = 
$GLOBALS['phpgw_info']['server']['webserver_url'] . $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($custom_function_list);
-                       $datatable['pagination']['records_total']        = 
$this->bo->total_records;
-
-                       $appname                 = lang('custom function');
-                       $function_msg    = lang('list entity custom function');
-
-                       if((phpgw::get_var("start") == "") && 
(phpgw::get_var("order", 'string') == ""))
-                       {
-                               $datatable['sorting']['order']   = 'name'; // 
name key Column in myColumnDef
-                               $datatable['sorting']['sort']    = 'asc'; // 
ASC / DESC
-                       }
-                       else
-                       {
-                               $datatable['sorting']['order']   = 
phpgw::get_var('order', 'string'); // name of column of Database
-                               $datatable['sorting']['sort']    = 
phpgw::get_var('sort', 'string'); // ASC / DESC
-                       }
-
-                       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');
-
-                       //-- BEGIN----------------------------- JSON CODE 
------------------------------
-                       //values for Pagination
-                       $json = array
-                               (
-                               '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>";
-                                               }
-                                               elseif(isset($column['format']) 
&& $column['format'] == "link")
-                                               {
-                                                       
$json_row[$column['name']] = "<a href='#' onclick='" . $column['link'] . "'>" . 
$column['value'] . "</a>";
-                                               }
-                                               else
-                                               {
-                                                       
$json_row[$column['name']] = $column['value'];
-                                               }
-                                       }
-                                       $json['records'][] = $json_row;
-                               }
-                       }
-
-                       // right in datatable
-                       if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
-                       {
-                               $json ['rights'] = 
$datatable['rowactions']['action'];
-                       }
-
-                       // query parameters
-                       if(isset($current_Consult) && 
is_array($current_Consult))
-                       {
-                               $json ['current_consult'] = $current_Consult;
-                       }
-
-                       if(phpgw::get_var('phpgw_return_as') == 'json')
-                       {
-                               return $json;
-                       }
-
-
-                       $datatable['json_data'] = json_encode($json);
-                       //-------------------- JSON CODE ----------------------
-
-                       $template_vars                           = array();
-                       $template_vars['datatable']      = $datatable;
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
-
-                       if(!isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css))
-                       {
-                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
-                       }
-
-                       $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_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
-                       $GLOBALS['phpgw']->js->validate_file('yahoo', 
'admin_entity.function_group', 'property');
+                       self::render_template_xsl('datatable_jquery', $data);
                }
 
                function edit_custom_function()

Modified: branches/dev-syncromind/registration/inc/class.uipending.inc.php
===================================================================
--- branches/dev-syncromind/registration/inc/class.uipending.inc.php    
2015-12-11 12:15:30 UTC (rev 14572)
+++ branches/dev-syncromind/registration/inc/class.uipending.inc.php    
2015-12-11 12:16:51 UTC (rev 14573)
@@ -26,7 +26,6 @@
        * @version $Id: class.uicheck_list.inc.php 8628 2012-01-21 10:42:05Z 
vator $
        */
 
-       phpgw::import_class('phpgwapi.yui');
        phpgw::import_class('phpgwapi.uicommon');
 
        class registration_uipending extends phpgwapi_uicommon
@@ -81,9 +80,6 @@
                function index()
                {
 
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('paginator');
-
                        if($values = phpgw::get_var('values'))
                        {
                                $values['pending_users'] = 
isset($values['pending_users']) && $values['pending_users'] ? 
array_unique($values['pending_users']) : array();
@@ -187,8 +183,6 @@
                                        )
                                );
                        
-                               phpgwapi_yui::load_widget('paginator');
-
                                self::add_javascript('registration', 'yahoo', 
'pending.index.js');
                                
self::render_template_xsl(array('pending_users'), $data);
                        }       
@@ -205,8 +199,6 @@
                        self::add_javascript('phpgwapi', 'yahoo', 
'datatable.js');
                        self::add_javascript('registration', 'yahoo', 
'pending.index2.js');
 
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('paginator');
 
                        $status_list = array
                        (

Modified: branches/dev-syncromind/rental/inc/class.uicommon.inc.php
===================================================================
--- branches/dev-syncromind/rental/inc/class.uicommon.inc.php   2015-12-11 
12:15:30 UTC (rev 14572)
+++ branches/dev-syncromind/rental/inc/class.uicommon.inc.php   2015-12-11 
12:16:51 UTC (rev 14573)
@@ -1,5 +1,4 @@
 <?php
-       //phpgw::import_class('phpgwapi.yui');
        phpgw::import_class('phpgwapi.uicommon_jquery');
 
        //define("RENTAL_TEMPLATE_PATH", "rental/templates/base/");
@@ -40,24 +39,6 @@
                        parent::__construct();
 
                        self::set_active_menu('rental');
-                       /* 
self::add_stylesheet('phpgwapi/js/yahoo/calendar/assets/skins/sam/calendar.css');
-                         
self::add_stylesheet('phpgwapi/js/yahoo/autocomplete/assets/skins/sam/autocomplete.css');
-                         
self::add_stylesheet('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
-                         
self::add_stylesheet('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
-                         
self::add_stylesheet('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
-                         
self::add_stylesheet('phpgwapi/js/yahoo/treeview/assets/skins/sam/treeview.css');
-                         
self::add_stylesheet('rental/templates/base/css/base.css');
-                         self::add_javascript('rental', 'rental', 'common.js');
-                         $this->tmpl_search_path = array();
-                         array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT 
. '/phpgwapi/templates/base');
-                         array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT 
. '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set']);
-                         array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT 
. '/' . $GLOBALS['phpgw_info']['flags']['currentapp'] . '/templates/base');
-                         /*phpgwapi_yui::load_widget('datatable');
-                         phpgwapi_yui::load_widget('paginator');
-                         phpgwapi_yui::load_widget('menu');
-                         phpgwapi_yui::load_widget('calendar');
-                         phpgwapi_yui::load_widget('autocomplete');
-                         phpgwapi_yui::load_widget('animation'); */
 
                        //$dateFormat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 




reply via email to

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