[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] [19089] make it so column selections stick
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] [19089] make it so column selections stick |
Date: |
Fri, 20 Feb 2009 12:16:19 +0000 |
Revision: 19089
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=19089
Author: skwashd
Date: 2009-02-20 12:16:18 +0000 (Fri, 20 Feb 2009)
Log Message:
-----------
make it so column selections stick
Modified Paths:
--------------
branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook_prefs.inc.php
branches/Version-0_9_16-branch/addressbook/inc/class.soaddressbook.inc.php
branches/Version-0_9_16-branch/addressbook/inc/class.uiaddressbook_prefs.inc.php
branches/Version-0_9_16-branch/addressbook/templates/default/preferences.tpl
Modified:
branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook_prefs.inc.php
===================================================================
---
branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook_prefs.inc.php
2009-02-19 23:32:09 UTC (rev 19088)
+++
branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook_prefs.inc.php
2009-02-20 12:16:18 UTC (rev 19089)
@@ -44,7 +44,7 @@
&&(count($this->person_columns['comm_types'])>0)))
{
//print "<br /><B>count(Person )columns >=
1".print_r($this->person_columns)."</B><br />";
-
$this->preferences->add('addressbook','person_columns',serialize($this->person_columns),$type);
+ $this->preferences->add('addressbook',
'person_columns', $this->person_columns, $type);
}
else
{
@@ -56,7 +56,7 @@
}
else
{
-
$this->preferences->delete('addressbook','person_columns',$type);
+
$this->preferences->delete('addressbook','person_columns',$type);
$this->remove_from_forced("person_columns");
}
@@ -68,7 +68,7 @@
if(count($this->org_columns) >=1)
{
-
$this->preferences->add('addressbook','org_columns',serialize($this->org_columns),$type);
+ $this->preferences->add('addressbook',
'org_columns', $this->org_columns, $type);
}
else
{
@@ -98,15 +98,15 @@
$this->preferences->delete('addressbook','default_category',$type);
$this->remove_from_forced('default_category');
}
- $this->preferences->save_repository(true,$type);
+ $this->preferences->save_repository(true, $type);
}
function read_preferences($type='')
{
$this->preferences->read();
$temp=$this->preferences->data['addressbook'];
- $this->person_columns=unserialize($temp['person_columns']);
-
$this->person_columns_forced=$this->is_forced_value('person_columns');
+ $this->person_columns = $temp['person_columns'];
+ $this->person_columns_forced =
$this->is_forced_value('person_columns');
//Check that we dont reflect types that arent asked of us in
'type'
if(!$this->person_columns_forced && $type=='forced')
{
@@ -114,7 +114,7 @@
unset($this->person_columns);
}
- $this->org_columns=unserialize($temp['org_columns']);
+ $this->org_columns = $temp['org_columns'];
$this->org_columns_forced=$this->is_forced_value('org_columns');
if(!$this->org_columns_forced && $type=='forced')
{
@@ -130,7 +130,6 @@
{
$this->default_category='__NONE__';
}
-
}
function remove_from_forced($preference_name)
{
Modified:
branches/Version-0_9_16-branch/addressbook/inc/class.soaddressbook.inc.php
===================================================================
--- branches/Version-0_9_16-branch/addressbook/inc/class.soaddressbook.inc.php
2009-02-19 23:32:09 UTC (rev 19088)
+++ branches/Version-0_9_16-branch/addressbook/inc/class.soaddressbook.inc.php
2009-02-20 12:16:18 UTC (rev 19089)
@@ -1044,16 +1044,16 @@
function read_preferences($contact_type)
{
- $prefs=$GLOBALS['phpgw']->preferences;
- $prefs=$prefs->data['addressbook'];
+ $prefs = $GLOBALS['phpgw']->preferences->read();
+ $prefs = $prefs['addressbook'];
if($contact_type==$this->tab_main_persons)
{
- return unserialize($prefs['person_columns']);
+ return $prefs['person_columns'];
}
elseif($contact_type==$this->tab_main_organizations)
{
- return unserialize($prefs['org_columns']);
+ return $prefs['org_columns'];
}
}
Modified:
branches/Version-0_9_16-branch/addressbook/inc/class.uiaddressbook_prefs.inc.php
===================================================================
---
branches/Version-0_9_16-branch/addressbook/inc/class.uiaddressbook_prefs.inc.php
2009-02-19 23:32:09 UTC (rev 19088)
+++
branches/Version-0_9_16-branch/addressbook/inc/class.uiaddressbook_prefs.inc.php
2009-02-20 12:16:18 UTC (rev 19089)
@@ -470,6 +470,7 @@
print "<br /><b>Columns</b><br />"; */
}
+
function linearize_query($qresult,$key)
{
// print_r($qresult);
@@ -616,9 +617,6 @@
$this->template->set_file(
array(
'addressbook_preferences_t'
=>'preferences.tpl',
- 'preferences_bits_t' =>
'preferences_bits.tpl',
- 'select_columns_form_options_t'
=> 'preferences_bits.tpl',
-
'select_columns_commtypes_options_t' => 'preferences_bits.tpl',
'selected_rows_t' =>
'preferences_bits.tpl',
'principal_tabs_t' =>
'principal_tabs.tpl'
)
@@ -723,45 +721,49 @@
$org_or_person=$this->org_or_person;
}
$this->fields_to_show();
-
$this->template->set_block('select_columns_form_options_t','B_select_columns_form_options','V_select_columns_form_options');
-
$this->template->set_block('select_columns_commtypes_options_t','B_select_ctypes_options','V_select_columns_commtypes_options');
- if(count($this->fields_show_selectbox) > 1)
- {
- reset($this->fields_show_selectbox);
- // print "<br /><B> To
Show in Selectbox<br />".print_r($this->fields_show_selectbox)."</B><br />";
-
while(list($field,$lang)=each($this->fields_show_selectbox))
- {
- //not a comtype
+
$this->template->set_block('addressbook_preferences_t','B_select_columns_form_options','V_select_columns_form_options');
+ $this->template->set_block('addressbook_preferences_t',
'B_select_ctypes_options', 'V_select_ctypes_options');
+
+ if ( isset($this->fields_show_selectbox['comm_types']) )
+ {
+ if (
is_array($this->fields_show_selectbox['comm_types'])
+ &&
count($this->fields_show_selectbox['comm_types']) )
+ {
+ foreach (
$this->fields_show_selectbox['comm_types'] as $k => $description )
+ {
+
$this->template->set_var('lang_comtype_field', $description);
+
$this->template->set_var('commtype_description', $description);
+
$this->template->parse('V_select_ctypes_options', 'B_select_ctypes_options',
True);
+ }
+ }
+ else
+ {
+
$this->template->set_var('lang_comtype_field',$GLOBALS['phpgw']->lang('Empty'));
+ $this->template->set_var('value', '');
+
$this->template->parse('V_select_ctypes_options', 'B_select_ctypes_options',
True);
+ }
+
+
unset($this->fields_show_selectbox['comm_types']);
+ }
+
+ if ( count($this->fields_show_selectbox) )
+ {
+ //print "<br /><B> To Show in Selectbox<br
/>".print_r($this->fields_show_selectbox, true)."</B><br />";
+ foreach ( $this->fields_show_selectbox as
$field => $lang )
+ {
+
$this->template->set_var('lang_contact_field',$lang);
+
$this->template->set_var('value',$field);
+
$this->template->parse('V_select_columns_form_options','B_select_columns_form_options',True);
+ }
+ }
+ else
+ {
+
$this->template->set_var('lang_contact_field',$GLOBALS['phpgw']->lang('Empty'));
+ $this->template->set_var('value', '');
+
$this->template->parse('V_select_columns_form_options','B_select_columns_form_options',True);
+ }
+ }
- if(!is_array($lang))
- {
-
$this->template->set_var('lang_contact_field',$lang);
-
$this->template->set_var('value',$field);
-
$this->template->parse('V_select_columns_form_options','B_select_columns_form_options',True);
- }
- else
- {
-
while(list($k,$description)=each($lang))
- {
-
$this->template->set_var('lang_comtype_field',$description);
-
$this->template->set_var('commtype_description',$description);
-
$this->template->parse('V_select_ctypes_options',
-
'B_select_ctypes_options',True);
-
- }
- }
- }
- }
- else
- {
-
$this->template->set_var('lang_contact_field',$GLOBALS['phpgw']->lang('Empty'));
- $this->template->set_var('value',"");
-
$this->template->parse('V_select_columns_form_options','B_select_columns_form_options');
- }
-
$this->template->parse('B_select_columns_form_options','V_select_columns_form_options');
- $this->template->parse('B_select_ctypes_options',
'V_select_ctypes_options');
-
- }
function show_cols($org_or_person='')
{
if(empty($org_or_person))
Modified:
branches/Version-0_9_16-branch/addressbook/templates/default/preferences.tpl
===================================================================
---
branches/Version-0_9_16-branch/addressbook/templates/default/preferences.tpl
2009-02-19 23:32:09 UTC (rev 19088)
+++
branches/Version-0_9_16-branch/addressbook/templates/default/preferences.tpl
2009-02-20 12:16:18 UTC (rev 19089)
@@ -23,13 +23,16 @@
<td>
{hider_open}
<select name="{select_columns_selectbox_name}" multiple size="5">
-
- {B_select_columns_form_options}
+ <!-- BEGIN B_select_columns_form_options -->
+ <option value="{value}">{lang_contact_field}</option>
+ <!-- END B_select_columns_form_options -->
</select>
</td>
<td>
<select name="{select_columns_comtypes_name}" multiple size="5">
- {B_select_ctypes_options}
+ <!-- BEGIN B_select_ctypes_options -->
+ <option
value="{commtype_description}">{lang_comtype_field}</option>
+ <!-- END B_select_ctypes_options -->
</select>
</td>
</tr>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] [19089] make it so column selections stick,
Dave Hall <=