[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7970] Added function for deleting contract party
From: |
Erik Holm-Larsen |
Subject: |
[Fmsystem-commits] [7970] Added function for deleting contract party |
Date: |
Mon, 31 Oct 2011 08:26:28 +0000 |
Revision: 7970
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7970
Author: erikhl
Date: 2011-10-31 08:26:28 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
Added function for deleting contract party
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-10-29 21:32:07 UTC (rev
7969)
+++ trunk/rental/inc/class.soparty.inc.php 2011-10-31 08:26:28 UTC (rev
7970)
@@ -410,5 +410,15 @@
return (int) $this->db->f('count',true);
}
+ public function delete_party($party_id)
+ {
+ if($party_id)
+ {
+ $sql = "DELETE FROM rental_party WHERE id={$party_id}";
+ $this->db->query($sql, __LINE__, __FILE__);
+ return true;
+ }
+ }
+
}
?>
Modified: trunk/rental/inc/class.uiparty.inc.php
===================================================================
--- trunk/rental/inc/class.uiparty.inc.php 2011-10-29 21:32:07 UTC (rev
7969)
+++ trunk/rental/inc/class.uiparty.inc.php 2011-10-31 08:26:28 UTC (rev
7970)
@@ -24,7 +24,8 @@
'syncronize_party' => true,
'syncronize_party_name' => true,
'create_user_based_on_email' => true,
- 'get_synchronize_party_info' => true
+ 'get_synchronize_party_info' => true,
+ 'delete_party' => true
);
public function __construct()
@@ -166,7 +167,7 @@
$type,
// [2] The type of query
isset($contract) ?
$contract->serialize() : null, // [3] Serialized contract
$editable,
// [4] Editable flag
- $this->type_of_user
// [5] User role
+ $this->type_of_user
// [5] User role
)
);
}
@@ -390,6 +391,13 @@
$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)
+ {
+ $value['ajax'][] = true;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uiparty.delete_party', 'id' => $value['id'])));
+ $value['labels'][] =
lang('delete');
+ }
+
if(isset($value['org_enhet_id']) &&
$value['org_enhet_id'] != '')
{
$value['ajax'][] = false;
@@ -735,5 +743,28 @@
//Redirect to edit mode with error message if user reaches this
point.
$GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'rental.uiparty.edit','id' => $party_id, 'error' =>
lang('error_create_user_based_on_email')));
}
+
+ public function delete_party()
+ {
+ $party_id = phpgw::get_var('id');
+ if(($this->isExecutiveOfficer() || $this->isAdministrator()))
+ {
+ if(isset($party_id) && $party_id > 0)
+ {
+
if(rental_soparty::get_instance()->delete_party($party_id)) // ... delete the
party
+ {
+ $message = lang('messages_saved_form');
+ }
+ else
+ {
+ $error = lang('messages_form_error');
+ }
+ }
+ }
+ else
+ {
+ $this->render('permission_denied.php',array('error' =>
lang('permission_denied_edit')));
+ }
+ }
}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7970] Added function for deleting contract party,
Erik Holm-Larsen <=