[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15632]
From: |
saul . huanay |
Subject: |
[Fmsystem-commits] [15632] |
Date: |
Thu, 8 Sep 2016 23:24:40 +0000 (UTC) |
Revision: 15632
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15632
Author: psaul
Date: 2016-09-08 23:24:39 +0000 (Thu, 08 Sep 2016)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
branches/dev-syncromind-2/rental/js/rental/schedule.js
branches/dev-syncromind-2/rental/templates/base/application.xsl
branches/dev-syncromind-2/rental/templates/base/schedule.xsl
Added Paths:
-----------
branches/dev-syncromind-2/rental/templates/base/rental_schedule.xsl
Modified: branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
2016-09-08 15:07:45 UTC (rev 15631)
+++ branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
2016-09-08 23:24:39 UTC (rev 15632)
@@ -26,6 +26,7 @@
* @subpackage application
* @version $Id: $
*/
+ phpgw::import_class('rental.uicomposite');
phpgw::import_class('rental.uicommon');
phpgw::import_class('phpgwapi.datetime');
@@ -309,7 +310,7 @@
array('key' => 'author', 'label' =>
lang('User'), 'sortable' => true, 'resizeable' => true),
array('key' => 'comment', 'label' =>
lang('Note'), 'sortable' => true, 'resizeable' => true)
);
-
+
$datatable_def[] = array(
'container' => 'datatable-container_0',
'requestUrl' => "''",
@@ -341,10 +342,144 @@
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'value_active_tab' => $active_tab
);
+
+ // Composite
+ $composite_id = (int)phpgw::get_var('id');
+ $date = new DateTime(phpgw::get_var('date'));
+ if ($date->format('w') != 1) {
+ $date->modify('last monday');
+ }
+
+ $editable = phpgw::get_var('editable', 'bool');
+ $type = 'all_composites';
+
+ $filters = rental_uicomposite::get_filters();
+
+ $schedule['filters'] = $filters;
+
+ $schedule['datasource_url'] = self::link(array(
+ 'menuaction' =>
'rental.uicomposite.get_schedule',
+ 'editable' => ($editable) ? 1 : 0,
+ 'type' => $type,
+ 'phpgw_return_as' => 'json'
+ ));
+
+ $parameters = array
+ (
+ 'parameter' => array
+ (
+ array
+ (
+ 'name' => 'id',
+ 'source' => 'id'
+ )
+ )
+ );
+
+ $toolbar = array();
+
+ $toolbar[] = array(
+ 'name' => 'new',
+ 'text' => lang('new'),
+ 'action' => self::link(array(
+ 'menuaction' => 'rental.uicomposite.add'
+ ))
+ );
+
+ $toolbar[] = array(
+ 'name' => 'download',
+ 'text' => lang('download'),
+ 'action' => self::link(array(
+ 'menuaction' =>
'rental.uicomposite.download',
+ 'type' => $type,
+ 'export' => true,
+ 'allrows' => true
+ ))
+ );
+
+ $toolbar[] = array(
+ 'name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'rental.uicomposite.edit'
+ )),
+ 'parameters' => $parameters
+ );
+
+ $toolbar[] = array(
+ 'name' => 'view',
+ 'text' => lang('show'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'rental.uicomposite.view'
+ )),
+ 'parameters' => $parameters
+ );
+
+ $contract_types =
rental_socontract::get_instance()->get_fields_of_responsibility();
+
+ $valid_contract_types = array();
+ if (isset($this->config->config_data['contract_types'])
&& is_array($this->config->config_data['contract_types']))
+ {
+ foreach
($this->config->config_data['contract_types'] as $_key => $_value)
+ {
+ if ($_value)
+ {
+ $valid_contract_types[] =
$_value;
+ }
+ }
+ }
+
+ $create_types = array();
+ foreach ($contract_types as $id => $label)
+ {
+ if ($valid_contract_types && !in_array($id,
$valid_contract_types))
+ {
+ continue;
+ }
+
+ $names = $this->locations->get_name($id);
+ if ($names['appname'] ==
$GLOBALS['phpgw_info']['flags']['currentapp'])
+ {
+ if
($this->hasPermissionOn($names['location'], PHPGW_ACL_ADD))
+ {
+ $create_types[] = array($id,
$label);
+ }
+ }
+ }
+
+ foreach ($create_types as $create_type)
+ {
+ $toolbar[] = array
+ (
+ 'name' => $create_type[1],
+ 'text' => lang('create_contract_' .
$create_type[1]),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'rental.uicontract.add_from_composite',
+ 'responsibility_id' =>
$create_type[0]
+ )),
+ 'attributes' => array(
+ 'class' => 'create_type'
+ ),
+ 'parameters' => $parameters
+ );
+ }
+
+ $schedule['composite_id'] = $composite_id;
+ $schedule['date'] = $date;
+ $schedule['picker_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi', 'cal');
+ $schedule['toolbar'] = json_encode($toolbar);
+
+ $data['schedule'] = $schedule;
+
+ phpgwapi_jquery::load_widget("datepicker");
phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
phpgwapi_jquery::load_widget('autocomplete');
+ self::add_javascript('rental','rental','schedule.js');
self::add_javascript('rental', 'rental',
'application.edit.js');
- self::render_template_xsl(array('application',
'datatable_inline'), array($mode => $data));
+ self::render_template_xsl(array('application',
'datatable_inline', 'rental_schedule'), array($mode => $data));
}
/*
* To be removed
Modified: branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
2016-09-08 15:07:45 UTC (rev 15631)
+++ branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
2016-09-08 23:24:39 UTC (rev 15632)
@@ -37,7 +37,7 @@
$this->config->read();
}
- private function _get_filters()
+ public function get_filters()
{
$filters = array();
@@ -454,7 +454,7 @@
)
);
- $filters = $this->_get_Filters();
+ $filters = $this->get_Filters();
krsort($filters);
foreach ($filters as $filter)
{
@@ -1127,7 +1127,7 @@
$editable = phpgw::get_var('editable', 'bool');
$type = 'all_composites';
- $filters = $this->_get_filters();
+ $filters = $this->get_filters();
$schedule['filters'] = $filters;
@@ -1245,12 +1245,12 @@
$schedule['date'] = $date;
$schedule['picker_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi', 'cal');
$schedule['toolbar'] = json_encode($toolbar);
-
+ $data['schedule'] = $schedule;
self::add_javascript('rental','rental','schedule.js');
phpgwapi_jquery::load_widget("datepicker");
- self::render_template_xsl(array('schedule'),
array('schedule' => $schedule));
+ self::render_template_xsl(array('schedule',
'rental_schedule'), array('schedule' => $data));
}
public function get_schedule ()
Modified: branches/dev-syncromind-2/rental/js/rental/schedule.js
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/schedule.js 2016-09-08
15:07:45 UTC (rev 15631)
+++ branches/dev-syncromind-2/rental/js/rental/schedule.js 2016-09-08
23:24:39 UTC (rev 15632)
@@ -221,6 +221,7 @@
var button = document.createElement('button');
button.innerHTML = text;
+ button.classList.add('toolbar_button')
if (parameters)
{
Modified: branches/dev-syncromind-2/rental/templates/base/application.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/application.xsl
2016-09-08 15:07:45 UTC (rev 15631)
+++ branches/dev-syncromind-2/rental/templates/base/application.xsl
2016-09-08 23:24:39 UTC (rev 15632)
@@ -424,6 +424,9 @@
</xsl:for-each>
</div>
</div>
+ <xsl:call-template
name="rental_schedule">
+ <xsl:with-param
name="schedule" select ='./schedule'/>
+ </xsl:call-template>
</fieldset>
</div>
</xsl:if>
Added: branches/dev-syncromind-2/rental/templates/base/rental_schedule.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/rental_schedule.xsl
(rev 0)
+++ branches/dev-syncromind-2/rental/templates/base/rental_schedule.xsl
2016-09-08 23:24:39 UTC (rev 15632)
@@ -0,0 +1,195 @@
+<xsl:template name="rental_schedule">
+ <xsl:param name="schedule" />
+
+ <style typ="text/css" rel="stylesheet">
+ #schedule_container tbody tr th {background: #eee none repeat
scroll 0 0;}
+ #schedule_toolbar {margin-bottom: 10px;}
+ #week-selector {list-style: outside none none;display:
inline-block;vertical-align: middle;}
+ #week-selector li {display: inline-block;vertical-align:
middle;}
+ #cal_container {margin: 0 20px;}
+ #cal_container #datepicker {width: 2px;opacity: 0;position:
absolute;display:none;}
+ #cal_container #numberWeek {width: 20px;display: inline-block;}
+ #schedule_container {display: inline-block;position: relative;}
+ #scheduleSearchBox {display: inline-block; vertical-align:
middle;}
+ #scheduleSearchBox label {margin-right: 5px;
margin-left: 20px;}
+ #scheduleSearchBox #txtSearchSchedule {}
+ .schedule_paginate#schedule-container_paginate {bottom:
-50px;position: absolute;right: 0;}
+ .schedule_paginate#schedule-container_paginate .ellipsis
{padding: 0 1em;}
+ .paginate_button {border: 1px solid transparent;border-radius:
2px;box-sizing: border-box;color: #333 !important;cursor: pointer;display:
inline-block;margin-left: 2px;min-width: 1.5em;padding: 0.5em 1em;text-align:
center;text-decoration: none !important;}
+ .paginate_button:hover {background: rgba(0, 0, 0, 0)
linear-gradient(to bottom, #585858 0%, #111 100%) repeat scroll 0 0;border: 1px
solid #111;color: white !important;}
+ .paginate_button:active {background: rgba(0, 0, 0, 0)
linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%) repeat scroll 0
0;box-shadow: 0 0 3px #111 inset;outline: medium none;}
+ .paginate_button.disabled,
+ .paginate_button.disabled:hover,
+ .paginate_button.disabled:active {background: transparent none
repeat scroll 0 0;border: 1px solid transparent;box-shadow: none;color: #666
!important;cursor: default;}
+ .paginate_button.previous {}
+ .paginate_button.next {}
+ .paginate_button.current,
+ .paginate_button.current:hover {background: rgba(0, 0, 0, 0)
linear-gradient(to bottom, white 0%, #dcdcdc 100%) repeat scroll 0 0;border:
1px solid #979797;color: #333 !important;}
+ tr.trselected td, tr.trselected th {background-color: #acbad4
!important;}
+ .toolbar_button {-moz-user-select: none;background-color:
#e9e9e9;background-image: linear-gradient(to bottom, white 0%, #e9e9e9
100%);border: 1px solid #999;border-radius: 2px;box-sizing: border-box;color:
black;cursor: pointer;display: inline-block;font-size: 0.88em;margin-right:
0.333em;outline: medium none;overflow: hidden;padding: 0.5em 1em;position:
relative;text-decoration: none;white-space: nowrap;font-weight:
normal;box-shadow: none;}
+ .toolbar_button[disabled] {background-color:
#f9f9f9;background-image: linear-gradient(to bottom, #ffffff 0%, #f9f9f9
100%);border: 1px solid #d0d0d0;color: #999;cursor: default;}
+ .toolbar_button:hover:not([disabled]) {background-color:
#e0e0e0;background-image: linear-gradient(to bottom, #f9f9f9 0%, #e0e0e0
100%);border: 1px solid #666;}
+ .toolbar_button:active:not([disabled]) {background-color:
#e2e2e2;background-image: linear-gradient(to bottom, #f3f3f3 0%, #e2e2e2
100%);box-shadow: 1px 1px 3px #999999 inset;}
+ .toolbar_button:focus:not([disabled]) {background-color:
#79ace9;background-image: linear-gradient(to bottom, #bddef4 0%, #79ace9
100%);border: 1px solid #426c9e;outline: medium none;text-shadow: 0 1px 0
#c4def1;}
+ </style>
+ <div id="contract_schedule">
+ <div id="shceduleFilters">
+ <div id="queryForm">
+ <style scoped="scoped" type="text/css"
id="toggle-box-css">
+ .toggle-box {display: none;}
+ .toggle-box + label {cursor:
pointer;display: block;font-weight: bold;line-height: 21px;margin-bottom: 5px;}
+ .toggle-box + label + #toolbar
{display: none;margin-bottom: 10px;}
+ .toggle-box:checked + label + #toolbar
{display: block;}
+ .toggle-box + label:before
{background-color: #4F5150;-webkit-border-radius: 10px;-moz-border-radius:
10px;border-radius: 10px;color: #FFFFFF;content: "+";display: block;float:
left;font-weight: bold;height: 20px;line-height: 20px;margin-right:
5px;text-align: center;width: 20px;}
+ .toggle-box:checked + label:before
{content: "\2212";}
+ </style>
+ <input type="checkbox" id="header1"
class="toggle-box" />
+ <label for="header1">Filter</label>
+ <div id="toolbar"
class="dtable_custom_controls">
+ <table class="pure-table
pure-table-horizontal" id="toolbar_table">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>!item</th>
+ </tr>
+ </thead>
+ <tbody>
+ <script
type="text/javascript">
+ schedule.params
= {};
+ </script>
+ <xsl:for-each
select="schedule/filters">
+ <tr>
+
<td><xsl:value-of select="text" /></td>
+ <td>
+
<xsl:variable name="name">
+
<xsl:value-of select="name"/>
+
</xsl:variable>
+
<xsl:if test="type = 'filter'">
+
<select id="{$name}" name="{$name}" class="searchSchedule" width="250"
style="width: 250px">
+
<xsl:for-each select="list">
+
<xsl:variable name="id">
+
<xsl:value-of select="id"/>
+
</xsl:variable>
+
<xsl:choose>
+
<xsl:when test="id = 'NEW'">
+
<option value="{$id}"
selected="selected">
+
<xsl:value-of select="name"/>
+
</option>
+
</xsl:when>
+
<xsl:otherwise>
+
<xsl:choose>
+
<xsl:when test="selected =
'selected'">
+
<option value="{$id}"
selected="selected">
+
<xsl:value-of
select="name"/>
+
</option>
+
</xsl:when>
+
<xsl:when test="selected = '1'">
+
<option value="{$id}"
selected="selected">
+
<xsl:value-of
select="name"/>
+
</option>
+
</xsl:when>
+
<xsl:otherwise>
+
<option value="{$id}">
+
<xsl:value-of
select="name"/>
+
</option>
+
</xsl:otherwise>
+
</xsl:choose>
+
</xsl:otherwise>
+
</xsl:choose>
+
</xsl:for-each>
+
</select>
+
</xsl:if>
+ </td>
+ </tr>
+ <script
type="text/javascript">
+
schedule.params.<xsl:value-of select="name"/> = $('select#<xsl:value-of
select="name"/>').val();
+
$('select#<xsl:value-of select="name"/>').change( function()
+ {
+
schedule.params.<xsl:value-of select="name"/> = $(this).val();
+ });
+ </script>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ <ul id="week-selector">
+ <li>
+ <span class="pure-button pure-button-primary"
onclick="schedule.prevWeek(); return false">
+ <xsl:value-of
select="php:function('lang', 'Previous week')"/>
+ </span>
+ </li>
+ <li id="cal_container">
+ <div>
+ <span>
+ <xsl:value-of
select="php:function('lang', 'Week')" />: </span>
+ <label id="numberWeek"></label>
+ <input type="text" id="datepicker" />
+ <img id="pickerImg"
src="{schedule/picker_img}" />
+ </div>
+ </li>
+ <li>
+ <span class="pure-button pure-button-primary"
onclick="schedule.nextWeek(); return false">
+ <xsl:value-of
select="php:function('lang', 'Next week')"/>
+ </span>
+ </li>
+ </ul>
+ <p id="scheduleSearchBox">
+ <label for="txtSearchSchedule">Search: </label>
+ <input type="text" id="txtSearchSchedule"
class="searchSchedule" />
+ </p>
+ <div id="schedule_container"></div>
+ <p>
+ <label for="cboNObjects">Show</label>
+ <select name="cboNObjects" id="cboNObjects"
class="searchSchedule">
+ <option selected="selected"
value="15">15</option>
+ <option value="30">30</option>
+ <option value="45">45</option>
+ <option value="0">All</option>
+ </select>
+ <label for="cboNObjects">Entries</label>
+ <script type="text/javascript">
+ schedule.params.n_objects =
$('select#cboNObjects').val();
+ $('select#cboNObjects').change( function()
+ {
+ schedule.params.length = $(this).val();
+ });
+ </script>
+ </p>
+ </div>
+ <script type="text/javascript">
+ var composite_id = '<xsl:value-of
select="schedule/composite_id"/>';
+ schedule.rental = {};
+ $(window).load(function() {
+
+ schedule.params.length = $('#cboNObjects').val();
+ schedule.params.search = $('#txtSearchSchedule').val();
+ schedule.params.start = 0;
+
+ schedule.setupWeekPicker('cal_container');
+
+ var img_src = '<xsl:value-of
select="schedule/picker_img"/>';
+ //var composite_id = '<xsl:value-of
select="schedule/composite_id"/>';
+
+ schedule.datasourceUrl = '<xsl:value-of
select="schedule/datasource_url"/>';
+ var initialRequest = getUrlData("date") ||
'<xsl:value-of select="schedule/date"/>';
+
+ schedule.includeResource = false;
+ schedule.colFormatter = 'rentalSchedule';
+ var handleHistoryNavigation = function (state) {
+ schedule.date = parseISO8601(state);
+ schedule.renderSchedule('schedule_container',
schedule.datasourceUrl, schedule.date, schedule.colFormatter,
schedule.includeResource);
+ };
+
+ var state = getUrlData("date") || initialRequest;
+ if (state){
+ handleHistoryNavigation(state);
+ schedule.week =
$.datepicker.iso8601Week(schedule.date);
+ $('#cal_container
#numberWeek').text(schedule.week);
+ $("#cal_container
#datepicker").datepicker("setDate", parseISO8601(state));
+ }
+ schedule.toolbar = <xsl:value-of
select="schedule/toolbar" />;
+ });
+ </script>
+</xsl:template>
\ No newline at end of file
Modified: branches/dev-syncromind-2/rental/templates/base/schedule.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/schedule.xsl
2016-09-08 15:07:45 UTC (rev 15631)
+++ branches/dev-syncromind-2/rental/templates/base/schedule.xsl
2016-09-08 23:24:39 UTC (rev 15632)
@@ -3,197 +3,11 @@
<xsl:when test="schedule">
<xsl:apply-templates select="schedule"/>
</xsl:when>
- <xsl:when test="view">
- <xsl:apply-templates select="view"/>
- </xsl:when>
</xsl:choose>
</xsl:template>
-<xsl:template xmlns:php="http://php.net/xsl" match="schedule">
- <style typ="text/css" rel="stylesheet">
- #schedule_container tbody tr th {background: #eee none repeat
scroll 0 0;}
- #schedule_toolbar {margin-bottom: 10px;}
- #week-selector {list-style: outside none none;display:
inline-block;vertical-align: middle;}
- #week-selector li {display: inline-block;vertical-align:
middle;}
- #cal_container {margin: 0 20px;}
- #cal_container #datepicker {width: 2px;opacity: 0;position:
absolute;display:none;}
- #cal_container #numberWeek {width: 20px;display: inline-block;}
- #schedule_container {display: inline-block;position: relative;}
- #scheduleSearchBox {display: inline-block; vertical-align:
middle;}
- #scheduleSearchBox label {margin-right: 5px;
margin-left: 20px;}
- #scheduleSearchBox #txtSearchSchedule {}
- .schedule_paginate#schedule-container_paginate {bottom:
-50px;position: absolute;right: 0;}
- .schedule_paginate#schedule-container_paginate .ellipsis
{padding: 0 1em;}
- .paginate_button {border: 1px solid transparent;border-radius:
2px;box-sizing: border-box;color: #333 !important;cursor: pointer;display:
inline-block;margin-left: 2px;min-width: 1.5em;padding: 0.5em 1em;text-align:
center;text-decoration: none !important;}
- .paginate_button:hover {background: rgba(0, 0, 0, 0)
linear-gradient(to bottom, #585858 0%, #111 100%) repeat scroll 0 0;border: 1px
solid #111;color: white !important;}
- .paginate_button:active {background: rgba(0, 0, 0, 0)
linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%) repeat scroll 0
0;box-shadow: 0 0 3px #111 inset;outline: medium none;}
- .paginate_button.disabled,
- .paginate_button.disabled:hover,
- .paginate_button.disabled:active {background: transparent none
repeat scroll 0 0;border: 1px solid transparent;box-shadow: none;color: #666
!important;cursor: default;}
- .paginate_button.previous {}
- .paginate_button.next {}
- .paginate_button.current,
- .paginate_button.current:hover {background: rgba(0, 0, 0, 0)
linear-gradient(to bottom, white 0%, #dcdcdc 100%) repeat scroll 0 0;border:
1px solid #979797;color: #333 !important;}
- tr.trselected td, tr.trselected th {background-color: #acbad4
!important;}
- </style>
- <div id="contract_schedule">
- <div id="shceduleFilters">
- <div id="queryForm">
- <style scoped="scoped" type="text/css"
id="toggle-box-css">
- .toggle-box {display: none;}
- .toggle-box + label {cursor:
pointer;display: block;font-weight: bold;line-height: 21px;margin-bottom: 5px;}
- .toggle-box + label + #toolbar
{display: none;margin-bottom: 10px;}
- .toggle-box:checked + label + #toolbar
{display: block;}
- .toggle-box + label:before
{background-color: #4F5150;-webkit-border-radius: 10px;-moz-border-radius:
10px;border-radius: 10px;color: #FFFFFF;content: "+";display: block;float:
left;font-weight: bold;height: 20px;line-height: 20px;margin-right:
5px;text-align: center;width: 20px;}
- .toggle-box:checked + label:before
{content: "\2212";}
- </style>
- <input type="checkbox" id="header1"
class="toggle-box" />
- <label for="header1">Filter</label>
- <div id="toolbar"
class="dtable_custom_controls">
- <table class="pure-table
pure-table-horizontal" id="toolbar_table">
- <thead>
- <tr>
- <th>Name</th>
- <th>!item</th>
- </tr>
- </thead>
- <tbody>
- <script
type="text/javascript">
- schedule.params
= {};
- </script>
- <xsl:for-each
select="filters">
- <tr>
-
<td><xsl:value-of select="text" /></td>
- <td>
-
<xsl:variable name="name">
-
<xsl:value-of select="name"/>
-
</xsl:variable>
-
<xsl:if test="type = 'filter'">
-
<select id="{$name}" name="{$name}" class="searchSchedule" width="250"
style="width: 250px">
-
<xsl:for-each select="list">
-
<xsl:variable name="id">
-
<xsl:value-of select="id"/>
-
</xsl:variable>
-
<xsl:choose>
-
<xsl:when test="id = 'NEW'">
-
<option value="{$id}"
selected="selected">
-
<xsl:value-of select="name"/>
-
</option>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:choose>
-
<xsl:when test="selected =
'selected'">
-
<option value="{$id}"
selected="selected">
-
<xsl:value-of
select="name"/>
-
</option>
-
</xsl:when>
-
<xsl:when test="selected = '1'">
-
<option value="{$id}"
selected="selected">
-
<xsl:value-of
select="name"/>
-
</option>
-
</xsl:when>
-
<xsl:otherwise>
-
<option value="{$id}">
-
<xsl:value-of
select="name"/>
-
</option>
-
</xsl:otherwise>
-
</xsl:choose>
-
</xsl:otherwise>
-
</xsl:choose>
-
</xsl:for-each>
-
</select>
-
</xsl:if>
- </td>
- </tr>
- <script
type="text/javascript">
-
schedule.params.<xsl:value-of select="name"/> = $('select#<xsl:value-of
select="name"/>').val();
-
$('select#<xsl:value-of select="name"/>').change( function()
- {
-
schedule.params.<xsl:value-of select="name"/> = $(this).val();
- });
- </script>
- </xsl:for-each>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <ul id="week-selector">
- <li>
- <span class="pure-button pure-button-primary"
onclick="schedule.prevWeek(); return false">
- <xsl:value-of
select="php:function('lang', 'Previous week')"/>
- </span>
- </li>
- <li id="cal_container">
- <div>
- <span>
- <xsl:value-of
select="php:function('lang', 'Week')" />: </span>
- <label id="numberWeek"></label>
- <input type="text" id="datepicker" />
- <img id="pickerImg" src="{picker_img}"
/>
- </div>
- </li>
- <li>
- <span class="pure-button pure-button-primary"
onclick="schedule.nextWeek(); return false">
- <xsl:value-of
select="php:function('lang', 'Next week')"/>
- </span>
- </li>
- </ul>
- <p id="scheduleSearchBox">
- <label for="txtSearchSchedule">Search: </label>
- <input type="text" id="txtSearchSchedule"
class="searchSchedule" />
- </p>
- <div id="schedule_container"></div>
- <p>
- <label for="cboNObjects">Show</label>
- <select name="cboNObjects" id="cboNObjects"
class="searchSchedule">
- <option selected="selected"
value="15">15</option>
- <option value="30">30</option>
- <option value="45">45</option>
- <option value="0">All</option>
- </select>
- <label for="cboNObjects">Entries</label>
- <script type="text/javascript">
- schedule.params.n_objects =
$('select#cboNObjects').val();
- $('select#cboNObjects').change( function()
- {
- schedule.params.length = $(this).val();
- });
- </script>
- </p>
- </div>
- <script type="text/javascript">
- var composite_id = '<xsl:value-of select="composite_id"/>';
- schedule.rental = {};
- $(window).load(function() {
-
- schedule.params.length = $('#cboNObjects').val();
- schedule.params.search = $('#txtSearchSchedule').val();
- schedule.params.start = 0;
-
- schedule.setupWeekPicker('cal_container');
-
- var img_src = '<xsl:value-of select="picker_img"/>';
- //var composite_id = '<xsl:value-of
select="composite_id"/>';
-
- schedule.datasourceUrl = '<xsl:value-of
select="datasource_url"/>';
- var initialRequest = getUrlData("date") ||
'<xsl:value-of select="date"/>';
-
- schedule.includeResource = false;
- schedule.colFormatter = 'rentalSchedule';
- var handleHistoryNavigation = function (state) {
- schedule.date = parseISO8601(state);
- schedule.renderSchedule('schedule_container',
schedule.datasourceUrl, schedule.date, schedule.colFormatter,
schedule.includeResource);
- };
-
- var state = getUrlData("date") || initialRequest;
- if (state){
- handleHistoryNavigation(state);
- schedule.week =
$.datepicker.iso8601Week(schedule.date);
- $('#cal_container
#numberWeek').text(schedule.week);
- $("#cal_container
#datepicker").datepicker("setDate", parseISO8601(state));
- }
- schedule.toolbar = <xsl:value-of select="toolbar" />;
- });
- </script>
+<xsl:template xmlns:php="http://php.net/xsl" match="schedule" name="schedule">
+ <xsl:call-template name="rental_schedule">
+ <xsl:with-param name="schedule" select ='schedule'/>
+ </xsl:call-template>
</xsl:template>
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15632],
saul . huanay <=