[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] admin/inc hook_admin.inc.php class.bo_custom_fi...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] admin/inc hook_admin.inc.php class.bo_custom_fi... |
Date: |
Sun, 19 Nov 2006 12:34:13 +0000 |
CVSROOT: /sources/phpgroupware
Module name: admin
Changes by: Sigurd Nes <sigurdne> 06/11/19 12:34:13
Modified files:
inc : hook_admin.inc.php
Removed files:
inc : class.bo_custom_fields.inc.php
class.ui_custom_fields.inc.php
Log message:
obsolete - clean up
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/admin/inc/hook_admin.inc.php?cvsroot=phpgroupware&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/admin/inc/class.bo_custom_fields.inc.php?cvsroot=phpgroupware&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/admin/inc/class.ui_custom_fields.inc.php?cvsroot=phpgroupware&r1=1.2&r2=0
Patches:
Index: hook_admin.inc.php
===================================================================
RCS file: /sources/phpgroupware/admin/inc/hook_admin.inc.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- hook_admin.inc.php 3 Apr 2006 18:58:15 -0000 1.42
+++ hook_admin.inc.php 19 Nov 2006 12:34:12 -0000 1.43
@@ -8,7 +8,7 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\**************************************************************************/
- /* $Id: hook_admin.inc.php,v 1.42 2006/04/03 18:58:15 sigurdne Exp $ */
+ /* $Id: hook_admin.inc.php,v 1.43 2006/11/19 12:34:12 sigurdne Exp $ */
if (! $GLOBALS['phpgw']->acl->check('site_config_access',1,'admin'))
{
@@ -50,16 +50,6 @@
if (! $GLOBALS['phpgw']->acl->check('custom_fields_access',1,'admin'))
{
- $file['custom fields'] = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'admin.ui_custom_fields.index', 'appname' => 'admin') );
- }
-
- if (! $GLOBALS['phpgw']->acl->check('custom_fields_access',1,'admin'))
- {
- $file['custom fields2'] = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'admin.ui_custom.list_attribute', 'appname' => 'tts') );
- }
-
- if (! $GLOBALS['phpgw']->acl->check('custom_fields_access',1,'admin'))
- {
$file['custom functions'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_custom_function', 'appname' => 'tts') );
}
Index: class.bo_custom_fields.inc.php
===================================================================
RCS file: class.bo_custom_fields.inc.php
diff -N class.bo_custom_fields.inc.php
--- class.bo_custom_fields.inc.php 12 Mar 2006 11:39:55 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,112 +0,0 @@
-<?php
-/**
-* phpGroupWare custom fields manager
-* @author Dave Hall dave.hall at skwashd.com
-* @copyright Copyright (C) 2006 Free Software Foundation http://www.fsf.org/
-* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
-* @version $Id: class.bo_custom_fields.inc.php,v 1.2 2006/03/12 11:39:55
skwashd Exp $
-*/
-
- class bo_custom_fields
- {
- /**
- * @var $custom refernce to API custom fields object
- */
- var $custom;
-
- /**
- * @var array $public_functions the publicly accessiable
methods for this class
- */
- var $public_functions = array
- (
-
'add_field' => true,
-
'get_field' => true,
-
'delete_field' => true
- );
-
- /**
- * @constructor
- */
- function bo_custom_fields($appname = '')
- {
- if (
$GLOBALS['phpgw']->acl->check('custom_fields_access',1,'admin'))
- {
- Header('HTTP/1.0 403 Forbidden');
- die(lang('you do not have access to this
functionality'));
- }
- $this->custom = createObject('phpgwapi.custom_fields',
$appname);
- }
-
- function add_field()
- {
- $put_data = file_get_contents('php://input');
- $json = createObject('phpgwapi.Services_JSON');
- $field = $json->decode($put_data);
- unset($put_data);
-
- $this->custom->set_application = $field['appname'];
-
- $id = $this->custom->add_field($field);
- if ( $id > 0 )
- {
- die($json->encode($id));
- }
- header('HTTP/1.1 500 ERROR');
- die( lang('error: %1.',
$this->custom->db->adodb->ErrorMsg()) . "\n" . lang('your entry has not been
saved.') );
- }
-
- function delete_field()
- {
- if ( !$this->custom->is_used($_GET['id']) )
- {
- if ( $this->custom->delete_field($_GET['id']) )
- {
- die('record deleted');
- }
- header('HTTP/1.1 500 ERROR');
- die( lang('error: %1.',
$this->custom->db->adodb->ErrorMsg()) . "\n" . lang('the record has not been
deleted.') );
- }
- else
- {
- header('HTTP/1.1 403 ERROR');
- die( lang('this field is in use, you can not
delete the record until all linked records are unlinked or removed') );
-
- }
- }
-
- function get_field()
- {
- $field = $this->custom->get_field($_GET['id']);
- $json = createObject('phpgwapi.Services_JSON');
- if ( is_array($field) && isset($field[$_GET['id']]) )
- {
- die($json->encode($field[$_GET['id']]));
- }
- header('HTTP/1.1 404 Not Found');
- die( $json->encode(lang('error: %1.', lang('field %1
was not found', $_GET['id']) ) ) );
- }
-
- function list_fields()
- {
- return $this->custom->list_fields(false);
- }
-
- function list_field_types($inc_none = true, $inc_inactive =
false)
- {
- $fields = array();
-
- if ( $inc_none )
- {
- $fields[0] = array
- (
- 'id' => 0,
- 'value' => lang('none'),
- );
- }
-
- $fields +=
$this->custom->list_field_types($inc_inactive);
-
- return $fields;
- }
- }
-?>
Index: class.ui_custom_fields.inc.php
===================================================================
RCS file: class.ui_custom_fields.inc.php
diff -N class.ui_custom_fields.inc.php
--- class.ui_custom_fields.inc.php 12 Mar 2006 11:39:55 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,161 +0,0 @@
-<?php
-/**
-* phpGroupWare custom fields manager
-* @author Dave Hall dave.hall at skwashd.com
-* @copyright Copyright (C) 2006 Free Software Foundation http://www.fsf.org/
-* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
-* @version $Id: class.ui_custom_fields.inc.php,v 1.2 2006/03/12 11:39:55
skwashd Exp $
-*/
- class ui_custom_fields
- {
- /**
- * @var object $bo reference to business logic class
- */
- var $bo;
-
- /**
- * @var array $public_functions the publicly avaibale methods
of this class
- */
- var $public_functions = array
- (
- 'index'
=> true,
- 'show'
=> true
- );
-
- /**
- * @var object $t reference to global xslt template variable
- */
- var $t;
-
- /**
- * @constructor
- */
- function ui_custom_fields()
- {
- if (
$GLOBALS['phpgw']->acl->check('custom_fields_access',1,'admin'))
- {
-
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
- exit;
- }
-
- $this->bo =& createObject('admin.bo_custom_fields',
$_REQUEST['appname']);
- $this->t =& $GLOBALS['phpgw']->xslttpl;
- }
-
- /**
- * Wrapper for show
- */
- function index()
- {
- $this->show();
- }
-
- /**
- * Display the list of custom fields available for the
application
- */
- function show()
- {
- if ( !isset($_REQUEST['appname']) )
- {
- $this->_error('no application name provided,
exiting');
- }
-
- if (
!isset($GLOBALS['phpgw_info']['user']['apps'][$_REQUEST['appname']]) )
- {
- $this->_error('you don\'t have access to this
application');
- }
-
- $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('custom fields');
-
- if ( !$GLOBALS['phpgw']->js )
- {
- $GLOBALS['phpgw']->js =&
createObject('phpgwapi.javascript');
- }
-
- $GLOBALS['phpgw']->js->validate_file('core', 'base');
- $GLOBALS['phpgw']->js->validate_file('json', 'json');
- $GLOBALS['phpgw']->js->validate_file('sarissa',
'sarissa');
- $GLOBALS['phpgw']->js->validate_file('base',
'custom_fields', 'admin');
-
- $this->t->add_file('custom_fields');
-
- $data = array
- (
- 'appname'
=> $_REQUEST['appname'],
- 'app_icon'
=> $GLOBALS['phpgw']->common->image('admin', 'navbar', '.png', false),
- 'img_add'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_add', '.png', false),
- 'img_back'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'left', '.png', false),
- 'img_cancel' =>
$GLOBALS['phpgw']->common->image('phpgwapi', 'stock_cancel', '.png', false),
- 'img_close'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'close', '.png', false),
- 'img_close_icon' =>
$GLOBALS['phpgw']->common->image('phpgwapi', 'stock_close', '.png', false),
- 'img_edit'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_edit', '.png', false),
- 'img_forward' =>
$GLOBALS['phpgw']->common->image('phpgwapi', 'right', '.png', false),
- 'img_no'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_no', '.png', false),
- 'img_ok'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_ok', '.png', false),
- 'img_remove' =>
$GLOBALS['phpgw']->common->image('phpgwapi', 'stock_remove', '.png', false),
- 'img_save'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_save', '.png', false),
- 'img_view'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_view-fields', '.png',
false),
- 'img_yes'
=> $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_yes', '.png', false),
- 'lang_add'
=> lang('add'),
- 'lang_add_fields' =>
lang('add fields'),
- 'lang_application' =>
lang('application'),
- 'lang_apply' =>
lang('apply'),
- 'lang_back'
=> lang('back'),
- 'lang_basics' =>
lang('basics'),
- 'lang_cancel' =>
lang('cancel'),
- 'lang_click_apply' =>
lang('click "apply" to save your changes'),
- 'lang_click_forward'=>
lang('click "forward" to begin'),
- 'lang_close' =>
lang('close'),
- 'lang_completed_add'=>
lang('congratulations, you have created a new custom field'),
- 'lang_db_lookup' =>
lang('database lookup'),
- 'lang_disable' =>
lang('disable'),
- 'lang_display' =>
lang('display'),
- 'lang_done'
=> lang('done'),
- 'lang_edit'
=> lang('edit'),
- 'lang_enabled' =>
lang('enabled'),
- 'lang_explain_add' =>
lang('welcome to the custom field assistant, the assistant will help you add a
new custom field to be used within phpgroupware'),
- 'lang_explain_basics' =>
lang('please enter how you would like this field displayed in a form. the
field name must can only contain a-z, 0-9, _ and - and will be converted to all
lower case.'),
- 'lang_explain_edit' =>
lang('making changes here will instantly change how this field is handled with
the application'),
- 'lang_explain_remove'=> lang
('do you wish to remove this field? answering yes this will permanantly remove
the following record:'),
- 'lang_field_name' =>
lang('field name'),
- 'lang_field_type' =>
lang('field type'),
- 'lang_filter' =>
lang('filter'),
- 'lang_forward' =>
lang('forward'),
- 'lang_help'
=> lang('help'),
- 'lang_id'
=> lang('id'),
- 'lang_label' =>
lang('label'),
- 'lang_list'
=> lang('list'),
- 'lang_no'
=> lang('no'),
- 'lang_remove' =>
lang('remove'),
- 'lang_remove_field' =>
lang('remove field'),
- 'lang_save'
=> lang('save'),
- 'lang_search' =>
lang('search'),
- 'lang_value' =>
lang('value'),
- 'lang_values' =>
lang('values'),
- 'lang_view'
=> lang('view'),
- 'lang_view_field' =>
lang('view field'),
- 'lang_warn_no_undo' =>
lang('deleting this record can not be undone at a later stage'),
- 'lang_yes'
=> lang('yes')
- );
-
- $data['custom_fields_field'] =
$this->bo->list_fields($_REQUEST['appname']);
- $data['custom_field_types'] = array();
- $data['custom_field_types']['field_type'] =
$this->bo->list_field_types();
-
- $this->t->set_var('phpgw', array('custom_fields' =>
$data) );
- }
-
- /**
- * Display a run time error message to the user
- *
- * @internal currently terminates script for all errors, this
will change to fatal only at some point
- * @param string $msg the error message
- * @param bool $fatal is the error fatal
- */
- function _error($msg, $fatal = true )
- {
- die( lang($msg) );
- }
- }
-?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] admin/inc hook_admin.inc.php class.bo_custom_fi...,
Sigurd Nes <=