[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16114] more on rental
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16114] more on rental |
Date: |
Tue, 27 Dec 2016 11:06:11 +0000 (UTC) |
Revision: 16114
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16114
Author: sigurdne
Date: 2016-12-27 11:06:10 +0000 (Tue, 27 Dec 2016)
Log Message:
-----------
more on rental
Modified Paths:
--------------
trunk/rental/inc/class.uicontract.inc.php
trunk/rental/inc/class.uimovein.inc.php
trunk/rental/inc/class.uimoveout.inc.php
trunk/rental/inc/model/class.movein.inc.php
trunk/rental/inc/model/class.moveout.inc.php
trunk/rental/setup/phpgw_no.lang
trunk/rental/templates/base/contract.xsl
Modified: trunk/rental/inc/class.uicontract.inc.php
===================================================================
--- trunk/rental/inc/class.uicontract.inc.php 2016-12-27 11:05:15 UTC (rev
16113)
+++ trunk/rental/inc/class.uicontract.inc.php 2016-12-27 11:06:10 UTC (rev
16114)
@@ -1719,6 +1719,28 @@
$document_search_options[] = array('id' => 'name',
'name' => lang('document_name'));
/* *
********************************************************************************
*/
+
+ $moveout_gross =
createObject('rental.bomoveout')->read(array('filters' => array('contract_id'
=> $contract_id)));
+ $moveout = $moveout_gross['results'] ?
$moveout_gross['results'][0] : array();
+ if($moveout)
+ {
+ $moveout['url'] = self::link(array('menuaction'
=> 'rental.uimoveout.view','id' => $moveout['id']));
+ }
+ else
+ {
+ $moveout['new_report'] =
self::link(array('menuaction' => 'rental.uimoveout.edit','contract_id' =>
$contract_id));
+ }
+ $movein_gross =
createObject('rental.bomovein')->read(array('filters' => array('contract_id' =>
$contract_id)));
+ $movein = $movein_gross['results'] ?
$movein_gross['results'][0] : array();
+ if($movein)
+ {
+ $movein['url'] = self::link(array('menuaction'
=> 'rental.uimovein.view','id' => $movein['id']));
+ }
+ else
+ {
+ $movein['new_report'] =
self::link(array('menuaction' => 'rental.uimovein.edit','contract_id' =>
$contract_id));
+ }
+
$code = <<<JS
var thousandsSeparator =
'$this->thousandsSeparator';
var decimalSeparator =
'$this->decimalSeparator';
@@ -1776,7 +1798,9 @@
'value_security_amount_view' =>
($contract->get_security_amount()) ? $contract->get_security_amount() : '0',
'value_current_interval' => $current_interval .
" " . lang('year'),
'value_current_share' => $current_share . " %",
- 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab)
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'moveout' => $moveout,
+ 'movein' => $movein
);
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('view');
@@ -2207,6 +2231,28 @@
$document_search_options[] = array('id' =>
'title', 'name' => lang('document_title'));
$document_search_options[] = array('id' =>
'name', 'name' => lang('document_name'));
/* *
********************************************************************************
*/
+
+ $moveout_gross =
createObject('rental.bomoveout')->read(array('filters' => array('contract_id'
=> $contract_id)));
+ $moveout = $moveout_gross['results'] ?
$moveout_gross['results'][0] : array();
+ if($moveout)
+ {
+ $moveout['url'] =
self::link(array('menuaction' => 'rental.uimoveout.view','id' =>
$moveout['id']));
+ }
+ else
+ {
+ $moveout['new_report'] =
self::link(array('menuaction' => 'rental.uimoveout.edit','contract_id' =>
$contract_id));
+ }
+ $movein_gross =
createObject('rental.bomovein')->read(array('filters' => array('contract_id' =>
$contract_id)));
+ $movein = $movein_gross['results'] ?
$movein_gross['results'][0] : array();
+ if($movein)
+ {
+ $movein['url'] =
self::link(array('menuaction' => 'rental.uimovein.view','id' => $movein['id']));
+ }
+ else
+ {
+ $movein['new_report'] =
self::link(array('menuaction' => 'rental.uimovein.edit','contract_id' =>
$contract_id));
+ }
+
}
$code = <<<JS
@@ -2287,6 +2333,8 @@
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'img_cal' =>
json_encode($GLOBALS['phpgw']->common->image('phpgwapi', 'cal')),
'dateformat' => str_ireplace(array('d', 'm',
'y'), array('dd', 'mm', 'yy'),
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+ 'moveout' => $moveout,
+ 'movein' => $movein
);
//$appname = $this->location_info['name'];
Modified: trunk/rental/inc/class.uimovein.inc.php
===================================================================
--- trunk/rental/inc/class.uimovein.inc.php 2016-12-27 11:05:15 UTC (rev
16113)
+++ trunk/rental/inc/class.uimovein.inc.php 2016-12-27 11:06:10 UTC (rev
16114)
@@ -154,6 +154,8 @@
$movein = $this->bo->read_single($id);
}
+ $contract_id = $movein->contract_id ?
$movein->contract_id : phpgw::get_var('contract_id', 'int');
+
$tabs = array();
$tabs['first_tab'] = array(
'label' => lang('movein'),
@@ -239,7 +241,7 @@
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimovein.save')),
'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimovein.index',)),
'movein' => $movein,
- 'contract' =>
createObject('rental.uicontract')->get($movein->contract_id),
+ 'contract' =>
createObject('rental.uicontract')->get($contract_id),
'mode' => $mode,
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'value_active_tab' => $active_tab,
Modified: trunk/rental/inc/class.uimoveout.inc.php
===================================================================
--- trunk/rental/inc/class.uimoveout.inc.php 2016-12-27 11:05:15 UTC (rev
16113)
+++ trunk/rental/inc/class.uimoveout.inc.php 2016-12-27 11:06:10 UTC (rev
16114)
@@ -154,6 +154,8 @@
$moveout = $this->bo->read_single($id);
}
+ $contract_id = $moveout->contract_id ?
$moveout->contract_id : phpgw::get_var('contract_id', 'int');
+
$tabs = array();
$tabs['first_tab'] = array(
'label' => lang('moveout'),
@@ -238,7 +240,7 @@
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimoveout.save')),
'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimoveout.index',)),
'moveout' => $moveout,
- 'contract' =>
createObject('rental.uicontract')->get($moveout->contract_id),
+ 'contract' =>
createObject('rental.uicontract')->get($contract_id),
'mode' => $mode,
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'value_active_tab' => $active_tab,
Modified: trunk/rental/inc/model/class.movein.inc.php
===================================================================
--- trunk/rental/inc/model/class.movein.inc.php 2016-12-27 11:05:15 UTC (rev
16113)
+++ trunk/rental/inc/model/class.movein.inc.php 2016-12-27 11:06:10 UTC (rev
16114)
@@ -194,7 +194,17 @@
}
+ protected function doValidate( $entity, &$errors )
+ {
+ $values =
rental_somovein::get_instance()->read(array('filters' => array('contract_id' =>
$entity->contract_id)));
+ //Duplicate
+ if(!$entity->get_id() &&!empty($values['results']))
+ {
+ $errors['contract_id'] = lang("report is
already recorded for %1", $entity->contract_id);
+ }
+ }
+
public function serialize()
{
return self::toArray();
Modified: trunk/rental/inc/model/class.moveout.inc.php
===================================================================
--- trunk/rental/inc/model/class.moveout.inc.php 2016-12-27 11:05:15 UTC
(rev 16113)
+++ trunk/rental/inc/model/class.moveout.inc.php 2016-12-27 11:06:10 UTC
(rev 16114)
@@ -195,6 +195,18 @@
}
+ protected function doValidate( $entity, &$errors )
+ {
+ $values =
rental_somoveout::get_instance()->read(array('filters' => array('contract_id'
=> $entity->contract_id)));
+
+ //Duplicate
+ if(!$entity->get_id() &&!empty($values['results']))
+ {
+ $errors['contract_id'] = lang("report is
already recorded for %1", $entity->contract_id);
+ }
+ }
+
+
public function serialize()
{
return self::toArray();
Modified: trunk/rental/setup/phpgw_no.lang
===================================================================
--- trunk/rental/setup/phpgw_no.lang 2016-12-27 11:05:15 UTC (rev 16113)
+++ trunk/rental/setup/phpgw_no.lang 2016-12-27 11:06:10 UTC (rev 16114)
@@ -652,4 +652,5 @@
picture rental no Bilde
delete file rental no Slett fil
user rental no Bruker
-note rental no Merknad
\ No newline at end of file
+note rental no Merknad
+report is already recorded for %1 rental no Rapport finnes allerede
for %1
\ No newline at end of file
Modified: trunk/rental/templates/base/contract.xsl
===================================================================
--- trunk/rental/templates/base/contract.xsl 2016-12-27 11:05:15 UTC (rev
16113)
+++ trunk/rental/templates/base/contract.xsl 2016-12-27 11:06:10 UTC (rev
16114)
@@ -270,6 +270,40 @@
</xsl:attribute>
</input>
</div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'movein')"/>
+ </label>
+ <xsl:choose>
+ <xsl:when
test="movein/url">
+ <a
href="{movein/url}">
+
<xsl:value-of select="movein/created"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a
href="{movein/new_report}">
+
<xsl:value-of select="php:function('lang', 'new')"/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'moveout')"/>
+ </label>
+ <xsl:choose>
+ <xsl:when
test="moveout/url">
+ <a
href="{moveout/url}">
+
<xsl:value-of select="moveout/created"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a
href="{moveout/new_report}">
+
<xsl:value-of select="php:function('lang', 'new')"/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
</div>
<div class="pure-u-1 pure-u-lg-1-2">
<div class="pure-control-group">
@@ -844,6 +878,41 @@
</div>
</xsl:otherwise>
</xsl:choose>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'movein')"/>
+ </label>
+ <xsl:choose>
+ <xsl:when
test="movein/url">
+ <a
href="{movein/url}">
+
<xsl:value-of select="movein/created"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a
href="{movein/new_report}">
+
<xsl:value-of select="php:function('lang', 'new')"/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'moveout')"/>
+ </label>
+ <xsl:choose>
+ <xsl:when
test="moveout/url">
+ <a
href="{moveout/url}">
+
<xsl:value-of select="moveout/created"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a
href="{moveout/new_report}">
+
<xsl:value-of select="php:function('lang', 'new')"/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+
</div>
<div class="pure-u-1 pure-u-lg-1-2">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16114] more on rental,
sigurdne <=