This commit is contained in:
ceb 2003-04-28 00:31:33 +00:00
parent 2f282b71ca
commit bde09a37ec
2 changed files with 41 additions and 18 deletions

View File

@ -100,7 +100,7 @@
if ($_POST['done']) if ($_POST['done'])
{ {
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.iumainscreen.mainscreen'); $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uimainscreen.mainscreen');
} }
if ($GLOBALS['appname']) if ($GLOBALS['appname'])
@ -369,7 +369,7 @@
'global_cats' => $global_cats 'global_cats' => $global_cats
); );
if ($_POST['cancel'] || !$this->cat_id) if ($_POST['done'] || $_POST['cancel'] || !$this->cat_id)
{ {
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data); $GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
} }
@ -389,7 +389,9 @@
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data); $GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
break; break;
default: default:
$error_msg = lang('Please choose one of the methods to handle the subcategories'); $error = array('Please choose one of the methods to handle the subcategories');
$msgbox_error = $GLOBALS['phpgw']->common->error_list($error);
$show_done = 'yes';
break; break;
} }
} }
@ -411,12 +413,14 @@
'cat_id' => $this->cat_id)); 'cat_id' => $this->cat_id));
if ($apps_cats) if ($apps_cats)
{ {
$lang_confirm_msg = lang('This category is currently being used by applications as a parent category. ') $error = array('This category is currently being used by applications as a parent category',
. lang('You will need to reassign these subcategories before you can delete this category'); 'You will need to reassign these subcategories before you can delete this category');
$msgbox_error = $GLOBALS['phpgw']->common->error_list($error);
} }
else else
{ {
$lang_confirm_msg = lang('Are you sure you want to delete this global category ?'); $confirm_msg = lang('Are you sure you want to delete this global category ?');
$exists = $this->bo->exists(array $exists = $this->bo->exists(array
( (
@ -435,15 +439,18 @@
$data = array $data = array
( (
'lang_delete_msg' => $lang_confirm_msg, 'show_done' => $show_done,
'msgbox_data' => $msgbox_error,
'lang_delete' => lang('delete'), 'lang_delete' => lang('delete'),
'subs' => $subs, 'subs' => $subs,
'lang_sub_select_move' => $lang_sub_select_move, 'lang_sub_select_move' => $lang_sub_select_move,
'lang_sub_select_drop' => $lang_sub_select_drop, 'lang_sub_select_drop' => $lang_sub_select_drop,
'lang_delete_statustext' => lang('delete the category'), 'lang_delete_statustext' => lang('delete the category'),
'lang_cancel_statustext' => lang('do NOT delete the category and return back to the list'), 'lang_cancel_statustext' => lang('do NOT delete the category and return back to the list'),
'lang_done_statustext' => lang('back to the list'),
'lang_cancel' => lang('cancel'), 'lang_cancel' => lang('cancel'),
'lang_error_msg' => $error_msg 'lang_done' => lang('done'),
'lang_confirm_msg' => $confirm_msg
); );
$link_data['menuaction'] = 'admin.uicategories.delete'; $link_data['menuaction'] = 'admin.uicategories.delete';

View File

@ -7,17 +7,20 @@
<xsl:template match="delete"> <xsl:template match="delete">
<table cellpadding="2" cellspacing="2" align="center"> <table cellpadding="2" cellspacing="2" align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="lang_error_msg != ''"> <xsl:when test="msgbox_data != ''">
<tr class="row_off"> <tr>
<td align="center" colspan="2"><xsl:value-of select="lang_error_msg"/></td> <td align="center" colspan="2"><xsl:call-template name="msgbox"/></td>
</tr> </tr>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
<tr> <tr>
<td align="center" colspan="2" class="row_on"><xsl:value-of select="lang_delete_msg"/></td> <td align="center" colspan="2"><xsl:value-of select="lang_confirm_msg"/></td>
</tr> </tr>
<!-- delete sub --> <!-- delete sub -->
<xsl:variable name="delete_url"><xsl:value-of select="delete_url"/></xsl:variable>
<form method="POST" action="{$delete_url}">
<xsl:choose> <xsl:choose>
<xsl:when test="subs = 'yes'"> <xsl:when test="subs = 'yes'">
<tr> <tr>
@ -72,16 +75,27 @@
</tr> </tr>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
<tr> <tr>
<xsl:variable name="delete_url"><xsl:value-of select="delete_url"/></xsl:variable> <xsl:choose>
<form method="POST" action="{$delete_url}"> <xsl:when test="show_done != ''">
<td> <xsl:variable name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
<td>
<input type="submit" name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
<xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="lang_done_statustext"/>
<xsl:text>'; return true;</xsl:text>
</xsl:attribute>
</input>
</td>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="lang_delete"><xsl:value-of select="lang_delete"/></xsl:variable> <xsl:variable name="lang_delete"><xsl:value-of select="lang_delete"/></xsl:variable>
<td>
<input type="submit" name="delete" value="{$lang_delete}" onMouseout="window.status='';return true;"> <input type="submit" name="delete" value="{$lang_delete}" onMouseout="window.status='';return true;">
<xsl:attribute name="onMouseover"> <xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text> <xsl:text>window.status='</xsl:text>
<xsl:value-of select="lang_yes_statustext"/> <xsl:value-of select="lang_delete_statustext"/>
<xsl:text>'; return true;</xsl:text> <xsl:text>'; return true;</xsl:text>
</xsl:attribute> </xsl:attribute>
</input> </input>
@ -96,8 +110,10 @@
</xsl:attribute> </xsl:attribute>
</input> </input>
</td> </td>
</form> </xsl:otherwise>
</xsl:choose>
</tr> </tr>
</form>
</table> </table>
</xsl:template> </xsl:template>