phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property templates/base/actor.xsl templates/bas...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property templates/base/actor.xsl templates/bas...
Date: Mon, 30 Oct 2006 22:20:34 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/10/30 22:20:34

Modified files:
        templates/base : actor.xsl attributes_form.xsl 
        inc            : class.boactor.inc.php class.bocommon.inc.php 
                         class.soactor.inc.php class.uiactor.inc.php 

Log message:
        Password as custom attribute

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/actor.xsl?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/attributes_form.xsl?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boactor.inc.php?cvsroot=phpgroupware&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bocommon.inc.php?cvsroot=phpgroupware&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soactor.inc.php?cvsroot=phpgroupware&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiactor.inc.php?cvsroot=phpgroupware&r1=1.22&r2=1.23

Patches:
Index: templates/base/actor.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/actor.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- templates/base/actor.xsl    12 Oct 2006 10:51:11 -0000      1.3
+++ templates/base/actor.xsl    30 Oct 2006 22:20:34 -0000      1.4
@@ -479,6 +479,15 @@
                <div align="left">
                
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
+                       <xsl:choose>
+                               <xsl:when test="msgbox_data != ''">
+                                       <tr>
+                                               <td align="left" colspan="3">
+                                                       <xsl:call-template 
name="msgbox"/>
+                                               </td>
+                                       </tr>
+                               </xsl:when>
+                       </xsl:choose>
                        
                        <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                        <form method="post" action="{$form_action}">

Index: templates/base/attributes_form.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/attributes_form.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- templates/base/attributes_form.xsl  20 Oct 2006 08:10:26 -0000      1.6
+++ templates/base/attributes_form.xsl  30 Oct 2006 22:20:34 -0000      1.7
@@ -1,4 +1,4 @@
-<!-- $Id: attributes_form.xsl,v 1.6 2006/10/20 08:10:26 sigurdne Exp $ -->
+<!-- $Id: attributes_form.xsl,v 1.7 2006/10/30 22:20:34 sigurdne Exp $ -->
 
        <xsl:template name="attributes_form">
                <xsl:apply-templates select="attributes_values"/>
@@ -173,6 +173,50 @@
                                                                                
<xsl:value-of select="value"/>          
                                                                        
</textarea>
                                                                </xsl:when>
+                                                               <xsl:when 
test="datatype='pwd'">
+                                                                       <table>
+                                                                               
<tr>
+                                                                               
        <td>
+                                                                               
                <input type="password" 
name="values_attribute[{counter}][value]"  size="30" 
onMouseout="window.status='';return true;" >
+                                                                               
                        <xsl:choose>
+                                                                               
                                <xsl:when test="disabled!=''">
+                                                                               
                                        <xsl:attribute name="disabled">
+                                                                               
                                                <xsl:text> disabled</xsl:text>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                </xsl:when>
+                                                                               
                        </xsl:choose>
+                                                                               
                        <xsl:attribute name="onMouseover">
+                                                                               
                                <xsl:text>window.status='</xsl:text>
+                                                                               
                                        <xsl:value-of select="statustext"/>
+                                                                               
                                        <xsl:text> - </xsl:text>
+                                                                               
                                        <xsl:value-of select="datatype_text"/>
+                                                                               
                                <xsl:text>';return true;</xsl:text>
+                                                                               
                        </xsl:attribute>
+                                                                               
                </input>
+                                                                               
        </td>
+                                                                               
</tr>
+                                                                               
<tr>
+                                                                               
        <td>
+                                                                               
                <input type="password" 
name="values_attribute[{counter}][value2]"  size="30" 
onMouseout="window.status='';return true;" >
+                                                                               
                        <xsl:choose>
+                                                                               
                                <xsl:when test="disabled!=''">
+                                                                               
                                        <xsl:attribute name="disabled">
+                                                                               
                                                <xsl:text> disabled</xsl:text>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                        </xsl:when>
+                                                                               
                        </xsl:choose>
+                                                                               
                        <xsl:attribute name="onMouseover">
+                                                                               
                                <xsl:text>window.status='</xsl:text>
+                                                                               
                                        <xsl:value-of select="statustext"/>
+                                                                               
                                        <xsl:text> - </xsl:text>
+                                                                               
                                        <xsl:value-of select="datatype_text"/>
+                                                                               
                                <xsl:text>';return true;</xsl:text>
+                                                                               
                        </xsl:attribute>
+                                                                               
                </input>
+                                                                               
        </td>
+                                                                               
</tr>
+                                                                       </table>
+                                                               </xsl:when>
                                                                <xsl:otherwise>
                                                                        <input 
type="text" name="values_attribute[{counter}][value]" value="{value}" size="30" 
onMouseout="window.status='';return true;" >
                                                                                
<xsl:choose>

Index: inc/class.boactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boactor.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- inc/class.boactor.inc.php   14 Sep 2006 17:40:38 -0000      1.11
+++ inc/class.boactor.inc.php   30 Oct 2006 22:20:34 -0000      1.12
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.boactor.inc.php,v 1.11 2006/09/14 17:40:38 
sigurdne Exp $
+       * @version $Id: class.boactor.inc.php,v 1.12 2006/10/30 22:20:34 
sigurdne Exp $
        */
 
        /**
@@ -357,6 +357,7 @@
                        {
                                $receipt = $this->so->add_attrib($attrib);
                        }
+
                        return $receipt;
                }
 

Index: inc/class.bocommon.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- inc/class.bocommon.inc.php  12 Oct 2006 09:50:40 -0000      1.48
+++ inc/class.bocommon.inc.php  30 Oct 2006 22:20:34 -0000      1.49
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.48 2006/10/12 09:50:40 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.49 2006/10/30 22:20:34 
sigurdne Exp $
        */
 
        /**
@@ -781,7 +781,8 @@
                                'AB' => 'Contact',
                                'VENDOR' => 'Vendor',
                                'email' => 'Email',
-                               'link' => 'Link'
+                               'link' => 'Link',
+                               'pwd' => 'Password'
                        );
 
                        $datatype  = lang($datatype_text[$datatype]);
@@ -804,7 +805,8 @@
                                'AB' => 'int',
                                'VENDOR' => 'int',
                                'email' => 'varchar',
-                               'link' => 'varchar'
+                               'link' => 'varchar',
+                               'pwd' => 'varchar'
                        );
 
                        return $datatype_text[$datatype];
@@ -819,7 +821,8 @@
                                'AB' => 4,
                                'VENDOR' => 4,
                                'email' => 64,
-                               'link' => 255
+                               'link' => 255,
+                               'pwd' => 32
                        );
 
                        return 
(isset($datatype_precision[$datatype])?$datatype_precision[$datatype]:'');
@@ -1313,6 +1316,8 @@
                        $datatypes[11]['name']= lang('Email');
                        $datatypes[12]['id']= 'link';
                        $datatypes[12]['name']= lang('Link');
+                       $datatypes[13]['id']= 'pwd';
+                       $datatypes[13]['name']= lang('Password');
 
                        return $this->select_list($selected,$datatypes);
 

Index: inc/class.soactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soactor.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- inc/class.soactor.inc.php   30 Oct 2006 10:46:48 -0000      1.17
+++ inc/class.soactor.inc.php   30 Oct 2006 22:20:34 -0000      1.18
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.soactor.inc.php,v 1.17 2006/10/30 10:46:48 
sigurdne Exp $
+       * @version $Id: class.soactor.inc.php,v 1.18 2006/10/30 22:20:34 
sigurdne Exp $
        */
 
        /**
@@ -393,15 +393,41 @@
                                }
                        }
 
+
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
                                foreach($values_attribute as $entry)
                                {
                                        if($entry['value'])
                                        {
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V')
+                                               {
+                                                       $entry['value'] = 
$this->db->db_addslashes($entry['value']);
+                                               }
+                                               
+                                               if($entry['datatype'] == 'pwd')
+                                               {
+                                                       if($entry['value'] == 
$entry['value2'])
+                                                       {
+                                                               $cols[] = 
$entry['name'];
+                                                               $vals[] = 
md5($entry['value']);
+                                                       }
+                                                       else
+                                                       {
+                                                               
$receipt['error'][]=array('msg'=>lang('Passwords do not match!'));
+                                                       }
+                                               }
+                                               else
+                                               {
                                                $cols[] = $entry['name'];
                                                $vals[] = $entry['value'];
                                        }
+
+                                               if($entry['history'] == 1)
+                                               {
+                                                       
$history_set[$entry['attrib_id']] = $entry['value'];
+                                               }
+                                       }
                                }
                        }
 
@@ -662,11 +688,17 @@
 
                        $receipt['id']= $attrib['id'];
 
-                       if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
+                       
+                       if(!$attrib['column_info']['precision'])
                        {
-                               $attrib['column_info']['precision']=64;
+                               $attrib['column_info']['precision'] = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
                        }
 
+/*                     if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
+                       {
+                               $attrib['column_info']['precision']=64;
+                       }
+*/
                        $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
 
                        if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])

Index: inc/class.uiactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiactor.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- inc/class.uiactor.inc.php   7 Oct 2006 15:44:07 -0000       1.22
+++ inc/class.uiactor.inc.php   30 Oct 2006 22:20:34 -0000      1.23
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.uiactor.inc.php,v 1.22 2006/10/07 15:44:07 
sigurdne Exp $
+       * @version $Id: class.uiactor.inc.php,v 1.23 2006/10/30 22:20:34 
sigurdne Exp $
        */
 
        /**
@@ -372,7 +372,7 @@
 
                        $insert_record_actor = 
$GLOBALS['phpgw']->session->appsession('insert_record_actor',$this->currentapp);
 
-//_debug_array($insert_record_actor);
+//_debug_array($values_attribute);
                        for ($j=0;$j<count($insert_record_actor);$j++)
                        {
                                
$insert_record['extra'][$insert_record_actor[$j]]       = 
$insert_record_actor[$j];
@@ -880,9 +880,7 @@
                                $column_nullable  = 
$values['column_info']['nullable'];
                        }
 
-
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
                        $data = array
                        (
                                'lang_choice'                   => 
lang('Choice'),
@@ -893,7 +891,7 @@
                                'lang_delete_value'             => lang('Delete 
value'),
                                'lang_value'                    => 
lang('value'),
                                'lang_delete_choice_statustext' => lang('Delete 
this value from the list of multiple choice'),
-                               //'msgbox_data'                 => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.list_attribute', 'type_id'=> $type_id, 'role'=> 
$this->role)),
                                'lang_id'                       => 
lang('Attribute ID'),




reply via email to

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