예제 #1
0
 public function install()
 {
     Base_AclCommon::add_permission(_M('View Activity Report'), array('ACCESS:employee', 'ACCESS:manager'));
     Base_ThemeCommon::install_default_theme($this->get_type());
     Utils_RecordBrowserCommon::new_addon('contact', 'Apps/ActivityReport', 'contact_addon', array('Apps_ActivityReportCommon', 'contact_addon_label'));
     return true;
 }
예제 #2
0
    public function install()
    {
        global $database;
        $ret = true;
        $ret &= DB::CreateTable('base_user_settings', '
			user_login_id I4 NOTNULL,
			module C(128) NOTNULL,
			variable C(64) NOTNULL,
			value X NOTNULL', array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(id), PRIMARY KEY(user_login_id,module,variable)'));
        if (!$ret) {
            print 'Unable to create table base_user_settings.<br>';
            return false;
        }
        $ret &= DB::CreateTable('base_user_settings_admin_defaults', '
			module C(128) NOTNULL,
			variable C(64) NOTNULL,
			value X NOTNULL', array('constraints' => ', PRIMARY KEY(module,variable)'));
        if (!$ret) {
            print 'Unable to create table base_user_settings_defaults.<br>';
            return false;
        }
        Base_ThemeCommon::install_default_theme(Base_User_SettingsInstall::module_name());
        Base_AclCommon::add_permission(_M('Advanced User Settings'), array('ACCESS:employee'));
        return $ret;
    }
예제 #3
0
 public function install()
 {
     Base_ThemeCommon::install_default_theme('CRM/Calendar');
     Base_AclCommon::add_permission(_M('Calendar'), array('ACCESS:employee'));
     DB::CreateTable('crm_calendar_custom_events_handlers', 'id I4 AUTO KEY,' . 'group_name C(64),' . 'handler_callback C(128)', array('constraints' => ''));
     return true;
 }
예제 #4
0
	public function install() {
		Base_ThemeCommon::install_default_theme($this->get_type());
		$ret = true;
		$ret &= DB::CreateTable('utils_messenger_message','
			id I4 AUTO KEY,
			callback_method C(255) NOTNULL,
			callback_args X,
			message X,
			created_by I4 NOTNULL,
			created_on T NOTNULL,
			alert_on T,
			parent_module C(32) NOTNULL,
			page_id C(32) NOTNULL',
			array('constraints'=>', FOREIGN KEY (created_by) REFERENCES user_login(ID)'));
		if(!$ret){
			print('Unable to create table utils_messenger_message.<br>');
			return false;
		}
		$ret &= DB::CreateTable('utils_messenger_users','
			message_id I4,
			done I1 DEFAULT 0,
			user_login_id I4,
			done_on T,
			follow I1 DEFAULT 0',
			array('constraints'=>' , FOREIGN KEY (message_id) REFERENCES utils_messenger_message(id), FOREIGN KEY (user_login_id) REFERENCES user_login(ID)'));
		if(!$ret){
			print('Unable to create table utils_messenger_users.<br>');
			return false;
		}
		Base_AclCommon::add_permission(_M('Messenger Alerts'),array('ACCESS:employee'));
		
		return $ret;
	}
예제 #5
0
 public function install()
 {
     Base_ThemeCommon::install_default_theme($this->get_type());
     Base_AclCommon::add_permission(_M('Fax - Browse'), array('ACCESS:employee'));
     Base_AclCommon::add_permission(_M('Fax - Send'), array('ACCESS:employee'));
     $this->create_data_dir();
     return true;
 }
예제 #6
0
	public function install() {
		Base_ThemeCommon::install_default_theme($this->get_type());
		$ret = true;
		$ret &= DB::CreateTable('utils_watchdog_category',
					'id I AUTO KEY,'.
					'name C(32),'.
					'callback C(128)',
			array('constraints'=>''));
		if(!$ret){
			print('Unable to create table utils_watchdog_category.<br>');
			return false;
		}
		$ret &= DB::CreateTable('utils_watchdog_event',
					'id I AUTO KEY,'.
					'category_id I,'.
					'internal_id I,'.
					'message C(64),'.
					'event_time T',
			array('constraints'=>', FOREIGN KEY (category_id) REFERENCES utils_watchdog_category(id)'));
		if(!$ret){
			print('Unable to create table utils_watchdog_event.<br>');
			return false;
		}
		$ret &= DB::CreateTable('utils_watchdog_subscription',
					'category_id I,'.
					'internal_id I,'.
					'last_seen_event I,'.
					'user_id I',
			array('constraints'=>', FOREIGN KEY (user_id) REFERENCES user_login(id)'));
		if(!$ret){
			print('Unable to create table utils_watchdog_subscription.<br>');
			return false;
		}
		$ret &= DB::CreateTable('utils_watchdog_category_subscription',
					'category_id I,'.
					'user_id I',
			array('constraints'=>', FOREIGN KEY (user_id) REFERENCES user_login(id), FOREIGN KEY (category_id) REFERENCES utils_watchdog_category(id)'));
		if(!$ret){
			print('Unable to create table utils_watchdog_category_subscription.<br>');
			return false;
		}

		DB::CreateIndex('utils_watchdog_event__internal_id__idx', 'utils_watchdog_event', 'internal_id');
		DB::CreateIndex('utils_watchdog_event__cat_int__idx', 'utils_watchdog_event', array('category_id','internal_id'));
		DB::CreateIndex('utils_watchdog_subscription__cat_int__idx', 'utils_watchdog_subscription', array('category_id','internal_id'));
		DB::CreateIndex('utils_watchdog_subscription__user__idx', 'utils_watchdog_subscription', 'user_id');
		Base_AclCommon::add_permission(_M('Watchdog - subscribe to categories'),array('ACCESS:employee','ACCESS:manager'));
		return $ret;
	}
예제 #7
0
    public function install()
    {
        $ret = true;
        $ret &= DB::CreateTable('apps_shoutbox_messages', '
			id I4 AUTO KEY,
			base_user_login_id I4 NOTNULL,
			to_user_login_id I4,
			message X,
			posted_on T DEFTIMESTAMP', array('constraints' => ', FOREIGN KEY (base_user_login_id) REFERENCES user_login(ID)'));
        if (!$ret) {
            print 'Unable to create table apps_shoutbox_messages.<br>';
            return false;
        }
        Base_ThemeCommon::install_default_theme($this->get_type());
        Base_AclCommon::add_permission(_M('Shoutbox'), array('ACCESS:employee'));
        return $ret;
    }
예제 #8
0
    public function install()
    {
        $ret = true;
        $ret &= DB::CreateTable('crm_filters_group', '
			id I4 AUTO KEY,
			name C(128) NOTNULL,
			description C(255),
			user_login_id I4 NOTNULL', array('constraints' => ', UNIQUE(name, user_login_id), FOREIGN KEY (user_login_id) REFERENCES user_login(ID)'));
        if (!$ret) {
            print 'Unable to create table crm_filters_group.<br>';
            return false;
        }
        $ret &= DB::CreateTable('crm_filters_contacts', '
			group_id I4 NOTNULL,
			contact_id I4', array('constraints' => ', FOREIGN KEY (group_id) REFERENCES crm_filters_group(id)'));
        if (!$ret) {
            print 'Unable to create table crm_filters_contacts.<br>';
            return false;
        }
        Base_ThemeCommon::install_default_theme($this->get_type());
        Base_AclCommon::add_permission(_M('Manage Perspective'), array('ACCESS:employee'));
        return $ret;
    }
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
Base_AclCommon::add_permission(_M('Watchdog - subscribe to categories'), array('ACCESS:employee', 'ACCESS:manager'));
예제 #10
0
	public function install() {
		$ret = true;
        Utils_RecordBrowserCommon::uninstall_recordset('utils_attachment');
        $fields = array(
            array(
                'name' => _M('Edited on'),
                'type' => 'timestamp',
                'extra'=>false,
                'visible'=>true,
                'required' => false,
                'display_callback'=>array('Utils_AttachmentCommon','display_date'),
                'QFfield_callback'=>array('Utils_AttachmentCommon','QFfield_date')
            ),
            array(
                'name' => _M('Title'),
                'type' => 'text',
                'param' => 255,
                'required' => false, 'extra' => false, 'visible' => false
            ),
            array('name' => _M('Note'),
                'type' => 'long text',
                'required' => false,
                'extra' => false,
                'visible'=>true,
                'display_callback'=>array('Utils_AttachmentCommon','display_note'),
                'QFfield_callback'=>array('Utils_AttachmentCommon','QFfield_note'),
            ),
            array('name' => _M('Permission'),
                'type' => 'commondata',
                'required' => true,
                'param' => array('order_by_key' => true, 'CRM/Access'),
                'extra' => false),
            array('name' => _M('Sticky'),
                'type' => 'checkbox',
                'visible' => true,
                'extra' => false),
            array('name' => _M('Crypted'),
                'type' => 'checkbox',
                'extra' => false,
                'QFfield_callback'=>array('Utils_AttachmentCommon','QFfield_crypted')),
            array('name' => _M('Attached to'),
                'type' => 'calculated',
                'extra' => false,
                'display_callback'=>array('Utils_AttachmentCommon','display_attached_to')),
        );
        Utils_RecordBrowserCommon::install_new_recordset('utils_attachment',$fields);
        Utils_RecordBrowserCommon::add_access('utils_attachment', 'view', 'ACCESS:employee', array('(!permission'=>2, '|:Created_by'=>'USER_ID'));
        Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', 'ACCESS:employee', array(':Created_by'=>'USER_ID'));
        Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', array('ACCESS:employee','ACCESS:manager'));
        Utils_RecordBrowserCommon::add_access('utils_attachment', 'add', 'ACCESS:employee',array(),array('edited_on'));
        Utils_RecordBrowserCommon::add_access('utils_attachment', 'edit', 'ACCESS:employee', array('(permission'=>0, '|:Created_by'=>'USER_ID'),array('edited_on'));
        Utils_RecordBrowserCommon::register_processing_callback('utils_attachment',array('Utils_AttachmentCommon','submit_attachment'));
        Utils_RecordBrowserCommon::set_tpl('utils_attachment', Base_ThemeCommon::get_template_filename('Utils/Attachment', 'View_entry'));
        Utils_RecordBrowserCommon::enable_watchdog('utils_attachment', array('Utils_AttachmentCommon','watchdog_label'));
        Utils_RecordBrowserCommon::set_caption('utils_attachment', _M('Note'));
        Utils_RecordBrowserCommon::set_description_callback('utils_attachment', array('Utils_AttachmentCommon','description_callback'));
        Utils_RecordBrowserCommon::set_jump_to_id('utils_attachment', false);
        Utils_RecordBrowserCommon::set_search('utils_attachment',1,0);

        $ret &= DB::CreateTable('utils_attachment_local','
			local C(255) NOTNULL,
			attachment I4 NOTNULL,
			func C(255),
			args C(255)',
            array('constraints'=>', FOREIGN KEY (attachment) REFERENCES utils_attachment_data_1(ID)'));
        if(!$ret){
            print('Unable to create table utils_attachment_local.<br>');
            return false;
        }
        DB::CreateIndex('utils_attachment_local__idx', 'utils_attachment_local', 'local');

		$ret &= DB::CreateTable('utils_attachment_file','
			id I4 AUTO KEY NOTNULL,
			attach_id I4 NOTNULL,
			original C(255) NOTNULL,
			created_by I4,
			created_on T DEFTIMESTAMP,
			deleted I1 NOTNULL DEFAULT 0',
			array('constraints'=>', FOREIGN KEY (created_by) REFERENCES user_login(ID), FOREIGN KEY (attach_id) REFERENCES utils_attachment_data_1(id)'));
		if(!$ret){
			print('Unable to create table utils_attachment_file.<br>');
			return false;
		}
        DB::CreateIndex('attach_id_idx','utils_attachment_file','attach_id');
		$ret &= DB::CreateTable('utils_attachment_download','
			id I4 AUTO KEY NOTNULL,
			attach_file_id I4 NOTNULL,
			created_by I4,
			created_on T,
			expires_on T,
			remote I1 DEFAULT 0,
			download_on T DEFTIMESTAMP,
			ip_address C(32),
			host_name C(64),
			description C(128),
			token C(32)',
			array('constraints'=>', FOREIGN KEY (created_by) REFERENCES user_login(ID), FOREIGN KEY (attach_file_id) REFERENCES utils_attachment_file(id)'));
		if(!$ret){
			print('Unable to create table utils_attachment_download.<br>');
			return false;
		}
		$ret &= DB::CreateTable('utils_attachment_clipboard','
			id I4 AUTO KEY NOTNULL,
			filename C(255),
			created_by I4,
			created_on T DEFTIMESTAMP',
			array('constraints'=>''));

		$this->create_data_dir();
		file_put_contents($this->get_data_dir().'.htaccess','deny from all');
		Base_ThemeCommon::install_default_theme($this->get_type());
		
		DB::CreateTable('utils_attachment_googledocs','
			id I4 AUTO KEY NOTNULL,
			note_id I4 NOTNULL,
			view_link C(255),
			doc_id C(128)',
			array('constraints'=>''));
		
		Base_AclCommon::add_permission(_M('Attachments - view full download history'), array('ACCESS:employee'));

		Variable::set('utils_attachments_google_user', '');
		Variable::set('utils_attachments_google_pass', '');
		return $ret;
	}
예제 #11
0
 public function install()
 {
     Base_AclCommon::add_permission(_M('View Activity Report'), array('ACCESS:employee', 'ACCESS:manager'));
     Base_ThemeCommon::install_default_theme($this->get_type());
     return true;
 }
예제 #12
0
    public function install()
    {
        $ret = true;
        $ret &= DB::CreateTable('base_dashboard_tabs', '
			id I4 AUTO KEY,
			user_login_id I4,
			name C(64) NOTNULL,
			pos I2', array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(ID)'));
        if (!$ret) {
            print 'Unable to create table base_dashboard_tabs.<br>';
            return false;
        }
        $ret &= DB::CreateTable('base_dashboard_default_tabs', '
			id I4 AUTO KEY,
			name C(64) NOTNULL,
			pos I2');
        if (!$ret) {
            print 'Unable to create table base_dashboard_default_tabs.<br>';
            return false;
        }
        DB::Execute('INSERT INTO base_dashboard_default_tabs(name,pos) VALUES(\'Default\',0)');
        $ret &= DB::CreateTable('base_dashboard_applets', '
			id I4 AUTO KEY,
			user_login_id I4,
			module_name C(128),
			col I2 DEFAULT 0,
			pos I2 DEFAULT 0,
			color I2 DEFAULT 0,
			tab I4', array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(ID), FOREIGN KEY (tab) REFERENCES base_dashboard_tabs(ID)'));
        if (!$ret) {
            print 'Unable to create table base_dashboard_applets.<br>';
            return false;
        }
        $ret &= DB::CreateTable('base_dashboard_settings', '
			applet_id I4,
			name C(32) NOTNULL,
			value X NOTNULL', array('constraints' => ', FOREIGN KEY (applet_id) REFERENCES base_dashboard_applets(ID), PRIMARY KEY(applet_id,name)'));
        if (!$ret) {
            print 'Unable to create table base_dashboard_settings.<br>';
            return false;
        }
        $ret &= DB::CreateTable('base_dashboard_default_applets', '
			id I4 AUTO KEY,
			module_name C(128),
			col I2 DEFAULT 0,
			pos I2 DEFAULT 0,
			color I2 DEFAULT 0,
			tab I4', array('constraints' => ', FOREIGN KEY (tab) REFERENCES base_dashboard_default_tabs(ID)'));
        if (!$ret) {
            print 'Unable to create table base_dashboard_default_applets.<br>';
            return false;
        }
        $ret &= DB::CreateTable('base_dashboard_default_settings', '
			applet_id I4,
			name C(32) NOTNULL,
			value X NOTNULL', array('constraints' => ', FOREIGN KEY (applet_id) REFERENCES base_dashboard_default_applets(ID), PRIMARY KEY(applet_id,name)'));
        if (!$ret) {
            print 'Unable to create table base_dashboard_default_settings<br>';
            return false;
        }
        Base_ThemeCommon::install_default_theme($this->get_type());
        Base_AclCommon::add_permission(_M('Dashboard'), array('ACCESS:employee'));
        Base_HomePageCommon::set_home_page(_M('Dashboard'), array('ACCESS:employee'));
        Base_HomePageCommon::set_home_page(_M('My Contact'), array());
        // Not exactly the place to add that, but we need to ensure proper order of home pages
        return $ret;
    }
예제 #13
0
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
Base_AclCommon::add_permission(_M('Dashboard - manage applets'), array('ACCESS:employee'));
예제 #14
0
 public function install()
 {
     Base_ThemeCommon::install_default_theme(Base_SearchInstall::module_name());
     Base_AclCommon::add_permission(_M('Search'), array('ACCESS:employee'));
     return true;
 }
예제 #15
0
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (in_array('base_acl_permission', DB::MetaTables())) {
    return;
}
DB::CreateTable('base_acl_permission', 'id I4 AUTO KEY,' . 'name C(255)', array('constraints' => ''));
DB::CreateTable('base_acl_rules', 'id I4 AUTO KEY,' . 'permission_id I', array('constraints' => ', FOREIGN KEY (permission_id) REFERENCES base_acl_permission(id)'));
DB::CreateTable('base_acl_rules_clearance', 'id I4 AUTO KEY,' . 'rule_id I,' . 'clearance C(64)', array('constraints' => ', FOREIGN KEY (rule_id) REFERENCES base_acl_rules(id)'));
$permissions = array('Apps_ActivityReport' => array('View Activity Report', array('ACCESS:employee', 'ACCESS:manager')), 'Apps_Shoutbox' => array('Shoutbox', array('ACCESS:employee')), 'Base_Dashboard' => array('Dashboard', array('ACCESS:employee')), 'Base_Search' => array('Search', array('ACCESS:employee')), 'Base_User_Settings' => array('Advanced User Settings', array('ACCESS:employee')), 'CRM_Calendar' => array('Calendar', array('ACCESS:employee')), 'CRM_Filters' => array('Manage Perspective', array('ACCESS:employee')), 'Premium_Import' => array('Import', array('SUPERADMIN')), 'Premium_Warehouse_Items_Orders' => array('Inventory - Sell at loss', array('ACCESS:employee', 'ACCESS:manager')), 'Utils_Attachment' => array('Attachments - view full download history', array('ACCESS:employee')), 'Utils_Messenger' => array('Messenger Alerts', array('ACCESS:employee')), 'CRM_Fax' => array('Fax - Browse', array('ACCESS:employee')), 'CRM_Fax' => array('Fax - Send', array('ACCESS:employee')), 'Premium_Warehouse_eCommerce_Allegro' => array('Inventory - Allegro Settings', array('ACCESS:employee')));
foreach ($permissions as $module => $params) {
    if (ModuleManager::is_installed($module) >= 0) {
        Base_AclCommon::add_permission($params[0], $params[1]);
    }
}