fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15855] more on integration


From: sigurdne
Subject: [Fmsystem-commits] [15855] more on integration
Date: Wed, 19 Oct 2016 12:44:14 +0000 (UTC)

Revision: 15855
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15855
Author:   sigurdne
Date:     2016-10-19 12:44:14 +0000 (Wed, 19 Oct 2016)
Log Message:
-----------
more on integration

Modified Paths:
--------------
    trunk/property/inc/class.sopending_action.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/js/portico/tts.view.js

Modified: trunk/property/inc/class.sopending_action.inc.php
===================================================================
--- trunk/property/inc/class.sopending_action.inc.php   2016-10-19 11:39:12 UTC 
(rev 15854)
+++ trunk/property/inc/class.sopending_action.inc.php   2016-10-19 12:44:14 UTC 
(rev 15855)
@@ -222,8 +222,7 @@
                        $start = isset($data['start']) && $data['start'] ? 
$data['start'] : 0;
                        $appname = isset($data['appname']) && $data['appname'] 
? $data['appname'] : '';
                        $location = isset($data['location']) && 
$data['location'] ? $data['location'] : '';
-                       $item_id = isset($data['id']) && $data['id'] ? 
$data['id'] : '';
-                       $data['id']; //possible bigint
+                       $item_id = isset($data['id']) && $data['id'] ? 
$data['id'] : '';//possible bigint
                        $responsible = (int)$data['responsible'];
                        $responsible_type = isset($data['responsible_type']) && 
$data['responsible_type'] ? $data['responsible_type'] : 'user';
                        $action = isset($data['action']) && $data['action'] ? 
$this->db->db_addslashes($data['action']) : '';
@@ -232,6 +231,7 @@
                        $sort = isset($data['sort']) && $data['sort'] ? 
$data['sort'] : 'DESC';
                        $order = isset($data['order']) ? $data['order'] : '';
                        $allrows = isset($data['allrows']) ? $data['allrows'] : 
'';
+                       $closed = isset($data['closed']) ? $data['closed'] : '';
                        $results = isset($data['results']) ? 
(int)$data['results'] : 0;
 
                        if (!in_array($responsible_type, 
$this->valid_responsible_types))
@@ -278,6 +278,11 @@
                                $ordermethod = ' ORDER BY created_on DESC';
                        }
 
+                       if($closed)
+                       {
+
+                       }
+
                        $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 11:39:12 UTC (rev 
15854)
+++ trunk/property/inc/class.uitts.inc.php      2016-10-19 12:44:14 UTC (rev 
15855)
@@ -2304,8 +2304,7 @@
                                                $GLOBALS['phpgw']->send = 
CreateObject('phpgwapi.send');
                                        }
 
-                                       $action_params = array
-                                               (
+                                       $action_params = array(
                                                'appname' => 'property',
                                                'location' => '.ticket',
                                                'id' => $id,
@@ -2333,7 +2332,32 @@
                                        $receipt['error'][] = array('msg' => 
lang('SMTP server is not set! (admin section)'));
                                }
                        }
+       
+                       if (!empty($values['do_approve']) && 
is_array($values['do_approve']))
+                       {
+                               $action_params = array(
+                                       'appname' => 'property',
+                                       'location' => '.ticket',
+                                       'id' => $id,
+                                       'responsible' => '',
+                                       'responsible_type' => 'user',
+                                       'action' => 'approval',
+                                       'remark' => '',
+                                       'deadline' => ''
+                               );
 
+                               foreach ($values['do_approve'] as $_account_id 
=> $_dummy)
+                               {
+                                       $action_params['responsible'] = 
$_account_id;
+                               //      
if(!execMethod('property.sopending_action.get_pending_action', $action_params))
+                                       {
+                                               
execMethod('property.sopending_action.set_pending_action', $action_params);
+                                       }
+                                       
execMethod('property.sopending_action.close_pending_action', $action_params);
+                               }
+                       }
+
+
                        // end approval
                        // -------- end order section
 
@@ -3191,6 +3215,8 @@
                        $supervisor_email = array();
                        if ($supervisor_id && $need_approval)
                        {
+                               $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $date =
 
                                $pending_action = 
CreateObject('property.sopending_action');
 
@@ -3215,7 +3241,8 @@
                                                'id' => $supervisor_id,
                                                'address' => $prefs['email'],
                                                'required'      => true,
-                                               'approved'      => 
!!$approval['action_performed'],
+                                               'approved'      => 
true,//!!$approval['action_performed'],
+                                               'approved_time'  => 
$GLOBALS['phpgw']->common->show_date($approval['action_performed'], 
$dateformat),
                                                'is_user'       => 
$supervisor_id == $this->account ? true : false
                                        );
                                }
@@ -3253,6 +3280,7 @@
                                                        'address' => 
$prefs2['email'],
                                                        'required'      => 
false,
                                                        'approved'      => 
!!$approval['action_performed'],
+                                                       'approved_time'  => 
$GLOBALS['phpgw']->common->show_date($approval['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 11:39:12 UTC (rev 
15854)
+++ trunk/property/js/portico/tts.view.js       2016-10-19 12:44:14 UTC (rev 
15855)
@@ -389,7 +389,7 @@
        var total_amount = Number(amount) + Number($('#budget').val());
        $("#order_received_amount").val(total_amount);
 
-       var oArgs = {menuaction: 'property.uitts.check_purchase_right', 
ecodimb: ecodimb, amount: total_amount, ticket_id:location_item_id};
+       var oArgs = {menuaction: 'property.uitts.check_purchase_right', 
ecodimb: ecodimb, amount: total_amount, ticket_id: location_item_id};
        var requestUrl = phpGWLink('index.php', oArgs, true);
        var htmlString = "";
 
@@ -411,19 +411,20 @@
 
                                        htmlString += "<tr><td>";
 
-                                       if (obj[i].required === true)
+                                       var left_cell = "Ikke relevant";
+                                       if (obj[i].is_user !== true)
                                        {
-                                               if(obj[i].approved === true)
+                                               if (obj[i].approved !== true)
                                                {
-                                                       required = 
'disabled="disabled"';
+                                                       if (obj[i].required === 
true)
+                                                       {
+                                                               required = 
'checked="checked" disabled="disabled"';
+                                                               left_cell = 
"<input type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\"" 
+ obj[i].address + "\"></input>";
+                                                       }
+                                                       left_cell += "<input 
type=\"checkbox\" name=\"values[approval][" + obj[i].id + "]\" value=\"" + 
obj[i].address + "\"" + required + "></input>";
                                                }
-                                               else
-                                               {
-                                                       htmlString += "<input 
type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\"" + 
obj[i].address + "\"></input>";
-                                                       required = 
'checked="checked" disabled="disabled"';
-                                               }
                                        }
-                                       htmlString += "<input type=\"checkbox\" 
name=\"values[approval][" + obj[i].id + "]\" value=\"" + obj[i].address + "\"" 
+ required + "></input>";
+                                       htmlString += left_cell;
                                        htmlString += "</td><td 
valign=\"top\">";
                                        htmlString += obj[i].address;
                                        htmlString += "</td>";
@@ -431,7 +432,7 @@
 
                                        if (obj[i].approved === true)
                                        {
-                                               htmlString + "X";
+                                               htmlString += 
obj[i].approved_time;
                                        }
                                        else
                                        {
@@ -441,7 +442,7 @@
                                                }
                                        }
                                        htmlString += "</td>";
-                                       
+
                                        htmlString += "</tr>";
                                });
                                htmlString += "</tbody></table>";




reply via email to

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