[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10018] controller: use dateformat from userprefs, us
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10018] controller: use dateformat from userprefs, use generated url |
Date: |
Fri, 21 Sep 2012 11:30:40 +0000 |
Revision: 10018
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10018
Author: sigurdne
Date: 2012-09-21 11:30:40 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
controller: use dateformat from userprefs, use generated url
Modified Paths:
--------------
trunk/controller/inc/class.uicalendar.inc.php
trunk/controller/inc/class.uicase.inc.php
trunk/controller/inc/class.uicheck_list.inc.php
trunk/controller/templates/base/calendar/view_calendar_month.xsl
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
trunk/controller/templates/base/calendar/view_calendar_year.xsl
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
trunk/controller/templates/base/case/create_case_message.xsl
trunk/controller/templates/base/case/view_case_message.xsl
trunk/controller/templates/base/check_list/add_check_list.xsl
trunk/controller/templates/base/check_list/edit_check_list.xsl
trunk/controller/templates/base/check_list/view_cases_for_check_list.xsl
trunk/controller/templates/base/check_list/view_check_list.xsl
trunk/controller/templates/base/check_list/view_check_lists.xsl
trunk/controller/templates/base/check_list/view_control_details.xsl
trunk/controller/templates/base/check_list/view_control_info.xsl
Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php 2012-09-21 11:30:07 UTC
(rev 10017)
+++ trunk/controller/inc/class.uicalendar.inc.php 2012-09-21 11:30:40 UTC
(rev 10018)
@@ -570,13 +570,14 @@
$location_with_check_lists =
$this->so->get_check_lists_for_control_and_location($control_id,
$curr_location_code, $from_date_ts, $to_date_ts, $control->get_repeat_type());
$check_lists_array =
$location_with_check_lists["check_lists_array"];
-
- $month_calendar = new month_calendar($control,
$year, $month, null, $location_code, "location");
+
+
+ $month_calendar = new month_calendar($control,
$year, $month, null, $curr_location_code, "location");
$calendar_array =
$month_calendar->build_calendar( $check_lists_array );
$locations_with_calendar_array[] =
array("location" => $location, "calendar_array" => $calendar_array);
}
-
+
foreach( $components_for_control_array as $component )
{
$short_desc_arr =
execMethod('property.soentity.get_short_description', array('location_id' =>
$component->get_location_id(), 'id' => $component->get_id()));
Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php 2012-09-21 11:30:07 UTC (rev
10017)
+++ trunk/controller/inc/class.uicase.inc.php 2012-09-21 11:30:40 UTC (rev
10018)
@@ -215,23 +215,43 @@
$data = array
(
- 'categories'
=> $categories,
- 'check_list'
=> $check_list->toArray(),
- 'control'
=> $control->toArray(),
+ 'categories' =>
$categories,
+ 'check_list' =>
$check_list->toArray(),
+ 'control'
=> $control->toArray(),
'check_items_and_cases' =>
$check_items_and_cases,
- 'date_format'
=> $date_format,
- 'location_array'
=> $location_array,
- 'component_array'
=> $component_array,
+ 'date_format' =>
$date_format,
+ 'location_array' =>
$location_array,
+ 'component_array' =>
$component_array,
'building_location_code' =>
$building_location_code,
- 'current_year'
=> $year,
- 'current_month_nr'
=> $month,
- 'type'
=> $type,
- 'location_level'
=> $level
+ // 'current_year' =>
$year,
+ // 'current_month_nr' =>
$month,
+ 'type'
=> $type,
+ 'location_level' =>
$level,
+ 'dateformat' =>
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
+ 'action'
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicase.send_case_message')),
+ 'url_calendar_for_year' =>
$GLOBALS['phpgw']->link('/index.php', array
+
(
+
'menuaction' => 'controller.uicalendar.view_calendar_for_year',
+
'year' => $year,
+
'location_code' => $type == 'component' ? $building_location_code :
$location_array['location_code']
+
)
+
),
+ 'url_calendar_for_month' =>
$GLOBALS['phpgw']->link('/index.php', array
+
(
+
'menuaction' => 'controller.uicalendar.view_calendar_for_month',
+
'year' => $year,
+
'month' => $month,
+
'location_code' => $type == 'component' ? $building_location_code :
$location_array['location_code']
+
)
+
),
);
- if(count( $buildings_array ) > 0){
+ if(count( $buildings_array ) > 0)
+ {
$data['buildings_array'] = $buildings_array;
- }else{
+ }
+ else
+ {
$data['building_array'] = $building_array;
}
@@ -417,6 +437,7 @@
(
'menuaction' => 'controller.uicalendar.view_calendar_for_month',
'year' => $year,
+
'month' => $month,
'location_code' => $type == 'component' ? $building_location_code :
$location_array['location_code']
)
),
Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php 2012-09-21 11:30:07 UTC
(rev 10017)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2012-09-21 11:30:40 UTC
(rev 10018)
@@ -28,6 +28,14 @@
* @version $Id$
*/
+ /**
+ * Import the jQuery class
+ */
+ phpgw::import_class('phpgwapi.jquery');
+
+ /**
+ * Import the yui class
+ */
phpgw::import_class('phpgwapi.yui');
phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('controller.socheck_list');
@@ -264,12 +272,12 @@
'location_level' =>
$level
);
- self::add_javascript('controller', 'controller',
'jquery.js');
+ // phpgwapi_jquery::load_widget('core');
+ $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
+
$GLOBALS['phpgw']->jqcal->add_listener('completed_date');
+
self::add_javascript('controller', 'controller',
'custom_ui.js');
self::add_javascript('controller', 'controller',
'ajax.js');
- self::add_javascript('controller', 'controller',
'jquery-ui.custom.min.js');
-
self::add_stylesheet('controller/templates/base/css/jquery-ui.custom.css');
-
self::render_template_xsl('check_list/add_check_list',
$data);
}
@@ -337,13 +345,13 @@
'location_level'
=> $level
);
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'jquery-ui.custom.min.js');
+ $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
+
$GLOBALS['phpgw']->jqcal->add_listener('completed_date');
+ $GLOBALS['phpgw']->jqcal->add_listener('deadline_date');
+
self::add_javascript('controller', 'controller',
'custom_ui.js');
self::add_javascript('controller', 'controller',
'ajax.js');
-
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
-
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/edit_check_list'),
$data);
}
Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id$ -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<xsl:variable name="month_str">month <xsl:value-of select="current_month_nr"/>
capitalized</xsl:variable>
<script>
<xsl:text>
Modified:
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
===================================================================
---
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id: view_calendar_year.xsl 9206 2012-04-23 06:21:38Z vator $ -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<xsl:variable name="month_str">month <xsl:value-of select="current_month_nr"/>
capitalized</xsl:variable>
<div id="main_content">
Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id$ -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<script>
<xsl:text>
Modified:
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
===================================================================
---
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id: view_calendar_year.xsl 9206 2012-04-23 06:21:38Z vator $ -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<div id="main_content">
Modified: trunk/controller/templates/base/case/create_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/create_case_message.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/case/create_case_message.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id: edit_check_list.xsl 8374 2011-12-20 07:45:04Z vator $ -->
<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="dateformat"/></xsl:variable>
<div id="main_content" class="medium">
@@ -24,40 +24,10 @@
</xsl:choose>
</div>
<div class="box-2 select-box">
- <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:attribute>
+ <a href="{url_calendar_for_year}">
Kontrolplan for bygg/eiendom (å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:attribute>
+ <a class="last" href="{url_calendar_for_month}">
Kontrolplan for bygg/eiendom (måned)
</a>
</div>
@@ -72,7 +42,7 @@
<xsl:choose>
<xsl:when
test="check_items_and_cases/child::node()">
- <form ENCTYPE="multipart/form-data"
id="frmRegCaseMessage"
action="index.php?menuaction=controller.uicase.send_case_message" method="post">
+ <form ENCTYPE="multipart/form-data"
id="frmRegCaseMessage" action="{action}" method="post">
<input>
<xsl:attribute
name="name">check_list_id</xsl:attribute>
<xsl:attribute
name="type">hidden</xsl:attribute>
Modified: trunk/controller/templates/base/case/view_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/view_case_message.xsl 2012-09-21
11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/case/view_case_message.xsl 2012-09-21
11:30:40 UTC (rev 10018)
@@ -27,7 +27,7 @@
<a href="{url_calendar_for_year}">
Kontrolplan for bygg/eiendom (år)
</a>
- <a class="last" href="{url_calendar_for_year}">
+ <a class="last" href="{url_calendar_for_month}">
Kontrolplan for bygg/eiendom (måned)
</a>
</div>
Modified: trunk/controller/templates/base/check_list/add_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/add_check_list.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/add_check_list.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,27 +1,8 @@
<!-- $Id$ -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
-<script>
- $(function() {
- $( "#planned_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy',
- changeMonth: true,
- changeYear: true
- });
- $( "#completed_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy',
- changeMonth: true,
- changeYear: true
- });
- });
-</script>
-
<!-- ================== ADD CHECKLIST ========================= -->
<div id="main_content" class="medium">
Modified: trunk/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/edit_check_list.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/edit_check_list.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,37 +1,9 @@
<!-- $Id$ -->
<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<div id="main_content" class="medium">
- <!-- ======================= CALENDAR
================================== -->
- <script>
- $(function() {
- $( "#planned_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To',
'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy',
- changeMonth: true,
- changeYear: true
- });
- $( "#completed_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To',
'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy',
- changeMonth: true,
- changeYear: true
- });
- $( "#deadline_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To',
'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy',
- changeMonth: true,
- changeYear: true
- });
-
- });
- </script>
-
<!-- ================== EDIT CHECKLIST ========================= -->
<div id="check-list-heading">
Modified:
trunk/controller/templates/base/check_list/view_cases_for_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_cases_for_check_list.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/view_cases_for_check_list.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id: edit_check_list.xsl 8513 2012-01-07 10:38:09Z vator $ -->
<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<div id="main_content" class="medium">
Modified: trunk/controller/templates/base/check_list/view_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_check_list.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/view_check_list.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id$ -->
<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<div id="main_content" class="medium">
Modified: trunk/controller/templates/base/check_list/view_check_lists.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_check_lists.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/view_check_lists.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id$ -->
<xsl:template match="data" name="view_check_lists"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<div id="main_content" class="medium">
Modified: trunk/controller/templates/base/check_list/view_control_details.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_control_details.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/view_control_details.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,5 +1,5 @@
<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<xsl:template match="data" xmlns:php="http://php.net/xsl">
Modified: trunk/controller/templates/base/check_list/view_control_info.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_control_info.xsl
2012-09-21 11:30:07 UTC (rev 10017)
+++ trunk/controller/templates/base/check_list/view_control_info.xsl
2012-09-21 11:30:40 UTC (rev 10018)
@@ -1,6 +1,6 @@
<!-- $Id: edit_check_list.xsl 8478 2012-01-03 12:36:37Z vator $ -->
<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')"
/></xsl:variable>
<div id="main_content" class="medium">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10018] controller: use dateformat from userprefs, use generated url,
Sigurd Nes <=