[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16619] Stable: Merge 16615:16618 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16619] Stable: Merge 16615:16618 from trunk |
Date: |
Tue, 25 Apr 2017 05:22:22 -0400 (EDT) |
Revision: 16619
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16619
Author: sigurdne
Date: 2017-04-25 05:22:21 -0400 (Tue, 25 Apr 2017)
Log Message:
-----------
Stable: Merge 16615:16618 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/booking/inc/class.bobooking.inc.php
branches/Version-2_0-branch/property/inc/class.bodimb_role_user.inc.php
branches/Version-2_0-branch/property/inc/class.hook_helper.inc.php
branches/Version-2_0-branch/property/inc/class.menu.inc.php
branches/Version-2_0-branch/property/inc/class.sodimb_role_user.inc.php
branches/Version-2_0-branch/property/inc/class.soproject.inc.php
branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php
branches/Version-2_0-branch/property/inc/class.uidimb_role_user.inc.php
branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
branches/Version-2_0-branch/property/templates/base/dimb_role_user.xsl
Added Paths:
-----------
branches/Version-2_0-branch/property/inc/class.bosubstitute.inc.php
branches/Version-2_0-branch/property/inc/class.sosubstitute.inc.php
branches/Version-2_0-branch/property/inc/class.uisubstitute.inc.php
branches/Version-2_0-branch/property/js/portico/substitute.index.js
branches/Version-2_0-branch/property/templates/base/substitute.xsl
Removed Paths:
-------------
branches/Version-2_0-branch/property/templates/base/role_user_substitute.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-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch 2017-04-25 09:22:21 UTC (rev 16619)
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-16587
/branches/stavangerkommune:12743-12875,12986
-/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614
\ No newline at end of property
+/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618
\ No newline at end of property
Index: branches/Version-2_0-branch/booking
===================================================================
--- branches/Version-2_0-branch/booking 2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/booking 2017-04-25 09:22:21 UTC (rev 16619)
Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/dev-syncromind-2/booking:14933-16587
/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,16514-16517,16534,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598
\ 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,16534,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16616-16618
\ No newline at end of property
Modified: branches/Version-2_0-branch/booking/inc/class.bobooking.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.bobooking.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/booking/inc/class.bobooking.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -1128,7 +1128,11 @@
// echo "A0: break ef <= bf && et >= bt\n\n";
break;
}
- elseif (($ef >= $bf) &&
($et > $bt))
+ //elseif (($ef >= $bf)
&& ($et > $bt))
+ /**
+ * Sigurd 20170425 -
altered in an attempt to keep allocations from disappearing.
+ */
+ elseif (($ef >= $bf) &&
($et >= $bt))
{
// echo "A1: (ef >= bf) && (et > bt)\n";
$tmp['from_'] =
$bf;
Modified:
branches/Version-2_0-branch/property/inc/class.bodimb_role_user.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.bodimb_role_user.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.bodimb_role_user.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -69,14 +69,4 @@
$values = $this->so->edit($data);
return $values;
}
-
- public function update_substitute( $user_id,
$substitute_user_id )
- {
- return $this->so->update_substitute($user_id,
$substitute_user_id);
- }
-
- public function get_substitute( $user_id)
- {
- return $this->so->get_substitute($user_id);
- }
}
\ No newline at end of file
Copied: branches/Version-2_0-branch/property/inc/class.bosubstitute.inc.php
(from rev 16618, trunk/property/inc/class.bosubstitute.inc.php)
===================================================================
--- branches/Version-2_0-branch/property/inc/class.bosubstitute.inc.php
(rev 0)
+++ branches/Version-2_0-branch/property/inc/class.bosubstitute.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -0,0 +1,92 @@
+<?php
+
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2011,2012 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 registration
+ * @version $Id: class.bodimb_role_user.inc.php 16604 2017-04-20
14:53:00Z sigurdne $
+ */
+ class property_bosubstitute
+ {
+
+ var $public_functions = array
+ (
+ );
+
+ function __construct()
+ {
+ $this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->so = CreateObject('property.sosubstitute');
+ $this->allrows = $this->bo->allrows;
+ }
+
+ public function read( $data )
+ {
+ static $users = array();
+ $values = $this->so->read($data);
+
+ foreach ($values as &$entry)
+ {
+ if ($entry['user_id'])
+ {
+ if (!$entry['user'] =
$users[$entry['user_id']])
+ {
+ $entry['user'] =
$GLOBALS['phpgw']->accounts->get($entry['user_id'])->__toString();
+ $users[$entry['user_id']] =
$entry['user'];
+ }
+ }
+ if ($entry['substitute_user_id'])
+ {
+ if (!$entry['substitute'] =
$users[$entry['substitute_user_id']])
+ {
+ $entry['substitute'] =
$GLOBALS['phpgw']->accounts->get($entry['substitute_user_id'])->__toString();
+
$users[$entry['substitute_user_id']] = $entry['substitute'];
+ }
+ }
+
+ }
+
+ return $values;
+ }
+
+ public function delete( $data )
+ {
+ return $this->so->delete($data);
+ }
+
+ public function edit( $data )
+ {
+ $values = $this->so->edit($data);
+ return $values;
+ }
+
+ public function update_substitute( $user_id,
$substitute_user_id )
+ {
+ return $this->so->update_substitute($user_id,
$substitute_user_id);
+ }
+
+ public function get_substitute( $user_id)
+ {
+ return $this->so->get_substitute($user_id);
+ }
+ }
\ No newline at end of file
Modified: branches/Version-2_0-branch/property/inc/class.hook_helper.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.hook_helper.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.hook_helper.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -1003,7 +1003,7 @@
//
$portalbox->set_controls($key,$value);
}
- $users_for_substitute =
CreateObject('property.sodimb_role_user')->get_users_for_substitute(
$accound_id);
+ $users_for_substitute =
CreateObject('property.sosubstitute')->get_users_for_substitute( $accound_id);
$users_for_substitute[] = $accound_id;
@@ -1176,9 +1176,9 @@
function after_navbar( )
{
- $sodimb_role_user =
CreateObject('property.sodimb_role_user');
+ $sosubstitute = CreateObject('property.sosubstitute');
$user_id = $GLOBALS['phpgw_info']['user']['account_id'];
- $substitute_user_id =
$sodimb_role_user->get_substitute( $user_id);
+ $substitute_user_id = $sosubstitute->get_substitute(
$user_id);
$lang_substitute =
$GLOBALS['phpgw']->translation->translate('substitute', array(), false,
'property');
if($substitute_user_id)
{
@@ -1187,7 +1187,7 @@
echo '</div>';
}
- $users_for_substitute =
$sodimb_role_user->get_users_for_substitute( $user_id);
+ $users_for_substitute =
$sosubstitute->get_users_for_substitute( $user_id);
$names = array();
foreach ($users_for_substitute as $user_for_substitute)
{
Modified: branches/Version-2_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.menu.inc.php 2017-04-25
09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.menu.inc.php 2017-04-25
09:22:21 UTC (rev 16619)
@@ -354,7 +354,7 @@
'substitute' => array
(
'text' =>
lang('substitute'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uidimb_role_user.list_substitute')),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uisubstitute.index')),
)
)
),
@@ -806,7 +806,7 @@
),
array(
'text' => lang('substitute'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uidimb_role_user.substitute',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uisubstitute.edit',
'acl_app' =>
'property'))
)
);
Modified:
branches/Version-2_0-branch/property/inc/class.sodimb_role_user.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sodimb_role_user.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.sodimb_role_user.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -303,60 +303,4 @@
return $ok;
}
-
- /**
- * A user can only have one substitute
- * @param int $user_id
- * @param int $substitute_user_id
- * @return boolean true on success
- */
- public function update_substitute( $user_id,
$substitute_user_id = 0 )
- {
- $this->db->transaction_begin();
- $this->db->query('DELETE FROM
fm_ecodimb_role_user_substitute WHERE user_id = ' . (int)$user_id, __LINE__,
__FILE__);
- if($substitute_user_id)
- {
- $this->db->query('INSERT INTO
fm_ecodimb_role_user_substitute (user_id, substitute_user_id ) VALUES (' .
(int)$user_id . ',' . (int) $substitute_user_id . ')', __LINE__, __FILE__);
- }
- if($this->db->transaction_commit())
- {
- if($substitute_user_id)
- {
-
phpgwapi_cache::message_set(lang('substitute') .': ' .
$GLOBALS['phpgw']->accounts->get($substitute_user_id)->__toString(), 'message');
- }
- else
- {
-
phpgwapi_cache::message_set(lang('substitute') . ' ' .lang('deleted'),
'message');
- }
- return true;
- }
- }
-
- /**
- * Get the substitute for a user
- * @param int $user_id
- * @return int $substitute_user_id
- */
- public function get_substitute( $user_id)
- {
- $this->db->query('SELECT substitute_user_id FROM
fm_ecodimb_role_user_substitute WHERE user_id = ' . (int)$user_id, __LINE__,
__FILE__);
- $this->db->next_record();
- return (int)$this->db->f('substitute_user_id');
- }
-
- /**
- * Get the users that the substitute is given responsibility for
- * @param int $substitute_user_id
- * @return array $users
- */
- public function get_users_for_substitute( $substitute_user_id)
- {
- $this->db->query('SELECT user_id FROM
fm_ecodimb_role_user_substitute WHERE substitute_user_id = ' .
(int)$substitute_user_id, __LINE__, __FILE__);
- $users = array();
- while ($this->db->next_record())
- {
- $users[] = $this->db->f('user_id');
- }
- return $users;
- }
}
\ No newline at end of file
Modified: branches/Version-2_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soproject.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.soproject.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -1760,8 +1760,8 @@
$close_pending_action = true;
- $sodimb_role_user =
CreateObject('property.sodimb_role_user');
- $users_for_substitute =
$sodimb_role_user->get_users_for_substitute($this->account);
+ $sosubstitute =
CreateObject('property.sosubstitute');
+ $users_for_substitute =
$sosubstitute->get_users_for_substitute($this->account);
$take_responsibility_for =
array($this->account);
$action_params = array
@@ -3441,11 +3441,11 @@
}
$historylog = CreateObject('property.historylog',
'workorder');
- $sodimb_role_user =
CreateObject('property.sodimb_role_user');
+ $sosubstitute = CreateObject('property.sosubstitute');
foreach ($ids as $order_id)
{
- $users_for_substitute =
$sodimb_role_user->get_users_for_substitute($this->account);
+ $users_for_substitute =
$sosubstitute->get_users_for_substitute($this->account);
$take_responsibility_for =
array($this->account);
$action_params = array(
Copied: branches/Version-2_0-branch/property/inc/class.sosubstitute.inc.php
(from rev 16618, trunk/property/inc/class.sosubstitute.inc.php)
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sosubstitute.inc.php
(rev 0)
+++ branches/Version-2_0-branch/property/inc/class.sosubstitute.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -0,0 +1,148 @@
+<?php
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2011,2012 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 registration
+ * @version $Id: class.sodimb_role_user.inc.php 16610 2017-04-21
14:21:03Z sigurdne $
+ */
+ phpgw::import_class('phpgwapi.datetime');
+
+ class property_sosubstitute
+ {
+
+ var $total_records = 0;
+
+ function __construct()
+ {
+ $this->account_id =
(int)$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->db = & $GLOBALS['phpgw']->db;
+ $this->db2 = clone($this->db);
+ $this->join = & $this->db->join;
+ $this->left_join = & $this->db->left_join;
+ $this->like = & $this->db->like;
+ }
+
+ function read( $data )
+ {
+ if (!empty($data['user_id']))
+ {
+ $user_id = (int)$data['user_id'];
+ }
+
+ $substitute_user_id = (int)$data['substitute_user_id'];
+
+ $filtermethod = '';
+ $where = 'WHERE';
+ if ($user_id)
+ {
+ $filtermethod .= "{$where} user_id = $user_id";
+ $where = 'AND';
+ }
+ if ($substitute_user_id)
+ {
+ $filtermethod .= "{$where} substitute_user_id =
$substitute_user_id";
+ $where = 'AND';
+ }
+
+ $sql = "SELECT id, user_id, substitute_user_id FROM
fm_ecodimb_role_user_substitute {$filtermethod}";
+
+//_debug_array($sql);
+ $this->db->query($sql, __LINE__, __FILE__);
+
+ $values = array();
+ while ($this->db->next_record())
+ {
+ $values[] = array(
+ 'id' => $this->db->f('id'),
+ 'user_id' => $this->db->f('user_id'),
+ 'substitute_user_id' =>
$this->db->f('substitute_user_id'),
+ );
+ }
+
+ return $values;
+ }
+
+ public function delete( $data = array())
+ {
+ if($data)
+ {
+ return $this->db->query('DELETE FROM
fm_ecodimb_role_user_substitute WHERE id IN (' . implode(', ', $data) . ')',
__LINE__, __FILE__);
+ }
+ }
+
+ /**
+ * A user can only have one substitute
+ * @param int $user_id
+ * @param int $substitute_user_id
+ * @return boolean true on success
+ */
+ public function update_substitute( $user_id,
$substitute_user_id = 0 )
+ {
+ $this->db->transaction_begin();
+ $this->db->query('DELETE FROM
fm_ecodimb_role_user_substitute WHERE user_id = ' . (int)$user_id, __LINE__,
__FILE__);
+ if($substitute_user_id)
+ {
+ $this->db->query('INSERT INTO
fm_ecodimb_role_user_substitute (user_id, substitute_user_id ) VALUES (' .
(int)$user_id . ',' . (int) $substitute_user_id . ')', __LINE__, __FILE__);
+ }
+ if($this->db->transaction_commit())
+ {
+ if($substitute_user_id)
+ {
+
phpgwapi_cache::message_set(lang('substitute') .': ' .
$GLOBALS['phpgw']->accounts->get($substitute_user_id)->__toString(), 'message');
+ }
+ else
+ {
+
phpgwapi_cache::message_set(lang('substitute') . ' ' .lang('deleted'),
'message');
+ }
+ return true;
+ }
+ }
+
+ /**
+ * Get the substitute for a user
+ * @param int $user_id
+ * @return int $substitute_user_id
+ */
+ public function get_substitute( $user_id)
+ {
+ $this->db->query('SELECT substitute_user_id FROM
fm_ecodimb_role_user_substitute WHERE user_id = ' . (int)$user_id, __LINE__,
__FILE__);
+ $this->db->next_record();
+ return (int)$this->db->f('substitute_user_id');
+ }
+
+ /**
+ * Get the users that the substitute is given responsibility for
+ * @param int $substitute_user_id
+ * @return array $users
+ */
+ public function get_users_for_substitute( $substitute_user_id)
+ {
+ $this->db->query('SELECT user_id FROM
fm_ecodimb_role_user_substitute WHERE substitute_user_id = ' .
(int)$substitute_user_id, __LINE__, __FILE__);
+ $users = array();
+ while ($this->db->next_record())
+ {
+ $users[] = $this->db->f('user_id');
+ }
+ return $users;
+ }
+ }
\ No newline at end of file
Modified: branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -1638,8 +1638,8 @@
$this->db->next_record();
if ($this->db->f('approved') ||
$workorder['approved'])
{
- $sodimb_role_user =
CreateObject('property.sodimb_role_user');
- $users_for_substitute =
$sodimb_role_user->get_users_for_substitute($this->account);
+ $sosubstitute =
CreateObject('property.sosubstitute');
+ $users_for_substitute =
$sosubstitute->get_users_for_substitute($this->account);
$take_responsibility_for =
array($this->account);
$action_params = array
@@ -3044,8 +3044,8 @@
$this->db->next_record();
if ($this->db->f('approved'))
{
- $sodimb_role_user =
CreateObject('property.sodimb_role_user');
- $users_for_substitute =
$sodimb_role_user->get_users_for_substitute($this->account);
+ $sosubstitute =
CreateObject('property.sosubstitute');
+ $users_for_substitute =
$sosubstitute->get_users_for_substitute($this->account);
$take_responsibility_for =
array($this->account);
$action_params = array
Modified:
branches/Version-2_0-branch/property/inc/class.uidimb_role_user.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uidimb_role_user.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.uidimb_role_user.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -306,63 +306,4 @@
'user_id' => $user_id, 'dimb_id' =>
$dimb_id, 'role_id' => $role_id, 'query' => $query));
}
}
-
- public function substitute()
- {
- $user_id = $this->account_id;
- $substitute_user_id =
phpgw::get_var('substitute_user_id', 'int', 'POST');
- $save = phpgw::get_var('save', 'string', 'POST');
-
- if($save)
- {
- $this->bo->update_substitute($user_id,
$substitute_user_id);
- }
-
- $selected = $this->bo->get_substitute($user_id);
-
- $appname = lang('substitute');
- $function_msg = lang('set substitute');
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
$GLOBALS['phpgw']->xslttpl->add_file(array('role_user_substitute'));
-
- $data = array
- (
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uidimb_role_user.substitute')),
- 'user_list' => array('options' =>
$this->_get_user_list($selected)),
- );
-
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('edit' => $data));
- }
-
- private function _get_user_list($selected)
- {
- $users =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, '.project',
'property');
- $user_list = array();
- $selected_found = false;
- foreach ($users as $user)
- {
- $name = (isset($user['account_lastname']) ?
$user['account_lastname'] . ' ' : '') . $user['account_firstname'];
- $user_list[] = array(
- 'id' => $user['account_id'],
- 'name' => $name,
- 'selected' => $user['account_id'] ==
$selected ? 1 : 0
- );
-
- if (!$selected_found)
- {
- $selected_found = $user['account_id']
== $selected ? true : false;
- }
- }
- if ($selected && !$selected_found)
- {
- $user_list[] = array
- (
- 'id' => $selected,
- 'name' =>
$GLOBALS['phpgw']->accounts->get($selected)->__toString(),
- 'selected' => 1
- );
- }
- return $user_list;
- }
-
}
\ No newline at end of file
Copied: branches/Version-2_0-branch/property/inc/class.uisubstitute.inc.php
(from rev 16618, trunk/property/inc/class.uisubstitute.inc.php)
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uisubstitute.inc.php
(rev 0)
+++ branches/Version-2_0-branch/property/inc/class.uisubstitute.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -0,0 +1,306 @@
+<?php
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2011,2012 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 registration
+ * @version $Id: class.uidimb_role_user.inc.php 16610 2017-04-21
14:21:03Z sigurdne $
+ */
+ phpgw::import_class('phpgwapi.uicommon_jquery');
+
+ class property_uisubstitute extends phpgwapi_uicommon_jquery
+ {
+
+ var $cat_id;
+ var $start;
+ var $query;
+ var $sort;
+ var $order;
+ var $filter;
+ var $currentapp;
+ var $type_id;
+ var $location_code;
+ private $config;
+ var $public_functions = array
+ (
+ 'index' => true,
+ 'query' => true,
+ 'edit' => true,
+ 'edit2' => true,
+ 'substitute' => true
+ );
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+ $this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->bo = CreateObject('property.bosubstitute');
+ $this->bocommon = CreateObject('property.bocommon');
+ $this->start = $this->bo->start;
+ $this->query = $this->bo->query;
+ $this->sort = $this->bo->sort;
+ $this->order = $this->bo->order;
+
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'admin::property::accounting::dimb_role_user2::substitute';
+ }
+
+ function index()
+ {
+ $receipt = array();
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ $msgbox_data = array();
+ if (phpgw::get_var('phpgw_return_as') != 'json' &&
$receipt = phpgwapi_cache::session_get('phpgwapi', 'phpgw_messages'))
+ {
+ phpgwapi_cache::session_clear('phpgwapi',
'phpgw_messages');
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($receipt);
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
+ }
+
+ $myColumnDefs = array
+ (
+ array
+ (
+ 'key' => 'id',
+ 'hidden' => true
+ ),
+ array
+ (
+ 'key' => 'user',
+ 'label' => lang('user'),
+ 'sortable' => false
+ ),
+ array
+ (
+ 'key' => 'substitute',
+ 'label' => lang('substitute'),
+ 'sortable' => false
+ ),
+ array
+ (
+ 'key' => 'delete',
+ 'label' => lang('delete'),
+ 'sortable' => false,
+ 'formatter' =>
'JqueryPortico.FormatterCenter',
+ )
+ );
+
+
+ $datatable_def[] = array
+ (
+ 'container' => 'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' => 'property.uisubstitute.query',
+ 'phpgw_return_as' => 'json'))),
+ 'ColumnDefs' => $myColumnDefs,
+ 'data' => '',
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
+
+ $user_list =
$this->bocommon->get_user_list_right2('select', PHPGW_ACL_READ, 0, '.invoice');
+ $substitute_list = $user_list;
+
+ array_unshift($user_list, array('id' => '', 'name' =>
lang('select')));
+ array_unshift($substitute_list, array('id' => '',
'name' => lang('select')));
+
+ $data = array
+ (
+ 'datatable_def' => $datatable_def,
+ 'msgbox_data' => $msgbox_data,
+ 'filter_form' => array
+ (
+ 'user_list' => array('options' =>
$user_list),
+ 'substitute_list' => array('options' =>
$substitute_list),
+ ),
+ 'update_action' =>
self::link(array('menuaction' => 'property.uisubstitute.edit2'))
+ );
+
+ $GLOBALS['phpgw']->jqcal->add_listener('query_start');
+ $GLOBALS['phpgw']->jqcal->add_listener('query_end');
+ $GLOBALS['phpgw']->jqcal->add_listener('active_from');
+ $GLOBALS['phpgw']->jqcal->add_listener('active_to');
+
+ self::add_javascript('property', 'portico',
'substitute.index.js');
+
+
$GLOBALS['phpgw']->xslttpl->add_file(array('substitute', 'datatable_inline'));
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('table' => $data));
+ }
+
+ public function query()
+ {
+ $user_id = phpgw::get_var('user_id', 'int');
+ $substitute_user_id =
phpgw::get_var('substitute_user_id', 'int');
+
+
+ $values = $this->bo->read(array('user_id' => $user_id,
'substitute_user_id' => $substitute_user_id));
+
+ foreach ($values as &$entry)
+ {
+ $entry['delete'] = "<input class=\"delete\"
id=\"delete\" type =\"checkbox\" name=\"delete[]\" value=\"{$entry['id']}\">";
+ $results['results'][] = $entry;
+ }
+
+ $result_data = array
+ (
+ 'results' => $values,
+ 'total_records' => count($values),
+ 'draw' => phpgw::get_var('draw', 'int')
+ );
+
+
+ return $this->jquery_results($result_data);
+
+ // return json_encode($values);
+ }
+
+ public function edit2()
+ {
+ if (!$GLOBALS['phpgw']->acl->check('.admin',
PHPGW_ACL_EDIT, 'property'))
+ {
+ $receipt['error'][] = true;
+ phpgwapi_cache::message_set(lang('you are not
approved for this task'), 'error');
+ }
+
+ $user_id = phpgw::get_var('user_id', 'int');
+ $substitute_user_id =
phpgw::get_var('substitute_user_id', 'int');
+
+ $save = phpgw::get_var('save', 'string');
+
+ if($save && $user_id && $substitute_user_id)
+ {
+ if($this->bo->update_substitute($user_id,
$substitute_user_id))
+ {
+ $result = array
+ (
+ 'status' => 'updated'
+ );
+ }
+ }
+
+ if ($delete = phpgw::get_var('delete', 'int'))
+ {
+ if (!$receipt['error'])
+ {
+ if ($this->bo->delete($delete))
+ {
+ $result = array
+ (
+ 'status' => 'updated'
+ );
+ }
+ else
+ {
+ $result = array
+ (
+ 'status' => 'error'
+ );
+ }
+ }
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ if ($receipt =
phpgwapi_cache::session_get('phpgwapi', 'phpgw_messages'))
+ {
+
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+ $result['receipt'] = $receipt;
+ }
+ else
+ {
+ $result['receipt'] = array();
+ }
+ return $result;
+ }
+ else
+ {
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'property.uisubstitute.index',
+ 'user_id' => $user_id,
'substitute_user_id' => $substitute_user_id));
+ }
+ }
+
+ public function edit()
+ {
+ $user_id = $this->account_id;
+ $substitute_user_id =
phpgw::get_var('substitute_user_id', 'int', 'POST');
+ $save = phpgw::get_var('save', 'string', 'POST');
+
+ if($save)
+ {
+ $this->bo->update_substitute($user_id,
$substitute_user_id);
+ }
+
+ $selected = $this->bo->get_substitute($user_id);
+
+ $appname = lang('substitute');
+ $function_msg = lang('set substitute');
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->add_file(array('substitute'));
+
+ $data = array
+ (
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uisubstitute.edit')),
+ 'user_list' => array('options' =>
$this->_get_user_list($selected)),
+ );
+
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('edit' => $data));
+ }
+
+ private function _get_user_list($selected)
+ {
+ $users =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, '.project',
'property');
+ $user_list = array();
+ $selected_found = false;
+ foreach ($users as $user)
+ {
+ $name = (isset($user['account_lastname']) ?
$user['account_lastname'] . ' ' : '') . $user['account_firstname'];
+ $user_list[] = array(
+ 'id' => $user['account_id'],
+ 'name' => $name,
+ 'selected' => $user['account_id'] ==
$selected ? 1 : 0
+ );
+
+ if (!$selected_found)
+ {
+ $selected_found = $user['account_id']
== $selected ? true : false;
+ }
+ }
+ if ($selected && !$selected_found)
+ {
+ $user_list[] = array
+ (
+ 'id' => $selected,
+ 'name' =>
$GLOBALS['phpgw']->accounts->get($selected)->__toString(),
+ 'selected' => 1
+ );
+ }
+ return $user_list;
+ }
+
+ }
\ No newline at end of file
Modified: branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
2017-04-25 09:22:21 UTC (rev 16619)
@@ -913,7 +913,7 @@
}
$_budget_amount =
$this->bo->get_budget_amount($id);
- $sodimb_role_user =
CreateObject('property.sodimb_role_user');
+ $sosubstitute =
CreateObject('property.sosubstitute');
if (isset($values['approval']) &&
$values['approval'] && $config->config_data['workorder_approval'])
{
@@ -960,7 +960,7 @@
if(!$approvals)
{
-
$substitute = $sodimb_role_user->get_substitute($_account_id);
+
$substitute = $sosubstitute->get_substitute($_account_id);
if($substitute)
{
@@ -1048,7 +1048,7 @@
$bcc =
'';//$coordinator_email;
foreach
($values['approval'] as $_account_id => $_address)
{
- $substitute =
$sodimb_role_user->get_substitute($_account_id);
+ $substitute =
$sosubstitute->get_substitute($_account_id);
/**
* Alert the
substitute
@@ -1111,7 +1111,7 @@
foreach ($values['do_approve'] as
$_account_id => $_dummy)
{
- $users_for_substitute =
$sodimb_role_user->get_users_for_substitute($_account_id);
+ $users_for_substitute =
$sosubstitute->get_users_for_substitute($_account_id);
$approvals =
execMethod('property.sopending_action.get_pending_action', $action_params);
Copied: branches/Version-2_0-branch/property/js/portico/substitute.index.js
(from rev 16618, trunk/property/js/portico/substitute.index.js)
===================================================================
--- branches/Version-2_0-branch/property/js/portico/substitute.index.js
(rev 0)
+++ branches/Version-2_0-branch/property/js/portico/substitute.index.js
2017-04-25 09:22:21 UTC (rev 16619)
@@ -0,0 +1,99 @@
+$(document).ready(function ()
+{
+
+ $("#user_id").change(function ()
+ {
+ update_substitute_table();
+ });
+
+ $("#substitute_user_id").change(function ()
+ {
+ update_substitute_table();
+ });
+
+ $("#acl_form").on("submit", function (e)
+ {
+ e.preventDefault();
+ var thisForm = $(this);
+ var submitBnt = $(thisForm).find("input[type='submit']");
+ var requestUrl = $(thisForm).attr("action");
+ $.ajax({
+ type: 'POST',
+ url: requestUrl +
"&phpgw_return_as=json&save=save&substitute_user_id=" +
$("#substitute_user_id").val() +'&user_id=' + $("#user_id").val() + '&' +
$(thisForm).serialize(),
+ success: function (data)
+ {
+ if (data)
+ {
+ if (data.sessionExpired)
+ {
+ alert('Sesjonen er utløpt - du
må logge inn på nytt');
+ return;
+ }
+
+ var obj = data;
+
+ var submitBnt =
$(thisForm).find("input[type='submit']");
+ if (obj.status == "updated")
+ {
+ $(submitBnt).val("Lagret");
+ var oArgs = {menuaction:
'property.uisubstitute.query', substitute_user_id:
$("#substitute_user_id").val(), user_id: $("#user_id").val()};
+ var requestUrl =
phpGWLink('index.php', oArgs, true);
+
JqueryPortico.updateinlineTableHelper(oTable0, requestUrl);
+ }
+ else
+ {
+ $(submitBnt).val("Feil ved
lagring");
+ }
+
+ // Changes text on save button back to
original
+ window.setTimeout(function ()
+ {
+ $(submitBnt).val('Lagre');
+
$(submitBnt).addClass("not_active");
+ }, 1000);
+
+ var htmlString = "";
+ if (typeof (data['receipt']['error'])
!= 'undefined')
+ {
+ for (var i = 0; i <
data['receipt']['error'].length; ++i)
+ {
+ htmlString += "<div
class=\"error\">";
+ htmlString +=
data['receipt']['error'][i]['msg'];
+ htmlString += '</div>';
+ }
+
+ }
+ if (typeof (data['receipt']['message'])
!= 'undefined')
+ {
+ for (var i = 0; i <
data['receipt']['message'].length; ++i)
+ {
+ htmlString += "<div
class=\"msg_good\">";
+ htmlString +=
data['receipt']['message'][i]['msg'];
+ htmlString += '</div>';
+ }
+
+ }
+ $("#receipt").html(htmlString);
+ }
+ }
+ });
+ });
+});
+
+
+function update_substitute_table()
+{
+ var oArgs = {menuaction: 'property.uisubstitute.query', user_id:
$("#user_id").val(), substitute_user_id: $("#substitute_user_id").val()};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ JqueryPortico.updateinlineTableHelper(oTable0, requestUrl);
+// execute_async(myDataTable_0, oArgs);
+ $("#receipt").html('');
+}
+
+var addFooterDatatable = function (oTable)
+{
+ var api = oTable.api();
+ var newTD = JqueryPortico.CreateRowChecked("delete");
+ $(api.column(2).footer()).html(newTD);
+};
Modified: branches/Version-2_0-branch/property/templates/base/dimb_role_user.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/dimb_role_user.xsl
2017-04-25 09:19:29 UTC (rev 16618)
+++ branches/Version-2_0-branch/property/templates/base/dimb_role_user.xsl
2017-04-25 09:22:21 UTC (rev 16619)
@@ -5,57 +5,48 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
<style type="text/css">
- #box { width: 200px; height: 5px; background: blue; }
- select { width: 200px; }
- .row_on,.th_bright
- {
+ #box { width: 200px; height: 5px; background: blue; }
+ select { width: 200px; }
+ .row_on,.th_bright
+ {
background-color: #CCEEFF;
- }
+ }
- .row_off
- {
+ .row_off
+ {
background-color: #DDF0FF;
- }
+ }
</style>
- <xsl:call-template name="invoice" />
+ <xsl:call-template name="table" />
<div id="popupBox"></div>
<div id="curtain"></div>
</xsl:template>
-<xsl:template name="invoice" xmlns:php="http://php.net/xsl">
- <!-- loads translations into array for use with javascripts -->
- <!--
- <script type="text/javascript">
- var lang = <xsl:value-of select="php:function('js_lang',
'edit')"/>;
- </script>
- -->
-
- <div class="yui-content">
+<xsl:template name="table" xmlns:php="http://php.net/xsl">
+ <div class="body">
<div id="invoice-layout">
- <div class="header">
+ <div class="header">
<h2>
- <xsl:value-of
select="php:function('lang', 'invoice')"/>
+ <xsl:value-of
select="php:function('lang', 'role')"/>
</h2>
- </div>
+ </div>
<xsl:choose>
<xsl:when test="msgbox_data != ''">
<xsl:call-template name="msgbox"/>
</xsl:when>
</xsl:choose>
- <div class="body">
- <div id="voucher_details">
+ <div class="body">
+ <div id="voucher_details">
+ <table align = "center" width="95%">
+ <xsl:apply-templates
select="filter_form" />
+ </table>
+ <form action="{update_action}"
name="acl_form" id="acl_form" method="post">
<table align = "center"
width="95%">
- <xsl:apply-templates
select="filter_form" />
- </table>
- <form action="{update_action}"
name="acl_form" id="acl_form" method="post">
- <table align = "center"
width="95%">
-
<xsl:call-template name="role_fields" />
- <tr>
- <td
colspan = '6'>
-
<!--xsl:apply-templates select="paging"/>
-
<xsl:apply-templates select="datatable"/-->
+ <xsl:call-template
name="role_fields" />
+ <tr>
+ <td colspan =
'6'>
<xsl:for-each select="datatable_def">
<xsl:if test="container = 'datatable-container_0'">
<xsl:call-template name="table_setup">
@@ -68,9 +59,9 @@
</xsl:if>
</xsl:for-each>
- </td>
- </tr>
- </table>
+ </td>
+ </tr>
+ </table>
<div id="receipt"></div>
<xsl:variable
name="label_submit">
<xsl:value-of
select="php:function('lang', 'save')" />
@@ -78,142 +69,92 @@
<div class="row_on">
<input type="submit"
name="update_acl" id="frm_update_acl" value="{$label_submit}"/>
</div>
- </form>
- </div>
+ </form>
</div>
+ </div>
</div>
</div>
</xsl:template>
<xsl:template match="filter_form" xmlns:php="http://php.net/xsl">
- <xsl:call-template name="filter_list"/>
+ <xsl:call-template name="filter_list"/>
</xsl:template>
<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
<tr>
- <td colspan = '6'>
- <table>
- <tr>
- <td>
- <xsl:value-of select="php:function('lang', 'dim b')" />
+ <td colspan = '6'>
+ <table>
+ <tr>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'dim b')" />
+ </td>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'role')" />
+ </td>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'user')" />
+ </td>
+ <td colspan = "2" align = "center">
+ <xsl:value-of
select="php:function('lang', 'search')" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of
select="php:function('lang', 'date')" />
+ </td>
+ </tr>
+ <tr id="filters">
+ <td>
+ <select id="dimb_id"
name="dimb">
+ <xsl:apply-templates
select="dimb_list/options"/>
+ </select>
+ </td>
+ <td>
+ <select id="role_id"
name="role_id">
+ <xsl:apply-templates
select="role_list/options"/>
+ </select>
+ </td>
+ <td>
+ <select id="user_id"
name="user_id">
+ <xsl:apply-templates
select="user_list/options"/>
+ </select>
+ </td>
+ <td>
+ <input type="text"
name="query_start" id="query_start" size = "10"/>
+ </td>
+ <td>
+ <input type="text"
name="query_end" id="query_end" size = "10"/>
+ </td>
+ <td>
+ <xsl:variable
name="lang_search">
+ <xsl:value-of
select="php:function('lang', 'Search')" />
+ </xsl:variable>
+ <input type="button" id =
"search" name="search" value="{$lang_search}" title = "{$lang_search}" />
+ </td>
+ </tr>
+ </table>
</td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template name="role_fields" xmlns:php="http://php.net/xsl">
+ <tr class ='row_off'>
<td>
- <xsl:value-of select="php:function('lang', 'role')" />
+ <xsl:value-of select="php:function('lang', 'date
from')" />
</td>
<td>
- <xsl:value-of select="php:function('lang', 'user')" />
+ <input type="text" name="values[active_from]"
id="active_from" value=""/>
</td>
- <td colspan = "2" align = "center">
- <xsl:value-of select="php:function('lang', 'search')" />
- <xsl:text> </xsl:text>
- <xsl:value-of select="php:function('lang', 'date')" />
- </td>
</tr>
- <tr id="filters">
+ <tr class ='row_off'>
<td>
- <select id="dimb_id" name="dimb">
- <xsl:apply-templates select="dimb_list/options"/>
- </select>
- </td>
- <td>
- <select id="role_id" name="role_id">
- <xsl:apply-templates select="role_list/options"/>
- </select>
- </td>
- <td>
- <select id="user_id" name="user_id">
- <xsl:apply-templates select="user_list/options"/>
- </select>
- </td>
- <td>
- <input type="text" name="query_start" id="query_start"
size = "10"/>
+ <xsl:value-of select="php:function('lang', 'date to')"
/>
</td>
<td>
- <input type="text" name="query_end" id="query_end" size
= "10"/>
+ <input type="text" name="values[active_to]"
id="active_to" value=""/>
</td>
- <td>
- <xsl:variable
name="lang_search">
- <xsl:value-of
select="php:function('lang', 'Search')" />
- </xsl:variable>
- <input type="button" id = "search" name="search"
value="{$lang_search}" title = "{$lang_search}" />
- </td>
- </tr>
- </table>
- </td>
- </tr>
+ </tr>
</xsl:template>
-<xsl:template name="role_fields" xmlns:php="http://php.net/xsl">
- <tr class ='row_off'>
- <td>
- <xsl:value-of select="php:function('lang',
'date from')" />
- </td>
- <td>
- <input type="text" name="values[active_from]"
id="active_from" value=""/>
- </td>
- </tr>
- <tr class ='row_off'>
- <td>
- <xsl:value-of select="php:function('lang',
'date to')" />
- </td>
- <td>
- <input type="text" name="values[active_to]"
id="active_to" value=""/>
- </td>
- </tr>
-</xsl:template>
-
-
-
-<xsl:template match="datatable" xmlns:php="http://php.net/xsl">
- <div id="paging_0"/>
- <div id="datatable-container_0"/>
-
- <div id="data_paginator"/>
- <div id="datatable-container"/>
-
- <xsl:call-template name="datasource-definition" />
- <div id="receipt"></div>
- <xsl:variable name="label_submit">
- <xsl:value-of select="php:function('lang', 'save')" />
- </xsl:variable>
- <div class="row_on">
- <input type="submit" name="update_acl" id="frm_update_acl"
value="{$label_submit}"/>
- </div>
-</xsl:template>
-
-<xsl:template name="datasource-definition" xmlns:php="http://php.net/xsl">
-
- <!-- DATATABLE DEFINITIONS-->
- <script type="text/javascript">
- var property_js = <xsl:value-of
select="//property_js"/>;
- var datatable = new Array();
- var myColumnDefs = new Array();
- var myButtons = new Array();
- var td_count = <xsl:value-of select="//td_count"/>;
-
- <xsl:for-each select="//datatable">
- datatable[<xsl:value-of select="name"/>] = [
- {
- values:<xsl:value-of
select="values"/>,
- total_records: <xsl:value-of
select="total_records"/>,
- is_paginator: <xsl:value-of
select="is_paginator"/>,
- edit_action: <xsl:value-of
select="edit_action"/>,
- footer:<xsl:value-of
select="footer"/>
- }
- ]
- </xsl:for-each>
- <xsl:for-each select="//myColumnDefs">
- myColumnDefs[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
- </xsl:for-each>
- <xsl:for-each select="//myButtons">
- myButtons[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
- </xsl:for-each>
- </script>
-
-
-</xsl:template>
-
<!-- options for use with select-->
<xsl:template match="options">
<option value="{id}">
Deleted:
branches/Version-2_0-branch/property/templates/base/role_user_substitute.xsl
===================================================================
---
branches/Version-2_0-branch/property/templates/base/role_user_substitute.xsl
2017-04-25 09:19:29 UTC (rev 16618)
+++
branches/Version-2_0-branch/property/templates/base/role_user_substitute.xsl
2017-04-25 09:22:21 UTC (rev 16619)
@@ -1,68 +0,0 @@
-
-<!-- $Id: tts.xsl 16389 2017-02-28 17:35:22Z sigurdne $ -->
-
-<xsl:template match="data">
- <xsl:choose>
- <xsl:when test="view">
- <xsl:apply-templates select="edit"/>
- </xsl:when>
- </xsl:choose>
- <xsl:call-template name="jquery_phpgw_i18n"/>
-</xsl:template>
-
-
-
-<!-- edit -->
-<xsl:template xmlns:php="http://php.net/xsl" match="edit">
- <xsl:variable name="form_action">
- <xsl:value-of select="form_action"/>
- </xsl:variable>
- <form class="pure-form pure-form-aligned" id="form" name="form"
method="post" action="{$form_action}">
- <div id="tab-content">
- <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
- <div id="general">
- <fieldset>
- <div class="pure-control-group">
- <xsl:variable
name="lang_substitute">
- <xsl:value-of
select="php:function('lang', 'substitute')"/>
- </xsl:variable>
- <label>
- <xsl:value-of
select="$lang_substitute"/>
- </label>
- <select
name="substitute_user_id" id="substitute_user_id">
- <xsl:attribute
name="title">
- <xsl:value-of
select="$lang_substitute"/>
- </xsl:attribute>
- <option value="">
- <xsl:value-of
select="php:function('lang', 'select')"/>
- </option>
- <xsl:apply-templates
select="user_list/options"/>
- </select>
- </div>
- </fieldset>
- </div>
- </div>
- <xsl:variable name="lang_save">
- <xsl:value-of select="php:function('lang', 'save')"/>
- </xsl:variable>
- <input type="submit" class="pure-button pure-button-primary"
name="save">
- <xsl:attribute name="value">
- <xsl:value-of select="$lang_save"/>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:value-of select="$lang_save"/>
- </xsl:attribute>
- </input>
- </form>
-</xsl:template>
-
-
-<!-- New 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>
Copied: branches/Version-2_0-branch/property/templates/base/substitute.xsl
(from rev 16618, trunk/property/templates/base/substitute.xsl)
===================================================================
--- branches/Version-2_0-branch/property/templates/base/substitute.xsl
(rev 0)
+++ branches/Version-2_0-branch/property/templates/base/substitute.xsl
2017-04-25 09:22:21 UTC (rev 16619)
@@ -0,0 +1,161 @@
+
+<!-- $Id: tts.xsl 16389 2017-02-28 17:35:22Z sigurdne $ -->
+
+<xsl:template match="data">
+ <xsl:choose>
+ <xsl:when test="view">
+ <xsl:apply-templates select="edit"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="table" xmlns:php="http://php.net/xsl">
+ <style type="text/css">
+ #box { width: 200px; height: 5px; background: blue; }
+ select { width: 200px; }
+ </style>
+ <xsl:call-template name="table_substitute" />
+ <div id="popupBox"></div>
+ <div id="curtain"></div>
+</xsl:template>
+
+<xsl:template name="table_substitute" xmlns:php="http://php.net/xsl">
+ <div class="body">
+ <div id="invoice-layout">
+ <div class="header">
+ <h2>
+ <xsl:value-of
select="php:function('lang', 'substitute')"/>
+ </h2>
+ </div>
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <xsl:call-template name="msgbox"/>
+ </xsl:when>
+ </xsl:choose>
+ <div class="body">
+ <div id="voucher_details">
+ <table align = "center" width="95%">
+ <xsl:apply-templates
select="filter_form" />
+ </table>
+ <form action="{update_action}"
name="acl_form" id="acl_form" method="post">
+ <table align = "center"
width="95%">
+ <tr>
+ <td colspan =
'2'>
+
<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>
+
+ </td>
+ </tr>
+ </table>
+ <div id="receipt"></div>
+ <xsl:variable
name="label_submit">
+ <xsl:value-of
select="php:function('lang', 'save')" />
+ </xsl:variable>
+ <div class="row_on">
+ <input type="submit"
name="update_acl" id="frm_update_acl" value="{$label_submit}"/>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</xsl:template>
+
+<xsl:template match="filter_form" xmlns:php="http://php.net/xsl">
+ <xsl:call-template name="filter_list"/>
+</xsl:template>
+
+<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
+ <tr>
+ <td colspan = '1'>
+ <table>
+ <tr>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'user')" />
+ </td>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'substitute')" />
+ </td>
+ </tr>
+ <tr id="filters">
+ <td>
+ <select id="user_id"
name="user_id">
+ <xsl:apply-templates
select="user_list/options"/>
+ </select>
+ </td>
+ <td>
+ <select id="substitute_user_id"
name="substitute_user_id">
+ <xsl:apply-templates
select="substitute_list/options"/>
+ </select>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</xsl:template>
+
+
+
+<!-- edit -->
+<xsl:template xmlns:php="http://php.net/xsl" match="edit">
+ <xsl:variable name="form_action">
+ <xsl:value-of select="form_action"/>
+ </xsl:variable>
+ <form class="pure-form pure-form-aligned" id="form" name="form"
method="post" action="{$form_action}">
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
+ <div id="general">
+ <fieldset>
+ <div class="pure-control-group">
+ <xsl:variable
name="lang_substitute">
+ <xsl:value-of
select="php:function('lang', 'substitute')"/>
+ </xsl:variable>
+ <label>
+ <xsl:value-of
select="$lang_substitute"/>
+ </label>
+ <select
name="substitute_user_id" id="substitute_user_id">
+ <xsl:attribute
name="title">
+ <xsl:value-of
select="$lang_substitute"/>
+ </xsl:attribute>
+ <option value="">
+ <xsl:value-of
select="php:function('lang', 'select')"/>
+ </option>
+ <xsl:apply-templates
select="user_list/options"/>
+ </select>
+ </div>
+ </fieldset>
+ </div>
+ </div>
+ <xsl:variable name="lang_save">
+ <xsl:value-of select="php:function('lang', 'save')"/>
+ </xsl:variable>
+ <input type="submit" class="pure-button pure-button-primary"
name="save">
+ <xsl:attribute name="value">
+ <xsl:value-of select="$lang_save"/>
+ </xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="$lang_save"/>
+ </xsl:attribute>
+ </input>
+ </form>
+</xsl:template>
+
+
+<!-- New 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>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16619] Stable: Merge 16615:16618 from trunk,
sigurdne <=