fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [13233]


From: Nelson Guerra
Subject: [Fmsystem-commits] [13233]
Date: Tue, 19 May 2015 22:05:24 +0000

Revision: 13233
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13233
Author:   nelson224
Date:     2015-05-19 22:05:24 +0000 (Tue, 19 May 2015)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind/property/inc/class.uilocation.inc.php

Modified: branches/dev-syncromind/property/inc/class.uilocation.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uilocation.inc.php       
2015-05-19 22:05:06 UTC (rev 13232)
+++ branches/dev-syncromind/property/inc/class.uilocation.inc.php       
2015-05-19 22:05:24 UTC (rev 13233)
@@ -211,6 +211,7 @@
                        //$this->save_sessiondata();
 
                        $user_id = phpgw::get_var('user_id', 'int', 'request', 
$this->account);
+                       $result['message'] = array();
 
                        if(($assign || $assign_orig) && $this->acl_edit)
                        {
@@ -220,7 +221,7 @@
                                $contact_id = $account->person_id;
                                if(empty($role_id))
                                {
-                                       $result = lang('missing role');
+                                       $result['error'][] = array('msg'=> 
lang('missing role'));
                                }
                                else
                                {
@@ -233,7 +234,7 @@
                                        $result = 
$boresponsible->update_role_assignment($values);
                                }
                        }
-
+                       
                        return $result;
                }
 
@@ -1374,7 +1375,8 @@
                                                        'second_display'    => 
1,
                                                        'status'            => 
$this->status,
                                                        'location_code'     => 
$this->location_code,
-                                                       'entity_id'             
        => $this->entity_id
+                                                       'entity_id'             
        => $this->entity_id,
+                                                       'phpgw_return_as' => 
'json'
                                                ));
                                
                                $code = '
@@ -1392,9 +1394,21 @@
 
                                        var data = {"assign": assign, 
"assign_orig": assign_orig, "user_id": $("#user_id").val(), "role_id": 
$("#role_id").val()};
                                        execute_ajax(link, function(result){
-                                               
document.getElementById("message").innerHTML += "<br/>" + result;
+                                               
document.getElementById("message").innerHTML = "";
+                                               if (typeof(result.message) !== 
"undefined")
+                                               {
+                                                       $.each(result.message, 
function (k, v) {
+                                                               
document.getElementById("message").innerHTML = v.msg + "<br/>";
+                                                       });
+                                               }
+                                               if (typeof(result.error) !== 
"undefined")
+                                               {
+                                                       $.each(result.error, 
function (k, v) {
+                                                               
document.getElementById("message").innerHTML += v.msg + "<br/>";
+                                                       });
+                                               }
                                                oTable.fnDraw();
-                                       }, data, "POST");
+                                       }, data, "POST", "JSON");
                                ';
 
                                $data['datatable']['actions'][] = array




reply via email to

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