[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] calendar inc/class.uicustom_fields.inc.php inc/...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] calendar inc/class.uicustom_fields.inc.php inc/... |
Date: |
Tue, 12 Dec 2006 19:27:47 +0000 |
CVSROOT: /sources/phpgroupware
Module name: calendar
Changes by: Sigurd Nes <sigurdne> 06/12/12 19:27:47
Modified files:
inc : class.uicustom_fields.inc.php
hook_sidebox_menu.inc.php
templates/base : custom_fields.tpl
Log message:
Custom fields , links, notices
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.uicustom_fields.inc.php?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/hook_sidebox_menu.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/calendar/templates/base/custom_fields.tpl?cvsroot=phpgroupware&r1=1.1&r2=1.2
Patches:
Index: inc/class.uicustom_fields.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/inc/class.uicustom_fields.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- inc/class.uicustom_fields.inc.php 6 Dec 2006 17:58:01 -0000 1.4
+++ inc/class.uicustom_fields.inc.php 12 Dec 2006 19:27:47 -0000 1.5
@@ -10,7 +10,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.uicustom_fields.inc.php,v 1.4 2006/12/06 17:58:01
sigurdne Exp $ */
+ /* $Id: class.uicustom_fields.inc.php,v 1.5 2006/12/12 19:27:47
sigurdne Exp $ */
require_once(PHPGW_INCLUDE_ROOT.'/calendar/inc/class.bocustom_fields.inc.php');
$GLOBALS['phpgw_info']['flags']['included_classes']['bocustom_fields']
= True; // for 0.9.14
@@ -22,6 +22,8 @@
'submited' => True
);
+ var $classname;
+
function uicustom_fields()
{
$this->bocustom_fields(); // call constructor of
extended class
@@ -72,7 +74,7 @@
'lang_order' => lang('Order'),
'lang_title' => lang('Title-row'),
'lang_disabled'=> lang('Disabled'),
- 'action_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicustom_fields.submited'),
+ 'action_url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'calendar.uicustom_fields.submited')),
'save_button' =>
$this->html->submit_button('save','Save'),
'cancel_button'=>
$this->html->submit_button('cancel','Cancel'),
));
@@ -89,24 +91,26 @@
$id = '['.htmlspecialchars($id).']';
}
$this->tpl->set_var(array(
- 'name' => $values['label'] ?
lang($values['label']) :
$this->html->input('name'.$id,$values['name'],'','SIZE="40" MAXLENGTH="40"'),
- 'length' => $values['label'] ? ' ' :
$this->html->input('length'.$id,$values['length'],'','SIZE="3"'),
- 'shown' => $values['label'] ? ' ' :
$this->html->input('shown'.$id,$values['shown'],'','SIZE="3"'),
+ 'name' => isset($values['label']) &&
$values['label'] ? lang($values['label']) :
$this->html->input('name'.$id,(isset($values['name'])?$values['name']:''),'','SIZE="40"
MAXLENGTH="40"'),
+ 'length' => isset($values['label']) &&
$values['label'] ? ' ' :
$this->html->input('length'.$id,(isset($values['length'])?$values['length']:''),'','SIZE="3"'),
+ 'shown' => isset($values['label']) &&
$values['label'] ? ' ' :
$this->html->input('shown'.$id,(isset($values['shown'])?$values['shown']:''),'','SIZE="3"'),
'order' =>
$this->html->input('order'.$id,$values['order'],'','SIZE="3"'),
- 'title' =>
$this->html->checkbox('title'.$id,$values['title']),
- 'disabled'=>
$this->html->checkbox('disabled'.$id,$values['disabled']),
+ 'title' =>
$this->html->checkbox('title'.$id,(isset($values['title'])?$values['title']:'')),
+ 'disabled'=>
$this->html->checkbox('disabled'.$id,(isset($values['disabled'])?$values['disabled']:'')),
'button' => $name ?
$this->html->submit_button($name.$id,$label) : ' '
));
+
+ $this->classname =
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($this->classname);
if ($name !== 'add')
{
- $this->tpl->set_var('tr_color',$values['title']
? $GLOBALS['phpgw_info']['theme']['th_bg'] :
$GLOBALS['phpgw']->nextmatchs->alternate_row_class());
+ $this->tpl->set_var('tr_color',
$this->classname);
$this->tpl->parse('rows','row',True);
}
}
function submited()
{
- if ($_POST['cancel'])
+ if (isset($_POST['cancel']) && $_POST['cancel'])
{
$GLOBALS['phpgw']->redirect_link('/admin/');
}
@@ -124,11 +128,11 @@
}
$ordered[$order] = array(
'field' => $field,
- 'name' =>
stripslashes($_POST['name'][$field]),
- 'length' =>
intval($_POST['length'][$field]),
- 'shown' =>
intval($_POST['shown'][$field]),
+ 'name' =>
stripslashes(isset($_POST['name'][$field])?$_POST['name'][$field]:''),
+ 'length' =>
isset($_POST['length'][$field])?intval($_POST['length'][$field]):0,
+ 'shown' =>
isset($_POST['shown'][$field])?intval($_POST['shown'][$field]):0,
'title' =>
!!$_POST['title'][$field],
- 'disabled' =>
!!$_POST['disabled'][$field]
+ 'disabled' =>
!!isset($_POST['disabled'][$field])
);
if (isset($this->stock_fields[$field]))
{
@@ -175,7 +179,7 @@
{
unset($data['length']);
}
- if ($data['shown'] >= $data['length'] ||
$data['shown'] <= 0)
+ if ($data['shown'] >=
(isset($_POST['disabled'][$field])?$_POST['disabled'][$field]:0) ||
$data['shown'] <= 0)
{
unset($data['shown']);
}
@@ -191,7 +195,7 @@
unset($data['field']);
$this->fields[$field] = $data;
}
- if (!$error && isset($_POST['save']))
+ if ((!isset($error) || !$error) &&
isset($_POST['save']))
{
$this->save();
$GLOBALS['phpgw']->redirect_link('/admin/');
Index: inc/hook_sidebox_menu.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/inc/hook_sidebox_menu.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- inc/hook_sidebox_menu.inc.php 12 Dec 2006 15:19:11 -0000 1.6
+++ inc/hook_sidebox_menu.inc.php 12 Dec 2006 19:27:47 -0000 1.7
@@ -10,7 +10,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: hook_sidebox_menu.inc.php,v 1.6 2006/12/12 15:19:11 sigurdne Exp $ */
+ /* $Id: hook_sidebox_menu.inc.php,v 1.7 2006/12/12 19:27:47 sigurdne Exp $ */
{
/*
@@ -78,7 +78,7 @@
$menu_title = lang('Administration');
$file = Array(
array('text' => 'Configuration',
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index&appname=calendar'))),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index','appname'=>'calendar'))),
array('text' => 'Custom Fields',
'url'
=>$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'calendar.uicustom_fields.index'))),
array('text' => 'Holiday Management',
Index: templates/base/custom_fields.tpl
===================================================================
RCS file: /sources/phpgroupware/calendar/templates/base/custom_fields.tpl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- templates/base/custom_fields.tpl 28 Jul 2006 03:30:43 -0000 1.1
+++ templates/base/custom_fields.tpl 12 Dec 2006 19:27:47 -0000 1.2
@@ -1,4 +1,4 @@
-<!-- $Id: custom_fields.tpl,v 1.1 2006/07/28 03:30:43 skwashd Exp $ -->
+<!-- $Id: custom_fields.tpl,v 1.2 2006/12/12 19:27:47 sigurdne Exp $ -->
<!-- BEGIN custom_fields -->
{lang_error}<br />
<form action="{action_url}" method="post">
@@ -34,7 +34,7 @@
<!-- END custom_fields -->
<!-- BEGIN row -->
- <tr bgcolor="{tr_color}">
+ <tr class="{tr_color}">
<td>{name}</td>
<td align="center">{length}</td>
<td align="center">{shown}</td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] calendar inc/class.uicustom_fields.inc.php inc/...,
Sigurd Nes <=