fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16518] Stable: Merge 16513:16517 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [16518] Stable: Merge 16513:16517 from trunk
Date: Sun, 2 Apr 2017 12:26:08 -0400 (EDT)

Revision: 16518
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16518
Author:   sigurdne
Date:     2017-04-02 12:26:07 -0400 (Sun, 02 Apr 2017)
Log Message:
-----------
Stable: Merge 16513:16517 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/booking/inc/class.menu.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.menu.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.uilookup.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/setup/tables_current.inc.php
    branches/Version-2_0-branch/helpdesk/setup/tables_update.inc.php
    branches/Version-2_0-branch/helpdesk/templates/base/config.tpl
    branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-2_0-branch/property/inc/class.uigeneric.inc.php
    branches/Version-2_0-branch/property/templates/base/generic.xsl

Added Paths:
-----------
    branches/Version-2_0-branch/booking/inc/class.bogeneric.inc.php
    branches/Version-2_0-branch/booking/inc/class.sogeneric.inc.php
    branches/Version-2_0-branch/booking/inc/class.uigeneric.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.boemail_out.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.soemail_out.inc.php
    branches/Version-2_0-branch/helpdesk/inc/class.uiemail_out.inc.php
    branches/Version-2_0-branch/helpdesk/inc/model/
    branches/Version-2_0-branch/helpdesk/js/portico/email_out.edit.js
    branches/Version-2_0-branch/helpdesk/templates/base/email_out.xsl

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

Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch 2017-04-02 16:26:07 UTC (rev 16518)

Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
 /branches/dev-syncromind:13653
 /branches/dev-syncromind-2:14933-16394
 /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
\ 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
\ No newline at end of property
Index: branches/Version-2_0-branch/booking
===================================================================
--- branches/Version-2_0-branch/booking 2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/booking 2017-04-02 16:26:07 UTC (rev 16518)

Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
 /branches/dev-syncromind-2/booking:14933-16394
 /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,15621-15630,15637-15639,15641-15643,15645,15647-15665,15667-15668,15695-15712,15714-15764,15820-15849,15889-15900,15902-16046,16055,16101-16130,16144-16212,16297-16305,16307-16314,16393-16395,16490-16497
\ No newline at end of property
+/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,15621-15630,15637-15639,15641-15643,15645,15647-15665,15667-15668,15695-15712,15714-15764,15820-15849,15889-15900,15902-16046,16055,16101-16130,16144-16212,16297-16305,16307-16314,16393-16395,16490-16497,16514-16517
\ No newline at end of property
Copied: branches/Version-2_0-branch/booking/inc/class.bogeneric.inc.php (from 
rev 16517, trunk/booking/inc/class.bogeneric.inc.php)
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.bogeneric.inc.php             
                (rev 0)
+++ branches/Version-2_0-branch/booking/inc/class.bogeneric.inc.php     
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,37 @@
+<?php
+/**
+        * phpGroupWare - booking: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare 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.
+        *
+        * phpGroupWare 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 phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package booking
+        * @subpackage generic
+        * @version $Id: $
+        */
+       phpgw::import_class('property.bogeneric');
+
+       class booking_bogeneric extends property_bogeneric
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+               }
+       }
\ No newline at end of file

Modified: branches/Version-2_0-branch/booking/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.menu.inc.php  2017-04-02 
16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/booking/inc/class.menu.inc.php  2017-04-02 
16:26:07 UTC (rev 16518)
@@ -317,7 +317,7 @@
                                                'office' => array
                                                        (
                                                        'text' => 
lang('office'),
-                                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index',
+                                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'booking.uigeneric.index',
                                                                'type' => 
'bb_office')),
                                                        'children' => array
                                                                (
@@ -324,7 +324,7 @@
                                                                'office_user' 
=> array
                                                                        (
                                                                        'text' 
=> lang('office user'),
-                                                                       'url' 
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index',
+                                                                       'url' 
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'booking.uigeneric.index',
                                                                                
'type' => 'bb_office_user'))
                                                                )
                                                        )

Copied: branches/Version-2_0-branch/booking/inc/class.sogeneric.inc.php (from 
rev 16517, trunk/booking/inc/class.sogeneric.inc.php)
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.sogeneric.inc.php             
                (rev 0)
+++ branches/Version-2_0-branch/booking/inc/class.sogeneric.inc.php     
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,141 @@
+<?php
+       /**
+        * phpGroupWare - booking: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare 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.
+        *
+        * phpGroupWare 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 phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package booking
+        * @subpackage generic
+        * @version $Id: $
+        */
+       phpgw::import_class('property.sogeneric_');
+
+       class booking_sogeneric extends property_sogeneric_
+       {
+
+               var $appname = 'booking';
+
+               function __construct( $type = '', $type_id = 0 )
+               {
+                       parent::__construct($type, $type_id);
+               }
+
+               public function get_location_info( $type, $type_id = 0 )
+               {
+
+                       $type_id = (int)$type_id;
+                       $this->type = $type;
+                       $this->type_id = $type_id;
+                       $info = array();
+
+                       if (!$type)
+                       {
+                               return $info;
+                       }
+
+                       switch ($type)
+                       {
+// START BOOKING TABLES
+                               case 'bb_office':
+                                       $info = array
+                                               (
+                                               'table' => 'bb_office',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'description',
+                                                               'descr' => 
lang('description'),
+                                                               'type' => 'text'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => 
$GLOBALS['phpgw']->translation->translate('office', array(), false, 'booking'),
+                                               'acl_app' => 'booking',
+                                               'acl_location' => '.office',
+                                               'system_location' => '.office',
+                                               'menu_selection' => 
'booking::settings::office',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                                       'modified_date' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => false
+                                       );
+
+                                       break;
+                               case 'bb_office_user':
+                                       $info = array
+                                               (
+                                               'table' => 'bb_office_user',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array(
+                                                       array(
+                                                               'name' => 
'office',
+                                                               'descr' => 
$GLOBALS['phpgw']->translation->translate('office', array(), false, 'booking'),
+                                                               'type' => 
'select',
+                                                               'filter' => 
true,
+                                                               'values_def' => 
array(
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'booking.bogeneric.get_list',
+                                                                       
'get_single_value' => 'booking.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'bb_office', 'selected' => '##office##')
+                                                               )
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => 
$GLOBALS['phpgw']->translation->translate('office user', array(), false, 
'booking'),
+                                               'acl_app' => 'booking',
+                                               'acl_location' => 
'.office.user',
+                                               'system_location' => 
'.office.user',
+                                               'menu_selection' => 
'booking::settings::office::office_user',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                                       'modified_date' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => false
+                                       );
+
+                                       break;
+
+// END BOOKING TABLES
+                               default:
+                                       $message = lang('ERROR: illegal type 
%1', $type);
+                                       phpgwapi_cache::message_set($message, 
'error');
+//                             throw new Exception(lang('ERROR: illegal type 
%1', $type));
+                       }
+
+                       $this->location_info = $info;
+                       return $info;
+               }
+       }
\ No newline at end of file

Copied: branches/Version-2_0-branch/booking/inc/class.uigeneric.inc.php (from 
rev 16517, trunk/booking/inc/class.uigeneric.inc.php)
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uigeneric.inc.php             
                (rev 0)
+++ branches/Version-2_0-branch/booking/inc/class.uigeneric.inc.php     
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,37 @@
+<?php
+/**
+        * phpGroupWare - booking: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare 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.
+        *
+        * phpGroupWare 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 phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package booking
+        * @subpackage generic
+        * @version $Id: $
+        */
+       phpgw::import_class('property.uigeneric');
+
+       class booking_uigeneric extends property_uigeneric
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+               }
+       }
\ No newline at end of file

Copied: branches/Version-2_0-branch/helpdesk/inc/class.boemail_out.inc.php 
(from rev 16517, trunk/helpdesk/inc/class.boemail_out.inc.php)
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.boemail_out.inc.php          
                (rev 0)
+++ branches/Version-2_0-branch/helpdesk/inc/class.boemail_out.inc.php  
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,164 @@
+<?php
+       /**
+        * phpGroupWare
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation 
http://www.fsf.org/
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License v2 or later
+        * @internal
+        * @package helpdesk
+        * @subpackage email_out
+        * @version $Id:$
+        */
+
+       /*
+          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 Lesser 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('phpgwapi.bocommon');
+       phpgw::import_class('helpdesk.soemail_out');
+
+       include_class('helpdesk', 'email_out', 'inc/model/');
+
+       class helpdesk_boemail_out extends phpgwapi_bocommon
+       {
+               protected static
+                       $bo,
+                       $fields,
+                       $acl_location;
+
+               public function __construct()
+               {
+                       $this->fields = helpdesk_email_out::get_fields();
+                       $this->acl_location = helpdesk_email_out::acl_location;
+               }
+
+               /**
+                * Implementing classes must return an instance of itself.
+                *
+                * @return the class instance.
+                */
+               public static function get_instance()
+               {
+                       if (self::$bo == null)
+                       {
+                               self::$bo = new helpdesk_boemail_out();
+                       }
+                       return self::$bo;
+               }
+
+               public function store($object)
+               {
+                       $this->store_pre_commit($object);
+                       $ret = 
helpdesk_soemail_out::get_instance()->store($object);
+                       $this->store_post_commit($object);
+                       return $ret;
+               }
+
+               public function read($params)
+               {
+                       if(empty($params['filters']['active']))
+                       {
+                               $params['filters']['active'] = 1;
+                       }
+                       else
+                       {
+                               unset($params['filters']['active']);
+                       }
+                       $values =  
helpdesk_soemail_out::get_instance()->read($params);
+       //              $status_text = helpdesk_email_out::get_status_list();
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       foreach ($values['results'] as &$entry)
+                       {
+       //                              $entry['status'] = 
$status_text[$entry['status']];
+                                       $entry['created'] = 
$GLOBALS['phpgw']->common->show_date($entry['created']);
+                                       $entry['modified'] = 
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+                       }
+                       return $values;
+               }
+
+               public function read_single($id, $return_object = true)
+               {
+                       if ($id)
+                       {
+                               $values = 
helpdesk_soemail_out::get_instance()->read_single($id, $return_object);
+                       }
+                       else
+                       {
+                               $values = new helpdesk_email_out();
+                       }
+
+                       return $values;
+               }
+
+               public function get_recipient_candidates( $recipient_set_id, 
$email_out_id)
+               {
+                       return 
helpdesk_soemail_out::get_instance()->get_recipient_candidates($recipient_set_id,
 $email_out_id);
+               }
+
+               function set_candidates($id, $ids)
+               {
+                       return 
helpdesk_soemail_out::get_instance()->set_candidates($id, $ids);
+               }
+
+               function delete_recipients($id, $ids)
+               {
+                       return 
helpdesk_soemail_out::get_instance()->delete_recipients($id, $ids);
+               }
+
+               public function get_recipients( $email_out_id )
+               {
+                       return 
helpdesk_soemail_out::get_instance()->get_recipients($email_out_id);
+               }
+
+               public function send_email( $id, $ids = array() )
+               {
+                       $email_out = $this->read_single($id);
+                       $subject = $email_out->subject;
+                       $content = nl2br($email_out->content);
+                       $sogeneric = 
CreateObject('helpdesk.sogeneric','email_recipient_list');
+                       $email_validator = 
CreateObject('phpgwapi.EmailAddressValidator');
+                       if (!is_object($GLOBALS['phpgw']->send))
+                       {
+                               $GLOBALS['phpgw']->send = 
CreateObject('phpgwapi.send');
+                       }
+                       $config = 
CreateObject('phpgwapi.config','helpdesk')->read();;
+
+                       $cc ='';
+                       $bcc = '';
+                       $from_email = $config['from_email'];
+                       $from_name = '';
+                       foreach ($ids as $recipient_id)
+                       {
+                               $recipient = $sogeneric->read_single(array('id' 
=> $recipient_id));
+
+                               $to_email = $recipient['email'];
+                               if 
(!$email_validator->check_email_address($to_email) )
+                               {
+                                       
helpdesk_soemail_out::get_instance()->set_status($id, $recipient_id, 
helpdesk_email_out::STATUS_ERROR);
+                                       continue;
+                               }
+
+                               try
+                               {
+                                       $rcpt = 
$GLOBALS['phpgw']->send->msg('email', $to_email, $subject, 
stripslashes($content), '', $cc, $bcc, $from_email, $from_name, 'html');
+                                       
helpdesk_soemail_out::get_instance()->set_status($id, $recipient_id, 
helpdesk_email_out::STATUS_SENT);
+                               }
+                               catch (Exception $exc)
+                               {
+                                       
helpdesk_soemail_out::get_instance()->set_status($id, $recipient_id, 
helpdesk_email_out::STATUS_ERROR);
+                               }
+                       }
+               }
+       }
\ 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-04-02 
16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/inc/class.menu.inc.php 2017-04-02 
16:26:07 UTC (rev 16518)
@@ -163,6 +163,29 @@
                                        'image' => array('helpdesk', 'helpdesk')
                                );
 
+                               $menus['navigation']['email_out'] = array(
+                                       'text' => lang('email out'),
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uiemail_out.index')),
+                                       'image' => array('helpdesk', 
'helpdesk'),
+                                       'children' => array(
+                                               'template' => array(
+                                                       'text' => lang('email 
template'),
+                                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uigeneric.index',
+                                                               'type' => 
'email_template', 'admin' => true))
+                                               ),
+                                               'recipient_set' => array(
+                                                       'text' => 
lang('recipient set'),
+                                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uigeneric.index',
+                                                               'type' => 
'email_recipient_set', 'admin' => true))
+                                               ),
+                                               'recipient_list' => array(
+                                                       'text' => 
lang('recipient list'),
+                                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uigeneric.index',
+                                                               'type' => 
'email_recipient_list', 'admin' => true))
+                                               ),
+                                       )
+                               );
+
                                $custom_menu_items = 
CreateObject('helpdesk.sogeneric','custom_menu_items')->read_tree(array('type' 
=> 'custom_menu_items',
                                                        'filter' => 
array('location' => '.ticket')));
 

Copied: branches/Version-2_0-branch/helpdesk/inc/class.soemail_out.inc.php 
(from rev 16517, trunk/helpdesk/inc/class.soemail_out.inc.php)
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.soemail_out.inc.php          
                (rev 0)
+++ branches/Version-2_0-branch/helpdesk/inc/class.soemail_out.inc.php  
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,222 @@
+<?php
+       /**
+        * phpGroupWare - property: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare 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.
+        *
+        * phpGroupWare 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 phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+        * @package helpdesk
+        * @subpackage email_out
+        * @version $Id: $
+        */
+       phpgw::import_class('phpgwapi.socommon');
+
+       class helpdesk_soemail_out extends phpgwapi_socommon
+       {
+
+               protected static $so;
+
+               public function __construct()
+               {
+                       parent::__construct('phpgw_helpdesk_email_out', 
helpdesk_email_out::get_fields());
+               }
+
+               /**
+                * Implementing classes must return an instance of itself.
+                *
+                * @return the class instance.
+                */
+               public static function get_instance()
+               {
+                       if (self::$so == null)
+                       {
+                               self::$so = 
CreateObject('helpdesk.soemail_out');
+                       }
+                       return self::$so;
+               }
+
+
+               protected function populate( array $data )
+               {
+                       $object = new helpdesk_email_out();
+                       foreach ($this->fields as $field => $field_info)
+                       {
+                               $object->set_field($field, $data[$field]);
+                       }
+
+                       return $object;
+               }
+
+               protected function update( $object )
+               {
+                       $this->db->transaction_begin();
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $lang_active = lang('active');
+                       $lang_inactive = lang('inactive');
+
+                       $original = 
$this->read_single($object->get_id());//returned as array()
+                       foreach ($this->fields as $field => $params)
+                       {
+                               $new_value = $object->$field;
+                               $old_value = $original[$field];
+                               if (!empty($params['history']) && ($new_value 
!= $old_value))
+                               {
+                                       $label = !empty($params['label']) ? 
lang($params['label']) : $field;
+                                       $value_set = array
+                                       (
+                                               'email_out_id'  => 
$object->get_id(),
+                                               'time'          => time(),
+                                               'author'        => 
$GLOBALS['phpgw_info']['user']['fullname'],
+                                               'comment'       => $label . ':: 
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', ' 
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
+                                               'type'  => 'history',
+                                       );
+
+                                       $this->db->query( 'INSERT INTO 
helpdesk_email_out_comment (' .  implode( ',', array_keys( $value_set ) )   . 
') VALUES ('
+                                       . $this->db->validate_insert( 
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
+                               }
+
+                       }
+
+                       parent::update($object);
+
+                       return  $this->db->transaction_commit();
+               }
+
+               public function get_recipient_candidates( $recipient_set_id , 
$email_out_id)
+               {
+                       $recipient_set_id = (int) $recipient_set_id;
+                       $email_out_id = (int) $email_out_id;
+
+                       $recipients = array(-1);
+                       $sql = "SELECT recipient_id FROM 
phpgw_helpdesk_email_out_recipient WHERE email_out_id = {$email_out_id}";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $recipients[] = $this->db->f('recipient_id');
+                       }
+
+                       $values = array();
+
+                       $sql = "SELECT 
phpgw_helpdesk_email_out_recipient_list.id as id,"
+                               . " email, 
phpgw_helpdesk_email_out_recipient_list.name as name"
+                               . " FROM phpgw_helpdesk_email_out_recipient_set"
+                               . " {$this->join} 
phpgw_helpdesk_email_out_recipient_list ON 
phpgw_helpdesk_email_out_recipient_list.set_id = 
phpgw_helpdesk_email_out_recipient_set.id"
+                               . " WHERE 
phpgw_helpdesk_email_out_recipient_set.id = {$recipient_set_id}"
+                               . " AND 
phpgw_helpdesk_email_out_recipient_list.id NOT IN (" . implode(',', 
$recipients) . ")";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array(
+                                       'id'    => $this->db->f('id'),
+                                       'name'  => $this->db->f('name', true),
+                                       'email' => $this->db->f('email',true),
+                               );
+                       }
+                       return $values;
+               }
+
+               public function get_recipients( $email_out_id )
+               {
+
+                       $status_list = helpdesk_email_out::get_status_list();
+
+                       $email_out_id = (int) $email_out_id;
+                       $values = array();
+
+                       $sql = "SELECT email, 
phpgw_helpdesk_email_out_recipient_list.name as name,"
+                               . " phpgw_helpdesk_email_out_recipient_list.id, 
status"
+                               . " FROM phpgw_helpdesk_email_out"
+                               . " {$this->join} 
phpgw_helpdesk_email_out_recipient ON phpgw_helpdesk_email_out.id = 
phpgw_helpdesk_email_out_recipient.email_out_id"
+                               . " {$this->join} 
phpgw_helpdesk_email_out_recipient_list ON 
phpgw_helpdesk_email_out_recipient_list.id = 
phpgw_helpdesk_email_out_recipient.recipient_id"
+                               . " WHERE phpgw_helpdesk_email_out.id = 
{$email_out_id}";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array(
+                                       'id'    => $this->db->f('id'),
+                                       'name'  => $this->db->f('name',true),
+                                       'email' => $this->db->f('email',true),
+                                       'status'        => 
$status_list[$this->db->f('status')]
+                               );
+                       }
+                       return $values;
+               }
+
+               function set_candidates($id, $ids)
+               {
+                       $recipients = $this->get_recipients($id);
+
+                       $check_duplicates = array();
+                       foreach ($recipients as $entry)
+                       {
+                               $check_duplicates[] = $entry['id'];
+                       }
+
+
+                       $sql = 'INSERT INTO phpgw_helpdesk_email_out_recipient 
(email_out_id, recipient_id)'
+                               . ' VALUES(?, ?)';
+                       foreach ($ids as $recipient_id)
+                       {
+                               if(in_array($recipient_id, $check_duplicates))
+                               {
+                                       continue;
+                               }
+
+                               $valueset[] = array
+                                       (
+                                       1 => array(
+                                               'value' => (int)$id,
+                                               'type' => PDO::PARAM_INT
+                                       ),
+                                       2 => array(
+                                               'value' => $recipient_id,
+                                               'type' => PDO::PARAM_INT
+                                       )
+                               );
+                       }
+                       if($valueset)
+                       {
+                               return $GLOBALS['phpgw']->db->insert($sql, 
$valueset, __LINE__, __FILE__);
+                       }
+               }
+
+               function delete_recipients($id, $ids = array())
+               {
+                       $id = (int) $id;
+                       if($ids)
+                       {
+                               $parties = implode(',', $ids);
+                               $sql = "DELETE FROM 
phpgw_helpdesk_email_out_recipient WHERE email_out_id = {$id} AND recipient_id 
IN ({$parties})"
+                               . " AND (status IS NULL OR status = 0 )";
+                               return $this->db->query($sql,__LINE__,__FILE__);
+                       }
+               }
+
+               function set_status($id, $recipient_id, $status)
+               {
+                       $id = (int) $id;
+                       $recipient_id = (int) $recipient_id;
+                       $status = (int) $status;
+                       $sql = "UPDATE phpgw_helpdesk_email_out_recipient SET 
status = {$status} WHERE email_out_id = {$id} AND recipient_id = 
{$recipient_id}";
+                       return $this->db->query($sql,__LINE__,__FILE__);
+               }
+       }
\ No newline at end of file

Modified: branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php    
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php    
2017-04-02 16:26:07 UTC (rev 16518)
@@ -1,5 +1,5 @@
 <?php
-/**
+       /**
         * phpGroupWare - eventplanner: a part of a Facilities Management 
System.
         *
         * @author Sigurd Nes <address@hidden>
@@ -30,6 +30,7 @@
 
        class helpdesk_sogeneric extends property_sogeneric_
        {
+
                var $appname = 'helpdesk';
 
                function __construct( $type = '', $type_id = 0 )
@@ -37,7 +38,6 @@
                        parent::__construct($type, $type_id);
                }
 
-
                public function get_location_info( $type, $type_id = 0 )
                {
 
@@ -155,6 +155,157 @@
                                        );
 
                                        break;
+                               case 'email_template':
+                                       $info = array
+                                               (
+                                               'table' => 
'phpgw_helpdesk_email_template',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar',
+                                                               'nullable' => 
false
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'content',
+                                                               'descr' => 
lang('content'),
+                                                               'type' => 
'html',
+                                                               'nullable' => 
false
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'public',
+                                                               'descr' => 
lang('public'),
+                                                               'type' => 
'checkbox'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('email 
template'),
+                                               'acl_app' => 'helpdesk',
+                                               'system_location' => 
'.email_out.email_template',
+                                               'acl_location' => '.email_out',
+                                               'menu_selection' => 
'helpdesk::email_out::email_template',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'created' => 
array('add' => 'time()'),
+                                                       'modified' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => true
+                                       );
+
+                                       break;
+                               case 'email_recipient_set':
+                                       $info = array
+                                               (
+                                               'table' => 
'phpgw_helpdesk_email_out_recipient_set',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar',
+                                                               'nullable' => 
false
+                                                       ),
+                                                       array(
+                                                               'name' => 
'active',
+                                                               'descr' => 
lang('active'),
+                                                               'type' => 
'checkbox',
+                                                               'default' => 
'checked',
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array(
+                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('recipient set'),
+                                               'acl_app' => 'helpdesk',
+                                               'system_location' => 
'.email_out.recipient_set',
+                                               'acl_location' => '.email_out',
+                                               'menu_selection' => 
'helpdesk::email_out::recipient_set',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'created' => 
array('add' => 'time()'),
+                                                       'modified' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => true
+                                       );
+
+                                       break;
+                               case 'email_recipient_list':
+                                       $info = array
+                                               (
+                                               'table' => 
'phpgw_helpdesk_email_out_recipient_list',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar',
+                                                               'nullable' => 
false
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'email',
+                                                               'descr' => 
lang('email'),
+                                                               'type' => 
'varchar',
+                                                               'nullable' => 
false
+                                                       ),
+                                                       array(
+                                                               'name' => 
'set_id',
+                                                               'descr' => 
$GLOBALS['phpgw']->translation->translate('recipient set', array(), false, 
'helpdesk'),
+                                                               'type' => 
'select',
+                                                               'filter' => 
true,
+                                                               'nullable' => 
false,
+                                                               'values_def' => 
array(
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'helpdesk.bogeneric.get_list',
+                                                                       
'get_single_value' => 'helpdesk.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'email_recipient_set', 'selected' => 
'##set_id##')
+                                                               )
+                                                       ),
+                                                       array(
+                                                               'name' => 
'active',
+                                                               'descr' => 
lang('active'),
+                                                               'type' => 
'checkbox',
+                                                               'default' => 
'checked',
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array(
+                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('recipient 
list'),
+                                               'acl_app' => 'helpdesk',
+                                               'system_location' => 
'.email_out.recipient_list',
+                                               'acl_location' => '.email_out',
+                                               'menu_selection' => 
'helpdesk::email_out::recipient_list',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'created' => 
array('add' => 'time()'),
+                                                       'modified' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => true
+                                       );
+
+                                       break;
                                case 'custom_menu_items':
                                        $info = array
                                                (
@@ -240,7 +391,8 @@
                                                'mapping' => array('name' => 
'text')
                                        );
 
-                                       break;                          default:
+                                       break;
+                               default:
                                        $message = lang('ERROR: illegal type 
%1', $type);
                                        phpgwapi_cache::message_set($message, 
'error');
 //                             throw new Exception(lang('ERROR: illegal type 
%1', $type));
@@ -249,6 +401,4 @@
                        $this->location_info = $info;
                        return $info;
                }
-
-
        }
\ No newline at end of file

Copied: branches/Version-2_0-branch/helpdesk/inc/class.uiemail_out.inc.php 
(from rev 16517, trunk/helpdesk/inc/class.uiemail_out.inc.php)
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.uiemail_out.inc.php          
                (rev 0)
+++ branches/Version-2_0-branch/helpdesk/inc/class.uiemail_out.inc.php  
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,466 @@
+<?php
+/**
+        * phpGroupWare - helpdesk: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare 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.
+        *
+        * phpGroupWare 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 phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package helpdesk
+        * @subpackage email_out
+        * @version $Id: $
+        */
+       phpgw::import_class('phpgwapi.uicommon');
+       phpgw::import_class('phpgwapi.datetime');
+
+       include_class('helpdesk', 'email_out', 'inc/model/');
+
+       class helpdesk_uiemail_out extends phpgwapi_uicommon
+       {
+
+               public $public_functions = array(
+                       'add' => true,
+                       'index' => true,
+                       'query' => true,
+                       'edit' => true,
+                       'save' => true,
+                       'get' => true,
+                       'get_candidates' => true,
+                       'set_candidates' => true,
+                       'delete_recipients'     => true,
+                       'get_recipients'=> true,
+                       'set_email'             => true,
+                       'send_email'    => true
+               );
+
+               protected
+                       $fields,
+                       $permissions;
+
+               public function __construct()
+               {
+                       parent::__construct();
+                       self::set_active_menu('helpdesk::email_out');
+                       $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' . 
lang('email out');
+                       $this->bo = createObject('helpdesk.boemail_out');
+                       $this->fields = helpdesk_email_out::get_fields();
+                       $this->permissions = 
helpdesk_email_out::get_instance()->get_permission_array();
+               }
+
+
+               public function index()
+               {
+                       if (empty($this->permissions[PHPGW_ACL_READ]))
+                       {
+                               phpgw::no_access();
+                       }
+
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
+
+                       phpgwapi_jquery::load_widget('autocomplete');
+
+                       $function_msg = lang('email out');
+
+                       $data = array(
+                               'datatable_name' => $function_msg,
+                               'form' => array(
+                                       'toolbar' => array(
+                                       )
+                               ),
+                               'datatable' => array(
+                                       'source' => self::link(array(
+                                               'menuaction' => 
'helpdesk.uiemail_out.index',
+                                               'phpgw_return_as' => 'json'
+                                       )),
+                                       'allrows' => true,
+                                       'new_item' => 
self::link(array('menuaction' => 'helpdesk.uiemail_out.add')),
+                                       'editor_action' => '',
+                                       'field' => parent::_get_fields()
+                               )
+                       );
+
+                       $parameters = array(
+                               'parameter' => array(
+                                       array(
+                                               'name' => 'id',
+                                               'source' => 'id'
+                                       )
+                               )
+                       );
+
+                       $data['datatable']['actions'][] = array
+                               (
+                               'my_name' => 'edit',
+                               'text' => lang('edit'),
+                               'action' => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'helpdesk.uiemail_out.edit'
+                               )),
+                               'parameters' => json_encode($parameters)
+                       );
+
+                       self::add_javascript('helpdesk', 'portico', 
'email_out.index.js');
+                       phpgwapi_jquery::load_widget('numberformat');
+
+                       self::render_template_xsl('datatable_jquery', $data);
+               }
+
+               /*
+                * Edit the price item with the id given in the http variable 
'id'
+                */
+
+               public function edit( $values = array(), $mode = 'edit' )
+               {
+                       $active_tab = !empty($values['active_tab']) ? 
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST', 
'first_tab');
+                       $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' . 
lang('edit');
+                       if (empty($this->permissions[PHPGW_ACL_ADD]))
+                       {
+                               phpgw::no_access();
+                       }
+
+                       if (!empty($values['object']))
+                       {
+                               $email_out = $values['object'];
+                       }
+                       else
+                       {
+                               $id = !empty($values['id']) ? $values['id'] : 
phpgw::get_var('id', 'int');
+                               $email_out = $this->bo->read_single($id);
+                       }
+
+                       $tabs = array();
+                       $tabs['first_tab'] = array(
+                               'label' => lang('email out'),
+                               'link' => '#first_tab'
+                       );
+                       $tabs['recipient'] = array(
+                               'label' => lang('recipient'),
+                               'link' => '#recipient',
+                               'disable' => $email_out->get_id() ? false : 
true,
+                       );
+
+
+                       $bocommon = CreateObject('property.bocommon');
+
+                       $comments = (array)$email_out->comments;
+                       foreach ($comments as $key => &$comment)
+                       {
+                               $comment['value_count'] = $key +1;
+                               $comment['value_date'] = 
$GLOBALS['phpgw']->common->show_date($comment['time']);
+                       }
+
+                       $comments_def = array(
+                               array('key' => 'value_count', 'label' => '#', 
'sortable' => true, 'resizeable' => true),
+                               array('key' => 'value_date', 'label' => 
lang('Date'), 'sortable' => true, 'resizeable' => true),
+                               array('key' => 'author', 'label' => 
lang('User'), 'sortable' => true, 'resizeable' => true),
+                               array('key' => 'comment', 'label' => 
lang('Note'), 'sortable' => true, 'resizeable' => true)
+                       );
+ 
+                       $datatable_def[] = array(
+                               'container' => 'datatable-container_0',
+                               'requestUrl' => "''",
+                               'ColumnDefs' => $comments_def,
+                               'data' => json_encode($comments),
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true)
+                               )
+                       );
+
+                       $parties_def = array(
+                               array('key' => 'id', 'label' => 'ID', 
'sortable' => true, 'resizeable' => true,'formatter' => 
'JqueryPortico.formatLink'),
+                               array('key' => 'name', 'label' => lang('name'), 
'sortable' => true, 'resizeable' => true),
+                               array('key' => 'email', 'label' => 
lang('email'), 'sortable' => true, 'resizeable' => true, 'editor' =>true),
+                       );
+
+                       $tabletools = array
+                               (
+                               array('my_name' => 'select_all'),
+                               array('my_name' => 'select_none')
+                       );
+
+                       $tabletools_candidate = array();
+                       $tabletools_candidate[] = array
+                               (
+                               'my_name' => 'add',
+                               'text' => lang('add'),
+                               'type' => 'custom',
+                               'custom_code' => "
+                                               var api = oTable1.api();
+                                               var selected = api.rows( { 
selected: true } ).data();
+
+                                               var numSelected =       
selected.length;
+
+                                               if (numSelected ==0){
+                                                       alert('None selected');
+                                                       return false;
+                                               }
+                                               var ids = [];
+                                               for ( var n = 0; n < 
selected.length; ++n )
+                                               {
+                                                       var aData = selected[n];
+                                                       ids.push(aData['id']);
+                                               }
+                                               
onActionsClick_candidates('add', ids);
+                                               "
+                       );
+
+                       $datatable_def[] = array
+                               (
+                               'container' => 'datatable-container_1',
+                               'requestUrl' => "''",
+//                             'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.notify.update_data',
+//                                             'location_id' => $location_id, 
'location_item_id' => $id, 'action' => 'refresh_notify_contact',
+//                                             'phpgw_return_as' => 'json'))),
+                               'ColumnDefs' => $parties_def,
+                               'data' => json_encode(array()),
+                               'tabletools' => 
array_merge($tabletools,$tabletools_candidate),
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true),
+                                       array('editor_action' => 
self::link(array('menuaction' => 'helpdesk.uiemail_out.set_email')))
+                               )
+                       );
+
+
+                       $tabletools_recipient = array();
+                       $tabletools_recipient[] = array
+                               (
+                               'my_name' => 'delete',
+                               'text' => lang('delete'),
+                               'type' => 'custom',
+                               'custom_code' => "
+                                               var api = oTable2.api();
+                                               var selected = api.rows( { 
selected: true } ).data();
+
+                                               var numSelected =       
selected.length;
+
+                                               if (numSelected ==0){
+                                                       alert('None selected');
+                                                       return false;
+                                               }
+                                               var ids = [];
+                                               for ( var n = 0; n < 
selected.length; ++n )
+                                               {
+                                                       var aData = selected[n];
+                                                       ids.push(aData['id']);
+                                               }
+                                               
onActionsClick_recipient('delete_recipients', ids);
+                                               "
+                       );
+                       $tabletools_recipient[] = array
+                               (
+                               'my_name' => 'send_email',
+                               'text' => lang('send email'),
+                               'type' => 'custom',
+                               'custom_code' => "
+                                               var api = oTable2.api();
+                                               var selected = api.rows( { 
selected: true } ).data();
+
+                                               var numSelected =       
selected.length;
+
+                                               if (numSelected ==0){
+                                                       alert('None selected');
+                                                       return false;
+                                               }
+                                               var ids = [];
+                                               for ( var n = 0; n < 
selected.length; ++n )
+                                               {
+                                                       var aData = selected[n];
+                                                       ids.push(aData['id']);
+                                               }
+                                               
onActionsClick_recipient('send_email', ids);
+                                               "
+                       );
+
+
+                       $parties_def[] = array('key' => 'status', 'label' => 
lang('status'), 'sortable' => true, 'resizeable' => true);
+
+
+                       $datatable_def[] = array
+                               (
+                               'container' => 'datatable-container_2',
+                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 
'helpdesk.uiemail_out.get_recipients',
+                                               'id' => $id,'phpgw_return_as' 
=> 'json'))),
+                               'ColumnDefs' => $parties_def,
+                               'data' => json_encode(array()),
+                               'tabletools' => 
array_merge($tabletools,$tabletools_recipient),
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true),
+                                       array('editor_action' => 
self::link(array('menuaction' => 'helpdesk.uiemail_out.set_email')))
+                               )
+                       );
+
+                       $data = array(
+                               'datatable_def' => $datatable_def,
+                               'form_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uiemail_out.save')),
+                               'cancel_url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uiemail_out.index',)),
+                               'email_out' => $email_out,
+                               'mode' => $mode,
+                               'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+                               'value_active_tab' => $active_tab
+                       );
+                       phpgwapi_jquery::load_widget('autocomplete');
+                       phpgwapi_jquery::formvalidator_generate(array());
+                       self::rich_text_editor('content');
+                       self::add_javascript('helpdesk', 'portico', 
'email_out.edit.js');
+                       self::render_template_xsl(array('email_out', 
'datatable_inline'), array($mode => $data));
+               }
+
+               /*
+                * Get the email_out with the id given in the http variable 'id'
+                */
+
+               public function get( $id = 0 )
+               {
+                       if (empty($this->permissions[PHPGW_ACL_ADD]))
+                       {
+                               phpgw::no_access();
+                       }
+
+                       $id = !empty($id) ? $id : phpgw::get_var('id', 'int');
+
+                       $email_out = $this->bo->read_single($id)->toArray();
+
+                       unset($email_out['secret']);
+
+                       return $email_out;
+               }
+
+               public function save()
+               {
+                       parent::save();
+               }
+
+               public function get_candidates( )
+               {
+                       if (empty($this->permissions[PHPGW_ACL_ADD]))
+                       {
+                               phpgw::no_access();
+                       }
+                       $type =  phpgw::get_var('type', 'string');
+                       $set_id =  phpgw::get_var('set_id', 'int');
+                       $email_out_id =  phpgw::get_var('id', 'int');
+
+                       switch ($type)
+                       {
+                               case 'recipient_set':
+                                       $values = 
$this->bo->get_recipient_candidates($set_id, $email_out_id);
+                                       array_walk($values, array($this, 
"_add_links"), array('menuaction' => 'helpdesk.uigeneric.edit',
+                                                               'type' => 
'email_recipient_list'));
+
+                                       break;
+
+                               default:
+                                       $values = array();
+                                       break;
+                       }
+
+                       return $this->jquery_results(array('results' => 
$values));
+               }
+
+               public function set_candidates()
+               {
+                       if (empty($this->permissions[PHPGW_ACL_EDIT]))
+                       {
+                               phpgw::no_access();
+                       }
+                       $id =  phpgw::get_var('id', 'int');
+                       $ids =  (array) phpgw::get_var('ids', 'int');
+                       $ret = $this->bo->set_candidates($id, $ids);
+               }
+
+               public function delete_recipients()
+               {
+                       if (empty($this->permissions[PHPGW_ACL_EDIT]))
+                       {
+                               phpgw::no_access();
+                       }
+                       $id =  phpgw::get_var('id', 'int');
+                       $ids =  (array) phpgw::get_var('ids', 'int');
+                       $ret = $this->bo->delete_recipients($id, $ids);
+               }
+
+               public function get_recipients()
+               {
+                       if (empty($this->permissions[PHPGW_ACL_EDIT]))
+                       {
+                               phpgw::no_access();
+                       }
+                       $id =  phpgw::get_var('id', 'int');
+                       $values = $this->bo->get_recipients($id);
+                       array_walk($values, array($this, "_add_links"), 
array('menuaction' => 'helpdesk.uigeneric.edit',
+                                                               'type' => 
'email_recipient_list'));
+                       return $this->jquery_results(array('results' => 
$values));
+
+               }
+
+               public function send_email( )
+               {
+                       if (empty($this->permissions[PHPGW_ACL_EDIT]))
+                       {
+                               phpgw::no_access();
+                       }
+                       $id =  phpgw::get_var('id', 'int');
+                       $ids =  (array) phpgw::get_var('ids', 'int');
+                       $ret = $this->bo->send_email($id, $ids);
+               }
+
+               public function set_email( )
+               {
+                       if (empty($this->permissions[PHPGW_ACL_EDIT]))
+                       {
+                               phpgw::no_access();
+                       }
+
+                       phpgw::import_class('helpdesk.soparty');
+
+                       $field_name = phpgw::get_var('field_name');
+                       $email = phpgw::get_var('value');
+                       $id = phpgw::get_var('id');
+                       $email_validator = 
CreateObject('phpgwapi.EmailAddressValidator');
+                       $message = array();
+                       if (!$email_validator->check_email_address($email) )
+                       {
+                               $message['error'][] = array('msg' => lang('data 
has not validated'));
+                               return $message;
+                       }
+
+                       $party = 
helpdesk_soparty::get_instance()->get_single($id);
+                       $party->set_field('email', $email);
+                       $result = 
helpdesk_soparty::get_instance()->store($party);
+
+                       $message = array();
+                       if ($result)
+                       {
+                               $message['message'][] = array('msg' => 
lang('data has been saved'));
+                       }
+                       else
+                       {
+                               $message['error'][] = array('msg' => lang('data 
has not been saved'));
+                       }
+
+                       return $message;
+
+               }
+       }
\ No newline at end of file

Modified: branches/Version-2_0-branch/helpdesk/inc/class.uilookup.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.uilookup.inc.php     
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/inc/class.uilookup.inc.php     
2017-04-02 16:26:07 UTC (rev 16518)
@@ -54,6 +54,7 @@
                        'ecodimb' => true,
                        'order_template' => true,
                        'response_template' => true,
+                       'email_template' => true,
                        'custom' => true
                );
 
@@ -162,4 +163,105 @@
 
                        self::render_template_xsl('datatable_jquery', $data);
                }
+
+               function email_template()
+               {
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               $search = phpgw::get_var('search');
+                               $order = phpgw::get_var('order');
+                               $draw = phpgw::get_var('draw', 'int');
+                               $columns = phpgw::get_var('columns');
+
+                               $params = array(
+                                       'start' => phpgw::get_var('start', 
'int', 'REQUEST', 0),
+                                       'results' => phpgw::get_var('length', 
'int', 'REQUEST', 0),
+                                       'query' => $search['value'],
+                                       'order' => 
$columns[$order[0]['column']]['data'],
+                                       'sort' => $order[0]['dir'],
+                                       'dir' => $order[0]['dir'],
+                                       'allrows' => phpgw::get_var('length', 
'int') == -1,
+                                       'filter' => ''
+                               );
+
+                               $values = array();
+                               $bo = CreateObject('helpdesk.bogeneric');
+                               $bo->get_location_info('email_template');
+                               $values = $bo->read($params);
+
+                               $result_data = array
+                                       (
+                                       'results' => $values,
+                                       'total_records' => $bo->total_records,
+                                       'draw' => $draw
+                               );
+                               return $this->jquery_results($result_data);
+                       }
+
+//                     $action = 'var temp = 
parent.document.getElementById("content").value;' . "\r\n";
+//                     $action .= 'if(temp){temp = temp + "\n";}' . "\r\n";
+//                     $action .= 
'parent.document.getElementById("content").value = temp + aData["content"];' . 
"\r\n";
+//                     $action .= 
'parent.JqueryPortico.onPopupClose("close");' . "\r";
+
+                       $action = <<<JS
+
+                               var encodedStr = aData["content"];
+                               var parser = new DOMParser;
+                               var dom = 
parser.parseFromString(encodedStr,'text/html');
+                               var decodedString = dom.body.textContent;
+                               parent.$.fn.insertAtCaret(decodedString);
+                               parent.JqueryPortico.onPopupClose("close");
+JS;
+
+                       $data = array(
+                               'left_click_action' => $action,
+                               'datatable_name' => '',
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array()
+                                       )
+                               ),
+                               'datatable' => array(
+                                       'source' => self::link(array(
+                                               'menuaction' => 
'helpdesk.uilookup.email_template',
+                                               'query' => $this->query,
+                                               'filter' => $this->filter,
+                                               'cat_id' => $this->cat_id,
+                                               'type' => 'email_template',
+                                               'phpgw_return_as' => 'json'
+                                       )),
+                                       'allrows' => true,
+                                       'editor_action' => '',
+                                       'field' => array()
+                               )
+                       );
+
+                       $uicols = array(
+                               'input_type' => array('text', 'text', 'text'),
+                               'name' => array('id', 'name', 'content'),
+                               'formatter' => array('', '', ''),
+                               'descr' => array(lang('ID'), lang('name'), 
lang('content'))
+                       );
+
+                       $count_uicols_name = count($uicols['name']);
+
+                       for ($k = 0; $k < $count_uicols_name; $k++)
+                       {
+                               $params = array(
+                                       'key' => $uicols['name'][$k],
+                                       'label' => $uicols['descr'][$k],
+                                       'sortable' => $uicols['sortable'][$k],
+                                       'hidden' => false
+                               );
+
+                               array_push($data['datatable']['field'], 
$params);
+                       }
+
+                       $appname = lang('template');
+                       $function_msg = lang('list email template');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('helpdesk') . ' - ' . $appname . ': ' . $function_msg;
+
+                       self::render_template_xsl('datatable_jquery', $data);
+               }
        }
\ No newline at end of file

Copied: branches/Version-2_0-branch/helpdesk/js/portico/email_out.edit.js (from 
rev 16517, trunk/helpdesk/js/portico/email_out.edit.js)
===================================================================
--- branches/Version-2_0-branch/helpdesk/js/portico/email_out.edit.js           
                (rev 0)
+++ branches/Version-2_0-branch/helpdesk/js/portico/email_out.edit.js   
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,133 @@
+var oArgs = {
+       menuaction: 'helpdesk.bogeneric.get_autocomplete',
+       type: 'email_recipient_set',
+       active: 1
+};
+var strURL = phpGWLink('index.php', oArgs, true);
+JqueryPortico.autocompleteHelper(strURL, 'recipient_set_name', 
'recipient_set_id', 'recipient_set_container');
+
+
+$(window).on('load', function ()
+{
+       recipient_set_id = $('#recipient_set_id').val();
+       if (recipient_set_id)
+       {
+               recipient_set_id_selection = recipient_set_id;
+       }
+       $("#recipient_set_name").on("autocompleteselect", function (event, ui)
+       {
+               var recipient_set_id = ui.item.value;
+//             if (recipient_set_id != recipient_set_id_selection)
+//             {
+               populateCandidates('recipient_set', recipient_set_id);
+//             }
+       });
+
+       $.fn.insertAtCaret = function (myValue)
+       {
+               myValue = myValue.trim();
+               CKEDITOR.instances['content'].insertText(myValue);
+       };
+
+});
+
+function populateCandidates(type, recipient_set_id)
+{
+       recipient_set_id = recipient_set_id || $('#recipient_set_id').val();
+
+       if (!recipient_set_id)
+       {
+               return;
+       }
+
+       oArgs = {
+               menuaction: 'helpdesk.uiemail_out.get_candidates',
+               type: type,
+               set_id: recipient_set_id,
+               id: $('#id').val()
+       };
+
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+       JqueryPortico.updateinlineTableHelper(oTable1, requestUrl);
+
+}
+
+this.onActionsClick_candidates = function (type, ids)
+{
+//             console.log(ids);
+       oArgs = {
+               menuaction: 'helpdesk.uiemail_out.set_candidates',
+               id: $('#id').val()
+       };
+
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+
+       $.ajax({
+               type: 'POST',
+               dataType: 'json',
+               url: requestUrl,
+               data: {ids: ids, type: type},
+               success: function (data)
+               {
+                       if (data != null)
+                       {
+
+                       }
+                       oArgs = {
+                               menuaction: 
'helpdesk.uiemail_out.get_recipients',
+                               id: $('#id').val()
+                       };
+
+                       var requestUrl = phpGWLink('index.php', oArgs, true);
+                       JqueryPortico.updateinlineTableHelper(oTable2, 
requestUrl);
+                       oArgs = {
+                               menuaction: 
'helpdesk.uiemail_out.get_candidates',
+                               type: 'recipient_set',
+                               set_id: $('#recipient_set_id').val(),
+                               id: $('#id').val()
+                       };
+
+                       var requestUrl = phpGWLink('index.php', oArgs, true);
+                       JqueryPortico.updateinlineTableHelper(oTable1, 
requestUrl);
+               }
+       });
+
+}
+this.onActionsClick_recipient = function (type, ids)
+{
+       oArgs = {
+               menuaction: 'helpdesk.uiemail_out.' + type,
+               id: $('#id').val()
+       };
+
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+
+       $.ajax({
+               type: 'POST',
+               dataType: 'json',
+               url: requestUrl,
+               data: {ids: ids, type: type},
+               success: function (data)
+               {
+                       if (data != null)
+                       {
+
+                       }
+                       oArgs = {
+                               menuaction: 
'helpdesk.uiemail_out.get_recipients',
+                               id: $('#id').val()
+                       };
+
+                       var requestUrl = phpGWLink('index.php', oArgs, true);
+                       JqueryPortico.updateinlineTableHelper(oTable2, 
requestUrl);
+               }
+       });
+
+}
+
+function template_lookup()
+{
+       var oArgs = {menuaction: 'helpdesk.uilookup.email_template'};
+       var strURL = phpGWLink('index.php', oArgs);
+       TINY.box.show({iframe: strURL, boxid: "frameless", width: 750, height: 
450, fixed: false, maskid: "darkmask", maskopacity: 40, mask: true, animate: 
true, close: true});
+}

Modified: branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang    2017-04-02 
16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/setup/phpgw_no.lang    2017-04-02 
16:26:07 UTC (rev 16518)
@@ -181,4 +181,22 @@
 inbox  helpdesk        no      Innboks
 standard text  helpdesk        no      Standardtekst
 custom menu items      helpdesk        no      Tilpassede menyer
-reports        helpdesk        no      Rapporter
\ No newline at end of file
+reports        helpdesk        no      Rapporter
+email out      helpdesk        no      Epost ut
+recipient      helpdesk        no      Mottaker
+recipients     helpdesk        no      Mottakere
+candidates     helpdesk        no      Kandidater
+send email     helpdesk        no      Send epost
+remark helpdesk        no      Merknad
+subject        helpdesk        no      Overskrift
+content        helpdesk        no      Innhold
+select all     helpdesk        no      Velg alle
+planned        helpdesk        no      Planlagt
+email template helpdesk        no      Standardtekster
+recipient set  helpdesk        no      mottaker sett
+list   helpdesk        no      List
+recipient list helpdesk        no      Mottaker liste
+select helpdesk        no      Velg
+modified       helpdesk        no      Endret
+sent   helpdesk        no      Sendt
+generic        helpdesk        no      Generelt
\ No newline at end of file

Modified: branches/Version-2_0-branch/helpdesk/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/setup.inc.php    2017-04-02 
16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/setup/setup.inc.php    2017-04-02 
16:26:07 UTC (rev 16518)
@@ -3,7 +3,7 @@
        * phpGroupWare - helpdesk.
        *
        * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2009 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @copyright Copyright (C) 2003-2017 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package helpdesk
@@ -12,7 +12,7 @@
        */
 
        $setup_info['helpdesk']['name']                 = 'helpdesk';
-       $setup_info['helpdesk']['version']              = '0.9.18.003';
+       $setup_info['helpdesk']['version']              = '0.9.18.004';
        $setup_info['helpdesk']['app_order']    = 8;
        $setup_info['helpdesk']['enable']               = 1;
        $setup_info['helpdesk']['app_group']    = 'office';
@@ -49,7 +49,12 @@
                'phpgw_helpdesk_tickets',
                'phpgw_helpdesk_views',
                'phpgw_helpdesk_response_template',
-               'phpgw_helpdesk_custom_menu_items'
+               'phpgw_helpdesk_custom_menu_items',
+               'phpgw_helpdesk_email_template',
+               'phpgw_helpdesk_email_out',
+               'phpgw_helpdesk_email_out_recipient_set',
+               'phpgw_helpdesk_email_out_recipient_list',
+               'phpgw_helpdesk_email_out_recipient'
        );
 
        /* The hooks this app includes, needed for hooks registration */

Modified: branches/Version-2_0-branch/helpdesk/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/tables_current.inc.php   
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/setup/tables_current.inc.php   
2017-04-02 16:26:07 UTC (rev 16518)
@@ -119,6 +119,85 @@
                        'fk' => array(),
                        'ix' => array(),
                        'uc' => array()
+               ),
+               'phpgw_helpdesk_email_out' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'remark' => array('type' => 'text', 'nullable' 
=> True),
+                               'subject' => array('type' => 'text', 'nullable' 
=> false),
+                               'content' => array('type' => 'text', 'nullable' 
=> True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'created' => array('type' => 'int', 'precision' 
=> 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+               'phpgw_helpdesk_email_out_recipient_set' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'active' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True, 'default' => '0'),
+                               'public' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'created' => array('type' => 'int', 'precision' 
=> 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+               'phpgw_helpdesk_email_out_recipient_list' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'set_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'email' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'active' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True, 'default' => '0'),
+                               'public' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'created' => array('type' => 'int', 'precision' 
=> 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(
+                               'phpgw_helpdesk_email_out_recipient_set' => 
array('set_id' => 'id'),
+                       ),
+                       'ix' => array(),
+                       'uc' => array('set_id', 'email')
+               ),
+               'phpgw_helpdesk_email_out_recipient' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'email_out_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => False),
+                               'recipient_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => False),
+                               'status' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True, 'default' => '0'),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(
+                               'phpgw_helpdesk_email_out' => 
array('email_out_id' => 'id'),
+                               'phpgw_helpdesk_email_out_recipient_list' => 
array('recipient_id' => 'id'),
+                       ),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+               'phpgw_helpdesk_email_template' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'content' => array('type' => 'text', 'nullable' 
=> True),
+                               'public' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'entry_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               'modified_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
                )
-
        );

Modified: branches/Version-2_0-branch/helpdesk/setup/tables_update.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/setup/tables_update.inc.php    
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/setup/tables_update.inc.php    
2017-04-02 16:26:07 UTC (rev 16518)
@@ -103,4 +103,117 @@
                        $GLOBALS['setup_info']['helpdesk']['currentver'] = 
'0.9.18.003';
                        return $GLOBALS['setup_info']['helpdesk']['currentver'];
                }
+       }
+
+       /**
+       * Update helpdesk version from 0.9.18.003 to 0.9.18.004
+       */
+       $test[] = '0.9.18.003';
+
+       function helpdesk_upgrade0_9_18_003()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
+               $GLOBALS['phpgw']->locations->add('.email_out', 'email out', 
'helpdesk');
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_helpdesk_email_template', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => False),
+                                       'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                                       'content' => array('type' => 'text', 
'nullable' => True),
+                                       'public' => array('type' => 'int', 
'precision' => 2, 'nullable' => True),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
+                                       'created' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                                       'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_helpdesk_email_out', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => False),
+                                       'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                                       'remark' => array('type' => 'text', 
'nullable' => True),
+                                       'subject' => array('type' => 'text', 
'nullable' => false),
+                                       'content' => array('type' => 'text', 
'nullable' => True),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
+                                       'created' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                                       'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_helpdesk_email_out_recipient_set',  array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => False),
+                                       'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                                       'active' => array('type' => 'int', 
'precision' => 2, 'nullable' => True, 'default' => '0'),
+                                       'public' => array('type' => 'int', 
'precision' => 2, 'nullable' => True),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
+                                       'created' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                                       'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_helpdesk_email_out_recipient_list',  array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => False),
+                                       'set_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => False),
+                                       'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                                       'email' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                                       'active' => array('type' => 'int', 
'precision' => 2, 'nullable' => True, 'default' => '0'),
+                                       'public' => array('type' => 'int', 
'precision' => 2, 'nullable' => True),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
+                                       'created' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                                       'modified' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(
+                                       
'phpgw_helpdesk_email_out_recipient_set' => array('set_id' => 'id'),
+                               ),
+                               'ix' => array(),
+                               'uc' => array('set_id', 'email')
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_helpdesk_email_out_recipient',  array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => False),
+                                       'email_out_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => False),
+                                       'recipient_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => False),
+                                       'status' => array('type' => 'int', 
'precision' => 2, 'nullable' => True, 'default' => '0'),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(
+                                       'phpgw_helpdesk_email_out' => 
array('email_out_id' => 'id'),
+                                       
'phpgw_helpdesk_email_out_recipient_list' => array('recipient_id' => 'id'),
+                               ),
+                               'ix' => array(),
+                               'uc' => array()
+               ));
+
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['helpdesk']['currentver'] = 
'0.9.18.004';
+                       return $GLOBALS['setup_info']['helpdesk']['currentver'];
+               }
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/helpdesk/templates/base/config.tpl
===================================================================
--- branches/Version-2_0-branch/helpdesk/templates/base/config.tpl      
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/helpdesk/templates/base/config.tpl      
2017-04-02 16:26:07 UTC (rev 16518)
@@ -19,6 +19,10 @@
                                {lang_default}: {lang_Helpdesk}</td>
                        <td><input name="newsettings[app_name]" 
value="{value_app_name}"></td>
                </tr>
+               <tr>
+                       <td>{lang_from_email}: <br>
+                       <td><input name="newsettings[from_email]" 
value="{value_from_email}"></td>
+               </tr>
                <tr class="row_off">
                        <td>{lang_show_billable_hours}:</td>
                        <td>

Copied: branches/Version-2_0-branch/helpdesk/templates/base/email_out.xsl (from 
rev 16517, trunk/helpdesk/templates/base/email_out.xsl)
===================================================================
--- branches/Version-2_0-branch/helpdesk/templates/base/email_out.xsl           
                (rev 0)
+++ branches/Version-2_0-branch/helpdesk/templates/base/email_out.xsl   
2017-04-02 16:26:07 UTC (rev 16518)
@@ -0,0 +1,225 @@
+
+<!-- $Id: price_item.xsl 12604 2015-01-15 17:06:11Z nelson224 $ -->
+<xsl:template match="data">
+       <xsl:choose>
+               <xsl:when test="edit">
+                       <xsl:apply-templates select="edit" />
+               </xsl:when>
+               <xsl:when test="view">
+                       <xsl:apply-templates select="view" />
+               </xsl:when>
+       </xsl:choose>
+
+</xsl:template>
+
+<!-- add / edit  -->
+<xsl:template xmlns:php="http://php.net/xsl"; match="edit">
+       <xsl:variable name="date_format">
+               <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')" />
+       </xsl:variable>
+       <xsl:variable name="form_action">
+               <xsl:value-of select="form_action"/>
+       </xsl:variable>
+       <xsl:variable name="mode">
+               <xsl:value-of select="mode"/>
+       </xsl:variable>
+
+       <div>
+               <script type="text/javascript">
+                       var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required')"/>;
+               </script>
+               <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
+                       <div id="tab-content">
+                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
+                               <input type="hidden" id="active_tab" 
name="active_tab" value="{value_active_tab}"/>
+                               <div id="first_tab">
+                                       <fieldset>
+                                               <xsl:if test="email_out/id > 0">
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'id')"/>
+                                                               </label>
+                                                               <input 
type="hidden" id="id"  name="id" value="{email_out/id}"/>
+                                                               <xsl:value-of 
select="email_out/id"/>
+                                                       </div>
+                                               </xsl:if>
+
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'name')"/>
+                                                       </label>
+                                                       <input type="text" 
name="name" value="{email_out/name}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="placeholder">
+                                                                       
<xsl:value-of select="php:function('lang', 'name')"/>
+                                                               </xsl:attribute>
+                                                       </input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'remark')"/>
+                                                       </label>
+                                                       <textarea cols="47" 
rows="7" name="remark">
+                                                               <xsl:value-of 
select="email_out/remark"/>
+                                                       </textarea>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'subject')"/>
+                                                       </label>
+                                                       <textarea cols="47" 
rows="7" name="subject">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="email_out/subject"/>
+                                                       </textarea>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <a 
href="javascript:template_lookup();">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'content')"/>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:value-of select="php:function('lang', 'content')"/>
+                                                               </a>
+                                                       </label>
+                                                       <textarea cols="47" 
rows="7" id="content" name="content">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="email_out/content"/>
+                                                       </textarea>
+                                               </div>
+                                               <!--div 
class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'details')"/>
+                                                       </label>
+                                                       <div 
class="pure-custom">
+                                                               <xsl:for-each 
select="datatable_def">
+                                                                       <xsl:if 
test="container = 'datatable-container_0'">
+                                                                               
<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="data" select ='data'/>
+                                                                               
        <xsl:with-param name="config" select ='config'/>
+                                                                               
</xsl:call-template>
+                                                                       
</xsl:if>
+                                                               </xsl:for-each>
+                                                       </div>
+                                               </div-->
+                                       </fieldset>
+                               </div>
+                               <div id="recipient">
+
+                                       <fieldset>
+
+                                               <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_recipient_set">
+                                                               <xsl:value-of 
select="php:function('lang', 'recipient set')"/>
+                                                       </xsl:variable>
+                                                       <label>
+                                                               <xsl:value-of 
select="$lang_recipient_set"/>
+                                                       </label>
+                                                       <input type="hidden" 
id="recipient_set_id" name="recipient_set_id"  value="">
+                                                               <xsl:attribute 
name="placeholder">
+                                                                       
<xsl:value-of select="$lang_recipient_set"/>
+                                                               </xsl:attribute>
+                                                       </input>
+                                                       <input type="text" 
id="recipient_set_name" name="recipient_set_name" value="">
+                                                               <xsl:attribute 
name="placeholder">
+                                                                       
<xsl:value-of select="$lang_recipient_set"/>
+                                                               </xsl:attribute>
+                                                       </input>
+                                                       <div 
id="recipient_set_container"/>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'candidates')"/>
+                                                       </label>
+
+                                                       <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="data" select ='data'/>
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools'/>
+                                                                               
<xsl:with-param name="config" select ='config'/>
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'recipients')"/>
+                                                       </label>
+
+                                                       <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="data" select ='data'/>
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools'/>
+                                                                               
<xsl:with-param name="config" select ='config'/>
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
+                                               </div>
+                                       </fieldset>
+
+                               </div>
+
+                       </div>
+                       <div class="proplist-col">
+                               <input type="submit" class="pure-button 
pure-button-primary" name="save">
+                                       <xsl:attribute name="value">
+                                               <xsl:value-of 
select="php:function('lang', 'save')"/>
+                                       </xsl:attribute>
+                               </input>
+                               <xsl:variable name="cancel_url">
+                                       <xsl:value-of select="cancel_url"/>
+                               </xsl:variable>
+                               <input type="button" class="pure-button 
pure-button-primary" name="cancel" onClick="window.location = '{cancel_url}';">
+                                       <xsl:attribute name="value">
+                                               <xsl:value-of 
select="php:function('lang', 'cancel')"/>
+                                       </xsl:attribute>
+                               </input>
+                       </div>
+               </form>
+       </div>
+</xsl:template>
+
+<xsl:template match="options">
+       <option value="{id}">
+               <xsl:if test="selected != 0">
+                       <xsl:attribute name="selected" value="selected"/>
+               </xsl:if>
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
+</xsl:template>
+
+
+<xsl:template xmlns:php="http://php.net/xsl"; match="view">
+       <div>
+               <form id="form" name="form" method="post" action="" 
class="pure-form pure-form-aligned">
+                       <div id="tab-content">
+                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
+                               <div id="showing">
+
+                               </div>
+                       </div>
+                       <div class="proplist-col">
+                               <xsl:variable name="cancel_url">
+                                       <xsl:value-of select="cancel_url"/>
+                               </xsl:variable>
+                               <input type="button" class="pure-button 
pure-button-primary" name="cancel" value="{lang_cancel}" 
onMouseout="window.status='';return true;" onClick="window.location = 
'{cancel_url}';"/>
+                       </div>
+               </form>
+       </div>
+</xsl:template>

Modified: branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php    
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php    
2017-04-02 16:26:07 UTC (rev 16518)
@@ -2441,82 +2441,6 @@
 
                                        break;
 
-// START BOOKING TABLES
-                               case 'bb_office':
-                                       $info = array
-                                               (
-                                               'table' => 'bb_office',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'description',
-                                                               'descr' => 
lang('description'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => 
$GLOBALS['phpgw']->translation->translate('office', array(), false, 'booking'),
-                                               'acl_app' => 'booking',
-                                               'acl_location' => '.office',
-                                               'system_location' => '.office',
-                                               'menu_selection' => 
'booking::settings::office',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-                               case 'bb_office_user':
-                                       $info = array
-                                               (
-                                               'table' => 'bb_office_user',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'office',
-                                                               'descr' => 
$GLOBALS['phpgw']->translation->translate('office', array(), false, 'booking'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array(
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'bb_office', 'selected' => '##office##')
-                                                               )
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => 
$GLOBALS['phpgw']->translation->translate('office user', array(), false, 
'booking'),
-                                               'acl_app' => 'booking',
-                                               'acl_location' => 
'.office.user',
-                                               'system_location' => 
'.office.user',
-                                               'menu_selection' => 
'booking::settings::office::office_user',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-
-// END BOOKING TABLES
 // START CONTROLLER TABLES
                                case 'controller_check_item_status':
                                        $info = array

Modified: branches/Version-2_0-branch/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uigeneric.inc.php    
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/property/inc/class.uigeneric.inc.php    
2017-04-02 16:26:07 UTC (rev 16518)
@@ -109,7 +109,28 @@
                        $id_name = $this->location_info['id']['name'];
 
                        $id = phpgw::get_var($id_name);
-                       $values = phpgw::get_var('values');
+
+       //              $values = phpgw::get_var('values');
+                       $values = array();
+
+                       foreach ($this->location_info['fields'] as $field)
+                       {
+                               switch ($field['type'])
+                               {
+                                       case 'integer':
+                                       case 'int':
+                                               $value_type = 'int';
+                                               break;
+                                       case 'html':
+                                               $value_type = 'html';
+                                               break;
+                                       default:
+                                               $value_type = 'string';
+                                               break;
+                               }
+                               $values[$field['name']] = 
phpgw::clean_value($_POST['values'][$field['name']],$value_type);
+                       }
+
                        $values_attribute = phpgw::get_var('values_attribute');
 
                        if (!$id && !$values[$id_name] && 
$this->location_info['id']['type'] != 'auto')
@@ -130,8 +151,27 @@
 
                        foreach ($this->location_info['fields'] as $_field)
                        {
+
+                               switch ($_field['type'])
+                               {
+                                       case 'integer':
+                                       case 'int':
+                                               $value_type = 'int';
+                                               break;
+                                       case 'html':
+                                               $value_type = 'html';
+                                               break;
+                                       default:
+                                               $value_type = 'string';
+                                               break;
+                               }
+
+                               if($_field['type'] == 'html')
+                               {
+                                       $value_type = 'html';
+                               }
                                $data[$_field['name']] = 
$values[$_field['name']];
-                               $data[$_field['name']] = 
phpgw::clean_value($data[$_field['name']], $_field['type']);
+                               $data[$_field['name']] = 
phpgw::clean_value($data[$_field['name']], $value_type);
 
                                if (isset($_field['nullable']) && 
$_field['nullable'] != true)
                                {
@@ -558,8 +598,21 @@
                        {
                                foreach ($this->location_info['fields'] as 
$field)
                                {
-                                       $values[$field['name']] = 
phpgw::clean_value($_POST['values'][$field['name']]);
+                               switch ($field['type'])
+                               {
+                                       case 'integer':
+                                       case 'int':
+                                               $value_type = 'int';
+                                               break;
+                                       case 'html':
+                                               $value_type = 'html';
+                                               break;
+                                       default:
+                                               $value_type = 'string';
+                                               break;
                                }
+                                       $values[$field['name']] = 
phpgw::clean_value($_POST['values'][$field['name']],$value_type);
+                               }
 
                                if (isset($values_attribute) && 
is_array($values_attribute))
                                {
@@ -627,6 +680,11 @@
                        foreach ($this->location_info['fields'] as & $field)
                        {
                                $field['value'] = 
isset($values[$field['name']]) ? $values[$field['name']] : '';
+
+                               if($field['type'] == 'html')
+                               {
+                                       self::rich_text_editor($field['name']);
+                               }
                                if (isset($field['values_def']))
                                {
                                        if ($field['values_def']['valueset'] && 
is_array($field['values_def']['valueset']))
@@ -912,6 +970,7 @@
                        }
 
                        $id = 
phpgw::get_var($this->location_info['id']['name']);
+
                        $values = phpgw::get_var('values');
 
                        if ($id)

Modified: branches/Version-2_0-branch/property/templates/base/generic.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/generic.xsl     
2017-04-02 16:22:21 UTC (rev 16517)
+++ branches/Version-2_0-branch/property/templates/base/generic.xsl     
2017-04-02 16:26:07 UTC (rev 16518)
@@ -112,8 +112,8 @@
                                                                        
<xsl:value-of select="$descr"/>
                                                                </label>
                                                                <xsl:choose>
-                                                                       
<xsl:when test="type='text'">
-                                                                               
<textarea cols="{//textareacols}" rows="{//textarearows}" name="values[{name}]">
+                                                                       
<xsl:when test="type='text' or type='html'">
+                                                                               
<textarea cols="{//textareacols}" rows="{//textarearows}" name="values[{name}]" 
id="{name}">
                                                                                
        <xsl:value-of select="value"/>
                                                                                
</textarea>
                                                                        
</xsl:when>




reply via email to

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