fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [13120] more on controller integration


From: Sigurd Nes
Subject: [Fmsystem-commits] [13120] more on controller integration
Date: Thu, 30 Apr 2015 11:24:30 +0000

Revision: 13120
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13120
Author:   sigurdne
Date:     2015-04-30 11:24:29 +0000 (Thu, 30 Apr 2015)
Log Message:
-----------
more on controller integration

Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.inc.php
    trunk/property/inc/class.boentity.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/js/yahoo/entity.edit.js
    trunk/property/templates/base/entity.xsl

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2015-04-29 23:04:03 UTC 
(rev 13119)
+++ trunk/controller/inc/class.socontrol.inc.php        2015-04-30 11:24:29 UTC 
(rev 13120)
@@ -895,9 +895,39 @@
                                        $sql .= "AND component_id = 
{$component_id}";
                                        
                                        $this->db->query($sql, __LINE__, 
__FILE__);
-                       
-                                       if(!$this->db->next_record() || 
$duplicate)
+                                       $this->db->next_record();
+                                       $relation_id = $this->db->f('id');
+                                       if(!$relation_id || $duplicate)
                                        {
+                                               if($relation_id)
+                                               {
+                                                       $sql = "SELECT * FROM 
controller_control_serie"
+                                                       . " WHERE 
control_relation_id = {$relation_id}"
+                                                       . " AND repeat_type = 
{$repeat_type}";
+                                                       //. " AND 
repeat_interval = {$repeat_interval}";
+                                                       $this->db->query($sql, 
__LINE__, __FILE__);
+                                                       
$this->db->next_record();
+                                                       $serie_id = 
$this->db->f('id');
+                                                       if($serie_id)
+                                                       {
+                                                               
$this->update_control_serie($data = array(
+                                                                       'ids'   
                        => array($serie_id),
+                                                                       
'action'                        => 'edit',
+                                                                       
'assigned_to'           => $assigned_to,
+                                                                       
'start_date'            => $start_date,
+                                                                       
'repeat_type'           => $repeat_type,
+                                                                       
'repeat_interval'       => $repeat_interval,
+                                                                       
'controle_time'         => $controle_time,
+                                                                       
'service_time'          => $service_time,
+                                                               ));
+                                                               $ret = 
$this->update_control_serie($data = array(
+                                                                       'ids'   
                        => array($serie_id),
+                                                                       
'action'                        => 'enable',
+                                                               ));
+                                                               continue;
+                                                       }
+                                               }
+
                                                $values_insert = array
                                                (
                                                        'control_id'            
=> $control_id,
@@ -1405,7 +1435,9 @@
                                $value_set_update = 
$this->db->validate_update($value_set);
 
                        $sql = "UPDATE controller_control_serie SET 
{$value_set_update} WHERE id IN (" . implode(',', $ids) . ')';
-                       $this->db->query($sql,__LINE__,__FILE__);
-
+                       if($this->db->query($sql,__LINE__,__FILE__))
+                       {
+                               return PHPGW_ACL_EDIT; // Bit - edit
+                       }
                }
        }

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2015-04-29 23:04:03 UTC (rev 
13119)
+++ trunk/property/inc/class.boentity.inc.php   2015-04-30 11:24:29 UTC (rev 
13120)
@@ -1055,6 +1055,29 @@
                                'controle_time'         => 
phpgw::get_var('controle_time', 'float'),
                                'service_time'          => 
phpgw::get_var('service_time', 'float')
                        );
-                       $so_control->update_control_serie($values);
+                       $ret = $so_control->update_control_serie($values);
+
+                       if($ret)
+                       {
+                               $result =  array
+                               (
+                                       'status_kode'=> 'ok',
+                                       'status'        => 'Ok',
+                                       'msg'           => lang('updated')
+
+                               );
+                       }
+                       else
+                       {
+                               $result =  array
+                               (
+                                       'status_kode'=> 'error',
+                                       'status'        => lang('error'),
+                                       'msg'           => 'Noe gikk galt'
+                               );
+                       }
+
+                       return $result;
+
                }
        }

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2015-04-29 23:04:03 UTC (rev 
13119)
+++ trunk/property/inc/class.uientity.inc.php   2015-04-30 11:24:29 UTC (rev 
13120)
@@ -2391,9 +2391,10 @@
                                        $myButtons[4] = array
                                        (
                                                'name'   => "4",
-                                               'values'  => json_encode(array( 
array('id' =>'values[enable_serie]','type'=>'buttons', 'value'=>'enable', 
'label'=>lang('enable'), 'funct'=> 'onActionsClick' , 'classname'=> 
'actionButton', 'value_hidden'=>""),
-                                                                               
                                array('id' 
=>'values[disable_serie]','type'=>'buttons', 'value'=>'disable', 
'label'=>lang('disable'), 'funct'=> 'onActionsClick' , 'classname'=> 
'actionButton', 'value_hidden'=>""),
-                                                                               
                                array('id' 
=>'values[edit_serie]','type'=>'buttons', 'value'=>'edit', 
'label'=>lang('edit'), 'funct'=> 'onActionsClick' , 'classname'=> 
'actionButton', 'value_hidden'=>""),
+                                               'values'  => json_encode(array( 
array('id' =>'add_serie','type'=>'buttons', 'value'=>'add', 
'label'=>lang('add'), 'funct'=> 'onActionsClick' , 'classname'=> 
'actionButton', 'value_hidden'=>""),
+                                                                               
                                array('id' =>'enable_serie','type'=>'buttons', 
'value'=>'enable', 'label'=>lang('enable'), 'funct'=> 'onActionsClick' , 
'classname'=> 'actionButton', 'value_hidden'=>""),
+                                                                               
                                array('id' =>'disable_serie','type'=>'buttons', 
'value'=>'disable', 'label'=>lang('disable'), 'funct'=> 'onActionsClick' , 
'classname'=> 'actionButton', 'value_hidden'=>""),
+                                                                               
                                array('id' =>'edit_serie','type'=>'buttons', 
'value'=>'edit', 'label'=>lang('edit'), 'funct'=> 'onActionsClick' , 
'classname'=> 'actionButton', 'value_hidden'=>""),
                                        ))
                                );
 

Modified: trunk/property/js/yahoo/entity.edit.js
===================================================================
--- trunk/property/js/yahoo/entity.edit.js      2015-04-29 23:04:03 UTC (rev 
13119)
+++ trunk/property/js/yahoo/entity.edit.js      2015-04-30 11:24:29 UTC (rev 
13120)
@@ -29,10 +29,17 @@
                        }
                }
 
+               $("#controller_receipt").html("");
+
+               var action = this.get("value");
+
+               if(action === 'add')
+               {
+                       add_control();
+               }
+
                if(flag)
                {
-                       var action = this.get("value");
-
                        var ids = [];
 
                        $(".mychecks:checked").each(function () {
@@ -54,10 +61,7 @@
                        oArgs.menuaction = 
'property.boentity.update_control_serie';
 
                        var requestUrl = phpGWLink('index.php', oArgs, true);
-       //                                                              
alert(requestUrl);
 
-                       $("#controller_receipt").html("");
-
                        $.ajax({
                                type: 'POST',
                                dataType: 'json',
@@ -82,12 +86,6 @@
                }
        }
        
-       this.cleanValuesHiddenActionsButtons=function()
-       {
-               YAHOO.util.Dom.get('hd_values[enable_serie]').value = '';
-               YAHOO.util.Dom.get('hd_values[disable_serie]').value = '';
-       }
-
        function parseURL(url)
        {
                var parser = document.createElement('a'),
@@ -153,6 +151,9 @@
                                                
$("#control_responsible").val('');
                                                
$("#control_responsible_user_name").val('');
                                                
$("#control_start_date").val('');
+                                               $("#repeat_interval").val('');
+                                               $("#controle_time").val('');
+                                               $("#service_time").val('');
                                        }
                                }
                        }

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2015-04-29 23:04:03 UTC (rev 
13119)
+++ trunk/property/templates/base/entity.xsl    2015-04-30 11:24:29 UTC (rev 
13120)
@@ -725,13 +725,6 @@
                                                                </input>
                                                                </td>
                                                                </tr>
-                                                               <tr>
-                                                               <td>
-                                                               <input 
type="button" name="" value="{$lang_add}" title="{$lang_add}" 
onClick="add_control();">
-                                                               </input>
-                                                               </td>
-                                                               <td></td>
-                                                               </tr>
                                                        </table>
                                                        <table>
                                                                <tr>
@@ -847,7 +840,7 @@
                                        </xsl:choose>
 
                                        <xsl:choose>
-                                               <xsl:when test="value_id !='' 
and enable_bulk = ''">
+                                               <xsl:when test="value_id !='' 
and enable_bulk = '0'">
                                                        <div id="related">
                                                                <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
                                                                        <tr>




reply via email to

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