mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
Switch to use of Save/Apply/Cancel for save and edit pages. Fix array close in boaddressbook.
This commit is contained in:
parent
fc99dbd57f
commit
29cfef66be
@ -23,7 +23,7 @@
|
|||||||
'add_vcard' => True,
|
'add_vcard' => True,
|
||||||
'add_email' => True,
|
'add_email' => True,
|
||||||
'update_entry' => True,
|
'update_entry' => True,
|
||||||
'delete_entry' => True,
|
'delete_entry' => True
|
||||||
);
|
);
|
||||||
|
|
||||||
var $xml_functions = array();
|
var $xml_functions = array();
|
||||||
@ -56,7 +56,7 @@
|
|||||||
'customfields' => array(
|
'customfields' => array(
|
||||||
'in' => array('array'),
|
'in' => array('array'),
|
||||||
'out'=> array('struct')
|
'out'=> array('struct')
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
var $debug = False;
|
var $debug = False;
|
||||||
|
@ -710,7 +710,7 @@
|
|||||||
|
|
||||||
function add()
|
function add()
|
||||||
{
|
{
|
||||||
if($_POST['submit'])
|
if($_POST['save'] || $_POST['apply'])
|
||||||
{
|
{
|
||||||
$fields = $this->get_form();
|
$fields = $this->get_form();
|
||||||
|
|
||||||
@ -726,7 +726,7 @@
|
|||||||
}
|
}
|
||||||
// $ab_id = $this->bo->get_lastid();
|
// $ab_id = $this->bo->get_lastid();
|
||||||
|
|
||||||
if(!$errors)
|
if(!$errors && $_POST['save'])
|
||||||
{
|
{
|
||||||
Header('Location: '
|
Header('Location: '
|
||||||
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $ab_id . '&referer=' . $referer));
|
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $ab_id . '&referer=' . $referer));
|
||||||
@ -754,6 +754,7 @@
|
|||||||
$GLOBALS['egw']->template->set_var('errors',implode(',',$errors));
|
$GLOBALS['egw']->template->set_var('errors',implode(',',$errors));
|
||||||
}
|
}
|
||||||
$GLOBALS['egw']->template->set_var('lang_save',lang('Save'));
|
$GLOBALS['egw']->template->set_var('lang_save',lang('Save'));
|
||||||
|
$GLOBALS['egw']->template->set_var('lang_apply',lang('Apply'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
||||||
$GLOBALS['egw']->template->set_var('cancel_url',$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
$GLOBALS['egw']->template->set_var('cancel_url',$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||||
$GLOBALS['egw']->template->parse('out','add');
|
$GLOBALS['egw']->template->parse('out','add');
|
||||||
@ -762,7 +763,7 @@
|
|||||||
|
|
||||||
function edit()
|
function edit()
|
||||||
{
|
{
|
||||||
if($_POST['submit'])
|
if($_POST['save'] || $_POST['apply'])
|
||||||
{
|
{
|
||||||
$_fields = $this->get_form();
|
$_fields = $this->get_form();
|
||||||
/* _debug_array($_fields);exit; */
|
/* _debug_array($_fields);exit; */
|
||||||
@ -782,12 +783,14 @@
|
|||||||
|
|
||||||
$this->bo->update_entry($_fields);
|
$this->bo->update_entry($_fields);
|
||||||
|
|
||||||
|
if($_POST['save'])
|
||||||
|
{
|
||||||
Header('Location: '
|
Header('Location: '
|
||||||
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer)
|
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer)
|
||||||
);
|
);
|
||||||
|
|
||||||
$GLOBALS['egw']->common->phpgw_exit();
|
$GLOBALS['egw']->common->phpgw_exit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* First, make sure they have permission to this entry */
|
/* First, make sure they have permission to this entry */
|
||||||
$check = $this->bo->read_entry(array('id' => (int) $_GET['ab_id'], 'fields' => array('owner' => 'owner','tid' => 'tid')));
|
$check = $this->bo->read_entry(array('id' => (int) $_GET['ab_id'], 'fields' => array('owner' => 'owner','tid' => 'tid')));
|
||||||
@ -824,6 +827,7 @@
|
|||||||
$GLOBALS['egw']->template->set_var('tid',$check[0]['tid']);
|
$GLOBALS['egw']->template->set_var('tid',$check[0]['tid']);
|
||||||
$GLOBALS['egw']->template->set_var('referer',$referer);
|
$GLOBALS['egw']->template->set_var('referer',$referer);
|
||||||
$GLOBALS['egw']->template->set_var('lang_save',lang('Save'));
|
$GLOBALS['egw']->template->set_var('lang_save',lang('Save'));
|
||||||
|
$GLOBALS['egw']->template->set_var('lang_apply',lang('Apply'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
||||||
$GLOBALS['egw']->template->set_var('cancel_link','<form method="POST" action="'
|
$GLOBALS['egw']->template->set_var('cancel_link','<form method="POST" action="'
|
||||||
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index') . '">');
|
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index') . '">');
|
||||||
@ -940,7 +944,8 @@
|
|||||||
function view()
|
function view()
|
||||||
{
|
{
|
||||||
$ab_id = (int) $_GET['ab_id'];
|
$ab_id = (int) $_GET['ab_id'];
|
||||||
$submit = $_POST['submit'];
|
$save = $_POST['save'];
|
||||||
|
$apply = $_POST['apply'];
|
||||||
$referer = $this->rebuild_referer($_GET['referer']);
|
$referer = $this->rebuild_referer($_GET['referer']);
|
||||||
|
|
||||||
/* First, make sure they have permission to this entry */
|
/* First, make sure they have permission to this entry */
|
||||||
@ -949,7 +954,7 @@
|
|||||||
Header('Location: ' . $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
Header('Location: ' . $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||||
$GLOBALS['egw']->common->phpgw_exit();
|
$GLOBALS['egw']->common->phpgw_exit();
|
||||||
}
|
}
|
||||||
elseif(!$submit && $ab_id)
|
elseif(!($save || $apply) && $ab_id)
|
||||||
{
|
{
|
||||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('Address book - view');
|
$GLOBALS['egw_info']['flags']['app_header'] = lang('Address book - view');
|
||||||
$GLOBALS['egw']->common->phpgw_header();
|
$GLOBALS['egw']->common->phpgw_header();
|
||||||
@ -1334,6 +1339,7 @@
|
|||||||
$GLOBALS['egw']->template->set_var('lang_other',lang('Other').' '.lang('Fields'));
|
$GLOBALS['egw']->template->set_var('lang_other',lang('Other').' '.lang('Fields'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_otherprefs',lang('Other').' '.lang('Preferences'));
|
$GLOBALS['egw']->template->set_var('lang_otherprefs',lang('Other').' '.lang('Preferences'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_save',lang('Save'));
|
$GLOBALS['egw']->template->set_var('lang_save',lang('Save'));
|
||||||
|
$GLOBALS['egw']->template->set_var('lang_apply',lang('Apply'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
||||||
$GLOBALS['egw']->template->set_var('th_bg', $GLOBALS['egw_info']['theme']['th_bg']);
|
$GLOBALS['egw']->template->set_var('th_bg', $GLOBALS['egw_info']['theme']['th_bg']);
|
||||||
$GLOBALS['egw']->template->set_var('th_text',$GLOBALS['egw_info']['theme']['th_text']);
|
$GLOBALS['egw']->template->set_var('th_text',$GLOBALS['egw_info']['theme']['th_text']);
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
<!--<table border="0" cellPadding="0" cellSpacing="0" width="77%">-->
|
<!--<table border="0" cellPadding="0" cellSpacing="0" width="77%">-->
|
||||||
<tr>
|
<tr>
|
||||||
<td width="10%">
|
<td width="10%">
|
||||||
<input type="submit" name="submit" value="{lang_save}">
|
<input type="submit" name="save" value="{lang_save}">
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<input type="submit" name="apply" value="{lang_apply}">
|
||||||
</td>
|
</td>
|
||||||
</form>
|
</form>
|
||||||
<form action="{cancel_url}" method="post">
|
<form action="{cancel_url}" method="post">
|
||||||
|
@ -6,8 +6,11 @@
|
|||||||
<!-- <table border="0" cellPadding="1" cellSpacing="1" width="95%" align="center">-->
|
<!-- <table border="0" cellPadding="1" cellSpacing="1" width="95%" align="center">-->
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<td align="left" width="10%">
|
<td align="left" width="10%">
|
||||||
<input type="submit" name="submit" value="{lang_save}"></form>
|
<input type="submit" name="save" value="{lang_save}">
|
||||||
</TD>
|
</td>
|
||||||
|
<td align="left" width="10%">
|
||||||
|
<input type="submit" name="apply" value="{lang_apply}"></form>
|
||||||
|
</td>
|
||||||
<td align="left" colspan="3">
|
<td align="left" colspan="3">
|
||||||
{cancel_link}
|
{cancel_link}
|
||||||
<input type="submit" name="cancel" value="{lang_cancel}"></form>
|
<input type="submit" name="cancel" value="{lang_cancel}"></form>
|
||||||
|
@ -136,6 +136,7 @@
|
|||||||
<tr height="40">
|
<tr height="40">
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<input type="submit" name="save" value="{lang_save}">
|
<input type="submit" name="save" value="{lang_save}">
|
||||||
|
<input type="submit" name="apply" value="{lang_apply}">
|
||||||
<input type="submit" name="cancel" value="{lang_cancel}">
|
<input type="submit" name="cancel" value="{lang_cancel}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user