From: <ral...@us...> - 2015-07-27 13:24:26
|
Author: ralfbecker Date: Mon Jul 27 15:24:18 2015 New Revision: 53206 URL: http://svn.stylite.de/viewvc/egroupware?rev=53206&view=rev Log: if db-object passed to so_sql_cf, use that also for querying custom-fields Modified: branches/14.2/etemplate/ (props changed) branches/14.2/etemplate/inc/class.so_sql_cf.inc.php branches/14.2/phpgwapi/ (props changed) branches/14.2/phpgwapi/inc/class.egw_customfields.inc.php Propchange: branches/14.2/etemplate/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Jul 27 15:24:18 2015 @@ -1,1 +1,1 @@ -/trunk/etemplate:51364,51378,51382,51385,51389,51391,51397-51398,51405,51410,51412,51424-51425,51435,51437-51438,51450,51453-51454,51465,51488,51490,51516,51518,51522,51531,51533,51548,51551,51562,51565,51567,51580,51586-51589,51595,51600,51612,51628,51636,51645-51646,51649-51651,51680,51684,51690-51691,51695,51708,51712,51716-51717,51720,51791,51812,51814,51817,51822,51826,51830,51834,51874-51875,51886,51894,51903,51907-51908,51929,51933,51943,51948,51950-51951,51953,51958,51971,51997,51999,52001,52012,52022,52036,52051,52072,52088,52093,52100,52103,52114,52117,52152-52153,52163,52175-52176,52188,52192,52194-52196,52204,52222,52224,52229,52232,52236,52238,52243,52245,52253,52255,52258,52261-52262,52268,52275-52276,52278,52282,52285-52286,52296,52307,52321,52330,52334-52336,52340-52341,52353-52355,52357,52360,52368,52372-52373,52375,52379,52385,52406,52412,52423,52440,52447,52449,52455,52460,52470,52472,52477,52482,52487,52492,52495-52496,52510,52514,52519,52524,52555,52570,52573-52 574,52583,52610,52624,52627,52635,52664,52667,52688,52690,52696,52698,52708,52713,52718,52720,52726,52728,52732,52734,52749,52753,52778,52787-52788,52790,52804-52806,52819,52832,52842,52844,52851,52914,52920,52946,52982,53008-53009,53021-53022,53024,53061,53082,53103,53109,53135 +/trunk/etemplate:51364,51378,51382,51385,51389,51391,51397-51398,51405,51410,51412,51424-51425,51435,51437-51438,51450,51453-51454,51465,51488,51490,51516,51518,51522,51531,51533,51548,51551,51562,51565,51567,51580,51586-51589,51595,51600,51612,51628,51636,51645-51646,51649-51651,51680,51684,51690-51691,51695,51708,51712,51716-51717,51720,51791,51812,51814,51817,51822,51826,51830,51834,51874-51875,51886,51894,51903,51907-51908,51929,51933,51943,51948,51950-51951,51953,51958,51971,51997,51999,52001,52012,52022,52036,52051,52072,52088,52093,52100,52103,52114,52117,52152-52153,52163,52175-52176,52188,52192,52194-52196,52204,52222,52224,52229,52232,52236,52238,52243,52245,52253,52255,52258,52261-52262,52268,52275-52276,52278,52282,52285-52286,52296,52307,52321,52330,52334-52336,52340-52341,52353-52355,52357,52360,52368,52372-52373,52375,52379,52385,52406,52412,52423,52440,52447,52449,52455,52460,52470,52472,52477,52482,52487,52492,52495-52496,52510,52514,52519,52524,52555,52570,52573-52 574,52583,52610,52624,52627,52635,52664,52667,52688,52690,52696,52698,52708,52713,52718,52720,52726,52728,52732,52734,52749,52753,52778,52787-52788,52790,52804-52806,52819,52832,52842,52844,52851,52914,52920,52946,52982,53008-53009,53021-53022,53024,53061,53082,53103,53109,53135,53205 Modified: branches/14.2/etemplate/inc/class.so_sql_cf.inc.php URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/etemplate/inc/class.so_sql_cf.inc.php?rev=53206&r1=53205&r2=53206&view=diff ============================================================================== --- branches/14.2/etemplate/inc/class.so_sql_cf.inc.php (original) +++ branches/14.2/etemplate/inc/class.so_sql_cf.inc.php Mon Jul 27 15:24:18 2015 @@ -164,7 +164,7 @@ $this->extra_join_order = " LEFT JOIN $extra_table extra_order ON $table.$this->autoinc_id=extra_order.$this->extra_id"; $this->extra_join_filter = " JOIN $extra_table extra_filter ON $table.$this->autoinc_id=extra_filter.$this->extra_id"; - $this->customfields = egw_customfields::get($app); + $this->customfields = egw_customfields::get($app, false, null, $db); } /** Propchange: branches/14.2/phpgwapi/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Jul 27 15:24:18 2015 @@ -1,1 +1,1 @@ -/trunk/phpgwapi:51366,51376,51397,51419,51437,51453-51454,51479,51503,51512,51518,51521-51522,51526-51528,51530,51539,51556,51562,51577,51579,51588-51589,51612,51626,51701,51716-51717,51721,51758,51762-51763,51768,51775,51779,51785,51800,51810,51812,51817,51824,51839,51855,51870,51881-51882,51886,51905,51909,51918,51973,51975,51977,51988,52007,52016,52054,52057,52059,52062,52088,52099,52107-52108,52132,52147,52149,52165,52177,52179,52199,52220,52238,52241,52252,52268,52274,52283,52288-52289,52296,52301,52310,52312,52314,52316,52322-52323,52327,52332,52334,52341,52368-52372,52375,52399,52428,52457,52494,52497,52501,52517-52518,52532,52534,52575,52579,52588,52596,52598,52604,52608,52619,52621,52653,52684,52686,52706,52732,52787,52797,52820,52846,52900,52912,52958,52961,53008,53011,53021-53022,53024,53047,53051,53067,53080-53081,53085,53087,53095,53097,53101,53112,53116,53145-53147,53173,53185,53187,53192 +/trunk/phpgwapi:51366,51376,51397,51419,51437,51453-51454,51479,51503,51512,51518,51521-51522,51526-51528,51530,51539,51556,51562,51577,51579,51588-51589,51612,51626,51701,51716-51717,51721,51758,51762-51763,51768,51775,51779,51785,51800,51810,51812,51817,51824,51839,51855,51870,51881-51882,51886,51905,51909,51918,51973,51975,51977,51988,52007,52016,52054,52057,52059,52062,52088,52099,52107-52108,52132,52147,52149,52165,52177,52179,52199,52220,52238,52241,52252,52268,52274,52283,52288-52289,52296,52301,52310,52312,52314,52316,52322-52323,52327,52332,52334,52341,52368-52372,52375,52399,52428,52457,52494,52497,52501,52517-52518,52532,52534,52575,52579,52588,52596,52598,52604,52608,52619,52621,52653,52684,52686,52706,52732,52787,52797,52820,52846,52900,52912,52958,52961,53008,53011,53021-53022,53024,53047,53051,53067,53080-53081,53085,53087,53095,53097,53101,53112,53116,53145-53147,53173,53185,53187,53192,53200,53205 Modified: branches/14.2/phpgwapi/inc/class.egw_customfields.inc.php URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/phpgwapi/inc/class.egw_customfields.inc.php?rev=53206&r1=53205&r2=53206&view=diff ============================================================================== --- branches/14.2/phpgwapi/inc/class.egw_customfields.inc.php (original) +++ branches/14.2/phpgwapi/inc/class.egw_customfields.inc.php Mon Jul 27 15:24:18 2015 @@ -55,9 +55,10 @@ * @param string $only_type2 =null if given only return fields of type2 == $only_type2 * @param int $start =0 * @param int $num_rows =null + * @param egw_db $db =null reference to database instance to use * @return array with customfields */ - function __construct($app, $all_private_too=false, $only_type2=null, $start=0, $num_rows=null) + function __construct($app, $all_private_too=false, $only_type2=null, $start=0, $num_rows=null, egw_db $db=null) { $this->app = $app; $this->all_private_too = $all_private_too; @@ -75,7 +76,8 @@ { $query[] = $this->commasep_match('cf_type2', $only_type2); } - $this->iterator = self::$db->select(self::TABLE, '*', $query, __LINE__, __FILE__, + if (!$db) $db = self::$db; + $this->iterator = $db->select(self::TABLE, '*', $query, __LINE__, __FILE__, !isset($num_rows) ? false : $start, 'ORDER BY cf_order ASC', 'phpgwapi', $num_rows); } @@ -123,16 +125,17 @@ * @param string $app * @param boolean $all_private_too =false should all the private fields be returned too, default no * @param string $only_type2 =null if given only return fields of type2 == $only_type2 + * @param egw_db $db =null reference to database to use * @return array with customfields */ - public static function get($app, $all_private_too=false, $only_type2=null) + public static function get($app, $all_private_too=false, $only_type2=null, egw_db $db=null) { $cache_key = $app.':'.($all_private_too?'all':$GLOBALS['egw_info']['user']['account_id']).':'.$only_type2; $cfs = egw_cache::getInstance(__CLASS__, $cache_key); if (!isset($cfs)) { - $cfs = iterator_to_array(new egw_customfields($app, $all_private_too, $only_type2)); + $cfs = iterator_to_array(new egw_customfields($app, $all_private_too, $only_type2, 0, null, $db)); egw_cache::setInstance(__CLASS__, $cache_key, $cfs); $cached = egw_cache::getInstance(__CLASS__, $app); @@ -401,7 +404,7 @@ } } } - + self::$db->$op(self::TABLE, array( 'cf_label' => $cf['label'], 'cf_type' => $cf['type'], |