[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [13431] more on controller
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [13431] more on controller |
Date: |
Sun, 14 Jun 2015 17:34:16 +0000 |
Revision: 13431
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13431
Author: sigurdne
Date: 2015-06-14 17:34:16 +0000 (Sun, 14 Jun 2015)
Log Message:
-----------
more on controller
Modified Paths:
--------------
trunk/controller/inc/class.uicase.inc.php
trunk/controller/inc/class.uicheck_list.inc.php
trunk/controller/inc/class.uicomponent.inc.php
trunk/controller/js/controller/check_list_update_status.js
trunk/controller/templates/base/case/create_case_message.xsl
trunk/controller/templates/base/case/view_case_message.xsl
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl
trunk/controller/templates/base/check_list/fragments/nav_control_plan.xsl
Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php 2015-06-14 17:33:35 UTC (rev
13430)
+++ trunk/controller/inc/class.uicase.inc.php 2015-06-14 17:34:16 UTC (rev
13431)
@@ -525,6 +525,8 @@
// $short_desc =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code(
$component_arr['location_code'] );
$component->set_xml_short_desc( $short_desc );
$component_array = $component->toArray();
@@ -728,6 +730,8 @@
// $short_desc =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code(
$component_arr['location_code'] );
$component->set_xml_short_desc( $short_desc );
$component_array = $component->toArray();
@@ -901,6 +905,8 @@
// $short_desc =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code(
$component_arr['location_code'] );
$component->set_xml_short_desc( $short_desc );
$component_array = $component->toArray();
@@ -1006,6 +1012,8 @@
// $short_desc =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code(
$component_arr['location_code'] );
$component->set_xml_short_desc( $short_desc );
$component_array = $component->toArray();
Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php 2015-06-14 17:33:35 UTC
(rev 13430)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2015-06-14 17:34:16 UTC
(rev 13431)
@@ -276,6 +276,8 @@
$short_desc = $location_name . '::' .
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code($component_arr['location_code']);
$component->set_xml_short_desc($short_desc);
@@ -291,13 +293,16 @@
$control =
$this->so_control->get_single($check_list->get_control_id());
- $responsible_user_id =
execMethod('property.soresponsible.get_responsible_user_id',
+ if(!$responsible_user_id =
phpgw::get_var('assigned_to', 'int'))
+ {
+ $responsible_user_id =
execMethod('property.soresponsible.get_responsible_user_id',
array
(
'responsibility_id' =>
$control->get_responsibility_id(),
'location_code' =>
$location_code
)
);
+ }
$year = date("Y", $deadline_ts);
$month_nr = date("n", $deadline_ts);
@@ -379,6 +384,8 @@
$short_desc = $location_name . '::' .
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code($component_arr['location_code']);
$component->set_xml_short_desc($short_desc);
$component_array = $component->toArray();
@@ -709,6 +716,8 @@
$short_desc = $location_name . '::' .
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
+ $component->set_id($component_id);
+ $component->set_location_id($location_id);
$component->set_location_code($component_arr['location_code']);
$component->set_xml_short_desc($short_desc);
$component_array = $component->toArray();
@@ -879,7 +888,7 @@
{
if(!$this->add && !$this->edit)
{
- return json_encode( array( "status" =>
'not_saved') );
+ return json_encode( array( "status" =>
'not_saved', 'message' => '') );
}
$check_list_id = phpgw::get_var('check_list_id');
@@ -888,7 +897,23 @@
$check_list = $this->so->get_single($check_list_id);
if ( !$this->_check_for_required($check_list) )
{
- return json_encode( array( "status" =>
'not_saved') );
+ $messages = phpgwapi_cache::message_get(true);
+ $message = '';
+ foreach($messages as $_type => $_message)
+ {
+ if($_type == 'error')
+ {
+ foreach($_message as $__message)
+ {
+ // $message.=
strip_tags($__message['msg']);
+ $message.=
preg_replace("/<\/br[^>]*>\s*\r*\n*/is", "\n", $__message['msg']);
+
+ }
+ }
+
+ }
+ return json_encode( array( "status" =>
'not_saved', 'message' => $message) );
+
}
if($check_list_status ==
controller_check_list::STATUS_DONE)
@@ -909,7 +934,7 @@
}
else
{
- return json_encode( array( "status" =>
'not_saved') );
+ return json_encode( array( "status" =>
'not_saved', 'message' => '') );
}
}
Modified: trunk/controller/inc/class.uicomponent.inc.php
===================================================================
--- trunk/controller/inc/class.uicomponent.inc.php 2015-06-14 17:33:35 UTC
(rev 13430)
+++ trunk/controller/inc/class.uicomponent.inc.php 2015-06-14 17:34:16 UTC
(rev 13431)
@@ -306,62 +306,62 @@
),
array(
'key' => '1',
- 'label' => lang('month 1'),
+ 'label' => lang('short_month 1
capitalized'),
'sortable' => true,
),
array(
'key' => '2',
- 'label' => lang('month 2'),
+ 'label' => lang('short_month 2
capitalized'),
'sortable' => true,
),
array(
'key' => '3',
- 'label' => lang('month 3'),
+ 'label' => lang('short_month 3
capitalized'),
'sortable' => true,
),
array(
'key' => '4',
- 'label' => lang('month 4'),
+ 'label' => lang('short_month 4
capitalized'),
'sortable' => true,
),
array(
'key' => '5',
- 'label' => lang('month 5'),
+ 'label' => lang('short_month 5
capitalized'),
'sortable' => true,
),
array(
'key' => '6',
- 'label' => lang('month 6'),
+ 'label' => lang('short_month 6
capitalized'),
'sortable' => true,
),
array(
'key' => '7',
- 'label' => lang('month 7'),
+ 'label' => lang('short_month 7
capitalized'),
'sortable' => true,
),
array(
'key' => '8',
- 'label' => lang('month 8'),
+ 'label' => lang('short_month 8
capitalized'),
'sortable' => true,
),
array(
'key' => '9',
- 'label' => lang('month 9'),
+ 'label' => lang('short_month 9
capitalized'),
'sortable' => true,
),
array(
'key' => '10',
- 'label' => lang('month 10'),
+ 'label' => lang('short_month
10 capitalized'),
'sortable' => true,
),
array(
'key' => '11',
- 'label' => lang('month 11'),
+ 'label' => lang('short_month
11 capitalized'),
'sortable' => true,
),
array(
'key' => '12',
- 'label' => lang('month 12'),
+ 'label' => lang('short_month
12 capitalized'),
'sortable' => true,
),
);
@@ -842,7 +842,7 @@
break;
case "CONTROL_DONE_WITH_ERRORS":
$status = "Utført med
{$param['info']['num_open_cases']} åpne avvik";
- $img = "<img height=\"15\"
src=\"controller/images/status_icon_yellow_ring.png\" title=\"{$status}\"/>
({$param['info']['num_open_cases']})";
+ $img = "<img height=\"15\"
src=\"controller/images/status_icon_red_empty.png\" title=\"{$status}\"/>
({$param['info']['num_open_cases']})";
break;
case "CONTROL_CANCELED":
$status = 'Kansellert';
@@ -863,6 +863,7 @@
else
{
$menuaction =
'controller.uicheck_list.add_check_list';
+ $a_date = "{$year}-{$month}-23";
$control_link_data = array
(
'menuaction' => $menuaction,
@@ -870,8 +871,9 @@
'location_id' =>
$param['info']['location_id'],
'component_id' =>
$param['info']['component_id'],
'serie_id' =>
$param['info']['serie_id'],
- 'deadline_ts' => mktime(23, 59, 00,
$month, date('t', $month), $year),
- 'type' =>
$param['info']['component_id'] ? 'component' : ''
+ 'deadline_ts' => mktime(23, 59, 00,
$month, date('t', strtotime($a_date)), $year),
+ 'type' =>
$param['info']['component_id'] ? 'component' : '',
+ 'assigned_to' =>
$param['info']['assigned_to']
);
}
$link = "<a
href=\"".$GLOBALS['phpgw']->link('/index.php',$control_link_data)."\"
target=\"_blank\">{$img}</a>";
Modified: trunk/controller/js/controller/check_list_update_status.js
===================================================================
--- trunk/controller/js/controller/check_list_update_status.js 2015-06-14
17:33:35 UTC (rev 13430)
+++ trunk/controller/js/controller/check_list_update_status.js 2015-06-14
17:34:16 UTC (rev 13431)
@@ -22,6 +22,11 @@
if (jsonObj.status == 'not_saved')
{
$(submitBnt).val("feil ved
lagring");
+ if (jsonObj.message)
+ {
+ alert(jsonObj.message);
+ }
+
}
else if (jsonObj.status == '1')
{
Modified: trunk/controller/templates/base/case/create_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/create_case_message.xsl
2015-06-14 17:33:35 UTC (rev 13430)
+++ trunk/controller/templates/base/case/create_case_message.xsl
2015-06-14 17:34:16 UTC (rev 13431)
@@ -23,43 +23,47 @@
</xsl:choose>
</div>
<div class="box-2 select-box">
- <a>
- <xsl:attribute name="href">
- <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_year' )" />
- <xsl:text>&year=</xsl:text>
- <xsl:value-of select="current_year"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:value-of
select="building_location_code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="location_array/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- Kontrollplan for bygg/eiendom (år)
- </a>
-
- <a class="last">
- <xsl:attribute name="href">
- <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_month' )" />
- <xsl:text>&year=</xsl:text>
- <xsl:value-of select="current_year"/>
- <xsl:text>&month=</xsl:text>
- <xsl:value-of
select="current_month_nr"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:value-of
select="building_location_code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="location_array/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- Kontrolplan for bygg/eiendom (måned)
- </a>
+ <xsl:choose>
+ <xsl:when test="type = 'component'">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicomponent.index' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="current_year"/>
+
<xsl:text>&location_id=</xsl:text>
+ <xsl:value-of
select="component_array/location_id"/>
+
<xsl:text>&component_id=</xsl:text>
+ <xsl:value-of
select="component_array/id"/>
+ </xsl:attribute>
+ Kontrollplan for komponent (år)
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_year' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="current_year"/>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:attribute>
+ Kontrollplan for bygg/eiendom (år)
+ </a>
+
+ <a class="last">
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_month' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="current_year"/>
+ <xsl:text>&month=</xsl:text>
+ <xsl:value-of
select="current_month_nr"/>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:attribute>
+ Kontrolplan for bygg/eiendom (måned)
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
</div>
<!-- ================== CHECKLIST TAB MENU
===================== -->
Modified: trunk/controller/templates/base/case/view_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/view_case_message.xsl 2015-06-14
17:33:35 UTC (rev 13430)
+++ trunk/controller/templates/base/case/view_case_message.xsl 2015-06-14
17:34:16 UTC (rev 13431)
@@ -24,43 +24,45 @@
</div>
<div class="box-2 select-box">
- <a>
- <xsl:attribute name="href">
- <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_year' )" />
- <xsl:text>&year=</xsl:text>
- <xsl:value-of select="current_year"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:value-of
select="building_location_code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="location_array/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- Vis kontrollplan (år)
- </a>
-
- <a class="last">
- <xsl:attribute name="href">
- <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_month' )" />
- <xsl:text>&year=</xsl:text>
- <xsl:value-of select="current_year"/>
- <xsl:text>&month=</xsl:text>
- <xsl:value-of
select="current_month_nr"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:value-of
select="building_location_code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="location_array/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- Vis kontrollplan (måned)
- </a>
+ <xsl:when test="type = 'component'">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicomponent.index' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="current_year"/>
+
<xsl:text>&location_id=</xsl:text>
+ <xsl:value-of
select="component_array/location_id"/>
+
<xsl:text>&component_id=</xsl:text>
+ <xsl:value-of
select="component_array/id"/>
+ </xsl:attribute>
+ Kontrollplan for komponent (år)
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_year' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="current_year"/>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:attribute>
+ Vis kontrollplan (år)
+ </a>
+
+ <a class="last">
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_month' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="current_year"/>
+ <xsl:text>&month=</xsl:text>
+ <xsl:value-of
select="current_month_nr"/>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:attribute>
+ Vis kontrollplan (måned)
+ </a>
+ </xsl:otherwise>
</div>
<!-- ================== CHECKLIST TAB MENU
===================== -->
Modified:
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl
===================================================================
---
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl
2015-06-14 17:33:35 UTC (rev 13430)
+++
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl
2015-06-14 17:34:16 UTC (rev 13431)
@@ -23,13 +23,13 @@
</xsl:choose>
</div>
- <div class="box-2 select-box">
- <xsl:call-template name="nav_control_plan" />
- </div>
+
<!-- ================== CHANGE STATUS FOR CHECKLIST
===================== -->
<xsl:choose>
<xsl:when test="check_list/id != 0">
+ <div class="box-2 select-box">
+ <xsl:call-template name="nav_control_plan" />
<xsl:variable name="action_url"><xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicheck_list.update_status,phpgw_return_as:json')"
/></xsl:variable>
<form id="update-check-list-status" class="done"
action="{$action_url}" method="post">
<input type="hidden"
name="check_list_id" value="{check_list/id}" />
@@ -64,9 +64,9 @@
</div>
-->
</form>
+ </div>
</xsl:when>
</xsl:choose>
-
<!-- ================== CHECKLIST TAB MENU
===================== -->
<xsl:choose>
<xsl:when test="count(check_list_type) = 0 or check_list_type !=
'add_check_list'">
Modified:
trunk/controller/templates/base/check_list/fragments/nav_control_plan.xsl
===================================================================
--- trunk/controller/templates/base/check_list/fragments/nav_control_plan.xsl
2015-06-14 17:33:35 UTC (rev 13430)
+++ trunk/controller/templates/base/check_list/fragments/nav_control_plan.xsl
2015-06-14 17:34:16 UTC (rev 13431)
@@ -1,42 +1,49 @@
<xsl:template name="nav_control_plan" xmlns:php="http://php.net/xsl">
- <xsl:variable name="session_url">&<xsl:value-of
select="php:function('get_phpgw_session_url')" /></xsl:variable>
+ <xsl:variable name="session_url">&
+ <xsl:value-of select="php:function('get_phpgw_session_url')" />
+ </xsl:variable>
- <a>
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
- <xsl:text>&year=</xsl:text>
- <xsl:value-of select="current_year"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:value-of select="building_location_code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="location_array/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="$session_url"/>
- </xsl:attribute>
- Vis kontrolplan for år
- </a>
- <a class="last">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
- <xsl:text>&year=</xsl:text>
- <xsl:value-of select="current_year"/>
- <xsl:text>&month=</xsl:text>
- <xsl:value-of select="current_month_nr"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:value-of select="building_location_code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="location_array/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="$session_url"/>
- </xsl:attribute>
- Vis kontrolplan for måned
- </a>
- </xsl:template>
\ No newline at end of file
+ <xsl:choose>
+ <xsl:when test="type = 'component'">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicomponent.index' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year"/>
+ <xsl:text>&location_id=</xsl:text>
+ <xsl:value-of
select="component_array/location_id"/>
+ <xsl:text>&component_id=</xsl:text>
+ <xsl:value-of
select="component_array/id"/>
+ </xsl:attribute>
+ Kontrollplan for komponent (år)
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_year' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:attribute>
+ Kontrollplan for bygg/eiendom (år)
+ </a>
+
+ <a class="last">
+ <xsl:attribute name="href">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicalendar.view_calendar_for_month' )" />
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year"/>
+ <xsl:text>&month=</xsl:text>
+ <xsl:value-of
select="current_month_nr"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:attribute>
+ Kontrolplan for bygg/eiendom (måned)
+ </a>
+
+ </xsl:otherwise>
+ </xsl:choose>
+
+</xsl:template>
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [13431] more on controller,
Sigurd Nes <=