fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11501] controller: fix check required


From: Sigurd Nes
Subject: [Fmsystem-commits] [11501] controller: fix check required
Date: Sun, 01 Dec 2013 14:27:59 +0000

Revision: 11501
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11501
Author:   sigurdne
Date:     2013-12-01 14:27:58 +0000 (Sun, 01 Dec 2013)
Log Message:
-----------
controller: fix check required 

Modified Paths:
--------------
    trunk/controller/inc/class.socase.inc.php
    trunk/controller/inc/class.uicheck_list.inc.php

Modified: trunk/controller/inc/class.socase.inc.php
===================================================================
--- trunk/controller/inc/class.socase.inc.php   2013-11-28 15:06:56 UTC (rev 
11500)
+++ trunk/controller/inc/class.socase.inc.php   2013-12-01 14:27:58 UTC (rev 
11501)
@@ -146,11 +146,12 @@
                 * @param       $location_item_id location item id
                 * @return array of case object represented as objects or arrays
                */
-               public function get_cases_by_component($component_location_id, 
$component_id, $control_item_id = 0)
+               public function get_cases_by_component($component_location_id, 
$component_id, $control_item_id = 0, $check_list_id = 0)
                {
                        $component_location_id  = (int) $component_location_id;
                        $component_id                   = (int) $component_id;
                        $control_item_id                = (int) 
$control_item_id;
+                       $check_list_id                  = (int) $check_list_id;
 
                        $sql = "SELECT controller_check_item_case.*, 
check_list_id FROM controller_check_item_case " 
                        . " {$this->join} controller_check_item ON 
controller_check_item_case.check_item_id = controller_check_item.id"
@@ -161,6 +162,11 @@
                                $sql .= " AND 
controller_check_item.control_item_id = {$control_item_id}";
                        }
 
+                       if($check_list_id)
+                       {
+                               $sql .= " AND check_list_id = {$check_list_id}";
+                       }
+
                        $this->db->query($sql);
 
                        $values = array();

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2013-11-28 15:06:56 UTC 
(rev 11500)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2013-12-01 14:27:58 UTC 
(rev 11501)
@@ -731,6 +731,15 @@
                                return json_encode( array( "status" => 
'not_saved') );                  
                        }
 
+                       if($check_list_status == 
controller_check_list::STATUS_DONE)
+                       {
+                               $check_list->set_completed_date(time());
+                       }
+                       else
+                       {
+                               $check_list->set_completed_date(0);
+                       }
+
                        $check_list->set_status( $check_list_status );
 
                        if($this->so->store($check_list))
@@ -847,7 +856,8 @@
                                        {
                                                
foreach($_components_at_location as &$_component_at_location)
                                                {
-                                                       $_ok = 
$this->so_case->get_cases_by_component($_component_at_location['location_id'], 
$_component_at_location['id'], $required_control_item['id']);
+                                                       $_ok = 
$this->so_case->get_cases_by_component($_component_at_location['location_id'], 
$_component_at_location['id'], $required_control_item['id'], 
$check_list->get_id());
+
                                                        if(!$_ok)
                                                        {
                                                                $error_message 
=  "mangler registrering for required</br>";




reply via email to

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