fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16420] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [16420] more on eventplanner
Date: Thu, 9 Mar 2017 13:16:06 -0500 (EST)

Revision: 16420
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16420
Author:   sigurdne
Date:     2017-03-09 13:16:05 -0500 (Thu, 09 Mar 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.boapplication.inc.php
    trunk/eventplanner/inc/class.soapplication.inc.php
    trunk/eventplanner/inc/class.socustomer.inc.php
    trunk/eventplanner/inc/class.uibooking.inc.php
    trunk/eventplanner/inc/model/class.booking.inc.php
    trunk/phpgwapi/inc/class.socommon.inc.php

Modified: trunk/eventplanner/inc/class.boapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.boapplication.inc.php  2017-03-09 17:24:49 UTC 
(rev 16419)
+++ trunk/eventplanner/inc/class.boapplication.inc.php  2017-03-09 18:16:05 UTC 
(rev 16420)
@@ -99,11 +99,11 @@
                        return $values;
                }
 
-               public function read_single($id, $return_object = true)
+               public function read_single($id, $return_object = true, 
$relaxe_acl = false)
                {
                        if ($id)
                        {
-                               $values = 
eventplanner_soapplication::get_instance()->read_single($id, $return_object);
+                               $values = 
eventplanner_soapplication::get_instance()->read_single($id, $return_object, 
$relaxe_acl);
                        }
                        else
                        {

Modified: trunk/eventplanner/inc/class.soapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soapplication.inc.php  2017-03-09 17:24:49 UTC 
(rev 16419)
+++ trunk/eventplanner/inc/class.soapplication.inc.php  2017-03-09 18:16:05 UTC 
(rev 16420)
@@ -73,7 +73,7 @@
                {
                        $clause = '';
 
-                       if($this->use_acl && $this->currentapp && 
$this->acl_location)
+                       if(!$this->relaxe_acl && ($this->use_acl && 
$this->currentapp && $this->acl_location))
                        {
                                $paranthesis = false;
 

Modified: trunk/eventplanner/inc/class.socustomer.inc.php
===================================================================
--- trunk/eventplanner/inc/class.socustomer.inc.php     2017-03-09 17:24:49 UTC 
(rev 16419)
+++ trunk/eventplanner/inc/class.socustomer.inc.php     2017-03-09 18:16:05 UTC 
(rev 16420)
@@ -55,7 +55,25 @@
                        return self::$so;
                }
 
+               function get_acl_condition( )
+               {
+                       $acl_condition = parent::get_acl_condition();
+                       
+                       $sql = "SELECT object_id, permission FROM 
eventplanner_permission WHERE subject_id = {$this->account}";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $object_ids = array(-1);
+                       while ($this->db->next_record())
+                       {
+                               $permission = $this->db->f('permission');
+                               if($permission & PHPGW_ACL_READ)
+                               {
+                                       $object_ids[] = 
$this->db->f('object_id');
+                               }
+                       }
 
+                       return '(' . $acl_condition . ' OR 
eventplanner_customer.id IN (' . implode(',', $object_ids) . '))';
+               }
+
                protected function populate( array $data )
                {
                        $object = new eventplanner_customer();

Modified: trunk/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uibooking.inc.php      2017-03-09 17:24:49 UTC 
(rev 16419)
+++ trunk/eventplanner/inc/class.uibooking.inc.php      2017-03-09 18:16:05 UTC 
(rev 16420)
@@ -279,7 +279,7 @@
                                )
                        );
 
-                       $application = 
createObject('eventplanner.boapplication')->read_single($booking->application_id);
+                       $application = 
createObject('eventplanner.boapplication')->read_single($booking->application_id,
 true, $relaxe_acl = true);
 
 //                     $GLOBALS['phpgw']->jqcal2->add_listener('from_', 
'datetime', $booking->from_, array(
 //                                     'min_date' => date('Y/m/d', 
$application->date_start),

Modified: trunk/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.booking.inc.php  2017-03-09 17:24:49 UTC 
(rev 16419)
+++ trunk/eventplanner/inc/model/class.booking.inc.php  2017-03-09 18:16:05 UTC 
(rev 16420)
@@ -264,7 +264,7 @@
 
                        if (!empty($entity->application_id))
                        {
-                               $application = 
createObject('eventplanner.boapplication')->read_single($entity->application_id);
+                               $application = 
createObject('eventplanner.boapplication')->read_single($entity->application_id,
 true, $relaxe_acl = true);
                                $entity->to_ = $entity->from_ + 
((int)$application->timespan * 60);
                        }
 

Modified: trunk/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.socommon.inc.php   2017-03-09 17:24:49 UTC (rev 
16419)
+++ trunk/phpgwapi/inc/class.socommon.inc.php   2017-03-09 18:16:05 UTC (rev 
16420)
@@ -44,6 +44,7 @@
                protected $currentapp;
                protected $acl;
                protected $relaxe_acl;
+               protected $account;
 
                public function __construct( $table_name, $fields )
                {
@@ -59,6 +60,7 @@
                        $this->dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $this->currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->acl = & $GLOBALS['phpgw']->acl;
+                       $this->account = 
(int)$GLOBALS['phpgw_info']['user']['account_id'];
                }
 
                /**
@@ -364,12 +366,18 @@
                        return $conditions;
                }
 
-               function read_single( $id, $return_object = false )
+               function read_single( $id, $return_object = false , $relaxe_acl 
= false)
                {
                        if (!$id && !$return_object)
                        {
                                return array();
                        }
+
+                       if($relaxe_acl)
+                       {
+                               $this->relaxe_acl = $relaxe_acl;
+                       }
+
                        $row = array();
                        $pk_params = $this->primary_key_conditions($id);
 




reply via email to

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