fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10543] property: more on condition survey


From: Sigurd Nes
Subject: [Fmsystem-commits] [10543] property: more on condition survey
Date: Tue, 27 Nov 2012 11:21:46 +0000

Revision: 10543
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10543
Author:   sigurdne
Date:     2012-11-27 11:21:45 +0000 (Tue, 27 Nov 2012)
Log Message:
-----------
property: more on condition survey

Modified Paths:
--------------
    trunk/property/inc/class.bocondition_survey.inc.php
    trunk/property/inc/class.fileuploader.inc.php
    trunk/property/inc/class.socondition_survey.inc.php
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/js/portico/condition_survey_edit.js
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/condition_survey.xsl

Modified: trunk/property/inc/class.bocondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.bocondition_survey.inc.php 2012-11-27 11:20:10 UTC 
(rev 10542)
+++ trunk/property/inc/class.bocondition_survey.inc.php 2012-11-27 11:21:45 UTC 
(rev 10543)
@@ -266,6 +266,24 @@
                        return $id;
                }
 
+
+               public function edit_title($data)
+               {
+                       try
+                       {
+                               $this->so->edit_title($data);
+                       }
+
+                       catch(Exception $e)
+                       {
+                               if ( $e )
+                               {
+                                       throw $e;                               
+                               }
+                       }
+               }
+               
+
                public function delete($id)
                {
                        $this->so->delete($id);

Modified: trunk/property/inc/class.fileuploader.inc.php
===================================================================
--- trunk/property/inc/class.fileuploader.inc.php       2012-11-27 11:20:10 UTC 
(rev 10542)
+++ trunk/property/inc/class.fileuploader.inc.php       2012-11-27 11:21:45 UTC 
(rev 10543)
@@ -125,6 +125,7 @@
                                                                //              
'scriptAccess'   : '{$scriptAccess}',//'sameDomain'|'always' Set to "always" to 
allow script access across domains
                                                                                
'multi'              : true,
                                                                                
'auto'           : true,
+                                                               //              
'debug'                  : true,
                                                                                
'fileExt'        : '{$fileExt}',
                                                                                
'fileDesc'       : 'Files ({$fileDesc})',
                                                                                
'queueID'        : 'queue',

Modified: trunk/property/inc/class.socondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.socondition_survey.inc.php 2012-11-27 11:20:10 UTC 
(rev 10542)
+++ trunk/property/inc/class.socondition_survey.inc.php 2012-11-27 11:21:45 UTC 
(rev 10543)
@@ -125,7 +125,7 @@
                        if($query)
                        {
                                $query                  = 
$this->_db->db_addslashes($query);
-                               $querymethod    = " {$where} name 
{$this->_like} '%{$query}%'";
+                               $querymethod    = " {$where} title 
{$this->_like} '%{$query}%'";
                        }
 
                        $sql = "SELECT * FROM {$table} $filtermethod 
$querymethod";
@@ -241,12 +241,59 @@
                        }
                }
 
-               function edit($data)
+               public function edit($data)
                {
                        $table = 'fm_condition_survey';
                        $id = (int)$data['id'];
 
                        $value_set      = $this->_get_value_set( $data );
+
+                       try
+                       {
+                               $this->_edit($id, $value_set);
+                       }
+
+                       catch(Exception $e)
+                       {
+                               if ( $e )
+                               {
+                                       throw $e;                               
+                               }
+                       }
+
+                       return $id;
+               }
+
+               public function edit_title($data)
+               {
+                       $id = (int)$data['id'];
+
+                       $value_set      = array
+                       (
+                               'title' => $data['title']
+                       );
+
+                       try
+                       {
+                               $this->_edit($id, $value_set);
+                       }
+
+                       catch(Exception $e)
+                       {
+                               if ( $e )
+                               {
+                                       throw $e;                               
+                               }
+                       }
+
+                       return $id;
+               }
+
+               private function _edit($id, $value_set)
+               {
+                       $table = 'fm_condition_survey';
+                       $id = (int)$id;
+
                        $value_set      = 
$this->_db->validate_update($value_set);
 
                        $this->_db->transaction_begin();

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-11-27 11:20:10 UTC 
(rev 10542)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-11-27 11:21:45 UTC 
(rev 10543)
@@ -37,14 +37,15 @@
                private $receipt = array();
                public $public_functions = array
                (
-                       'query'                 => true,
-                       'index'                 => true,
-                       'view'                  => true,
-                       'add'                   => true,
-                       'edit'                  => true,
-                       'save'                  => true,
-                       'get_vendors'   => true,
-                       'get_users'             => true
+                       'query'                         => true,
+                       'index'                         => true,
+                       'view'                          => true,
+                       'add'                           => true,
+                       'edit'                          => true,
+                       'save'                          => true,
+                       'get_vendors'           => true,
+                       'get_users'                     => true,
+                       'edit_survey_title'     => true
                );
 
                public function __construct()
@@ -107,7 +108,7 @@
                                                        ),
                                                        array(
                                                                'type' => 
'link',
-                                                               'value' => 
lang('new survey'),
+                                                               'value' => 
lang('new'),
                                                                'href' => 
self::link(array('menuaction' => 'property.uicondition_survey.add')),
                                                                'class' => 
'new_item'
                                                        ),
@@ -128,6 +129,7 @@
                                ),
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'property.uicondition_survey.index', 
'phpgw_return_as' => 'json')),
+                                       'editor_action' => 
'property.uicondition_survey.edit_survey_title',
                                        'field' => array(
                                                array(
                                                        'key' => 'id',
@@ -138,13 +140,13 @@
                                                array(
                                                        'key' => 'title',
                                                        'label' => 
lang('title'),
-                                                       'sortable' => true
+                                                       'sortable' => true,
+                                                       'editor' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:false})'
                                                ),
                                                array(
                                                        'key' => 'descr',
                                                        'label' => 
lang('description'),
                                                        'sortable' => false,
-                                                       'editor' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:true})'
                                                ),
                                                array(
                                                        'key' => 'address',
@@ -433,6 +435,36 @@
                }
 
 
+               public function edit_survey_title()
+               {
+                       $id = phpgw::get_var('id', 'POST', 'int');
+
+                       if(!$this->acl_edit)
+                       {
+                               return lang('no access');
+                       }
+                       
+                       if ($id )
+                       {
+                               $values = $this->bo->read_single( array('id' => 
$id,  'view' => true) );
+                               $values['title'] = phpgw::get_var('value');
+
+                               try
+                               {
+                                       $this->bo->edit_title($values);
+                               }
+
+                               catch(Exception $e)
+                               {
+                                       if ( $e )
+                                       {
+                                               return $e->getMessage(); 
+                                       }
+                               }
+                               return 'OK';
+                       }
+               }
+
                /*
                * Overrides with incoming data from POST
                */

Modified: trunk/property/js/portico/condition_survey_edit.js
===================================================================
--- trunk/property/js/portico/condition_survey_edit.js  2012-11-27 11:20:10 UTC 
(rev 10542)
+++ trunk/property/js/portico/condition_survey_edit.js  2012-11-27 11:21:45 UTC 
(rev 10543)
@@ -61,9 +61,12 @@
 
        function closeJS_local()
        {
-               var reqUrl = '<xsl:value-of select="//datatable/source"/>';
-               YAHOO.portico.inlineTableHelper('requirement-container', 
reqUrl, YAHOO.portico.columnDefs);
+       //      var reqUrl = '<xsl:value-of select="//datatable/source"/>';
+       //      YAHOO.portico.inlineTableHelper('requirement-container', 
reqUrl, YAHOO.portico.columnDefs);
        }
 
+       function refresh_files()
+       {
+               alert('refresh_files');
+       }
 
-

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2012-11-27 11:20:10 UTC (rev 10542)
+++ trunk/property/setup/phpgw_no.lang  2012-11-27 11:21:45 UTC (rev 10543)
@@ -348,6 +348,7 @@
 composites     property        no      Leieobjekter
 condition      property        no      Tilstand
 condition degree       property        no      Tilstandsgrad
+condition survey       property        no      Tilstandsanalyse
 config property        no      Konfigurer
 configuration  property        no      Konfigurasjon
 confirm status property        no      Bekreft status
@@ -820,6 +821,7 @@
 gabnr  property        no      GrunnEiendom
 gallery        property        no      Bildearkiv
 general        property        no      Generelt
+generic        property        no      Generelt
 general address        property        no      Generell adresse
 general info   property        no      generell informasjon
 generate a project from this request   property        no      generer et 
prosjekt basert på denne anmodningen

Modified: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl  2012-11-27 11:20:10 UTC 
(rev 10542)
+++ trunk/property/templates/base/condition_survey.xsl  2012-11-27 11:21:45 UTC 
(rev 10543)
@@ -321,7 +321,7 @@
                                                                </xsl:when>
                                                                <xsl:otherwise>
                                                                        
<xsl:variable name="lang_edit"><xsl:value-of select="php:function('lang', 
'edit')" /></xsl:variable>
-                                                                       
<xsl:variable name="lang_new_survey"><xsl:value-of select="php:function('lang', 
'new survey')" /></xsl:variable>
+                                                                       
<xsl:variable name="lang_new_survey"><xsl:value-of select="php:function('lang', 
'new')" /></xsl:variable>
                                                                        <input 
type="button" name="edit_survey" value="{$lang_edit}" title = "{$lang_edit}"  
onClick="document.load_edit_form.submit();"/>
                                                                        <input 
type="button" name="new_survey" value="{$lang_new_survey}" title = 
"{$lang_new_survey}" onClick="document.new_form.submit();"/>
                                                                        <input 
class="button" type="button" name="cancelButton" id ='cancelButton' 
value="{$lang_cancel}" title = "{$lang_cancel}" 
onClick="document.cancel_form.submit();"/>




reply via email to

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