fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7928] bkbooking: update


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [7928] bkbooking: update
Date: Mon, 24 Oct 2011 15:52:57 +0000

Revision: 7928
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7928
Author:   kjell
Date:     2011-10-24 15:52:56 +0000 (Mon, 24 Oct 2011)
Log Message:
-----------
bkbooking: update

Modified Paths:
--------------
    trunk/booking/inc/class.boaccount_code_set.inc.php
    trunk/booking/inc/class.sodocumentation.inc.php
    trunk/booking/inc/class.soseason.inc.php
    trunk/booking/inc/class.uievent.inc.php

Modified: trunk/booking/inc/class.boaccount_code_set.inc.php
===================================================================
--- trunk/booking/inc/class.boaccount_code_set.inc.php  2011-10-24 13:20:23 UTC 
(rev 7927)
+++ trunk/booking/inc/class.boaccount_code_set.inc.php  2011-10-24 15:52:56 UTC 
(rev 7928)
@@ -8,4 +8,46 @@
                        parent::__construct();
                        $this->so = CreateObject('booking.soaccount_code_set');
                }
-       }
\ No newline at end of file
+
+               protected function get_object_role_permissions(array 
$forObject, $defaultPermissions)
+               {
+                       return array_merge(
+                               array
+                               (
+                                       booking_sopermission::ROLE_MANAGER => 
array
+                                       (
+                                               'write' => true,
+                                       ),
+                                       'global' => array
+                                       (
+                                               
booking_sopermission::ROLE_MANAGER => array
+                                               (
+                                                       'read' => true,
+                                                       'write' => true,
+                                                       'create' => true,
+                                                       'delete' => true,
+                                               ),
+                                       )
+                               ),
+                               $defaultPermissions
+                       );
+               }
+               
+               protected function 
get_collection_role_permissions($defaultPermissions)
+               {
+                       return array_merge(
+                               array(
+                                       'global' => array
+                                       (
+                                               
booking_sopermission::ROLE_MANAGER => array
+                                               (
+                                                       'create' => true, 
#means that this role may create new objects of the present type
+                                                       'delete' => true,
+                                               ),
+                                       ),
+                               ),
+                               $defaultPermissions
+                       );
+               }
+
+       }

Modified: trunk/booking/inc/class.sodocumentation.inc.php
===================================================================
--- trunk/booking/inc/class.sodocumentation.inc.php     2011-10-24 13:20:23 UTC 
(rev 7927)
+++ trunk/booking/inc/class.sodocumentation.inc.php     2011-10-24 15:52:56 UTC 
(rev 7928)
@@ -175,6 +175,17 @@
                        return (false === $pos = strrpos($entity['name'], '.')) 
? false : substr($entity['name'], $pos+1);
                }
 
+               public function getMyRole($id) {
+
+                       $db = $this->db;
+                       $db->limit_query("SELECT role FROM bb_permission_root 
WHERE id=".intval($GLOBALS['phpgw_info']['user']['account_id']), 0, __LINE__, 
__FILE__, 1);
+                       if($db->next_record())
+                       {
+                               return $db->f('role', false);
+                       } 
+                       return false;
+               }
+
                public function getFrontendDoc()
                {
                                $this->db->query("SELECT id,name FROM 
bb_documentation WHERE category='frontend' ORDER BY id DESC", __LINE__, 
__FILE__);

Modified: trunk/booking/inc/class.soseason.inc.php
===================================================================
--- trunk/booking/inc/class.soseason.inc.php    2011-10-24 13:20:23 UTC (rev 
7927)
+++ trunk/booking/inc/class.soseason.inc.php    2011-10-24 15:52:56 UTC (rev 
7928)
@@ -14,7 +14,7 @@
                                        'active'                => array('type' 
=> 'int', 'required' => true),
                                        'building_id'   => array('type' => 
'int', 'required' => true),
                                        'name'                  => array('type' 
=> 'string', 'query' => true, 'required' => true),
-                                       'status'                => array('type' 
=> 'string', 'required'=> true),
+                                       'status'                => array('type' 
=> 'string', 'query' => true, 'required'=> true),
                                        'from_'         => array('type' => 
'date', 'required'=> true),
                                        'to_'           => array('type' => 
'date', 'required'=> true),
                                        'building_name' => array('type' => 
'string',

Modified: trunk/booking/inc/class.uievent.inc.php
===================================================================
--- trunk/booking/inc/class.uievent.inc.php     2011-10-24 13:20:23 UTC (rev 
7927)
+++ trunk/booking/inc/class.uievent.inc.php     2011-10-24 15:52:56 UTC (rev 
7928)
@@ -533,7 +533,7 @@
                                } 
 
                                if(!$errors['event'] and 
!$errors['resource_number'] and !$errors['organization_number'] and 
!$errors['invoice_data']  && !$errors['contact_name'] && !$errors['cost'])
-                               {
+                               { 
                                        if (phpgw::get_var('mail', 'POST') || 
phpgw::get_var('sendtorbuilding', 'POST'))
                                        {
                                                
if(phpgw::get_var('sendtocollision', 'POST') || phpgw::get_var('sendtocontact', 
'POST') || phpgw::get_var('sendtorbuilding', 'POST'))
@@ -621,12 +621,44 @@
                                                                }
                                                                
                                                        }
-                                               }                               
-                                               else 
-                                               {
-                                               $this->add_comment($event, 
phpgw::get_var('mail', 'POST'));
-                                               
$this->send_mailnotification($event['contact_email'], lang('Event changed'), 
phpgw::get_var('mail', 'POST'));
+                                               } else {
+                                                       
$this->add_comment($event, phpgw::get_var('mail', 'POST'));
+                                                       
$this->send_mailnotification($event['contact_email'], lang('Event changed'), 
phpgw::get_var('mail', 'POST'));
                                                }
+                                       } elseif (!phpgw::get_var('active', 
'POST')) {
+                                                               if 
($event['customer_organization_name']) {
+                                                                       
$comment_text_log = $event['customer_organization_name'];
+                                                               } else {
+                                                                       
$comment_text_log = $event['contact_name'];
+                                                               }
+                                                               
$comment_text_log = $comment_text_log.' sitt arrangement i 
'.$event['building_name'].' '.date('d-m-Y H:i', strtotime($event['from_']))." 
har blitt kansellert.\n For mer opplysinger slÄ opp i AktivBy.";
+//                                                             
$comment_text_log = phpgw::get_var('mail', 'POST');
+                                                               $sendt = 0;
+                                                               $mail_sendt_to 
= '';
+                                                               
if($building_info['email']) {
+                                                                       
$sendt++;
+                                                                       
$mail_sendt_to = $mail_sendt_to.' '.$building_info['email'];
+                                                                       
$this->send_mailnotification($building_info['email'], lang('Event changed'), 
$comment_text_log);
+                                                               } 
+                                                               if 
($_POST['sendtorbuilding_email1']) {
+                                                                       
$sendt++;
+                                                                       
$mail_sendt_to = $mail_sendt_to.' '.$_POST['sendtorbuilding_email1'];
+                                                                       
$this->send_mailnotification($_POST['sendtorbuilding_email1'], lang('Event 
changed'), $comment_text_log);
+               
+                                                               } 
+                                                               if 
($_POST['sendtorbuilding_email2']) {
+                                                                       
$sendt++;
+                                                                       
$mail_sendt_to = $mail_sendt_to.' '.$_POST['sendtorbuilding_email2'];
+                                                                       
$this->send_mailnotification($_POST['sendtorbuilding_email2'], lang('Event 
changed'), $comment_text_log);
+                                                               }
+                                                               if ($sendt > 0) 
{
+                                                                       
$errors['mailtobuilding'] = lang('Unable to send warning, No mailadresses 
found');
+                                                               } 
+                                                               else 
+                                                               {
+                                                                       
$comment = $comment_text_log.'. Denne er sendt til '.$mail_sendt_to;
+                                                                       
$this->add_comment($event,$comment);                    
+                                                               }
                                        }
                                        $receipt = $this->bo->update($event);
                                        $this->redirect(array('menuaction' => 
'booking.uievent.edit', 'id'=>$event['id']));




reply via email to

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