projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved all SQL statements from PHP files into relevant *_db.inc files.
[fa-stable.git]
/
gl
/
manage
/
gl_account_classes.php
diff --git
a/gl/manage/gl_account_classes.php
b/gl/manage/gl_account_classes.php
index de419e72c6524492344f1b9df0f9babdc37a1742..d90a952402b033d33a51f0d19eb68f2289a98aba 100644
(file)
--- a/
gl/manage/gl_account_classes.php
+++ b/
gl/manage/gl_account_classes.php
@@
-9,11
+9,11
@@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =
3
;
-$path_to_root
=
"../..";
+$page_security =
'SA_GLACCOUNTCLASS'
;
+$path_to_root
=
"../..";
include($path_to_root . "/includes/session.inc");
include($path_to_root . "/includes/session.inc");
-page(_("GL Account Classes"));
+page(_(
$help_context =
"GL Account Classes"));
include($path_to_root . "/gl/includes/gl_db.inc");
include($path_to_root . "/gl/includes/gl_db.inc");
@@
-52,15
+52,16
@@
if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
if ($selected_id != -1)
{
if ($selected_id != -1)
{
- update_account_class($selected_id, $_POST['name'], $_POST['ctype']);
- display_notification(_('Selected account class settings has been updated'));
+ if(update_account_class($selected_id, $_POST['name'], $_POST['ctype']))
+
display_notification(_('Selected account class settings has been updated'));
}
else
{
}
else
{
- add_account_class($_POST['id'], $_POST['name'], $_POST['ctype']);
- display_notification(_('New account class has been added'));
+ if(add_account_class($_POST['id'], $_POST['name'], $_POST['ctype'])) {
+ display_notification(_('New account class has been added'));
+ $Mode = 'RESET';
+ }
}
}
- $Mode = 'RESET';
}
}
}
}
@@
-70,11
+71,7
@@
function can_delete($selected_id)
{
if ($selected_id == -1)
return false;
{
if ($selected_id == -1)
return false;
- $sql= "SELECT COUNT(*) FROM ".TB_PREF."chart_types
- WHERE class_id=$selected_id";
- $result = db_query($sql, "could not query chart master");
- $myrow = db_fetch_row($result);
- if ($myrow[0] > 0)
+ if (account_class_in_account_types($selected_id))
{
display_error(_("Cannot delete this account class because GL account types have been created referring to it."));
return false;
{
display_error(_("Cannot delete this account class because GL account types have been created referring to it."));
return false;