fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11837] property: save new on request


From: Sigurd Nes
Subject: [Fmsystem-commits] [11837] property: save new on request
Date: Mon, 17 Mar 2014 15:33:29 +0000

Revision: 11837
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11837
Author:   sigurdne
Date:     2014-03-17 15:33:17 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
property: save new on request

Modified Paths:
--------------
    trunk/property/inc/class.socondition_survey.inc.php
    trunk/property/inc/class.sorequest.inc.php
    trunk/property/inc/class.uirequest.inc.php
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/condition_survey.xsl
    trunk/property/templates/base/request.xsl

Modified: trunk/property/inc/class.socondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.socondition_survey.inc.php 2014-03-17 08:37:10 UTC 
(rev 11836)
+++ trunk/property/inc/class.socondition_survey.inc.php 2014-03-17 15:33:17 UTC 
(rev 11837)
@@ -249,8 +249,6 @@
                        $this->_db->transaction_begin();
                        try
                        {
-                               $sql = "UPDATE {$table} SET $value_set WHERE 
id= {$id}";
-
                                $this->_db->Exception_On_Error = true;
 
                                if($old_coordinator_id != 
$value_set['coordinator_id'])

Modified: trunk/property/inc/class.sorequest.inc.php
===================================================================
--- trunk/property/inc/class.sorequest.inc.php  2014-03-17 08:37:10 UTC (rev 
11836)
+++ trunk/property/inc/class.sorequest.inc.php  2014-03-17 15:33:17 UTC (rev 
11837)
@@ -1043,7 +1043,12 @@
                        $value_set['recommended_year']                  = (int) 
$request['recommended_year'];
                        $value_set['multiplier']                                
= $request['multiplier'] ? (float)$request['multiplier'] : 1;
                        
-
+               
+                       if($request['origin'][0]['location'] == 
'.project.condition_survey' && $request['origin'][0]['data'][0]['id'] && 
!$value_set['condition_survey_id']);
+                       {
+                               $value_set['condition_survey_id']       = 
(int)$request['origin'][0]['data'][0]['id'];
+                       }
+                       
                        $cols = implode(',', array_keys($value_set));
                        $values = 
$this->_db->validate_insert(array_values($value_set));
 

Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php  2014-03-17 08:37:10 UTC (rev 
11836)
+++ trunk/property/inc/class.uirequest.inc.php  2014-03-17 15:33:17 UTC (rev 
11837)
@@ -1182,7 +1182,7 @@
 
 //                     _debug_array($values);die();
 
-                       if ($values['save'] && $mode == 'edit')
+                       if (($values['save'] || $values['save_new']) && $mode 
== 'edit')
                        {
                                if(!$values['location'])
                                {
@@ -1372,6 +1372,22 @@
                                                
$values['p'][$values['extra']['p_entity_id']]['p_cat_name']=phpgw::get_var('entity_cat_name_'.$values['extra']['p_entity_id'],
 'string', 'POST');
                                        }
                                }
+
+                               if(isset($values['save_new']) && 
$values['save_new'] && !$receipt['error'])
+                               {
+                                       $values = $this->bo->read_single($id);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uirequest.edit',
+                                                       'location_code' => 
$values['location_code'],
+                                                       'p_entity_id'   => 
$values['p_entity_id'],
+                                                       'p_cat_id'              
=> $values['p_cat_id'],
+                                                       'p_num'                 
=> $values['p_num'],
+                                                       'origin'                
=> isset($values['origin'][0]) ? $values['origin'][0]['location'] : '',
+                                                       'origin_id'             
=>  isset($values['origin'][0]) ? $values['origin'][0]['data'][0]['id'] : ''
+                                               )
+                                       );
+                               }
                        }
 
                        if(!$receipt['error'] && !$bypass && $id)
@@ -1723,8 +1739,6 @@
                        //              'location_type'                         
                => 'form2',
                                        'form_action'                           
                => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                        'done_action'                           
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.index')),
-                                       'lang_save'                             
                        => lang('save'),
-                                       'lang_done'                             
                        => lang('done'),
 
                                        'lang_request_id'                       
                => lang('request ID condition'),
                                        'value_request_id'                      
                => $id,

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2014-03-17 08:37:10 UTC (rev 11836)
+++ trunk/property/setup/phpgw_no.lang  2014-03-17 15:33:17 UTC (rev 11837)
@@ -1123,6 +1123,7 @@
 new value      property        no      Ny verdi
 new value for multiple choice  property        no      Ny verdi for fler-valg
 new values     property        no      Nye verdier
+new record     property        no      Ny Post
 next run       property        no      Neste kjøring
 no access      property        no      Ingen tilgang
 no account     property        no      Ingen konto
@@ -1464,6 +1465,7 @@
 save the workorder     property        no      lagre bestilling
 save this workorder as a template for later use        property        no      
lagre denne bestillingen som mal for senere bruk
 save values and exit   property        no      Lagre verdier og gå til liste
+save new       property        no      Lagre og Ny
 scale  property        no      Scale
 schedule       property        no      planlegge (tid)
 scheduled events       property        no      Planlagte oppgaver

Modified: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl  2014-03-17 08:37:10 UTC 
(rev 11836)
+++ trunk/property/templates/base/condition_survey.xsl  2014-03-17 15:33:17 UTC 
(rev 11837)
@@ -275,7 +275,7 @@
                                <dl class="proplist-col">
                                        <dt>
                                                <label>
-                                                       <a 
href="javascript:show_related_requests()">
+                                                       <a 
href="javascript:show_related_requests();">
                                                                <xsl:attribute 
name="title">
                                                                        
<xsl:value-of select="php:function('lang', 'details')"/>
                                                                </xsl:attribute>
@@ -283,6 +283,17 @@
                                                        </a>
                                                </label>
                                        </dt>
+                                       <dt>
+                                               <label>
+                                                       <xsl:variable 
name="lang_new_request"><xsl:value-of select="php:function('lang', 'new 
record')" /></xsl:variable>
+                                                       <a 
href="javascript:document.load_new_request_form.submit();">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="$lang_new_request"/>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="$lang_new_request"/>
+                                                       </a>
+                                               </label>
+                                       </dt>
 
                                        <dt>
                                                <label><xsl:value-of 
select="php:function('lang', 'request')"/></label>
@@ -359,8 +370,8 @@
 
                <xsl:variable name="edit_params">
                        <xsl:text>menuaction:property.uicondition_survey.edit, 
id:</xsl:text>
-                               <xsl:value-of select="survey/id" />
-                       </xsl:variable>
+                       <xsl:value-of select="survey/id" />
+               </xsl:variable>
                <xsl:variable name="edit_url">
                                <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $edit_params )" />
                </xsl:variable>
@@ -368,6 +379,21 @@
                <form name="load_edit_form" id="load_edit_form" 
action="{$edit_url}" method="post">
                </form>
 
+
+               <xsl:variable name="new_request_params">
+                       <xsl:text>menuaction:property.uirequest.edit, 
location_code:</xsl:text>
+                       <xsl:value-of select="survey/location_code" />
+                       <xsl:text>,origin:.project.condition_survey, 
origin_id:</xsl:text>
+                       <xsl:value-of select="survey/id" />
+               </xsl:variable>
+
+               <xsl:variable name="new_request_url">
+                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $new_request_params )" />
+               </xsl:variable>
+
+               <form name="load_new_request_form" id="load_new_request_form" 
action="{$new_request_url}" method="post">
+               </form>
+
        </xsl:template>
 
 <xsl:template name="datasource-definition">

Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl   2014-03-17 08:37:10 UTC (rev 
11836)
+++ trunk/property/templates/base/request.xsl   2014-03-17 15:33:17 UTC (rev 
11837)
@@ -46,7 +46,7 @@
                                        <tr height="50">
                                                <td>
                                                        <xsl:variable 
name="lang_save">
-                                                               <xsl:value-of 
select="lang_save"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'save')"/>
                                                        </xsl:variable>
                                                        <input type="submit" 
name="values[update]" value="{$lang_save}">
                                                        </input>
@@ -677,7 +677,7 @@
                                                        <xsl:when test="mode = 
'edit'">
                                                                <td 
style="padding-right: 5px;">
                                                                        
<xsl:variable name="lang_save">
-                                                                               
<xsl:value-of select="lang_save"/>
+                                                                               
<xsl:value-of select="php:function('lang', 'save')"/>
                                                                        
</xsl:variable>
                                                                        <input 
type="submit" name="values[save]" value="{$lang_save}">
                                                                                
<xsl:attribute name="title">
@@ -685,6 +685,16 @@
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                </td>
+                                                               <td>
+                                                                       
<xsl:variable name="lang_save_new">
+                                                                               
<xsl:value-of select="php:function('lang', 'save new')"/>
+                                                                       
</xsl:variable>
+                                                                       <input 
type="submit" name="values[save_new]" value="{$lang_save_new}">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="$lang_save_new"/>
+                                                                               
</xsl:attribute>
+                                                                       </input>
+                                                               </td>
                                                        </xsl:when>
                                                </xsl:choose>
                                                <td>
@@ -692,7 +702,7 @@
                                                                <xsl:value-of 
select="done_action"/>
                                                        </xsl:variable>
                                                        <xsl:variable 
name="lang_done">
-                                                               <xsl:value-of 
select="lang_done"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'done')"/>
                                                        </xsl:variable>
                                                        <input type="button" 
name="done" value="{$lang_done}" onclick="location.href='{$done_action}'">
                                                                <xsl:attribute 
name="title">




reply via email to

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