[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8507]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8507] |
Date: |
Fri, 06 Jan 2012 10:49:08 +0000 |
Revision: 8507
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8507
Author: vator
Date: 2012-01-06 10:49:07 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.uicheck_list.inc.php
trunk/controller/inc/class.uiprocedure.inc.php
trunk/controller/templates/base/check_list/view_control_info.xsl
trunk/controller/templates/base/check_list/view_control_items.xsl
trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
Added Paths:
-----------
trunk/controller/templates/base/check_list/print_check_list.xsl
trunk/controller/templates/base/procedure/print_procedure.xsl
Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php 2012-01-06 09:26:10 UTC
(rev 8506)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2012-01-06 10:49:07 UTC
(rev 8507)
@@ -59,7 +59,8 @@
'add_check_item_to_list' =>
true,
'update_check_list'
=> true,
'view_control_items' =>
true,
- 'view_control_details' =>
true
+ 'view_control_details' =>
true,
+ 'print_check_list'
=> true
);
public function __construct()
@@ -266,18 +267,18 @@
}
public function view_control_items(){
- $control_id = phpgw::get_var('control_id');
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_list =
$this->so_check_list->get_single($check_list_id);
+
+ $control =
$this->so_control->get_single($check_list->get_control_id());
+ $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
- $control = $this->so_control->get_single($control_id);
-
- $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control_id);
-
$saved_groups_with_items_array = array();
//Populating array with saved control items for each
group
foreach ($control_groups as $control_group)
{
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control_id,
$control_group->get_id());
+ $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
$control_group->get_id());
$control_item =
$this->so_control_item->get_single($control_item_id);
@@ -286,13 +287,14 @@
$data = array
(
- 'saved_groups_with_items_array' =>
$saved_groups_with_items_array
+ 'saved_groups_with_items_array' =>
$saved_groups_with_items_array,
+ 'check_list'
=> $check_list->toArray()
);
$xslttemplate = CreateObject('phpgwapi.xslttemplates');
- $xslttemplate->add_file(array(PHPGW_SERVER_ROOT .
'/controller/templates/base/control_item/view_control_items'));
-
+ $xslttemplate->add_file(array(PHPGW_SERVER_ROOT .
'/controller/templates/base/check_list/view_control_items'));
+
$xslttemplate->set_var('phpgw',array('view_control_items' =>
$data));
$xslttemplate->xsl_parse();
@@ -369,7 +371,56 @@
echo $html;
}
+
+ public function print_check_list(){
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_list =
$this->so_check_list->get_single($check_list_id);
+
+ $control =
$this->so_control->get_single($check_list->get_control_id());
+ $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
+
+ $saved_groups_with_items_array = array();
+
+ //Populating array with saved control items for each
group
+ foreach ($control_groups as $control_group)
+ {
+ $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
$control_group->get_id());
+
+ $control_item =
$this->so_control_item->get_single($control_item_id);
+
+ $saved_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
+ }
+
+ $data = array
+ (
+ 'saved_groups_with_items_array' =>
$saved_groups_with_items_array,
+ 'check_list'
=> $check_list->toArray()
+ );
+
+ $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+
+ $xslttemplate->add_file(array(PHPGW_SERVER_ROOT .
'/controller/templates/base/check_list/print_check_list'));
+
+ $xslttemplate->set_var('phpgw',array('view_control_items' =>
$data));
+
+ $xslttemplate->xsl_parse();
+ $xslttemplate->xml_parse();
+
+ $xml = new DOMDocument;
+ $xml->loadXML($xslttemplate->xmldata);
+ $xsl = new DOMDocument;
+ $xsl->loadXML($xslttemplate->xsldata);
+
+ // Configure the transformer
+ $proc = new XSLTProcessor;
+ $proc->importStyleSheet($xsl); // attach the xsl rules
+
+ $html = $proc->transformToXML($xml);
+
+ echo $html;
+ }
+
public function view_check_lists_for_control()
{
$control_id = phpgw::get_var('id');
Modified: trunk/controller/inc/class.uiprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.uiprocedure.inc.php 2012-01-06 09:26:10 UTC
(rev 8506)
+++ trunk/controller/inc/class.uiprocedure.inc.php 2012-01-06 10:49:07 UTC
(rev 8507)
@@ -51,7 +51,8 @@
'view'
=> true,
'add'
=> true,
'get_procedures' =>
true,
- 'view_procedures_for_control' => true
+ 'view_procedures_for_control' => true,
+ 'print_procedure' => true
);
public function __construct()
@@ -482,50 +483,85 @@
}
public function view_procedures_for_control(){
- $control_id = phpgw::get_var('control_id');
-
- $control =
$this->so_control->get_single($control_id);
-
- $control_procedure = $this->so->get_single(
$control->get_procedure_id() );
-
- $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control_id);
+ $control_id = phpgw::get_var('control_id');
- $group_procedures_array = array();
-
- foreach ($control_groups as $control_group)
- {
- $group_procedure =
$this->so->get_single( $control_group->get_procedure_id() );
- $group_procedures_array[] =
array("control_group" => $control_group->toArray(), "procedure" =>
$group_procedure->toArray());
- }
-
- $data = array
- (
- 'control_procedure'
=> $control_procedure->toArray(),
- 'group_procedures_array' =>
$group_procedures_array
- );
-
- $xslttemplate =
CreateObject('phpgwapi.xslttemplates');
-
- $xslttemplate->add_file(array(PHPGW_SERVER_ROOT .
'/controller/templates/base/procedure/view_procedures_for_control'));
-
-
$xslttemplate->set_var('phpgw',array('view_procedures_for_control' => $data));
-
- $xslttemplate->xsl_parse();
- $xslttemplate->xml_parse();
+ $control = $this->so_control->get_single($control_id);
+
+ $control_procedure = $this->so->get_single(
$control->get_procedure_id() );
+
+ $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control_id);
- $xml = new DOMDocument;
- $xml->loadXML($xslttemplate->xmldata);
+ $group_procedures_array = array();
+
+ foreach ($control_groups as $control_group)
+ {
+ $group_procedure = $this->so->get_single(
$control_group->get_procedure_id() );
+ $group_procedures_array[] =
array("control_group" => $control_group->toArray(), "procedure" =>
$group_procedure->toArray());
+ }
+
+ $data = array
+ (
+ 'control_procedure' =>
$control_procedure->toArray(),
+ 'group_procedures_array' =>
$group_procedures_array
+ );
+
+ $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+
+ $xslttemplate->add_file(array(PHPGW_SERVER_ROOT .
'/controller/templates/base/procedure/view_procedures_for_control'));
+
+ $xslttemplate->set_var('phpgw',array('view_procedures_for_control'
=> $data));
+
+ $xslttemplate->xsl_parse();
+ $xslttemplate->xml_parse();
- $xsl = new DOMDocument;
- $xsl->loadXML($xslttemplate->xsldata);
+ $xml = new DOMDocument;
+ $xml->loadXML($xslttemplate->xmldata);
+
+ $xsl = new DOMDocument;
+ $xsl->loadXML($xslttemplate->xsldata);
+
+ // Configure the transformer
+ $proc = new XSLTProcessor;
+ $proc->importStyleSheet($xsl); // attach the xsl rules
- // Configure the transformer
- $proc = new XSLTProcessor;
- $proc->importStyleSheet($xsl); // attach the xsl rules
+ $html = $proc->transformToXML($xml);
+
+ echo $html;
+ }
- $html = $proc->transformToXML($xml);
+ public function print_procedure(){
+ $procedure_id = phpgw::get_var('procedure_id');
+
+ $procedure = $this->so->get_single($procedure_id);
+
+ $data = array
+ (
+ 'procedure' =>
$procedure->toArray()
+ );
+
+ $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+
+ $xslttemplate->add_file(array(PHPGW_SERVER_ROOT .
'/controller/templates/base/procedure/print_procedure'));
+
+ $xslttemplate->set_var('phpgw',array('print_procedure' => $data));
+
+ $xslttemplate->xsl_parse();
+ $xslttemplate->xml_parse();
- echo $html;
+ $xml = new DOMDocument;
+ $xml->loadXML($xslttemplate->xmldata);
+
+ $xsl = new DOMDocument;
+ $xsl->loadXML($xslttemplate->xsldata);
+
+ // Configure the transformer
+ $proc = new XSLTProcessor;
+ $proc->importStyleSheet($xsl); // attach the xsl rules
+ $proc->registerPHPFunctions();
+
+ $html = $proc->transformToXML($xml);
+
+ echo $html;
}
public function query()
Added: trunk/controller/templates/base/check_list/print_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/print_check_list.xsl
(rev 0)
+++ trunk/controller/templates/base/check_list/print_check_list.xsl
2012-01-06 10:49:07 UTC (rev 8507)
@@ -0,0 +1,74 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_control_items">
+
+<ul class="groups">
+ <xsl:for-each select="saved_groups_with_items_array">
+ <li class="drag_group 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">
+ <xsl:variable
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
+ <input type="hidden" name="control_group_id"
value="{$control_group_id}" />
+
+ <ul id="list">
+ <xsl:for-each select="control_items">
+ <xsl:variable
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+ <xsl:variable name="order_tag">
+ <xsl:choose>
+ <xsl:when
test="order_nr > 0">
+
<xsl:value-of select="order_nr"/>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:number/>
+ </xsl:otherwise>
+
</xsl:choose>:<xsl:value-of select="id"/>
+ </xsl:variable>
+
+ <li class="list_item">
+ <span
class="order_nr"><xsl:number/></span>. <xsl:value-of select="title"/><input
type="hidden" name="order_nr[]" value="{$order_tag}" />
+ </li>
+ </xsl:for-each>
+ </ul>
+ </form>
+ </li>
+ </xsl:for-each>
+</ul>
+
+<style>
+.btn{
+ background: none repeat scroll 0 0 #2647A0;
+ color: #FFFFFF;
+ display: inline-block;
+ margin-right: 5px;
+ padding: 5px 10px;
+ text-decoration: none;
+ border: 1px solid #173073;
+ cursor: pointer;
+}
+
+ul{
+ list-style: none outside none;
+}
+
+li{
+ list-style: none outside none;
+}
+
+ul.groups li {
+ padding: 3px 0;
+}
+
+ul.groups li.odd{
+ background: none repeat scroll 0 0 #DBE7F5;
+}
+
+ul.groups h3 {
+ font-size: 18px;
+ margin: 0 0 5px;
+}
+
+</style>
+<a style="margin:20px 0 0 40px;" href="#print" class="btn"
onClick="window.print()">Skriv ut</a>
+
+</xsl:template>
Property changes on:
trunk/controller/templates/base/check_list/print_check_list.xsl
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/controller/templates/base/check_list/view_control_info.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_control_info.xsl
2012-01-06 09:26:10 UTC (rev 8506)
+++ trunk/controller/templates/base/check_list/view_control_info.xsl
2012-01-06 10:49:07 UTC (rev 8507)
@@ -101,8 +101,8 @@
<a id="view_control_items">
<xsl:attribute name="href">
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_items</xsl:text>
- <xsl:text>&control_id=</xsl:text>
- <xsl:value-of select="control/id"/>
+ <xsl:text>&check_list_id=</xsl:text>
+ <xsl:value-of select="check_list/id"/>
</xsl:attribute>
Kontrollpunkter
</a>
Modified: trunk/controller/templates/base/check_list/view_control_items.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_control_items.xsl
2012-01-06 09:26:10 UTC (rev 8506)
+++ trunk/controller/templates/base/check_list/view_control_items.xsl
2012-01-06 10:49:07 UTC (rev 8507)
@@ -46,8 +46,13 @@
</li>
</xsl:for-each>
</ul>
+<a style="margin-top:20px;" id="print_control_items" class="btn"
target="_blank">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list.print_check_list</xsl:text>
+ <xsl:text>&check_list_id=</xsl:text>
+ <xsl:value-of select="check_list/id"/>
+ </xsl:attribute>
+ Skriv ut
+</a>
-
-
-
</xsl:template>
Added: trunk/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- trunk/controller/templates/base/procedure/print_procedure.xsl
(rev 0)
+++ trunk/controller/templates/base/procedure/print_procedure.xsl
2012-01-06 10:49:07 UTC (rev 8507)
@@ -0,0 +1,191 @@
+<!-- $Id: procedure_item.xsl 8503 2012-01-06 08:13:27Z erikhl $ -->
+<!-- item -->
+
+<xsl:template match="print_procedure" xmlns:php="http://php.net/xsl">
+<xsl:variable name="dateformat"><xsl:value-of select="dateformat"
/></xsl:variable>
+
+<div style="margin:40px 0 0 40px;">
+ <dl class="proplist-col">
+ <dt>
+ <label for="title"><xsl:value-of
select="php:function('lang','Procedure title')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <input type="text" name="title"
id="title" value="{procedure/title}" size="100"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="procedure/title"
/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="revision_no"><xsl:value-of
select="php:function('lang','Procedure revision')" /></label>
+ </dt>
+ <dd>
+ <xsl:value-of select="procedure/revision_no" />
+ </dd>
+ <dt>
+ <label for="control_area"><xsl:value-of
select="php:function('lang','Control area')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <select id="control_area"
name="control_area">
+ <xsl:apply-templates
select="control_area/options"/>
+ </select>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="procedure/control_area_name" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="start_date"><xsl:value-of
select="php:function('lang','Procedure start date')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <xsl:value-of
disable-output-escaping="yes" select="start_date"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable
name="startdate"><xsl:value-of select="procedure/start_date" /></xsl:variable>
+ <xsl:value-of
select="php:function('date', $dateformat, $startdate)" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="revision_date"><xsl:value-of
select="php:function('lang','Procedure revision date')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <xsl:value-of
disable-output-escaping="yes" select="revision_date"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="procedure/revision_date
!= 0">
+ <xsl:variable
name="revisiondate"><xsl:value-of select="procedure/revision_date"
/></xsl:variable>
+ <xsl:value-of
select="php:function('date', $dateformat, $revisiondate)" />
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <xsl:if test="procedure/end_date != 0">
+ <dt>
+ <label for="end_date"><xsl:value-of
select="php:function('lang','Procedure end date')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <xsl:value-of
disable-output-escaping="yes" select="end_date"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable
name="enddate"><xsl:value-of select="procedure/end_date" /></xsl:variable>
+ <xsl:value-of
select="php:function('date', $dateformat, $enddate)" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ </xsl:if>
+ <dt>
+ <label for="purpose"><xsl:value-of
select="php:function('lang','Procedure purpose')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <textarea id="purpose" name="purpose"
rows="5" cols="60"><xsl:value-of select="procedure/purpose"
disable-output-escaping="yes"/></textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="procedure/purpose" disable-output-escaping="yes"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="responsibility"><xsl:value-of
select="php:function('lang','Procedure responsibility')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <textarea id="responsibility"
name="responsibility" rows="5" cols="60"><xsl:value-of
select="procedure/responsibility" /></textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="procedure/responsibility" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="description"><xsl:value-of
select="php:function('lang','Procedure description')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <textarea id="description"
name="description" rows="5" cols="60"><xsl:value-of
select="procedure/description" disable-output-escaping="yes"/></textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="procedure/description" disable-output-escaping="yes"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="reference"><xsl:value-of
select="php:function('lang','Procedure Reference')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <input type="text" name="reference"
id="reference" value="{procedure/reference}" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="procedure/reference" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label for="attachment"><xsl:value-of
select="php:function('lang','Procedure Attachment')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <input type="text" name="attachment"
id="attachment" value="{procedure/attachment}" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="procedure/attachment" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ </dl>
+</div>
+<style>
+ .btn{
+ background: none repeat scroll 0 0 #2647A0;
+ color: #FFFFFF;
+ display: inline-block;
+ margin-right: 5px;
+ padding: 5px 10px;
+ text-decoration: none;
+ border: 1px solid #173073;
+ cursor: pointer;
+ }
+
+ ul{
+ list-style: none outside none;
+ }
+
+ li{
+ list-style: none outside none;
+ }
+
+ ul.groups li {
+ padding: 3px 0;
+ }
+
+ ul.groups li.odd{
+ background: none repeat scroll 0 0 #DBE7F5;
+ }
+
+ ul.groups h3 {
+ font-size: 18px;
+ margin: 0 0 5px;
+ }
+
+ </style>
+ <a style="margin:20px 0 0 40px;" href="#print" class="btn"
onClick="window.print()">Skriv ut</a>
+</xsl:template>
\ No newline at end of file
Property changes on:
trunk/controller/templates/base/procedure/print_procedure.xsl
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
===================================================================
--- trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
2012-01-06 09:26:10 UTC (rev 8506)
+++ trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
2012-01-06 10:49:07 UTC (rev 8507)
@@ -4,6 +4,14 @@
<h3 style="margin:5px 0;">Prosedyre for kontroll</h3>
<span>Tittel: </span><xsl:value-of select="control_procedure/title"/>
+ <a style="display:block;margin-top:5px;" id="print_control_items"
target="_blank">
+ <xsl:attribute name="href">
+
<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:attribute>
+ Skriv ut
+ </a>
<h3 style="margin:15px 0 3px 0;">Prosedyrer for grupper</h3>
@@ -13,7 +21,14 @@
<h4 style="margin:2px 0;"><xsl:value-of
select="procedure/title"/></h4>
<div style="margin-left:10px;">
<span>Gruppe: </span><xsl:value-of
select="control_group/group_name"/>
- <span style="margin-left:10px;">Skriv
ut</span>
+ <a
style="display:block;margin-top:5px;" id="print_control_items" target="_blank">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uiprocedure.print_procedure</xsl:text>
+
<xsl:text>&procedure_id=</xsl:text>
+ <xsl:value-of
select="procedure/id"/>
+ </xsl:attribute>
+ Skriv ut
+ </a>
</div>
</li>
</xsl:for-each>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8507],
Torstein <=