fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17206] Stable: Merge 17196:17205 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [17206] Stable: Merge 17196:17205 from trunk
Date: Mon, 30 Oct 2017 06:19:40 -0400 (EDT)

Revision: 17206
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17206
Author:   sigurdne
Date:     2017-10-30 06:19:40 -0400 (Mon, 30 Oct 2017)
Log Message:
-----------
Stable: Merge 17196:17205 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/helpdesk/inc/class.botts.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.menu.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php
    branches/Version-2_0-branch/helpdesk/inc/hook_config.inc.php
    branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang
    branches/Version-2_0-branch/helpdesk/setup/setup.inc.php
    branches/Version-2_0-branch/helpdesk/templates/base/config.tpl
    branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
    branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php
    branches/Version-2_0-branch/property/inc/class.boadmin_entity.inc.php
    branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php
    
branches/Version-2_0-branch/property/js/portico/admin_entity.edit_category.js

Added Paths:
-----------
    branches/Version-2_0-branch/helpdesk/inc/class.hook_helper.inc.php

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

Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch 2017-10-30 10:19:40 UTC (rev 17206)

Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
 /branches/dev-syncromind:13653
 /branches/dev-syncromind-2:14933-16846
 /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,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618,16620-16621,16623-16624,16626,16628,16630,16632-16638,16640,16642,16644,16646-16651,16653-16663,16665,16667,16669,16671,16673,16675,16677,16679-16680,16682,16684,16686,16688-16692,16694-16695,16697-16699,16701,16703,16705-16706,16708,16710,16712,16714,16716-16718,16720-16728,16730-16732,16734-16739,16741,16743-16746,16748-16750,16752-16755,16757,16759-16761,16763,16765,16767,16769-16774,16776,16778-16783,16785-16788,16790,16792,16794,16796-16802,16804-16807,16809,16811-16817,16819,16821-16825,16827-16831,16833,16835-16836,16838,16840-16844,16846-16847,16849,16851,16853-16854,16856-16859,16861,16863-16865,16867,16869-16871,16873,16875-16876,16878,16880-16881,16883,16885,16887-16888,16890,16892,16894-16900,16902,16904,16906,16908-16909,16911-16916,16918-16919,16921,16923,16925,16927,16929-16930,16932,16934,16936-16937,16939-16942,16944,16946,16948,16950,16952-16953,16955-16959,16961,16963,16965-16970,16972,16974-16977,16979-16982,16984,16986,16988-16999,17001,17003,17005-17018,17020-17023,17025-17026,17028-17033,17035,17037,17039-17040,17042-17050,17052-17053,17055,17057-17058,17060,17062-17064,17066,17068-17074,17076-17088,17090,17092,17094,17096,17098,17100-17101,17103-17104,17106-17108,17110-17121,17123-17124,17126-17132,17134-17143,17145-17150,17152-17157,17159,17161-17162,17164,17166-17167,17169-17173,17175-17188,17190-17195
\ No newline at end of property
+/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,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618,16620-16621,16623-16624,16626,16628,16630,16632-16638,16640,16642,16644,16646-16651,16653-16663,16665,16667,16669,16671,16673,16675,16677,16679-16680,16682,16684,16686,16688-16692,16694-16695,16697-16699,16701,16703,16705-16706,16708,16710,16712,16714,16716-16718,16720-16728,16730-16732,16734-16739,16741,16743-16746,16748-16750,16752-16755,16757,16759-16761,16763,16765,16767,16769-16774,16776,16778-16783,16785-16788,16790,16792,16794,16796-16802,16804-16807,16809,16811-16817,16819,16821-16825,16827-16831,16833,16835-16836,16838,16840-16844,16846-16847,16849,16851,16853-16854,16856-16859,16861,16863-16865,16867,16869-16871,16873,16875-16876,16878,16880-16881,16883,16885,16887-16888,16890,16892,16894-16900,16902,16904,16906,16908-16909,16911-16916,16918-16919,16921,16923,16925,16927,16929-16930,16932,16934,16936-16937,16939-16942,16944,16946,16948,16950,16952-16953,16955-16959,16961,16963,16965-16970,16972,16974-16977,16979-16982,16984,16986,16988-16999,17001,17003,17005-17018,17020-17023,17025-17026,17028-17033,17035,17037,17039-17040,17042-17050,17052-17053,17055,17057-17058,17060,17062-17064,17066,17068-17074,17076-17088,17090,17092,17094,17096,17098,17100-17101,17103-17104,17106-17108,17110-17121,17123-17124,17126-17132,17134-17143,17145-17150,17152-17157,17159,17161-17162,17164,17166-17167,17169-17173,17175-17188,17190-17195,17197-17205
\ No newline at end of property
Modified: branches/Version-2_0-branch/helpdesk/inc/class.botts.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.botts.inc.php        
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/inc/class.botts.inc.php        
2017-10-30 10:19:40 UTC (rev 17206)
@@ -39,6 +39,7 @@
                var $filter;
                var $sort;
                var $order;
+               var $parent_cat_id;
                var $cat_id;
                var $acl_location;
                var $uicols_related = array();
@@ -80,6 +81,7 @@
                        $this->user_id = phpgw::get_var('user_id', 'int');
                        $this->reported_by = phpgw::get_var('reported_by', 
'int');
                        $this->cat_id = phpgw::get_var('cat_id', 'int');
+                       $this->parent_cat_id = phpgw::get_var('parent_cat_id', 
'int');
                        $this->allrows = phpgw::get_var('allrows', 'bool');
                        $this->start_date = phpgw::get_var('filter_start_date', 
'string');
                        $this->end_date = phpgw::get_var('filter_end_date', 
'string');
@@ -1238,7 +1240,7 @@
 
                public function get_reported_by( $selected = 0 )
                {
-                       $values = $this->so->get_reported_by();
+                       $values = 
$this->so->get_reported_by($this->parent_cat_id);
 
                        foreach ($values as &$entry)
                        {

Copied: branches/Version-2_0-branch/helpdesk/inc/class.hook_helper.inc.php 
(from rev 17205, trunk/helpdesk/inc/class.hook_helper.inc.php)
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.hook_helper.inc.php          
                (rev 0)
+++ branches/Version-2_0-branch/helpdesk/inc/class.hook_helper.inc.php  
2017-10-30 10:19:40 UTC (rev 17206)
@@ -0,0 +1,196 @@
+<?php
+       /**
+        * Helpdesk - Hook helper
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2017 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @package Helpdesk
+        * @version $Id: class.hook_helper.inc.php 14728 2016-02-11 22:28:46Z 
sigurdne $
+        */
+       /*
+         This program is free software: you can redistribute it and/or modify
+         it under the terms of the GNU General Public License as published by
+         the Free Software Foundation, either version 2 of the License, or
+         (at your option) any later version.
+
+         This program is distributed in the hope that it will be useful,
+         but WITHOUT ANY WARRANTY; without even the implied warranty of
+         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+         GNU General Public License for more details.
+
+         You should have received a copy of the GNU General Public License
+         along with this program.  If not, see <http://www.gnu.org/licenses/>.
+        */
+
+
+       phpgw::import_class('frontend.bofellesdata');
+
+       class frontend_hook_helper
+       {
+               private $config;
+
+               public function __construct()
+               {
+
+               }
+
+               /**
+                * Create useraccount on login for SSO/ntlm
+                *
+                * @return void
+                */
+               public function auto_addaccount()
+               {
+                       $account_lid = $GLOBALS['hook_values']['account_lid'];
+
+                       if (!$GLOBALS['phpgw']->accounts->exists($account_lid))
+                       {
+                               $this->config = CreateObject('phpgwapi.config', 
'helpdesk')->read();
+
+                               $autocreate_user = 
isset($this->config['autocreate_user']) && $this->config['autocreate_user'] ? 
$this->config['autocreate_user'] : 0;
+
+                               if ($autocreate_user)
+                               {
+                                       $fellesdata_user = 
frontend_bofellesdata::get_instance()->get_user($account_lid);
+                                       if ($fellesdata_user)
+                                       {
+                                               // Read default assign-to-group 
from config
+                                               $default_group_id = 
isset($this->config['autocreate_default_group']) && 
$this->config['autocreate_default_group'] ? 
$this->config['autocreate_default_group'] : 0;
+                                               $group_lid = 
$GLOBALS['phpgw']->accounts->name2id($default_group_id);
+                                               $group_lid = $group_lid ? 
$group_lid : 'frontend_delegates';
+
+                                               $password = 'PEre' . 
mt_rand(100, mt_getrandmax()) . '&';
+                                               $account_id = 
self::create_phpgw_account($account_lid, $fellesdata_user['firstname'], 
$fellesdata_user['lastname'], $password, $group_lid);
+                                               if ($account_id)
+                                               {
+                                                       
$GLOBALS['phpgw']->redirect_link('/login.php', array());
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               /**
+                * Try to create a phpgw user
+                *
+                * @param string $username      the username
+                * @param string $firstname     the user's first name
+                * @param string $lastname the user's last name
+                * @param string $password      the user's password
+                */
+               public static function create_phpgw_account( string $username, 
string $firstname, string $lastname, string $password, $group_lid = 
'frontend_delegates' )
+               {
+
+                       // Create group account if needed
+                       if (!$GLOBALS['phpgw']->accounts->exists($group_lid)) 
// No group account exist
+                       {
+                               $account = new phpgwapi_group();
+                               $account->lid = $group_lid;
+                               $account->firstname = 'Frontend';
+                               $account->lastname = 'Delegates';
+                               $frontend_delegates = 
$GLOBALS['phpgw']->accounts->create($account, array(), array(), $modules);
+
+                               $aclobj = & $GLOBALS['phpgw']->acl;
+                               $aclobj->set_account_id($frontend_delegates, 
true);
+//                             $aclobj->add('frontend', '.', 1);
+//                             $aclobj->add('frontend', 'run', 1);
+                               $aclobj->add('helpdesk', '.', 1);
+                               $aclobj->add('helpdesk', 'run', 1);
+
+                               $aclobj->add('manual', '.', 1);
+                               $aclobj->add('manual', 'run', 1);
+
+                               $aclobj->add('preferences', 'changepassword', 
1);
+                               $aclobj->add('preferences', '.', 1);
+                               $aclobj->add('preferences', 'run', 1);
+
+                               $aclobj->add('helpdesk', '.ticket', 1);
+
+//                             $aclobj->add('frontend', '.ticket', 1);
+//                             $aclobj->add('frontend', '.rental.contract', 1);
+//                             $aclobj->add('frontend', '.rental.contract_in', 
1);
+                               $aclobj->save_repository();
+                       }
+                       else
+                       {
+                               $frontend_delegates = 
$GLOBALS['phpgw']->accounts->name2id($group_lid);
+                       }
+
+                       if (isset($username) && isset($firstname) && 
isset($lastname) && isset($password))
+                       {
+                               if 
(!$GLOBALS['phpgw']->accounts->exists($username))
+                               {
+                                       $account = new phpgwapi_user();
+                                       $account->lid = $username;
+                                       $account->firstname = $firstname;
+                                       $account->lastname = $lastname;
+                                       $account->passwd = $password;
+                                       $account->enabled = true;
+                                       $account->expires = -1;
+                                       $result = 
$GLOBALS['phpgw']->accounts->create($account, array($frontend_delegates), 
array(), array(
+                                               'helpdesk'));
+                                       if ($result)
+                                       {
+                                               $fellesdata_user = 
frontend_bofellesdata::get_instance()->get_user($username);
+                                               if ($fellesdata_user)
+                                               {
+                                                       $email = 
$fellesdata_user['email'];
+//                                                     if (!empty($email))
+//                                                     {
+//                                                             $title = 
lang('email_create_account_title');
+//                                                             $message = 
lang('email_create_account_message', $fellesdata_user['firstname'], 
$fellesdata_user['lastname']);
+//                                                             
self::send_system_message($email, $title, $message);
+//                                                     }
+                                               }
+
+                                               $preferences = 
createObject('phpgwapi.preferences', $result);
+                                               $preferences->add('common', 
'default_app', 'helpdesk');
+                                               if (!empty($email))
+                                               {
+                                                       
$preferences->add('helpdesk', 'email', $email);
+                                               }
+                                               $preferences->save_repository();
+
+                                               
$GLOBALS['phpgw']->log->write(array('text' => 'I-Notification, user created %1',
+                                                       'p1' => $username));
+                                       }
+
+                                       return $result;
+                               }
+                       }
+                       return false;
+               }
+
+               /**
+                *
+                * @param unknown_type $to
+                * @param unknown_type $title
+                * @param unknown_type $contract_message
+                * @param unknown_type $from
+                */
+               public static function send_system_message( $to, $title, 
$contract_message, $from = 'address@hidden' )
+               {
+                       if 
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'])
+                       {
+                               if (!is_object($GLOBALS['phpgw']->send))
+                               {
+                                       $GLOBALS['phpgw']->send = 
CreateObject('phpgwapi.send');
+                               }
+
+                               try
+                               {
+                                       $rcpt = 
$GLOBALS['phpgw']->send->msg('email', $to, $title, 
stripslashes(nl2br($contract_message)), '', '', '', $from, 'System message', 
'html', '', array(), false);
+                               }
+                               catch (Exception $e)
+                               {
+
+                               }
+
+                               return !!$rcpt;
+
+                       }
+                       return false;
+               }
+
+       }
\ No newline at end of file

Modified: branches/Version-2_0-branch/helpdesk/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.menu.inc.php 2017-10-30 
10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/inc/class.menu.inc.php 2017-10-30 
10:19:40 UTC (rev 17206)
@@ -146,13 +146,52 @@
 
                        if ( $acl->check('.ticket',PHPGW_ACL_READ, 'helpdesk') )
                        {
-                               $menus['navigation']['helpdesk'] = array
-                                       (
-                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'helpdesk.uitts.index')),
-                                               'text'  => lang('inbox'),
-                                               'image'         => 
array('helpdesk', 'helpdesk')
-                                       );
+                               $categories     = 
CreateObject('phpgwapi.categories', -1, 'helpdesk', '.ticket');
+                               $categories->supress_info       = true;
+
+                               $_cats = $categories->return_sorted_array(0, 
false, '', '', '', false, false);
+                               $_categories = array();
+                               $subs = false;
+                               foreach ($_cats as $_cat)
+                               {
+                                       if ($_cat['level'] == 0 && 
$_cat['active'] != 2)
+                                       {
+                                               $_categories[] = $_cat;
+                                       }
+                                       else
+                                       {
+                                               $subs = true;
+                                       }
+                               }
+
+                               if($subs)
+                               {
+                                       $menus['navbar']['helpdesk']['url'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'helpdesk.uitts.index', 'parent_cat_id' => -1));
+
+                                       foreach ($_categories as $_category)
+                                       {
+                                               
$menus['navigation']["helpdesk_{$_category['id']}"] = array
+                                                       (
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'helpdesk.uitts.index', 'parent_cat_id' => $_category['id'])),
+                                                               'text'  => 
$_category['name'],
+                                                               'image'         
=> array('helpdesk', 'helpdesk')
+                                                       );
+                                       }
+                               }
+                               else
+                               {
+                                       $menus['navigation']['helpdesk'] = array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'helpdesk.uitts.index')),
+                                                       'text'  => 
lang('inbox'),
+                                                       'image'         => 
array('helpdesk', 'helpdesk')
+                                               );
+
+                               }
                        }
+
+
+
                        if ( $acl->check('.ticket',PHPGW_ACL_PRIVATE, 
'helpdesk') ) //manage
                        {
                                $menus['navigation']['response_template'] = 
array

Modified: branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php        
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php        
2017-10-30 10:19:40 UTC (rev 17206)
@@ -115,6 +115,7 @@
                        $sort                   = isset($data['sort']) && 
$data['sort'] ? $data['sort']:'DESC';
                        $order                  = 
isset($data['order'])?$data['order']:'';
                        $cat_id                 = isset($data['cat_id']) && 
$data['cat_id'] ? $data['cat_id']:0;
+                       $parent_cat_id  = isset($data['parent_cat_id']) && 
$data['parent_cat_id'] ? $data['parent_cat_id']:0;
                        $start_date             = isset($data['start_date']) && 
$data['start_date'] ? (int)$data['start_date'] : 0;
                        $end_date               = isset($data['end_date']) && 
$data['end_date'] ? (int)$data['end_date'] : 0;
                        $results                = isset($data['results']) && 
$data['results'] ? (int)$data['results'] : 0;
@@ -170,11 +171,25 @@
 
                        $where= 'WHERE';
 
+                       if($parent_cat_id)
+                       {
+                               $_cats  = CreateObject('phpgwapi.categories', 
-1, 'helpdesk', '.ticket')->return_sorted_array(0, false, '', '', '', false, 
$parent_cat_id);
+                               $_filter_cat = array($parent_cat_id);
+                               foreach ($_cats as $_cat)
+                               {
+                                       $_filter_cat[] = $_cat['id'];
+
+                               }
+
+                               $filtermethod = ' WHERE cat_id IN (' . 
implode(',', $_filter_cat) . ')';
+                               $where= 'AND';
+                       }
+
                        $GLOBALS['phpgw']->config->read();
 
                        
if(isset($GLOBALS['phpgw']->config->config_data['acl_at_tts_category']) && 
$GLOBALS['phpgw']->config->config_data['acl_at_tts_category'])
                        {
-                               $filtermethod = " WHERE 
phpgw_helpdesk_tickets.cat_id IN (" . implode(",", $grant_category) . ")";
+                               $filtermethod .= " {$where} 
phpgw_helpdesk_tickets.cat_id IN (" . implode(",", $grant_category) . ")";
                                $where= 'AND';
                        }
 
@@ -1200,11 +1215,29 @@
                        }
                }
 
-               public function get_reported_by()
+               public function get_reported_by($parent_cat_id = 0)
                {
+                       $filtermethod = '';
+
+                       if($parent_cat_id)
+                       {
+                               $categories     = 
CreateObject('phpgwapi.categories', -1, 'helpdesk', '.ticket');
+                               $categories->supress_info       = true;
+                               $_cats = $categories->return_sorted_array(0, 
false, '', '', '', false, $parent_cat_id);
+                               $_filter_cat = array($parent_cat_id);
+                               foreach ($_cats as $_cat)
+                               {
+                                       $_filter_cat[] = $_cat['id'];
+                       
+                               }
+
+                               $filtermethod = ' WHERE cat_id IN (' . 
implode(',', $_filter_cat) . ')';
+                       }
+
                        $values = array();
                        $sql = "SELECT DISTINCT user_id as id , 
account_lastname, account_firstname FROM phpgw_helpdesk_tickets"
                                . " {$this->join} phpgw_accounts ON 
phpgw_helpdesk_tickets.user_id = phpgw_accounts.account_id"
+                               . " {$filtermethod}"
                                . " ORDER BY account_lastname ASC";
 
                        $this->db->query($sql, __LINE__, __FILE__);

Modified: branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php        
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php        
2017-10-30 10:19:40 UTC (rev 17206)
@@ -67,6 +67,7 @@
                var $status;
                var $filter;
                var $user_filter;
+               var $parent_cat_id;
 
                public function __construct()
                {
@@ -101,6 +102,7 @@
                        $this->status_id                        = 
$this->bo->status_id;
                        $this->user_id                          = 
$this->bo->user_id;
                        $this->cat_id                           = 
$this->bo->cat_id;
+                       $this->parent_cat_id            = 
$this->bo->parent_cat_id;
                        $this->district_id                      = 
$this->bo->district_id;
                        $this->allrows                          = 
$this->bo->allrows;
                        $this->start_date                       = 
$this->bo->start_date;
@@ -108,6 +110,10 @@
                        $this->location_code            = 
$this->bo->location_code;
                        $this->p_num                            = 
$this->bo->p_num;
 
+                       if($this->parent_cat_id)
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"helpdesk::helpdesk_$this->parent_cat_id";
+                       }
 
                        $default_interface = 
isset($this->bo->config->config_data['tts_default_interface']) ? 
$this->bo->config->config_data['tts_default_interface'] : '';
 
@@ -241,6 +247,7 @@
                                'branch_id' => phpgw::get_var('branch_id'),
                                'order_dim1' => phpgw::get_var('order_dim1'),
                                'check_date_type' => 
phpgw::get_var('check_date_type', 'int'),
+                               'parent_cat_id' => $this->parent_cat_id
                        );
 
                        return $params;
@@ -287,11 +294,11 @@
                        $result_data['sum_budget'] = $this->bo->sum_budget;
                        $result_data['sum_actual_cost'] = 
$this->bo->sum_actual_cost;
                        $result_data['sum_difference'] = 
$this->bo->sum_difference;
-                       $result_data['draw'] = $draw;
+                       $result_data['draw'] = phpgw::get_var('draw', 'int');
 
                        $link_data = array
                                (
-                               'menuaction' => 'helpdesk.uitts.view',
+                               'menuaction' => 'helpdesk.uitts.view', 
'parent_cat_id' => $this->parent_cat_id
                        );
 
                        array_walk($result_data['results'], array($this, 
'_add_links'), $link_data);
@@ -711,17 +718,36 @@
 
                        if(!$this->_simple)
                        {
-                               $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
-                                       'selected' => $this->cat_id, 'globals' 
=> true, 'use_acl' => $this->_category_acl));
-                               $default_value = array('cat_id' => '', 'name' 
=> lang('no category'));
-                               array_unshift($values_combo_box[0]['cat_list'], 
$default_value);
-
-                               $_categories = array();
-                               foreach ($values_combo_box[0]['cat_list'] as 
$_category)
+                               if($this->parent_cat_id)
                                {
-                                       $_categories[] = array('id' => 
$_category['cat_id'], 'name' => $_category['name']);
+                                       $_cats = 
$this->cats->return_sorted_array(0, false, '', '', '', false, 
$this->parent_cat_id);
+                                       $_categories = array();
+                                       foreach ($_cats as $_cat)
+                                       {
+                                               if($_cat['parent'] == 
$this->parent_cat_id)
+                                               {
+                                                       if ($_cat['active'] != 
2)
+                                                       {
+                                                               $_categories[] 
= $_cat;
+                                                       }
+                                               }
+                                       }
                                }
+                               else
+                               {
+                                       $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
+                                               'selected' => $this->cat_id, 
'globals' => true, 'use_acl' => $this->_category_acl));
 
+                                       $_categories = array();
+                                       foreach 
($values_combo_box[0]['cat_list'] as $_category)
+                                       {
+                                               $_categories[] = array('id' => 
$_category['cat_id'], 'name' => $_category['name']);
+                                       }
+
+                               }
+
+                               array_unshift($_categories, array('id' => '', 
'name' => lang('no category')));
+
                                $combos[] = array('type' => 'filter',
                                        'name' => 'cat_id',
                                        'extra' => '',
@@ -840,6 +866,13 @@
                        
$GLOBALS['phpgw']->jqcal->add_listener('filter_end_date');
 
                        $appname = $this->lang_app_name;
+
+                       if($this->parent_cat_id)
+                       {
+                               $parent_category =  
CreateObject('phpgwapi.categories', -1, 'helpdesk', 
'.ticket')->return_single($this->parent_cat_id);
+                               $appname = !empty($parent_category[0]['name']) 
? $parent_category[0]['name'] : $this->lang_app_name;
+                       }
+
                        $function_msg = lang('list ticket');
 
                        $data = array(
@@ -867,13 +900,13 @@
                                        ),
                                ),
                                'datatable' => array(
-                                       'source' => 
self::link(array('menuaction' => 'helpdesk.uitts.index',
+                                       'source' => 
self::link(array('menuaction' => 'helpdesk.uitts.index', 'parent_cat_id' => 
$this->parent_cat_id,
                                                'phpgw_return_as' => 'json')),
                                        'download' => 
self::link(array('menuaction' => 'helpdesk.uitts.download',
                                                'export' => true, 'allrows' => 
true)),
                                        'allrows' => true,
                                        "columns" => array('onclick' => 
"JqueryPortico.openPopup({menuaction:'helpdesk.uitts.columns'}, 
{closeAction:'reload'})"),
-                                       'new_item' => 
self::link(array('menuaction' => 'helpdesk.uitts.add')),
+                                       'new_item' => 
self::link(array('menuaction' => 'helpdesk.uitts.add', 'parent_cat_id' => 
$this->parent_cat_id)),
                                        'editor_action' => 
self::link(array('menuaction' => 'helpdesk.uitts.edit_survey_title')),
                                        'field' => $this->_get_fields(),
                                        'query' => phpgw::get_var('query')
@@ -902,7 +935,8 @@
                                'text' => lang('view'),
                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                        (
-                                       'menuaction' => 'helpdesk.uitts.view'
+                                       'menuaction' => 'helpdesk.uitts.view',
+                                       'parent_cat_id' => $this->parent_cat_id
                                )),
                                'parameters' => json_encode($parameters)
                        );
@@ -915,6 +949,7 @@
                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                        (
                                        'menuaction' => 'helpdesk.uitts._print',
+                                       'parent_cat_id' => $this->parent_cat_id
                                )),
                                'target' => '_blank',
                                'parameters' => json_encode($parameters)
@@ -933,6 +968,7 @@
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
                                                        'menuaction' => 
'helpdesk.uijasper.view',
+                                                       'parent_cat_id' => 
$this->parent_cat_id,
                                                        'jasper_id' => 
$report['id'],
                                                )),
                                                'target' => '_blank',
@@ -1102,7 +1138,7 @@
                        $values['contact_id'] = phpgw::get_var('contact', 
'int', 'POST');
                        if ((isset($values['cancel']) && $values['cancel']))
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'helpdesk.uitts.index'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'helpdesk.uitts.index','parent_cat_id' => 
$this->parent_cat_id));
                        }
 
                        $values_attribute = phpgw::get_var('values_attribute');
@@ -1302,11 +1338,11 @@
 
                                        if ((isset($values['save']) && 
$values['save']))
                                        {
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'helpdesk.uitts.index'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'helpdesk.uitts.index', 'parent_cat_id' => $this->parent_cat_id));
                                        }
                                        else
                                        {
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'helpdesk.uitts.view',
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'helpdesk.uitts.view', 'parent_cat_id' => $this->parent_cat_id,
                                                        'id' => $receipt['id'], 
'tab' => 'general'));
                                        }
                                }
@@ -1349,7 +1385,7 @@
                                'type' => 'form'));
 
                        $link_data = array(
-                               'menuaction' => 'helpdesk.uitts.add'
+                               'menuaction' => 'helpdesk.uitts.add', 
'parent_cat_id' => $this->parent_cat_id
                        );
 
                        if (!isset($values['assignedto']))
@@ -1389,7 +1425,27 @@
                        $tabs['add'] = array('label' => lang('Add'), 'link' => 
'#add');
                        $active_tab = 'add';
 
+                       $cat_select = 
$this->cats->formatted_xslt_list(array('select_name' => 'values[cat_id]',
+                                       'selected' => $this->cat_id, 'use_acl' 
=> $this->_category_acl, 'required' => true,'class'=>'pure-input-1-2'));
 
+                       /**overide*/
+                       if($this->parent_cat_id)
+                       {
+                               $cat_select['cat_list'] = array();
+
+                               $_cats = $this->cats->return_sorted_array(0, 
false, '', '', '', false, $this->parent_cat_id);
+                               foreach ($_cats as $_cat)
+                               {
+                                       $cat_select['cat_list'][] = array
+                                       (
+                                               'cat_id'        => $_cat['id'],
+                                               'name'          => 
$_cat['name'],
+                                               'selected'      => $_cat['id'] 
== $this->cat_id ? 'selected' : '',
+                                               'description' => 
$_cat['description']
+                                       );
+                               }
+                       }
+
                        $data = array(
                                'my_groups' => json_encode($my_groups),
                                'custom_attributes' => array('attributes' => 
$values['attributes']),
@@ -1430,8 +1486,7 @@
                                'lang_town_statustext' => lang('Select the part 
of town the building belongs to. To do not use a part of town -  select NO PART 
OF TOWN'),
                                'lang_part_of_town' => lang('Part of town'),
                                'lang_no_part_of_town' => lang('No part of 
town'),
-                               'cat_select' => 
$this->cats->formatted_xslt_list(array('select_name' => 'values[cat_id]',
-                                       'selected' => $this->cat_id, 'use_acl' 
=> $this->_category_acl, 'required' => true,'class'=>'pure-input-1-2')),
+                               'cat_select' => $cat_select,
                                'pref_send_mail' => 
(isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_user_mailnotification'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_user_mailnotification']
 : ''),
                                'fileupload' => 
true,//(isset($this->bo->config->config_data['fmttsfileupload']) ? 
$this->bo->config->config_data['fmttsfileupload'] : ''),
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab)
@@ -1750,7 +1805,7 @@
 
                        if(!$ticket)
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'helpdesk.uitts.index'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'helpdesk.uitts.index', 'parent_cat_id' => 
$this->parent_cat_id));
                        }
                        if (isset($ticket['attributes']) && 
is_array($ticket['attributes']))
                        {
@@ -1774,6 +1829,7 @@
 
                        $form_link = array(
                                'menuaction' => 'helpdesk.uitts.view',
+                               'parent_cat_id' => $this->parent_cat_id,
                                'id' => $id
                        );
 
@@ -1955,6 +2011,25 @@
                        $cat_select = 
$this->cats->formatted_xslt_list(array('select_name' => 'values[cat_id]',
                                'selected' => $this->cat_id, 'use_acl' => 
$this->_category_acl, 'required' => true,'class'=>'pure-input-1-2'));
 
+                       /**overide*/
+                       if($this->parent_cat_id)
+                       {
+                               $cat_select['cat_list'] = array();
+
+                               $_cats = $this->cats->return_sorted_array(0, 
false, '', '', '', false, $this->parent_cat_id);
+                               foreach ($_cats as $_cat)
+                               {
+                                       $cat_select['cat_list'][] = array
+                                       (
+                                               'cat_id'        => $_cat['id'],
+                                               'name'          => 
$_cat['name'],
+                                               'selected'      => $_cat['id'] 
== $this->cat_id ? 'selected' : '',
+                                               'description' => 
$_cat['description']
+                                       );
+                               }
+                       }
+
+
                        $_ticket_cat_found = false;
                        if (isset($cat_select['cat_list']) && 
is_array($cat_select['cat_list']))
                        {
@@ -1986,10 +2061,6 @@
                        }
 
 
-//                     $this->cats->set_appname('property','.project');
-//                     $order_catetory = 
$this->cats->formatted_xslt_list(array('select_name' => 
'values[order_cat_id]','selected' => $ticket['order_cat_id']));
-
-
                        $membership = 
$GLOBALS['phpgw']->accounts->membership($this->account);
                        $my_groups = array();
                        foreach ($membership as $group_id => $group)
@@ -2048,7 +2119,7 @@
                                'cat_select' => $cat_select,
                                'value_category_name' => 
$ticket['category_name'],
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $form_link),
-                               'done_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uitts.index')),
+                               'done_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uitts.index','parent_cat_id' => $this->parent_cat_id)),
                                'value_subject' => $ticket['subject'],
                                'value_id' => '[ #' . $id . ' ] - ',
                                'id'            => $id,
@@ -2088,7 +2159,7 @@
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
                                'set_user' => ($ticket['user_id'] != 
$ticket['reverse_id'] && $ticket['assignedto'] ==  $this->account) ? true : 
false
                        );
- 
+
                        phpgwapi_jquery::load_widget('numberformat');
                        phpgwapi_jquery::load_widget('autocomplete');
                        self::add_javascript('helpdesk', 'portico', 
'tts.view.js');
@@ -2181,7 +2252,16 @@
 
                        
$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, 'helpdesk', $this->_group_candidates);
+                       if($this->parent_cat_id)
+                       {
+                               $acl_location = 
".ticket.category.{$this->parent_cat_id}";
+                       }
+                       else
+                       {
+                               $acl_location = $this->acl_location;
+                       }
+
+                       $users = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, $acl_location, 
'helpdesk', $this->_group_candidates);
                        $user_list = array();
                        $selected_found = false;
                        foreach ($users as $user)

Modified: branches/Version-2_0-branch/helpdesk/inc/hook_config.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/hook_config.inc.php        
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/inc/hook_config.inc.php        
2017-10-30 10:19:40 UTC (rev 17206)
@@ -226,3 +226,31 @@
                return $out;
        }
 
+
+               /**
+        * Get HTML selectbox with user groups - which group to add autocreated 
users
+        *
+        * @param $config
+        * @return string options for selectbox
+        */
+       function autocreate_default_group( $config )
+       {
+               $groups = $GLOBALS['phpgw']->accounts->get_list('groups');
+               $group_assigned = isset($config['autocreate_default_group']) ? 
$config['autocreate_default_group'] : '';
+
+               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+
+               foreach ($groups as $group => $label)
+               {
+                       $selected = '';
+                       if ($group_assigned == $group)
+                       {
+                               $selected = ' selected';
+                       }
+
+                       $out .= <<<HTML
+                               <option 
value="{$group}"{$selected}>{$label}</option>
+HTML;
+               }
+               return $out;
+       }

Modified: branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang    2017-10-30 
10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang    2017-10-30 
10:19:40 UTC (rev 17206)
@@ -217,4 +217,6 @@
 ticket status  helpdesk        no      Meldingsstatus
 url    helpdesk        no      Url
 forward        helpdesk        no      Videresend
-ticket is forwarded    helpdesk        no      Melding er videresendt
\ No newline at end of file
+ticket is forwarded    helpdesk        no      Melding er videresendt
+email_create_account_title     helpdesk        no      LRS systemtilgang
+email_create_account_message   helpdesk        no      Systemmelding fra LRS 
til %1 %2:<br/>Det er opprettet en tilgang for deg i LRS<br/><br/>Du får 
tilgang til systemet via kommunens intranett.<br/>Under verktøy i høyre 
kolonne, velg fra LRS listen.<br/>Brukerveiledning finner du i systemet, ved å 
velge "Hjelp" i toppmenyen.<br/>Har du spørsmål send en e-post til LRS 
brukerstøtte.<br/>

Modified: branches/Version-2_0-branch/helpdesk/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/setup.inc.php    2017-10-30 
10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/setup/setup.inc.php    2017-10-30 
10:19:40 UTC (rev 17206)
@@ -66,6 +66,7 @@
                'cat_add'               => 'helpdesk.cat_hooks.cat_add',
                'cat_delete'    => 'helpdesk.cat_hooks.cat_delete',
                'cat_edit'              => 'helpdesk.cat_hooks.cat_edit',
+               'auto_addaccount' => 'helpdesk.hook_helper.auto_addaccount',
                'config',
                'home',
        );

Modified: branches/Version-2_0-branch/helpdesk/templates/base/config.tpl
===================================================================
--- branches/Version-2_0-branch/helpdesk/templates/base/config.tpl      
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/helpdesk/templates/base/config.tpl      
2017-10-30 10:19:40 UTC (rev 17206)
@@ -215,6 +215,23 @@
                                </select>
                        </td>
                </tr>
+               <tr class="row_on">
+                       <td>{lang_activate_autocreate_user}:</td>
+                       <td>
+                               <select name="newsettings[autocreate_user]">
+                                       <option value="" 
{selected_autocreate_user_}>NO</option>
+                                       <option value="1" 
{selected_autocreate_user_1}>YES</option>
+                               </select>
+                       </td>
+               </tr>
+               <tr class="row_off">
+                       <td>{lang_autocreate_default_group}:</td>
+                       <td>
+                               <select 
name="newsettings[autocreate_default_group]">
+                                       {hook_autocreate_default_group}
+                               </select>
+                       </td>
+               </tr>
 
                <!-- END body -->
                <!-- BEGIN footer -->

Modified: branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php        
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php        
2017-10-30 10:19:40 UTC (rev 17206)
@@ -53,6 +53,27 @@
                                $_REQUEST['skip_remote']                        
         = true;
                        }
 
+                       if ( $_POST['mode'] == 'api' )
+                       {
+                               $_POST['submitit'] = true;
+                               $GLOBALS['phpgw_remote_user_fallback']   = 
'sql';
+                               $_REQUEST['skip_remote']                        
         = true;
+                               switch ($_POST['section'])
+                               {
+                                       case 'activitycalendarfrontend':
+                                               
$GLOBALS['phpgw_info']['flags']['session_name'] = 
'activitycalendarfrontendsession';
+                                               break;
+                                       case 'bookingfrontend':
+                                               
$GLOBALS['phpgw_info']['flags']['session_name'] = 'bookingfrontendsession';
+                                               break;
+                                       case 'eventplannerfrontend':
+                                               
$GLOBALS['phpgw_info']['flags']['session_name'] = 'eventplannerfrontendsession';
+                                               break;
+                                       default://nothing
+                                               break;
+                               }
+                       }
+
                        require_once dirname(realpath(__FILE__)) . 
'/sso/include_login.inc.php';
 
                        $lightbox                        = 
isset($_REQUEST['lightbox']) && $_REQUEST['lightbox'] ? true : false;
@@ -147,7 +168,7 @@
                                        'account_lid' => $login
                                );
 
-                               
$GLOBALS['phpgw']->hooks->process('auto_addaccount', array('frontend'));
+                               
$GLOBALS['phpgw']->hooks->process('auto_addaccount', array('frontend', 
'helpdesk'));
 
                        //------------------Start login ntlm
 
@@ -249,7 +270,7 @@
                                        (
                                                'account_lid' => $login
                                        );
-                                       
$GLOBALS['phpgw']->hooks->process('auto_addaccount', array('frontend'));
+                                       
$GLOBALS['phpgw']->hooks->process('auto_addaccount', array('frontend', 
'helpdesk'));
                                        $GLOBALS['sessionid'] = 
$GLOBALS['phpgw']->session->create($login, '');
                                }
 
@@ -352,6 +373,16 @@
                                        exit;
                                }
 
+                               if ( phpgw::get_var('mode', 'string', 'POST') 
== 'api' )
+                               {
+                                       header('Content-Type: 
application/json');
+                                       echo json_encode(array(
+                                               'sessionid' => 
$GLOBALS['sessionid'],
+                                               'session_name'  => 
session_name(),
+                                       ));
+                                       exit;
+                               }
+
                                if ($receipt)
                                {
                                        phpgwapi_cache::message_set($receipt, 
'message');

Modified: branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php      
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php      
2017-10-30 10:19:40 UTC (rev 17206)
@@ -422,6 +422,12 @@
                        $this->add_jquery_translation($data);
                        $data['webserver_url'] = 
$GLOBALS['phpgw_info']['server']['webserver_url'];
 
+                       if (phpgw::get_var('phpgw_return_as', 'string', 'GET') 
== 'json' )
+                       {
+                               echo json_encode($data);
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
                        $output = phpgw::get_var('output', 'string', 'REQUEST', 
'html');
                        $GLOBALS['phpgw']->xslttpl->set_output($output);
                        $this->add_template_file($files);

Modified: branches/Version-2_0-branch/property/inc/class.boadmin_entity.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.boadmin_entity.inc.php       
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/property/inc/class.boadmin_entity.inc.php       
2017-10-30 10:19:40 UTC (rev 17206)
@@ -600,9 +600,9 @@
                        return $this->so->read_category_tree2($entity_id);
                }
 
-               function get_children2( $entity_id, $parent, $level, $reset = 
false, $table )
+               function get_children2( $entity_id, $parent, $level, $reset = 
false )
                {
-                       return $this->so->get_children2($entity_id, $parent, 
$level, $reset, $table);
+                       return $this->so->get_children2($entity_id, $parent, 
$level, $reset);
                }
 
                function convert_to_eav()

Modified: branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php       
2017-10-30 10:14:09 UTC (rev 17205)
+++ branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php       
2017-10-30 10:19:40 UTC (rev 17206)
@@ -162,7 +162,7 @@
                        if ($query)
                        {
                                $query = $this->db->db_addslashes($query);
-                               $querymethod = " AND name {$this->like} 
'%{$query}%' OR descr {$this->like} '%{$query}%'";
+                               $querymethod = " AND (name {$this->like} 
'%{$query}%' OR descr {$this->like} '%{$query}%')";
                        }
                        if ($enable_controller)
                        {

Modified: 
branches/Version-2_0-branch/property/js/portico/admin_entity.edit_category.js
===================================================================
--- 
branches/Version-2_0-branch/property/js/portico/admin_entity.edit_category.js   
    2017-10-30 10:14:09 UTC (rev 17205)
+++ 
branches/Version-2_0-branch/property/js/portico/admin_entity.edit_category.js   
    2017-10-30 10:19:40 UTC (rev 17206)
@@ -35,7 +35,12 @@
                values_tophp.push($(this).val());
        });
 
-       document.form.template_attrib.value = values_tophp;
+       if($("#template_attrib") && values_tophp)
+       {
+
+               $("#template_attrib").val(values_tophp);
+       //      document.form.template_attrib.value = values_tophp;
+       }
        document.form.submit();
 }
 




reply via email to

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