fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15618] Stable: Merge 15584:15617 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15618] Stable: Merge 15584:15617 from trunk
Date: Thu, 8 Sep 2016 07:43:11 +0000 (UTC)

Revision: 15618
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15618
Author:   sigurdne
Date:     2016-09-08 07:43:11 +0000 (Thu, 08 Sep 2016)
Log Message:
-----------
Stable: Merge 15584:15617 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/admin/inc/class.boaccounts.inc.php
    branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php
    branches/Version-2_0-branch/admin/inc/class.uiapplications.inc.php
    branches/Version-2_0-branch/admin/js/base/groups.js
    branches/Version-2_0-branch/admin/setup/phpgw_no.lang
    branches/Version-2_0-branch/admin/templates/base/groups.xsl
    branches/Version-2_0-branch/booking/js/booking/schedule.js
    branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js
    branches/Version-2_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php
    branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js
    branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang
    branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_.inc.php
    branches/Version-2_0-branch/phpgwapi/inc/class.menu.inc.php
    branches/Version-2_0-branch/property/inc/class.boentity.inc.php
    branches/Version-2_0-branch/property/inc/class.bolocation.inc.php
    branches/Version-2_0-branch/property/inc/class.borequest.inc.php
    branches/Version-2_0-branch/property/inc/class.botts.inc.php
    branches/Version-2_0-branch/property/inc/class.solocation.inc.php
    branches/Version-2_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-2_0-branch/property/inc/class.sotts.inc.php
    branches/Version-2_0-branch/property/inc/class.uigallery.inc.php
    branches/Version-2_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-2_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-2_0-branch/property/inc/class.uitts.inc.php
    branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
    branches/Version-2_0-branch/property/js/portico/tts.view.js
    branches/Version-2_0-branch/property/setup/phpgw_no.lang
    branches/Version-2_0-branch/property/templates/base/entity.xsl
    branches/Version-2_0-branch/property/templates/base/tts.xsl
    branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php
    branches/Version-2_0-branch/rental/inc/model/class.application.inc.php
    branches/Version-2_0-branch/rental/setup/setup.inc.php
    branches/Version-2_0-branch/rental/setup/tables_current.inc.php
    branches/Version-2_0-branch/rental/setup/tables_update.inc.php
    branches/Version-2_0-branch/rental/templates/base/application.xsl

Property Changed:
----------------
    branches/Version-2_0-branch/
    branches/Version-2_0-branch/booking/
    branches/Version-2_0-branch/bookingfrontend/


Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583
   + /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617

Modified: branches/Version-2_0-branch/admin/inc/class.boaccounts.inc.php
===================================================================
--- branches/Version-2_0-branch/admin/inc/class.boaccounts.inc.php      
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/admin/inc/class.boaccounts.inc.php      
2016-09-08 07:43:11 UTC (rev 15618)
@@ -186,13 +186,12 @@
                        if ( !$id ) // add new group?
                        {
                                $new_group->id = $id;
-                               $id = 
$GLOBALS['phpgw']->accounts->create($new_group, $values['account_user'],
+                               $id = 
$GLOBALS['phpgw']->accounts->create($new_group, array(),
                                                                                
                                array(), array_keys($values['account_apps']));
                        }
                        else //edit group
                        {
-                               
$GLOBALS['phpgw']->accounts->update_group($new_group, $values['account_user'],
-                                                                               
                                $values['account_apps']);
+                               
$GLOBALS['phpgw']->accounts->update_group($new_group, $values['account_apps']);
                        }
 
                        //Delete cached menu for members of group

Modified: branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php
===================================================================
--- branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php      
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php      
2016-09-08 07:43:11 UTC (rev 15618)
@@ -27,6 +27,7 @@
         */
 
        phpgw::import_class('phpgwapi.jquery');
+       phpgw::import_class('phpgwapi.uicommon_jquery');
 
        /**
        * phpGroupWare Administration - Accounts User Interface
@@ -39,7 +40,7 @@
        * @subpackage admin
        * @category accounts
        */
-       class admin_uiaccounts
+       class admin_uiaccounts extends phpgwapi_uicommon_jquery
        {
                /**
                 * @var array $public_functions Publicly available methods
@@ -57,7 +58,11 @@
                        'clear_user_cache'                      => true,
                        'clear_cache'                           => true,
                        'global_message'                        => true,
-                        'home_screen_message'                   => true
+                       'home_screen_message'           => true,
+                       'query'                                         => true,
+                       'remove_group_user'                     => true,
+                       'reset_group_users'                     => true,
+                       'add_group_users'                       => true,
                );
 
                /**
@@ -82,6 +87,8 @@
                 */
                public function __construct()
                {
+                       parent::__construct();
+
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::admin';
 
@@ -93,6 +100,159 @@
                                && 
$GLOBALS['phpgw_info']['server']['ldap_extra_attributes'];
                }
 
+               function query( )
+               {
+                       $account_id             = phpgw::get_var('group_id', 
'int');
+
+                       if ( !$account_id
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::EDIT, 'admin')
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::PRIV, 'admin') )
+                       {
+                               return;
+                       }
+
+                       $type = phpgw::get_var('type');
+                       $search = phpgw::get_var('search');
+                       $order = phpgw::get_var('order');
+                       $dir = strtoupper($order[0]['dir']);
+                       $columns = phpgw::get_var('columns');
+                       $results = phpgw::get_var('length', 'int', 'REQUEST', 
0);
+                       $allrows = phpgw::get_var('length', 'int') == -1;
+                       $query = $search['value'];
+                       $start = phpgw::get_var('start', 'int', 'REQUEST', 0);
+
+
+                       switch ($columns[$order[0]['column']]['data'])
+                       {
+                               case 'id':
+                                       $order = 'account_id';
+                                       break;
+                               case 'lid':
+                                       $order = 'account_lid';
+                                       break;
+                               case 'name':
+                                       $order = 'account_lastname';
+                                       break;
+                               default:
+                                       $order = 'account_lastname';
+                                       break;
+                       }
+
+                       $accounts =& $GLOBALS['phpgw']->accounts;
+
+                       $group_members = $accounts->member($account_id);
+
+                       //local application admin
+                       if(!$GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
+                       {
+                               $available_apps = 
$GLOBALS['phpgw_info']['apps'];
+                               $valid_users = array();
+                               foreach($available_apps as $_app => $dummy)
+                               {
+                                       
if($GLOBALS['phpgw']->acl->check('admin', phpgwapi_acl::ADD, $_app))
+                                       {
+                                               $_valid_users   = 
$GLOBALS['phpgw']->acl->get_user_list_right(phpgwapi_acl::READ, 'run', $_app);
+
+                                               foreach($_valid_users as $_user)
+                                               {
+                                                       $valid_users[] = 
$_user['account_id'];
+                                               }
+                                               unset($_user);
+                                               unset($_valid_users);
+                                       }
+                               }
+
+                               $valid_users = array_unique($valid_users);
+
+                               $account_list = 
$GLOBALS['phpgw']->accounts->get_list('accounts', -1,$dir, $order,  $query);
+                               foreach($account_list as  $user)
+                               {
+                                       if(!in_array($user->id, $valid_users))
+                                       {
+                                               unset($account_list[$user->id]);
+                                       }
+                               }
+                               unset($user);
+                       }
+                       else
+                       {
+                               $account_list = $accounts->get_list('accounts', 
-1, $dir, $order, $query);
+                       }
+
+                       $lang_disabled  = lang('disabled');
+                       $lang_enabled   = lang('enabled');
+                       $members = array();
+                       $user_list = array();
+                       foreach ( $account_list as $id => $user )
+                       {
+                               if(isset($group_members[$id]))
+                               {
+                                       $member_list[] = array
+                                       (
+                                               'id'    => $id,
+                                               'lid'   => $user->lid,
+                                               'name'  => $user->__toString(),
+                                               'status'        => 
$user->enabled ? $lang_enabled : $lang_disabled
+                                       );
+                               }
+                               else
+                               {
+                                       $user_list[] = array
+                                       (
+                                               'id'    => $id,
+                                               'lid'   => $user->lid,
+                                               'name'  => $user->__toString(),
+                                               'status'        => 
$user->enabled ? $lang_enabled : $lang_disabled
+                                       );
+                               }
+                       }
+
+                       switch ($type)
+                       {
+                               case 'included_users':
+                                       $values = $member_list;
+                                       break;
+                               case 'not_included_users':
+                                       $values = $user_list;
+                                       break;
+                               default :
+                               $values = array();
+                       }
+
+                       $total_records = count($values);
+                       if (!$allrows)
+                       {
+                               if ($results)
+                               {
+                                       $num_rows = $results;
+                               }
+                               else
+                               {
+                                       $num_rows = 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) ? 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) : 
15;
+                               }
+                               
//_debug_array(array($start,$this->total_records,$this->total_records,$num_rows));
+                               $page = ceil(( $start / $total_records ) * 
($total_records / $num_rows));
+
+                               $out = array_chunk($values, $num_rows);
+
+                               $result_data = array('results' => $out[$page]);
+                       }
+                       else
+                       {
+                               $result_data = array('results' => $values);
+                       }
+
+                       $link_data = array(
+                               'menuaction' => 'admin.uiaccounts.edit_user',
+                       );
+
+                       $result_data['total_records'] = $total_records;
+                       $result_data['draw'] = phpgw::get_var('draw', 'int');
+
+                       array_walk($result_data['results'], array($this, 
'_add_links'), $link_data);
+                       return $this->jquery_results($result_data);
+
+               }
                /**
                 * Render a list of groups
                 *
@@ -574,15 +734,7 @@
                        {
                                $values                 = 
phpgw::get_var('values', 'string', 'POST', array());
                                $account_apps   = 
phpgw::get_var('account_apps', 'string', 'POST');
-                               $account_user   = 
phpgw::get_var('account_user', 'int', 'POST');
 
-                               $values['account_user'] = array();
-                               if (is_array($account_user))
-                               {
-                                       
-                                       $values['account_user'] = $account_user;
-                               }
-
                                $values['account_apps'] = array();
                                if ( is_array($account_apps) && 
count($account_apps) )
                                {
@@ -625,7 +777,7 @@
 
                        $group_members = $accounts->member($account_id);
 
-                       //local application admin
+/*                     //local application admin
                        if(!$GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
                        {
                                $available_apps = 
$GLOBALS['phpgw_info']['apps'];
@@ -683,7 +835,7 @@
                                        );                              
                                }
                        }
-
+*/
                        //FIXME this needs to be provided by the app itself - 
thats why we have hooks
                        $apps_with_acl = array
                        (
@@ -783,7 +935,7 @@
 
                        // this is in the api, so lets not waste loops looking 
for it the app tpl dirs
                        $GLOBALS['phpgw']->xslttpl->add_file('msgbox', 
PHPGW_TEMPLATE_DIR, 3);
-                       $GLOBALS['phpgw']->xslttpl->add_file('groups');
+//                     $GLOBALS['phpgw']->xslttpl->add_file('groups');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] =  
lang('edit group');
                        if ( $account_id )
@@ -793,6 +945,7 @@
 
                        $data = array
                        (
+                               'datatable_def'         => 
$this->_get_tableDef_user('edit', $account_id),
                                'page_title'            => $account_id ? 
lang('edit group') : lang('add group'),
                                'account_id'            => $account_id,
                                'app_list'                      => $app_list,
@@ -801,8 +954,8 @@
                                                                                
        'menuaction' => 'admin.uiaccounts.edit_group',
                                                                                
        'account_id' => $account_id
                                                                                
)),
-                               'guser_list'            => $user_list,
-                               'member_list'           => $member_list,
+//                             'guser_list'            => $user_list,
+//                             'member_list'           => $member_list,
                                'img_close'                     => 
$GLOBALS['phpgw']->common->image('phpgwapi', 'stock_close', '.png', false),
                                'img_save'                      => 
$GLOBALS['phpgw']->common->image('phpgwapi', 'stock_save', '.png', false),
                                'lang_cancel'           => lang('cancel'),
@@ -814,9 +967,216 @@
                                'tabs'                          => 
phpgwapi_jquery::tabview_generate($tabs, 'data','group_edit_tabview')
                        );
 
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('group_edit' => $data));
+                       self::render_template_xsl(array('groups', 
'datatable_inline'), array('group_edit' => $data));
                }
 
+               function remove_group_user(  )
+               {
+                       $group_id               = phpgw::get_var('group_id', 
'int');
+                       $account_user   = (array)phpgw::get_var('account_user', 
'int');
+
+                       if ( !$group_id
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::EDIT, 'admin')
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::PRIV, 'admin') )
+                       {
+                               return array('error' => 'error');
+                       }
+
+                       $acl = createObject('phpgwapi.acl', $group_id);
+                       $is_admin_group = $acl->check('run', 
phpgwapi_acl::READ, 'admin');
+                       $current_user = 
$GLOBALS['phpgw_info']['user']['account_id'];
+
+                       if($group_id && isset($_POST['account_user']))
+                       {
+                               foreach ($account_user as $user_id)
+                               {
+                                       //Don't lock your self out
+                                       if($is_admin_group && ($current_user == 
$user_id))
+                                       {
+                                               continue;
+                                       }
+                                       
$GLOBALS['phpgw']->accounts->delete_account4group($user_id, $group_id);
+                                       //Delete cached menu for members of 
group
+                                       phpgwapi_cache::user_clear('phpgwapi', 
'menu', $user_id);
+                               }
+                               return array('message' => 'OK');
+                       }
+               }
+
+               function reset_group_users(  )
+               {
+                       $group_id               = phpgw::get_var('group_id', 
'int');
+                       $account_user   = array();
+
+                       if ( !$group_id
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::EDIT, 'admin')
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::PRIV, 'admin') )
+                       {
+                               return array('error' => 'error');
+                       }
+
+                       $acl = createObject('phpgwapi.acl', $group_id);
+                       $is_admin_group = $acl->check('run', 
phpgwapi_acl::READ, 'admin');
+                       $current_user = 
$GLOBALS['phpgw_info']['user']['account_id'];
+
+                       if($group_id && isset($_POST))
+                       {
+                               $members = 
$GLOBALS['phpgw']->accounts->member($group_id);
+                               foreach($members as $entry)
+                               {
+                                       //Don't lock your self out
+                                       if($is_admin_group && ($current_user == 
$entry['account_id']))
+                                       {
+                                               continue;
+                                       }
+                                       
$GLOBALS['phpgw']->accounts->delete_account4group($entry['account_id'], 
$group_id);
+                                       //Delete cached menu for members of 
group
+                                       phpgwapi_cache::user_clear('phpgwapi', 
'menu', $entry['account_id']);
+                               }
+                               return array('message' => 'OK');
+                       }
+               }
+
+               function add_group_users(  )
+               {
+                       $group_id               = phpgw::get_var('group_id', 
'int');
+                       $account_user   = (array)phpgw::get_var('account_user', 
'int');
+
+                       if ( !$group_id
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::EDIT, 'admin')
+                               && 
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::PRIV, 'admin') )
+                       {
+                               return array('error' => 'error');
+                       }
+
+                       if($group_id && isset($_POST['account_user']))
+                       {
+                               foreach ($account_user as $user_id)
+                               {
+                                       
$GLOBALS['phpgw']->accounts->add_user2group($user_id, $group_id);
+                                       //Delete cached menu for members of 
group
+                                       phpgwapi_cache::user_clear('phpgwapi', 
'menu', $user_id);
+                               }
+                               return array('message' => 'OK');
+                       }
+               }
+
+               private function _get_tableDef_user( $mode, $group_id )
+               {
+                       $columns_def = array(
+                               array('key' => 'id', 'label' => 'ID', 
'className' => '','sortable' => true, 'hidden' => false,'formatter' => 
'JqueryPortico.formatLink'),
+                               array('key' => 'lid', 'label' => 
lang('loginid'), 'className' => '', 'sortable' => true,'hidden' => false),
+                               array('key' => 'name', 'label' => lang('name'), 
'className' => '', 'sortable' => true,'hidden' => false),
+                               array('key' => 'status', 'label' => 'Status', 
'className' => '', 'sortable' => false,'hidden' => false),
+                       );
+
+
+                       if ($mode == 'edit')
+                       {
+                               $tabletools_user1 = array(
+                                       array('my_name' => 'select_all'),
+                                       array('my_name' => 'select_none')
+                               );
+                               $tabletools_user1[] = array
+                                       (
+                                       'my_name' => 'remove',
+                                       'text' => lang('remove'),
+                                       'type' => 'custom',
+                                       'custom_code' => "
+                                               var oArgs = " . 
json_encode(array(
+                                               'menuaction' => 
'admin.uiaccounts.remove_group_user',
+                                               'group_id' => $group_id,
+                                               'phpgw_return_as' => 'json'
+                                       )) . ";
+                                               var parameters = " . 
json_encode(array('parameter' => array(array('name' => 'account_user',
+                                                               'source' => 
'id')))) . ";
+                                               removeUser(oArgs, parameters);
+                                       "
+                               );
+
+                               $tabletools_user1[] = array
+                                       (
+                                       'my_name' => 'reset',
+                                       'text' => lang('reset'),
+                                       'type' => 'custom',
+                                       'custom_code' => "
+                                               var oArgs = " . 
json_encode(array(
+                                               'menuaction' => 
'admin.uiaccounts.reset_group_users',
+                                               'group_id' => $group_id,
+                                               'phpgw_return_as' => 'json'
+                                       )) . ";
+                                               var parameters = " . 
json_encode(array('parameter' => array(array('name' => 'account_user',
+                                                               'source' => 
'id')))) . ";
+                                               removeUser(oArgs, parameters);
+                                       "
+                               );
+
+                               $datatable_def[] = array
+                                       (
+                                       'container' => 'datatable-container_1',
+                                       'requestUrl' => 
json_encode(self::link(array('menuaction' => 'admin.uiaccounts.query',
+                                               'type' => 'included_users', 
'group_id' => $group_id,
+                                               'phpgw_return_as' => 'json'))),
+                                       'data' => json_encode(array()),
+                                       'ColumnDefs' => $columns_def,
+                                       'tabletools' => $tabletools_user1,
+                                       'config' => array(
+                       //                      array('disableFilter' => true),
+                                       )
+                               );
+
+                               $tabletools_user2 = array(
+                                       array('my_name' => 'select_all'),
+                                       array('my_name' => 'select_none')
+                               );
+                               $tabletools_user2[] = array
+                                       (
+                                       'my_name' => 'add',
+                                       'text' => lang('add'),
+                                       'type' => 'custom',
+                                       'custom_code' => "
+                                               var oArgs = " . 
json_encode(array(
+                                               'menuaction' => 
'admin.uiaccounts.add_group_users',
+                                               'group_id' => $group_id,
+                                               'phpgw_return_as' => 'json'
+                                       )) . ";
+                                               var parameters = " . 
json_encode(array('parameter' => array(array('name' => 'account_user',
+                                                               'source' => 
'id')))) . ";
+                                               addUser(oArgs, parameters);
+                                       "
+                               );
+
+                               $datatable_def[] = array
+                                       (
+                                       'container' => 'datatable-container_2',
+                                       'requestUrl' => 
json_encode(self::link(array('menuaction' => 'admin.uiaccounts.query',
+                                               'type' => 'not_included_users', 
'group_id' => $group_id,
+                                               'phpgw_return_as' => 'json'))),
+                                       'data' => json_encode(array()),
+                                       'ColumnDefs' => $columns_def,
+                                       'tabletools' => $tabletools_user2,
+                                       'config' => array(
+                       //                      array('disableFilter' => true)
+                                       )
+                               );
+                       }
+                       else
+                       {
+                               $datatable_def[] = array
+                                       (
+                                       'container' => 'datatable-container_1',
+                                       'requestUrl' => "''",
+                                       'data' => json_encode(array()),
+                                       'ColumnDefs' => $columns_def,
+                                       'config' => array(
+                       //                      array('disableFilter' => true)
+                                       )
+                               );
+                       }
+
+                       return $datatable_def;
+               }
+
                /**
                 * Render a form for editing a user account
                 *
@@ -840,6 +1200,8 @@
                        }
 
                        $account_id = phpgw::get_var('account_id', 'int');
+                       $id = phpgw::get_var('id', 'int');
+                       $account_id = $account_id ? $account_id : $id;
                        if ( $account_id )
                        {
                                $user = 
$GLOBALS['phpgw']->accounts->get($account_id);

Modified: branches/Version-2_0-branch/admin/inc/class.uiapplications.inc.php
===================================================================
--- branches/Version-2_0-branch/admin/inc/class.uiapplications.inc.php  
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/admin/inc/class.uiapplications.inc.php  
2016-09-08 07:43:11 UTC (rev 15618)
@@ -42,7 +42,7 @@
                        
$GLOBALS['phpgw']->template->set_block('applications','list','list');
                        
$GLOBALS['phpgw']->template->set_block('applications','row','row');
 
-                       $start  = phpgw::get_var('start', 'int', 'POST');
+                       $start  = phpgw::get_var('start', 'int', 'GET');
                        $sort   = phpgw::get_var('sort', 'string', 'GET');
                        $order  = phpgw::get_var('order', 'string', 'GET');
                        $offset = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];

Modified: branches/Version-2_0-branch/admin/js/base/groups.js
===================================================================
--- branches/Version-2_0-branch/admin/js/base/groups.js 2016-09-08 07:39:49 UTC 
(rev 15617)
+++ branches/Version-2_0-branch/admin/js/base/groups.js 2016-09-08 07:43:11 UTC 
(rev 15618)
@@ -1,25 +1,93 @@
-/** Written by & (c) Dave Hall 2006 **/
-function updateManager()
+
+get_user_data = function ()
 {
-       var manager = document.getElementById('group_manager');
-       var curManagerVal = manager.options[manager.selectedIndex].value;
-       while ( manager.childNodes.length )
+       if (set_user_data === 0)
        {
-               manager.removeChild(manager.firstChild);
+               oTable1.dataTableSettings[1]['oFeatures']['bServerSide'] = true;
+               JqueryPortico.updateinlineTableHelper(oTable1, 
link_included_user_items);
+
+               oTable2.dataTableSettings[2]['oFeatures']['bServerSide'] = true;
+               oTable2.dataTableSettings[2]['ajax'] = {url: 
link_not_included_user_items, data: {}, type: 'GET'};
+               JqueryPortico.updateinlineTableHelper(oTable2);
+
+               set_user_data = 1;
        }
-       
-       var users = document.getElementById('account_user');
-       var userOption;
-       for ( i=0; i < users.options.length; ++i )
+};
+
+getRequestData = function (dataSelected, parameters)
+{
+
+       var data = {};
+
+       $.each(parameters.parameter, function (i, val)
        {
-               if ( users.options[i].selected )
+               data[val.name] = {};
+       });
+
+       var n = 0;
+       for (var n = 0; n < dataSelected.length; ++n)
+       {
+               $.each(parameters.parameter, function (i, val)
                {
-                       userOption = users.options[i].cloneNode(true);
-                       if ( userOption.value != curManagerVal )
-                       {
-                               userOption.selected = false;
-                       }
-                       manager.appendChild(userOption);
-               }
+                       data[val.name][n] = dataSelected[n][val.source];
+               });
        }
-}
+
+       return data;
+};
+
+
+addUser = function (oArgs, parameters)
+{
+
+       var api = $('#datatable-container_2').dataTable().api();
+       var selected = api.rows({selected: true}).data();
+       var nTable = 1;
+
+       if (selected.length == 0)
+       {
+               alert('None selected');
+               return false;
+       }
+
+       var data = getRequestData(selected, parameters);
+       var requestUrl = phpGWLink('index.php', oArgs);
+
+       JqueryPortico.execute_ajax(requestUrl, function (result)
+       {
+
+       //      JqueryPortico.show_message(nTable, result);
+
+               oTable1.fnDraw();
+               oTable2.fnDraw();
+
+       }, data, 'POST', 'JSON');
+};
+
+removeUser = function (oArgs, parameters)
+{
+
+       var api = $('#datatable-container_1').dataTable().api();
+       var selected = api.rows({selected: true}).data();
+       var nTable = 1;
+
+       if (selected.length == 0)
+       {
+               alert('None selected');
+               return false;
+       }
+
+       var data = getRequestData(selected, parameters);
+       var requestUrl = phpGWLink('index.php', oArgs);
+
+       JqueryPortico.execute_ajax(requestUrl, function (result)
+       {
+
+//             JqueryPortico.show_message(nTable, result);
+
+               oTable1.fnDraw();
+               oTable2.fnDraw();
+
+       }, data, 'POST', 'JSON');
+};
+

Modified: branches/Version-2_0-branch/admin/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/admin/setup/phpgw_no.lang       2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/admin/setup/phpgw_no.lang       2016-09-08 
07:43:11 UTC (rev 15618)
@@ -39,3 +39,4 @@
 home screen message    admin   no      Melding på hjemmeskjerm
 title  admin   no      Overskrift
 important message      admin   no      Viktig informasjon
+enabled        admin   no      Aktiv
\ No newline at end of file

Modified: branches/Version-2_0-branch/admin/templates/base/groups.xsl
===================================================================
--- branches/Version-2_0-branch/admin/templates/base/groups.xsl 2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/admin/templates/base/groups.xsl 2016-09-08 
07:43:11 UTC (rev 15618)
@@ -1,239 +1,303 @@
 <!-- $Id$ -->
+<xsl:template match="data">
+       <xsl:choose>
+               <xsl:when test="group_edit">
+                       <xsl:apply-templates select="group_edit"/>
+               </xsl:when>
+               <xsl:when test="group_list">
+                       <xsl:apply-templates select="group_list"/>
+               </xsl:when>
+       </xsl:choose>
+       <xsl:call-template name="jquery_phpgw_i18n"/>
+</xsl:template>
 
-       <xsl:template name="groups">
-               <xsl:choose>
-                       <xsl:when test="group_list">
-                               <xsl:apply-templates select="group_list"/>
-                       </xsl:when>
-                       <xsl:when test="group_edit">
-                               <xsl:apply-templates select="group_edit"/>
-                       </xsl:when>
-               </xsl:choose>
-       </xsl:template>
 
 <!-- BEGIN group_list -->
 
-       <xsl:template match="group_list">
-               <div id="admin_group_list">
-                       <xsl:if test="search_access = 1">
-                               <div class="search">
-                                       <xsl:call-template name="search_field"/>
-                               </div>
-                       </xsl:if>
-
-                       <div>
-                               <xsl:call-template name="nextmatchs"/>
+<xsl:template match="group_list">
+       <div id="admin_group_list">
+               <xsl:if test="search_access = 1">
+                       <div class="search">
+                               <xsl:call-template name="search_field"/>
                        </div>
+               </xsl:if>
 
-                       <table class="pure-table pure-table-bordered" 
border="0" cellspacing="2" cellpadding="2">
-                               <thead>
-                                       <xsl:apply-templates 
select="group_header"/>
-                               </thead>
-                               <tbody>
-                                       <xsl:apply-templates 
select="group_data"/>
-                               </tbody>
-                       </table>
-                       <xsl:apply-templates select="group_add"/>
+               <div>
+                       <xsl:call-template name="nextmatchs"/>
                </div>
-       </xsl:template>
 
+               <table class="pure-table pure-table-bordered" border="0" 
cellspacing="2" cellpadding="2">
+                       <thead>
+                               <xsl:apply-templates select="group_header"/>
+                       </thead>
+                       <tbody>
+                               <xsl:apply-templates select="group_data"/>
+                       </tbody>
+               </table>
+               <xsl:apply-templates select="group_add"/>
+       </div>
+</xsl:template>
+
 <!-- BEGIN group_header -->
 
-       <xsl:template match="group_header">
-               <tr>
-                       <th><a href="{sort_name}"><xsl:value-of 
select="lang_name"/></a></th>
-                       <th><xsl:value-of select="lang_edit"/></th>
-                       <th><xsl:value-of select="lang_delete"/></th>
-               </tr>
-       </xsl:template>
+<xsl:template match="group_header">
+       <tr>
+               <th>
+                       <a href="{sort_name}">
+                               <xsl:value-of select="lang_name"/>
+                       </a>
+               </th>
+               <th>
+                       <xsl:value-of select="lang_edit"/>
+               </th>
+               <th>
+                       <xsl:value-of select="lang_delete"/>
+               </th>
+       </tr>
+</xsl:template>
 
 <!-- BEGIN group_data -->
-       <xsl:template match="group_data">
-               <tr>
-                       <xsl:attribute name="class">
-                               <xsl:choose>
-                                       <xsl:when test="position() mod 2 = 0">
-                                               <xsl:text>row_off</xsl:text>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:text>row_on</xsl:text>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </xsl:attribute>
-                       <td><xsl:value-of select="group_name"/></td>
-                       <td  class="action">
-                               <xsl:variable name="edit_url" 
select="edit_url"/>
-                               <a href="{$edit_url}" 
class="th_text"><xsl:value-of select="lang_edit"/></a>
-                       </td>
-                       <td  class="action">
-                               <xsl:variable name="delete_url" 
select="delete_url"/>
-                               <a href="{$delete_url}" 
class="th_text"><xsl:value-of select="lang_delete"/></a>
-                       </td>
-               </tr>
-       </xsl:template>
+<xsl:template match="group_data">
+       <tr>
+               <xsl:attribute name="class">
+                       <xsl:choose>
+                               <xsl:when test="position() mod 2 = 0">
+                                       <xsl:text>row_off</xsl:text>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:text>row_on</xsl:text>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </xsl:attribute>
+               <td>
+                       <xsl:value-of select="group_name"/>
+               </td>
+               <td  class="action">
+                       <xsl:variable name="edit_url" select="edit_url"/>
+                       <a href="{$edit_url}" class="th_text">
+                               <xsl:value-of select="lang_edit"/>
+                       </a>
+               </td>
+               <td  class="action">
+                       <xsl:variable name="delete_url" select="delete_url"/>
+                       <a href="{$delete_url}" class="th_text">
+                               <xsl:value-of select="lang_delete"/>
+                       </a>
+               </td>
+       </tr>
+</xsl:template>
 
 <!-- BEGIN group_add -->
-       <xsl:template match="group_add">
-               <div>
-                       <xsl:if test="add_access = 1">
-                               <a href="{add_url}"><xsl:value-of 
select="lang_add" /></a>
-                       </xsl:if>
-                       <a href="{done_url}"><xsl:value-of select="lang_done" 
/></a>
-               </div>
-       </xsl:template>
+<xsl:template match="group_add">
+       <div>
+               <xsl:if test="add_access = 1">
+                       <a href="{add_url}">
+                               <xsl:value-of select="lang_add" />
+                       </a>
+               </xsl:if>
+               <a href="{done_url}">
+                       <xsl:value-of select="lang_done" />
+               </a>
+       </div>
+</xsl:template>
 <!-- END group_list -->
 
 <!-- BEGIN group_edit -->
-       <xsl:template match="group_edit" xmlns:php="http://php.net/xsl";>
-               <div id="admin_group_edit">
-                       <h1><xsl:value-of select="page_title" /></h1>
-                       <xsl:if test="msgbox_data != ''">
-                               <xsl:call-template name="msgbox"/>
-                       </xsl:if>
+<xsl:template match="group_edit" xmlns:php="http://php.net/xsl";>
+       <div id="admin_group_edit">
+               <h1>
+                       <xsl:value-of select="page_title" />
+               </h1>
+               <xsl:if test="msgbox_data != ''">
+                       <xsl:call-template name="msgbox"/>
+               </xsl:if>
 
-                       <form name='body_form' action="{edit_url}" 
method="post"  onsubmit="process_list('all_users[]', 'account_user[]')">
-                               <div class="yui-navset" id="group_edit_tabview">
-                                       <xsl:value-of 
disable-output-escaping="yes" select="tabs" />
+               <form name='body_form' action="{edit_url}" method="post"  
onsubmit="process_list('all_users[]', 'account_user[]')">
+                       <div class="yui-navset" id="group_edit_tabview">
+                               <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
 
-                                               <div class="yui-content">
+                               <div class="yui-content">
 
-                                                       <div id="group">
-                                                               
<h2><xsl:value-of select="php:function('lang', 'group')" /></h2>
-                                                               <input 
type="hidden" name="values[account_id]" value="{account_id}"/>
-                                                               <ul 
id="admin_account_form">
-                                                                       <li>
-                                                                               
<label for="account_name"><xsl:value-of select="php:function('lang', 'group 
name')" /></label>
-                                                                               
<input name="values[account_name]" value="{value_account_name}" 
id="account_name" /><br class="eol" />
-                                                                       </li>
-                                                               </ul>
+                                       <div id="group">
+                                               <h2>
+                                                       <xsl:value-of 
select="php:function('lang', 'group')" />
+                                               </h2>
+                                               <input type="hidden" 
name="values[account_id]" value="{account_id}"/>
+                                               <ul id="admin_account_form">
+                                                       <li>
+                                                               <label 
for="account_name">
+                                                                       
<xsl:value-of select="php:function('lang', 'group name')" />
+                                                               </label>
+                                                               <input 
name="values[account_name]" value="{value_account_name}" id="account_name" />
+                                                               <br class="eol" 
/>
+                                                       </li>
+                                               </ul>
 
-                                                               <table 
border="0" align="center" width="100%">
-                                                                       <tbody 
align="center">
-                                                                               
<tr bgcolor="">
-                                                                               
        <td width="45%"><xsl:value-of select="php:function('lang', 'all 
users')" /></td>
-                                                                               
        <td width="10%"></td>
-                                                                               
        <td width="45%"><xsl:value-of select="php:function('lang', 'members')" 
/></td>
-                                                                               
</tr>
-                                                                               
<tr bgcolor="">
-                                                                               
<td width="45%">
-                                                                               
        <select multiple ='multiple' size="10" name="all_users[]" 
style="width:220">
-                                                                               
                <xsl:apply-templates select="guser_list"/>
-                                                                               
        </select>
-                                                                               
</td>
-                                                                               
<td width="10%">
-                                                                               
        <table border="0" align="center">
+                                               <!--table border="0" 
align="center" width="100%">
+                                                       <tbody align="center">
+                                                               <tr bgcolor="">
+                                                                       <td 
width="45%">
+                                                                               
<xsl:value-of select="php:function('lang', 'all users')" />
+                                                                       </td>
+                                                                       <td 
width="10%"></td>
+                                                                       <td 
width="45%">
+                                                                               
<xsl:value-of select="php:function('lang', 'members')" />
+                                                                       </td>
+                                                               </tr>
+                                                               <tr bgcolor="">
+                                                                       <td 
width="45%">
+                                                                               
<select multiple ='multiple' size="10" name="all_users[]" style="width:220">
+                                                                               
        <xsl:apply-templates select="guser_list"/>
+                                                                               
</select>
+                                                                       </td>
+                                                                       <td 
width="10%">
+                                                                               
<table border="0" align="center">
                                                                                
        <tbody align="center">
                                                                                
                <tr>
-                                                                               
                <td>
-                                                                               
                        <input type="button" 
onClick="move('all_users[]','account_user[]','','account_user[]')" 
value="&gt;&gt;"/>
-                                                                               
                </td>
+                                                                               
                        <td>
+                                                                               
                                <input type="button" 
onClick="move('all_users[]','account_user[]','','account_user[]')" 
value="&gt;&gt;"/>
+                                                                               
                        </td>
                                                                                
                </tr>
                                                                                
                <tr>
-                                                                               
                <td>
-                                                                               
                        <input type="button" 
onClick="move('account_user[]','all_users[]','','account_user[]')" 
value="&lt;&lt;"/>
-                                                                               
                </td>
+                                                                               
                        <td>
+                                                                               
                                <input type="button" 
onClick="move('account_user[]','all_users[]','','account_user[]')" 
value="&lt;&lt;"/>
+                                                                               
                        </td>
                                                                                
                </tr>
                                                                                
        </tbody>
-                                                                               
        </table>
-                                                                               
</td>
-                                                                               
<td width="45%">
-                                                                               
        <select multiple = 'multiple' size="10" name="account_user[]" 
id="account_user" style="width:220">
-                                                                               
                <xsl:apply-templates select="member_list"/>
-                                                                               
        </select>
-                                                                               
</td>
-                                                                               
</tr>
-                                                                       </tbody>
-                                                               </table>        
-                                                       </div>
-
-                                                       <div id="apps">
-                                                               
<h2><xsl:value-of select="php:function('lang', 'applications')" /></h2>
-                                                               <ul 
class="app_list">
-                                                                       
<xsl:apply-templates select="app_list" />
-                                                               </ul>
-                                                       </div>
+                                                                               
</table>
+                                                                       </td>
+                                                                       <td 
width="45%">
+                                                                               
<select multiple = 'multiple' size="10" name="account_user[]" id="account_user" 
style="width:220">
+                                                                               
        <xsl:apply-templates select="member_list"/>
+                                                                               
</select>
+                                                                       </td>
+                                                               </tr>
+                                                       </tbody>
+                                               </table-->
+                                               <div>
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_1'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
<xsl:with-param name="data" select ='data' />
+                                                                               
<xsl:with-param name="config" select ='config' />
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
                                                </div>
+                                               <div>
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_2'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
<xsl:with-param name="data" select ='data' />
+                                                                               
<xsl:with-param name="config" select ='config' />
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
+                                               </div>
                                        </div>
-                               <div class="button_group">
-                                       <input type="submit" name="save" 
value="{lang_save}" />
-                                       <input type="submit" name="cancel" 
value="{lang_cancel}" />
+
+                                       <div id="apps">
+                                               <h2>
+                                                       <xsl:value-of 
select="php:function('lang', 'applications')" />
+                                               </h2>
+                                               <ul class="app_list">
+                                                       <xsl:apply-templates 
select="app_list" />
+                                               </ul>
+                                       </div>
                                </div>
-                       </form>
-               </div>
-       </xsl:template>
+                       </div>
+                       <div class="button_group">
+                               <input type="submit" name="save" 
value="{lang_save}" />
+                               <input type="submit" name="cancel" 
value="{lang_cancel}" />
+                       </div>
+               </form>
+       </div>
+</xsl:template>
 
-       <xsl:template match="guser_list">
-               <option value="{account_id}">
-                       <xsl:value-of select="account_name" />
-               </option>
-       </xsl:template>
+<xsl:template match="guser_list">
+       <option value="{account_id}">
+               <xsl:value-of select="account_name" />
+       </option>
+</xsl:template>
 
-       <xsl:template match="member_list">
-               <option value="{account_id}">
-                       <xsl:value-of select="account_name" />
-               </option>
-       </xsl:template>
+<xsl:template match="member_list">
+       <option value="{account_id}">
+               <xsl:value-of select="account_name" />
+       </option>
+</xsl:template>
 
-       <xsl:template match="app_list">
-               <li>
-                       <xsl:attribute name="class">
-                               <xsl:choose>
-                                       <xsl:when test="position() mod 2 = 0">
-                                               <xsl:text>row_off</xsl:text>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:text>row_on</xsl:text>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </xsl:attribute>
-
+<xsl:template match="app_list">
+       <li>
+               <xsl:attribute name="class">
                        <xsl:choose>
-                               <xsl:when test="acl_url != ''">
-                                       <a href="{acl_url}"><img 
src="{acl_img}" title="{acl_img_name}" alt="{acl_img_name}" /></a>
+                               <xsl:when test="position() mod 2 = 0">
+                                       <xsl:text>row_off</xsl:text>
                                </xsl:when>
                                <xsl:otherwise>
-                                       <img src="{acl_img}" 
title="{acl_img_name}" alt="{acl_img_name}" />
+                                       <xsl:text>row_on</xsl:text>
                                </xsl:otherwise>
                        </xsl:choose>
-                       <xsl:text> </xsl:text>
-                       <xsl:choose>
-                               <xsl:when test="grant_url != ''">
-                                       <a href="{grant_url}"><img 
src="{grant_img}" title="{grant_img_name}" alt="{grant_img_name}" /></a>
-                               </xsl:when>
-                               <xsl:otherwise>
+               </xsl:attribute>
+
+               <xsl:choose>
+                       <xsl:when test="acl_url != ''">
+                               <a href="{acl_url}">
+                                       <img src="{acl_img}" 
title="{acl_img_name}" alt="{acl_img_name}" />
+                               </a>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <img src="{acl_img}" title="{acl_img_name}" 
alt="{acl_img_name}" />
+                       </xsl:otherwise>
+               </xsl:choose>
+               <xsl:text> </xsl:text>
+               <xsl:choose>
+                       <xsl:when test="grant_url != ''">
+                               <a href="{grant_url}">
                                        <img src="{grant_img}" 
title="{grant_img_name}" alt="{grant_img_name}" />
-                               </xsl:otherwise>
-                       </xsl:choose>
+                               </a>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <img src="{grant_img}" title="{grant_img_name}" 
alt="{grant_img_name}" />
+                       </xsl:otherwise>
+               </xsl:choose>
 
-                       <xsl:choose>
-                               <xsl:when test="i_am_admin = '1'">
-                                       <input type="checkbox" id="{elmid}" 
name="{checkbox_name}" value="1">
-                                               <xsl:if test="checked = '1'">
-                                                       <xsl:attribute 
name="checked">
-                                                               
<xsl:text>checked</xsl:text>
-                                                       </xsl:attribute>
-                                               </xsl:if>
-                                       </input>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <input type="hidden" id="{elmid}" 
name="{checkbox_name}">
-                                               <xsl:if test="checked = '1'">
-                                                       <xsl:attribute 
name="value">
-                                                               
<xsl:text>1</xsl:text>
-                                                       </xsl:attribute>
-                                               </xsl:if>
-                                       </input>
-                                       <input type="checkbox" readonly='true'>
-                                               <xsl:if test="checked = '1'">
-                                                       <xsl:attribute 
name="checked">
-                                                               
<xsl:text>checked</xsl:text>
-                                                       </xsl:attribute>
-                                               </xsl:if>
-                                       </input>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       <label for="{elmid}">
-                               <xsl:value-of select="app_title" />
-                       </label>
-               </li>
-       </xsl:template>
+               <xsl:choose>
+                       <xsl:when test="i_am_admin = '1'">
+                               <input type="checkbox" id="{elmid}" 
name="{checkbox_name}" value="1">
+                                       <xsl:if test="checked = '1'">
+                                               <xsl:attribute name="checked">
+                                                       
<xsl:text>checked</xsl:text>
+                                               </xsl:attribute>
+                                       </xsl:if>
+                               </input>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <input type="hidden" id="{elmid}" 
name="{checkbox_name}">
+                                       <xsl:if test="checked = '1'">
+                                               <xsl:attribute name="value">
+                                                       <xsl:text>1</xsl:text>
+                                               </xsl:attribute>
+                                       </xsl:if>
+                               </input>
+                               <input type="checkbox" readonly='true'>
+                                       <xsl:if test="checked = '1'">
+                                               <xsl:attribute name="checked">
+                                                       
<xsl:text>checked</xsl:text>
+                                               </xsl:attribute>
+                                       </xsl:if>
+                               </input>
+                       </xsl:otherwise>
+               </xsl:choose>
+               <label for="{elmid}">
+                       <xsl:value-of select="app_title" />
+               </label>
+       </li>
+</xsl:template>


Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15360-15541,15543-15566,15568-15569
   + /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15360-15541,15543-15566,15568-15569,15585-15617

Modified: branches/Version-2_0-branch/booking/js/booking/schedule.js
===================================================================
--- branches/Version-2_0-branch/booking/js/booking/schedule.js  2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/booking/js/booking/schedule.js  2016-09-08 
07:43:11 UTC (rev 15618)
@@ -15,7 +15,7 @@
        var detected_lang = navigator.language || navigator.userLanguage;
        var lang = {};
 
-       if(detected_lang == 'no' || detected_lang == 'nn' || detected_lang == 
'nb')
+       if(detected_lang == 'no' || detected_lang == 'nn' || detected_lang == 
'nb' ||detected_lang == 'nb-no' || detected_lang == 'no-no' || detected_lang == 
'nn-no')
        {
                lang = {
                        WEEKDAYS_FULL: [


Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335
   + /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335,15585-15617

Modified: 
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js  
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js  
2016-09-08 07:43:11 UTC (rev 15618)
@@ -13,7 +13,7 @@
        var detected_lang = navigator.language || navigator.userLanguage;
        var lang = {};
 
-       if(detected_lang == 'no' || detected_lang == 'nn' || detected_lang == 
'nb')
+       if(detected_lang == 'no' || detected_lang == 'nn' || detected_lang == 
'nb' ||detected_lang == 'nb-no' || detected_lang == 'no-no' || detected_lang == 
'nn-no')
        {
                lang = {
                        WEEKDAYS_FULL: [

Modified: branches/Version-2_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-2_0-branch/controller/inc/class.uicalendar.inc.php 
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/controller/inc/class.uicalendar.inc.php 
2016-09-08 07:43:11 UTC (rev 15618)
@@ -505,6 +505,19 @@
                                unset($location);
                        }
 
+                       // Sort the data with account_lastname ascending, 
account_firstname ascending
+                       // Add $data as the last parameter, to sort by the 
common key
+                       if ($locations_list)
+                       {
+                               $locations_location_code = array();
+                               foreach ($locations_list as $key => $row)
+                               {
+                                       $locations_location_code[$key] = 
$row['location_code'];
+                               }
+                               array_multisort($locations_location_code, 
SORT_ASC, $locations_list);
+                       }
+
+
                        // Validates year. If year is not set, current year is 
chosen
                        $year = $this->validate_year($year);
 
@@ -745,6 +758,7 @@
                                $bookmark_locations[] = $location_code;
                        }
 
+                       $locations_list = array();
                        if (is_numeric($control_id) & $control_id > 0)
                        {
                                $locations_for_control_array = 
$this->so_control->get_locations_for_control($control_id);
@@ -762,6 +776,17 @@
                                reset($locations_for_control_array);
                                unset($location);
                        }
+                       // Sort the data with account_lastname ascending, 
account_firstname ascending
+                       // Add $data as the last parameter, to sort by the 
common key
+                       if ($locations_list)
+                       {
+                               $locations_location_code = array();
+                               foreach ($locations_list as $key => $row)
+                               {
+                                       $locations_location_code[$key] = 
$row['location_code'];
+                               }
+                               array_multisort($locations_location_code, 
SORT_ASC, $locations_list);
+                       }
 
                        // Validates year. If year is not set, current year is 
chosen
                        $year = $this->validate_year($year);

Modified: branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php        
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php        
2016-09-08 07:43:11 UTC (rev 15618)
@@ -50,7 +50,8 @@
                                '_print'                        => true,
                                'columns'                       => true,
                                'update_data'           => true,
-                               'upload_clip'           => true
+                               'upload_clip'           => true,
+                               'view_image'            => true
                        );
 
                /**
@@ -1309,6 +1310,68 @@
                        }
                }
 
+               function view_image()
+               {
+                       $GLOBALS['phpgw_info']['flags']['noheader'] = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+
+                       if (!$this->acl_read)
+                       {
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       $thumb = phpgw::get_var('thumb', 'bool');
+                       $img_id = phpgw::get_var('img_id', 'int');
+
+                       $bofiles = CreateObject('property.bofiles');
+
+                       if($img_id)
+                       {
+                               $file_info = $bofiles->vfs->get_info($img_id);
+                               $file = 
"{$file_info['directory']}/{$file_info['name']}";
+                       }
+                       else
+                       {
+                               $file = urldecode(phpgw::get_var('file'));
+                       }
+
+                       $source = "{$bofiles->rootdir}{$file}";
+                       $thumbfile = "$source.thumb";
+
+                       // prevent path traversal
+                       if (preg_match('/\.\./', $source))
+                       {
+                               return false;
+                       }
+
+                       $uigallery = CreateObject('property.uigallery');
+
+                       $re_create = false;
+                       if ($uigallery->is_image($source) && $thumb && 
$re_create)
+                       {
+                               $uigallery->create_thumb($source, $thumbfile, 
$thumb_size = 50);
+                               readfile($thumbfile);
+                       }
+                       else if ($thumb && is_file($thumbfile))
+                       {
+                               readfile($thumbfile);
+                       }
+                       else if ($uigallery->is_image($source) && $thumb)
+                       {
+                               $uigallery->create_thumb($source, $thumbfile, 
$thumb_size = 50);
+                               readfile($thumbfile);
+                       }
+                       else if ($img_id)
+                       {
+                               $bofiles->get_file($img_id);
+                       }
+                       else
+                       {
+                               $bofiles->view_file('', $file);
+                       }
+               }
+
                function get_files()
                {
                        $id = phpgw::get_var('id', 'int');
@@ -1328,15 +1391,32 @@
                        $values = $this->bo->read_single($id);
 
                        $content_files = array();
+                       $img_types = array(
+                               'image/jpeg',
+                               'image/png',
+                               'image/gif'
+                       );
 
+                       $z = 0;
                        foreach ($values['files'] as $_entry)
                        {
-                               $content_files[] = array
-                                       (
+                               $content_files[] = array(
                                        'file_name' => '<a href="' . 
$link_view_file . '&amp;file_id=' . $_entry['file_id'] . '" target="_blank" 
title="' . lang('click to view file') . '">' . $_entry['name'] . '</a>',
                                        'delete_file' => '<input 
type="checkbox" name="values[file_action][]" value="' . $_entry['file_id'] . '" 
title="' . lang('Check to delete file') . '">',
                                        'attach_file' => '<input 
type="checkbox" name="values[file_attach][]" value="' . $_entry['file_id'] . '" 
title="' . lang('Check to attach file') . '">'
                                );
+                               if ( in_array($_entry['mime_type'], $img_types))
+                               {
+                                       $content_files[$z]['file_name'] = 
$_entry['name'];
+                                       $content_files[$z]['img_id'] = 
$_entry['file_id'];
+                                       $content_files[$z]['img_url'] = 
self::link(array(
+                                                       'menuaction' => 
'helpdesk.uitts.view_image',
+                                                       'img_id'        =>  
$_entry['file_id'],
+                                                       'file' => 
$_entry['directory'] . '/' . $_entry['file_name']
+                                       ));
+                                       $content_files[$z]['thumbnail_flag'] = 
'thumb=1';
+                               }
+                               $z ++;
                        }
 
                        if (phpgw::get_var('phpgw_return_as') == 'json')
@@ -1636,17 +1716,41 @@
 
                        $link_view_file = $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'helpdesk.uitts.view_file'));
 
-                       for ($z = 0; $z < count($ticket['files']); $z++)
+                       $img_types = array(
+                               'image/jpeg',
+                               'image/png',
+                               'image/gif'
+                       );
+
+                       $content_files = array();
+
+                       $z = 0;
+                       foreach ($ticket['files'] as $_entry)
                        {
-                               $content_files[$z]['file_name'] = '<a href="' . 
$link_view_file . '&amp;file_id=' . $ticket['files'][$z]['file_id'] . '" 
target="_blank" title="' . lang('click to view file') . '">' . 
$ticket['files'][$z]['name'] . '</a>';
-                               $content_files[$z]['delete_file'] = '<input 
type="checkbox" name="values[file_action][]" value="' . 
$ticket['files'][$z]['file_id'] . '" title="' . lang('Check to delete file') . 
'">';
-                               $content_files[$z]['attach_file'] = '<input 
type="checkbox" name="values[file_attach][]" value="' . 
$ticket['files'][$z]['file_id'] . '" title="' . lang('Check to attach file') . 
'">';
+                               $content_files[] = array(
+                                       'file_name' => '<a href="' . 
$link_view_file . '&amp;file_id=' . $_entry['file_id'] . '" target="_blank" 
title="' . lang('click to view file') . '">' . $_entry['name'] . '</a>',
+                                       'delete_file' => '<input 
type="checkbox" name="values[file_action][]" value="' . $_entry['file_id'] . '" 
title="' . lang('Check to delete file') . '">',
+                                       'attach_file' => '<input 
type="checkbox" name="values[file_attach][]" value="' . $_entry['file_id'] . '" 
title="' . lang('Check to attach file') . '">'
+                               );
+                               if ( in_array($_entry['mime_type'], $img_types))
+                               {
+                                       $content_files[$z]['file_name'] = 
$_entry['name'];
+                                       $content_files[$z]['img_id'] = 
$_entry['file_id'];
+                                       $content_files[$z]['img_url'] = 
self::link(array(
+                                                       'menuaction' => 
'helpdesk.uitts.view_image',
+                                                       'img_id'        =>  
$_entry['file_id'],
+                                                       'file' => 
$_entry['directory'] . '/' . $_entry['file_name']
+                                       ));
+                                       $content_files[$z]['thumbnail_flag'] = 
'thumb=1';
+                               }
+                               $z ++;
                        }
 
-
                        $attach_file_def = array(
                                array('key' => 'file_name', 'label' => 
lang('Filename'), 'sortable' => false,
                                        'resizeable' => true),
+                               array('key' => 'picture', 'label' => 
lang('picture'), 'sortable' => false,
+                                       'resizeable' => true, 'formatter' => 
'JqueryPortico.showPicture'),
                                array('key' => 'delete_file', 'label' => 
lang('Delete file'), 'sortable' => false,
                                        'resizeable' => true, 'formatter' => 
'FormatterCenter'),
                        );

Modified: branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js
===================================================================
--- branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js  2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js  2016-09-08 
07:43:11 UTC (rev 15618)
@@ -81,6 +81,10 @@
        errorMessageKey: ''
 });
 
+upload_canvas = function ()
+{
+       confirm_session('apply');
+}
 
 $(document).ready(function ()
 {
@@ -247,6 +251,10 @@
                                ctx.drawImage(pastedImage, 0, 0);
                        };
                        pastedImage.src = source;
+                       setTimeout(function ()
+                       {
+                               upload_canvas();
+                       }, 500);
                };
        }
 

Modified: branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang    2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang    2016-09-08 
07:43:11 UTC (rev 15618)
@@ -105,11 +105,11 @@
 new value      helpdesk        no      Ny verdi
 ok     helpdesk        no      OK
 about  helpdesk        no      Om
-update subject helpdesk        no      Oppdater overskrift
+update subject helpdesk        no      Oppdater emne
 failed to create directory     helpdesk        no      Opplasting av fil feilet
 organisation   helpdesk        no      Organisasjon
-subject        helpdesk        no      Overskrift
-subject changed        helpdesk        no      Overskrift er endret
+subject        helpdesk        no      Emne
+subject changed        helpdesk        no      Emne er endret
 password       helpdesk        no      Passord
 item   helpdesk        no      Post
 print view     helpdesk        no      Print visning
@@ -125,7 +125,7 @@
 send e-mail    helpdesk        no      Send epost
 sent by email to       helpdesk        no      sendt med epost til
 last   helpdesk        no      Siste
-enter the subject of this ticket       helpdesk        no      Skriv overskrift
+enter the subject of this ticket       helpdesk        no      Angi emne
 print  helpdesk        no      Skriv ut
 print the ticket       helpdesk        no      Skriv ut melding
 delete helpdesk        no      Slett
@@ -174,5 +174,6 @@
 change to      helpdesk        no      Endre til
 do you really want to change the status to %1  helpdesk        no      Vil du 
virkelig endre status til %1
 do you really want to change the priority to %1        helpdesk        no      
Vil du virkelig endre prioritet til %1
-please enter a title!  helpdesk        no      Angi en overskrift
-ticket has been updated        helpdesk        no      Melding er oppdatert
\ No newline at end of file
+please enter a title!  helpdesk        no      Angi et emne
+ticket has been updated        helpdesk        no      Melding er oppdatert
+picture        helpdesk        no      Bilde
\ No newline at end of file

Modified: 
branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_.inc.php   
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_.inc.php   
2016-09-08 07:43:11 UTC (rev 15618)
@@ -649,35 +649,16 @@
                 * Update the data for a group
                 *
                 * @param object $group   the phpgwapi_account_group object to 
use for the update
-                * @param array  $users   the list of users who belong in the 
group
                 * @param array  $modules the list of modules the group shall 
have access to
                 *
                 * @return integer the group id
                 */
-               public function update_group($group, $users, $modules = null)
+               public function update_group($group, $modules = null)
                {
                        $this->account = $group;
                        $this->account_id = $group->id;
                        $this->save_repository();
 
-                       // handle group memberships
-                       $old_users = array_keys($this->member($group->id));
-                       $new_users = $users;
-                       $drop_users = array_diff($old_users, $new_users);
-                       if ( is_array($drop_users) && count($drop_users) )
-                       {
-                               foreach ( $drop_users as $user )
-                               {
-                                       $this->delete_account4group($user, 
$group->id);
-                               }
-                       }
-                       unset($old_users, $users, $drop_users);
-
-                       foreach ( $new_users as $user )
-                       {
-                               $this->add_user2group($user, $group->id);
-                       }
-
                        // module permissions
                        if ( is_array($modules) )
                        {

Modified: branches/Version-2_0-branch/phpgwapi/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.menu.inc.php 2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.menu.inc.php 2016-09-08 
07:43:11 UTC (rev 15618)
@@ -110,6 +110,10 @@
                        foreach($GLOBALS['phpgw_info']['user']['apps'] as $app 
=> $app_info)
                        //      foreach ( $raw_menus as $app => $raw_menu )
                        {
+                               if($app_info['status'] == 2) // hidden
+                               {
+                                       continue;
+                               }
                                $raw_menu = $raw_menus[$app];
                                // Ignore invalid entries
                                if(!is_array($raw_menu))

Modified: branches/Version-2_0-branch/property/inc/class.boentity.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.boentity.inc.php     
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.boentity.inc.php     
2016-09-08 07:43:11 UTC (rev 15618)
@@ -954,6 +954,7 @@
                        $start_date = phpgw::get_var('control_start_date', 
'string');
                        $repeat_type = phpgw::get_var('repeat_type', 'int');
                        $repeat_interval = phpgw::get_var('repeat_interval', 
'int');
+                       $repeat_interval = $repeat_interval ? $repeat_interval 
: 1;
                        $controle_time = phpgw::get_var('controle_time', 
'float');
                        $service_time = phpgw::get_var('service_time', 'float');
 

Modified: branches/Version-2_0-branch/property/inc/class.bolocation.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.bolocation.inc.php   
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.bolocation.inc.php   
2016-09-08 07:43:11 UTC (rev 15618)
@@ -180,11 +180,26 @@
                                $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'
 . $this->type_id . !!$this->lookup]) ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']["location_columns_" . 
$this->type_id . !!$this->lookup] : '';
                        }
                        $filter = array('list' => ''); // translates to "list 
IS NULL"
-                       $columns = $this->custom->find('property', '.location.' 
. $type_id, 0, '', '', '', true, false, $filter);
-                       $column_list = 
$this->bocommon->select_multi_list($selected, $columns);
-                       return $column_list;
+                       //$columns = $this->custom->find('property', 
'.location.' . $type_id, 0, '', '', '', true, false, $filter);
+
+                       $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', ".location.{$this->type_id}");
+
+                       $columns = $this->so->get_column_list($location_id);
+                       $columns = array_merge($columns, 
$this->get_column_list());
+                       return $this->bocommon->select_multi_list($selected, 
$columns);
                }
 
+               function get_column_list()
+               {
+                       $columns = array();
+//                     $columns['category_text'] = array(
+//                             'id' => 'category_text',
+//                             'name' => lang('category'),
+//                             'sortable' => false
+//                     );
+                       return $columns;
+               }
+
                function select_status_list( $format = '', $selected = '' )
                {
                        switch ($format)
@@ -751,6 +766,32 @@
                        $this->total_records = $this->so->total_records;
                        $this->uicols = $this->so->uicols;
 
+                       $custom_cols = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'
 . $this->type_id . !!$this->lookup]) ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']["location_columns_" . 
$this->type_id . !!$this->lookup] : '';
+
+                       $column_list = $this->get_column_list();
+                       $get_vendor_names = false;
+
+                       foreach ($custom_cols as $col_id)
+                       {
+                               if (!ctype_digit($col_id))
+                               {
+                                       $this->uicols['input_type'][] = 'text';
+                                       $this->uicols['name'][] = $col_id;
+                                       $this->uicols['descr'][] = 
$column_list[$col_id]['name'];
+                                       $this->uicols['statustext'][] = 
$column_list[$col_id]['name'];
+                                       $this->uicols['exchange'][] = false;
+                                       $this->uicols['align'][] = '';
+                                       $this->uicols['datatype'][] = false;
+                                       $this->uicols['sortable'][] = 
$column_list[$col_id]['sortable'];
+                                       $this->uicols['formatter'][] = 
$column_list[$col_id]['formatter'];
+                                       $this->uicols['classname'][] = 
$column_list[$col_id]['classname'];
+                                       if ($col_id == 'vendor_names')
+                                       {
+                                               $get_vendor_names = true;
+                                       }
+                               }
+                       }
+
                        return $locations;
                }
 

Modified: branches/Version-2_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.borequest.inc.php    
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.borequest.inc.php    
2016-09-08 07:43:11 UTC (rev 15618)
@@ -484,13 +484,6 @@
                                }
                        }
 
-                       /* $request = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                         'filter' => $this->filter,'district_id' => 
$this->district_id,'cat_id' => $this->cat_id,'status_id' => $this->status_id,
-                         'project_id' => 
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' => 
$data['list_descr'],
-                         'dry_run'=>$data['dry_run'], 'p_num' => 
$this->p_num,'start_date'=>$this->start_date,'end_date'=>$this->end_date,
-                         'property_cat_id' => $this->property_cat_id, 
'building_part' => $this->building_part,
-                         'degree_id' => $this->degree_id, 'attrib_filter' => 
$attrib_filter, 'condition_survey_id' => $this->condition_survey_id,
-                         'responsible_unit' => $this->responsible_unit, 
'recommended_year' => $this->recommended_year)); */
                        $values = $this->so->read(array
                                (
                                'start' => $data['start'],
@@ -500,7 +493,7 @@
                                'sort' => $data['sort'],
                                'allrows' => $data['allrows'],
                                'list_descr' => $data['list_descr'],
-                               'project_id' => $data['project_id'],
+                               'make_relation' => $data['make_relation'],
                                'dry_run' => $data['dry_run'],
                                'filter' => $this->filter,
                                'district_id' => $this->district_id,

Modified: branches/Version-2_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.botts.inc.php        
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.botts.inc.php        
2016-09-08 07:43:11 UTC (rev 15618)
@@ -56,6 +56,7 @@
                public $sum_difference = 0;
                public $show_finnish_date = false;
                public $simple = false;
+               public $group_candidates = array(-1);
                protected $custom_filters = array();
                var $public_functions = array
                        (
@@ -86,6 +87,29 @@
                        $this->config->read();
 
 
+                       $user_groups =  
$GLOBALS['phpgw']->accounts->membership($this->account);
+                       $simple_group = 
isset($this->config->config_data['fmttssimple_group']) ? 
$this->config->config_data['fmttssimple_group'] : array();
+
+                       if 
(isset($this->config->config_data['fmtts_assign_group_candidates']) && 
is_array($this->config->config_data['fmtts_assign_group_candidates']))
+                       {
+                               foreach 
($this->config->config_data['fmtts_assign_group_candidates'] as 
$group_candidate)
+                               {
+                                       if ($group_candidate)
+                                       {
+                                               $this->group_candidates[] = 
$group_candidate;
+                                       }
+                               }
+                       }
+                       foreach ( $user_groups as $group => $dummy)
+                       {
+                               if ( in_array($group, $simple_group) && 
!in_array($group, $this->group_candidates))
+                               {
+                                       $this->simple = true;
+                                       break;
+                               }
+                       }
+
+                       reset($user_groups);
                        $user_groups = 
$GLOBALS['phpgw']->accounts->membership($this->account);
                        $simple_group = 
isset($this->config->config_data['fmttssimple_group']) ? 
$this->config->config_data['fmttssimple_group'] : array();
                        foreach ($user_groups as $group => $dummy)
@@ -1760,4 +1784,11 @@
                                );
                }
 
+
+               function add_relation( $add_relation, $id )
+               {
+                       return $this->so->add_relation($add_relation, $id);
+               }
+
+
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/inc/class.solocation.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.solocation.inc.php   
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.solocation.inc.php   
2016-09-08 07:43:11 UTC (rev 15618)
@@ -285,6 +285,51 @@
                        return $this->db->next_record();
                }
 
+               function get_column_list($location_id)
+               {
+                       $sql = "SELECT * FROM phpgw_cust_attribute "
+                               . " WHERE location_id = {$location_id}"
+                               . " AND custom = 1 OR column_name = 'category'";
+
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       
+                       while ($this->db->next_record())
+                       {
+                       $attribs = array();
+                               $id = $this->db->f('id');
+                               $attribs[$id] = array
+                               (
+                                       'id'                                    
=> $id,
+                                       'group_id'                              
=> (int) $this->db->f('group_id'),
+                                       'attrib_sort'                   => 
(int) $this->db->f('attrib_sort'),
+                                       'list'                                  
=> $this->db->f('list'),
+                                       'lookup_form'                   => 
$this->db->f('lookup_form'),
+                                       'entity_form'                   => 
$this->db->f('entity_form'),
+                                       'column_name'                   => 
$this->db->f('column_name'),
+                                       'name'                                  
=> $this->db->f('column_name'),
+                                       'size'                                  
=> $this->db->f('size'),
+                                       'precision'                             
=> $this->db->f('precision_'),
+                                       'statustext'                    => 
$this->db->f('statustext', true),
+                                       'input_text'                    => 
$this->db->f('input_text', true),
+                                       'type_name'                             
=> $this->db->f('type'),
+                                       'datatype'                              
=> $this->db->f('datatype'),
+                                       'search'                                
=> $this->db->f('search'),
+                                       'nullable'                              
=> ($this->db->f('nullable') == 'True'),
+                                       'history'                               
=> $this->db->f('history'),
+                                       'disabled'                              
=> $this->db->f('disabled'),
+                                       'helpmsg'                               
=> !!$this->db->f('helpmsg'),
+                                       'get_list_function'             => 
$this->db->f('get_list_function'),
+                                       'get_list_function_input' => 
$this->db->f('get_list_function_input') ? 
unserialize($this->db->f('get_list_function_input', true)) : '',
+                                       'get_single_function'           => 
$this->db->f('get_single_function'),
+                                       'get_single_function_input' => 
$this->db->f('get_single_function_input') ? 
unserialize($this->db->f('get_single_function_input', true)) : '',
+                                       'short_description'                     
=> $this->db->f('short_description'),
+                                       'javascript_action'                     
=> $this->db->f('javascript_action',true),
+                                       'default_value'                         
=> $this->db->f('default_value',true)
+                               );
+                       }
+                       return $attribs;
+               }
+
                function read( $data )
                {
                        $start = isset($data['start']) && $data['start'] ? 
$data['start'] : 0;
@@ -615,11 +660,19 @@
 
                        //---------------------start custom user cols
 
-                       $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'
 . $type_id . !!$lookup]) ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_' . 
$type_id . !!$lookup] : '';
+                       $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'
 . $type_id . !!$lookup]) ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_' . 
$type_id . !!$lookup] : array();
+                       $_user_columns = array();
+                       foreach ($user_columns as $user_column_id)
+                       {
+                               if (ctype_digit($user_column_id))
+                               {
+                                       $_user_columns[] = $user_column_id;
+                               }
+                       }
                        $user_column_filter = '';
-                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
+                       if ($_user_columns)
                        {
-                               $user_column_filter = " OR ($attribute_filter 
AND id IN (" . implode(',', $user_columns) . '))';
+                               $user_column_filter = " OR ($attribute_filter 
AND id IN (" . implode(',', $_user_columns) . '))';
                        }
 
                        $this->db->query("SELECT DISTINCT * FROM 
$attribute_table WHERE (list=1 OR lookup_form=1) AND $attribute_filter 
$user_column_filter ORDER BY attrib_sort ASC");

Modified: branches/Version-2_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sorequest.inc.php    
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.sorequest.inc.php    
2016-09-08 07:43:11 UTC (rev 15618)
@@ -307,7 +307,7 @@
                        $property_cat_id = isset($data['property_cat_id']) ? 
$data['property_cat_id'] : 0;
                        $status_id = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id'] : 'open';
                        $district_id = isset($data['district_id']) && 
$data['district_id'] ? $data['district_id'] : 0;
-                       $project_id = isset($data['project_id']) ? 
$data['project_id'] : '';
+                       $make_relation = isset($data['make_relation']) ? 
$data['make_relation'] : '';
                        $allrows = isset($data['allrows']) ? $data['allrows'] : 
'';
                        $results = isset($data['results']) ? 
(int)$data['results'] : 0;
                        $list_descr = isset($data['list_descr']) ? 
$data['list_descr'] : '';
@@ -716,9 +716,8 @@
                                $where = 'AND';
                        }
 
-                       if ($project_id && !$status_id)// lookup requests not 
already allocated to projects
+                       if ($make_relation && !$status_id)// lookup requests 
not already allocated to projects
                        {
-//                             $filtermethod .= " $where project_id is NULL ";
                                $filtermethod .= " $where 
fm_request_status.closed is NULL ";
                                $where = 'AND';
                        }

Modified: branches/Version-2_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-09-08 07:43:11 UTC (rev 15618)
@@ -1979,4 +1979,49 @@
 
                        return $values;
                }
+
+               function add_relation( $add_relation, $id )
+               {
+                       $config = $GLOBALS['phpgw']->config->read();
+                       $interlink = CreateObject('property.interlink');
+                       $this->db->transaction_begin();
+
+                       foreach ($add_relation['request_id'] as $relation_id)
+                       {
+                               $target_id = false;
+                               $target = 
$interlink->get_specific_relation('property', '.project.request', '.ticket', 
$relation_id, 'target');
+                               if ($target)
+                               {
+                                       $target_id =  $target[0];
+                               }
+
+                               if (!$target_id)
+                               {
+                                       $interlink_data = array(
+                                               'location1_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.project.request'),
+                                               'location1_item_id' => 
$relation_id,
+                                               'location2_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket'),
+                                               'location2_item_id' => $id,
+                                               'account_id' => $this->account
+                                       );
+
+                                       $interlink->add($interlink_data);
+
+                                       $request_ticket_hookup_status = 
isset($config['request_ticket_hookup_status']) && 
$config['request_ticket_hookup_status'] ? 
$config['request_ticket_hookup_status'] : false;
+
+                                       if ($request_ticket_hookup_status)
+                                       {
+                                               $this->db->query("UPDATE 
fm_request SET status='{$request_ticket_hookup_status}' WHERE id='" . 
$relation_id . "'", __LINE__, __FILE__);
+                                       }
+
+                                       
phpgwapi_cache::message_set(lang('request %1 has been added', $relation_id), 
'message');
+                               }
+                               else
+                               {
+                                       
phpgwapi_cache::message_set(lang('request %1 has already been added to ticket 
%2', $relation_id, $target_id), 'error');
+                               }
+                       }
+                       $this->db->transaction_commit();
+                       return $receipt;
+               }
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/inc/class.uigallery.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uigallery.inc.php    
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.uigallery.inc.php    
2016-09-08 07:43:11 UTC (rev 15618)
@@ -147,14 +147,24 @@
                        }
 
                        $location_info = $this->bo->get_location($directory);
-
                        if (!$this->acl->check($location_info['location'], 
PHPGW_ACL_READ, 'property'))
                        {
                                echo 'sorry - no access';
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
 
+                       $img_id = phpgw::get_var('img_id', 'int');
+
                        $bofiles = CreateObject('property.bofiles');
+
+                       if($img_id)
+                       {
+                               $file_info = $bofiles->vfs->get_info($img_id);
+                               $file = 
"{$file_info['directory']}/{$file_info['name']}";
+                       }
+
+
+
                        $source = "{$bofiles->rootdir}{$file}";
                        $thumbfile = "$source.thumb";
 
@@ -179,6 +189,10 @@
                                $this->create_thumb($source, $thumbfile, 
$thumb_size = 100);
                                readfile($thumbfile);
                        }
+                       else if ($img_id)
+                       {
+                               $bofiles->get_file($img_id);
+                       }
                        else
                        {
                                $bofiles->view_file('', $file);

Modified: branches/Version-2_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiproject.inc.php    
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.uiproject.inc.php    
2016-09-08 07:43:11 UTC (rev 15618)
@@ -1458,7 +1458,9 @@
                                (
                                'menuaction' => 'property.uirequest.index',
                                'query' => 
(isset($values['location_data']['loc1']) ? $values['location_data']['loc1'] : 
''),
-                               'project_id' => (isset($id) ? $id : '')
+                               'make_relation' => !!$id,
+                               'relation_id' => isset($id) ? $id : 0,
+                               'relation_type' => 'project'
                        );
 
                        $supervisor_email = array();

Modified: branches/Version-2_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uirequest.inc.php    
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.uirequest.inc.php    
2016-09-08 07:43:11 UTC (rev 15618)
@@ -120,7 +120,7 @@
                 */
                public function query()
                {
-                       $project_id = phpgw::get_var('project_id', 'int');
+                       $make_relation =  phpgw::get_var('make_relation', 
'bool');
                        $search = phpgw::get_var('search');
                        $order = phpgw::get_var('order');
                        $draw = phpgw::get_var('draw', 'int');
@@ -150,7 +150,7 @@
                                'sort' => $order[0]['dir'],
                                'dir' => $order[0]['dir'],
                                'allrows' => phpgw::get_var('length', 'int') == 
-1 || $export,
-                               'project_id' => $project_id,
+                               'make_relation' => $make_relation,
                                'start_date' => $start_date,
                                'end_date' => $end_date,
                                'list_descr' => $list_descr
@@ -615,10 +615,27 @@
                                return $this->query();
                        }
 
-                       $project_id = phpgw::get_var('project_id', 'int'); // 
lookup for maintenance planning
+                       $make_relation =  phpgw::get_var('make_relation', 
'bool'); // lookup for maintenance planning
+                       $relation_id = phpgw::get_var('relation_id', 'int');
+                       $relation_type = phpgw::get_var('relation_type');
+
+                       switch ($relation_type)
+                       {
+                               case 'ticket':
+                                       $update_menuaction = 
'property.uitts.view';
+                                       $lang_update_relation = lang('update 
ticket');
+                                       break;
+                               case 'project':
+                                       $update_menuaction = 
'property.uiproject.edit';
+                                       $lang_update_relation = lang('update 
project');
+                                       break;
+                               default:
+                                       break;
+                       }
+
                        $query = phpgw::get_var('query');
 
-                       if ($project_id)
+                       if ($make_relation)
                        {
                                $lookup = true;
                        }
@@ -678,7 +695,9 @@
                                        'source' => self::link(array(
                                                'menuaction' => 
'property.uirequest.index',
                                                'lookup' => $lookup,
-                                               'project_id' => $project_id,
+                                               'make_relation' => 
$make_relation,
+                                               'relation_id' => $relation_id,
+                                               'relation_type' => 
$relation_type,
                                                'nonavbar' => $this->nonavbar,
                                                'phpgw_return_as' => 'json'
                                        )),
@@ -690,7 +709,7 @@
                                                'menuaction' => 
'property.uirequest.add'
                                        )),
                                        'allrows' => true,
-                                       'select_all' => !!$project_id,
+                                       'select_all' => $make_relation,
                                        'editor_action' => array(),
                                        'field' => array(),
                                        'query' => phpgw::get_var('query')
@@ -738,7 +757,7 @@
                                array_unshift($data['form']['toolbar']['item'], 
$filter);
                        }
 
-                       $this->bo->read(array('project_id' => $project_id, 
'allrows' => $this->allrows,
+                       $this->bo->read(array('make_relation' => 
$make_relation, 'allrows' => $this->allrows,
                                'dry_run' => true));
                        $uicols = $this->bo->uicols;
                        //_debug_array($uicols);die();
@@ -884,8 +903,8 @@
                                $data['datatable']['actions'][] = array
                                        (
                                        'my_name' => 'update_project',
-                                       'statustext' => lang('Update project'),
-                                       'text' => lang('Update project'),
+                                       'statustext' => $lang_update_relation,
+                                       'text' => $lang_update_relation,
                                        'type' => 'custom',
                                        'custom_code' => "
                                                                                
        
@@ -906,8 +925,8 @@
                        }
 
                                                                                
        var path_update = new Array();
-                                                                               
        path_update['menuaction'] = 'property.uiproject.edit';
-                                                                               
        path_update['id'] = '" . $project_id . "';
+                                                                               
        path_update['menuaction'] = '{$update_menuaction}';
+                                                                               
        path_update['id'] = '{$relation_id}';
 
                                                                                
        var sUrl = phpGWLink('index.php', path_update);
 

Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2016-09-08 07:43:11 UTC (rev 15618)
@@ -63,6 +63,7 @@
                 * @var boolean $_simple use simplified interface
                 */
                protected $simple = false;
+               protected $group_candidates = array(-1);
                protected $_show_finnish_date = false;
                protected $_category_acl = false;
                var $part_of_town_id;
@@ -112,6 +113,7 @@
                        $this->location_code = $this->bo->location_code;
                        $this->p_num = $this->bo->p_num;
                        $this->simple = $this->bo->simple;
+                       $this->group_candidates = $this->bo->group_candidates;
                        $this->show_finnish_date = $this->bo->show_finnish_date;
 
                        $this->_category_acl = 
isset($this->bo->config->config_data['acl_at_tts_category']) ? 
$this->bo->config->config_data['acl_at_tts_category'] : false;
@@ -729,9 +731,8 @@
                                        'list' => $values_combo_box[2]
                                );
 
-                               $filter_tts_assigned_to_me = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_assigned_to_me'];
+                               $values_combo_box[4] = 
$this->_get_user_list($this->user_id);
 
-                               $values_combo_box[4] = 
$this->bocommon->get_user_list_right2('filter', PHPGW_ACL_EDIT, $this->user_id, 
$this->acl_location);
                                array_unshift($values_combo_box[4], array(
                                        'id' => -1 * 
$GLOBALS['phpgw_info']['user']['account_id'],
                                        'name' => lang('my assigned tickets'),
@@ -1468,8 +1469,8 @@
                                'lang_no_user' => lang('Select user'),
                                'lang_user_statustext' => lang('Select the user 
the selection belongs to. To do not use a user select NO USER'),
                                'select_user_name' => 'values[assignedto]',
-                               'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $values['assignedto'], 
$this->acl_location),
-//                             'user_list' => 
$this->_get_user_list($values['assignedto']),
+//                             'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $values['assignedto'], 
$this->acl_location),
+                               'user_list' => 
$this->_get_user_list($values['assignedto']),
                                'disable_userassign_on_add' => 
isset($this->bo->config->config_data['tts_disable_userassign_on_add']) ? 
$this->bo->config->config_data['tts_disable_userassign_on_add'] : '',
                                'lang_no_group' => lang('No group'),
                                'group_list' => 
$this->bo->get_group_list($values['group_id']),
@@ -1584,7 +1585,7 @@
                                        'perm' => 1, 'acl_location' => 
$this->acl_location));
                        }
 
-                       $id = phpgw::get_var('id', 'int', 'GET');
+                       $id = phpgw::get_var('id', 'int');
 
                        if ($this->tenant_id)
                        {
@@ -1592,6 +1593,12 @@
                                        'id' => $id));
                        }
 
+                       $add_relation = phpgw::get_var('add_request');
+                       if($add_relation)
+                       {
+                               $receipt = 
$this->bo->add_relation($add_relation, $id);
+                       }
+
                        $bolocation = CreateObject('property.bolocation');
 
                        $values = phpgw::get_var('values');
@@ -2764,8 +2771,25 @@
                        $unspsc_code = $ticket['unspsc_code'] ? 
$ticket['unspsc_code'] : 
$GLOBALS['phpgw_info']['user']['preferences']['property']['unspsc_code'];
                        $enable_order_service_id = 
isset($config->config_data['enable_order_service_id']) && 
$config->config_data['enable_order_service_id'] ? true : false;
                        $enable_unspsc = 
isset($config->config_data['enable_unspsc']) && 
$config->config_data['enable_unspsc'] ? true : false;
+
+                       $relation_type_list = array(
+                               array(
+                                       'id'    => 'property.uirequest.index',
+                                       'name'  => lang('request')
+                               ),
+//                             array(
+//                                     'id'    => 'property.uiproject.index',
+//                                     'name'  => lang('project')
+//                             ),
+//                             array(
+//                                     'id'    => 'property.uilookup.entity',
+//                                     'name'  => 'Everything else'
+//                             ),
+                       );
+
                        $data = array(
                                'datatable_def' => $datatable_def,
+                               'relation_type_list' => array('options' => 
$relation_type_list),
                                'my_groups' => json_encode($my_groups),
                                'custom_attributes' => array('attributes' => 
$ticket['attributes']),
                                'lookup_functions' => 
isset($ticket['lookup_functions']) ? $ticket['lookup_functions'] : '',
@@ -2800,6 +2824,7 @@
                                'td_count' => '""',
                                'base_java_url' => 
"{menuaction:'property.uitts.update_data',id:{$id}}",
                                'location_item_id' => $id,
+                               'value_location_code'   => 
$ticket['location_code'],
                                'value_origin' => $ticket['origin'],
                                'value_target' => $ticket['target'],
                                'value_finnish_date' => $ticket['finnish_date'],
@@ -2812,8 +2837,8 @@
                                'lang_user_statustext' => lang('Select the user 
the selection belongs to. To do not use a user select NO USER'),
                                'select_user_name' => 'values[assignedto]',
                                'value_assignedto_id' => $ticket['assignedto'],
-                               'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $ticket['assignedto'], 
$this->acl_location),
-//                             'user_list' => 
$this->_get_user_list($ticket['assignedto']),
+//                             'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $ticket['assignedto'], 
$this->acl_location),
+                               'user_list' => 
$this->_get_user_list($ticket['assignedto']),
                                'lang_no_group' => lang('No group'),
                                'group_list' => 
$this->bo->get_group_list($ticket['group_id']),
                                'select_group_name' => 'values[group_id]',
@@ -3521,24 +3546,11 @@
 
                private function _get_user_list($selected)
                {
-                       $_candidates = array();
-                       $_candidates[] = -1;
-                       if 
(isset($this->bo->config->config_data['fmtts_assign_group_candidates']) && 
is_array($this->bo->config->config_data['fmtts_assign_group_candidates']))
-                       {
-                               foreach 
($this->bo->config->config_data['fmtts_assign_group_candidates'] as 
$group_candidate)
-                               {
-                                       if ($group_candidate)
-                                       {
-                                               $_candidates[] = 
$group_candidate;
-                                       }
-                               }
-                       }
-
                        $xsl_rootdir = PHPGW_SERVER_ROOT . 
"/property/templates/{$GLOBALS['phpgw_info']['server']['template_set']}";
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'), $xsl_rootdir);
 
-                       $users = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, 
$this->acl_location, 'property', $_candidates);
+                       $users = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, 
$this->acl_location, 'property', $this->group_candidates);
                        $user_list = array();
                        $selected_found = false;
                        foreach ($users as $user)

Modified: branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php  
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php  
2016-09-08 07:43:11 UTC (rev 15618)
@@ -1279,7 +1279,21 @@
                                {
                                        if ($project['project_type_id'] == 
1)//operation
                                        {
-                                               $values['start_date'] = 
$GLOBALS['phpgw']->common->show_date(time(), 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                                               
phpgw::import_class('phpgwapi.datetime');
+                                               if( $project['end_date'] && 
phpgwapi_datetime::date_to_timestamp($project['end_date']) < time() )
+                                               {
+                                                       $values['start_date'] = 
$GLOBALS['phpgw']->common->show_date(
+                                                               
phpgwapi_datetime::date_to_timestamp($project['end_date']),
+                                                               
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']
+                                                       );
+                                               }
+                                               else
+                                               {
+                                                       $values['start_date'] = 
$GLOBALS['phpgw']->common->show_date(
+                                                               time(),
+                                                               
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']
+                                                       );
+                                               }
                                        }
                                        else
                                        {

Modified: branches/Version-2_0-branch/property/js/portico/tts.view.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/tts.view.js 2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/js/portico/tts.view.js 2016-09-08 
07:43:11 UTC (rev 15618)
@@ -248,6 +248,32 @@
        JqueryPortico.updateinlineTableHelper(oTable2, strURL);
 };
 
+this.make_relation = function (id)
+{
+       var oArgs = null;
+       relation_type = $('#make_relation').val();
+       if (relation_type)
+       {
+               if (confirm("Du vil miste informasjon som ikke er lagret"))
+               {
+                       oArgs = {
+                               menuaction: relation_type,
+                               make_relation: true,
+                               relation_id: id,
+                               relation_type: 'ticket',
+                               query: location_code, //defined in xsl
+                               clear_state: 1,
+                       };
+                       var strURL = phpGWLink('index.php', oArgs);
+                       window.open(strURL, '_self');
+               }
+       }
+       else
+       {
+               alert('Velg type');
+       }
+};
+
 window.addEventListener("load", function ()
 {
        d = document.getElementById('vendor_id');
@@ -370,11 +396,11 @@
 {
        ecodimb = ecodimb || $('#ecodimb').val();
 
-       if(!ecodimb)
+       if (!ecodimb)
        {
                return;
        }
-       
+
        var total_amount = Number(amount) + Number($('#budget').val());
        var oArgs = {menuaction: 'property.uitts.check_purchase_right', 
ecodimb: ecodimb, amount: total_amount};
        var requestUrl = phpGWLink('index.php', oArgs, true);
@@ -400,10 +426,10 @@
 
                                        if (obj[i].required == true)
                                        {
-                                               htmlString += "<input 
type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\"" + 
obj[i].address +"\"></input>";
+                                               htmlString += "<input 
type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\"" + 
obj[i].address + "\"></input>";
                                                required = 'checked="checked" 
disabled="disabled"';
                                        }
-                                       htmlString += "<input type=\"checkbox\" 
name=\"values[approval][" + obj[i].id + "]\" value=\"" + obj[i].address +"\"" + 
required +"></input>";
+                                       htmlString += "<input type=\"checkbox\" 
name=\"values[approval][" + obj[i].id + "]\" value=\"" + obj[i].address + "\"" 
+ required + "></input>";
                                        htmlString += "</td><td 
valign=\"top\">";
                                        htmlString += obj[i].address;
                                        htmlString += "</td></tr>";

Modified: branches/Version-2_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/property/setup/phpgw_no.lang    2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/setup/phpgw_no.lang    2016-09-08 
07:43:11 UTC (rev 15618)
@@ -2064,4 +2064,6 @@
 no date        property        no      Ingen dato
 Please select an external project!     property        no      Velg et 
tilnyttet eksternt prosjekt
 mine roles     property        no      Mine roller
-account type   property        no      Rolletype
\ No newline at end of file
+account type   property        no      Rolletype
+update ticket  property        no      Oppdater melding
+make relation  property        no      Opprett kopling
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/templates/base/entity.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/entity.xsl      
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/templates/base/entity.xsl      
2016-09-08 07:43:11 UTC (rev 15618)
@@ -609,7 +609,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'interval')" />
                                                                </label>
-                                                               <input 
type="text" name="repeat_interval" id="repeat_interval" value="1" size="2">
+                                                               <input 
type="text" name="repeat_interval" id="repeat_interval" value="0" size="2">
                                                                </input>
                                                        </div>
                                                                

Modified: branches/Version-2_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/tts.xsl 2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/property/templates/base/tts.xsl 2016-09-08 
07:43:11 UTC (rev 15618)
@@ -281,6 +281,7 @@
 
                var base_java_url = <xsl:value-of select="base_java_url"/>;
                var location_item_id = '<xsl:value-of 
select="location_item_id"/>';
+               var location_code = '<xsl:value-of 
select="value_location_code"/>';
 
                //      var initialSelection = <xsl:value-of 
select="resources_json"/>;
                var lang = <xsl:value-of select="php:function('js_lang',  
'Name', 'Address')"/>
@@ -371,7 +372,31 @@
                                                </div>
                                        </xsl:for-each>
                                        <div class="pure-control-group">
+                                               <xsl:variable 
name="lang_make_relation">
+                                                       <xsl:value-of 
select="php:function('lang', 'make relation')"/>
+                                               </xsl:variable>
+
                                                <label>
+                                                       <a href="#" 
onClick="make_relation({location_item_id});">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="$lang_make_relation"/>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="$lang_make_relation"/>
+                                                       </a>
+                                               </label>
+                                               <select name="make_relation" 
id="make_relation">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="$lang_make_relation"/>
+                                                       </xsl:attribute>
+                                                       <option value="">
+                                                               <xsl:value-of 
select="php:function('lang', 'select')"/>
+                                                       </option>
+                                                       <xsl:apply-templates 
select="relation_type_list/options"/>
+                                               </select>
+                                       </div>
+
+                                       <div class="pure-control-group">
+                                               <label>
                                                        <xsl:value-of 
select="php:function('lang', 'details')"/>
                                                </label>
                                                <xsl:choose>
@@ -448,7 +473,7 @@
                                                                <xsl:variable 
name="select_priority_name">
                                                                        
<xsl:value-of select="select_priority_name"/>
                                                                </xsl:variable>
-                                                               <select 
name="{$select_priority_name}" class="forms" 
title="{$lang_priority_statustext}" 
onMouseover="window.status='{$lang_priority_statustext}'; return true;" 
onMouseout="window.status='';return true;">
+                                                               <select 
name="{$select_priority_name}" class="forms" 
title="{$lang_priority_statustext}">
                                                                        
<xsl:apply-templates select="priority_list/options"/>
                                                                </select>
                                                        </div>

Modified: branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php  
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php  
2016-09-08 07:43:11 UTC (rev 15618)
@@ -267,10 +267,10 @@
                                );
                        }
 
-                       $composite_type = array();
+                       $composite_types = array();
                        foreach ($this->composite_types as $_key => $_value)
                        {
-                               $composite_type[] = array('id' => $_key, 'name' 
=> $_value);
+                               $composite_types[] = array('id' => $_key, 
'name' => $_value);
                        }
 
                        $payment_methods = array();
@@ -334,7 +334,7 @@
                                        'attrib_name' => 'descr')
                                ),
                                'district_list' => array('options' => 
$bocommon->select_district_list('', $application->district_id)),
-                               'composite_type_list' => array('options' => 
$bocommon->select_list($application->composite_type, $composite_type)),
+                               'composite_type_list' => array('options' => 
$bocommon->select_list($application->composite_type, $composite_types)),
                                'payment_method_list' => array('options' => 
$bocommon->select_list($application->payment_method, $payment_methods)),
                                'status_list' => array('options' => 
$this->get_status_options($application->status)),
                                'mode' => $mode,

Modified: branches/Version-2_0-branch/rental/inc/model/class.application.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/model/class.application.inc.php      
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/rental/inc/model/class.application.inc.php      
2016-09-08 07:43:11 UTC (rev 15618)
@@ -45,7 +45,7 @@
                        $ecodimb_id,
                        $ecodimb_name,
                        $district_id,
-                       $composite_type,
+                       $composite_type_id,
                        $date_start,
                        $date_end,
                        $cleaning,
@@ -126,7 +126,7 @@
                                        ),
                                'district_id' => array('action'=> PHPGW_ACL_ADD 
| PHPGW_ACL_EDIT,
                                        'type' => 'int'),
-                               'composite_type' => array('action'=> 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                               'composite_type_id' => array('action'=> 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
                                        'type' => 'int'),
                                'date_start' => array('action'=> PHPGW_ACL_ADD 
| PHPGW_ACL_EDIT,
                                        'type' => 'date'),

Modified: branches/Version-2_0-branch/rental/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/setup.inc.php      2016-09-08 
07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/rental/setup/setup.inc.php      2016-09-08 
07:43:11 UTC (rev 15618)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['rental']['name'] = 'rental';  // Module identifier
-       $setup_info['rental']['version'] = '0.1.0.27'; // Current module version
+       $setup_info['rental']['version'] = '0.1.0.28'; // Current module version
        $setup_info['rental']['app_order'] = 51;  // (?)
        $setup_info['rental']['tables'] = array(
                'rental_party', // All contract participants, tenants etc.

Modified: branches/Version-2_0-branch/rental/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/tables_current.inc.php     
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/rental/setup/tables_current.inc.php     
2016-09-08 07:43:11 UTC (rev 15618)
@@ -495,7 +495,7 @@
                                'id' => array('type' => 'auto', 'nullable' => 
false),
                                'ecodimb_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
                                'district_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
-                               'composite_type' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
+                               'composite_type_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
                                'cleaning' => array('type' => 'int', 
'precision' => '2', 'nullable' => true),
                                'payment_method' => array('type' => 'int', 
'precision' => '2', 'nullable' => false),
                                'date_start' => array('type' => 'int', 
'precision' => '8', 'nullable' => true),

Modified: branches/Version-2_0-branch/rental/setup/tables_update.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/tables_update.inc.php      
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/rental/setup/tables_update.inc.php      
2016-09-08 07:43:11 UTC (rev 15618)
@@ -631,3 +631,29 @@
                }
        }
 
+       $test[] = '0.1.0.27';
+       function rental_upgrade0_1_0_27()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $metadata = 
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata('rental_application');
+               if(isset($metadata['composite_type']))
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->RenameColumn('rental_application', 
'composite_type', 'composite_type_id');
+               }
+               if(isset($metadata['address_1']))
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->RenameColumn('rental_application', 'address_1', 
'address1');
+               }
+               if(isset($metadata['address_2']))
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->RenameColumn('rental_application', 'address_2', 
'address2');
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['rental']['currentver'] = 
'0.1.0.28';
+                       return $GLOBALS['setup_info']['rental']['currentver'];
+               }
+       }
+

Modified: branches/Version-2_0-branch/rental/templates/base/application.xsl
===================================================================
--- branches/Version-2_0-branch/rental/templates/base/application.xsl   
2016-09-08 07:39:49 UTC (rev 15617)
+++ branches/Version-2_0-branch/rental/templates/base/application.xsl   
2016-09-08 07:43:11 UTC (rev 15618)
@@ -98,7 +98,7 @@
                                                                <xsl:value-of 
select="$lang_composite_type"/>
                                                        </label>
 
-                                                       <select 
name="composite_type">
+                                                       <select 
name="composite_type_id">
                                                                <xsl:attribute 
name="title">
                                                                        
<xsl:value-of select="$lang_composite_type"/>
                                                                </xsl:attribute>




reply via email to

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