[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15856] more in integration
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15856] more in integration |
Date: |
Wed, 19 Oct 2016 16:36:21 +0000 (UTC) |
Revision: 15856
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15856
Author: sigurdne
Date: 2016-10-19 16:36:20 +0000 (Wed, 19 Oct 2016)
Log Message:
-----------
more in integration
Modified Paths:
--------------
trunk/phpgwapi/setup/phpgw_no.lang
trunk/property/inc/class.sopending_action.inc.php
trunk/property/inc/class.uitts.inc.php
trunk/property/js/portico/tts.view.js
trunk/property/templates/base/tts.xsl
Modified: trunk/phpgwapi/setup/phpgw_no.lang
===================================================================
--- trunk/phpgwapi/setup/phpgw_no.lang 2016-10-19 12:44:14 UTC (rev 15855)
+++ trunk/phpgwapi/setup/phpgw_no.lang 2016-10-19 16:36:20 UTC (rev 15856)
@@ -32,7 +32,7 @@
delete common no Slett
domain common no Database
domain name for mail-address, eg. %1 common no Domene-navnet for
E-Postadressen, %1
-done common no Avslutt
+done common no Avbryt
e-mail common no E-Post
email-address of the user, eg. %1 common no E-Postadressen til
brukeren, %1
edit common no Editer
Modified: trunk/property/inc/class.sopending_action.inc.php
===================================================================
--- trunk/property/inc/class.sopending_action.inc.php 2016-10-19 12:44:14 UTC
(rev 15855)
+++ trunk/property/inc/class.sopending_action.inc.php 2016-10-19 16:36:20 UTC
(rev 15856)
@@ -247,7 +247,7 @@
}
$ret = array();
- $condition = " WHERE action_performed IS NULL AND
expired_on IS NULL AND num = '{$action}' AND location_id = {$location_id}";
+ $condition = " WHERE num = '{$action}' AND location_id
= {$location_id}";
if ($responsible)
{
@@ -280,8 +280,13 @@
if($closed)
{
-
+ $ordermethod = ' ORDER BY action_performed
DESC';
+ $condition .= " AND action_performed IS NOT
NULL";
}
+ else
+ {
+ $condition .= " AND action_performed IS NULL
AND expired_on IS NULL ";
+ }
$sql = "SELECT fm_action_pending.* FROM
fm_action_pending {$this->join} fm_action_pending_category"
. " ON fm_action_pending.action_category =
fm_action_pending_category.id {$condition}";
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2016-10-19 12:44:14 UTC (rev
15855)
+++ trunk/property/inc/class.uitts.inc.php 2016-10-19 16:36:20 UTC (rev
15856)
@@ -2318,12 +2318,18 @@
foreach ($values['approval'] as
$_account_id => $_address)
{
$action_params['responsible'] =
$_account_id;
- $rcpt =
$GLOBALS['phpgw']->send->msg('email', $_address, $subject,
stripslashes($message), '', $cc, $bcc, $coordinator_email, $coordinator_name,
'html');
- if ($rcpt)
+ try
{
- $receipt['message'][] =
array('msg' => lang('%1 is notified', $_address));
+ $rcpt =
$GLOBALS['phpgw']->send->msg('email', $_address, $subject,
stripslashes($message), '', $cc, $bcc, $coordinator_email, $coordinator_name,
'html');
+ if ($rcpt)
+ {
+
$receipt['message'][] = array('msg' => lang('%1 is notified', $_address));
+ }
}
-
+ catch (Exception $exc)
+ {
+ $receipt['error'][] =
array('msg' => $exc->getMessage());
+ }
execMethod('property.sopending_action.set_pending_action', $action_params);
}
}
@@ -2349,7 +2355,7 @@
foreach ($values['do_approve'] as $_account_id
=> $_dummy)
{
$action_params['responsible'] =
$_account_id;
- //
if(!execMethod('property.sopending_action.get_pending_action', $action_params))
+
if(!execMethod('property.sopending_action.get_pending_action', $action_params))
{
execMethod('property.sopending_action.set_pending_action', $action_params);
}
@@ -3216,7 +3222,6 @@
if ($supervisor_id && $need_approval)
{
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- $date =
$pending_action =
CreateObject('property.sopending_action');
@@ -3229,11 +3234,18 @@
'action' => 'approval',
'deadline' => '',
'created_by' => '',
- 'allrows' => false
+ 'allrows' => false,
+ 'closed' => true
);
- $approval =
$pending_action->get_pending_action($action_params);
+ $approvals =
$pending_action->get_pending_action($action_params);
+ if(!$approvals)
+ {
+ $action_params['closed'] = false;
+ }
+ $requests =
$pending_action->get_pending_action($action_params);
+
$prefs =
$this->bocommon->create_preferences('property', $supervisor_id);
if (isset($prefs['email']) && $prefs['email'])
{
@@ -3241,8 +3253,10 @@
'id' => $supervisor_id,
'address' => $prefs['email'],
'required' => true,
- 'approved' =>
true,//!!$approval['action_performed'],
- 'approved_time' =>
$GLOBALS['phpgw']->common->show_date($approval['action_performed'],
$dateformat),
+ 'requested' =>
!!$requests[0]['action_requested'],
+ 'requested_time'=>
$GLOBALS['phpgw']->common->show_date($requests[0]['action_requested'],
$dateformat),
+ 'approved' =>
!!$approvals[0]['action_performed'],
+ 'approved_time' =>
$GLOBALS['phpgw']->common->show_date($approvals[0]['action_performed'],
$dateformat),
'is_user' =>
$supervisor_id == $this->account ? true : false
);
}
@@ -3261,16 +3275,23 @@
'appname' => 'property',
'location' => '.ticket',
'id' => $ticket_id,
- 'responsible' => $supervisor_id,
+ 'responsible' =>
$prefs['approval_from'],
'responsible_type' => 'user',
'action' => 'approval',
'deadline' => '',
'created_by' => '',
- 'allrows' => false
+ 'allrows' => false,
+ 'closed' => true
);
- $approval =
$pending_action->get_pending_action($action_params);
+ $approvals =
$pending_action->get_pending_action($action_params);
+ if(!$approvals)
+ {
+ $action_params['closed'] =
false;
+ }
+ $requests =
$pending_action->get_pending_action($action_params);
+
$prefs2 =
$this->bocommon->create_preferences('property', $prefs['approval_from']);
if (isset($prefs2['email']) &&
$prefs2['email'])
@@ -3279,8 +3300,10 @@
'id' =>
$prefs['approval_from'],
'address' =>
$prefs2['email'],
'required' =>
false,
- 'approved' =>
!!$approval['action_performed'],
- 'approved_time' =>
$GLOBALS['phpgw']->common->show_date($approval['action_performed'],
$dateformat),
+ 'requested' =>
!!$requests[0]['action_requested'],
+ 'requested_time'=>
$GLOBALS['phpgw']->common->show_date($requests[0]['action_requested'],
$dateformat),
+ 'approved' =>
!!$approvals[0]['action_performed'],
+ 'approved_time' =>
$GLOBALS['phpgw']->common->show_date($approvals[0]['action_performed'],
$dateformat),
'is_user' =>
$prefs['approval_from'] == $this->account ? true : false
);
$supervisor_email =
array_reverse($supervisor_email);
Modified: trunk/property/js/portico/tts.view.js
===================================================================
--- trunk/property/js/portico/tts.view.js 2016-10-19 12:44:14 UTC (rev
15855)
+++ trunk/property/js/portico/tts.view.js 2016-10-19 16:36:20 UTC (rev
15856)
@@ -412,8 +412,13 @@
htmlString += "<tr><td>";
var left_cell = "Ikke relevant";
- if (obj[i].is_user !== true)
+
+ if (obj[i].requested === true)
{
+ left_cell =
obj[i].requested_time;
+ }
+ else if (obj[i].is_user !== true)
+ {
if (obj[i].approved !== true)
{
if (obj[i].required ===
true)
@@ -421,9 +426,17 @@
required =
'checked="checked" disabled="disabled"';
left_cell =
"<input type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\""
+ obj[i].address + "\"></input>";
}
+ else
+ {
+ left_cell = '';
+ }
left_cell += "<input
type=\"checkbox\" name=\"values[approval][" + obj[i].id + "]\" value=\"" +
obj[i].address + "\"" + required + "></input>";
}
}
+ else if (obj[i].is_user === true)
+ {
+ left_cell = '(Meg selv...)';
+ }
htmlString += left_cell;
htmlString += "</td><td
valign=\"top\">";
htmlString += obj[i].address;
@@ -451,6 +464,25 @@
}
}
});
-
}
-;
+$(document).ready(function ()
+{
+ var offset = $("#box").offset();
+ var topPadding = 180;
+ $(window).scroll(function ()
+ {
+ if ($(window).scrollTop() > offset.top)
+ {
+ $("#box").stop().animate({
+ marginTop: $(window).scrollTop() - offset.top +
topPadding
+ }, 100);
+ }
+ else
+ {
+ $("#box").stop().animate({
+ marginTop: 0
+ }, 100);
+ }
+ ;
+ });
+});
Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl 2016-10-19 12:44:14 UTC (rev
15855)
+++ trunk/property/templates/base/tts.xsl 2016-10-19 16:36:20 UTC (rev
15856)
@@ -230,6 +230,19 @@
<!-- view -->
<xsl:template xmlns:php="http://php.net/xsl" match="view">
+ <style type="text/css">
+ #floating-box {
+ position: relative;
+ z-index: 1000;
+ }
+ #box {
+ position: absolute;
+ right: 10px;
+ border: 1px solid #B5076D;
+ padding: 0 10px 10px 10px;
+ width: 200px;
+ background-color: #FFF;
+ } </style>
<script type="text/javascript">
self.name="first_Window";
<xsl:value-of select="lookup_functions"/>
@@ -303,6 +316,37 @@
<form class="pure-form pure-form-aligned" ENCTYPE="multipart/form-data"
id="form" name="form" method="post" action="{$form_action}">
<div id="tab-content">
<xsl:value-of disable-output-escaping="yes"
select="tabs"/>
+ <div id="floating-box">
+ <div id="box">
+ <table width="200px">
+ <tbody>
+ <tr>
+ <td
width="200px">
+ <input
type="hidden" id="save" name="values[save]" value=""/>
+ <input
type="button" class="pure-button pure-button-primary" name="save"
onClick="confirm_session('save');">
+
<xsl:attribute name="value">
+
<xsl:value-of select="php:function('lang', 'save')"/>
+
</xsl:attribute>
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'save the ticket')"/>
+
</xsl:attribute>
+ </input>
+ </td>
+ <td>
+
<xsl:variable name="lang_done">
+
<xsl:value-of select="php:function('lang', 'done')"/>
+
</xsl:variable>
+ <input
type="button" class="pure-button pure-button-primary" name="done"
value="{$lang_done}" onClick="document.cancel_form.submit();">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'Back to the ticket list')"/>
+
</xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
<div id="general">
<fieldset>
<div class="pure-control-group">
@@ -1002,7 +1046,7 @@
<xsl:when test="need_approval='1'">
<div class="pure-control-group">
<label>
-
<xsl:value-of select="php:function('lang', 'ask for
approval')"/>
+
<xsl:value-of select="php:function('lang',
'approval')"/>
</label>
<div id="approval_container" class="pure-table pure-u-md-1-2">
</div>
@@ -1239,7 +1283,7 @@
</input>
</div>
</form>
-
+
<xsl:variable name="done_action">
<xsl:value-of select="done_action"/>
</xsl:variable>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15856] more in integration,
sigurdne <=