[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8619]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8619] |
Date: |
Thu, 19 Jan 2012 13:01:23 +0000 |
Revision: 8619
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8619
Author: vator
Date: 2012-01-19 13:01:21 +0000 (Thu, 19 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.menu.inc.php
trunk/controller/inc/class.uicalendar.inc.php
trunk/controller/inc/class.uiprocedure.inc.php
trunk/controller/setup/tables_update.inc.php
trunk/controller/templates/base/calendar/view_calendar_month.xsl
trunk/controller/templates/base/calendar/view_calendar_year.xsl
trunk/controller/templates/base/check_list/view_control_info.xsl
trunk/controller/templates/base/check_list/view_control_items.xsl
trunk/controller/templates/base/css/base.css
trunk/controller/templates/base/procedure/print_procedure.xsl
trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
Modified: trunk/controller/inc/class.menu.inc.php
===================================================================
--- trunk/controller/inc/class.menu.inc.php 2012-01-19 11:58:47 UTC (rev
8618)
+++ trunk/controller/inc/class.menu.inc.php 2012-01-19 13:01:21 UTC (rev
8619)
@@ -105,7 +105,7 @@
'calendar_overview' => array
(
'text' =>
lang('Calendar_overview'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicalendar.view_calendar_for_month', 'year' => '2011', 'month' =>
'10') ),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicalendar.view_calendar_for_year') ),
'image' => array('property',
'location_1'),
)
);
Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php 2012-01-19 11:58:47 UTC
(rev 8618)
+++ trunk/controller/inc/class.uicalendar.inc.php 2012-01-19 13:01:21 UTC
(rev 8619)
@@ -96,10 +96,6 @@
$to_date_ts = strtotime("$to_month/01/$year");
- if(empty($location_code)){
- $location_code = "1101";
- }
-
$this->calendar_builder = new
calendar_builder($from_date_ts, $to_date_ts);
$repeat_type = 0;
@@ -114,6 +110,10 @@
$location_finder = new location_finder();
$my_locations = $location_finder->get_responsibilities(
$criteria );
+
+ if(empty($location_code)){
+ $location_code =
$my_locations[0]["location_code"];
+ }
$controls_for_location_array =
$this->so_control->get_controls_by_location($location_code, $from_date_ts,
$to_date_ts, $repeat_type);
@@ -134,6 +134,7 @@
$data = array
(
'my_locations' =>
$my_locations,
+ 'view_location_code' => $location_code,
'location_array' =>
$location_array,
'heading_array' =>
$heading_array,
'controls_calendar_array' =>
$controls_calendar_array,
@@ -156,7 +157,8 @@
foreach($control_id_with_check_list_array as
$control_id){
if($control->get_id() ==
$control_id->get_id())
$control->set_check_lists_array($control_id->get_check_lists_array());
- }
+ }
+
$controls_with_check_list[] = $control;
}
@@ -168,16 +170,16 @@
$location_code = phpgw::get_var('location_code');
$year = phpgw::get_var('year');
+ if(empty($year)){
+ $year = date("Y");
+ }
+
$year = intval($year);
$from_date_ts = strtotime("01/01/$year");
$to_year = $year + 1;
$to_date_ts = strtotime("01/01/$to_year");
- if(empty($location_code)){
- $location_code = "1101";
- }
-
$criteria = array
(
'user_id' =>
$GLOBALS['phpgw_info']['user']['account_id'],
@@ -188,6 +190,11 @@
$location_finder = new location_finder();
$my_locations = $location_finder->get_responsibilities(
$criteria );
+
+ if(empty($location_code)){
+ $location_code =
$my_locations[0]["location_code"];
+ }
+
$repeat_type = null;
$controls_for_location_array =
$this->so_control->get_controls_by_location($location_code, $from_date_ts,
$to_date_ts, $repeat_type );
@@ -233,7 +240,6 @@
}
-
$repeat_type = 2;
$control_check_list_array =
$this->so->get_check_lists_for_location( $location_code, $from_date_ts,
$to_date_ts, $repeat_type );
@@ -248,6 +254,7 @@
$data = array
(
'my_locations' =>
$my_locations,
+ 'view_location_code' => $location_code,
'location_array' =>
$location_array,
'heading_array' =>
$heading_array,
'controls_calendar_array' =>
$controls_calendar_array,
Modified: trunk/controller/inc/class.uiprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.uiprocedure.inc.php 2012-01-19 11:58:47 UTC
(rev 8618)
+++ trunk/controller/inc/class.uiprocedure.inc.php 2012-01-19 13:01:21 UTC
(rev 8619)
@@ -42,6 +42,7 @@
private $_category_acl;
private $so_control;
private $so_control_group_list;
+ private $so_control_group;
public $public_functions = array
(
@@ -63,6 +64,7 @@
$this->so_control_area =
CreateObject('controller.socontrol_area');
$this->so_control =
CreateObject('controller.socontrol');
$this->so_control_group_list =
CreateObject('controller.socontrol_group_list');
+ $this->so_control_group =
CreateObject('controller.socontrol_group');
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
"controller::procedure";
@@ -484,9 +486,12 @@
public function view_procedures_for_control(){
$control_id = phpgw::get_var('control_id');
+ $location_code = phpgw::get_var('location_code');
$control = $this->so_control->get_single($control_id);
+ $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
+
$control_procedure =
$this->so->get_single_with_documents( $control->get_procedure_id(),
"return_array" );
$control_groups =
$this->so_control_group_list->get_control_groups_by_control($control_id);
@@ -501,6 +506,8 @@
$data = array
(
+ 'location'
=> $location_array,
+ 'control'
=> $control->toArray(),
'control_procedure' =>
$control_procedure,
'group_procedures_array' =>
$group_procedures_array
);
@@ -510,14 +517,28 @@
public function print_procedure(){
$procedure_id = phpgw::get_var('procedure_id');
+ $location_code = phpgw::get_var('location_code');
+ $control_id = phpgw::get_var('control_id');
+ $control_group_id = phpgw::get_var('control_group_id');
+ $control = $this->so_control->get_single($control_id);
+
+ $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
+
$procedure = $this->so->get_single($procedure_id);
$data = array
(
+ 'location' => $location_array,
+ 'control' => $control->toArray(),
'procedure' => $procedure->toArray()
);
+ if( !empty($control_group_id) ){
+ $control_group =
$this->so_control_group->get_single($control_group_id);
+ $data['control_group'] =
$control_group->toArray();
+ }
+
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/base.css');
self::render_template_xsl('procedure/print_procedure',
$data);
Modified: trunk/controller/setup/tables_update.inc.php
===================================================================
--- trunk/controller/setup/tables_update.inc.php 2012-01-19 11:58:47 UTC
(rev 8618)
+++ trunk/controller/setup/tables_update.inc.php 2012-01-19 13:01:21 UTC
(rev 8619)
@@ -449,4 +449,4 @@
$GLOBALS['setup_info']['controller']['currentver'] =
'0.1.21';
return
$GLOBALS['setup_info']['controller']['currentver'];
}
- }
+ }
\ No newline at end of file
Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-01-19 11:58:47 UTC (rev 8618)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-01-19 13:01:21 UTC (rev 8619)
@@ -2,6 +2,7 @@
<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="location_code"><xsl:value-of
select="location_array/location_code"/></xsl:variable>
+<xsl:variable name="view_location_code"><xsl:value-of
select="view_location_code"/></xsl:variable>
<div id="main_content">
@@ -12,25 +13,30 @@
<div style="float:right;width:300px;margin-top:40px;">
<form action="#">
- <input type="hidden" name="period_type"
value="view_month" />
+ <input type="hidden" name="period_type"
value="view_year" />
<input type="hidden" name="year">
<xsl:attribute name="value">
<xsl:value-of select="year"/>
</xsl:attribute>
</input>
- <input type="hidden" name="month">
- <xsl:attribute name="value">
- <xsl:value-of select="month_nr"/>
- </xsl:attribute>
- </input>
-
+
<select id="choose_my_location">
<xsl:for-each select="my_locations">
- <option value="{location_code}"
selected="selected">
- <xsl:value-of
disable-output-escaping="yes" select="loc1_name"/>
- </option>
+ <xsl:variable
name="loc_code"><xsl:value-of select="location_code"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when
test="location_code = $view_location_code">
+ <option
value="{$loc_code}" selected="selected">
+
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+ </option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option
value="{$loc_code}">
+
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:for-each>
- </select>
+ </select>
</form>
<ul id="icon_color_map">
Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-01-19 11:58:47 UTC (rev 8618)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-01-19 13:01:21 UTC (rev 8619)
@@ -2,7 +2,7 @@
<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="year"><xsl:value-of select="year"/></xsl:variable>
-<xsl:variable name="location_code"><xsl:value-of
select="location_array/location_code"/></xsl:variable>
+<xsl:variable name="view_location_code"><xsl:value-of
select="view_location_code"/></xsl:variable>
<div id="main_content">
@@ -19,14 +19,24 @@
<xsl:value-of select="year"/>
</xsl:attribute>
</input>
-
+
<select id="choose_my_location">
<xsl:for-each select="my_locations">
- <option value="{location_code}"
selected="selected">
- <xsl:value-of
disable-output-escaping="yes" select="loc1_name"/>
- </option>
+ <xsl:variable
name="loc_code"><xsl:value-of select="location_code"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when
test="location_code = $view_location_code">
+ <option
value="{$loc_code}" selected="selected">
+
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+ </option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option
value="{$loc_code}">
+
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:for-each>
- </select>
+ </select>
</form>
<ul id="icon_color_map">
@@ -40,9 +50,6 @@
</div>
<ul class="calendar">
- <xsl:choose>
- <xsl:when
test="controls_calendar_array/child::node()">
-
<li class="heading">
<div class="id">ID</div>
<div class="title">Tittel</div>
@@ -58,6 +65,8 @@
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="$year"/>
+
<xsl:text>&location_code=</xsl:text>
+
<xsl:value-of select="//location_code"/>
<xsl:text>&month=</xsl:text>
<xsl:number/>
</xsl:attribute>
@@ -68,6 +77,9 @@
</div>
</li>
+ <xsl:choose>
+ <xsl:when
test="controls_calendar_array/child::node()">
+
<xsl:for-each select="controls_calendar_array">
<xsl:variable
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
<li>
@@ -209,7 +221,7 @@
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
- <div>Ingen sjekklister for bygg i angitt
periode</div>
+ <div class="cal_info_msg">Ingen sjekklister for
bygg i angitt periode</div>
</xsl:otherwise>
</xsl:choose>
</ul>
Modified: trunk/controller/templates/base/check_list/view_control_info.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_control_info.xsl
2012-01-19 11:58:47 UTC (rev 8618)
+++ trunk/controller/templates/base/check_list/view_control_info.xsl
2012-01-19 13:01:21 UTC (rev 8619)
@@ -96,6 +96,8 @@
<xsl:text>index.php?menuaction=controller.uiprocedure.view_procedures_for_control</xsl:text>
<xsl:text>&control_id=</xsl:text>
<xsl:value-of select="control/id"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="location_array/location_code"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
</xsl:attribute>
Prosedyrer
Modified: trunk/controller/templates/base/check_list/view_control_items.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_control_items.xsl
2012-01-19 11:58:47 UTC (rev 8618)
+++ trunk/controller/templates/base/check_list/view_control_items.xsl
2012-01-19 13:01:21 UTC (rev 8619)
@@ -2,9 +2,9 @@
<xsl:template match="data">
-<ul class="groups">
+<ul>
<xsl:for-each select="saved_groups_with_items_array">
- <li class="drag_group list_item">
+ <li class="list_item">
<h3><span class="group_order_nr"><xsl:number/></span>.
<xsl:value-of select="control_group/group_name"/></h3>
<form
action="index.php?menuaction=controller.uicontrol_item.save_item_order"
class="frm_save_order">
@@ -26,19 +26,9 @@
</xsl:variable>
<li class="list_item">
- <span class="drag">
+ <span>
<span
class="order_nr"><xsl:number/></span>. <xsl:value-of select="title"/><input
type="hidden" name="order_nr[]" value="{$order_tag}" />
</span>
- <a class="delete">
- <xsl:attribute
name="href">
-
<xsl:text>index.php?menuaction=controller.uicontrol_item.delete_item_list</xsl:text>
-
<xsl:text>&control_id=</xsl:text>
-
<xsl:value-of select="//control_id"/>
-
<xsl:text>&control_item_id=</xsl:text>
-
<xsl:value-of select="id"/>
- </xsl:attribute>
- <span>x</span>
- </a>
</li>
</xsl:for-each>
</ul>
Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css 2012-01-19 11:58:47 UTC
(rev 8618)
+++ trunk/controller/templates/base/css/base.css 2012-01-19 13:01:21 UTC
(rev 8619)
@@ -1259,4 +1259,11 @@
}
#cal_wrp{
clear:both;
+}
+ul#groups {
+ margin-left: 10px;
+ margin-top: 5px;
+}
+ul#groups h4{
+ margin: 4px 0;
}
\ No newline at end of file
Modified: trunk/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- trunk/controller/templates/base/procedure/print_procedure.xsl
2012-01-19 11:58:47 UTC (rev 8618)
+++ trunk/controller/templates/base/procedure/print_procedure.xsl
2012-01-19 13:01:21 UTC (rev 8619)
@@ -5,21 +5,23 @@
<xsl:variable name="dateformat"><xsl:value-of select="dateformat"
/></xsl:variable>
<div id="control_info" style="margin:40px 0 0 40px;">
-
+ <h1 style="text-decoration: underline;text-transform:
uppercase;"><xsl:value-of select="control/title"/></h1>
+ <h2 style="text-transform: uppercase;"><xsl:value-of
select="location/loc1_name"/></h2>
+ <h3 style="text-transform: uppercase;"><xsl:value-of
select="control_group/group_name"/></h3>
</div>
<div id="procedure" style="margin:40px 0 0 40px;">
<div>
<label for="title"><xsl:value-of
select="php:function('lang','Procedure title')" /></label>
- <xsl:value-of select="procedure/title" />
+ <span style="display: inline-block;width:
600px;"><xsl:value-of select="procedure/title" /></span>
</div>
<div>
<label for="revision_no"><xsl:value-of
select="php:function('lang','Procedure revision')" /></label>
- <xsl:value-of select="procedure/revision_no" />
+ <span style="display: inline-block;width:
600px;"><xsl:value-of select="procedure/revision_no" /></span>
</div>
<div>
<label for="control_area"><xsl:value-of
select="php:function('lang','Control area')" /></label>
- <xsl:value-of select="procedure/control_area_name" />
+ <span style="display: inline-block;width:
600px;"><xsl:value-of select="procedure/control_area_name" /></span>
</div>
<div>
<label for="start_date"><xsl:value-of
select="php:function('lang','Procedure start date')" /></label>
@@ -43,15 +45,15 @@
</div>
<div>
<label for="purpose"><xsl:value-of
select="php:function('lang','Procedure purpose')" /></label>
- <xsl:value-of select="procedure/purpose"
disable-output-escaping="yes"/>
+ <span style="display: inline-block;width:
600px;"><xsl:value-of select="procedure/purpose"
disable-output-escaping="yes"/></span>
</div>
<div>
<label for="responsibility"><xsl:value-of
select="php:function('lang','Procedure responsibility')" /></label>
- <xsl:value-of select="procedure/responsibility" />
+ <span style="display: inline-block;width:
600px;"><xsl:value-of select="procedure/responsibility" /></span>
</div>
<div>
<label for="description"><xsl:value-of
select="php:function('lang','Procedure description')" /></label>
- <xsl:value-of select="procedure/description"
disable-output-escaping="yes"/>
+ <span style="display: inline-block;width:
600px;"><xsl:value-of select="procedure/description"
disable-output-escaping="yes"/></span>
</div>
<div>
<label for="reference"><xsl:value-of
select="php:function('lang','Procedure Reference')" /></label>
@@ -72,9 +74,10 @@
margin:10px 0;
}
label{
- font-weight: bold;
display: inline-block;
- width: 200px;
+ font-weight: bold;
+ vertical-align: top;
+ width: 200px;
}
.btn {
@@ -89,11 +92,12 @@
text-decoration: none;
}
- ul{
- list-style: none outside none;
+ ol{
+ margin: 0;
+ padding: 0 20px;
}
- li{
+ ul{
list-style: none outside none;
}
Modified:
trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
===================================================================
--- trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
2012-01-19 11:58:47 UTC (rev 8618)
+++ trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
2012-01-19 13:01:21 UTC (rev 8619)
@@ -9,6 +9,10 @@
<xsl:text>index.php?menuaction=controller.uiprocedure.print_procedure</xsl:text>
<xsl:text>&procedure_id=</xsl:text>
<xsl:value-of select="control_procedure/id"/>
+ <xsl:text>&control_id=</xsl:text>
+ <xsl:value-of select="control/id"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of select="location/location_code"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
</xsl:attribute>
Skriv ut
@@ -26,7 +30,7 @@
<h3 style="margin:15px 0 3px 0;">Prosedyrer for grupper</h3>
- <ul>
+ <ul id="groups">
<xsl:for-each select="group_procedures_array">
<li>
<h4 style="margin:2px 0;"><xsl:value-of
select="procedure/title"/></h4>
@@ -37,6 +41,12 @@
<xsl:text>index.php?menuaction=controller.uiprocedure.print_procedure</xsl:text>
<xsl:text>&procedure_id=</xsl:text>
<xsl:value-of
select="procedure/id"/>
+
<xsl:text>&control_id=</xsl:text>
+ <xsl:value-of
select="//control/id"/>
+
<xsl:text>&control_group_id=</xsl:text>
+ <xsl:value-of
select="control_group/id"/>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//location/location_code"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
</xsl:attribute>
Skriv ut
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8619],
Torstein <=