phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.2.2.2, 1.17.2.2.2.3 class.schema_proc_pgsql.inc.php, 1.5.2.3, 1.5.2.4 class.sql_entity.inc.php, 1.1.2.1, 1.1.2.2
Date: Wed, 10 Sep 2003 18:37:32 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv25300

Modified Files:
      Tag: Version-0_9_16-branch
        class.contacts_sql.inc.php class.schema_proc_pgsql.inc.php 
        class.sql_entity.inc.php 
Log Message:
fix for bugs 5143 5145


Index: class.contacts_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.contacts_sql.inc.php,v
retrieving revision 1.17.2.2.2.2
retrieving revision 1.17.2.2.2.3
diff -C2 -r1.17.2.2.2.2 -r1.17.2.2.2.3
*** class.contacts_sql.inc.php  8 Sep 2003 13:26:38 -0000       1.17.2.2.2.2
--- class.contacts_sql.inc.php  10 Sep 2003 22:37:30 -0000      1.17.2.2.2.3
***************
*** 1533,1560 ****
                }
  
                function add_people_for_organzation($people, $cid, 
$action=PHPGW_SQL_RETURN_SQL)
                {
-                       $this->relations = 
CreateObject('phpgwapi.contact_org_person');
                        foreach($people as $person)
                        {
!                               $sql[] = $this->_add(array('my_person_id' => 
$person), 'relations', 'my_org_id', $cid, $action);
                        }
                        return $sql;
                }
  
                function add_orgs_for_person($organizations, $preferred_org, 
$addr_id, $cid, $action=PHPGW_SQL_RETURN_SQL)
                {
-                       $this->relations = 
CreateObject('phpgwapi.contact_org_person');
                        foreach($organizations as $org)
                        {
                                $data['my_org_id'] = $org;
!                               $data['my_creaton'] = 1;
!                               $data['my_creatby'] = 1;
                                if ($preferred_org == $org)
                                {
!                                       $data['my_preferred'] = $org;
!                                       $data['my_addr_id'] = $addr_id;
                                }
                                $sql[] = $this->_add($data,'relations', 
'my_person_id', $cid, $action);
                        }
                        return $sql;
--- 1533,1587 ----
                }
  
+               /**
+                * Add a people for a organizations
+                * 
+                * @param array $people People id which you want to insert
+                * @param integer $cid Organization id
+                * @param integer $action PHPGW_SQL_RETURN_SQL | 
PHPGW_SQL_RUN_SQL depending what we want
+                */
                function add_people_for_organzation($people, $cid, 
$action=PHPGW_SQL_RETURN_SQL)
                {
                        foreach($people as $person)
                        {
!                               $this->relations = 
CreateObject('phpgwapi.contact_org_person');
!                               $this->lock_table($this->relations->table);
!                               $data['my_person_id'] = $person;
!                               $data['my_creaton'] = 1;
!                               $data['my_creatby'] = 1;
!                               $sql[] = $this->_add($data,'relations', 
'my_org_id', $cid, $action);
!                               $this->unlock_table();
                        }
                        return $sql;
                }
  
+               /**
+                * Add a organizations for a person
+                * 
+                * @param array $oragnizations Organizations id which you want 
to insert
+                * @param integer $preferred_org Organization id from preferred 
organization
+                * @param integer $addr_id Address id from preferred 
organization
+                * @param integer $cid Person id
+                * @param integer $action PHPGW_SQL_RETURN_SQL | 
PHPGW_SQL_RUN_SQL depending what we want
+                */
                function add_orgs_for_person($organizations, $preferred_org, 
$addr_id, $cid, $action=PHPGW_SQL_RETURN_SQL)
                {
                        foreach($organizations as $org)
                        {
+                               $this->relations = 
CreateObject('phpgwapi.contact_org_person');
+                               $this->lock_table($this->relations->table);
                                $data['my_org_id'] = $org;
!                               $data['my_addr_id'] = $addr_id;
                                if ($preferred_org == $org)
                                {
!                                       $data['my_preferred'] = 'Y';
                                }
+                               else
+                               {
+                                       $data['my_preferred'] = 'N';
+                               }
+                               $data['my_creaton'] = 1;
+                               $data['my_creatby'] = 1;
                                $sql[] = $this->_add($data,'relations', 
'my_person_id', $cid, $action);
+                               $this->unlock_table();
                        }
                        return $sql;

Index: class.schema_proc_pgsql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.schema_proc_pgsql.inc.php,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -C2 -r1.5.2.3 -r1.5.2.4
*** class.schema_proc_pgsql.inc.php     10 Sep 2003 00:01:02 -0000      1.5.2.3
--- class.schema_proc_pgsql.inc.php     10 Sep 2003 22:37:30 -0000      1.5.2.4
***************
*** 371,375 ****
                                @reset($aTables[$sDest]['fd']);
                                $i=0;
!                               while (list($name,$arraydef) = 
each($aTables[$sDest]['fd']))
                                {
                                        if ($i > 0)
--- 371,375 ----
                                @reset($aTables[$sDest]['fd']);
                                $i=0;
!                               while (list($name,$arraydef) = 
@each($aTables[$sDest]['fd']))
                                {
                                        if ($i > 0)

Index: class.sql_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/Attic/class.sql_entity.inc.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** class.sql_entity.inc.php    8 Sep 2003 13:26:38 -0000       1.1.2.1
--- class.sql_entity.inc.php    10 Sep 2003 22:37:30 -0000      1.1.2.2
***************
*** 410,414 ****
                }
  
!               function insert($data, $action=RETURN_SQL)
                {
                        $this->_insert($data, 0);
--- 410,414 ----
                }
  
!               function insert($data, $action=PHPGW_SQL_RETURN_SQL)
                {
                        $this->_insert($data, 0);
***************
*** 506,510 ****
                * @return string with sql update
                */
!               function update($data,$criteria, $action=RETURN_SQL)
                {
                        if(is_array($data) && count($data) > 0)
--- 506,510 ----
                * @return string with sql update
                */
!               function update($data,$criteria, $action=PHPGW_SQL_RETURN_SQL)
                {
                        if(is_array($data) && count($data) > 0)





reply via email to

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