fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [10502] logistic: tinybox


From: Sigurd Nes
Subject: [Fmsystem-commits] [10502] logistic: tinybox
Date: Fri, 09 Nov 2012 17:40:41 +0000

Revision: 10502
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10502
Author:   sigurdne
Date:     2012-11-09 17:40:39 +0000 (Fri, 09 Nov 2012)
Log Message:
-----------
logistic: tinybox

Modified Paths:
--------------
    trunk/logistic/inc/class.uiactivity.inc.php
    trunk/logistic/inc/class.uirequirement.inc.php
    trunk/logistic/templates/base/requirement/requirement_item.xsl
    trunk/logistic/templates/base/requirement/requirement_overview.xsl

Modified: trunk/logistic/inc/class.uiactivity.inc.php
===================================================================
--- trunk/logistic/inc/class.uiactivity.inc.php 2012-11-09 14:28:33 UTC (rev 
10501)
+++ trunk/logistic/inc/class.uiactivity.inc.php 2012-11-09 17:40:39 UTC (rev 
10502)
@@ -693,6 +693,9 @@
                        
                        self::add_javascript('logistic', 'logistic', 
'resource_allocation.js');
                        self::add_javascript('logistic', 'logistic', 
'requirement.js');
+                       self::add_javascript('phpgwapi', 'tinybox2', 
'packed.js');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');
+
                        
self::render_template_xsl(array('activity/view_activity_item', 
'requirement/requirement_overview', 'activity/activity_tabs'), $data);
                }
 

Modified: trunk/logistic/inc/class.uirequirement.inc.php
===================================================================
--- trunk/logistic/inc/class.uirequirement.inc.php      2012-11-09 14:28:33 UTC 
(rev 10501)
+++ trunk/logistic/inc/class.uirequirement.inc.php      2012-11-09 17:40:39 UTC 
(rev 10502)
@@ -307,6 +307,13 @@
 
                public function view()
                {
+                       if( $nonavbar   = phpgw::get_var('nonavbar', 'bool'))
+                       {
+                               $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
$nonavbar;
+                               $GLOBALS['phpgw_info']['flags']['noheader_xsl'] 
= true;
+                               $GLOBALS['phpgw_info']['flags']['nofooter']     
        = true;
+                       }
+
                        $requirement_id = phpgw::get_var('id');
 
                        if(isset($_POST['edit_requirement']))
@@ -347,6 +354,13 @@
 
                public function edit($requirement = null)
                {
+                       if( $nonavbar   = phpgw::get_var('nonavbar', 'bool'))
+                       {
+                               $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
$nonavbar;
+                               $GLOBALS['phpgw_info']['flags']['noheader_xsl'] 
= true;
+                               $GLOBALS['phpgw_info']['flags']['nofooter']     
        = true;
+                       }
+
                        $requirement_id = phpgw::get_var('id');
                        $activity_id = phpgw::get_var('activity_id');
 
@@ -416,11 +430,12 @@
 
                        $data = array
                        (
-                               'tabs'                                          
        => $GLOBALS['phpgw']->common->create_tabs($tabs, 0),
-                               'view'                                          
        => "requirement_details",
-                               'requirement'                   => $requirement,
+                               'tabs'                          => 
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
+                               'view'                          => 
"requirement_details",
+                               'requirement'           => $requirement,
                                'distict_locations' => $distict_locations_array,
-                               'editable' => true,
+                               'editable'                      => true,
+                               'nonavbar'                      => $nonavbar
                        );
 
                        if($activity_id > 0)
@@ -444,6 +459,14 @@
                        $requirement_id = phpgw::get_var('id', 'int');
                        $new_location_id = phpgw::get_var('location_id');
                        
+                       if( $nonavbar   = phpgw::get_var('nonavbar', 'bool'))
+                       {
+                               $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
$nonavbar;
+                               $GLOBALS['phpgw_info']['flags']['noheader_xsl'] 
= true;
+                               $GLOBALS['phpgw_info']['flags']['nofooter']     
        = true;
+                       }
+
+
                        if ($requirement_id)
                        {
                                $requirement = 
$this->so->get_single($requirement_id);
@@ -481,7 +504,7 @@
 //                                     $db_requirement->transaction_abort();
                                }                       
                                
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id, 
'nonavbar' => $nonavbar));
                        }
                        else
                        {

Modified: trunk/logistic/templates/base/requirement/requirement_item.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-11-09 14:28:33 UTC (rev 10501)
+++ trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-11-09 17:40:39 UTC (rev 10502)
@@ -1,12 +1,19 @@
 <xsl:template name="requirement_details" xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format"><xsl:value-of 
select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')"/></xsl:variable>
 <xsl:variable name="datetime_format"><xsl:value-of 
select="$date_format"/><xsl:text> H:i</xsl:text></xsl:variable>
+<xsl:variable name="nonavbar"><xsl:value-of select="nonavbar"/></xsl:variable>
 
+<xsl:variable name="action_params">
+       <xsl:text>menuaction:logistic.uirequirement.save, nonavbar:</xsl:text>
+               <xsl:value-of select="nonavbar" />
+</xsl:variable>
+<xsl:variable name="action_url">
+       <xsl:value-of select="php:function('get_phpgw_link', '/index.php', 
$action_params )" />
+</xsl:variable>
+
+
 <div class="content-wrp">
        <div id="details">
-               <xsl:variable name="action_url">
-                       <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:logistic.uirequirement.save')" />
-               </xsl:variable>
                <form action="{$action_url}" method="post">
                        <input type="hidden" name="id" value = 
"{requirement/id}" />
                        <input type="hidden" id="activity_id" 
name="activity_id" value="{activity/id}" />
@@ -14,6 +21,7 @@
                        <dl class="proplist-col">
                                <dt>
                                        <label 
for="start_date">Startdato</label>
+                                       <xsl:value-of select="$nonavbar"/>
                                </dt>
                                <dd>
                                        <xsl:choose>
@@ -122,10 +130,10 @@
                                <xsl:variable name="view_resources_params">
                                        
<xsl:text>menuaction:logistic.uiactivity.view_resource_allocation, 
activity_id:</xsl:text>
                                                <xsl:value-of 
select="activity/id" />
-                                       </xsl:variable>
-                                       <xsl:variable name="view_resources_url">
-                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $view_resources_params )" 
/>
                                </xsl:variable>
+                               <xsl:variable name="view_resources_url">
+                                       <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $view_resources_params )" 
/>
+                               </xsl:variable>
                                
                                <xsl:choose>
                                        <xsl:when test="editable">

Modified: trunk/logistic/templates/base/requirement/requirement_overview.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_overview.xsl  
2012-11-09 14:28:33 UTC (rev 10501)
+++ trunk/logistic/templates/base/requirement/requirement_overview.xsl  
2012-11-09 17:40:39 UTC (rev 10502)
@@ -18,6 +18,9 @@
 <xsl:template name="requirement_overview" xmlns:php="http://php.net/xsl";>
        <div id="resource_alloc_wrp" class="content-wrp">
        
+                       <xsl:variable name="activity_id">
+                               <xsl:value-of select="activity/id" />
+                       </xsl:variable>
                        <xsl:variable name="add_req_params">
                                
<xsl:text>menuaction:logistic.uirequirement.edit, activity_id:</xsl:text>
                                <xsl:value-of select="activity/id" />
@@ -27,7 +30,7 @@
                        </xsl:variable>
                        
                        <h2 style="float:left;"><xsl:value-of 
select="php:function('lang', 'Resource requirement')" /></h2>
-                       <a id="add-requirement-btn" class="btn focus" 
href="{$add_req_url}"><xsl:value-of select="php:function('lang', 'Add 
requirement')" /></a>
+                       <a id="add-requirement-btn" class="btn focus" 
onClick="load_requirement_edit({$activity_id});"><xsl:value-of 
select="php:function('lang', 'Add requirement')" /></a>
                        <div style="clear:both;" id="paging"></div>
                        <div style="margin-bottom: 40px;" 
id="requirement-container"></div>
                                
@@ -40,6 +43,20 @@
 <xsl:template name="datasource-def">
 
        <script>
+
+       function load_requirement_edit( activity_id ){
+               var oArgs = {menuaction: 'logistic.uirequirement.edit', 
activity_id:activity_id, nonavbar: true, lean: true};
+               var requestUrl = phpGWLink('index.php', oArgs);
+
+               TINY.box.show({iframe:requestUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
+       }
+
+       function closeJS_local()
+       {
+               var reqUrl = '<xsl:value-of select="//datatable/source"/>';
+               YAHOO.portico.inlineTableHelper('requirement-container', 
reqUrl, YAHOO.portico.columnDefs);
+       }
+
        YAHOO.util.Event.onDOMReady(function(){
         
        YAHOO.portico.columnDefs = [
@@ -98,4 +115,4 @@
                                
YAHOO.portico.inlineTableHelper('allocation-container', requestUrl, 
myColumnDefs);
                }
   </script>
-</xsl:template>
\ No newline at end of file
+</xsl:template>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]