R25072 - /trunk/phpgwapi/inc/class.solink.inc.php

Author: ralfbecker
New Revision: 25072

URL: http://www.egroupware.org/viewvc?rev=3D25072&view=3Drev
Log:
“new optional param to get_3links to return just the app_id’s and not the f=
ull link-records”

Modified:
trunk/phpgwapi/inc/class.solink.inc.php

Modified: trunk/phpgwapi/inc/class.solink.inc.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/class.solink.inc.p=
hp?rev=3D25072&r1=3D25071&r2=3D25072&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/class.solink.inc.php (original)
+++ trunk/phpgwapi/inc/class.solink.inc.php Thu Mar 13 12:27:48 2008
@@ -321,9 +321,10 @@
* @param string $app app the returned links are linked on one side (atm.=
this must be link_app1!)
* @param string $target_app app the returned links other side link also =
to
* @param string/array $target_id=3Dnull id(s) the returned links other s=
ide link also to

    • @param boolean $just_app_ids=3Dfalse return array with link_id =3D> ap=
      p_id pairs, not the full link record
    • @return array with links from entries from $app to $target_app/$target=
      _id plus the other (b) link_id/app/id in the keys ‘link3’/‘app3’/‘id3’
      */
  • static function get_3links($app,$target_app,$target_id=3Dnull)
  • static function get_3links($app,$target_app,$target_id=3Dnull,$just_app_i=
    ds=3Dfalse)
    {
    $table =3D self::TABLE;
    $arrayofselects=3Darray(
    @@ -358,7 +359,21 @@
    $links =3D array();
    foreach(self::$db->union($arrayofselects,LINE,FILE) as $row)
    {
  •   	$links[] =3D egw_db::strip_array_keys($row,'link_');
    
  •   	if ($just_app_ids)
    
  •   	{
    
  •   		if ($row['link_app1'] =3D=3D $target_app && (is_null($target_id) || in=
    

_array($row[‘link_id1’],(array)$target_id)))

  •   		{
    
  •   			$links[$row['link_id']] =3D $row['link_id2'];
    
  •   		}
    
  •   		else
    
  •   		{
    
  •   			$links[$row['link_id']] =3D $row['link_id1'];
    
  •   		}
    
  •   	}
    
  •   	else
    
  •   	{
    
  •   		$links[] =3D egw_db::strip_array_keys($row,'link_');
    
  •   	}
      }
      return $links;
    
    }

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs