fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17069] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [17069] more on eventplanner
Date: Wed, 13 Sep 2017 10:05:50 -0400 (EDT)

Revision: 17069
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17069
Author:   sigurdne
Date:     2017-09-13 10:05:50 -0400 (Wed, 13 Sep 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.sovendor.inc.php
    trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
    trunk/eventplannerfrontend/js/portico/application.edit.js
    trunk/phpgwapi/templates/frontend/head.inc.php
    trunk/phpgwapi/templates/frontend/head.tpl
    trunk/property/inc/class.solocation.inc.php
    trunk/property/inc/class.uitts.inc.php

Modified: trunk/eventplanner/inc/class.sovendor.inc.php
===================================================================
--- trunk/eventplanner/inc/class.sovendor.inc.php       2017-09-12 17:03:45 UTC 
(rev 17068)
+++ trunk/eventplanner/inc/class.sovendor.inc.php       2017-09-13 14:05:50 UTC 
(rev 17069)
@@ -54,7 +54,64 @@
                        return self::$so;
                }
 
+               function get_acl_condition( )
+               {
+                       $clause = '';
 
+                       if(!$this->relaxe_acl && ($this->use_acl && 
$this->currentapp && $this->acl_location))
+                       {
+                               $paranthesis = false;
+
+                               $grants = 
$this->acl->get_grants2($this->currentapp, $this->acl_location);
+                               $public_user_list = array();
+                               if (is_array($grants['accounts']) && 
$grants['accounts'])
+                               {
+                                       foreach($grants['accounts'] as $user => 
$_right)
+                                       {
+                                               $public_user_list[] = $user;
+                                       }
+                                       unset($user);
+                                       reset($public_user_list);
+                                       $clause .= 
"({$this->table_name}.owner_id IN(" . implode(',', $public_user_list) . ")";
+                                       $paranthesis = true;
+                               }
+
+                               $public_group_list = array();
+                               if (is_array($grants['groups']) && 
$grants['groups'])
+                               {
+                                       foreach($grants['groups'] as $user => 
$_right)
+                                       {
+                                               $public_group_list[] = $user;
+                                       }
+                                       unset($user);
+                                       reset($public_group_list);
+                                       $where = $public_user_list ? 'OR' : 
'AND';
+                                       if(!$paranthesis)
+                                       {
+                                               $clause .='(';
+                                       }
+                                       $clause .= " $where 
phpgw_group_map.group_id IN(" . implode(',', $public_group_list) . ")";
+
+                                       $paranthesis = true;
+                               }
+
+                               if($this->currentapp == 'eventplannerfrontend')
+                               {
+                                       $where = $clause ? 'OR' : 'AND';
+                                       $org_id = 
phpgw::get_var('org_id','string' , 'SESSION', -1);
+                                       $clause .= " {$where} 
eventplanner_vendor.organization_number = '{$org_id}'";
+                               }
+
+                               if($paranthesis)
+                               {
+                                       $clause .=')';
+                               }
+                       }
+
+                       return $clause;
+
+               }
+
                protected function populate( array $data )
                {
                        $object = new eventplanner_vendor();

Modified: 
trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
===================================================================
--- trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php    
2017-09-12 17:03:45 UTC (rev 17068)
+++ trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php    
2017-09-13 14:05:50 UTC (rev 17069)
@@ -125,8 +125,8 @@
 
                        if ($this->debug)
                        {
-                               $orgs[] = array('id' => '964338531', 'name' => 
'Bergen kommune');
-                               $_org_id = 964338531;
+                               $orgs[] = array('id' => '994239929', 'name' => 
'Bergen kommune');
+                               $_org_id = 994239929;
                        }
                        $_SESSION['orgs'] = $orgs;
                        $_SESSION['org_id'] = $_org_id; // one of them..

Modified: trunk/eventplannerfrontend/js/portico/application.edit.js
===================================================================
--- trunk/eventplannerfrontend/js/portico/application.edit.js   2017-09-12 
17:03:45 UTC (rev 17068)
+++ trunk/eventplannerfrontend/js/portico/application.edit.js   2017-09-13 
14:05:50 UTC (rev 17069)
@@ -480,7 +480,7 @@
 this.fileuploader = function (section)
 {
        multi_upload_parans.section = section;
-       var sUrl = phpGWLink('index.php', multi_upload_parans);
+       var sUrl = phpGWLink('eventplannerfrontend/', multi_upload_parans);
        TINY.box.show({iframe: sUrl, boxid: 'frameless', width: 750, height: 
450, fixed: false, maskid: 'darkmask', maskopacity: 40, mask: true, animate: 
true,
                close: true,
                closejs: function ()

Modified: trunk/phpgwapi/templates/frontend/head.inc.php
===================================================================
--- trunk/phpgwapi/templates/frontend/head.inc.php      2017-09-12 17:03:45 UTC 
(rev 17068)
+++ trunk/phpgwapi/templates/frontend/head.inc.php      2017-09-13 14:05:50 UTC 
(rev 17069)
@@ -173,16 +173,66 @@
        $test = $GLOBALS['phpgw']->common->get_on_events();
     $test = str_replace('window.onload = 
function()','$(document).ready(function()',$test);
     $test = str_replace("\n}\n","\n})\n",$test);
+       $site_url       = $GLOBALS['phpgw']->link("/{$app}/", array());
+       $home_text              = lang('home');
+       $manual_text = lang('manual');
 
+       $user = $GLOBALS['phpgw']->accounts->get( 
$GLOBALS['phpgw_info']['user']['id'] );
+
+       if($user && isset($_SESSION['phpgw_session']['session_flags']) && 
$_SESSION['phpgw_session']['session_flags'] == 'N')
+       {
+               $login_text = $user->__toString() . ' :: ' . lang('Logout');
+               $login_url = 'logout.php';
+       }
+       else
+       {
+               $login_text_org = '';
+               $login_text = lang('Login');
+               $login_url = 'logout.php?login=1&after='. $_GET['menuaction'];
+               $login_parameter = !empty($config_frontend['login_parameter']) 
? $config_frontend['login_parameter'] : '';
+               $custom_login_url = 
!empty($config_frontend['custom_login_url']) ? 
$config_frontend['custom_login_url'] : '';
+               if($login_parameter)
+               {
+                       $login_parameter = ltrim($login_parameter, '&');
+                       $login_url .= "&{$login_parameter}";
+               }
+               if($custom_login_url)
+               {
+                       $login_url = $custom_login_url;
+               }
+       }
+
+$header = <<<HTML
+               <div class="home-menu custom-menu-wrapper">
+                       <div class="home-menu pure-menu pure-menu-horizontal 
pure-menu-fixed">
+                               <a href="{$site_url}" 
class="pure-menu-heading">{$site_title}</a>
+                               <ul class="pure-menu-list">
+                                       <li class="pure-menu-item 
pure-menu-selected"><a href="{$site_url}" 
class="pure-menu-link">{$home_text}</a></li>
+                                       <li class="pure-menu-item 
pure-menu-selected"><a href="{$manual}" 
class="pure-menu-link">{$manual_text}</a></li>
+                                       <li class="pure-menu-item 
pure-menu-selected"><a href="{$login_url}" 
class="pure-menu-link">{$login_text}</a></li>
+                               </ul>
+                       </div>
+               </div>
+HTML;
+
+       if( !empty( $GLOBALS['phpgw_info']['flags']['noframework'] ))
+       {
+               $header = '';
+       }
+
        $tpl_vars = array
        (
+               'header'                => $header,
+               'login_text_org' =>     $login_text_org,
+               'login_text'    => $login_text,
+               'login_url'             => $login_url,
                'css'                   => $GLOBALS['phpgw']->common->get_css(),
                'javascript'    => $GLOBALS['phpgw']->common->get_javascript(),
                'img_icon'      => 
$GLOBALS['phpgw']->common->find_image('phpgwapi', 'favicon.ico'),
                'site_title'    => $site_title,
-               'home_text'             => lang('home'),
+               'home_text'             => $home_text,
                'str_base_url'  => $GLOBALS['phpgw']->link('/', array(), true),
-               'site_url'      => $GLOBALS['phpgw']->link("/{$app}/", array()),
+               'site_url'      => $site_url,
                'webserver_url' => $webserver_url,
         'win_on_events'        => $test,
                'metainfo_author' => $author,
@@ -196,7 +246,7 @@
        if ($manual !== null) 
        {
 
-               $tpl_vars['manual_text'] = lang('manual');
+               $tpl_vars['manual_text'] = $manual_text;
                $tpl_vars['manual_url'] = $manual;
        }
        $user = $GLOBALS['phpgw']->accounts->get( 
$GLOBALS['phpgw_info']['user']['id'] );

Modified: trunk/phpgwapi/templates/frontend/head.tpl
===================================================================
--- trunk/phpgwapi/templates/frontend/head.tpl  2017-09-12 17:03:45 UTC (rev 
17068)
+++ trunk/phpgwapi/templates/frontend/head.tpl  2017-09-13 14:05:50 UTC (rev 
17069)
@@ -39,8 +39,8 @@
        </head>
        <body>
 
-
-               <div class="home-menu custom-menu-wrapper">
+               {header}
+               <!--div class="home-menu custom-menu-wrapper">
                        <div class="home-menu pure-menu pure-menu-horizontal 
pure-menu-fixed">
                                <a href="{site_url}" 
class="pure-menu-heading">{site_title}</a>
                                <ul class="pure-menu-list">
@@ -49,20 +49,6 @@
                                        <li class="pure-menu-item 
pure-menu-selected"><a href="{login_url}" 
class="pure-menu-link">{login_text}</a></li>
                                </ul>
                        </div>
-               </div>
-
-               <!--div class="home-menu custom-menu-wrapper">
-                       <div class="pure-menu custom-menu custom-menu-top">
-                               <a href="{site_url}" class="pure-menu-heading 
custom-menu-brand">{site_title}</a>
-                               <a href="#" class="custom-menu-toggle" 
id="toggle"><s class="bar"></s><s class="bar"></s></a>
-                       </div>
-                       <div class="pure-menu pure-menu-horizontal 
pure-menu-scrollable custom-menu custom-menu-bottom custom-menu-tucked" 
id="tuckedMenu">
-                               <div class="custom-menu-screen"></div>
-                               <ul class="pure-menu-list">
-                                       <li class="pure-menu-item"><a 
href="{manual_url}" class="pure-menu-link">{manual_text}</a></li>
-                                       <li class="pure-menu-item"><a 
href="{login_url}" class="pure-menu-link">{login_text}</a></li>
-                               </ul>
-                       </div>
                </div-->
 
                <!-- END head -->

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2017-09-12 17:03:45 UTC (rev 
17068)
+++ trunk/property/inc/class.solocation.inc.php 2017-09-13 14:05:50 UTC (rev 
17069)
@@ -2199,6 +2199,46 @@
 
                }
 
+               function get_location_address($location_code = '')
+               {
+                       $locaction_code = 
$this->db->db_addslashes($location_code);
+
+                       $location_arr = explode('-', $location_code);
+                       $current_level = count($location_arr);
+
+
+                       $sql = "SELECT location_type AS location_level FROM 
fm_location_config WHERE column_name = 'street_id'";
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       $this->db->next_record();
+                       $location_level = $this->db->f('location_level');
+
+                       if($location_level > $current_level)
+                       {
+                               $sql = "SELECT loc{$current_level}_name AS 
address FROM fm_location{$current_level} WHERE location_code = 
'{$location_code}'";
+                               $this->db->query($sql, __LINE__, __FILE__);
+                               $this->db->next_record();
+                               $address = $this->db->f('address', true);
+                               return $address;
+                       }
+
+                       $search_location_arr = array();
+
+                       for ($i = 0; $i < $location_level; $i++)
+                       {
+                               $search_location_arr[] = $location_arr[$i];
+                       }
+
+                       $search_location_code = implode('-', 
$search_location_arr);
+
+                       $sql = "SELECT fm_streetaddress.descr || ' ' || 
fm_location{$location_level}.street_number AS address FROM 
fm_location{$location_level}"
+                       . " {$this->join} fm_streetaddress ON 
fm_location{$location_level}.street_id = fm_streetaddress.id"
+                       . " WHERE location_code = '{$search_location_code}'";
+                               $this->db->query($sql, __LINE__, __FILE__);
+                               $this->db->next_record();
+                               $address = $this->db->f('address', true);
+                       return $address;
+               }
+
                function get_location_exception($location_code = '', 
$alert_vendor = false)
                {
 

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2017-09-12 17:03:45 UTC (rev 
17068)
+++ trunk/property/inc/class.uitts.inc.php      2017-09-13 14:05:50 UTC (rev 
17069)
@@ -3652,8 +3652,10 @@
                                $user_name = 
$GLOBALS['phpgw_info']['user']['fullname'];
                        }
                        $ressursnr = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['ressursnr'];
-                       $location = $ticket['address'];
+//                     $location = $ticket['address'];
 
+                       $location = 
createObject('property.solocation')->get_location_address($ticket['location_code']);
+
                        $address_element = 
$this->bo->get_address_element($ticket['location_code']);
 
                        foreach ($address_element as $address_entry)
@@ -3719,7 +3721,13 @@
                                }
                        }
 
-                       $contact_block = nl2br(str_replace(array
+                       function nl2br2($string)
+                       {
+                               $string = str_replace(array("\r\n", "\r", 
"\n"), "<br />", $string);
+                               return $string;
+                       }
+                       
+                       $contact_block = nl2br2(str_replace(array
                                (
                                '__user_name__',
                                '__user_phone__',




reply via email to

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