[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6571] rental: updated contracts list for regulations
From: |
Joakim Hop |
Subject: |
[Fmsystem-commits] [6571] rental: updated contracts list for regulations |
Date: |
Wed, 10 Nov 2010 11:19:06 +0000 |
Revision: 6571
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6571
Author: joakim_hop
Date: 2010-11-10 11:19:05 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
rental: updated contracts list for regulations
Modified Paths:
--------------
trunk/rental/inc/class.socontract.inc.php
trunk/rental/inc/class.uiadjustment.inc.php
trunk/rental/inc/class.uicontract.inc.php
trunk/rental/setup/phpgw_no.lang
trunk/rental/templates/base/contract.php
trunk/rental/templates/base/contracts_for_regulation_list.php
Modified: trunk/rental/inc/class.socontract.inc.php
===================================================================
--- trunk/rental/inc/class.socontract.inc.php 2010-11-10 10:40:17 UTC (rev
6570)
+++ trunk/rental/inc/class.socontract.inc.php 2010-11-10 11:19:05 UTC (rev
6571)
@@ -180,8 +180,8 @@
$adjustment_year =
$this->marshal($filters['adjustment_year'],'int');
$filter_clauses[] = "contract.adjustable IS true";
- //$filter_clauses[] = "contract.adjustment_interval =
{$adjustment_interval}";
- //$filter_clauses[] = "contract.adjustment_year +
{$adjustment_interval} = {$adjustment_year}";
+ $filter_clauses[] = "contract.adjustment_interval =
{$adjustment_interval}";
+ $filter_clauses[] = "contract.adjustment_year +
{$adjustment_interval} = {$adjustment_year}";
}
/*
Modified: trunk/rental/inc/class.uiadjustment.inc.php
===================================================================
--- trunk/rental/inc/class.uiadjustment.inc.php 2010-11-10 10:40:17 UTC (rev
6570)
+++ trunk/rental/inc/class.uiadjustment.inc.php 2010-11-10 11:19:05 UTC (rev
6571)
@@ -269,7 +269,10 @@
public function show_affected_contracts()
{
$adjustment_id = (int)phpgw::get_var('id');
- $this->render('contracts_for_regulation_list.php',
array('adjustment_id' => $adjustment_id));
+ $adjustment =
rental_soadjustment::get_instance()->get_single($adjustment_id);
+ $this->render('contracts_for_regulation_list.php',
array('adjustment_id' => $adjustment_id,
+
'adjustment' =>
$adjustment,
+
'cancel_link' =>
self::link(array('menuaction' => 'rental.uiadjustment.index'))));
}
public function run_adjustments()
Modified: trunk/rental/inc/class.uicontract.inc.php
===================================================================
--- trunk/rental/inc/class.uicontract.inc.php 2010-11-10 10:40:17 UTC (rev
6570)
+++ trunk/rental/inc/class.uicontract.inc.php 2010-11-10 11:19:05 UTC (rev
6571)
@@ -184,7 +184,7 @@
if(!$export){
//Add context menu columns (actions and labels)
- array_walk($rows, array($this, 'add_actions'),
array($type,$ids));
+ array_walk($rows, array($this, 'add_actions'),
array($type,$ids,$adjustment_id));
}
//var_dump("Usage " .memory_get_usage() . " bytes after
menu");
@@ -209,6 +209,7 @@
$type = $params[0];
$ids = $params[1];
+ $adjustment_id = $params[2];
switch($type)
{
@@ -231,6 +232,28 @@
$value['labels'][] =
lang('show');
}
break;
+ case 'contracts_for_adjustment':
+ if(!isset($ids) || count($ids) > 0)
+ {
+ $value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'rental.uicontract.edit',
+
'id' => $value['id'],
+
'initial_load' => 'no',
+
'adjustment_id' => $adjustment_id)));
+ $value['labels'][] =
lang('edit');
+ $value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uicontract.copy_contract',
+
'id' => $value['id'],
+
'adjustment_id' => $adjustment_id)));
+ $value['labels'][] =
lang('copy');
+ }
+ $value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'rental.uicontract.view',
+
'id' => $value['id'],
+
'initial_load' => 'no',
+
'adjustment_id' => $adjustment_id)));
+ $value['labels'][] = lang('show');
+ break;
default:
if(!isset($ids) || count($ids) > 0)
{
@@ -244,7 +267,6 @@
$value['ajax'][] = false;
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'rental.uicontract.view',
'id' => $value['id'], 'initial_load' => 'no')));
$value['labels'][] = lang('show');
-
}
}
@@ -274,6 +296,14 @@
public function viewedit($editable, $contract_id, $contract =
null, $location_id = null, $notification = null, string $message = null, string
$error = null)
{
+ $cancel_link = self::link(array('menuaction' =>
'rental.uicontract.index', 'populate_form' => 'yes'));
+ $adjustment_id = (int)phpgw::get_var('adjustment_id');
+ if($adjustment_id){
+ $cancel_link = self::link(array('menuaction' =>
'rental.uiadjustment.show_affected_contracts','id' => $adjustment_id));
+ $cancel_text = 'contract_regulation_back';
+ }
+
+
if (isset($contract_id) && $contract_id > 0) {
if($contract == null){
$contract =
rental_socontract::get_instance()->get_single($contract_id);
@@ -299,7 +329,8 @@
'editable' => $editable,
'message' => isset($message) ?
$message : phpgw::get_var('message'),
'error' => isset($error) ?
$error : phpgw::get_var('error'),
- 'cancel_link' =>
self::link(array('menuaction' => 'rental.uicontract.index', 'populate_form' =>
'yes')),
+ 'cancel_link' => $cancel_link,
+ 'cancel_text' => $cancel_text
);
$contract->check_consistency();
$this->render('contract.php', $data);
@@ -322,7 +353,8 @@
'editable' => true,
'message' =>
isset($message) ? $message : phpgw::get_var('message'),
'error' =>
isset($error) ? $error : phpgw::get_var('error'),
- 'cancel_link' =>
self::link(array('menuaction' => 'rental.uicontract.index')),
+ 'cancel_link' =>
$cancel_link,
+ 'cancel_text' =>
$cancel_text
);
$this->render('contract.php',
$data);
}
@@ -582,6 +614,8 @@
*/
public function copy_contract()
{
+ $adjustment_id = (int)phpgw::get_var('adjustment_id');
+
$so_contract = rental_socontract::get_instance();
$contract =
$so_contract->get_single(phpgw::get_var('id'));
$old_contract_old_id = $contract->get_old_contract_id();
@@ -602,17 +636,17 @@
if($success){
$db_contract->transaction_commit();
$message =
lang(messages_new_contract_copied).' '.$old_contract_old_id;
-
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'rental.uicontract.edit', 'id' => $contract->get_id(), 'message' => $message));
+
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'rental.uicontract.edit', 'id' => $contract->get_id(), 'message' => $message,
'adjustment_id' => $adjustment_id));
}
else{
$db_contract->transaction_abort();
-
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'rental.uicontract.edit', 'id' => $contract->get_id(), 'message' =>
lang('messages_form_error')));
+
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'rental.uicontract.edit', 'id' => $contract->get_id(), 'message' =>
lang('messages_form_error'),'adjustment_id' => $adjustment_id));
}
}
else
{
$db_contract->transaction_abort();
-
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'rental.uicontract.edit', 'id' => $contract->get_id(), 'message' =>
lang('messages_form_error')));
+
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'rental.uicontract.edit', 'id' => $contract->get_id(), 'message' =>
lang('messages_form_error'),'adjustment_id' => $adjustment_id));
}
}
Modified: trunk/rental/setup/phpgw_no.lang
===================================================================
--- trunk/rental/setup/phpgw_no.lang 2010-11-10 10:40:17 UTC (rev 6570)
+++ trunk/rental/setup/phpgw_no.lang 2010-11-10 11:19:05 UTC (rev 6571)
@@ -109,6 +109,8 @@
contract_under_dismissal rental no Under avslutning
contract_notifications rental no Kontraktens varsler
contract_notification_status rental no Status
+contracts_for_regulation rental no Regulering med tilhørende
kontrakter
+contract_regulation_back rental no Regulering
contracts_removed rental no Kontrakter som er fjernet fra
fakturakjøringen
contracts_with_one_time rental no Kontrakter med engangsbeløp
contracts_in_cycle rental no Kontrakter som følger vanlig
fakturasyklus
@@ -423,6 +425,7 @@
recurrence rental no Gjentakelse
reference rental no Deres ref
regulation rental no Regulering
+regulation_back rental no Reguleringsliste
related_delegates rental no Delegater
remove rental no Fjern
remove_from_workbench rental no Fjern fra mitt skrivebord
@@ -475,6 +478,7 @@
service_exist rental no Eksisterer
set_payer rental no Sett som fakturamottaker
shortcuts rental no Snarveier
+show_affected_contracts rental no Vis kontrakter relatert til
reguleringen
showing_composite rental no Leieobjekt
showing_contract rental no Kontrakt
showing rental no Viser priselement
Modified: trunk/rental/templates/base/contract.php
===================================================================
--- trunk/rental/templates/base/contract.php 2010-11-10 10:40:17 UTC (rev
6570)
+++ trunk/rental/templates/base/contract.php 2010-11-10 11:19:05 UTC (rev
6571)
@@ -31,7 +31,11 @@
<div class="identifier-header">
<h1><img src="<?php echo RENTAL_TEMPLATE_PATH
?>images/32x32/mimetypes/text-x-generic.png" /> <?php echo
lang('showing_contract') ?></h1>
<div style="float: left; width: 50%;">
- <button onclick="javascript:window.location.href ='<?php echo
$cancel_link;?>;'">« <?php echo
lang('contract_back');?></button><br/>
+ <?php
+ $back_button = lang('contract_back');
+ if($cancel_text) $back_button = lang($cancel_text);
+ ?>
+ <button onclick="javascript:window.location.href ='<?php echo
$cancel_link;?>;'">« <?php echo $back_button;?></button><br/>
<label><?php echo lang('contract_number') ?> </label>
<?php if($contract->get_old_contract_id()){
echo $contract->get_old_contract_id();
Modified: trunk/rental/templates/base/contracts_for_regulation_list.php
===================================================================
--- trunk/rental/templates/base/contracts_for_regulation_list.php
2010-11-10 10:40:17 UTC (rev 6570)
+++ trunk/rental/templates/base/contracts_for_regulation_list.php
2010-11-10 11:19:05 UTC (rev 6571)
@@ -2,22 +2,56 @@
include("common.php");
?>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH
?>images/32x32/text-x-generic.png" /> <?php echo
lang('contracts_for_regulation') ?></h1>
-
-<?php
-
-$list_form = false;
-$list_id = 'contracts_for_adjustment';
-$url_add_on = '&type='.$list_id.'&id='.$adjustment_id;
-$editable = false;
-$extra_cols = array(
- array("key" => "type", "label" => lang('responsibility'), "index" => 3),
- array("key" => "composite", "label" => lang('composite'),
"sortable"=>'true', "index" => 4),
- array("key" => "party", "label" => lang('party'), "sortable"=>'true',
"index" => 5),
- array("key" => "adjustment_interval", "label" =>
lang('adjustment_interval'), "sortable"=>false),
- array("key" => "adjustment_share", "label" => lang('adjustment_share'),
"sortable"=>false),
- array("key" => "adjustment_year", "label" => lang('adjustment_year'),
"sortable"=>false)
-);
-include('contract_list_partial.php');
-?>
\ No newline at end of file
+<div class="identifier-header">
+ <h1><img src="<?php echo RENTAL_TEMPLATE_PATH
?>images/32x32/text-x-generic.png" /> <?php echo
lang('contracts_for_regulation') ?></h1>
+ <div style="float: left; width: 50%;">
+ <button onclick="javascript:window.location.href ='<?php echo
$cancel_link;?>;'">« <?php echo
lang('regulation_back');?></button><br/>
+ <label for="name"><?php echo lang('field_of_responsibility')
?></label>
+ <?php echo
lang(rental_socontract::get_instance()->get_responsibility_title($adjustment->get_responsibility_id()));
?>
+ <br/>
+ <label for="adjustment_type"><?php echo
lang('adjustment_type')?></label>
+ <?php
+ if($adjustment->get_adjustment_type()){
+ echo lang($adjustment->get_adjustment_type());
+ }
+ else{
+ echo lang('none');
+ }
+ ?>
+ <br/>
+ <label for="percent"><?php echo lang('percent') ?></label>
+ <?php echo $adjustment->get_percent(). "%"; ?>
+ <br/>
+ <label for="interval"><?php echo lang('interval') ?></label>
+ <?php echo $adjustment->get_interval().' '.lang('year'); ?>
+ <br/>
+ <label for="adjustment_date"><?php echo lang('adjustment_date')
?></label>
+ <?php
+ $adjustment_date = $adjustment->get_adjustment_date() ?
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
$adjustment->get_adjustment_date()) : '-';
+ echo $adjustment_date;
+ ?>
+ <br/>
+ <?php if($adjustment->is_executed()){?>
+ <label for="is_executed"><?php echo
lang("adjustment_is_executed")?></label>
+ <?php }else{?>
+ <label for="is_executed"><?php echo
lang("adjustment_is_not_executed")?></label>
+ <?php }?>
+ </div>
+ <div style="float: left; width: 100%;">
+ <?php
+ $list_form = false;
+ $list_id = 'contracts_for_adjustment';
+ $url_add_on = '&type='.$list_id.'&id='.$adjustment_id;
+ $editable = false;
+ $extra_cols = array(
+ array("key" => "type", "label" =>
lang('responsibility'), "index" => 3),
+ array("key" => "composite", "label" =>
lang('composite'), "sortable"=>'true', "index" => 4),
+ array("key" => "party", "label" => lang('party'),
"sortable"=>'true', "index" => 5),
+ array("key" => "adjustment_interval", "label" =>
lang('adjustment_interval'), "sortable"=>false),
+ array("key" => "adjustment_share", "label" =>
lang('adjustment_share'), "sortable"=>false),
+ array("key" => "adjustment_year", "label" =>
lang('adjustment_year'), "sortable"=>false)
+ );
+ include('contract_list_partial.php');
+ ?>
+ </div>
+</div>
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6571] rental: updated contracts list for regulations,
Joakim Hop <=