fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16090] more on rental


From: sigurdne
Subject: [Fmsystem-commits] [16090] more on rental
Date: Fri, 16 Dec 2016 13:12:43 +0000 (UTC)

Revision: 16090
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16090
Author:   sigurdne
Date:     2016-12-16 13:12:43 +0000 (Fri, 16 Dec 2016)
Log Message:
-----------
more on rental

Modified Paths:
--------------
    trunk/rental/inc/class.uicontract.inc.php
    trunk/rental/js/rental/moveout.edit.js
    trunk/rental/templates/base/moveout.xsl

Modified: trunk/rental/inc/class.uicontract.inc.php
===================================================================
--- trunk/rental/inc/class.uicontract.inc.php   2016-12-16 13:12:15 UTC (rev 
16089)
+++ trunk/rental/inc/class.uicontract.inc.php   2016-12-16 13:12:43 UTC (rev 
16090)
@@ -33,6 +33,7 @@
                        'index' => true,
                        'query' => true,
                        'view' => true,
+                       'get'   =>  true,
                        'add_party' => true,
                        'remove_party' => true,
                        'add_composite' => true,
@@ -1492,6 +1493,46 @@
                        $this->edit(array('contract_id' => $contract_id));
                }
 
+
+               public function get( $id = 0 )
+               {
+                       $contract_id =  $id ? (int)$id : 
(int)phpgw::get_var('id');
+                       if (!empty($contract_id))
+                       {
+                               $contract = 
rental_socontract::get_instance()->get_single($contract_id);
+
+                               if (!($contract && 
$contract->has_permission(PHPGW_ACL_READ)))
+                               {
+                                       
phpgw::no_access($GLOBALS['phpgw_info']['flags']['currentapp'], 
lang('permission_denied_view_contract'));
+                               }
+
+                               $ret = $contract->serialize();
+                               foreach ($ret as &$entry)
+                               {
+                                       $entry = rtrim($entry, '<br/>');
+                               }
+
+                       //      $ret['last_edited_by'] = 
$contract->get_last_edited_by();
+                               $ret['executive_officer'] = 
$GLOBALS['phpgw']->accounts->id2name($contract->get_executive_officer_id());
+                               $ret['security_amount'] = 
$contract->get_security_amount();
+                               phpgw::import_class('rental.soparty');
+
+                               $parties =  $contract->get_parties();
+                               foreach ($parties as $party_id => $value) // 
get the last one
+                               {
+
+                               }
+
+                               $party =  
rental_soparty::get_instance()->get_single($party_id);
+       //                      _debug_array($party);
+
+                               $ret['identifier'] = $party->get_identifier();
+                               $ret['mobile_phone'] = 
$party->get_mobile_phone();
+
+                               return $ret;
+                       }
+               }
+
                /**
                 * View a contract
                 */

Modified: trunk/rental/js/rental/moveout.edit.js
===================================================================
--- trunk/rental/js/rental/moveout.edit.js      2016-12-16 13:12:15 UTC (rev 
16089)
+++ trunk/rental/js/rental/moveout.edit.js      2016-12-16 13:12:43 UTC (rev 
16090)
@@ -59,19 +59,22 @@
        JqueryPortico.execute_ajax(requestUrl,
                function (result)
                {
-                       $("#contract_party_name").val(result.party_name);
-                       $("#contract_party_email").val(result.party_email);
-                       $("#contract_party_phone").val(result.party_phone);
+               
+                       $("#executive_officer").html(result.executive_officer);
+                       $("#composite").html(result.composite);
+                       $("#rented_area").html(result.rented_area);
+                       $("#security_amount").html(result.security_amount);
+                       $("#date_start").html(result.date_start);
+                       $("#date_end").html(result.date_end);
+                       $("#type").html(result.type);
+                       $("#party").html(result.party);
+                       $("#identifier").html(result.identifier);
+                       $("#mobile_phone").html(result.mobile_phone);
+                       $("#department").html(result.department);
+                       $("#contract_status").html(result.contract_status);
+                       $("#rented_area").html(result.rented_area);
+                       $("#term_label").html(result.term_label);
 
-                       var location = result.address_1;
-                       if (result.address_2)
-                       {
-                               location += "\n" + result.address_2;
-                       }
-                       location += "\n" + result.zip_code;
-                       location += ' ' + result.city;
-                       $("#location").val(location);
-
                }, data, "POST", "json"
                );
 }

Modified: trunk/rental/templates/base/moveout.xsl
===================================================================
--- trunk/rental/templates/base/moveout.xsl     2016-12-16 13:12:15 UTC (rev 
16089)
+++ trunk/rental/templates/base/moveout.xsl     2016-12-16 13:12:43 UTC (rev 
16090)
@@ -87,19 +87,130 @@
                                                        <div 
id="contract_container"/>
                                                </div>
 
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'executive_officer')"/>
+                                                       </label>
+                                                       <div 
id="executive_officer" class="pure-custom">
+                                                               <xsl:value-of 
select="contract/executive_officer"/>
+                                                       </div>
+                                               </div>
 
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'composite')"/>
+                                                       </label>
+                                                       <div id="composite" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/composite"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'rented_area')"/>
+                                                       </label>
+                                                       <div id="rented_area" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/rented_area"/>
+                                                       </div>
+                                               </div>
 
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'active')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'security_amount')"/>
                                                        </label>
-                                                       <input type="checkbox" 
name="active" id="active" value="1">
-                                                               <xsl:if 
test="moveout/active = 1">
-                                                                       
<xsl:attribute name="checked" value="checked"/>
-                                                               </xsl:if>
-                                                       </input>
+                                                       <div 
id="security_amount" class="pure-custom">
+                                                               <xsl:value-of 
select="contract/security_amount"/>
+                                                       </div>
                                                </div>
+
+
+
                                                <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'date_start')"/>
+                                                       </label>
+                                                       <div id="date_start" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/date_start"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'date_end')"/>
+                                                       </label>
+                                                       <div id="date_end" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/date_end"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'type')"/>
+                                                       </label>
+                                                       <div id="type" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/type"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'party')"/>
+                                                       </label>
+                                                       <div id="party" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/party"/>
+                                                       </div>
+                                               </div>
+
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'identifier')"/>
+                                                       </label>
+                                                       <div id="identifier" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/identifier"/>
+                                                       </div>
+                                               </div>
+
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'mobile_phone')"/>
+                                                       </label>
+                                                       <div id="mobile_phone" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/mobile_phone"/>
+                                                       </div>
+                                               </div>
+
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'department')"/>
+                                                       </label>
+                                                       <div id="department" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/department"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'contract_status')"/>
+                                                       </label>
+                                                       <div 
id="contract_status" class="pure-custom">
+                                                               <xsl:value-of 
select="contract/contract_status"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'rented_area')"/>
+                                                       </label>
+                                                       <div id="rented_area" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/rented_area"/>
+                                                       </div>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'billing_terms')"/>
+                                                       </label>
+                                                       <div id="term_label" 
class="pure-custom">
+                                                               <xsl:value-of 
select="contract/term_label"/>
+                                                       </div>
+                                               </div>
+
+
+
+                                               <div class="pure-control-group">
                                                        <xsl:variable 
name="lang_category">
                                                                <xsl:value-of 
select="php:function('lang', 'category')"/>
                                                        </xsl:variable>




reply via email to

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