[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8348]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8348] |
Date: |
Fri, 16 Dec 2011 13:56:41 +0000 |
Revision: 8348
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8348
Author: vator
Date: 2011-12-16 13:56:41 +0000 (Fri, 16 Dec 2011)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/component/class.calendar_builder.inc.php
trunk/controller/inc/component/class.date_generator.inc.php
trunk/controller/js/controller/custom_ui.js
trunk/controller/js/yahoo/datatable.js
trunk/controller/templates/base/css/base.css
trunk/controller/templates/base/edit_check_list.xsl
trunk/controller/templates/base/view_calendar_month.xsl
trunk/controller/templates/base/view_calendar_year.xsl
Modified: trunk/controller/inc/component/class.calendar_builder.inc.php
===================================================================
--- trunk/controller/inc/component/class.calendar_builder.inc.php
2011-12-16 13:56:22 UTC (rev 8347)
+++ trunk/controller/inc/component/class.calendar_builder.inc.php
2011-12-16 13:56:41 UTC (rev 8348)
@@ -28,7 +28,8 @@
foreach($dates_array as $date){
if( $period_type == "view_months" )
{
- $calendar_array[ date("n", $date) ]
= "";
+ $calendar_array[ date("n", $date)
]["status"] = 0;
+ $calendar_array[ date("n", $date)
]["info"] = array("date" => $date);
}
else if( $period_type == "view_days" )
{
@@ -68,7 +69,8 @@
if($period_type == "view_months")
{
- $calendar_array[ date("n",
$check_list->get_deadline()) ] = $check_list_status_info->serialize();
+ $calendar_array[ date("n",
$check_list->get_deadline()) ]["status"] = 1;
+ $calendar_array[ date("n",
$check_list->get_deadline()) ]["info"] = $check_list_status_info->serialize();
}
else if( $period_type == "view_days" )
{
@@ -102,7 +104,9 @@
// Inserts check_list object on deadline month in
twelve_months_array
foreach($check_list_array as $check_list){
- $calendar_array[ date("m",
$check_list['deadline']) - 1 ] += $check_list['count'];
+ $calendar_array[ date("m",
$check_list['deadline']) - 1 ] ["status"] = 2;
+ $calendar_array[ date("m",
$check_list['deadline']) - 1 ] ["info"] = $check_list['count'];
+
}
$control_calendar_array[] = array("control" =>
$control_info, "calendar_array" => $calendar_array);
Modified: trunk/controller/inc/component/class.date_generator.inc.php
===================================================================
--- trunk/controller/inc/component/class.date_generator.inc.php 2011-12-16
13:56:22 UTC (rev 8347)
+++ trunk/controller/inc/component/class.date_generator.inc.php 2011-12-16
13:56:41 UTC (rev 8348)
@@ -24,61 +24,45 @@
function generate_calendar(){
- $trail_date = $this->find_start_date_by_repeat_type();
+ $control_start_date = $this->find_control_start_date();
+ $period_start_date = $this->find_start_date_for_period(
$control_start_date );
+
+ $interval_date = $period_start_date;
- while( $trail_date < $this->period_start_date ){
-
- if($this->repeat_type == 1 || $this->repeat_type == 0)
- {
- $trail_date = mktime(0,0,0, date("m",
$trail_date), date("d", $trail_date)+$this->repeat_interval, date("Y",
$trail_date));
- }
- else if($this->repeat_type == 2)
- {
- $month = date("m", $trail_date) +
$this->repeat_interval;
- $year = date("Y", $trail_date);
-
- if($month > 12){
- $month = $month % 12;
- $year += 1;
- }
-
- $num_days_in_month =
cal_days_in_month(CAL_GREGORIAN, $month, $year);
- $trail_date = mktime(0,0,0, $month,
$num_days_in_month, $year);
- }
- else if($this->repeat_type == 3)
- {
- $trail_date = mktime(0,0,0, date("m",
$trail_date), date("d", $trail_date), date("Y",
$trail_date)+$this->repeat_interval);
- }
- }
+ echo " Interval start date: " . date("d/m-Y", $interval_date);
+ echo " Period end date: " . date("d/m-Y",
$this->period_end_date);
- while($trail_date <= $this->period_end_date){
+
+ while($interval_date <= $this->period_end_date){
- $this->calendar_array[] = $trail_date;
+ $this->calendar_array[] = $interval_date;
if($this->repeat_type == 1 || $this->repeat_type == 0)
{
- $trail_date = mktime(0,0,0, date("m",
$trail_date), date("d", $trail_date)+$this->repeat_interval, date("Y",
$trail_date));
+ $interval_date = mktime(0,0,0, date("m",
$interval_date), date("d", $interval_date)+$this->repeat_interval, date("Y",
$interval_date));
}
else if($this->repeat_type == 2)
{
- $month = date("m",
$trail_date)+$this->repeat_interval;
+ $month = date("m",
$interval_date)+$this->repeat_interval;
+ $year = date("Y", $interval_date);
if($month > 12){
$month = $month % 12;
- $year = date("Y", $trail_date) + 1;
+ $year += 1;
}
$num_days_in_month =
cal_days_in_month(CAL_GREGORIAN, $month, $year);
- $trail_date = mktime(0,0,0, $month,
$num_days_in_month, $year);
+ $interval_date = mktime(0,0,0, $month,
$num_days_in_month, $year);
+ echo " Ny interval date: " . date("d/m-Y",
$interval_date);
}
else if($this->repeat_type == 3)
{
- $trail_date = mktime(0,0,0, date("m",
$trail_date), date("d", $trail_date), date("Y",
$trail_date)+$this->repeat_interval);
+ $interval_date = mktime(0,0,0, date("m",
$interval_date), date("d", $interval_date), date("Y",
$interval_date)+$this->repeat_interval);
}
}
-
+
}
- public function find_start_date_by_repeat_type(){
+ public function find_control_start_date(){
if( $this->repeat_type == 1 || $this->repeat_type == 0 ){
$search_date = $this->start_date;
@@ -104,7 +88,38 @@
return $search_date;
}
+
+ public function find_start_date_for_period( $trail_date ){
+ while( $trail_date < $this->period_start_date ){
+
+ if($this->repeat_type == 1 || $this->repeat_type == 0)
+ {
+ $trail_date = mktime(0,0,0, date("m",
$trail_date), date("d", $trail_date)+$this->repeat_interval, date("Y",
$trail_date));
+ }
+ else if($this->repeat_type == 2)
+ {
+ $month = date("m", $trail_date) +
$this->repeat_interval;
+ $year = date("Y", $trail_date);
+
+ if($month > 12){
+ $month = $month % 12;
+ $year += 1;
+ }
+
+ $num_days_in_month =
cal_days_in_month(CAL_GREGORIAN, $month, $year);
+ $trail_date = mktime(0,0,0, $month,
$num_days_in_month, $year);
+ }
+ else if($this->repeat_type == 3)
+ {
+ $trail_date = mktime(0,0,0, date("m",
$trail_date), date("d", $trail_date), date("Y",
$trail_date)+$this->repeat_interval);
+ }
+ }
+
+ return $trail_date;
+ }
+
+
public function get_dates(){
return $this->calendar_array;
}
Modified: trunk/controller/js/controller/custom_ui.js
===================================================================
--- trunk/controller/js/controller/custom_ui.js 2011-12-16 13:56:22 UTC (rev
8347)
+++ trunk/controller/js/controller/custom_ui.js 2011-12-16 13:56:41 UTC (rev
8348)
@@ -1,23 +1,5 @@
$(document).ready(function() {
- $("#calendar_dates span").click(function(){
- var thisSpan = $(this);
-
- $("#calendar_dates span").css("border", "2px solid black");
- $(thisSpan).css("border", "2px solid red");
-
- var date = $(thisSpan).text();
- var day = date.substring(0, date.indexOf("/"));
- var month = date.substring(date.indexOf("/")+1,
date.indexOf("-"));
- var year = date.substring(date.indexOf("-")+1, date.length);
-
- var valid_save_date = year + "-" + month + "-" + day;
-
- $("#deadline_date").val(valid_save_date);
-
-
- });
-
$("ul.control_items ul:first").find("h4 img").attr("src",
"controller/images/arrow_down.png");
$("ul.control_items ul:first").find("li ul").slideDown("slow");
$("ul.control_items ul:first").addClass('active');
@@ -27,7 +9,7 @@
$(".expand_list h4").click(function(){
if( $(this).parent().parent().hasClass('active')){
$(this).parent().find("ul").slideUp("slow");
- $(this).find("img").attr("src",
"controller/images/arrow_left.png");
+ $(this).find("img").attr("src",
"controller/images/arrow_right.png");
$(this).parent().parent().removeClass('active');
}else{
$(this).parent().find("ul").slideDown("slow");
@@ -36,56 +18,75 @@
}
});
- $("ul.check_items h4.expand_list").click(function(){
- if( $(this).parent().parent().hasClass('expanded')){
- $(this).parent().find("div.check_item").slideUp("slow");
- $(this).find("img").attr("src",
"controller/images/arrow_left.png");
- $(this).parent().parent().removeClass('expanded');
- }else{
-
$(this).parent().find("div.check_item").slideDown("slow");
- $(this).find("img").attr("src",
"controller/images/arrow_down.png");
- $(this).parent().parent().addClass('expanded');
- }
+ $(".expand_all").click(function(){
+ $(this).addClass("focus");
+ $(".collapse_all").removeClass("focus");
+
+ $("ul.expand_list").find("li ul").slideDown("slow");
+ $("ul.expand_list").find("li ul").addClass("active");
+ $("ul.expand_list").find("li h4 img").attr("src",
"controller/images/arrow_down.png");
});
- $("ul.check_items h4.expand_list").load(function(){
- if( $(this).parent().parent().hasClass('expanded')){
- $(this).parent().find("div.check_item").slideUp("slow");
- $(this).find("img").attr("src",
"controller/images/arrow_left.png");
- $(this).parent().parent().removeClass('expanded');
+ $(".collapse_all").click(function(){
+ $(this).addClass("focus");
+ $(".expand_all").removeClass("focus");
+
+ $("ul.expand_list").find("li ul").slideUp("slow");
+ $("ul.expand_list").find("li ul").removeClass("active");
+ $("ul.expand_list").find("li h4 img").attr("src",
"controller/images/arrow_right.png");
+ });
+
+ /*
===============================================================================
*/
+
+ $("ul.check_items.expand_list h4").click(function(){
+ if( $(this).parent().hasClass('expanded')){
+ $(this).parent().find(".check_item").slideUp("slow");
+ $(this).find("img").attr("src",
"controller/images/arrow_right.png");
+ $(this).parent().removeClass('expanded');
}else{
-
$(this).parent().find("div.check_item").slideDown("slow");
+ $(this).parent().find(".check_item").slideDown("slow");
$(this).find("img").attr("src",
"controller/images/arrow_down.png");
- $(this).parent().parent().addClass('active');
+ $(this).parent().addClass('expanded');
}
});
- /*
===============================================================================
*/
-
$(".expand_all").click(function(){
- $(".expand_all").css("background",
"url('controller/images/bg_expand_blue.png') no-repeat");
- $(".expand_all").css("color", "#FFFFFF");
- $(".collapse_all").css("background",
"url('controller/images/bg_expand_grey.png') no-repeat");
- $(".collapse_all").css("color", "#000000");
-
- $("ul.expand_list").find("li ul").slideDown("slow");
- $("ul.expand_list").find("li ul").addClass("active");
+ $(this).addClass("focus");
+ $(".collapse_all").removeClass("focus");
+
+
$("ul.check_items.expand_list").find("div.check_item").slideDown("slow");
+
$("ul.check_items.expand_list").find("div.check_item").addClass("expanded");
$("ul.expand_list").find("li h4 img").attr("src",
"controller/images/arrow_down.png");
});
$(".collapse_all").click(function(){
- $(".collapse_all").css("background",
"url('controller/images/bg_expand_blue.png') no-repeat");
- $(".collapse_all").css("color", "#FFFFFF");
- $(".expand_all").css("background",
"url('controller/images/bg_expand_grey.png') no-repeat");
- $(".expand_all").css("color", "#000000");
+ $(this).addClass("focus");
+ $(".expand_all").removeClass("focus");
- $("ul.expand_list").find("li ul").slideUp("slow");
- $("ul.expand_list").find("li ul").removeClass("active");
- $("ul.expand_list").find("li h4 img").attr("src",
"controller/images/arrow_left.png");
+
$("ul.check_items.expand_list").find("div.check_item").slideUp("slow");
+
$("ul.check_items.expand_list").find("div.check_item").removeClass("expanded");
+ $("ul.expand_list").find("li h4 img").attr("src",
"controller/images/arrow_right.png");
});
+
/*
===============================================================================
*/
+ $("#calendar_dates span").click(function(){
+ var thisSpan = $(this);
+
+ $("#calendar_dates span").css("border", "2px solid black");
+ $(thisSpan).css("border", "2px solid red");
+
+ var date = $(thisSpan).text();
+ var day = date.substring(0, date.indexOf("/"));
+ var month = date.substring(date.indexOf("/")+1,
date.indexOf("-"));
+ var year = date.substring(date.indexOf("-")+1, date.length);
+
+ var valid_save_date = year + "-" + month + "-" + day;
+
+ $("#deadline_date").val(valid_save_date);
+ });
+
if( $("#frm_control_items").length > 0 ){
var check_box_arr =
$("#frm_control_items").find("input[type='checkbox']");
@@ -117,6 +118,15 @@
$("#frm_control_items").prepend("<input type='hidden'
id=hid_" + control_item_id + " name='control_tag_ids[]' value=" +
control_group_id + ":" + control_item_id + " />");
}
});
-
});
+
+function slide_up(elem){
+
+
+}
+
+function slide_down(elem){
+
+
+}
Modified: trunk/controller/js/yahoo/datatable.js
===================================================================
--- trunk/controller/js/yahoo/datatable.js 2011-12-16 13:56:22 UTC (rev
8347)
+++ trunk/controller/js/yahoo/datatable.js 2011-12-16 13:56:41 UTC (rev
8348)
@@ -96,8 +96,7 @@
//------------
myContextMenu = new YAHOO.widget.ContextMenu("mycontextmenu",
{trigger:myDataTable.getTbodyEl()});
myContextMenu.addItems(YAHOO.portico.GetMenuContext());
- myContextMenu.addItem("Hei du!!");
-
+
myDataTable.subscribe("rowMouseoverEvent",
myDataTable.onEventHighlightRow);
myDataTable.subscribe("rowMouseoutEvent",
myDataTable.onEventUnhighlightRow);
Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css 2011-12-16 13:56:22 UTC
(rev 8347)
+++ trunk/controller/templates/base/css/base.css 2011-12-16 13:56:41 UTC
(rev 8348)
@@ -557,33 +557,6 @@
margin-top:10px;
}
-.expand_all {
- background: url("../../../images/bg_expand_blue.png") no-repeat scroll 0 0
transparent;
- color: #FFFFFF;
- cursor: pointer;
- float: left;
- font-weight: normal;
- height: 18px;
- margin-left: 20px;
- padding: 5px 10px;
- width: 56px;
-}
-.collapse_all {
- background: url("../../../images/bg_expand_grey.png") no-repeat scroll 0 0
transparent;
- color: #000000;
- cursor: pointer;
- float: left;
- font-weight: normal;
- height: 22px;
- margin-left: 0;
- padding: 6px 0 0 7px;
- width: 59px;
-}
-
-.expand_header{
- overflow:hidden;
-}
-
dl.proplist, dl.proplist-col {
margin: 0;
padding-left: 0;
@@ -860,6 +833,7 @@
width: 500px;
overflow-x: hidden;
height: 800px;
+ margin-left: 40px;
}
ul.calendar.days {
position: absolute;
@@ -969,4 +943,49 @@
margin-right: 10px;
padding: 1px 4px;
cursor: pointer;
+}
+textarea{
+ padding: 4px;
+}
+.expand_menu div.focus{
+ background: url('../../../images/bg_expand_blue.png') no-repeat;
+ color: #FFF;
+}
+.expand_menu {
+ margin: 15px 0 20px;
+ overflow: hidden;
+}
+.expand_menu div{
+ background: url('../../../images/bg_expand_grey.png') no-repeat;
+ color: #000;
+ padding: 7px 10px;
+ cursor: pointer;
+ float: left;
+ font-weight: normal;
+ height: 18px;
+ width: 56px;
+}
+.expand_menu div.collapse_all{
+ padding: 7px;
+}
+
+label.comment{
+ vertical-align:top;
+}
+.check_item {
+ display: none;
+}
+.check_item label{
+ width: 150px;
+ display: inline-block;
+}
+
+.check_items h4 img{
+ padding-bottom:2px;
+}
+.check_items.expand_list h4{
+ font-size: 15px;
+}
+#days_view div{
+ font-weight:bold;
}
\ No newline at end of file
Modified: trunk/controller/templates/base/edit_check_list.xsl
===================================================================
--- trunk/controller/templates/base/edit_check_list.xsl 2011-12-16 13:56:22 UTC
(rev 8347)
+++ trunk/controller/templates/base/edit_check_list.xsl 2011-12-16 13:56:41 UTC
(rev 8348)
@@ -26,10 +26,7 @@
<form id="frm_save_check_items"
action="index.php?menuaction=controller.uicheck_list.save_check_items"
method="post">
<h1>Sjekkliste</h1>
- <div class="form-buttons-top">
- <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
- <input type="submit" name="save_control"
value="{$lang_save}" title = "{$lang_save}" />
- </div>
+
<fieldset class="check_list_details">
<div>
<label>ID</label>
@@ -51,7 +48,7 @@
<xsl:attribute name="id">deadline</xsl:attribute>
<xsl:attribute
name="name">deadline</xsl:attribute>
<xsl:attribute name="type">text</xsl:attribute>
- <xsl:if test="check_list/deadline != ''">
+ <xsl:if test="check_list/deadline != 0">
<xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(check_list/deadline))"/></xsl:attribute>
</xsl:if>
</input>
@@ -62,7 +59,7 @@
<xsl:attribute
name="id">planned_date</xsl:attribute>
<xsl:attribute
name="name">planned_date</xsl:attribute>
<xsl:attribute name="type">text</xsl:attribute>
- <xsl:if test="check_list/planned_date != ''">
+ <xsl:if test="check_list/planned_date != 0">
<xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(check_list/planned_date))"/></xsl:attribute>
</xsl:if>
</input>
@@ -73,13 +70,13 @@
<xsl:attribute
name="id">completed_date</xsl:attribute>
<xsl:attribute
name="name">completed_date</xsl:attribute>
<xsl:attribute name="type">text</xsl:attribute>
- <xsl:if test="check_list/completed_date !=
''">
+ <xsl:if test="check_list/completed_date != 0">
<xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(check_list/completed_date))"/></xsl:attribute>
</xsl:if>
</input>
</div>
<div>
- <label>Kommentar</label>
+ <label class="comment">Kommentar</label>
<textarea>
<xsl:attribute
name="name">check_list_comment</xsl:attribute>
<xsl:value-of select="check_list/comment"/>
@@ -89,42 +86,38 @@
</fieldset>
<h2 class="check_item_details">Sjekkpunkter</h2>
+
+ <xsl:choose>
+ <xsl:when
test="check_list/check_item_array/child::node()">
+ <xsl:variable name="check_list_id"><xsl:value-of
select="check_list/id"/></xsl:variable>
+ <input type="hidden" name="check_list_id"
value="{$check_list_id}" />
- <xsl:variable name="check_list_id"><xsl:value-of
select="check_list/id"/></xsl:variable>
- <input type="hidden" name="check_list_id"
value="{$check_list_id}" />
+ <xsl:for-each select="check_list/check_item_array">
+ <xsl:variable
name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+ <input type="hidden" name="check_item_ids[]"
value="{$check_item_id}" />
+ </xsl:for-each>
- <xsl:for-each select="check_list/check_item_array">
- <xsl:variable name="check_item_id"><xsl:value-of
select="id"/></xsl:variable>
- <input type="hidden" name="check_item_ids[]"
value="{$check_item_id}" />
- </xsl:for-each>
+ <div class="expand_menu"><div class="expand_all">Vis
alle</div><div class="collapse_all focus">Skjul alle</div></div>
- <h4 class="expand_header"><div class="expand_all">Vis
alle</div><div class="collapse_all">Skjul alle</div></h4>
-
- <ul class="check_items">
- <xsl:choose>
- <xsl:when
test="check_list/check_item_array/child::node()">
+ <ul class="check_items expand_list">
<xsl:for-each
select="check_list/check_item_array">
<xsl:variable
name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
<li>
- <h4 class="itemlist
expand_list"><xsl:number/>. <img src="controller/images/arrow_left.png"
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>
+ <h4><img
src="controller/images/arrow_right.png" width="14"/><xsl:number/>.
<span><xsl:value-of select="control_item/title"/></span></h4>
<div
class="check_item">
<div>
<label>Status</label>
- <span>
-
<select name="status_{$check_item_id}">
-
<option value="true">Utført</option>
-
<option value="false">Ikke utført</option>
-
</select>
-
</span>
+ <select
name="status_{$check_item_id}">
+
<option value="true">Utført</option>
+
<option value="false">Ikke utført</option>
+
</select>
</div>
<div>
-
<label>Kommentar</label>
- <span>
-
<textarea name="comment_{$check_item_id}">
-
<xsl:value-of select="comment"/>
-
</textarea>
- </span>
+ <label
class="comment">Kommentar</label>
+ <textarea
name="comment_{$check_item_id}">
+
<xsl:value-of select="comment"/>
+
</textarea>
</div>
<div>
<label>Hva
skal gjøres</label><span><xsl:value-of select="control_item/what_to_do"/></span>
@@ -135,102 +128,17 @@
</div>
</li>
</xsl:for-each>
+ </ul>
</xsl:when>
+ <xsl:otherwise>
+ Ingen sjekkpunkter
+ </xsl:otherwise>
</xsl:choose>
- </ul>
- <!--
- <ul class="check_items">
- <xsl:for-each
select="groups_with_control_items">
- <ul class="itemlist expand_list">
- <li>
- <xsl:choose>
- <xsl:when
test="group_control_items/child::node()">
- <h4><img
src="controller/images/arrow_left.png" width="14"/><span><xsl:value-of
select="control_group/group_name"/></span></h4>
- <xsl:variable
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
- <ul>
-
<xsl:for-each select="group_control_items">
-
<xsl:variable name="control_item_id"><xsl:value-of
select="control_item/id"/></xsl:variable>
-
<xsl:choose>
-
<xsl:when test="checked = 1">
-
<li><xsl:number/>. <input type="checkbox" checked="checked"
id="ch_{$control_group_id}:{$control_item_id}"
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of
select="control_item/title"/></li>
-
</xsl:when>
-
<xsl:otherwise>
-
<li><xsl:number/>. <input type="checkbox"
id="ch_{$control_group_id}:{$control_item_id}"
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of
select="control_item/title"/></li>
-
</xsl:otherwise>
-
</xsl:choose>
-
</xsl:for-each>
- </ul>
- </xsl:when>
- <xsl:otherwise>
- <div
class="empty_list"><span><xsl:value-of
select="control_group/group_name"/></span></div>
- <div>Ingen
kontrollpunkt</div>
- </xsl:otherwise>
- </xsl:choose>
- </li>
- </ul>
- </xsl:for-each>
- </ul>
- -->
- <div class="form-buttons">
- <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
- <input type="submit" name="save_control"
value="{$lang_save}" title = "{$lang_save}" />
- </div>
- </form>
-
- <!--
- <fieldset class="check_item_details">
- <xsl:variable name="check_list_id"><xsl:value-of
select="check_list/id"/></xsl:variable>
- <input type="hidden" name="check_list_id"
value="{$check_list_id}" />
-
- <xsl:for-each select="check_list/check_item_array">
- <xsl:variable
name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
- <input type="hidden" name="check_item_ids[]"
value="{$check_item_id}" />
- </xsl:for-each>
-
- <xsl:choose>
- <xsl:when
test="check_list/check_item_array/child::node()">
- <xsl:for-each
select="check_list/check_item_array">
- <xsl:variable
name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-
- <div class="check_item">
- <h3
class="order_nr"><xsl:number/>. <xsl:value-of select="control_item/title"/></h3>
- <div>
- <label>Status</label>
- <span>
- <select
name="status_{$check_item_id}">
-
<option value="true">Utført</option>
-
<option value="false">Ikke utført</option>
- </select>
- </span>
- </div>
- <div>
-
<label>Kommentar</label>
- <span>
- <textarea
name="comment_{$check_item_id}">
-
<xsl:value-of select="comment"/>
- </textarea>
- </span>
- </div>
- <div>
- <label>Hva skal
gjøres</label><span><xsl:value-of select="control_item/what_to_do"/></span>
- </div>
- <div>
-
<label>Utførelsesbeskrivelse</label><span><xsl:value-of
select="control_item/what_to_do"/></span>
- </div>
- </div>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
-
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
<input type="submit" name="save_control"
value="{$lang_save}" title = "{$lang_save}" />
</div>
- </fieldset>
- </form>
- -->
-
-
+ </form>
</div>
</xsl:template>
Modified: trunk/controller/templates/base/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/view_calendar_month.xsl 2011-12-16
13:56:22 UTC (rev 8347)
+++ trunk/controller/templates/base/view_calendar_month.xsl 2011-12-16
13:56:41 UTC (rev 8348)
@@ -11,8 +11,8 @@
</fieldset>
<h2 style="float:left;">Sjekklister</h2>
- <div style="float:left;margin-top: 30px;margin-left: 760px;"><a
class="move_cal_right" href="#"><<</a></div>
- <div style="float:left;margin-top: 30px;margin-left: 95px;"><a
class="move_cal_left" href="#">>></a></div>
+ <div style="float:left;margin-top: 30px;margin-left: 636px;"><a
class="move_cal_right" href="#"><img src="controller/images/arrow_left.png"
width="16"/></a></div>
+ <div style="float:left;margin-top: 30px;margin-left: 454px;"><a
class="move_cal_left" href="#"><img src="controller/images/arrow_right.png"
width="16"/></a></div>
<script>
$(document).ready(function() {
@@ -23,7 +23,7 @@
if(leftNumVal == -502){
$("#days_view").animate({
- left: '-=118'
+ left: '-=110'
}, 800);
}else if(leftNumVal > -502){
$("#days_view").animate({
@@ -37,9 +37,9 @@
var leftStrVal =
$("#days_view").css("left");
var leftNumVal =
leftStrVal.substring(0, leftStrVal.indexOf('px'));
- if(leftNumVal == -118){
+ if(leftNumVal == -110){
$("#days_view").animate({
- left: '+=118'
+ left: '+=110'
}, 800);
}else if(-502 > leftNumVal){
$("#days_view").animate({
Modified: trunk/controller/templates/base/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/view_calendar_year.xsl 2011-12-16
13:56:22 UTC (rev 8347)
+++ trunk/controller/templates/base/view_calendar_year.xsl 2011-12-16
13:56:41 UTC (rev 8348)
@@ -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="year"><xsl:value-of select="year"/></xsl:variable>
+<xsl:variable name="location_code"><xsl:value-of
select="location_array/location_code"/></xsl:variable>
<div id="main_content">
@@ -18,12 +19,17 @@
<xsl:when
test="controls_calendar_array/child::node()">
<li class="heading">
- <div class="id">ID</div><div
class="title">Tittel</div><div class="frequency">Frekvenstype</div><div
class="frequency">Frekvensintervall</div>
+ <div class="id">ID</div>
+ <div class="title">Tittel</div>
+ <div class="date">Start dato</div>
+ <div class="date">Slutt dato</div>
+ <div
class="frequency">Frekvenstype</div>
+ <div
class="frequency">Frekvensintervall</div>
<xsl:for-each select="heading_array">
<div>
<a>
<xsl:attribute
name="href">
-
<xsl:text>index.php?menuaction=controller.uilocation_check_list.view_agg_check_lists_for_location</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uilocation_check_list.view_calendar_for_month</xsl:text>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="$year"/>
<xsl:text>&month=</xsl:text>
@@ -36,7 +42,7 @@
</li>
<xsl:for-each select="controls_calendar_array">
- <xsl:variable
name="repeat_type"><xsl:value-of select="control/repeat_type"/></xsl:variable>
+ <xsl:variable
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
<li>
<div class="id">
<xsl:value-of
select="control/id"/>
@@ -44,6 +50,19 @@
<div class="title">
<xsl:value-of
select="control/title"/>
</div>
+ <div class="date">
+ <xsl:value-of
select="php:function('date', $date_format, number(control/start_date))"/>
+ </div>
+ <div class="date">
+ <xsl:choose>
+ <xsl:when
test="control/end_date != 0">
+ <xsl:value-of
select="php:function('date', $date_format, number(control/end_date))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ Løpende
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
<div class="frequency">
<xsl:value-of
select="control/repeat_type"/>
</div>
@@ -51,52 +70,55 @@
<xsl:value-of
select="control/repeat_interval"/>
</div>
<xsl:for-each
select="calendar_array">
- <div>
<xsl:choose>
- <xsl:when
test="$repeat_type = 0">
- <xsl:value-of
select="." />
- </xsl:when>
- <xsl:otherwise>
- <div
style="position:relative;">
- <div
id="info_box" style="position:absolute;display:none;">
- </div>
-
<xsl:choose>
-
<xsl:when test="id">
-
<xsl:variable name="status"><xsl:value-of
select="status"/></xsl:variable>
-
<xsl:choose>
-
<xsl:when test="status = 0">
-
<img height="15"
src="controller/images/status_icon_red_cross.png" />
-
</xsl:when>
-
<xsl:when test="status = 1">
-
<img height="15"
src="controller/images/status_icon_dark_green.png" />
-
</xsl:when>
-
<xsl:when test="status = 2">
-
<img height="15"
src="controller/images/status_icon_blue.png" />
-
</xsl:when>
-
<xsl:when test="status = 3">
-
<img height="15"
src="controller/images/status_icon_light_green.png" />
-
</xsl:when>
-
<xsl:otherwise>
-
<a class="view_check_list">
-
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-
<xsl:text>&phpgw_return_as=json</xsl:text>
-
<xsl:text>&check_list_id=</xsl:text>
-
<xsl:value-of select="id"/>
-
</xsl:attribute>
-
<img height="15"
src="controller/images/status_icon_red.png" />
-
</a>
-
</xsl:otherwise>
-
</xsl:choose>
-
</xsl:when>
-
<xsl:otherwise>
-
<img height="15"
src="controller/images/status_icon_yellow.png" />
-
</xsl:otherwise>
-
</xsl:choose>
-
</div>
- </xsl:otherwise>
- </xsl:choose>
- </div>
+ <xsl:when
test="status = 0">
+ <div>
+ <a>
+
<xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
+
<xsl:text>&date=</xsl:text>
+
<xsl:value-of select="info/date"/>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="$control_id"/>
+
<xsl:text>&location_code=</xsl:text>
+
<xsl:value-of select="$location_code"/>
+
</xsl:attribute>
+
<img height="15" src="controller/images/status_icon_yellow.png" />
+ </a>
+ </div>
+ </xsl:when>
+ <xsl:when
test="status = 1">
+ <div
style="position:relative;">
+ <div
id="info_box" style="position:absolute;display:none;"></div>
+
<a class="view_check_list">
+
<xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
+
<xsl:text>&phpgw_return_as=json</xsl:text>
+
<xsl:text>&check_list_id=</xsl:text>
+
<xsl:value-of select="info/id"/>
+
</xsl:attribute>
+
<span style="display:none"><xsl:value-of select="info/id"/></span>
+
<img height="15" src="controller/images/status_icon_red.png" />
+
</a>
+ </div>
+ </xsl:when>
+ <xsl:when
test="status = 2">
+ <div
style="background: url(controller/images/status_icon_red_empty.png) no-repeat
50% 50%;">
+ <a
style="color:#fff;font-weight:bold;text-decoration: none;font-size:10px;"
class="view_check_list">
+
<xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
+
<xsl:text>&phpgw_return_as=json</xsl:text>
+
<xsl:text>&check_list_id=</xsl:text>
+
<xsl:value-of select="info/id"/>
+
</xsl:attribute>
+
<span><xsl:value-of select="info"/></span>
+
</a>
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <div></div>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:for-each>
</li>
</xsl:for-each>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8348],
Torstein <=