[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16045] more on eventplanner
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16045] more on eventplanner |
Date: |
Sun, 4 Dec 2016 12:55:35 +0000 (UTC) |
Revision: 16045
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16045
Author: sigurdne
Date: 2016-12-04 12:55:35 +0000 (Sun, 04 Dec 2016)
Log Message:
-----------
more on eventplanner
Modified Paths:
--------------
trunk/eventplanner/inc/class.sobooking.inc.php
trunk/eventplanner/inc/class.uibooking.inc.php
trunk/eventplanner/inc/class.uicustomer.inc.php
trunk/eventplanner/inc/model/class.application.inc.php
trunk/eventplanner/inc/model/class.booking.inc.php
trunk/eventplanner/setup/tables_current.inc.php
trunk/eventplanner/templates/base/booking.xsl
trunk/phpgwapi/inc/functions.inc.php
Modified: trunk/eventplanner/inc/class.sobooking.inc.php
===================================================================
--- trunk/eventplanner/inc/class.sobooking.inc.php 2016-12-03 15:36:19 UTC
(rev 16044)
+++ trunk/eventplanner/inc/class.sobooking.inc.php 2016-12-04 12:55:35 UTC
(rev 16045)
@@ -86,7 +86,7 @@
{
$new_value = $object->$field;
$old_value = $original[$field];
- if (!empty($params['history']) && ($new_value
!= $old_value))
+ if (!empty($params['history']) && $new_value &&
$old_value && ($new_value != $old_value))
{
$label = !empty($params['label']) ?
lang($params['label']) : $field;
switch ($field)
@@ -101,8 +101,13 @@
break;
case 'from_':
case 'to_':
- $old_value =
$GLOBALS['phpgw']->common->show_date($old_value, $dateformat);
- $new_value =
$GLOBALS['phpgw']->common->show_date($new_value, $dateformat);
+ if(($old_value +
phpgwapi_datetime::user_timezone()) == $new_value)
+ {
+ continue;
+ }
+
+ $old_value =
$GLOBALS['phpgw']->common->show_date($old_value);
+ $new_value =
$GLOBALS['phpgw']->common->show_date($new_value);
break;
default:
break;
Modified: trunk/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uibooking.inc.php 2016-12-03 15:36:19 UTC
(rev 16044)
+++ trunk/eventplanner/inc/class.uibooking.inc.php 2016-12-04 12:55:35 UTC
(rev 16045)
@@ -206,11 +206,12 @@
$application =
createObject('eventplanner.boapplication')->read_single($booking->application_id);
- $GLOBALS['phpgw']->jqcal2->add_listener('from_',
'datetime', $booking->from_, array(
- 'min_date' => date('Y/m/d',
$application->date_start),
- 'max_date' => date('Y/m/d',
$application->date_end)
- )
- );
+// $GLOBALS['phpgw']->jqcal2->add_listener('from_',
'datetime', $booking->from_, array(
+// 'min_date' => date('Y/m/d',
$application->date_start),
+// 'max_date' => date('Y/m/d',
$application->date_end)
+// )
+// );
+
$application_type_list =
execMethod('eventplanner.bogeneric.get_list', array('type' =>
'application_type'));
$types = (array)$application->types;
if($types)
Modified: trunk/eventplanner/inc/class.uicustomer.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uicustomer.inc.php 2016-12-03 15:36:19 UTC
(rev 16044)
+++ trunk/eventplanner/inc/class.uicustomer.inc.php 2016-12-04 12:55:35 UTC
(rev 16045)
@@ -41,6 +41,7 @@
'view' => true,
'edit' => true,
'save' => true,
+ 'get' => true
);
protected
@@ -235,7 +236,27 @@
self::add_javascript('eventplanner', 'portico',
'customer.edit.js');
self::render_template_xsl(array('customer',
'datatable_inline'), array($mode => $data));
}
-
+
+ /*
+ * Get the customer with the id given in the http variable 'id'
+ */
+
+ public function get( $id = 0 )
+ {
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = !empty($id) ? $id : phpgw::get_var('id', 'int');
+
+ $customer = $this->bo->read_single($id)->toArray();
+
+ unset($customer['secret']);
+
+ return $customer;
+ }
+
public function save()
{
parent::save();
Modified: trunk/eventplanner/inc/model/class.application.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.application.inc.php 2016-12-03
15:36:19 UTC (rev 16044)
+++ trunk/eventplanner/inc/model/class.application.inc.php 2016-12-04
12:55:35 UTC (rev 16045)
@@ -210,28 +210,6 @@
'label' => 'contact phone',
'history' => true,
),
- /* 'customer_identifier_type' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'label' => 'customer_identifier_type',
- ),
- 'customer_ssn' => array(
- 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => false,
- 'query' => true,
- 'sf_validator' =>
createObject('booking.sfValidatorNorwegianSSN', array('full_required' =>
false)),
- 'label' => 'customer_ssn'
- ),
- 'customer_organization_number' => array(
- 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => false,
- 'query' => true,
- 'sf_validator' =>
createObject('booking.sfValidatorNorwegianOrganizationNumber', array(),
array('invalid' => '%field% is invalid')),
- 'label' =>
'customer_organization_number'
- ),*/
'vendor_id' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int',
'label' => 'vendor',
Modified: trunk/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.booking.inc.php 2016-12-03 15:36:19 UTC
(rev 16044)
+++ trunk/eventplanner/inc/model/class.booking.inc.php 2016-12-04 12:55:35 UTC
(rev 16045)
@@ -51,6 +51,9 @@
$application_name,
$customer_id,
$customer_name,
+ $customer_contact_name,
+ $customer_contact_email,
+ $customer_contact_phone,
$comments,
$created,
$secret;
@@ -149,6 +152,31 @@
'column' => 'name'
)
),
+ 'customer_contact_name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'customer contact name',
+ 'history' => true,
+ ),
+ 'customer_contact_email' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorEmail', array(), array('invalid' => '%field%
is invalid')),
+ 'label' => 'customer contact email',
+ 'history' => true,
+ ),
+ 'customer_contact_phone' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'customer contact phone',
+ 'history' => true,
+ ),
'comments' => array(
'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'string',
Modified: trunk/eventplanner/setup/tables_current.inc.php
===================================================================
--- trunk/eventplanner/setup/tables_current.inc.php 2016-12-03 15:36:19 UTC
(rev 16044)
+++ trunk/eventplanner/setup/tables_current.inc.php 2016-12-04 12:55:35 UTC
(rev 16045)
@@ -269,6 +269,9 @@
'completed' => array('type' => 'int',
'precision' => 4, 'nullable' => False,'default' => '0'),
'cost' => array('type' => 'decimal',
'precision' => 20, 'scale' => 2, 'nullable' => True,'default' => '0.00'),
'application_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'customer_contact_name' => array('type' =>
'text', 'nullable' => False),
+ 'customer_contact_email' => array('type' =>
'text', 'nullable' => False),
+ 'customer_contact_phone' => array('type' =>
'text', 'nullable' => False),
'reminder' => array('type' => 'int',
'precision' => 4, 'nullable' => False, 'default' => '0'),
'secret' => array('type' => 'text', 'nullable'
=> False),
'sms_total' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
Modified: trunk/eventplanner/templates/base/booking.xsl
===================================================================
--- trunk/eventplanner/templates/base/booking.xsl 2016-12-03 15:36:19 UTC
(rev 16044)
+++ trunk/eventplanner/templates/base/booking.xsl 2016-12-04 12:55:35 UTC
(rev 16045)
@@ -50,6 +50,12 @@
</legend>
<div class="pure-control-group">
<label>
+ <xsl:value-of
select="php:function('lang', 'vendor')"/>
+ </label>
+ <xsl:value-of
select="application/vendor_name"/>
+ </div>
+ <div class="pure-control-group">
+ <label>
<a
href="{application_url}" target="_blank">
<xsl:value-of select="php:function('lang', 'application')"/>
</a>
@@ -58,8 +64,13 @@
<xsl:value-of
select="booking/application_name"/>
</div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'remark')"/>
+ </label>
+ <xsl:value-of
select="application/remark"/>
+ </div>
-
<div class="pure-control-group">
<label>
<xsl:value-of
select="php:function('lang', 'contact name')"/>
@@ -175,7 +186,7 @@
<label>
<xsl:value-of
select="php:function('lang', 'contact name')"/>
</label>
- <input type="text"
name="contact_name" value="{booking/contact_name}">
+ <input type="text"
id="customer_contact_name" name="customer_contact_name"
value="{booking/customer_contact_name}">
<xsl:attribute
name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
@@ -188,7 +199,7 @@
<label>
<xsl:value-of
select="php:function('lang', 'email')"/>
</label>
- <input type="text"
name="contact_email" id="contact_email" value="{booking/contact_email}">
+ <input type="text"
id="customer_contact_email" name="customer_contact_email"
value="{booking/customer_contact_email}">
<xsl:attribute
name="data-validation">
<xsl:text>email</xsl:text>
</xsl:attribute>
@@ -209,7 +220,7 @@
<label>
<xsl:value-of
select="php:function('lang', 'contact phone')"/>
</label>
- <input type="text"
name="contact_phone" value="{booking/contact_phone}">
+ <input type="text"
id="customer_contact_phone" name="customer_contact_phone"
value="{booking/customer_contact_phone}">
<xsl:attribute
name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
@@ -230,7 +241,7 @@
<label>
<xsl:value-of
select="php:function('lang', 'active')"/>
</label>
- <input type="checkbox"
name="active" id="active" value="1">
+ <input type="checkbox"
name="active" id="active" value="1" readonly="readonly">
<xsl:if
test="booking/active = 1">
<xsl:attribute name="checked" value="checked"/>
</xsl:if>
@@ -257,7 +268,7 @@
<input type="text"
id="from_" name="from_" size="16" readonly="readonly">
<xsl:if
test="booking/from_ != 0 and booking/from_ != ''">
<xsl:attribute name="value">
-
<xsl:value-of select="php:function('date', $date_format,
number(booking/from_))"/>
+
<xsl:value-of select="php:function('show_date', number(booking/from_),
$date_format)"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute
name="data-validation">
@@ -279,7 +290,7 @@
<label>
<xsl:value-of
select="php:function('lang', 'to')"/>
</label>
- <xsl:value-of
select="php:function('date', $date_format, number(booking/to_))"/>
+ <xsl:value-of
select="php:function('show_date', number(booking/to_), $date_format)"/>
</div>
<div class="pure-control-group">
Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php 2016-12-03 15:36:19 UTC (rev
16044)
+++ trunk/phpgwapi/inc/functions.inc.php 2016-12-04 12:55:35 UTC (rev
16045)
@@ -87,7 +87,17 @@
}
return json_encode($strings);
}
-
+ /**
+ * Generate formatted datetime for use with xslt templates
+ * @return string datetime
+ */
+ function show_date()
+ {
+ $args = func_get_args();
+ $timestamp = $args[0];
+ $dateformat = !empty($args[1]) ? $args[1] : '';
+ return $GLOBALS['phpgw']->common->show_date($timestamp,
$dateformat);
+ }
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16045] more on eventplanner,
sigurdne <=