fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10974] property: condition survey


From: Sigurd Nes
Subject: [Fmsystem-commits] [10974] property: condition survey
Date: Fri, 08 Mar 2013 14:12:39 +0000

Revision: 10974
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10974
Author:   sigurdne
Date:     2013-03-08 14:12:37 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
property: condition survey

Modified Paths:
--------------
    trunk/property/inc/class.borequest.inc.php
    trunk/property/inc/class.menu.inc.php
    trunk/property/inc/hook_config.inc.php
    trunk/property/setup/phpgw_no.lang
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/css/base.css
    trunk/property/templates/base/request.xsl

Modified: trunk/property/inc/class.borequest.inc.php
===================================================================
--- trunk/property/inc/class.borequest.inc.php  2013-03-08 10:16:18 UTC (rev 
10973)
+++ trunk/property/inc/class.borequest.inc.php  2013-03-08 14:12:37 UTC (rev 
10974)
@@ -63,7 +63,7 @@
                        $this->bocommon                         = 
CreateObject('property.bocommon');
                        $this->solocation                       = 
CreateObject('property.solocation');
                        $this->historylog                       = 
CreateObject('property.historylog','request');
-                       $this->cats                                     = 
CreateObject('phpgwapi.categories', -1,  'property', '.project');
+                       $this->cats                                     = 
CreateObject('phpgwapi.categories', -1,  'property', '.project.request');
                        $this->cats->supress_info       = true;
                        $this->custom                           = & 
$this->so->custom;
 //                     $this->acl_location                     = 
'.project.request';

Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php       2013-03-08 10:16:18 UTC (rev 
10973)
+++ trunk/property/inc/class.menu.inc.php       2013-03-08 14:12:37 UTC (rev 
10974)
@@ -472,6 +472,11 @@
                                                        'text'  => lang('User 
contact info'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin.contact_info') )
                                                ),
+                                               'request_cats'  => array
+                                               (
+                                                       'text'  => 
lang('request categories'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'property', 'location' => 
'.project.request', 'global_cats' => 'true', 'menu_selection' => 
'admin::property::request_cats') )
+                                               ),
                                                'request_status'        => array
                                                (
                                                        'text'  => 
lang('Request status'),

Modified: trunk/property/inc/hook_config.inc.php
===================================================================
--- trunk/property/inc/hook_config.inc.php      2013-03-08 10:16:18 UTC (rev 
10973)
+++ trunk/property/inc/hook_config.inc.php      2013-03-08 14:12:37 UTC (rev 
10974)
@@ -352,7 +352,7 @@
                        3 => 'Combined::Investment/Operation',
                );
 
-               $cats   = CreateObject('phpgwapi.categories', -1, 'property', 
'.project');
+               $cats   = CreateObject('phpgwapi.categories', -1, 'property', 
'.project.request');
                $cats->supress_info = true;
                $values = $cats->return_sorted_array(0, false, '', '', '', 
$globals = true, '', $use_acl = false);
 

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2013-03-08 10:16:18 UTC (rev 10973)
+++ trunk/property/setup/phpgw_no.lang  2013-03-08 14:12:37 UTC (rev 10974)
@@ -578,6 +578,7 @@
 do you really want to update the categories again      property        no      
vil du virkelig oppdatere kategoriene igjen
 do you want to perform this action     property        no      Vil du 
gjennomføre denne handlingen
 draft  property        no      UTKAST
+economy and progress   property        no      Økonomi og fremdrift
 edit activity  property        no      rette aktivitet
 edit agreement property        no      rette avtale
 edit agreement group   property        no      Rette avtale gruppe

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2013-03-08 10:16:18 UTC (rev 
10973)
+++ trunk/property/setup/tables_update.inc.php  2013-03-08 14:12:37 UTC (rev 
10974)
@@ -7432,7 +7432,7 @@
        function property_upgrade0_9_17_666()
        {
                $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
-
+/*
                
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request','recommended_year',array(
                                'type' =>       'int',
                                'precision' => 4,
@@ -7461,12 +7461,52 @@
                                'uc' => array()
                        )
                );
+*/
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT DISTINCT 
fm_request.category, phpgw_categories.cat_name, 
phpgw_categories.cat_description FROM fm_request JOIN phpgw_categories ON 
fm_request.category = phpgw_categories.cat_id");
+               $request_cats = array();
 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $request_cats[]= array
+                       (
+                               'id'                            => 
$GLOBALS['phpgw_setup']->oProc->f('category'),
+                               'cat_name'                      => 
$GLOBALS['phpgw_setup']->oProc->f('cat_name'),
+                               'cat_description'       => 
$GLOBALS['phpgw_setup']->oProc->f('cat_description'),
+                       );
+               }
 
+               $location_id    = 
$GLOBALS['phpgw']->locations->get_id('property', '.project.request');
+
+               $i = 1;
+               foreach($request_cats as $old_cat)
+               {
+                       $value_set = array
+                       (
+                               'cat_main'                      => 0,
+                               'cat_parent'            => 0,
+                               'cat_level'                     => 0,
+                               'cat_owner'                     => -1,
+                               'cat_access'            =>'public',
+                               'cat_appname'           => 'property',
+                               'cat_name'                      => 
$old_cat['cat_name'],
+                               'cat_description'       => 
$old_cat['cat_description'],
+                               'last_mod'                      => time(),
+                               'location_id'           => $location_id
+                       );
+                       $i++;
+
+                       $cols = implode(',', array_keys($value_set));
+                       $values = 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($value_set));
+                       $sql = "INSERT INTO phpgw_categories ({$cols}) VALUES 
({$values})";
+                       
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+                       $cat_id = 
(int)$GLOBALS['phpgw_setup']->oProc->m_odb->get_last_insert_id('phpgw_categories','cat_id');
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
fm_request SET category = {$cat_id} WHERE category = {$old_cat['id']}");
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_categories SET cat_main= {$cat_id} WHERE 
cat_id={$cat_id}",__LINE__,__FILE__);
+               }
+
                if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
                {
                        $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.667';
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
-

Modified: trunk/property/templates/base/css/base.css
===================================================================
--- trunk/property/templates/base/css/base.css  2013-03-08 10:16:18 UTC (rev 
10973)
+++ trunk/property/templates/base/css/base.css  2013-03-08 14:12:37 UTC (rev 
10974)
@@ -1381,4 +1381,4 @@
 
 .yui-skin-sam .autocomplete .yui-ac-content li {
     white-space: wrap;
-}
\ No newline at end of file
+}

Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl   2013-03-08 10:16:18 UTC (rev 
10973)
+++ trunk/property/templates/base/request.xsl   2013-03-08 14:12:37 UTC (rev 
10974)
@@ -192,10 +192,8 @@
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
                                <div class="yui-content">
                                        <div id="general" class="content-wrp">
-                                               <dl class="proplist-col">
-                                                       <input type="hidden" 
name="values[origin]" value="{value_origin_type}"/>
-                                                       <input type="hidden" 
name="values[origin_id]" value="{value_origin_id}"/>
-                                                       <xsl:choose>
+ 
+                                                       <xsl:choose>
                                                                <xsl:when 
test="value_request_id!=''">
                                                                        
                                                                                
<dt><label>
@@ -216,38 +214,20 @@
                                                                                
<dd>
                                                                                
        <xsl:value-of select="value_request_id"/>
                                                                                
</dd>
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'entry date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_entry_date"/>
-                                                                               
</dd>
-                                                                       
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'in progress date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_in_progress_date"/>
-                                                                               
</dd>
-                                                                       
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'delivered date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_delivered_date"/>
-                                                                               
</dd>
-                                                                       
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'closed date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_closed_date"/>
-                                                                               
</dd>
-                                                                       
+
+                                               </xsl:when>
+                                       </xsl:choose>
+
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 
'location')"/>
+  </legend>
+                                               <dl class="proplist-col">
+                                                       <input type="hidden" 
name="values[origin]" value="{value_origin_type}"/>
+                                                       <input type="hidden" 
name="values[origin_id]" value="{value_origin_id}"/>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="value_request_id!=''">
+                                                               
                                                                        
<xsl:for-each select="value_origin">
                                                                                
                                                                                
        <dt><label>
@@ -338,6 +318,54 @@
                                                                </xsl:otherwise>
                                                        </xsl:choose>
 
+                                                               <dt><label>
+                                                                       
<xsl:value-of select="php:function('lang', 'building part')"/>
+                                                               </label></dt>
+                                                               <dd>
+                                                                       <select 
name="values[building_part]">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
+                                                                               
</xsl:attribute>
+                                                                               
<option value="0">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
+                                                                               
</option>
+                                                                               
<xsl:apply-templates select="building_part_list/options"/>
+                                                                       
</select>
+                                                               </dd>
+
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="suppressmeter =''">
+                                                                       
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="lang_power_meter"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <input type="text" name="values[power_meter]" 
value="{value_power_meter}" size="12">
+                                                                               
                <xsl:attribute name="title">
+                                                                               
                        <xsl:value-of select="lang_power_meter_statustext"/>
+                                                                               
                </xsl:attribute>
+                                                                               
        </input>
+                                                                               
</dd>
+                                                                       
+                                                               </xsl:when>
+                                                       </xsl:choose>
+
+                                               </dl>
+
+ </fieldset>
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 
'description')"/>
+  </legend>
+                                               <dl class="proplist-col">
+
+                                                       <dt><label>
+                                                               <xsl:value-of 
select="php:function('lang', 'category')"/>
+                                                       </label></dt>
+                                                       <dd>
+                                                               
<xsl:call-template name="categories"/>
+                                                       </dd>
+
                                                        <xsl:variable 
name="lang_request_title">
                                                                <xsl:value-of 
select="php:function('lang', 'enter request title')"/>
                                                        </xsl:variable>
@@ -363,6 +391,14 @@
                                                                        
</textarea>
                                                                </dd>
                                                        
+                                               </dl>
+ </fieldset>
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 
'condition')"/>
+  </legend>
+                                               <dl class="proplist-col">
+
                                                <table>
                                                        <xsl:apply-templates 
select="custom_attributes/attributes"/>
                                                        <tr>
@@ -473,56 +509,16 @@
                                                                        
<xsl:value-of select="value_score"/>
                                                                </dd>
 -->
+                                               </dl>
+ </fieldset>
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 'economy and 
progress')"/>
+  </legend>
+
+                                               <dl class="proplist-col">       
                                
                                                        
                                                                <dt><label>
-                                                                       
<xsl:value-of select="php:function('lang', 'cost categories')"/>
-                                                               </label></dt>
-                                                               <dd>
-                                                                       
<xsl:call-template name="categories"/>
-                                                               </dd>
-                                                       
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="suppressmeter =''">
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="lang_power_meter"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <input type="text" name="values[power_meter]" 
value="{value_power_meter}" size="12">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="lang_power_meter_statustext"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</dd>
-                                                                       
-                                                               </xsl:when>
-                                                       </xsl:choose>
-                                                       
-                                                               <dt><label>
-                                                                       
<xsl:value-of select="php:function('lang', 'building part')"/>
-                                                               </label></dt>
-                                                               <dd>
-                                                                       <select 
name="values[building_part]">
-                                                                               
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
-                                                                               
</xsl:attribute>
-                                                                               
<option value="0">
-                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
-                                                                               
</option>
-                                                                               
<xsl:apply-templates select="building_part_list/options"/>
-                                                                       
</select>
-                                                               </dd>
-                                                       
-                                                       
-                                                               <dt><label>
-                                                                       
<xsl:value-of select="lang_coordinator"/>
-                                                               </label></dt>
-                                                               <dd>
-                                                                       
<xsl:call-template name="user_id_select"/>
-                                                               </dd>
-                                                       
-                                                       
-                                                               <dt><label>
                                                                        
<xsl:value-of select="php:function('lang', 'status')"/>
                                                                </label></dt>
                                                                <dd>
@@ -553,6 +549,14 @@
                                                                </dd>
 
                                                                <dt><label>
+                                                                       
<xsl:value-of select="lang_coordinator"/>
+                                                               </label></dt>
+                                                               <dd>
+                                                                       
<xsl:call-template name="user_id_select"/>
+                                                               </dd>
+                                                       
+
+                                                               <dt><label>
                                                                        
<xsl:value-of select="php:function('lang', 'recommended year')"/>
                                                                </label></dt>
                                                                <dd>
@@ -589,6 +593,37 @@
                                                                        
                                                                </xsl:when>
                                                        </xsl:choose>
+
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'entry date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_entry_date"/>
+                                                                               
</dd>
+<!--                                                                   
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'in progress date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_in_progress_date"/>
+                                                                               
</dd>
+                                                                       
+                                                                       
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'delivered date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_delivered_date"/>
+                                                                               
</dd>
+                                                                       
+                                                                       
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'closed date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_closed_date"/>
+                                                                               
</dd>
+-->
                                                        
                                                                <dt><label>
                                                                        
<xsl:value-of select="php:function('lang', 'investment')"/>
@@ -719,6 +754,7 @@
                                                                </xsl:choose>
                                                        
                                                </dl>
+ </fieldset>
                                        </div>
                                        <div id="documents">
                                                <table>




reply via email to

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