[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7136] Rental: right click contracts to view "catch"
From: |
Yngve Espelid |
Subject: |
[Fmsystem-commits] [7136] Rental: right click contracts to view "catch" -module tenants relocation reports |
Date: |
Wed, 23 Mar 2011 08:43:43 +0000 |
Revision: 7136
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7136
Author: yes
Date: 2011-03-23 08:43:41 +0000 (Wed, 23 Mar 2011)
Log Message:
-----------
Rental: right click contracts to view "catch"-module tenants relocation reports
Modified Paths:
--------------
trunk/rental/inc/class.uicontract.inc.php
trunk/rental/inc/hook_config.inc.php
trunk/rental/setup/phpgw_no.lang
trunk/rental/templates/base/config.tpl
Modified: trunk/rental/inc/class.uicontract.inc.php
===================================================================
--- trunk/rental/inc/class.uicontract.inc.php 2011-03-23 08:33:36 UTC (rev
7135)
+++ trunk/rental/inc/class.uicontract.inc.php 2011-03-23 08:43:41 UTC (rev
7136)
@@ -204,7 +204,19 @@
if(!$export){
//Add context menu columns (actions and labels)
- array_walk($rows, array($this, 'add_actions'),
array($type,$ids,$adjustment_id));
+ $config =
CreateObject('phpgwapi.config','rental');
+
+ //Check if user has access to Catch module
+ $access =
$this->acl->check('.',PHPGW_ACL_READ,'catch');
+ if($access)
+ {
+ $config->read();
+ $entity_id =
$config->config_data['entity_config_move_in_out'];
+ $category_id_in =
$config->config_data['category_config_move_in'];
+ $category_id_out =
$config->config_data['category_config_move_out'];
+ }
+
+ array_walk($rows, array($this, 'add_actions'),
array($type,$ids,$adjustment_id,$entity_id,$category_id_in,$category_id_out));
}
//var_dump("Usage " .memory_get_usage() . " bytes after
menu");
@@ -230,7 +242,11 @@
$type = $params[0];
$ids = $params[1];
$adjustment_id = $params[2];
+ $entity_id = $params[3];
+ $category_id_in = $params[4];
+ $category_id_out = $params[5];
+
switch($type)
{
case 'last_edited_by':
@@ -296,6 +312,20 @@
$value['labels'][] =
lang('make_pdf').": ". $pdf_template[0];
$temlate_counter++;
}
+
//http://portico/pe/index.php?menuaction=property.uientity.index&second_display=1&entity_id=3&cat_id=1&type=catch&district_id=0&query=Tes&start_date=&end_date=&click_history=06014d0abc7293bfb52ff5d1c04f3cb8&phpgw_return_as=json
+ if(isset($entity_id) && $entity_id !=
'' && isset($category_id_in) && $category_id_in != '')
+ {
+ $value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'property.uientity.index',
'entity_id' => $entity_id, 'cat_id' => $category_id_in,'query' =>
$value['old_contract_id'], 'type' => 'catch')));
+ $value['labels'][] =
lang('show_move_in_reports');
+ }
+
+ if(isset($entity_id) && $entity_id !=
'' && isset($category_id_out) && $category_id_out != '')
+ {
+ $value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'property.uientity.index',
'entity_id' => $entity_id, 'cat_id' => $category_id_out,'query' =>
$value['old_contract_id'], 'type' => 'catch')));
+ $value['labels'][] =
lang('show_move_out_reports');
+ }
}
}
Modified: trunk/rental/inc/hook_config.inc.php
===================================================================
--- trunk/rental/inc/hook_config.inc.php 2011-03-23 08:33:36 UTC (rev
7135)
+++ trunk/rental/inc/hook_config.inc.php 2011-03-23 08:43:41 UTC (rev
7136)
@@ -1,4 +1,4 @@
-<?php
+ <?php
/**
* Rental - configuration hook
*
@@ -32,7 +32,7 @@
$group_assigned =
isset($config['create_user_based_on_email_group']) ?
$config['create_user_based_on_email_group'] : '';
$out = '<option value="">' . lang('none selected') .
'</option>' . "\n";
-
+
foreach ( $groups as $group => $label)
{
$selected = '';
@@ -46,4 +46,98 @@
HTML;
}
return $out;
+ }
+
+ function entity_config_move_in_out($config)
+ {
+ $entity =
CreateObject('property.soadmin_entity');
+ $entities = $entity->read(array('allrows' => true, 'type'
=> 'catch'));
+ $selected_entity = isset($config['entity_config_move_in_out'])
? $config['entity_config_move_in_out'] : '';
+ $out = '<option value="">' . lang('none selected') .
'</option>' . "\n";
+ if ( is_array($entities) && count($entities) )
+ {
+ foreach($entities as $entry)
+ {
+
+ $id = $entry['id'];
+ $selected = '';
+ if ( $selected_entity == $id )
+ {
+ $selected = ' selected';
+ }
+
+ $out .= <<<HTML
+ <option
value="{$id}"{$selected}>{$entry['name']}</option>
+
+HTML;
+ }
+ }
+ return $out;
+ }
+
+ function category_config_move_in($config)
+ {
+ $selected_entity = isset($config['entity_config_move_in_out'])
? $config['entity_config_move_in_out'] : '';
+ $selected_category = isset($config['category_config_move_in'])
? $config['category_config_move_in'] : '';
+ $out = '<option value="">' . lang('none selected') .
'</option>' . "\n";
+
+ if(isset($selected_entity) && $selected_entity != '')
+ {
+ $entity =
CreateObject('property.soadmin_entity');
+ $cat_list =
$entity->read_category(array('allrows'=>true,'entity_id'=>$selected_entity,
'type' => 'catch'));
+
+
+ if (is_array($cat_list) && count($cat_list) )
+ {
+
+ foreach($cat_list as $entry)
+ {
+ $id = $entry['id'];
+ if ( $selected_category == $id )
+ {
+ $selected = ' selected';
+ }
+
+ $out .= <<<HTML
+ <option
value="{$id}"{$selected}>{$entry['name']}</option>
+
+HTML;
+
+ }
+ }
+ }
+ return $out;
+ }
+
+ function category_config_move_out($config)
+ {
+ $selected_entity = isset($config['entity_config_move_in_out'])
? $config['entity_config_move_in_out'] : '';
+ $selected_category = isset($config['category_config_move_out'])
? $config['category_config_move_out'] : '';
+ $out = '<option value="">' . lang('none selected') .
'</option>' . "\n";
+
+ if(isset($selected_entity) && $selected_entity != '')
+ {
+ $entity =
CreateObject('property.soadmin_entity');
+ $cat_list =
$entity->read_category(array('allrows'=>true,'entity_id'=>$selected_entity,
'type' => 'catch'));
+
+ if (is_array($cat_list) && count($cat_list) )
+ {
+
+ foreach($cat_list as $entry)
+ {
+ $id = $entry['id'];
+ if ( $selected_category == $id )
+ {
+ $selected = ' selected';
+ }
+
+ $out .= <<<HTML
+ <option
value="{$id}"{$selected}>{$entry['name']}</option>
+
+HTML;
+
+ }
+ }
+ }
+ return $out;
}
\ No newline at end of file
Modified: trunk/rental/setup/phpgw_no.lang
===================================================================
--- trunk/rental/setup/phpgw_no.lang 2011-03-23 08:33:36 UTC (rev 7135)
+++ trunk/rental/setup/phpgw_no.lang 2011-03-23 08:43:41 UTC (rev 7136)
@@ -82,6 +82,8 @@
calendar_months rental no
["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"]
calendar_weekdays rental no ["Sø","Ma","Ti","On","To","Fr","Lø"]
cancel rental no Avbryt
+category config move in rental no Kategori for
innflyttingsmeldinger
+category config move out rental no Kategori for
utflyttingsmeldinger
close rental no Lukk
clear rental no Nullstill
closing_due_date rental no Nær opsjonsfrist
@@ -194,6 +196,7 @@
email_create_user_based_on_email_title rental no Tilgang til Portico
Estate
email_create_user_based_on_email_message rental no Hei %1
%2:<br/>Det er opprettet en tilgang for deg i Portico
Estate<br/><br/>Brukernavnet er e-posten din<br/>Passordet er
%3<br/><br/>Systemet kan nås på adressen %4
ended rental no Avsluttet
+entity config move in out rental no Entitet for inn- og utflytting
error_create_user_based_on_email rental no En feil oppstod under
opprettelse av bruker
error_create_user_based_on_email_account_exist rental no En konto med
denne e-posten som brukernavn eksisterer allerede
error_create_user_based_on_email_not_valid_address rental no Kan
ikke opprette kontoen pga av e-postadressen ikke er gyldig
@@ -494,6 +497,9 @@
set_payer rental no Sett som fakturamottaker
shortcuts rental no Snarveier
show_affected_contracts rental no Vis kontrakter relatert til
reguleringen
+show_move_in_reports rental no Vis jasperreport for innflyttingsmelding
+show_move_out_reports rental no Vis jasperreport for utflyttingsmelding
+show_in_out_move_reports rental no Vis jasperreports for inn- og
utflyttingsmeldinger
showing_composite rental no Leieobjekt
showing_contract rental no Kontrakt
showing rental no Viser priselement
Modified: trunk/rental/templates/base/config.tpl
===================================================================
--- trunk/rental/templates/base/config.tpl 2011-03-23 08:33:36 UTC (rev
7135)
+++ trunk/rental/templates/base/config.tpl 2011-03-23 08:43:41 UTC (rev
7136)
@@ -53,6 +53,30 @@
</td>
</tr>
<tr class="row_off">
+ <td>{lang_entity_config_move_in_out}:</td>
+ <td>
+ <select name="newsettings[entity_config_move_in_out]">
+{hook_entity_config_move_in_out}
+ </select>
+ </td>
+ </tr>
+ <tr class="row_on">
+ <td>{lang_category_config_move_in}:</td>
+ <td>
+ <select name="newsettings[category_config_move_in]">
+{hook_category_config_move_in}
+ </select>
+ </td>
+ </tr>
+ <tr class="row_off">
+ <td>{lang_category_config_move_out}:</td>
+ <td>
+ <select name="newsettings[category_config_move_out]">
+{hook_category_config_move_out}
+ </select>
+ </td>
+ </tr>
+ <tr class="row_off">
<td>{lang_use_fellesdata}:</td>
<td>
<select name="newsettings[use_fellesdata]">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7136] Rental: right click contracts to view "catch" -module tenants relocation reports,
Yngve Espelid <=