fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8088] Merge 8067:8087 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8088] Merge 8067:8087 from trunk
Date: Fri, 11 Nov 2011 14:59:54 +0000

Revision: 8088
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8088
Author:   sigurdne
Date:     2011-11-11 14:59:53 +0000 (Fri, 11 Nov 2011)
Log Message:
-----------
Merge 8067:8087 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.menu.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
    branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
    
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
    branches/Version-1_0-branch/controller/inc/class.menu.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicommon.inc.php
    branches/Version-1_0-branch/controller/setup/default_records.inc.php
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
    branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
    branches/Version-1_0-branch/sms/bin/default/config_BR
    branches/Version-1_0-branch/sms/bin/default/config_ST

Added Paths:
-----------
    branches/Version-1_0-branch/activitycalendar/inc/class.uidashboard.inc.php
    branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.menu.inc.php 
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.menu.inc.php 
2011-11-11 14:59:53 UTC (rev 8088)
@@ -12,7 +12,7 @@
                                'activitycalendar' => array
                                (
                                        'text'  => lang('Activitycalendar'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'activitycalendar.uiactivities.index') ),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'activitycalendar.uidashboard.index') ),
                     'image'    => array('property', 'location'),
                                        'order' => 10,
                                        'group' => 'office'
@@ -21,6 +21,12 @@
 
                        $menus['navigation'] =  array
                        (
+                               'dashboard' => array
+                               (
+                                       'text'  => lang('dashboard'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'activitycalendar.uidashboard.index') ),
+                    'image'    => array('property', 'location_tenant'),
+                               ),
                                'activities' => array
                                (
                                        'text'  => lang('Activities'),

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-11-11 14:59:53 UTC (rev 8088)
@@ -144,6 +144,10 @@
                        $id = 
$this->marshal($filters[$this->get_id_field_name()],'int');
                        $filter_clauses[] = "activity.id = {$id}";
                }
+               if(isset($filters['new_activities']))
+               {
+                       $filter_clauses = "activity.state=1";
+               }
                if(isset($filters['activity_state']) && 
$filters['activity_state'] != 'all'){
                        $activity_state = 
$this->marshal($filters['activity_state'],'int');
                        $filter_clauses[] = "activity.state = 
{$activity_state}";

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2011-11-11 14:59:53 UTC (rev 8088)
@@ -84,6 +84,15 @@
                                $filter_clauses[] = "activity_group.id = {$id}";
                        }
                }
+               if(isset($filters['new_groups'])){
+                       $use_local_group = true;
+                       unset($filter_clauses);
+                       $filter_clauses[] = "activity_group.change_type = 
'new'";
+                       if(isset($filters[$this->get_id_field_name()])){
+                               $id = 
$this->marshal($filters[$this->get_id_field_name()],'int');
+                               $filter_clauses[] = "activity_group.id = {$id}";
+                       }
+               }
                
                if(count($filter_clauses))
                {

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-11-11 14:52:30 UTC (rev 8087)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-11-11 14:59:53 UTC (rev 8088)
@@ -102,6 +102,17 @@
                                $filter_clauses[] = "org.id = {$id}";
                        }
                }
+               if(isset($filters['new_orgs'])){
+                       $use_local_org = true;
+                       //$id = 
$this->marshal($filters[$this->get_id_field_name()],'int');
+                       //$filter_clauses[] = "org.id = {$id}";
+                       unset($filter_clauses);
+                       $filter_clauses[] = "org.change_type = 'new'";
+                       if(isset($filters[$this->get_id_field_name()])){
+                               $id = 
$this->marshal($filters[$this->get_id_field_name()],'int');
+                               $filter_clauses[] = "org.id = {$id}";
+                       }
+               }
 
 /*
                // All parties with contracts of type X

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-11-11 14:59:53 UTC (rev 8088)
@@ -74,16 +74,30 @@
        {
                $errorMsgs = array();
                $infoMsgs = array();
+
                $activity = 
activitycalendar_soactivity::get_instance()->get_single((int)phpgw::get_var('id'));
+               $cancel_link = self::link(array('menuaction' => 
'activitycalendar.uiactivities.index'));
+               $saved_OK = phpgw::get_var('saved_ok');
+               if($saved_OK)
+               {
+                       $message = lang('activity_saved_form');
+               }
                
                if($activity == null) // Not found
                {
                        $errorMsgs[] = lang('Could not find specified 
activity.');
                }
+               
+               if(isset($_POST['edit_activity'])) // The user has pressed the 
save button
+               {
+                       $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uiactivities.edit','id' => 
phpgw::get_var('id')));
+               }
 
                $data = array
                (
                        'activity' => $activity,
+                       'cancel_link' => $cancel_link,
+                       'message' => $message,
                        'errorMsgs' => $errorMsgs,
                        'infoMsgs' => $infoMsgs
                );
@@ -99,7 +113,7 @@
                $so_arena = activitycalendar_soarena::get_instance();
                $so_org = activitycalendar_soorganization::get_instance();
                //var_dump($activity_id);
-               
+               $cancel_link = self::link(array('menuaction' => 
'activitycalendar.uiactivities.index'));
                $categories = $so_activity->get_categories();
                $targets = $so_activity->get_targets();
                $offices = $so_activity->select_district_list();
@@ -188,7 +202,7 @@
                                        $error = lang('messages_form_error');
                                }
 
-                               if($new_state == 3 || $new_state == 4 || 
$new_state == 5 )
+                               if($new_state == 3 || $new_state == 5 )
                                {
                                        $kontor = 
$so_activity->get_office_name($activity->get_office());
                                        $subject = "Melding fra AktivBy";
@@ -203,6 +217,7 @@
                                                
activitycalendar_uiactivities::send_mailnotification_to_organization($activity->get_contact_person_2(),$subject,$body);
                                        }
                                }
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uiactivities.view', 'id' => 
$activity->get_id(), 'saved_ok' => 'yes'));
                        }
                }
 
@@ -219,6 +234,7 @@
                                'districts' => $districts,
                                'offices' => $offices,
                                'editable' => true,
+                               'cancel_link' => $cancel_link,
                                'message' => isset($message) ? $message : 
phpgw::get_var('message'),
                                'error' => isset($error) ? $error : 
phpgw::get_var('error')
                        )       
@@ -265,6 +281,11 @@
                
                switch($query_type)
                {
+                       case 'new_activities':
+                               $filters = array('activity_state' => 1, 
'activity_district' => phpgw::get_var('activity_district'), 'user_id' => $uid);
+                               $result_objects = 
activitycalendar_soactivity::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
+                               $object_count = 
activitycalendar_soactivity::get_instance()->get_count($search_for, 
$search_type, $filters);
+                               break;
                        case 'all_activities':
                        default:
                                $filters = array('activity_state' => 
phpgw::get_var('activity_state'), 'activity_district' => 
phpgw::get_var('activity_district'), 'user_id' => $uid);

Copied: 
branches/Version-1_0-branch/activitycalendar/inc/class.uidashboard.inc.php 
(from rev 8087, trunk/activitycalendar/inc/class.uidashboard.inc.php)
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uidashboard.inc.php  
                        (rev 0)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uidashboard.inc.php  
2011-11-11 14:59:53 UTC (rev 8088)
@@ -0,0 +1,307 @@
+<?php
+phpgw::import_class('activitycalendar.uicommon');
+phpgw::import_class('activitycalendar.soorganization');
+phpgw::import_class('activitycalendar.sogroup');
+phpgw::import_class('activitycalendar.soactivity');
+
+include_class('activitycalendar', 'organization', 'inc/model/');
+include_class('activitycalendar', 'group', 'inc/model/');
+include_class('activitycalendar', 'activity', 'inc/model/');
+
+class activitycalendar_uidashboard extends activitycalendar_uicommon
+{
+       public $public_functions = array
+       (
+               'index'                         => true
+       );
+       
+       public function __construct()
+       {
+               parent::__construct();
+               self::set_active_menu('activitycalendar::dashboard');
+               $config = CreateObject('phpgwapi.config','activitycalendar');
+               $config->read();
+       }
+       
+       public function index()
+       {
+               $this->render('dashboard.php');
+       }
+       
+       public function changed_organizations()
+       {
+               
self::set_active_menu('activitycalendar::organizationList::changed_organizations');
+               $this->render('organization_list_changed.php');
+       }
+       
+       public function edit()
+       {
+               return false;
+       }
+       
+       /**
+        * (non-PHPdoc)
+        * @see rental/inc/rental_uicommon#query()
+        */
+       public function query()
+       {
+               
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+               {
+                       $user_rows_per_page = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+               }
+               else {
+                       $user_rows_per_page = 10;
+               }
+               // YUI variables for paging and sorting
+               $start_index    = phpgw::get_var('startIndex', 'int');
+               $num_of_objects = phpgw::get_var('results', 'int', 'GET', 
$user_rows_per_page);
+               $sort_field             = phpgw::get_var('sort', 'string', 
'GET', 'identifier');
+               $sort_ascending = phpgw::get_var('dir') == 'desc' ? false : 
true;
+               // Form variables
+               $search_for     = phpgw::get_var('query');
+               $search_type    = phpgw::get_var('search_option');
+               // Create an empty result set
+               $result_objects = array();
+               $result_count = 0;
+               
+               //Create an empty result set
+               $parties = array();
+               
+               $exp_param      = phpgw::get_var('export');
+               $export = false;
+               if(isset($exp_param)){
+                       $export=true;
+                       $num_of_objects = null;
+               }
+               
+               //Retrieve the type of query and perform type specific logic
+               $type = phpgw::get_var('type');
+               $changed_org = false;
+               $changed_group = false;
+               switch($type)
+               {
+                       case 'changed_organizations':
+                               $filters = array('changed_orgs' => 'true');
+                               $changed_org = true;
+                               break;
+                       case 'changed_groups':
+                               $filters = array('changed_groups' => 'true');
+                               $changed_group = true;
+                               break;
+                       default: // ... get all parties of a given type
+                               //$filters = array('party_type' => 
phpgw::get_var('party_type'), 'active' => phpgw::get_var('active'));
+                               break;
+               }
+               if($changed_group)
+               {
+                       $result_objects = 
activitycalendar_sogroup::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
+                       $result_count = 
activitycalendar_sogroup::get_instance()->get_count($search_for, $search_type, 
$filters);
+               }
+               else
+               {
+                       $result_objects = 
activitycalendar_soorganization::get_instance()->get($start_index, 
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type, 
$filters);
+                       $result_count = 
activitycalendar_soorganization::get_instance()->get_count($search_for, 
$search_type, $filters);
+               }
+                               
+               //var_dump($result_objects);
+               // Create an empty row set
+               $rows = array();
+               foreach ($result_objects as $result) {
+                       if(isset($result))
+                       {
+                               $res = $result->serialize();
+                               $org_id = $result->get_id();
+                               //$rows[] = $result->serialize();
+                               $rows[] = $res;
+                               if(!$changed_group && !$changed_org)
+                               {
+                                       $filter_group = array('org_id' => 
$org_id);
+                                       $result_groups = 
activitycalendar_sogroup::get_instance()->get(null, null, $sort_field, 
$sort_ascending, $search_for, $search_type, $filter_group);
+                                       foreach ($result_groups as 
$result_group) {
+                                               if(isset($result_group))
+                                               {
+                                                       $res_g = 
$result_group->serialize();
+                                                       $rows[] = $res_g;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               // ... add result data
+               $organization_data = array('results' => $rows, 'total_records' 
=> $result_count);
+
+               $editable = phpgw::get_var('editable') == 'true' ? true : false;
+
+               if(!$export){
+                       array_walk(
+                               $organization_data['results'], 
+                               array($this, 'add_actions'), 
+                               array(                                          
                                                        // Parameters 
(non-object pointers)
+                                       $type                                   
                                                        // [2] The type of 
query                
+                               )
+                       );
+               }
+               
+               
+               return $this->yui_results($organization_data, 'total_records', 
'results');
+       }
+       
+       public function get_organization_groups()
+       {
+               $GLOBALS['phpgw_info']['flags']['noheader'] = true; 
+               $GLOBALS['phpgw_info']['flags']['nofooter'] = true; 
+               $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+               
+               $org_id = phpgw::get_var('orgid');
+               $group_id = phpgw::get_var('groupid');
+               $returnHTML = "<option value='0'>Ingen gruppe valgt</option>";
+               if($org_id)
+               {
+                       $groups = 
activitycalendar_sogroup::get_instance()->get(null, null, null, null, null, 
null, array('org_id' => $org_id));
+                       foreach ($groups as $group) {
+                               if(isset($group))
+                               {
+                                       //$res_g = $group->serialize();
+                                       $selected = "";
+                                       if($group_id && $group_id > 0)
+                                       {
+                                               $gr_id = (int)$group_id; 
+                                               if($gr_id == 
(int)$group->get_id())
+                                               {
+                                                       $selected_group = " 
selected";
+                                               }
+                                       }
+                                       $group_html[] = "<option value='" . 
$group->get_id() . "'". $selected_group . ">" . $group->get_name() . 
"</option>";
+                               }
+                       }
+                   $html = implode(' ' , $group_html);
+                   $returnHTML = $returnHTML . ' ' . $html;
+               }
+               
+               
+               return $returnHTML;
+               //return "<option>Ingen gruppe valgt</option>";
+       }
+
+       /**
+        * Public method. Called when a user wants to view information about a 
party.
+        * @param HTTP::id      the party ID
+        */
+       public function view()
+       {
+               $GLOBALS['phpgw_info']['flags']['app_header'] .= 
'::'.lang('view');
+               // Get the contract part id
+               $party_id = (int)phpgw::get_var('id');
+               if(isset($party_id) && $party_id > 0)
+               {
+                       $party = 
rental_soparty::get_instance()->get_single($party_id); 
+               }
+               else
+               {
+                       $this->render('permission_denied.php',array('error' => 
lang('invalid_request')));
+                       return;
+               }
+               
+               if(isset($party) && $party->has_permission(PHPGW_ACL_READ))
+               {
+                       return $this->render(
+                               'party.php', 
+                               array (
+                                       'party'         => $party,
+                                       'editable' => false,
+                                       'cancel_link' => 
self::link(array('menuaction' => 'rental.uiparty.index', 'populate_form' => 
'yes')),
+                               )
+                       );
+               }
+               else
+               {
+                       $this->render('permission_denied.php',array('error' => 
lang('permission_denied_view_party')));
+               }
+       }
+
+       public function download_agresso(){
+               $browser = CreateObject('phpgwapi.browser');
+               $browser->content_header('export.txt','text/plain');
+               print rental_soparty::get_instance()->get_export_data();
+       }
+       
+       /**
+        * Add action links and labels for the context menu of the list items
+        *
+        * @param $value pointer to
+        * @param $key ?
+        * @param $params [composite_id, type of query, editable]
+        */
+       public function add_actions(&$value, $key, $params)
+       {
+               //Defining new columns
+               $value['ajax'] = array();
+               $value['actions'] = array();
+               $value['labels'] = array();
+
+               $query_type = $params[0];
+               
+               switch($query_type)
+               {
+                       case 'all_organizations':
+                               $value['ajax'][] = false;
+                               if($value['organization_id'] != '' && 
$value['organization_id'] != null){
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 'booking.uigroup.show', 
'id' => $value['id'])));
+                               }
+                               else
+                               {
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'booking.uiorganization.show', 'id' => $value['id'])));
+                               }
+                               $value['labels'][] = lang('show');
+                               break;
+                               
+                       case 'changed_organizations':
+                               $value['ajax'][] = false;
+                               if($value['organization_id'] != '' && 
$value['organization_id'] != null){
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.show', 'id' => $value['id'], 'type' => 
'group')));
+                               }
+                               else
+                               {
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.show', 'id' => $value['id'])));
+                               }
+                               $value['labels'][] = lang('show');
+                               if($value['transferred'] == false)
+                               {
+                                       $value['ajax'][] = false;
+                                       if($value['organization_id'] != '' && 
$value['organization_id'] != null){
+                                               $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.show', 'id' => $value['id'], 'type' => 
'group')));
+                                       }
+                                       else
+                                       {
+                                               $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.edit', 'id' => $value['id'])));
+                                       }
+                                       $value['labels'][] = lang('edit');
+                               }
+                               break;
+                       case 'changed_groups':
+                               $value['ajax'][] = false;
+                               if($value['organization_id'] != '' && 
$value['organization_id'] != null){
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.show', 'id' => $value['id'], 'type' => 
'group')));
+                               }
+                               else
+                               {
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.show', 'id' => $value['id'])));
+                               }
+                               $value['labels'][] = lang('show');
+                               if($value['transferred'] == false)
+                               {
+                                       $value['ajax'][] = false;
+                                       if($value['organization_id'] != '' && 
$value['organization_id'] != null){
+                                               $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.edit', 'id' => $value['id'], 'type' => 
'group')));
+                                       }
+                                       else
+                                       {
+                                               $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiorganization.edit', 'id' => $value['id'])));
+                                       }
+                                       $value['labels'][] = lang('edit');
+                               }
+                               break;
+               }
+    }
+}
+?>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2011-11-11 14:52:30 UTC (rev 8087)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2011-11-11 14:59:53 UTC (rev 8088)
@@ -440,10 +440,18 @@
                                $filters = array('changed_orgs' => 'true');
                                $changed_org = true;
                                break;
+                       case 'new_organizations':
+                               $filters = array('new_orgs' => 'true');
+                               $changed_org = true;
+                               break;
                        case 'changed_groups':
                                $filters = array('changed_groups' => 'true');
                                $changed_group = true;
                                break;
+                       case 'new_groups':
+                               $filters = array('new_groups' => 'true');
+                               $changed_group = true;
+                               break;
                        default: // ... get all parties of a given type
                                //$filters = array('party_type' => 
phpgw::get_var('party_type'), 'active' => phpgw::get_var('active'));
                                break;

Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2011-11-11 14:59:53 UTC (rev 8088)
@@ -64,7 +64,7 @@
 cost   activitycalendar        no      Pris
 create activitycalendar        no      Lagre
 created        activitycalendar        no      Opprettet
-dashboard      activitycalendar        no      Skrivebord
+dashboard      activitycalendar        no      Skrivebord - Innkomne endringer
 day of the week        activitycalendar        no      Ukedag
 dec    activitycalendar        no      desember
 description    activitycalendar        no      Beskrivelse
@@ -371,7 +371,7 @@
 state_4        activitycalendar        no      Behandlet
 state_5        activitycalendar        no      Avvist
 activity_import        activitycalendar        no      Importer aktiviteter
-office activitycalendar        no      Kontor
+office activitycalendar        no      Hovedansvarlig kulturkontor
 activity_helptext      activitycalendar        no      Før ny aktivitet kan 
registreres må du sjekke at organisasjon/gruppe finnes og er oppdatert, og at 
arena finnes og er oppdatert.
 mail_subject_update    activitycalendar        no      Melding om oppdatering 
av aktivitet
 mail_body_update       activitycalendar        no      Du må oppdatere 
informasjonen som er registrert på aktivitet %1 . Bruk følgende lenke for å gå 
inn på aktiviteten: %2
@@ -398,4 +398,8 @@
 arena_saved_form       activitycalendar        no      Arena ble lagret
 activity_saved_form    activitycalendar        no      Aktiviteten ble lagret
 organization_saved_form        activitycalendar        no      Organisasjonen 
ble lagret
-group_saved_form       activitycalendar        no      Gruppen ble lagret
\ No newline at end of file
+group_saved_form       activitycalendar        no      Gruppen ble lagret
+published      activitycalendar        no      Publisert
+contactperson_not_set  activitycalendar        no      Kontaktpersoner hentes 
fra valgt organisasjon/gruppe ved lagring.
+description_not_set    activitycalendar        no      Beskrivelse hentes fra 
valgt organisasjon/gruppe ved lagring (Max 255 tegn).
+back_to_list   activitycalendar        no      Tilbake til oversikt
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2011-11-11 14:59:53 UTC (rev 8088)
@@ -38,7 +38,7 @@
        get_available_groups();
 });
 </script>
-
+<?php echo activitycalendar_uicommon::get_page_message($message) ?>
 <div class="yui-content">
        <div id="details">
                <h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH 
?>images/32x32/custom/contact.png" /><?php echo lang('activity') ?></h1>
@@ -56,7 +56,7 @@
                                        if ($editable)
                                        {
                                        ?>
-                                               <input type="text" name="title" 
id="title" value="<?php echo $activity->get_title() ?>" />
+                                               <input type="text" name="title" 
id="title" value="<?php echo $activity->get_title() ?>" size="100"/>
                                        <?php
                                        }
                                        else
@@ -65,6 +65,33 @@
                                        }
                                        ?>
                                </dd>
+                                                               <dt>
+                                       <?php if($activity->get_state() || 
$editable) { ?>
+                                       <label for="state"><?php echo 
lang('state') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       if ($editable)
+                                       {
+                                               $selected_state = 
$activity->get_state();
+                                       ?>
+                                               <select name="state">
+                                                       <option value="3" <?php 
echo ($selected_state == 3 ? 'selected="selected"' : "")?>><?php echo 
lang('published') ?></option>
+                                                       <option value="5" <?php 
echo ($selected_state == 5 ? 'selected="selected"' : "")?>><?php echo 
lang('rejected') ?></option>
+                                                       <option value="1" <?php 
echo ($selected_state == 1 ? 'selected="selected"' : "")?>><?php echo 
lang('new') ?></option>
+                                                       <option value="2" <?php 
echo ($selected_state == 2 ? 'selected="selected"' : "")?>><?php echo 
lang('change') ?></option>
+                                               </select>
+                                       <?php
+                                       }
+                                       else
+                                       {
+                                               if($activity->get_state() && 
$activity->get_state() > 0){
+                                                       echo 
lang('state_'.$activity->get_state());
+                                               }
+                                       }
+                                       ?>
+                               </dd>
                                <dt>
                                        <?php 
if($activity->get_organization_id() || $editable) { ?>
                                        <label for="organization_id"><?php echo 
lang('organization') ?></label>
@@ -132,7 +159,49 @@
                                        }
                                        ?>
                                </dd>
+                               <?php if($activity->get_contact_person_1() || 
$editable) { ?>
                                <dt>
+                                       <label for="contact_person_1"><?php 
echo lang('contact_person_1') ?></label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                               if($activity->get_group_id())
+                                               {
+                                                       echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_1());
+                                               }
+                                               else 
if($activity->get_organization_id())
+                                               {
+                                                       echo 
$contpers_so->get_org_contact_name($activity->get_contact_person_1());
+                                               }
+                                               else
+                                               {
+                                                       echo 
lang('contactperson_not_set');
+                                               }
+                                       ?>
+                               </dd>
+                               <?php  } ?>
+                               <?php if($activity->get_contact_person_2() || 
$editable) { ?>
+                               <dt>
+                                       <label for="contact_person_2"><?php 
echo lang('contact_person_2') ?></label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                               if($activity->get_group_id())
+                                               {
+                                                       echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_2());
+                                               }
+                                               else 
if($activity->get_organization_id())
+                                               {
+                                                       echo 
$contpers_so->get_org_contact_name($activity->get_contact_person_2());
+                                               }
+                                               else
+                                               {
+                                                       echo 
lang('contactperson_not_set');
+                                               }
+                                       ?>
+                               </dd>
+                               <?php  } ?>
+                               <dt>
                                        <?php 
if($activity->get_internal_arena() || $editable) { ?>
                                        <label for="arena"><?php echo 
lang('building') ?></label>
                                        <?php  } ?>
@@ -193,31 +262,21 @@
                                        ?>
                                </dd>
                                <dt>
-                                       <?php if($activity->get_state() || 
$editable) { ?>
-                                       <label for="state"><?php echo 
lang('state') ?></label>
+                                       <?php if($activity->get_time() || 
$editable) { ?>
+                                       <label for="time"><?php echo 
lang('time') ?></label>
                                        <?php  } ?>
                                </dt>
                                <dd>
                                        <?php
                                        if ($editable)
                                        {
-                                               $selected_state = 
$activity->get_state();
                                        ?>
-                                               <select name="state">
-                                                       <option value="0" <?php 
echo ($selected_state == 0 ? 'selected="selected"' : "")?>>Ingen status 
valgt</option>
-                                                       <option value="1" <?php 
echo ($selected_state == 1 ? 'selected="selected"' : "")?>><?php echo 
lang('new') ?></option>
-                                                       <option value="2" <?php 
echo ($selected_state == 2 ? 'selected="selected"' : "")?>><?php echo 
lang('change') ?></option>
-                                                       <option value="3" <?php 
echo ($selected_state == 3 ? 'selected="selected"' : "")?>><?php echo 
lang('accepted') ?></option>
-                                                       <option value="4" <?php 
echo ($selected_state == 4 ? 'selected="selected"' : "")?>><?php echo 
lang('processed') ?></option>
-                                                       <option value="5" <?php 
echo ($selected_state == 5 ? 'selected="selected"' : "")?>><?php echo 
lang('rejected') ?></option>
-                                               </select>
+                                               <input type="text" name="time" 
id="time" value="<?php echo $activity->get_time() ?>" />
                                        <?php
                                        }
                                        else
                                        {
-                                               if($activity->get_state() && 
$activity->get_state() > 0){
-                                                       echo 
lang('state_'.$activity->get_state());
-                                               }
+                                               echo $activity->get_time();
                                        }
                                        ?>
                                </dd>
@@ -284,36 +343,6 @@
                                        ?>
                                </dd>
                                <dt>
-                                       <?php if($activity->get_office() || 
$editable) { ?>
-                                       <label for="office"><?php echo 
lang('office') ?></label>
-                                       <?php  } ?>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       if ($editable)
-                                       {
-                                               $selected_office = 
$activity->get_office();
-                                       ?>
-                                               <select name="office">
-                                                       <option value="0">Ingen 
kontor valgt</option>
-                                                       <?php
-                                                       foreach($offices as 
$office)
-                                                       {
-                                                               echo "<option 
".($selected_office == $office['id'] ? 'selected="selected"' : "")." 
value=\"{$office['id']}\">".$office['name']."</option>";
-                                                       }
-                                                       ?>
-                                               </select>
-                                       <?php
-                                       }
-                                       else
-                                       {
-                                               if($activity->get_office()){
-                                                       echo 
$act_so->get_office_name($activity->get_office());
-                                               }
-                                       }
-                                       ?>
-                               </dd>
-                               <dt>
                                        <?php if($activity->get_district() || 
$editable) { ?>
                                        <label for="district"><?php echo 
lang('district') ?></label>
                                        <?php  } ?>
@@ -347,65 +376,61 @@
                                        ?>
                                </dd>
                                <dt>
-                                       <?php if($activity->get_description()) 
{ ?>
-                                       <label for="description"><?php echo 
lang('description') ?></label>
+                                       <?php if($activity->get_office() || 
$editable) { ?>
+                                       <label for="office"><?php echo 
lang('office') ?></label>
                                        <?php  } ?>
                                </dt>
                                <dd>
-                                       <?php echo 
$activity->get_description(); ?>
-                               </dd>
-                               <dt>
-                                       <?php if($activity->get_time() || 
$editable) { ?>
-                                       <label for="time"><?php echo 
lang('time') ?></label>
-                                       <?php  } ?>
-                               </dt>
-                               <dd>
                                        <?php
                                        if ($editable)
                                        {
+                                               $selected_office = 
$activity->get_office();
                                        ?>
-                                               <input type="text" name="time" 
id="time" value="<?php echo $activity->get_time() ?>" />
+                                               <select name="office">
+                                                       <option value="0">Ingen 
kontor valgt</option>
+                                                       <?php
+                                                       foreach($offices as 
$office)
+                                                       {
+                                                               echo "<option 
".($selected_office == $office['id'] ? 'selected="selected"' : "")." 
value=\"{$office['id']}\">".$office['name']."</option>";
+                                                       }
+                                                       ?>
+                                               </select>
                                        <?php
                                        }
                                        else
                                        {
-                                               echo $activity->get_time();
+                                               if($activity->get_office()){
+                                                       echo 
$act_so->get_office_name($activity->get_office());
+                                               }
                                        }
                                        ?>
                                </dd>
                                <dt>
-                                       <?php 
if($activity->get_contact_person_1() || $editable) { ?>
-                                       <label for="contact_person_1"><?php 
echo lang('contact_person_1') ?></label>
-                                       <?php  } ?>
+                                       <label for="description"><?php echo 
lang('description') ?></label>
                                </dt>
                                <dd>
                                        <?php
                                                if($activity->get_group_id())
                                                {
-                                                       echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_1());
+                                                       $group =  
$act_so->get_group_info($activity->get_group_id());
+                                                       if($group)
+                                                       {
+                                                               echo 
$group['description'];
+                                                       }
                                                }
                                                else 
if($activity->get_organization_id())
                                                {
-                                                       echo 
$contpers_so->get_org_contact_name($activity->get_contact_person_1());
+                                                       $org = 
$act_so->get_org_info($activity->get_organization_id());
+                                                       if($org)
+                                                       {
+                                                               echo 
$org['description'];
+                                                       }
                                                }
-                                       ?>
-                               </dd>
-                               <dt>
-                                       <?php 
if($activity->get_contact_person_2() || $editable) { ?>
-                                       <label for="contact_person_2"><?php 
echo lang('contact_person_2') ?></label>
-                                       <?php  } ?>
-                               </dt>
-                               <dd>
-                                       <?php
-                                               if($activity->get_group_id())
+                                               else
                                                {
-                                                       echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_2());
+                                                       echo 
lang('description_not_set');
                                                }
-                                               else 
if($activity->get_organization_id())
-                                               {
-                                                       echo 
$contpers_so->get_org_contact_name($activity->get_contact_person_2());
-                                               }
-                                       ?>
+                                        ?>
                                </dd>
                                <dt>
                                        <?php 
if($activity->get_contact_person_2_address() || $editable) { ?>
@@ -456,7 +481,13 @@
                                <?php
                                        if ($editable) {
                                                echo '<input type="submit" 
name="save_activity" value="' . lang('save') . '"/>';
+                                               echo '<a href="' . $cancel_link 
. '">' . lang('back_to_list') . '</a>';
                                        }
+                                       else
+                                       {
+                                               echo '<input type="submit" 
name="edit_activity" value="' . lang('edit') . '"/>';
+                                               echo '<a href="' . $cancel_link 
. '">' . lang('back_to_list') . '</a>';
+                                       }
                                ?>
                        </div>
                        

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2011-11-11 14:52:30 UTC (rev 8087)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2011-11-11 14:59:53 UTC (rev 8088)
@@ -189,10 +189,9 @@
                <label class="toolbar_element_label" 
for="ctrl_toggle_activity_state"><?php echo lang('activity_state') ?></label>
                <select name="activity_state" id="<?php echo $list_id 
?>_ctrl_toggle_activity_state">
                        <option value="all"><?php echo lang('all') ?></option>
-                       <option value="1"><?php echo lang('new') ?></option>
+                       <option value="1" <?php if($list_id == 
'new_activities'){ echo 'selected="selected"';}?>><?php echo lang('new') 
?></option>
                        <option value="2" ><?php echo lang('change') ?></option>
-                       <option value="3" ><?php echo lang('accepted') 
?></option>
-                       <option value="4" ><?php echo lang('processed') 
?></option>
+                       <option value="3" ><?php echo lang('published') 
?></option>
                        <option value="5" ><?php echo lang('rejected') 
?></option>
                </select>
                <label class="toolbar_element_label" 
for="ctrl_toggle_activity_district"><?php echo lang('office') ?></label>
@@ -215,7 +214,8 @@
 <?php
        }
 ?>
-
+<?php if($list_id != 'new_activities')
+{?>
 <fieldset>
        <h3><?php echo lang('export_to') ?></h3>
        <?php 
@@ -225,6 +225,7 @@
                <a href="javascript:activity_export('<?php echo $list_id ?>')" 
title="<?php echo lang('Download as excel') ?>"><img src="<?php echo 
ACTIVITYCALENDAR_IMAGE_PATH 
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a>&nbsp;&nbsp;<a 
href="javascript:activity_email('<?php echo $list_id ?>')" title="<?php echo 
lang('Send email to selection') ?>"><button><?php echo lang('Send mail to 
selection') ?></button></a>
        </div>
 </fieldset>
+<?php }?>
 
 <div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
 <div id="<?php echo $list_id ?>_container" class="datatable_container"></div>

Copied: 
branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php (from 
rev 8087, trunk/activitycalendar/templates/base/dashboard.php)
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php   
                        (rev 0)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php   
2011-11-11 14:59:53 UTC (rev 8088)
@@ -0,0 +1,31 @@
+<?php
+       include("common.php");
+?>
+
+<h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH 
?>images/32x32/x-office-address-book.png" /> <?php echo lang('dashboard') 
?></h1>
+
+<h2><?php echo lang('organization')?></h2>
+<?php
+       $list_form = true;
+       $list_id = 'new_organizations';
+       $url_add_on = '&amp;type=new_organizations';
+       $nosearch = true;
+       $extra_cols = array(array("key" => "change_type", "label" => 
lang('change_type'), "sortable" => true, "index" => 5));
+       include('organization_list_partial.php');
+?>
+<h2><?php echo lang('group')?></h2>
+<?php
+       $list_form = true;
+       $list_id = 'new_groups';
+       $url_add_on = '&amp;type=new_groups';
+       $nosearch = true;
+       $extra_cols = array(array("key" => "change_type", "label" => 
lang('change_type'), "sortable" => true, "index" => 5));
+       include('organization_list_partial.php');
+?>
+<h2><?php echo lang('activities') ?></h2>
+<?php
+       $list_form = true;
+       $list_id = 'new_activities';
+       $url_add_on = '&amp;type=new_activities';
+       include('activity_list_partial.php');
+?>
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2011-11-11 14:59:53 UTC (rev 8088)
@@ -18,40 +18,68 @@
                                        'group' => 'office'
                                )
                        );
-
-                       $menus['navigation'] =  array
-                       (
-                               'control' => array
+                       
+                       
if($GLOBALS['phpgw']->acl->check('.usertype.superuser',PHPGW_ACL_ADD,'controller'))
+                       {
+                               $menus['navigation'] =  array
                                (
-                                       'text'  => lang('Control'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol.control_list') ),
-                           'image'     => array('property', 'location_1')
-                               ),
-                               'control_item' => array
+                                       'control' => array
+                                       (
+                                               'text'  => lang('Control'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol.control_list') ),
+                                   'image'     => array('property', 
'location_1')
+                                       ),
+                                       'control_item' => array
+                                       (
+                                               'text'  => lang('Control_item'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_item.index') ),
+                                   'image'     => array('property', 
'location_1')
+                               ),
+                               'control_group' => array
+                                       (
+                                               'text'  => 
lang('Control_group'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_group.index') ),
+                                   'image'     => array('property', 
'location_1')
+                               ),
+                               'procedure' => array
+                                       (
+                                               'text'  => lang('Procedure'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uiprocedure.index') ),
+                                   'image'     => array('property', 
'location_1'),
+                                       ),    
+                                       'check_list' => array
+                                       (
+                                               'text'  => lang('Check_list'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicheck_list.index') ),
+                                   'image'     => array('property', 
'location_1'),
+                                       ),
+                               );
+                       }
+                       else
+                       {
+                               $menus['navigation'] =  array
+                               (    
+                                       'check_list' => array
+                                       (
+                                               'text'  => lang('Check_list'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicheck_list.index') ),
+                                   'image'     => array('property', 
'location_1'),
+                                       ),
+                               );
+                       }
+                       
+                       if ( $GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin')
+                               || $GLOBALS['phpgw']->acl->check('admin', 
phpgwapi_acl::ADD, 'controller'))
+                       {
+                               $menus['admin'] = array
                                (
-                                       'text'  => lang('Control_item'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_item.index') ),
-                           'image'     => array('property', 'location_1')
-                       ),
-                       'control_group' => array
-                               (
-                                       'text'  => lang('Control_group'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_group.index') ),
-                           'image'     => array('property', 'location_1')
-                       ),
-                       'procedure' => array
-                               (
-                                       'text'  => lang('Procedure'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uiprocedure.index') ),
-                           'image'     => array('property', 'location_1'),
-                               ),    
-                               'check_list' => array
-                               (
-                                       'text'  => lang('Check_list'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicheck_list.index') ),
-                           'image'     => array('property', 'location_1'),
-                               ),
-                       );
+                                       'acl'   => array
+                                       (
+                                               'text'  => lang('Configure 
Access Permissions'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'controller') )
+                                       )
+                               );
+                       }
                        
                        $menus['folders'] = 
phpgwapi_menu::get_categories('bergen');
 

Modified: branches/Version-1_0-branch/controller/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicommon.inc.php   
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/controller/inc/class.uicommon.inc.php   
2011-11-11 14:59:53 UTC (rev 8088)
@@ -111,9 +111,9 @@
 
                
                const LOCATION_ROOT = '.';
-               const LOCATION_IN = '.RESPONSIBILITY.INTO';
-               const LOCATION_OUT = '.RESPONSIBILITY.OUT';
-               const LOCATION_INTERNAL = '.RESPONSIBILITY.INTERNAL';
+               const LOCATION_SUPERUSER = '.usertype.superuser';
+//             const LOCATION_ADMINISTRATOR = '.RESPONSIBILITY.ADMIN';
+               const LOCATION_USER = '.usertype.user';
                
                public $dateFormat;
                
@@ -151,11 +151,12 @@
                        $this->acl = & $GLOBALS['phpgw']->acl;
                        $this->locations = & $GLOBALS['phpgw']->locations;
                        
-/*                     $this->type_of_user = array(
-                       MANAGER => $this->isManager(),
+                       $this->type_of_user = array(
+                               MANAGER => $this->isManager(),
                                EXECUTIVE_OFFICER => 
$this->isExecutiveOfficer(),
                                ADMINISTRATOR => $this->isAdministrator()
-                       );*/
+                       );
+                       //var_dump($this->type_of_user);
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['phpgw_info']['flags']['currentapp']);
                }
 
@@ -248,9 +249,8 @@
                 */
                protected function isExecutiveOfficer(){
                        return (
-                               
$this->acl->check(controller_uicommon::LOCATION_IN,PHPGW_ACL_ADD,'controller')  
||
-                               
$this->acl->check(controller_uicommon::LOCATION_OUT,PHPGW_ACL_ADD,'controller') 
||
-                               
$this->acl->check(controller_uicommon::LOCATION_INTERNAL,PHPGW_ACL_ADD,'controller')
+                               
$this->acl->check(controller_uicommon::LOCATION_SUPERUSER,PHPGW_ACL_ADD,'controller')
   ||
+                               
$this->acl->check(controller_uicommon::LOCATION_USER,PHPGW_ACL_ADD,'controller')
                        );
                }
                

Modified: branches/Version-1_0-branch/controller/setup/default_records.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/default_records.inc.php        
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/controller/setup/default_records.inc.php        
2011-11-11 14:59:53 UTC (rev 8088)
@@ -5,6 +5,40 @@
  * $oProc->query("sql_statement");
  *
  */
+
+// clean up from previous install
+$GLOBALS['phpgw_setup']->oProc->query("SELECT app_id FROM phpgw_applications 
WHERE app_name = 'controller'");
+$GLOBALS['phpgw_setup']->oProc->next_record();
+$app_id = $GLOBALS['phpgw_setup']->oProc->f('app_id');
+
+$GLOBALS['phpgw_setup']->oProc->query("SELECT location_id FROM phpgw_locations 
WHERE app_id = {$app_id} AND name != 'run'");
+
+$locations = array();
+while ($GLOBALS['phpgw_setup']->oProc->next_record())
+{
+       $locations[] = $GLOBALS['phpgw_setup']->oProc->f('location_id');
+}
+
+if(count($locations))
+{
+       $GLOBALS['phpgw_setup']->oProc->query('DELETE FROM phpgw_cust_choice 
WHERE location_id IN ('. implode (',',$locations) . ')');
+       $GLOBALS['phpgw_setup']->oProc->query('DELETE FROM phpgw_cust_attribute 
WHERE location_id IN ('. implode (',',$locations). ')');
+       $GLOBALS['phpgw_setup']->oProc->query('DELETE FROM phpgw_acl  WHERE 
location_id IN ('. implode (',',$locations) . ')');
+}
+
+$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_locations WHERE 
app_id = {$app_id} AND name != 'run'");
+
+
+unset($locations);
+
+
+//Create groups, users, add users to groups and set preferences
+$GLOBALS['phpgw']->locations->add('.',                         'Root',         
        'controller',false);
+$GLOBALS['phpgw']->locations->add('admin',                     'Admin',        
        'controller',false);
+$GLOBALS['phpgw']->locations->add('.usertype',                         
'Usertypes',                                            'controller',false);
+$GLOBALS['phpgw']->locations->add('.usertype.superuser',       'Usertype: 
Superuser',                          'controller',false);
+$GLOBALS['phpgw']->locations->add('.usertype.user',                    
'Usertype: User',                                       'controller',false);
+
 /*
 // Default groups and users
 $GLOBALS['phpgw']->accounts    = createObject('phpgwapi.accounts');
@@ -181,7 +215,7 @@
 $oProc->query("INSERT INTO controller_control_item (title, required, 
what_to_do, how_to_do, control_group_id) VALUES ('Etter utført kontroll - Sett 
sentralen i normal drift - Kontroller at indikatorlampe lyser.', false, 
'Kontroller alle armaturer ift. funksjonalitet i normaldrift (nett 
frakoblet)<ul><li>Sentralen settes over i nøddrift</li><li>Oppsøk alle 
armaturer og utfør visuell sjekk av armaturens funksjonalitet (også ledelys i 
tak/panikkbelysning)</li><li>Test skal ikke vare lenger enn 25 % av total 
batterikapasitet for sentralen</li></ul>', 'Kommer', 11)");
 
 //insert procedures
-$oProc->query("INSERT INTO controller_procedure (title, purpose, 
responsibility, description, reference, attachment) VALUES ('P40 Hvordan utføre 
egenkontroll av elektriske anlegg i kommunale bygg', 'Å sikre at elektriske 
anlegg i holdes forsvarlig stand i.h.t. forskrift om internkontroll av 
elektriske installasjoner', 'Bergen kommunale bygg er ansvarlig for oppdatering 
av rutiner og informasjon', 'Elektriske installasjoner skal kontrolleres i.h.t. 
internkontrollforskriftens § 5', '', '')");
-$oProc->query("INSERT INTO controller_procedure (title, purpose, 
responsibility, description, reference, attachment) VALUES ('P3811 Vannprøver 
og resultater', 'Ved jevnlig prøvetaking kan vi avklare avvik så tidlig så 
mulig og dermed sikre stabil vannkvalitet', 'Byggeier representert ved 
ansvarlig drifts- og vedlikeholdsingeniør BBE KF.', '<ol><li><span>Drifts- og 
vedlikeholdsingeniør skal sørge for at det foretas jevnlig prøvetaking med maks 
3 måneders intervaller. 
</span></li><li><span><span></span></span><span>Prøvetakingsutstyret skal være 
godkjent av Næringsmiddeltilsynet og teknisk hygiene for Bergen og 
Omland.</span></li><li><span>Personell som skal innhente vannprøver skal ha 
nødvendig opplæring i dette. </span>Opplæring blir gitt av 
Næringsmiddeltilsynet.</li><li><span><span></span></span><span>Prøvetaking skal 
foregå iht. rutiner for prøvetaking som er vedlagt. 
</span></li><li><span><span></span></span><span>Analyseresultater blir sendt 
til BBE KF og tjenestested.</span></li><li><span><span></span></span><span>Kopi 
analyseresultat settes i denne IK-perm kap. 
3.</span></li><li><span><span></span></span><span>Dersom vannkvalitet ikke 
tilfredsstiller kravet må DV-ingeniør konferere Næringsmiddeltilsynet for 
korrigerende tiltak.</span></li><li><span><span></span></span><span>Eventuelle 
avvik og korrigerende tiltak loggføres under kap. 6.</span></li><li><span>Punkt 
9<br></span></li></ol></li>', '', '')");
-$oProc->query("INSERT INTO controller_procedure (title, purpose, 
responsibility, description, reference, attachment) VALUES ('P3812 
Sjekkliste/Rutiner/Logg', '&nbsp;Ved bruk av sjekklister og faste 
tilsynsrutiner oppnås stabil drift. Tilsyn og nødvendige kontrollpunkter skal 
dokumenteres (loggføres) for&nbsp; at vi på en bedre måte kan vurdere anleggets 
tilstand og dermed raskere oppdage avvik.', 'Driftsleder i bydel skal sørge for 
at nødvendig tilsyn blir utført i tråd med fastalgte rutiner.', 
'<ol><li>Drifts- og vedlikeholdsingeniør skal sørge for at denne IK-håndbok 
ettterleves.</li><li>Driftsleder skal påse at ansvarlig driftspersonell foretar 
rutinemessig tilsyn/ inspeksjon iht. kapittel 5.</li><li>Evt. avvik i forhold 
til beskrevne rutiner skal begrunnes under kap. 6 avviksbehandling- (bruk 
rapportskjema under kap. 6)</li><li>Avvik skal rapporteres til drifts- og 
vedlikeholdsingeniør. Avvik kan være rutiner som ikke er fulgt, tekniske feil/ 
mangler, vannkvalitet som ikke tilfredsstiller gjeldende krav 
o.l.</li></ol></li>', '', '')");
+$oProc->query("INSERT INTO controller_procedure (title, purpose, 
responsibility, description, reference, attachment, revision_no) VALUES ('P40 
Hvordan utføre egenkontroll av elektriske anlegg i kommunale bygg', 'Å sikre at 
elektriske anlegg i holdes forsvarlig stand i.h.t. forskrift om internkontroll 
av elektriske installasjoner', 'Bergen kommunale bygg er ansvarlig for 
oppdatering av rutiner og informasjon', 'Elektriske installasjoner skal 
kontrolleres i.h.t. internkontrollforskriftens § 5', '', '',1)");
+$oProc->query("INSERT INTO controller_procedure (title, purpose, 
responsibility, description, reference, attachment, revision_no) VALUES ('P3811 
Vannprøver og resultater', 'Ved jevnlig prøvetaking kan vi avklare avvik så 
tidlig så mulig og dermed sikre stabil vannkvalitet', 'Byggeier representert 
ved ansvarlig drifts- og vedlikeholdsingeniør BBE KF.', '<ol><li><span>Drifts- 
og vedlikeholdsingeniør skal sørge for at det foretas jevnlig prøvetaking med 
maks 3 måneders intervaller. 
</span></li><li><span><span></span></span><span>Prøvetakingsutstyret skal være 
godkjent av Næringsmiddeltilsynet og teknisk hygiene for Bergen og 
Omland.</span></li><li><span>Personell som skal innhente vannprøver skal ha 
nødvendig opplæring i dette. </span>Opplæring blir gitt av 
Næringsmiddeltilsynet.</li><li><span><span></span></span><span>Prøvetaking skal 
foregå iht. rutiner for prøvetaking som er vedlagt. 
</span></li><li><span><span></span></span><span>Analyseresultater blir sendt 
til BBE KF og tjenestested.</span></li><li><span><span></span></span><span>Kopi 
analyseresultat settes i denne IK-perm kap. 
3.</span></li><li><span><span></span></span><span>Dersom vannkvalitet ikke 
tilfredsstiller kravet må DV-ingeniør konferere Næringsmiddeltilsynet for 
korrigerende tiltak.</span></li><li><span><span></span></span><span>Eventuelle 
avvik og korrigerende tiltak loggføres under kap. 6.</span></li><li><span>Punkt 
9<br></span></li></ol></li>', '', '',1)");
+$oProc->query("INSERT INTO controller_procedure (title, purpose, 
responsibility, description, reference, attachment, revision_no) VALUES ('P3812 
Sjekkliste/Rutiner/Logg', '&nbsp;Ved bruk av sjekklister og faste 
tilsynsrutiner oppnås stabil drift. Tilsyn og nødvendige kontrollpunkter skal 
dokumenteres (loggføres) for&nbsp; at vi på en bedre måte kan vurdere anleggets 
tilstand og dermed raskere oppdage avvik.', 'Driftsleder i bydel skal sørge for 
at nødvendig tilsyn blir utført i tråd med fastalgte rutiner.', 
'<ol><li>Drifts- og vedlikeholdsingeniør skal sørge for at denne IK-håndbok 
ettterleves.</li><li>Driftsleder skal påse at ansvarlig driftspersonell foretar 
rutinemessig tilsyn/ inspeksjon iht. kapittel 5.</li><li>Evt. avvik i forhold 
til beskrevne rutiner skal begrunnes under kap. 6 avviksbehandling- (bruk 
rapportskjema under kap. 6)</li><li>Avvik skal rapporteres til drifts- og 
vedlikeholdsingeniør. Avvik kan være rutiner som ikke er fulgt, tekniske feil/ 
mangler, vannkvalitet som ikke tilfredsstiller gjeldende krav 
o.l.</li></ol></li>', '', '',1)");
 

Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-11-11 
14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-11-11 
14:59:53 UTC (rev 8088)
@@ -1,4 +1,5 @@
 control        controller      no      Kontroll
+controller     common  no      Kontroll
 control_helptext       controller      no      Her kommer hjelpetekst for å 
opprette en kontroll
 Check_list     controller      no      Sjekkliste
 Check_lists    controller      no      Sjekklister

Modified: branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uilocation.inc.php   
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/property/inc/class.uilocation.inc.php   
2011-11-11 14:59:53 UTC (rev 8088)
@@ -2364,11 +2364,11 @@
                                                {
                                                        $_sep = '&';
                                                }
-                                               $_param = str_replace($_keys, 
$_values, $_config_section_data['parametres']);
+                                               $_param = 
$_config_section_data['parametres'] ? $_sep . str_replace($_keys, $_values, 
$_config_section_data['parametres']) : '';
                                                unset($_keys);
                                                unset($_values);
                //                              $integration_src = 
phpgw::safe_redirect("{$_config_section_data['url']}{$_sep}{$_param}");
-                                               $integration_src = 
"{$_config_section_data['url']}{$_sep}{$_param}";
+                                               $integration_src = 
"{$_config_section_data['url']}{$_param}";
                                                
if($_config_section_data['action'])
                                                {
                                                        $_sep = '?';
@@ -2376,7 +2376,7 @@
                                                        {
                                                                $_sep = '&';
                                                        }
-                                                       $integration_src .= 
"{$_sep}{$_config_section_data['action']}=" . 
$_config_section_data["action_{$mode}"];
+                                                       //$integration_src .= 
"{$_sep}{$_config_section_data['action']}=" . 
$_config_section_data["action_{$mode}"];
                                                }
 
                                                $arguments = 
array($_config_section_data['auth_key_name'] => $response);
@@ -2387,15 +2387,23 @@
                                                        
parse_str($_config_section_data['location_data'], $output);
                                                        foreach ($output as 
$_dummy => $_substitute)
                                                        {
-                                                               $_keys[] = 
$_substitute;
-                                                               $_values[] = 
urlencode($values[trim($_substitute, '_')]);
+                                                               //$_substitute 
= '__loc1__.__loc4__%';
+                                                               $regex = 
"/__([\w]+)__/";
+                                                               
preg_match_all($regex, $_substitute, $matches);
+                                                               
+                                                               
foreach($matches[1] as $__substitute)
+                                                               {
+                                                                       
$_values[] = urlencode($values[$__substitute]);                                 
                                
+                                                               }
                                                        }
-                                                       //$integration_src .= 
'&' . str_replace($_keys, $_values, $_config_section_data['location_data']);
-                                                       $integration_src .= 
'ctittel=5374.019%';
+                                                       $integration_src .= '&' 
. str_replace($matches[0], $_values, $_config_section_data['location_data']);
                                                }
 
-                                               $integration_src .= 
"&{$_config_section_data['auth_key_name']}={$response}";
-                                               
+                                               
if(isset($_config_section_data['auth_key_name']) && 
$_config_section_data['auth_key_name'])
+                                               {
+                                                       $integration_src .= 
"&{$_config_section_data['auth_key_name']}={$response}";
+                                               }
+
                                                //FIXME NOT WORKING!! test for 
webservice, auth...
                                                
if(isset($_config_section_data['method']) && $_config_section_data['method'] == 
'POST')
                                                {

Modified: branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php        
2011-11-11 14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php        
2011-11-11 14:59:53 UTC (rev 8088)
@@ -418,11 +418,11 @@
                                                $value['ajax'][] = true;
                                                $value['alert'][] = true;
                                                
-                                               $alertMessage = "Du er i ferd 
med å slette en kontraktspart.\n\n";
-                                               $alertMessage .= "Operasjonen 
kan ikke angres.\n\n";
-                                               $alertMessage .= "Vil du gjøre 
dette?";
+                                               $alertMessage_deleteParty = "Du 
er i ferd med å slette en kontraktspart.\n\n";
+                                               $alertMessage_deleteParty .= 
"Operasjonen kan ikke angres.\n\n";
+                                               $alertMessage_deleteParty .= 
"Vil du gjøre dette?";
                                                
-                                               $value['alert'][] = 
$alertMessage;
+                                               $value['alert'][] = 
$alertMessage_deleteParty;
                                                $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'rental.uiparty.delete_party', 'id' => $value['id'])));
                                                $value['labels'][] = 
lang('delete');
                                        }

Modified: branches/Version-1_0-branch/sms/bin/default/config_BR
===================================================================
--- branches/Version-1_0-branch/sms/bin/default/config_BR       2011-11-11 
14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/sms/bin/default/config_BR       2011-11-11 
14:59:53 UTC (rev 8088)
@@ -17,13 +17,15 @@
         * Config values for SMS-command "BR" - (Br\xF8yting) "snow clearing" 
in Norwegian - as example - as it is configured at BBB 
         */
 
-       $agreement = array(48089,48329);
+       //$agreement = array(48089,48329);
+       $agreement = array(86850);
 
        $limit = array
-                       (
-                               48089 => ' AND id > 0 AND id < 131',
-                               48329 => ' AND id > 0 AND id < 43'
-                       );
+       (
+               48089 => ' AND id > 0 AND id < 131',
+               48329 => ' AND id > 0 AND id < 43',
+               86850 => '', 
+       );
 
        if(isset($param[0]) && $param[0])
        {

Modified: branches/Version-1_0-branch/sms/bin/default/config_ST
===================================================================
--- branches/Version-1_0-branch/sms/bin/default/config_ST       2011-11-11 
14:52:30 UTC (rev 8087)
+++ branches/Version-1_0-branch/sms/bin/default/config_ST       2011-11-11 
14:59:53 UTC (rev 8088)
@@ -17,13 +17,15 @@
         * Config values for SMS-command "ST" - (Str\xF8ing) "sanding the ice" 
in Norwegian - as example - as it is configured at BBB 
         */
 
-       $agreement = array(48089,48329);
+       //$agreement = array(48089,48329);
+       $agreement = array(86850);
 
        $limit = array
-                       (
-                               48089 => ' AND id > 0 AND id < 131',
-                               48329 => ' AND id > 0 AND id < 43'
-                       );
+       (
+               48089 => ' AND id > 0 AND id < 131',
+               48329 => ' AND id > 0 AND id < 43',
+               86850 => '', 
+       );
 
        if(isset($param[0]) && $param[0])
        {




reply via email to

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