[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6957] Merge 6954:6956 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6957] Merge 6954:6956 from trunk |
Date: |
Wed, 09 Feb 2011 14:01:02 +0000 |
Revision: 6957
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6957
Author: sigurdne
Date: 2011-02-09 14:00:59 +0000 (Wed, 09 Feb 2011)
Log Message:
-----------
Merge 6954:6956 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/admin/inc/class.bocategories.inc.php
branches/Version-1_0-branch/admin/inc/class.uicategories.inc.php
branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php
branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956
Modified: branches/Version-1_0-branch/admin/inc/class.bocategories.inc.php
===================================================================
--- branches/Version-1_0-branch/admin/inc/class.bocategories.inc.php
2011-02-09 13:59:23 UTC (rev 6956)
+++ branches/Version-1_0-branch/admin/inc/class.bocategories.inc.php
2011-02-09 14:00:59 UTC (rev 6957)
@@ -138,9 +138,9 @@
return $this->cats->formatted_list($data);
}
- function delete($data)
+ function delete($cat_id, $drop_subs = False, $modify_subs =
False)
{
- $this->cats->delete($data);
+ $this->cats->delete($cat_id, $drop_subs, $modify_subs);
}
function check_values($values)
Modified: branches/Version-1_0-branch/admin/inc/class.uicategories.inc.php
===================================================================
--- branches/Version-1_0-branch/admin/inc/class.uicategories.inc.php
2011-02-09 13:59:23 UTC (rev 6956)
+++ branches/Version-1_0-branch/admin/inc/class.uicategories.inc.php
2011-02-09 14:00:59 UTC (rev 6957)
@@ -394,7 +394,7 @@
$appname = phpgw::get_var('appname');
$location= phpgw::get_var('location');
$global_cats = phpgw::get_var('global_cats');
-
+ $receipt = array();
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
@@ -425,8 +425,7 @@
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
break;
default:
- $error =
array('Please choose one of the methods to handle the subcategories');
- $msgbox_error =
$GLOBALS['phpgw']->common->error_list($error);
+
$receipt['error'][]=array('msg'=>'Please choose one of the methods to handle
the subcategories');
break;
}
}
@@ -459,10 +458,8 @@
if ($apps_cats)
{
- $error = array('This category is currently
being used by applications as a parent category',
- 'You will need
to reassign these subcategories before you can delete this category');
-
- $msgbox_error =
$GLOBALS['phpgw']->common->error_list($error);
+ $receipt['message'][]=array('msg'=>'This
category is currently being used by applications as a parent category');
+ $receipt['message'][]=array('msg'=>'You will
need to reassign these subcategories before you can delete this category');
$show_done = 'yes';
}
else
@@ -495,11 +492,12 @@
);
$link_data['menu_selection'] =
$GLOBALS['phpgw_info']['flags']['menu_selection'];
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($receipt);
$data = array
(
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', $link_data),
'show_done' =>
$show_done,
- 'msgbox_data' =>
$msgbox_error,
+ 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'lang_delete' =>
lang('delete'),
'subs' =>
$subs,
'lang_confirm_msg' => $confirm_msg,
Modified: branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
===================================================================
--- branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
2011-02-09 13:59:23 UTC (rev 6956)
+++ branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
2011-02-09 14:00:59 UTC (rev 6957)
@@ -4,13 +4,44 @@
<xsl:apply-templates select="delete"/>
</xsl:template>
- <xsl:template match="delete">
+ <xsl:template match="delete" xmlns:php="http://php.net/xsl">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+
<h1><xsl:value-of select="lang_confirm_msg"/></h1>
<div class="button_group">
<form method="post" action="{form_action}">
- <input type="submit" name="cancel"
value="{lang_no}" />
+ <xsl:choose>
+ <xsl:when test="subs != ''">
+ <select name="subs" >
+ <option
value="none">
+
<xsl:value-of select="php:function('lang', 'select')" />
+ </option>
+ <option
value="move">
+
<xsl:value-of select="lang_sub_select_move"/>
+ </option>
+ <option
value="drop">
+
<xsl:value-of select="lang_sub_select_drop"/>
+ </option>
+ </select>
+ </xsl:when>
+ </xsl:choose>
+ <input type="submit" name="cancel"
value="{lang_no}" title="{lang_no_statustext}"/>
- <input type="submit" name="confirm"
value="{lang_yes}"/>
+ <xsl:choose>
+ <xsl:when test="show_done = ''">
+ <input type="submit"
name="confirm" value="{lang_yes}" title="{lang_yes_statustext}"/>
+ </xsl:when>
+ </xsl:choose>
+
+
</form>
</div>
</xsl:template>
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php
2011-02-09 13:59:23 UTC (rev 6956)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php
2011-02-09 14:00:59 UTC (rev 6957)
@@ -834,16 +834,29 @@
}
}
+ $this->db->query('SELECT cat_id FROM phpgw_categories
WHERE cat_id=' . $cat_id . $subdelete . " AND cat_appname='"
+ . $this->app_name .
"'",__LINE__,__FILE__);
+ $_cats = array();
+ while ($this->db->next_record())
+ {
+ $_cats[] = $this->db->f('cat_id');
+ }
+
$this->db->query('DELETE FROM phpgw_categories WHERE
cat_id=' . $cat_id . $subdelete . " AND cat_appname='"
. $this->app_name .
"'",__LINE__,__FILE__);
- $args = array
- (
- 'cat_id' => $cat_id,
- 'cat_owner' => $this->account_id,
- 'location' => 'cat_delete',
- 'location_id' => $this->location_id
- );
- $GLOBALS['phpgw']->hooks->single($args,
$this->app_name);
+
+ foreach($_cats as $_cat_id)
+ {
+ $args = array
+ (
+ 'cat_id' => $_cat_id,
+ 'cat_owner' => $this->account_id,
+ 'location' => 'cat_delete',
+ 'location_id' => $this->location_id
+ );
+
+ $GLOBALS['phpgw']->hooks->single($args,
$this->app_name);
+ }
}
/**
Modified: branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
2011-02-09 13:59:23 UTC (rev 6956)
+++ branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
2011-02-09 14:00:59 UTC (rev 6957)
@@ -575,14 +575,7 @@
$values = phpgw::get_var('values');
$values_attribute = phpgw::get_var('values_attribute');
- if(is_array($values_attribute))
- {
- foreach($values_attribute as &$_attr)
- {
- $_attr['value'] =
phpgw::get_var($_attr['name']);
- }
- }
-
+
$GLOBALS['phpgw_info']['apps']['manual']['section'] =
'general.edit.' . $this->type;
$GLOBALS['phpgw']->xslttpl->add_file(array('generic','attributes_form'));
@@ -633,10 +626,16 @@
{
foreach ($values_attribute as
$attribute )
{
+
if($attribute['nullable'] != 1 && (!$attribute['value'] &&
!$values['extra'][$attribute['name']]))
{
$receipt['error'][]=array('msg'=>lang('Please enter value for attribute %1',
$attribute['input_text']));
}
+
+
if(isset($attribute['value']) && $attribute['value'] && $attribute['datatype']
== 'I' && ! ctype_digit($attribute['value']))
+ {
+
$receipt['error'][]=array('msg'=>lang('Please enter integer for attribute %1',
$attribute['input_text']));
+ }
}
}
@@ -649,8 +648,7 @@
{
$id = $values['id'];
}
-//_debug_array($values);
-//_debug_array($values_attribute);die();
+
if(!$receipt['error'])
{
$receipt =
$this->bo->save($values,$action,$values_attribute);
@@ -662,16 +660,11 @@
}
$id = $receipt['id'];
}
- else
- {
- unset($values['id']);
- $id = '';
- }
}
else
{
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uigeneric.index', 'type'=> $this->type, 'type_id' =>
$this->type_id));
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uigeneric.index', 'type'=> $this->type, 'type_id' => $this->type_id));
}
}
@@ -734,10 +727,10 @@
phpgwapi_yui::tabview_setup('general_edit_tabview');
$attributes_groups =
$this->custom->get_attribute_groups($this->location_info['acl_app'],
$this->acl_location, $values['attributes']);
-
+//_debug_array($attributes_groups);die();
if((isset($attributes_groups[0]['id']) &&
$attributes_groups[0]['id'] > 0 ) || count($attributes_groups) > 1 )
{
- $tabs['general'] = array('label'
=> lang('general'), 'link' => '#general');
+// $tabs['general'] = array('label'
=> lang('general'), 'link' => '#general');
}
$attributes = array();
@@ -745,8 +738,8 @@
{
if(isset($group['attributes']) &&
isset($tabs['general']))
{
- $tabs[str_replace(' ', '_',
$group['name'])] = array('label' => $group['name'], 'link' => '#' .
str_replace(' ', '_', $group['name']));
- $group['link'] = str_replace('
', '_', $group['name']);
+// $tabs[str_replace(' ', '_',
$group['name'])] = array('label' => $group['name'], 'link' => '#' .
str_replace(' ', '_', $group['name']));
+// $group['link'] = str_replace('
', '_', $group['name']);
}
$attributes[] = $group;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6957] Merge 6954:6956 from trunk,
Sigurd Nes <=