mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01: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_email' => True,
|
||||
'update_entry' => True,
|
||||
'delete_entry' => True,
|
||||
'delete_entry' => True
|
||||
);
|
||||
|
||||
var $xml_functions = array();
|
||||
@ -56,7 +56,7 @@
|
||||
'customfields' => array(
|
||||
'in' => array('array'),
|
||||
'out'=> array('struct')
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
var $debug = False;
|
||||
|
@ -710,7 +710,7 @@
|
||||
|
||||
function add()
|
||||
{
|
||||
if($_POST['submit'])
|
||||
if($_POST['save'] || $_POST['apply'])
|
||||
{
|
||||
$fields = $this->get_form();
|
||||
|
||||
@ -726,7 +726,7 @@
|
||||
}
|
||||
// $ab_id = $this->bo->get_lastid();
|
||||
|
||||
if(!$errors)
|
||||
if(!$errors && $_POST['save'])
|
||||
{
|
||||
Header('Location: '
|
||||
. $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('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('cancel_url',$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$GLOBALS['egw']->template->parse('out','add');
|
||||
@ -762,7 +763,7 @@
|
||||
|
||||
function edit()
|
||||
{
|
||||
if($_POST['submit'])
|
||||
if($_POST['save'] || $_POST['apply'])
|
||||
{
|
||||
$_fields = $this->get_form();
|
||||
/* _debug_array($_fields);exit; */
|
||||
@ -782,11 +783,13 @@
|
||||
|
||||
$this->bo->update_entry($_fields);
|
||||
|
||||
Header('Location: '
|
||||
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer)
|
||||
);
|
||||
|
||||
$GLOBALS['egw']->common->phpgw_exit();
|
||||
if($_POST['save'])
|
||||
{
|
||||
Header('Location: '
|
||||
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer)
|
||||
);
|
||||
$GLOBALS['egw']->common->phpgw_exit();
|
||||
}
|
||||
}
|
||||
|
||||
/* First, make sure they have permission to this entry */
|
||||
@ -824,6 +827,7 @@
|
||||
$GLOBALS['egw']->template->set_var('tid',$check[0]['tid']);
|
||||
$GLOBALS['egw']->template->set_var('referer',$referer);
|
||||
$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('cancel_link','<form method="POST" action="'
|
||||
. $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index') . '">');
|
||||
@ -940,7 +944,8 @@
|
||||
function view()
|
||||
{
|
||||
$ab_id = (int) $_GET['ab_id'];
|
||||
$submit = $_POST['submit'];
|
||||
$save = $_POST['save'];
|
||||
$apply = $_POST['apply'];
|
||||
$referer = $this->rebuild_referer($_GET['referer']);
|
||||
|
||||
/* First, make sure they have permission to this entry */
|
||||
@ -949,7 +954,7 @@
|
||||
Header('Location: ' . $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$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']->common->phpgw_header();
|
||||
@ -1334,6 +1339,7 @@
|
||||
$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_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('th_bg', $GLOBALS['egw_info']['theme']['th_bg']);
|
||||
$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%">-->
|
||||
<tr>
|
||||
<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>
|
||||
</form>
|
||||
<form action="{cancel_url}" method="post">
|
||||
|
@ -6,8 +6,11 @@
|
||||
<!-- <table border="0" cellPadding="1" cellSpacing="1" width="95%" align="center">-->
|
||||
<tr valign="top">
|
||||
<td align="left" width="10%">
|
||||
<input type="submit" name="submit" value="{lang_save}"></form>
|
||||
</TD>
|
||||
<input type="submit" name="save" value="{lang_save}">
|
||||
</td>
|
||||
<td align="left" width="10%">
|
||||
<input type="submit" name="apply" value="{lang_apply}"></form>
|
||||
</td>
|
||||
<td align="left" colspan="3">
|
||||
{cancel_link}
|
||||
<input type="submit" name="cancel" value="{lang_cancel}"></form>
|
||||
|
@ -68,7 +68,7 @@
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td> </td>
|
||||
<td>
|
||||
<td>
|
||||
<font size="-1">{lang_email}:
|
||||
</td>
|
||||
<td>
|
||||
@ -138,9 +138,9 @@
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td> </td>
|
||||
<td><font size="-1">{lang_badrtype}:</font></td>
|
||||
<td><font size="-1">{lang_badrtype}:</font></td>
|
||||
<td colspan="3">
|
||||
<font size="-1">{badrtype}</font>
|
||||
<font size="-1">{badrtype}</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
@ -242,9 +242,9 @@
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td> </td>
|
||||
<td><font size="-1">{lang_hadrtype}:</font></td>
|
||||
<td><font size="-1">{lang_hadrtype}:</font></td>
|
||||
<td colspan="3">
|
||||
<font size="-1">{hadrtype}</font>
|
||||
<font size="-1">{hadrtype}</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
@ -272,7 +272,7 @@
|
||||
<td colspan="4">{cats_link}</td>
|
||||
</tr>
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="5"><font size="-1">{lang_custom}</font></td>
|
||||
<td colspan="5"><font size="-1">{lang_custom}</font></td>
|
||||
</tr>
|
||||
{custom}
|
||||
<!-- BEGIN creator -->
|
||||
|
@ -136,6 +136,7 @@
|
||||
<tr height="40">
|
||||
<td colspan="6">
|
||||
<input type="submit" name="save" value="{lang_save}">
|
||||
<input type="submit" name="apply" value="{lang_apply}">
|
||||
<input type="submit" name="cancel" value="{lang_cancel}">
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user