fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9416]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [9416]
Date: Mon, 21 May 2012 05:45:13 +0000

Revision: 9416
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9416
Author:   erikhl
Date:     2012-05-21 05:45:12 +0000 (Mon, 21 May 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/rental/inc/class.bofellesdata.inc.php
    trunk/rental/inc/class.uicontract.inc.php
    trunk/rental/templates/base/contract.php

Modified: trunk/rental/inc/class.bofellesdata.inc.php
===================================================================
--- trunk/rental/inc/class.bofellesdata.inc.php 2012-05-20 17:05:45 UTC (rev 
9415)
+++ trunk/rental/inc/class.bofellesdata.inc.php 2012-05-21 05:45:12 UTC (rev 
9416)
@@ -386,7 +386,7 @@
                        
                        if($db->next_record())
                        {
-                               return $db->f('count(*)');
+                               return $db->f('count');
                        }
                        return 0;
                }

Modified: trunk/rental/inc/class.uicontract.inc.php
===================================================================
--- trunk/rental/inc/class.uicontract.inc.php   2012-05-20 17:05:45 UTC (rev 
9415)
+++ trunk/rental/inc/class.uicontract.inc.php   2012-05-21 05:45:12 UTC (rev 
9416)
@@ -399,6 +399,8 @@
                        else
                        {
                                if($this->isAdministrator() || 
$this->isExecutiveOfficer()){
+                                       $created = strtotime('now');
+                                       $created_by = 
$GLOBALS['phpgw_info']['user']['account_id'];
                                        if(!isset($contract)){
                                                $contract = new 
rental_contract();
                                                $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
@@ -410,6 +412,8 @@
                                                (
                                                        'contract'      => 
$contract,
                                                        'notification' => 
$notification,
+                                                       'created' => $created,
+                                                       'created_by' => 
$created_by,
                                                        'editable' => true,
                                                        'message' => 
isset($message) ? $message : phpgw::get_var('message'),
                                                        'error' => 
isset($error) ? $error : phpgw::get_var('error'),

Modified: trunk/rental/templates/base/contract.php
===================================================================
--- trunk/rental/templates/base/contract.php    2012-05-20 17:05:45 UTC (rev 
9415)
+++ trunk/rental/templates/base/contract.php    2012-05-21 05:45:12 UTC (rev 
9416)
@@ -48,11 +48,22 @@
                 <br/>
                <label><?php echo lang('last_updated') ?> </label>
                <?php
-                       echo 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_last_updated());
+                       if($contract->get_id() > 0) {
+                               echo 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_last_updated());
+                       }
+                       else{
+                               echo 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$created);
+                       }
                 ?>
                <label>&nbsp;&nbsp;<?php echo lang('name') ?></label>
                <?php
-                       echo $contract->get_last_edited_by();
+                       if($contract->get_id() > 0) {
+                               echo $contract->get_last_edited_by();
+                       }
+                       else
+                       {
+                               echo 
$GLOBALS['phpgw']->accounts->id2name($created_by);
+                       }
                 ?>
                <br/>
                <label><?php echo lang('composite') ?> </label>




reply via email to

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