fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16921] property: service agreement


From: sigurdne
Subject: [Fmsystem-commits] [16921] property: service agreement
Date: Fri, 7 Jul 2017 05:04:44 -0400 (EDT)

Revision: 16921
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16921
Author:   sigurdne
Date:     2017-07-07 05:04:44 -0400 (Fri, 07 Jul 2017)
Log Message:
-----------
property: service agreement

Modified Paths:
--------------
    trunk/property/inc/class.uis_agreement.inc.php
    trunk/property/templates/base/s_agreement.xsl

Modified: trunk/property/inc/class.uis_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uis_agreement.inc.php      2017-07-06 13:42:42 UTC 
(rev 16920)
+++ trunk/property/inc/class.uis_agreement.inc.php      2017-07-07 09:04:44 UTC 
(rev 16921)
@@ -1960,8 +1960,7 @@
                {
                        if (!$this->acl_read)
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'property.uilocation.stop',
-                                       'perm' => 1, 'acl_location' => 
$this->acl_location));
+                               phpgw::no_access();
                        }
 
                        $from = phpgw::get_var('from');
@@ -2039,9 +2038,21 @@
                                                $attribute['link_history'] = 
$GLOBALS['phpgw']->link('/index.php', $link_history_data);
                                        }
                                }
+                               $location = $this->acl_location . '.detail';
+                               $attributes_groups = 
$this->bo->get_attribute_groups($location, $values['attributes']);
+
+                               $attributes = array();
+                               foreach ($attributes_groups as $group)
+                               {
+                                       if (isset($group['attributes']))
+                                       {
+                                               $attributes[] = $group;
+                                       }
+                               }
+                               unset($attributes_groups);
+                               unset($s_agreement['attributes']);
                        }
 
-
                        $GLOBALS['phpgw']->js->validate_file('overlib', 
'overlib', 'property');
                        $GLOBALS['phpgw']->js->validate_file('core', 'check', 
'property');
 
@@ -2147,7 +2158,7 @@
                                'lang_cancel' => lang('cancel'),
                                'lang_cancel_statustext' => lang('Leave the 
service agreement untouched and return back to the list'),
                                'lang_dateformat' => 
lang(strtolower($dateformat)),
-                               'attributes_view' => $values['attributes'],
+                               'attributes_group' => $attributes,
                                'lang_agreement' => lang('Agreement'),
                                'agreement_name' => $s_agreement['name'],
                                'table_add' => $table_add,
@@ -2477,7 +2488,24 @@
                                )
                        );
 
+                       if (isset($values['attributes']) && 
is_array($values['attributes']))
+                       {
 
+                               $location = $this->acl_location;
+                               $attributes_groups = 
$this->bo->get_attribute_groups($location, $values['attributes']);
+
+                               $attributes = array();
+                               foreach ($attributes_groups as $group)
+                               {
+                                       if (isset($group['attributes']))
+                                       {
+                                               $attributes[] = $group;
+                                       }
+                               }
+                               unset($attributes_groups);
+                               unset($values['attributes']);
+                       }
+
                        $data = array
                                (
                                'datatable_def' => $datatable_def,
@@ -2510,7 +2538,8 @@
                                'member_of_name' => 'member_id',
                                'member_of_list' => $member_of_data['cat_list'],
                                'lang_dateformat' => 
lang(strtolower($dateformat)),
-                               'attributes_view' => $s_agreement['attributes'],
+//                             'attributes_view' => $s_agreement['attributes'],
+                               'attributes_group' => $attributes,
                                'dateformat' => $dateformat,
                                'lang_start_date' => lang('start date'),
                                'value_start_date' => 
$s_agreement['start_date'],

Modified: trunk/property/templates/base/s_agreement.xsl
===================================================================
--- trunk/property/templates/base/s_agreement.xsl       2017-07-06 13:42:42 UTC 
(rev 16920)
+++ trunk/property/templates/base/s_agreement.xsl       2017-07-07 09:04:44 UTC 
(rev 16921)
@@ -1053,15 +1053,15 @@
                                                        </div>
                                                </xsl:when>
                                        </xsl:choose>
+                               <xsl:choose>
+                                       <xsl:when test="attributes_group != ''">
+                                               <div clas="pure-control-group">
+                                                       <br></br>
+                             <xsl:call-template name="attributes_values"/>
+                                               </div>
+                                       </xsl:when>
+                               </xsl:choose>
                                        <xsl:choose>
-                                               <xsl:when test="attributes_view 
!= ''">
-                                                       <div 
class="pure-control-group">
-                                                                               
             
-                                                               
<xsl:apply-templates select="attributes_view"/>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
-                                       <xsl:choose>
                                                <xsl:when test="member_of_list 
!= ''">
                                                        <div 
class="pure-control-group">
                                                                <label>
@@ -1262,11 +1262,11 @@
                                        <xsl:value-of select="value_cost"/>
                                </div>
                                <xsl:choose>
-                                       <xsl:when test="attributes_view != ''">
+                                       <xsl:when test="attributes_group != ''">
                                                <div clas="pure-control-group">
                                                        <br></br>
-                                                       <xsl:apply-templates 
select="attributes_view"/>
-                                                                
+                                                       <!--xsl:apply-templates 
select="attributes_view"/-->
+                             <xsl:call-template name="attributes_values"/>     
                                                </div>
                                        </xsl:when>
                                </xsl:choose>




reply via email to

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