[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7984]
From: |
Erik Holm-Larsen |
Subject: |
[Fmsystem-commits] [7984] |
Date: |
Wed, 02 Nov 2011 09:39:10 +0000 |
Revision: 7984
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7984
Author: erikhl
Date: 2011-11-02 09:39:10 +0000 (Wed, 02 Nov 2011)
Log Message:
-----------
Modified Paths:
--------------
trunk/rental/inc/class.soparty.inc.php
trunk/rental/inc/class.uiparty.inc.php
Modified: trunk/rental/inc/class.soparty.inc.php
===================================================================
--- trunk/rental/inc/class.soparty.inc.php 2011-11-01 16:50:42 UTC (rev
7983)
+++ trunk/rental/inc/class.soparty.inc.php 2011-11-02 09:39:10 UTC (rev
7984)
@@ -410,6 +410,20 @@
return (int) $this->db->f('count',true);
}
+ public function has_contract($party_id)
+ {
+ $sql = "SELECT * FROM rental_contract_party WHERE
party_id={$party_id}";
+ $result = $this->db->query($sql);
+ if($this->db->next_record())
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
public function delete_party($party_id)
{
if($party_id)
Modified: trunk/rental/inc/class.uiparty.inc.php
===================================================================
--- trunk/rental/inc/class.uiparty.inc.php 2011-11-01 16:50:42 UTC (rev
7983)
+++ trunk/rental/inc/class.uiparty.inc.php 2011-11-02 09:39:10 UTC (rev
7984)
@@ -150,6 +150,12 @@
}
}
}
+
+ //check if party is a part of a contract
+
+ $party_in_contract =
rental_soparty::get_instance()->has_contract($party->get_id());
+ $serialized['party_in_contract'] =
$party_in_contract ? true : false;
+
$rows[] = $serialized;
}
}
@@ -391,7 +397,7 @@
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'rental.uiparty.edit', 'id'
=> $value['id'])));
$value['labels'][] = lang('edit');
- if(isset($value['is_inactive']) &&
$value['is_inactive'] == true)
+ if(isset($value['party_in_contract'])
&& $value['party_in_contract'] == false)
{
$value['ajax'][] = true;
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uiparty.delete_party', 'id' => $value['id'])));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7984],
Erik Holm-Larsen <=