[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15517]
From: |
saul . huanay |
Subject: |
[Fmsystem-commits] [15517] |
Date: |
Sat, 27 Aug 2016 00:42:55 +0000 (UTC) |
Revision: 15517
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15517
Author: psaul
Date: 2016-08-27 00:42:54 +0000 (Sat, 27 Aug 2016)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind-2/rental/inc/class.socomposite.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/schedule.xsl
Modified: branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
2016-08-26 13:01:17 UTC (rev 15516)
+++ branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
2016-08-27 00:42:54 UTC (rev 15517)
@@ -518,7 +518,7 @@
return $uicols;
}
- public function get_schedule ($composite_id, $date)
+ public function get_schedule ($date, $filters, $options)
{
//$date = new DateTime('2016-8-24');
//$date = new DateTime(phpgw::get_var('date'));
@@ -547,11 +547,11 @@
}
/*----------------------------------------------------------------*/
- $filters = array(
- rental_socomposite::get_id_field_name() =>
$composite_id
- );
+// $filters = array(
+// rental_socomposite::get_id_field_name() =>
$composite_id
+// );
- $contracts = rental_socontract::get_instance()->get(0,
30, '', false, '', 'all', $filters);
+ $contracts =
rental_socontract::get_instance()->get($options['start_index'],
$options['num_of_objects'], $options['sort_field'], $options['ascending'],
$options['search_for'], $options['search_type'], $filters);
$data_contracts = array();
foreach ($contracts as $contract)
Modified: branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
2016-08-26 13:01:17 UTC (rev 15516)
+++ branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
2016-08-27 00:42:54 UTC (rev 15517)
@@ -1114,10 +1114,11 @@
}
$schedule['datasource_url'] = self::link(array(
- 'menuaction' => 'rental.uicomposite.get_schedule',
+ 'menuaction' => 'rental.uicomposite.get_schedule',
'id' => $composite_id,
'phpgw_return_as' => 'json'
- ));
+ ));
+ $schedule['composite_id'] = $composite_id;
$schedule['date'] = $date;
$schedule['picker_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi', 'cal');
@@ -1132,8 +1133,29 @@
public function get_schedule () {
$composite_id = (int)phpgw::get_var('id');
$date = new DateTime(phpgw::get_var('date'));
+
+ $filters = array();
+ $options = array();
+
+ if (phpgw::get_var('composite_id'))
+ $filters['composite_id'] = phpgw::get_var('composite_id');
+
+ if (phpgw::get_var('contract_status'))
+ $filters['contract_status'] =
phpgw::get_var('contract_status');
+
+ if (phpgw::get_var('contract_type'))
+ $filters['contract_type'] = phpgw::get_var('contract_type');
- $schedule =
rental_socomposite::get_instance()->get_schedule($composite_id, $date);
+ $options['start_index'] = 0;
+ $options['num_of_objects'] = (phpgw::get_var('n_objects')) ?
phpgw::get_var('n_objects') : 30;
+ $options['sort_field'] = '';
+ $options['ascending'] = false;
+ $options['search_for'] = (phpgw::get_var('search')) ?
phpgw::get_var('search') : '' ;
+ $options['search_type'] = (phpgw::get_var('search_option')) ?
phpgw::get_var('search_option') : 'all';
+
+ //$filter['location_id'] = phpgw::get_var('location_id');
+
+ $schedule =
rental_socomposite::get_instance()->get_schedule($date, $filters, $options);
$data = array(
'ResultSet' => array(
Modified: branches/dev-syncromind-2/rental/js/rental/schedule.js
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/schedule.js 2016-08-26
13:01:17 UTC (rev 15516)
+++ branches/dev-syncromind-2/rental/js/rental/schedule.js 2016-08-27
00:42:54 UTC (rev 15517)
@@ -134,4 +134,49 @@
schedule.nextWeek = function ()
{
schedule.moveWeek(7)
-}
\ No newline at end of file
+}
+
+$(window).load(function() {
+ function searchSchedule () {
+ var location_id = $('#location_id').val();
+ var search_option = $('#search_option').val();
+ var contract_status = $('#contract_status').val();
+ var contract_type = $('#contract_type').val();
+ var search = $('#txtSearchSchedule').val();
+ var n_objects = $('#cboNObjects').val();
+
+ var args = {
+ menuaction: 'rental.uicomposite.get_schedule',
+ composite_id: composite_id,
+ location_id: location_id,
+ search_option: search_option,
+ contract_status: contract_status,
+ contract_type: contract_type,
+ search: search,
+ n_objects: n_objects
+ }
+
+ var new_url = phpGWLink('index.php', args, true);
+
+ schedule.renderSchedule('schedule_container', new_url, schedule.date,
schedule.colFormatter, schedule.includeResource);
+
+ //console.log(new_url);
+
+ //console.log(location_id + ' / ' + search_option + ' / ' +
contract_status + ' / ' + contract_type + ' / ' + txtSearchSchedule);
+ }
+
+ $('select.searchSchedule').on('change', function() {
+ searchSchedule();
+ });
+ $('input.searchSchedule').on('keyup', function() {
+ var $this = $(this);
+ if ($this.data('text') != $this.val()) {
+ setTimeout(function(){
+ $this.data('text', $this.val());
+ searchSchedule();
+ }, 500);
+ }
+ });
+})
+
+
Modified: branches/dev-syncromind-2/rental/templates/base/schedule.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/schedule.xsl
2016-08-26 13:01:17 UTC (rev 15516)
+++ branches/dev-syncromind-2/rental/templates/base/schedule.xsl
2016-08-27 00:42:54 UTC (rev 15517)
@@ -11,13 +11,86 @@
<xsl:template xmlns:php="http://php.net/xsl" match="schedule">
<style typ="text/css" rel="stylesheet">
- #week-selector {list-style: outside none none;}
- #week-selector li {display: inline-block;}
+ #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;}
+ #scheduleSearchBox {display: inline-block; vertical-align: middle;}
+ #scheduleSearchBox label {margin-right: 5px; margin-left: 20px;}
+ #scheduleSearchBox #txtSearchSchedule {}
</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>
+ <tr>
+ <td><label
for="location_id">!t_new_contract</label></td>
+ <td valign="top">
+ <select style="width: 250px" width="250"
name="location_id" id="location_id" class="searchSchedule">
+ <option
value="838">!contract_type_eksternleie</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label
for="search_option">!search_where</label></td>
+ <td valign="top">
+ <select style="width: 250px" width="250"
name="search_option" id="search_option" class="searchSchedule">
+ <option value="all">All</option>
+ <option
value="id">!contract_id</option>
+ <option
value="party_name">!party_name</option>
+ <option
value="composite">!composite_name</option>
+ <option
value="composite_address">!composite_address</option>
+ <option
value="location_code">!object_number</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label
for="contract_status">Status</label></td>
+ <td valign="top">
+ <select style="width: 250px" width="250"
name="contract_status" id="contract_status" class="searchSchedule">
+ <option value="all">All</option>
+ <option
value="under_planning">!under_planning</option>
+ <option
value="active">!active_plural</option>
+ <option
value="under_dismissal">!under_dismissal</option>
+ <option value="ended">!ended</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label
for="contract_type">!field_of_responsibility</label></td>
+ <td valign="top">
+ <select style="width: 250px" width="250"
name="contract_type" id="contract_type" class="searchSchedule">
+ <option value="all">All</option>
+ <option
value="836">!contract_type_internleie</option>
+ <option
value="837">!contract_type_innleie</option>
+ <option
value="838">!contract_type_eksternleie</option>
+ </select>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
<ul id="week-selector">
<li>
<span class="pure-button pure-button-primary"
onclick="schedule.prevWeek(); return false">
@@ -39,13 +112,29 @@
</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>
+ </p>
</div>
<script type="text/javascript">
+ var composite_id = '<xsl:value-of select="composite_id"/>';
$(window).load(function() {
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"/>';
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15517],
saul . huanay <=