fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15370] controller: prepare for php7


From: sigurdne
Subject: [Fmsystem-commits] [15370] controller: prepare for php7
Date: Mon, 25 Jul 2016 12:58:08 +0000 (UTC)

Revision: 15370
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15370
Author:   sigurdne
Date:     2016-07-25 12:58:07 +0000 (Mon, 25 Jul 2016)
Log Message:
-----------
controller: prepare for php7

Modified Paths:
--------------
    trunk/controller/inc/class.socase.inc.php
    trunk/controller/inc/class.socheck_item.inc.php
    trunk/controller/inc/class.socheck_list.inc.php
    trunk/controller/inc/class.socommon.inc.php
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/inc/class.socontrol_group.inc.php
    trunk/controller/inc/class.socontrol_group_list.inc.php
    trunk/controller/inc/class.socontrol_item.inc.php
    trunk/controller/inc/class.socontrol_item_list.inc.php
    trunk/controller/inc/class.socontrol_item_option.inc.php
    trunk/controller/inc/class.sodocument.inc.php
    trunk/controller/inc/class.soprocedure.inc.php
    trunk/controller/inc/class.uicontrol.inc.php
    trunk/controller/inc/class.uicontrol_group.inc.php
    trunk/controller/inc/class.uicontrol_item.inc.php
    trunk/controller/inc/class.uiprocedure.inc.php
    trunk/controller/inc/model/class.model.inc.php

Modified: trunk/controller/inc/class.socase.inc.php
===================================================================
--- trunk/controller/inc/class.socase.inc.php   2016-07-25 12:06:21 UTC (rev 
15369)
+++ trunk/controller/inc/class.socase.inc.php   2016-07-25 12:58:07 UTC (rev 
15370)
@@ -51,7 +51,7 @@
                        return self::$so;
                }
 
-               function get_query( string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count )
+               function get_query( string $sort_field, bool $ascending, string 
$search_for, string $search_type, array $filters, bool $return_count )
                {
 
                }

Modified: trunk/controller/inc/class.socheck_item.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_item.inc.php     2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.socheck_item.inc.php     2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -497,7 +497,7 @@
                  }
                 */
 
-               function get_query( string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count )
+               function get_query( string $sort_field, bool $ascending, string 
$search_for, string $search_type, array $filters, bool $return_count )
                {
 
                }

Modified: trunk/controller/inc/class.socheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_list.inc.php     2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.socheck_list.inc.php     2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -715,7 +715,7 @@
                        return array("location_code" => $location_code, 
"check_lists_array" => $check_lists_array);
                }
 
-               function get_query( string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count )
+               function get_query( string $sort_field, bool $ascending, string 
$search_for, string $search_type, array $filters, bool $return_count )
                {
                        $current_time = time();
                        $buffer_in_days = 3600 * 24 * 7 * 5;

Modified: trunk/controller/inc/class.socommon.inc.php
===================================================================
--- trunk/controller/inc/class.socommon.inc.php 2016-07-25 12:06:21 UTC (rev 
15369)
+++ trunk/controller/inc/class.socommon.inc.php 2016-07-25 12:58:07 UTC (rev 
15370)
@@ -92,11 +92,11 @@
                {
                        if ($type == 'bool')
                        {
-                               return (boolean)$value;
+                               return (bool)$value;
                        }
                        else if ($type == 'boolean')
                        {
-                               return (boolean)$value;
+                               return (bool)$value;
                        }
                        else if ($type == 'int')
                        {
@@ -173,7 +173,7 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
@@ -181,7 +181,7 @@
                 * @return array of objects. May return an empty
                 * array, never null. The array keys are the respective index 
numbers.
                 */
-               public function get( int $start_index, int $num_of_objects, 
string $sort_field, boolean $ascending, string $search_for, string 
$search_type, array $filters )
+               public function get( int $start_index, int $num_of_objects, 
string $sort_field, bool $ascending, string $search_for, string $search_type, 
array $filters )
                {
                        $results = array();   // Array to store result objects
                        $map = array(); // Array to hold number of records per 
target object
@@ -309,7 +309,7 @@
                 */
                public function get_count( string $search_for, string 
$search_type, array $filters )
                {
-                       return $this->get_query_count($this->get_query(null, 
null, $search_for, $search_type, $filters, true));
+                       return $this->get_query_count($this->get_query('', 
false, $search_for, $search_type, $filters, true));
                }
 
                /**
@@ -326,16 +326,16 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
                 * @param $filters array with key => value of filters.
-                * @param $return_count boolean telling to return only the 
count of the
+                * @param $return_count bool telling to return only the count 
of the
                 * matching objects, or the objects themself.
                 * @return string with SQL.
                 */
-               protected abstract function get_query( string $sort_field, 
boolean $ascending, string $search_for, string $search_type, array $filters, 
boolean $return_count );
+               protected abstract function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count );
 
                protected abstract function populate( int $object_id, &$object 
);
 

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.socontrol.inc.php        2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -84,7 +84,7 @@
                 * Update the database values for an existing control object.
                 *
                 * @param $control the control to be updated
-                * @return boolean true if successful, false otherwise
+                * @return bool true if successful, false otherwise
                 */
                function update( $control )
                {
@@ -1220,7 +1220,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
 

Modified: trunk/controller/inc/class.socontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group.inc.php  2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.socontrol_group.inc.php  2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -262,7 +262,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
                        if ($search_for)

Modified: trunk/controller/inc/class.socontrol_group_list.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group_list.inc.php     2016-07-25 
12:06:21 UTC (rev 15369)
+++ trunk/controller/inc/class.socontrol_group_list.inc.php     2016-07-25 
12:58:07 UTC (rev 15370)
@@ -88,7 +88,7 @@
                 * Update the database values for an existing 
control_group_list object.
                 *
                 * @param $control_group_list the control_group_list to be 
updated
-                * @return boolean true if successful, false otherwise
+                * @return bool true if successful, false otherwise
                 */
                function update( $control_group_list )
                {
@@ -240,7 +240,7 @@
                        return $control_group_list;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
 
                }

Modified: trunk/controller/inc/class.socontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_item.inc.php   2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.socontrol_item.inc.php   2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -95,7 +95,7 @@
                 * Update the database values for an existing control item 
object.
                 *
                 * @param $control item object to be updated
-                * @return boolean true if successful, false otherwise
+                * @return bool true if successful, false otherwise
                 */
                function update( $control_item )
                {
@@ -237,7 +237,7 @@
                        {
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id'), 'int'));
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'boolean'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'bool'));
                                
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
@@ -269,7 +269,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
 
                        $clauses = array('1=1');
@@ -367,7 +367,7 @@
                                $control_item = new 
controller_control_item((int)$control_item_id);
 
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'boolean'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'bool'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                                
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id'),
 'int'));
@@ -425,7 +425,7 @@
                                //create check_item and add to return array
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id'), 'int'));
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'boolean'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'bool'));
                                
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));

Modified: trunk/controller/inc/class.socontrol_item_list.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_item_list.inc.php      2016-07-25 
12:06:21 UTC (rev 15369)
+++ trunk/controller/inc/class.socontrol_item_list.inc.php      2016-07-25 
12:58:07 UTC (rev 15370)
@@ -178,7 +178,7 @@
                        {
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id'), 'int'));
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                               
$control_item->set_required($this->unmarshal($this->db->f('required'), 
'boolean'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required'), 'bool'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                                
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id'),
 'int'));
@@ -213,7 +213,7 @@
                        {
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id'), 'int'));
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                               
$control_item->set_required($this->unmarshal($this->db->f('required'), 
'boolean'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required'), 'bool'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                                
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id'),
 'int'));
@@ -261,7 +261,7 @@
                        {
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id'), 'int'));
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                               
$control_item->set_required($this->unmarshal($this->db->f('required'), 
'boolean'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required'), 'bool'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                                
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id'),
 'int'));
@@ -329,7 +329,7 @@
 
                                        $control_item = new 
controller_control_item($this->unmarshal($this->db->f('ci_id'), 'int'));
                                        
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
-                                       
$control_item->set_required($this->unmarshal($this->db->f('required'), 
'boolean'));
+                                       
$control_item->set_required($this->unmarshal($this->db->f('required'), 'bool'));
                                        
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                        
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                                        
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id'),
 'int'));
@@ -433,7 +433,7 @@
 
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
 
                }

Modified: trunk/controller/inc/class.socontrol_item_option.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_item_option.inc.php    2016-07-25 
12:06:21 UTC (rev 15369)
+++ trunk/controller/inc/class.socontrol_item_option.inc.php    2016-07-25 
12:58:07 UTC (rev 15370)
@@ -136,7 +136,7 @@
 
                }
 
-               function get_query( string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count )
+               function get_query( string $sort_field, bool $ascending, string 
$search_for, string $search_type, array $filters, bool $return_count )
                {
                        
                }

Modified: trunk/controller/inc/class.sodocument.inc.php
===================================================================
--- trunk/controller/inc/class.sodocument.inc.php       2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.sodocument.inc.php       2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -70,7 +70,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
 
                        $clauses = array('1=1');

Modified: trunk/controller/inc/class.soprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.soprocedure.inc.php      2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.soprocedure.inc.php      2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -107,7 +107,7 @@
                 * Update the database values for an existing activity object.
                 *
                 * @param $activity the activity to be updated
-                * @return boolean true if successful, false otherwise
+                * @return bool true if successful, false otherwise
                 */
                function update( $procedure )
                {
@@ -454,7 +454,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
                        if ($search_for)

Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php        2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.uicontrol.inc.php        2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -903,6 +903,8 @@
                                'allrows' => phpgw::get_var('length', 'int') == 
-1,
                        );
 
+                       $filters = array();
+                       $search_type = '';
 
                        $ctrl_area = phpgw::get_var('control_areas');
                        if (isset($ctrl_area) && $ctrl_area > 0)

Modified: trunk/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_group.inc.php  2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.uicontrol_group.inc.php  2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -760,7 +760,9 @@
                        // YUI variables for paging and sorting
                        $start_index = $params['start'];
                        $num_of_objects = $params['results'] > 0 ? 
$params['results'] : null;
-                       $sort_field = $params['order'];
+                       $sort_field = ($params['order']) ? $params['order'] : 
'';
+                       $filters = array();
+                       $search_type = '';
 
                        $ctrl_area = phpgw::get_var('control_areas');
                        if (isset($ctrl_area) && $ctrl_area > 0)

Modified: trunk/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item.inc.php   2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.uicontrol_item.inc.php   2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -425,7 +425,8 @@
                        $num_of_objects = $params['results'] > 0 ? 
$params['results'] : null;
                        $sort_field = $params['order'];
 
-
+                       $search_type = '';
+                       $filters = array();
                        $ctrl_area = phpgw::get_var('control_areas');
                        if (isset($ctrl_area) && $ctrl_area > 0)
                        {

Modified: trunk/controller/inc/class.uiprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.uiprocedure.inc.php      2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/class.uiprocedure.inc.php      2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -681,7 +681,8 @@
 
                        $start_index = $params['start'];
                        $num_of_objects = $params['results'] > 0 ? 
$params['results'] : null;
-                       $sort_field = $params['order'];
+                       $sort_field = ($params['order']) ? $params['order'] : 
'';
+                       $filters = array();
 
                        $ctrl_area = phpgw::get_var('control_areas');
                        if (isset($ctrl_area) && $ctrl_area > 0)
@@ -690,7 +691,7 @@
                        }
                        $sort_ascending = $params['sort'] == 'desc' ? false : 
true;
                        // Form variables
-                       $search_type = phpgw::get_var('search_option');
+                       $search_type = phpgw::get_var('search_option', 
'string', 'REQUEST', '');
                        // Create an empty result set
                        $result_objects = array();
                        $result_count = 0;

Modified: trunk/controller/inc/model/class.model.inc.php
===================================================================
--- trunk/controller/inc/model/class.model.inc.php      2016-07-25 12:06:21 UTC 
(rev 15369)
+++ trunk/controller/inc/model/class.model.inc.php      2016-07-25 12:58:07 UTC 
(rev 15370)
@@ -83,7 +83,7 @@
                 * in order to validate against the standard database rules.  
The subclasses can in addition
                 * add their own specific validation logic.
                 *
-                * @return boolean true if the object is valid, false otherwise
+                * @return bool true if the object is valid, false otherwise
                 */
                public function validates()
                {




reply via email to

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