[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17416] controller: more on controllerfrontend
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17416] controller: more on controllerfrontend |
Date: |
Fri, 8 Dec 2017 14:25:00 -0500 (EST) |
Revision: 17416
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17416
Author: sigurdne
Date: 2017-12-08 14:25:00 -0500 (Fri, 08 Dec 2017)
Log Message:
-----------
controller: more on controllerfrontend
Modified Paths:
--------------
trunk/controller/inc/class.socontrol.inc.php
trunk/controller/inc/class.uicomponent.inc.php
trunk/controller/js/controller/component.index.js
trunk/controller/templates/base/css/base.css
trunk/controller/templates/mobilefrontend/css/base.css
trunk/property/inc/class.controller_helper.inc.php
Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php 2017-12-08 15:36:10 UTC
(rev 17415)
+++ trunk/controller/inc/class.socontrol.inc.php 2017-12-08 19:25:00 UTC
(rev 17416)
@@ -789,19 +789,33 @@
$component_id = (int)$component_id;
$control_id = (int)$control_id;
- $sql = "SELECT DISTINCT ccl.component_id,
ccl.location_id";
- $sql .= " FROM controller_control_component_list ccl ,
controller_control_serie cs";
- $sql .= " WHERE ccl.id = cs.control_relation_id";
- $sql .= " AND cs.control_relation_type = 'component'";
- $sql .= " AND cs.assigned_to = {$assigned_to}";
- $sql .= " AND cs.enabled = 1";
-// $sql .= " AND ((cs.start_date <= $to_date AND
cs.end_date IS NULL) ";
-// $sql .= " OR (cs.start_date <= $to_date AND cs.end_date
> $from_date ))";
- $sql .= " AND cs.start_date <= $to_date";
+// $sql = "SELECT DISTINCT ccl.component_id,
ccl.location_id";
+// $sql .= " FROM controller_control_component_list ccl ,
controller_control_serie cs";
+// $sql .= " WHERE ccl.id = cs.control_relation_id";
+// $sql .= " AND cs.control_relation_type = 'component'";
+// $sql .= " AND cs.assigned_to = {$assigned_to}";
+// $sql .= " AND cs.enabled = 1";
+//// $sql .= " AND ((cs.start_date <= $to_date AND
cs.end_date IS NULL) ";
+//// $sql .= " OR (cs.start_date <= $to_date AND cs.end_date
> $from_date ))";
+// $sql .= " AND cs.start_date <= $to_date";
+//
+// if($control_id)
+// {
+// $sql .= " AND ccl.control_id = {$control_id}";
+// }
+//
+ $sql = "SELECT distinct
controller_control_component_list.component_id,
controller_control_component_list.location_id"
+ . " FROM controller_control_component_list"
+ . " {$this->left_join} controller_control_serie
ON (controller_control_component_list.id =
controller_control_serie.control_relation_id)"
+ . " {$this->left_join} controller_check_list ON
controller_control_serie.id = controller_check_list.serie_id"
+ . " WHERE
controller_control_serie.control_relation_type = 'component'"
+ . " AND (controller_control_serie.assigned_to =
{$assigned_to} OR controller_check_list.assigned_to = {$assigned_to})"
+ . " AND controller_control_serie.enabled = 1
AND controller_control_serie.start_date <= {$to_date}";
+
if($control_id)
{
- $sql .= " AND ccl.control_id = {$control_id}";
+ $sql .= " AND
controller_control_component_list.control_id = {$control_id}";
}
$this->db->query($sql, __LINE__, __FILE__);
Modified: trunk/controller/inc/class.uicomponent.inc.php
===================================================================
--- trunk/controller/inc/class.uicomponent.inc.php 2017-12-08 15:36:10 UTC
(rev 17415)
+++ trunk/controller/inc/class.uicomponent.inc.php 2017-12-08 19:25:00 UTC
(rev 17416)
@@ -339,12 +339,9 @@
array('id' => 'done_with_open_deviation',
'name' => lang('done with open deviation')),
);
- $filter_component = '';
- if (phpgw::get_var('component_id', 'int'))
- {
- $filter_component =
phpgw::get_var('location_id', 'int') . '_' . phpgw::get_var('component_id',
'int');
- }
+ $filter_component = phpgw::get_var('filter_component');
+
$control_types =
createObject('controller.socontrol')->get(0, 0, 'title', true, '', '', array());
$control_types_arr = array(array('id'=>'', 'name' =>
lang('select')));
@@ -847,7 +844,17 @@
if ($user_id < 0)
{
+ $all_items = false;
$user_id = $user_id * -1;
+ }
+
+ if($all_items)
+ {
+ $user_id = 0;
+ }
+
+ if ($user_id)
+ {
$all_items = false;
$keep_only_assigned_to = $user_id;
@@ -1093,6 +1100,12 @@
{
foreach
($calendar_array as $_month => $_month_info)
{
+
+
if($filter_month && $_month != $filter_month)
+ {
+
continue;
+ }
+
if
(isset($_month_info['info']['assigned_to']) &&
$_month_info['info']['assigned_to'] == $user_id)
{
$found_assigned_to = true;
@@ -1661,7 +1674,7 @@
{
$control_link = json_encode($control_link_data);
-
+
$lang_plan = lang('plan');
$lang_ok = lang('ok');
$lang_deviation = lang('deviation');
@@ -1668,31 +1681,49 @@
if ($param['status'] == 'CONTROL_REGISTERED')
{
$row['action_button'] = <<<HTML
- <button class="save_check_list
pure-button pure-button-primary" type="submit" name="save_check_list" onclick =
'perform_action("save_check_list", {$control_link});'>
- <i class="fa fa-floppy-o"
aria-hidden="true"></i>
- {$lang_plan}
- </button>
- <button class="submit_ok pure-button
pure-button-primary" type="submit" name="submit_ok" onclick =
'perform_action("submit_ok", {$control_link});'>
- <i class="fa fa-check-square-o"
aria-hidden="true"></i>
- {$lang_ok}
- </button>
- <button class="submit_deviation
pure-button pure-button-primary" type="submit" name="submit_deviation" onclick
= 'perform_action("submit_deviation", {$control_link});'>
- <i class="fa
fa-exclamation-triangle" aria-hidden="true"></i>
- {$lang_deviation}
- </button>
+ <div class="block">
+ <div class="centered">
+ <div>
+ <button class="save_check_list
pure-button pure-button-primary" type="submit" name="save_check_list" onclick =
'perform_action("save_check_list", {$control_link});'>
+ <i class="fa
fa-floppy-o" aria-hidden="true"></i>
+ {$lang_plan}
+ </button>
+ </div>
+ <div>
+ <button class="submit_ok
pure-button pure-button-primary" type="submit" name="submit_ok" onclick =
'perform_action("submit_ok", {$control_link});'>
+ <i class="fa
fa-check-square-o" aria-hidden="true"></i>
+ {$lang_ok}
+ </button>
+ </div>
+ <div>
+ <button class="submit_deviation
pure-button pure-button-primary" type="submit" name="submit_deviation" onclick
= 'perform_action("submit_deviation", {$control_link});'>
+ <i class="fa
fa-exclamation-triangle" aria-hidden="true"></i>
+ {$lang_deviation}
+ </button>
+ </div>
+ </div>
+ </div>
HTML;
}
else if ($param['status'] == 'CONTROL_PLANNED')
{
$row['action_button'] = <<<HTML
- <button class="submit_ok pure-button
pure-button-primary" type="submit" name="submit_ok" onclick =
'perform_action("submit_ok", {$control_link});'>
- <i class="fa fa-check-square-o"
aria-hidden="true"></i>
- {$lang_ok}
- </button>
- <button class="submit_deviation
pure-button pure-button-primary" type="submit" name="submit_deviation" onclick
= 'perform_action("submit_deviation", {$control_link});'>
- <i class="fa
fa-exclamation-triangle" aria-hidden="true"></i>
- {$lang_deviation}
- </button>
+ <div class="block">
+ <div class="centered">
+ <div>
+ <button class="submit_ok
pure-button pure-button-primary" type="submit" name="submit_ok" onclick =
'perform_action("submit_ok", {$control_link});'>
+ <i class="fa
fa-check-square-o" aria-hidden="true"></i>
+ {$lang_ok}
+ </button>
+ </div>
+ <div>
+ <button class="submit_deviation
pure-button pure-button-primary" type="submit" name="submit_deviation" onclick
= 'perform_action("submit_deviation", {$control_link});'>
+ <i class="fa
fa-exclamation-triangle" aria-hidden="true"></i>
+ {$lang_deviation}
+ </button>
+ </div>
+ </div>
+ </div>
HTML;
Modified: trunk/controller/js/controller/component.index.js
===================================================================
--- trunk/controller/js/controller/component.index.js 2017-12-08 15:36:10 UTC
(rev 17415)
+++ trunk/controller/js/controller/component.index.js 2017-12-08 19:25:00 UTC
(rev 17416)
@@ -440,22 +440,3 @@
}
};
-
-
-$(document).ready(function ()
-{
- $(".save_check_list_form").on("click", function (e)
- {
- alert('e');
- e.preventDefault();
- var thisForm = $(this);
- var requestUrl = $(thisForm).attr("action");
- alert(requestUrl);
- });
-
- $(".submit_ok").on("on", function (e)
- {
- alert('e');
- });
-
-});
\ No newline at end of file
Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css 2017-12-08 15:36:10 UTC
(rev 17415)
+++ trunk/controller/templates/base/css/base.css 2017-12-08 19:25:00 UTC
(rev 17416)
@@ -2368,3 +2368,48 @@
margin: 20px 0;
padding: 15px;
}
+
+.save_check_list
+{
+/* text-align: center;*/
+ width: 140px;
+}
+
+.submit_ok
+{
+ /* text-align: center;*/
+ background-color: #4CAF50;
+ width: 140px;
+}
+
+.submit_deviation {
+/* text-align: center;*/
+ background-color: #f44336;
+ width: 140px;
+}
+
+.pure-button
+{
+ width: 140px;
+}
+
+
+/* Can be any width and height */
+.block {
+ text-align: center;
+}
+
+/* The ghost, nudged to maintain perfect centering */
+.block:before {
+ content:'';
+ display: inline-block;
+ height: 100%;
+ vertical-align: middle;
+ margin-right: -0.25em; /* Adjusts for spacing */
+}
+
+/* The element to be centered, can be any width or height */
+.centered {
+ display: inline-block;
+ vertical-align: middle;
+}
\ No newline at end of file
Modified: trunk/controller/templates/mobilefrontend/css/base.css
===================================================================
--- trunk/controller/templates/mobilefrontend/css/base.css 2017-12-08
15:36:10 UTC (rev 17415)
+++ trunk/controller/templates/mobilefrontend/css/base.css 2017-12-08
19:25:00 UTC (rev 17416)
@@ -200,4 +200,25 @@
font-size: 17px;
font-weight: bold;
text-decoration: none;
+}
+
+
+/* Can be any width and height */
+.block {
+ text-align: center;
+}
+
+/* The ghost, nudged to maintain perfect centering */
+.block:before {
+ content:'';
+ display: inline-block;
+ height: 100%;
+ vertical-align: middle;
+ margin-right: -0.25em; /* Adjusts for spacing */
+}
+
+/* The element to be centered, can be any width or height */
+.centered {
+ display: inline-block;
+ vertical-align: middle;
}
\ No newline at end of file
Modified: trunk/property/inc/class.controller_helper.inc.php
===================================================================
--- trunk/property/inc/class.controller_helper.inc.php 2017-12-08 15:36:10 UTC
(rev 17415)
+++ trunk/property/inc/class.controller_helper.inc.php 2017-12-08 19:25:00 UTC
(rev 17416)
@@ -184,6 +184,7 @@
'menuaction' => $menuaction,
'location_id' => $location_id,
'component_id' => $id,
+ 'filter_component' =>
"{$location_id}_{$id}"
);
$entry['title_text'] = $entry['title'];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17416] controller: more on controllerfrontend,
sigurdne <=