fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11997] bkbooking: stavanger update


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [11997] bkbooking: stavanger update
Date: Fri, 30 May 2014 10:09:45 +0000

Revision: 11997
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11997
Author:   kjell
Date:     2014-05-30 10:09:43 +0000 (Fri, 30 May 2014)
Log Message:
-----------
bkbooking: stavanger update

Modified Paths:
--------------
    branches/stavangerkommune/booking/inc/class.soorganization.inc.php
    branches/stavangerkommune/booking/templates/base/booking_delete.xsl
    branches/stavangerkommune/booking/templates/base/settings.xsl
    branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php
    branches/stavangerkommune/bookingfrontend/inc/class.uiorganization.inc.php
    branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang
    
branches/stavangerkommune/bookingfrontend/templates/stavanger/allocation_info.xsl
    
branches/stavangerkommune/bookingfrontend/templates/stavanger/booking_delete.xsl
    branches/stavangerkommune/phpgwapi/templates/stavanger/head.inc.php
    branches/stavangerkommune/phpgwapi/templates/stavanger/head.tpl

Modified: branches/stavangerkommune/booking/inc/class.soorganization.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.soorganization.inc.php  
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/booking/inc/class.soorganization.inc.php  
2014-05-30 10:09:43 UTC (rev 11997)
@@ -65,6 +65,15 @@
                                                  'city' => 
$this->db->f('city', false),
                                                  'description' => 
$this->db->f('description', false));
                }
+        function get_orgid($orgnr)
+        {
+            $this->db->limit_query("SELECT id FROM bb_organization where 
organization_number ='" . $orgnr."'", 0, __LINE__, __FILE__, 1);
+            if(!$this->db->next_record())
+            {
+                return False;
+            }
+            return $this->db->f('id', false);
+        }
         function get_groups($organization_id)
         {
             static $groups = null;

Modified: branches/stavangerkommune/booking/templates/base/booking_delete.xsl
===================================================================
--- branches/stavangerkommune/booking/templates/base/booking_delete.xsl 
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/booking/templates/base/booking_delete.xsl 
2014-05-30 10:09:43 UTC (rev 11997)
@@ -7,7 +7,10 @@
     <xsl:call-template name="msgbox"/>
        <xsl:call-template name="yui_booking_i18n"/>
        <dl class="form">
-       <dd><xsl:value-of select="php:function('lang', 'Booking Delete 
Information')"/></dd>
+       <dd>
+            <xsl:value-of select="php:function('lang', 'Booking Delete 
Information')"/>
+            <xsl:value-of select="php:function('lang', 'Booking Delete 
Information3')"/>
+        </dd>
        <dd><xsl:value-of select="php:function('lang', 'Booking Delete 
Information2')"/></dd>
        </dl>
 

Modified: branches/stavangerkommune/booking/templates/base/settings.xsl
===================================================================
--- branches/stavangerkommune/booking/templates/base/settings.xsl       
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/booking/templates/base/settings.xsl       
2014-05-30 10:09:43 UTC (rev 11997)
@@ -60,6 +60,12 @@
                         </xsl:if>
                         <xsl:value-of select="php:function('lang', 'Yes')" />
                           </option>
+                    <option value="never">
+                        <xsl:if 
test="config_data/user_can_delete_allocations='never'">
+                            <xsl:attribute 
name="selected">checked</xsl:attribute>
+                        </xsl:if>
+                        <xsl:value-of select="php:function('lang', 'No 
action')" />
+                    </option>
                        </select>
                        </dd>
             <dt><label for="field_extra_schedule"><xsl:value-of 
select="php:function('lang', 'Activate extra kalendar field on 
building')"/></label></dt>

Modified: 
branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php    
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php    
2014-05-30 10:09:43 UTC (rev 11997)
@@ -300,14 +300,18 @@
                {
                        $config = CreateObject('phpgwapi.config','booking');
                        $config->read();
-                       if ($config->config_data['user_can_delete_allocations'] 
!= 'yes')
-                       {
-                               $user_can_delete_allocations = 0;
-                       
-                       } else {
-                               $user_can_delete_allocations = 1;
-                       }
-                       
+                       if ($config->config_data['user_can_delete_allocations'] 
!= 'never') {
+                if ($config->config_data['user_can_delete_allocations'] != 
'yes')
+                {
+                    $user_can_delete_allocations = 0;
+                }
+                else
+                {
+                    $user_can_delete_allocations = 1;
+                }
+            } else {
+                $user_can_delete_allocations = 2;
+            }
 
                        $allocation = 
$this->bo->read_single(intval(phpgw::get_var('id', 'GET')));
                        $resources = 
$this->resource_bo->so->read(array('filters'=>array('id'=>$allocation['resources']),
 'sort'=>'name'));

Modified: 
branches/stavangerkommune/bookingfrontend/inc/class.uiorganization.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uiorganization.inc.php  
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uiorganization.inc.php  
2014-05-30 10:09:43 UTC (rev 11997)
@@ -9,6 +9,7 @@
                         'edit'         =>  true,
                         'index'        =>  true,
                         'building_users' => true,
+             'get_orgid'    => true,
                        );
                protected $module;
 
@@ -23,6 +24,9 @@
                        return parent::index_json();
                }
 
+        public function get_orgid($orgnr) {
+            return $this->bo->so->get_orgid($orgnr);
+        }
                public function edit()
                {
                        $organization = 
$this->bo->read_single(phpgw::get_var('id', 'GET'));

Modified: branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang       
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang       
2014-05-30 10:09:43 UTC (rev 11997)
@@ -354,7 +354,8 @@
 Layout bookingfrontend no      Frontend design
 Delete information     bookingfrontend no      Hvis du kun skal slette 
tildeling på valgt dato, velg Slett-knappen nederst og tiden blir vist som 
ledig i kalenderen, og kan tildeles andre klubber/org.
 Delete information2    bookingfrontend no      Skal du slette flere kan du 
velge Ut sesong eller Slett til og velg en dato, du kan også velge intervall 
(f.eks. annen hver uke).
-Booking Delete information     bookingfrontend no      Hvis du skal slette 
booking på valgt dato, velg Slett-knappen nederst. Skal tiden bli vist som 
ledig i kalenderen krysser du av for slett tildeling.
+Booking Delete information     bookingfrontend no      Hvis du skal slette 
booking på valgt dato, velg Slett-knappen nederst.
+Booking Delete information3    bookingfrontend no      Skal tiden bli vist som 
ledig i kalenderen krysser du av for slett tildeling.
 Booking Delete information2    bookingfrontend no      Skal du slette flere 
kan du velge Ut sesong eller Slett til og velg en dato, du kan også velge 
intervall (f.eks. annen hver uke).
 Cancel information     bookingfrontend no      Hvis du kun skal avbestille 
tildeling på valgt dato, velg Avbestill-knappen nederst og tiden blir vist som 
ledig i kalenderen, og kan tildeles andre klubber/org. 
 Cancel information2    bookingfrontend no      Skal du Avbestille flere kan du 
velge Ut sesong eller Slett til og velg en dato, du kan også velge intervall 
(f.eks. annen hver uke).

Modified: 
branches/stavangerkommune/bookingfrontend/templates/stavanger/allocation_info.xsl
===================================================================
--- 
branches/stavangerkommune/bookingfrontend/templates/stavanger/allocation_info.xsl
   2014-05-28 06:56:42 UTC (rev 11996)
+++ 
branches/stavangerkommune/bookingfrontend/templates/stavanger/allocation_info.xsl
   2014-05-30 10:09:43 UTC (rev 11997)
@@ -17,12 +17,14 @@
        <xsl:if test="allocation/add_link">
                <div class="actions">
                        <button 
onclick="location.href='{allocation/add_link}'"><xsl:value-of 
select="php:function('lang', 'Create new booking')"/></button>
-                       <xsl:if test="user_can_delete_allocations != 1">
-                       <button 
onclick="location.href='{allocation/cancel_link}'"><xsl:value-of 
select="php:function('lang', 'Cancel allocation')"/></button>
-                       </xsl:if>
-                       <xsl:if test="user_can_delete_allocations != 0">
-                       <button 
onclick="location.href='{allocation/cancel_link}'"><xsl:value-of 
select="php:function('lang', 'Delete allocation')"/></button>
-                       </xsl:if>
+            <xsl:if test="user_can_delete_allocations!=2">
+                       <xsl:if test="user_can_delete_allocations != 1">
+                       <button 
onclick="location.href='{allocation/cancel_link}'"><xsl:value-of 
select="php:function('lang', 'Cancel allocation')"/></button>
+                       </xsl:if>
+                       <xsl:if test="user_can_delete_allocations != 0">
+                       <button 
onclick="location.href='{allocation/cancel_link}'"><xsl:value-of 
select="php:function('lang', 'Delete allocation')"/></button>
+                       </xsl:if>
+            </xsl:if>
                </div>
        </xsl:if>
 </xsl:template>

Modified: 
branches/stavangerkommune/bookingfrontend/templates/stavanger/booking_delete.xsl
===================================================================
--- 
branches/stavangerkommune/bookingfrontend/templates/stavanger/booking_delete.xsl
    2014-05-28 06:56:42 UTC (rev 11996)
+++ 
branches/stavangerkommune/bookingfrontend/templates/stavanger/booking_delete.xsl
    2014-05-30 10:09:43 UTC (rev 11997)
@@ -7,7 +7,12 @@
     <xsl:call-template name="msgbox"/>
        <xsl:call-template name="yui_booking_i18n"/>
        <dl class="form">
-       <dd><xsl:value-of select="php:function('lang', 'Booking Delete 
Information')"/></dd>
+       <dd>
+            <xsl:value-of select="php:function('lang', 'Booking Delete 
Information')"/>
+            <xsl:if test="user_can_delete_allocations != 0">
+                <xsl:value-of select="php:function('lang', 'Booking Delete 
Information3')"/>
+            </xsl:if>
+        </dd>
        <dd><xsl:value-of select="php:function('lang', 'Booking Delete 
Information2')"/></dd>
        </dl>
     <div class="clr"/>

Modified: branches/stavangerkommune/phpgwapi/templates/stavanger/head.inc.php
===================================================================
--- branches/stavangerkommune/phpgwapi/templates/stavanger/head.inc.php 
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/phpgwapi/templates/stavanger/head.inc.php 
2014-05-30 10:09:43 UTC (rev 11997)
@@ -205,22 +205,31 @@
 #              $tpl_vars['help_url'] = => '#';
        }
        $bouser = CreateObject('bookingfrontend.bouser');
-       if($bouser->is_logged_in())
+    $org = CreateObject('bookingfrontend.uiorganization');
+    $orgid = $org->get_orgid($bouser->orgnr);
+    if($bouser->is_logged_in())
        {
                $tpl_vars['organization_json'] = 
json_encode(phpgwapi_cache::session_get($bouser->get_module(), 
$bouser::ORGARRAY_SESSION_KEY));
 
                $tpl_vars['change_org_header'] = lang('Change organization');
 
         if ( $bouser->orgname == '000000000') {
-            $tpl_vars['login_text'] = lang('SSN not registred'). ' :: ' . 
lang('Logout');
+            $tpl_vars['login_text_org'] = lang('SSN not registred');
+            $tpl_vars['login_text'] = lang('Logout');
+            $tpl_vars['org_url'] = '#';
         } else {
-               $tpl_vars['login_text'] = $bouser->orgname . ' :: ' . 
lang('Logout');
+               $tpl_vars['login_text_org'] = $bouser->orgname;
+            $tpl_vars['login_text'] = lang('Logout');
+            $tpl_vars['org_url'] = 
"/bookingfrontend/?menuaction=bookingfrontend.uiorganization.show&id=".$orgid;
         }
-               $tpl_vars['login_url'] = 'logout.php';
+#        $tpl_vars['login_url'] = 'logout.php'; #dev
+        $tpl_vars['login_url'] = '/logout.php';
        }
        else
        {
-               $tpl_vars['login_text'] = lang('Login');
+        $tpl_vars['login_text_org'] = '';
+        $tpl_vars['org_url'] = '#';
+        $tpl_vars['login_text'] = lang('Login');
                $tpl_vars['login_url'] = 
'login.php?after='.urlencode($_SERVER['QUERY_STRING']);
                $config         = 
CreateObject('phpgwapi.config','bookingfrontend');
                $config->read();

Modified: branches/stavangerkommune/phpgwapi/templates/stavanger/head.tpl
===================================================================
--- branches/stavangerkommune/phpgwapi/templates/stavanger/head.tpl     
2014-05-28 06:56:42 UTC (rev 11996)
+++ branches/stavangerkommune/phpgwapi/templates/stavanger/head.tpl     
2014-05-30 10:09:43 UTC (rev 11997)
@@ -33,7 +33,7 @@
     <div id="wrapper">
     <div id="header">
        <div id="login-bar">
-               <a href="{manual_url}">{manual_text}</a> <a 
href="{help_url}">{help_text}</a> <a href="{login_url}">{login_text}</a> <span 
id="change"></span>
+               <a href="{manual_url}">{manual_text}</a> <a 
href="{help_url}">{help_text}</a> <a href="{org_url}">{login_text_org}</a><a 
href="{login_url}">{login_text}</a> <span id="change"></span>
        </div>
         <a href="index.php?menuaction=bookingfrontend.uisearch.index"><div 
id="logo"></div></a>
         <div id="centerimage"></div>




reply via email to

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