[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15392] rental: more on appilcation
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15392] rental: more on appilcation |
Date: |
Thu, 28 Jul 2016 13:01:05 +0000 (UTC) |
Revision: 15392
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15392
Author: sigurdne
Date: 2016-07-28 13:01:05 +0000 (Thu, 28 Jul 2016)
Log Message:
-----------
rental: more on appilcation
Modified Paths:
--------------
trunk/rental/inc/class.soapplication.inc.php
trunk/rental/inc/class.uiapplication.inc.php
trunk/rental/inc/model/class.application.inc.php
trunk/rental/setup/phpgw_no.lang
trunk/rental/setup/tables_current.inc.php
trunk/rental/templates/base/application.xsl
Modified: trunk/rental/inc/class.soapplication.inc.php
===================================================================
--- trunk/rental/inc/class.soapplication.inc.php 2016-07-28 08:44:55 UTC
(rev 15391)
+++ trunk/rental/inc/class.soapplication.inc.php 2016-07-28 13:01:05 UTC
(rev 15392)
@@ -265,6 +265,7 @@
protected function add( &$object )
{
+ _debug_array($object);
}
Modified: trunk/rental/inc/class.uiapplication.inc.php
===================================================================
--- trunk/rental/inc/class.uiapplication.inc.php 2016-07-28 08:44:55 UTC
(rev 15391)
+++ trunk/rental/inc/class.uiapplication.inc.php 2016-07-28 13:01:05 UTC
(rev 15392)
@@ -26,7 +26,6 @@
* @subpackage application
* @version $Id: $
*/
-
phpgw::import_class('rental.uicommon');
phpgw::import_class('rental.soapplication');
@@ -53,6 +52,33 @@
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('application');
}
+ private function get_status_options( $selected = 0 )
+ {
+ $status_options = array();
+ $status_options[] = array(
+ 'id' => rental_application::STATUS_REGISTERED,
+ 'name' => lang('registered')
+ );
+ $status_options[] = array(
+ 'id' => rental_application::STATUS_PENDING,
+ 'name' => lang('pending')
+ );
+ $status_options[] = array(
+ 'id' => rental_application::STATUS_REJECTED,
+ 'name' => lang('rejected')
+ );
+ $status_options[] = array(
+ 'id' => rental_application::STATUS_APPROVED,
+ 'name' => lang('approved')
+ );
+
+ foreach ($status_options as &$entry)
+ {
+ $entry['selected'] = $entry['id'] == $selected
? 1 : 0;
+ }
+ return $status_options;
+ }
+
public function index()
{
if (!$this->isExecutiveOfficer())
@@ -67,24 +93,7 @@
phpgwapi_jquery::load_widget('autocomplete');
- $types_options = array();
- $types_options[] = array(
- 'id' => 1,
- 'name' => 'registrert'
- );
- $types_options[] = array(
- 'id' => 2,
- 'name' => 'under behandling'
- );
- $types_options[] = array(
- 'id' => 3,
- 'name' => 'avvist'
- );
- $types_options[] = array(
- 'id' => 3,
- 'name' => 'godkjent'
- );
-
+ $status_options = $this->get_status_options();
$function_msg = lang('application');
$data = array(
@@ -96,14 +105,14 @@
'type' =>
'filter',
'name' =>
'responsibility_id',
'text' =>
lang('status'),
- 'list' =>
$types_options
+ 'list' =>
$status_options
),
array('type' =>
'autocomplete',
'name' =>
'dimb',
'app' =>
'property',
'ui' =>
'generic',
-
'label_attr'=>'descr',
- // 'show_id'=>
true,
+ 'label_attr' =>
'descr',
+ //
'show_id'=> true,
'text' =>
lang('dimb') . ':',
'requestGenerator' => 'requestWithDimbFilter',
),
@@ -252,7 +261,7 @@
// $application->set_price_type_id(1); // defaults
to year
}
- // $responsibility_title =
($application->get_responsibility_title()) ?
$application->get_responsibility_title() :
rental_socontract::get_instance()->get_responsibility_title($responsibility_id);
+ // $responsibility_title =
($application->get_responsibility_title()) ?
$application->get_responsibility_title() :
rental_socontract::get_instance()->get_responsibility_title($responsibility_id);
$link_save = array(
'menuaction' => 'rental.uiapplication.save'
@@ -270,11 +279,11 @@
$active_tab = 'showing';
// $current_price_type_id =
$application->get_price_type_id();
- $types_options = array();
+ $status_options = array();
// foreach ($application->get_price_types() as
$price_type_id => $price_type_title)
// {
// $selected = ($current_price_type_id ==
$price_type_id) ? 1 : 0;
-// $types_options[] = array('id' =>
$price_type_id, 'name' => lang($price_type_title),
+// $status_options[] = array('id' =>
$price_type_id, 'name' => lang($price_type_title),
// 'selected' => $selected);
// }
@@ -292,21 +301,28 @@
$GLOBALS['phpgw']->jqcal->add_listener('date_start');
$GLOBALS['phpgw']->jqcal->add_listener('date_end');
+
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start');
+
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end');
$data = array(
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', $link_save),
'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', $link_index),
'lang_save' => lang('save'),
'lang_cancel' => lang('cancel'),
- 'value_ecodimb' => $application->get_ecodimb(),
- 'value_ecodimb_descr' =>
ExecMethod('property.bogeneric.get_single_attrib_value', array('type' =>
'dimb', 'id' => $application->get_ecodimb(), 'attrib_name' => 'descr' )),
- 'district_list' =>
array('options' => $bocommon->select_district_list('',
$application->get_district_id())),
- 'composite_type_list' =>
array('options' => $bocommon->select_list( $application->get_composite_type(),
$composite_type)),
- 'value_date_start' =>
$GLOBALS['phpgw']->common->show_date($application->get_start_date(),$this->dateFormat),
- 'value_date_end' =>
$GLOBALS['phpgw']->common->show_date($application->get_end_date(),$this->dateFormat),
- 'value_cleaning' =>
$application->get_cleaning(),
- 'payment_method_list' =>
array('options' => $bocommon->select_list( $application->get_payment_method(),
$payment_method)),
-
+ 'value_ecodimb' => $application->get_ecodimb(),
+ 'value_ecodimb_descr' =>
ExecMethod('property.bogeneric.get_single_attrib_value', array(
+ 'type' => 'dimb',
+ 'id' => $application->get_ecodimb(),
+ 'attrib_name' => 'descr')
+ ),
+ 'district_list' => array('options' =>
$bocommon->select_district_list('', $application->get_district_id())),
+ 'composite_type_list' => array('options' =>
$bocommon->select_list($application->get_composite_type(), $composite_type)),
+ 'value_date_start' =>
$GLOBALS['phpgw']->common->show_date($application->get_start_date(),
$this->dateFormat),
+ 'value_date_end' =>
$GLOBALS['phpgw']->common->show_date($application->get_end_date(),
$this->dateFormat),
+ 'value_cleaning' =>
$application->get_cleaning(),
+ 'payment_method_list' => array('options' =>
$bocommon->select_list($application->get_payment_method(), $payment_method)),
+ 'value_application_id' =>
$application->get_id(),
+ 'status_list' => array('options' =>
$this->get_status_options($application->get_status())),
// 'lang_current_price_type' =>
lang($application->get_price_type_title()),
// 'lang_adjustable_text' =>
$application->get_adjustable_text(),
// 'lang_standard_text' =>
$application->get_standard_text(),
@@ -314,19 +330,18 @@
// 'value_field_of_responsibility' =>
lang($responsibility_title),
// 'value_agresso_id' =>
$application->get_agresso_id(),
// 'is_area' => ($application->is_area()) ? 1 : 0,
-// 'list_type' => array('options' =>
$types_options),
+// 'list_type' => array('options' =>
$status_options),
// 'value_price' => $application->get_price(),
// 'value_price_formatted' =>
number_format($application->get_price(), $this->decimalPlaces,
$this->decimalSeparator, $this->thousandsSeparator) . ' ' .
$this->currency_suffix,
// 'has_active_contract' =>
(rental_soapplication::get_instance()->has_active_contract($application->get_id()))
? 1 : 0,
// 'is_inactive' => ($application->is_inactive())
? 1 : 0,
// 'is_adjustable' =>
($application->is_adjustable()) ? 1 : 0,
// 'is_standard' => ($application->is_standard())
? 1 : 0,
- 'application_id' => $application->get_id(),
// 'responsibility_id' => $responsibility_id,
'mode' => $mode,
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
);
-
phpgwapi_jquery::formvalidator_generate(array('date','security', 'file'));
+ phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
phpgwapi_jquery::load_widget('autocomplete');
self::add_javascript('rental', 'rental',
'application.edit.js');
@@ -349,6 +364,7 @@
public function save()
{
+ _debug_array($_POST);
$application_id = phpgw::get_var('id', 'int');
if (!empty($application_id))
@@ -406,7 +422,7 @@
switch ($field_name)
{
case 'count':
- $value = (int) $value;
+ $value = (int)$value;
break;
case 'price':
$value =
trim(str_replace(array($this->currency_suffix, " "), '', $value));
@@ -469,7 +485,6 @@
$filters = array();
$result_objects =
rental_soapplication::get_instance()->get($start_index, $num_of_objects,
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
$object_count =
0;//rental_soapplication::get_instance()->get_count($search_for, $search_type,
$filters);
-
// Create an empty row set
$rows = array();
foreach ($result_objects as $record)
@@ -488,5 +503,4 @@
return $this->jquery_results($result_data);
}
-
}
\ No newline at end of file
Modified: trunk/rental/inc/model/class.application.inc.php
===================================================================
--- trunk/rental/inc/model/class.application.inc.php 2016-07-28 08:44:55 UTC
(rev 15391)
+++ trunk/rental/inc/model/class.application.inc.php 2016-07-28 13:01:05 UTC
(rev 15392)
@@ -31,6 +31,12 @@
class rental_application extends rental_model
{
+ const STATUS_REGISTERED = 1;
+ const STATUS_PENDING = 2;
+ const STATUS_REJECTED = 3;
+ const STATUS_APPROVED = 4;
+
+ protected $status;
protected $ecodimb;
protected $district_id;
protected $composite_type;
@@ -50,6 +56,15 @@
{
parent::__construct((int)$id);
}
+ public function set_status( $status )
+ {
+ $this->ecodimb = $status;
+ }
+
+ public function get_status()
+ {
+ return $this->status;
+ }
public function set_ecodimb( $ecodimb )
{
$this->ecodimb = $ecodimb;
Modified: trunk/rental/setup/phpgw_no.lang
===================================================================
--- trunk/rental/setup/phpgw_no.lang 2016-07-28 08:44:55 UTC (rev 15391)
+++ trunk/rental/setup/phpgw_no.lang 2016-07-28 13:01:05 UTC (rev 15392)
@@ -586,7 +586,8 @@
upload rental no Last opp
url rental no Nettsted
Unable to get a location code for the building. rental no Klarte
ikke å hente objektnummer for bygget.
-unit_leader rental no Enhetsleder
+unit_leader rental no Enhetsleder
+unit_leader2 rental no Leder avdeling/enhet
username rental no Brukernavn
user_or_group rental no Bruker/Gruppe
vacant rental no Ledig
@@ -625,4 +626,10 @@
payment method rental no Betalingsmetode
what rental no Hva
cleaning rental no Rengjøring
-assignment rental no Tildeling
\ No newline at end of file
+assignment rental no Tildeling
+assign_start rental no Tildelt fra
+assign_end rental no Tildelt til
+registered rental no Registrert
+pending rental no Under behandling
+rejected rental no Avvist
+approved rental no Godkjent
Modified: trunk/rental/setup/tables_current.inc.php
===================================================================
--- trunk/rental/setup/tables_current.inc.php 2016-07-28 08:44:55 UTC (rev
15391)
+++ trunk/rental/setup/tables_current.inc.php 2016-07-28 13:01:05 UTC (rev
15392)
@@ -472,5 +472,40 @@
'fk' => array(),
'ix' => array(),
'uc' => array()
- )
+ ),/*
+ 'rental_application' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
false),
+ 'ecodimb' => array('type' => 'int', 'precision'
=> '4', 'nullable' => false),
+ 'district_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
+ 'composite_type_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
+ 'cleaning' => array('type' => 'int',
'precision' => '2', 'nullable' => false),
+ 'payment_method' => array('type' => 'int',
'precision' => '2', 'nullable' => false),
+ 'date_start' => array('type' => 'int',
'precision' => '8', 'nullable' => true),
+ 'date_end' => array('type' => 'int',
'precision' => '8', 'nullable' => true),
+ 'entry_date' => array('type' => 'int',
'precision' => '8', 'nullable' => true),
+ 'identifier' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
+ 'adjustment_type' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'firstname' => array('type' => 'varchar',
'precision' => '64', 'nullable' => true),
+ 'lastname' => array('type' => 'varchar',
'precision' => '64', 'nullable' => true),
+ 'title' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'company_name' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'department' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'address_1' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'address_2' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'postal_code' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'place' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'phone' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'email' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'account_number' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'unit_leader' => array('type' => 'varchar',
'precision' => '255', 'nullable' => true),
+ 'comment' => array('type' => 'text', 'nullable'
=> true),
+ 'status' => array('type' => 'int', 'precision'
=> '2', 'nullable' => false),
+
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )*/
);
Modified: trunk/rental/templates/base/application.xsl
===================================================================
--- trunk/rental/templates/base/application.xsl 2016-07-28 08:44:55 UTC (rev
15391)
+++ trunk/rental/templates/base/application.xsl 2016-07-28 13:01:05 UTC (rev
15392)
@@ -31,6 +31,15 @@
<xsl:value-of disable-output-escaping="yes"
select="tabs"/>
<div id="application">
<fieldset>
+ <xsl:if
test="value_application_id != ''">
+ <div
class="pure-control-group">
+ <label>
+
<xsl:value-of select="php:function('lang', 'id')"/>
+ </label>
+ <input
type="hidden" name="id" value="{value_application_id}"/>
+ <xsl:value-of
select="value_application_id"/>
+ </div>
+ </xsl:if>
<div class="pure-control-group">
<xsl:variable
name="lang_dimb">
<xsl:value-of
select="php:function('lang', 'dimb')"/>
@@ -38,8 +47,8 @@
<label>
<xsl:value-of
select="$lang_dimb"/>
</label>
- <input type="hidden"
id="ecodimb" name="values[ecodimb]" value="{value_ecodimb}"/>
- <input type="text"
id="ecodimb_name" name="values[ecodimb_name]" value="{value_ecodimb_descr}">
+ <input type="hidden"
id="ecodimb" name="ecodimb" value="{value_ecodimb}"/>
+ <input type="text"
id="ecodimb_name" name="ecodimb_name" value="{value_ecodimb_descr}">
<xsl:attribute
name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
@@ -60,7 +69,7 @@
<xsl:value-of
select="$lang_district"/>
</label>
- <select
name="values[district_id]">
+ <select
name="district_id">
<xsl:attribute
name="title">
<xsl:value-of select="$lang_district"/>
</xsl:attribute>
@@ -84,7 +93,7 @@
<xsl:value-of
select="$lang_composite_type"/>
</label>
- <select
name="values[composite_type_id]">
+ <select
name="composite_type_id">
<xsl:attribute
name="title">
<xsl:value-of select="$lang_composite_type"/>
</xsl:attribute>
@@ -138,7 +147,7 @@
<label>
<xsl:value-of
select="php:function('lang', 'cleaning')"/>
</label>
- <input type="checkbox"
name="values[cleaning]" id="cleaning">
+ <input type="checkbox"
name="cleaning" id="cleaning" value="1">
<xsl:if
test="value_cleaning = 1">
<xsl:attribute name="checked" value="checked"/>
</xsl:if>
@@ -151,7 +160,7 @@
<label>
<xsl:value-of
select="$lang_payment_method"/>
</label>
- <select
name="values[payment_method]">
+ <select
name="payment_method">
<xsl:attribute
name="title">
<xsl:value-of select="$lang_payment_method"/>
</xsl:attribute>
@@ -179,8 +188,10 @@
<xsl:attribute
name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="placeholder">
+
<xsl:text>Ansattnummer</xsl:text>
+ </xsl:attribute>
</input>
- <input type="hidden"
name="id" value="{party_id}"/>
</div>
<div class="pure-control-group">
<label>
@@ -259,18 +270,6 @@
</div>
<div class="pure-control-group">
<label>
- <xsl:value-of
select="php:function('lang', 'mobile_phone')"/>
- </label>
- <input type="text"
name="mobile_phone" value="{value_mobile_phone}"></input>
- </div>
- <div class="pure-control-group">
- <label>
- <xsl:value-of
select="php:function('lang', 'fax')"/>
- </label>
- <input type="text"
name="fax" value="{value_fax}"></input>
- </div>
- <div class="pure-control-group">
- <label>
<xsl:value-of
select="php:function('lang', 'email')"/>
</label>
<input type="text"
name="email" id="email" value="{value_email}">
@@ -289,14 +288,8 @@
</div>
<div class="pure-control-group">
<label>
- <xsl:value-of
select="php:function('lang', 'url')"/>
+ <xsl:value-of
select="php:function('lang', 'unit_leader2')"/>
</label>
- <input type="text"
name="url" value="{value_url}"></input>
- </div>
- <div class="pure-control-group">
- <label>
- <xsl:value-of
select="php:function('lang', 'unit_leader')"/>
- </label>
<input type="text"
id="unit_leader" name="unit_leader" value="{value_unit_leader}"></input>
</div>
<div class="pure-control-group">
@@ -323,16 +316,74 @@
</div>
<div id="assignment">
<fieldset>
+ <div class="pure-control-group">
+ <xsl:variable
name="lang_date_start">
+ <xsl:value-of
select="php:function('lang', 'assign_start')"/>
+ </xsl:variable>
+ <label>
+ <xsl:value-of
select="$lang_date_start"/>
+ </label>
+ <input type="text"
id="assign_date_start" name="date_start" size="10"
value="{value_assign_date_start}" readonly="readonly">
+ <xsl:attribute
name="data-validation">
+
<xsl:text>required</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+
<xsl:value-of select="$lang_date_start"/>
+ </xsl:attribute>
+
+ </input>
+ </div>
+ <div class="pure-control-group">
+ <xsl:variable
name="lang_date_end">
+ <xsl:value-of
select="php:function('lang', 'assign_end')"/>
+ </xsl:variable>
+ <label>
+ <xsl:value-of
select="$lang_date_end"/>
+ </label>
+ <input type="text"
id="assign_date_end" name="date_end" size="10" value="{value_assign_date_end}"
readonly="readonly">
+ <xsl:attribute
name="data-validation">
+
<xsl:text>required</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+
<xsl:value-of select="$lang_date_end"/>
+ </xsl:attribute>
+
+ </input>
+ </div>
+ <div class="pure-control-group">
+ <xsl:variable
name="lang_status">
+ <xsl:value-of
select="php:function('lang', 'status')"/>
+ </xsl:variable>
+ <label>
+ <xsl:value-of
select="$lang_status"/>
+ </label>
+ <select name="status">
+ <xsl:attribute
name="title">
+
<xsl:value-of select="$lang_status"/>
+ </xsl:attribute>
+ <xsl:attribute
name="data-validation">
+
<xsl:text>required</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+
<xsl:value-of select="$lang_status"/>
+ </xsl:attribute>
+ <option
value="">
+
<xsl:value-of select="$lang_status"/>
+ </option>
+
<xsl:apply-templates select="status_list/options"/>
+ </select>
+ </div>
+
</fieldset>
</div>
</div>
<div class="proplist-col">
- <input type="submit" class="pure-button
pure-button-primary" name="save" value="{lang_save}"
onMouseout="window.status='';return true;"/>
+ <input type="submit" class="pure-button
pure-button-primary" name="save" value="{lang_save}"/>
<xsl:variable name="cancel_url">
<xsl:value-of select="cancel_url"/>
</xsl:variable>
- <input type="button" class="pure-button
pure-button-primary" name="cancel" value="{lang_cancel}"
onMouseout="window.status='';return true;" onClick="window.location =
'{cancel_url}';"/>
+ <input type="button" class="pure-button
pure-button-primary" name="cancel" value="{lang_cancel}"
onClick="window.location = '{cancel_url}';"/>
</div>
</form>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15392] rental: more on appilcation,
sigurdne <=