public function install() { $fields = array( array('name' => _M('Project Name'), 'type'=>'text', 'required'=>true, 'param'=>'64', 'extra'=>false, 'visible'=>true,'display_callback'=>array('Tests_BugtrackCommon', 'display_bugtrack')), array('name' => _M('Company Name'), 'type'=>'select', 'required'=>true, 'param'=>array('company'=>'Company Name'), 'extra'=>false, 'visible'=>true), array('name' => _M('Due Date'), 'type'=>'date', 'required'=>true, 'param'=>64, 'extra'=>false, 'visible'=>true), array('name' => _M('Status'), 'type'=>'commondata', 'required'=>true, 'param'=>'Bugtrack_Status', 'extra'=>false,'visible'=>true), array('name' => _M('Description'), 'type'=>'long text', 'required'=>false, 'param'=>'64', 'extra'=>false) ); Utils_RecordBrowserCommon::install_new_recordset('bugtrack', $fields); Utils_RecordBrowserCommon::new_filter('bugtrack', 'Company Name'); Utils_RecordBrowserCommon::set_quickjump('bugtrack', 'Project Name'); Utils_RecordBrowserCommon::set_favorites('bugtrack', true); Utils_RecordBrowserCommon::set_recent('bugtrack', 15); Utils_RecordBrowserCommon::set_caption('bugtrack', _M('Bugtrack')); Utils_RecordBrowserCommon::set_icon('bugtrack', Base_ThemeCommon::get_template_filename('Tests/Bugtrack', 'icon.png')); // ************ addons ************** // Utils_AttachmentCommon::new_addon('bugtrack'); Utils_RecordBrowserCommon::new_addon('company', 'Tests/Bugtrack', 'company_bugtrack_addon', 'Bugtrack'); // ************ other ************** // Utils_CommonDataCommon::new_array('Bugtrack_Status',array('new'=>_M('New'),'inprog'=>_M('In Progress'),'cl'=>_M('Closed')),true,true); Utils_RecordBrowserCommon::add_access('bugtrack', 'view', 'ACCESS:employee'); Utils_RecordBrowserCommon::add_access('bugtrack', 'add', 'ACCESS:employee'); Utils_RecordBrowserCommon::add_access('bugtrack', 'edit', 'ACCESS:employee'); Utils_RecordBrowserCommon::add_access('bugtrack', 'delete', array('ACCESS:employee', 'ACCESS:manager')); return true; }
public function install() { Base_ThemeCommon::install_default_theme($this->get_type()); Variable::set('error_mail', ''); $this->create_data_dir(); return true; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme($this->get_type()); DB::DropTable('base_home_page'); DB::DropTable('base_home_page_clearance'); return true; }
public static function submit_contact($values, $mode) { if ($mode == 'display') { $ret = array(); $in = self::Instance(); $filename = self::get_photo($values['id']); if ($filename) { $file = $in->get_data_dir() . $filename; } else { $file = Base_ThemeCommon::get_template_file('CRM/Contacts/Photo', 'placeholder.png'); $ret['photo_note'] = __('Click to change'); } $ret['photo_link'] = Module::create_href(array('upload_new_photo' => $values['id'])) . ' ' . Utils_TooltipCommon::open_tag_attrs(__('Click to change the photo'), false); $ret['photo_src'] = $file; } else { $ret = $values; } if (isset($_REQUEST['upload_new_photo']) && $_REQUEST['upload_new_photo'] == $values['id']) { unset($_REQUEST['upload_new_photo']); $x = ModuleManager::get_instance('/Base_Box|0'); if (!$x) { trigger_error('There is no base box module instance', E_USER_ERROR); } $x->push_main('CRM/Contacts/Photo', 'body', array($values)); } return $ret; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme($this->get_type()); DB::DropTable('epesi_store_modules'); $this->remove_data_dir(); return true; }
public function uninstall() { global $database; $ret = true; $ret &= DB::DropTable('utils_commondata_tree'); Base_ThemeCommon::uninstall_default_theme($this->get_type()); return $ret; }
public static function get_installed_applets_html() { $colors = Base_DashboardCommon::get_available_colors(); $app_cap = ModuleManager::call_common_methods('applet_caption'); asort($app_cap); $app_info = ModuleManager::call_common_methods('applet_info'); $html = ''; foreach ($app_cap as $name => $cap) { if (!$cap) { continue; } $th = Base_ThemeCommon::init_smarty(); $id = str_replace('_', '-', $name); if (!isset($app_info[$name])) { $app_info[$name] = ''; } $th->assign('content', '<div class="content" style="padding:4px;" id="dashboard_applet_content_' . $id . '">' . $app_info[$name] . '</div>'); $th->assign('handle_class', 'handle'); $th->assign('caption', $cap); $th->assign('color', $colors[0]['class']); $remove_button = Base_DashboardCommon::get_remove_applet_button($id, false); $th->assign('remove', $remove_button); $th->assign('__link', array('remove' => Base_ThemeCommon::parse_links('remove', $remove_button))); //print('<xmp>'.self::get_remove_applet_button(null, false).'</xmp><br>'); $th->assign('actions', array()); $th->assign('config_mode', true); $html .= '<div class="applet" searchkey="' . strtolower($cap ? $cap : $name) . ';' . strtolower($app_info[$name]) . '" id="ab_item_' . 'new_' . $id . '">'; ob_start(); Base_ThemeCommon::display_smarty($th, 'Base_Dashboard', 'default'); $html .= ob_get_clean(); $html .= '</div>'; } return $html; }
public function uninstall() { $ret = true; if ($ret) { $ret = Variable::delete('mail_from_addr'); } if ($ret) { $ret = Variable::delete('mail_from_name'); } if ($ret) { $ret = Variable::delete('mail_use_replyto'); } if ($ret) { $ret = Variable::delete('mail_method'); } if ($ret) { $ret = Variable::delete('mail_user'); } if ($ret) { $ret = Variable::delete('mail_password'); } if ($ret) { $ret = Variable::delete('mail_host'); } if ($ret) { $ret = Variable::delete('mail_security'); } if ($ret) { $ret = Variable::delete('mail_auth'); } Base_ThemeCommon::uninstall_default_theme($this->get_type()); return $ret; }
private function print_structure($t = array(), $level = 0, $path = null) { if(count($t) > 0) { if($path===null) { $this->_sub = 0; $ret = '<div class=utils_tree_root>'; } else { $ret = '<div class=utils_tree_submenu id=utils_tree_'.$this->_id.'_'.$this->_sub.'>'; $this->_sub++; } foreach( $t as $k => $v ) { $ret .= '<div id=utils_tree_node_'.$this->_id.' class=utils_tree_node onmouseover=\'if(typeof(utils_tree_hl)!="undefined")utils_tree_hl(this)\' onmouseout=\'if(typeof(utils_tree_rg)!="undefined")utils_tree_rg(this)\'><table><tr>'; if(isset($v['sub']) && count($v['sub']) > 0) $ret .= '<td id=utils_tree_opener_'.$this->_id.'_'.($this->_sub).' class=utils_tree_opener_active_closed onclick="tree_node_visibility_toggle('.$this->_id.', '.($this->_sub).')"><img id=utils_tree_opener_img_'.$this->_id.'_'.($this->_sub).' src="'.Base_ThemeCommon::get_template_file($this->get_type(),'opener_active_closed.gif').'"></td>'; else $ret .= '<td class=utils_tree_opener_inactive><img src="'.Base_ThemeCommon::get_template_file($this->get_type(),'opener_inactive.gif').'"></td>'; if(isset($v['selected']) && $v['selected'] == 1) $ret .= "<td class=utils_tree_node_content_selected>".$v['name']."</td>"; else $ret .= "<td class=utils_tree_node_content>".$v['name']."</td>"; if(isset($v['visible']) && $v['visible'] == 1 && $path!==null) array_push($this->_opened_paths, $path); if(isset($v['opened']) && $v['opened'] == 1 && is_array($v['sub']) && !empty($v['sub'])) array_push($this->_opened_paths, $path.'_'.$this->_sub); $ret .= "</tr></table></div>"; if(isset($v['sub']) && is_array($v['sub'])) { $ret .= $this->print_structure($v['sub'], $level + 1, $path.'_'.$this->_sub); } } $ret .= "</div>"; return $ret; } return ''; }
public function uninstall() { Utils_CommonDataCommon::remove('Calling_Codes'); Utils_CommonDataCommon::remove('Countries'); Base_ThemeCommon::uninstall_default_theme($this->get_type()); return true; }
public function uninstall() { Base_AclCommon::delete_permission('Calendar'); DB::DropTable('crm_calendar_custom_events_handlers'); Base_ThemeCommon::uninstall_default_theme('CRM/Calendar'); return true; }
public static function get($id, $content, $header = '', $big = 0) { if (MOBILE_DEVICE) { return ''; } static $init = true; if ($init) { Base_ThemeCommon::load_css('Libs/Leightbox', 'default', false); load_js('modules/Libs/Leightbox/leightbox.js'); $init = false; } ob_start(); print '<div id="' . $id . '" big="1" class="leightbox">'; print '<input type="hidden" id="' . $id . '_bigsize" value="' . ($big ? 1 : 0) . '" />'; if ($big) { eval_js('s = $(\'' . $id . '\').style;' . 's.top = \'5%\';' . 's.left = \'5%\';' . 's.width = \'90%\';' . 's.height = \'90%\';' . 's.padding = \'0px\';'); } $smarty = Base_ThemeCommon::init_smarty(); $smarty->assign('close_href', 'href="javascript:leightbox_deactivate(\'' . $id . '\')"'); $smarty->assign('content', $content); $smarty->assign('header', $header); $smarty->assign('close_label', __('Close')); $smarty->assign('resize_label', __('Resize')); $smarty->assign('close_href', 'href="javascript:leightbox_deactivate(\'' . $id . '\')"'); Base_ThemeCommon::display_smarty($smarty, 'Libs_Leightbox'); print '</div>'; return ob_get_clean(); }
public function manage() { if (!Base_EpesiStoreCommon::admin_access()) { return; } $button_label = Base_EssClientCommon::has_license_key() ? __('License Key') : __('Register EPESI!'); Base_ActionBarCommon::add(Base_ThemeCommon::get_template_file('Base_EpesiStore', 'icon.png'), $button_label, $this->create_callback_href(array($this, 'display_registration_form'))); Base_ActionBarCommon::add('view', __('Invoices'), $this->create_callback_href(array($this, 'display_invoices'))); $setup = $this->init_module('Base_Setup'); $setup->set_inline_display(); if (Base_SetupCommon::is_simple_setup()) { if (!$this->isset_module_variable('filter_set')) { eval_js('base_setup__last_filter="' . (!Base_EssClientCommon::has_license_key() ? '' : (Base_EpesiStoreCommon::is_update_available() ? 'updates' : 'store')) . '";'); $this->set_module_variable('filter_set', true); } $this->display_module($setup, array(true), 'admin'); return; } Base_ActionBarCommon::add('settings', __('Simple view'), $this->create_callback_href(array($this, 'switch_simple'), true)); $tb = $this->init_module('Utils_TabbedBrowser'); $tb->set_tab('Modules Setup', array($this, 'setup_admin'), array($setup)); $tb->set_tab('Epesi Store', array($this, 'form_main_store'), array()); $tb->tag(); $this->display_module($tb); }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme('CRM/Contacts/Activities'); Utils_RecordBrowserCommon::delete_addon('company', 'CRM/Contacts/Activities', 'company_activities'); Utils_RecordBrowserCommon::delete_addon('contact', 'CRM/Contacts/Actitivies', 'contact_activities'); return true; }
public function uninstall() { Base_AclCommon::delete_permission('Fax - Browse'); Base_AclCommon::delete_permission('Fax - Send'); Base_ThemeCommon::uninstall_default_theme($this->get_type()); return true; }
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; }
public function uninstall() { $ret = true; $ret &= DB::DropTable('apps_shoutbox_messages'); Base_AclCommon::delete_permission('Shoutbox'); Base_ThemeCommon::uninstall_default_theme($this->get_type()); return $ret; }
public function action() { set_time_limit(0); Cache::clear(); ModuleManager::create_common_cache(); Base_ThemeCommon::themeup(); return true; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme($this->get_type()); Utils_RecordBrowserCommon::delete_addon('contact', 'CRM/Contacts/NotesAggregate', 'contact_addon'); Utils_RecordBrowserCommon::delete_addon('company', 'CRM/Contacts/NotesAggregate', 'company_addon'); Utils_RecordBrowserCommon::delete_addon('premium_salesopportunity', 'CRM/Contacts/NotesAggregate', 'salesopportunity_addon'); return true; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme(Base_User_LoginInstall::module_name()); Variable::delete('host_ban_time'); Variable::delete('host_ban_nr_of_tries'); Variable::delete('host_ban_by_login'); return DB::DropTable('user_password') && DB::DropTable('user_login_ban') && DB::DropTable('user_autologin') && DB::DropTable('user_reset_pass'); }
public function submit_admin($data) { Variable::set('default_theme', $data['theme']); Base_ThemeCommon::create_cache(); Base_StatusBarCommon::message('Theme changed - reloading page'); eval_js('setTimeout(\'document.location=\\\'index.php\\\'\',\'3000\')'); return true; }
public function uninstall() { $ret = true; $ret &= DB::DropTable('base_notify'); Base_ThemeCommon::uninstall_default_theme($this->get_type()); Utils_CommonDataCommon::remove('Base_Notify'); return $ret; }
public static function get_ini_file() { if (Base_BoxCommon::$ini_file) { $ini = Base_BoxCommon::$ini_file; } else { $ini = Base_ThemeCommon::get_template_file('Base_Box', 'default.ini'); } return $ini; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme($this->get_type()); Variable::delete('printers_registered', false); Variable::delete('print_document_types', false); Variable::delete('print_href_callback', false); Variable::delete('print_disabled_templates', false); return true; }
public function uninstall() { Base_AclCommon::delete_permission('Advanced User Settings'); global $database; $ret = true; $ret &= DB::DropTable('base_user_settings'); Base_ThemeCommon::uninstall_default_theme(Base_User_SettingsInstall::module_name()); return $ret; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme('CRM/Contacts/Activities'); Utils_RecordBrowserCommon::set_tpl('contact', Base_ThemeCommon::get_template_filename('CRM/Contacts', 'Contact')); Utils_RecordBrowserCommon::unregister_processing_callback('contact', array('CRM_Contacts_PhotoCommon', 'submit_contact')); $this->remove_data_dir(); DB::DropTable(CRM_Contacts_PhotoCommon::table_name); return true; }
public function uninstall() { Base_AclCommon::delete_permission('Manage Perspective'); $ret = true; $ret &= DB::DropTable('crm_filters_contacts'); $ret &= DB::DropTable('crm_filters_group'); Base_ThemeCommon::uninstall_default_theme($this->get_type()); return $ret; }
public function uninstall() { Base_ThemeCommon::uninstall_default_theme($this->get_type()); $ret = true; $ret &= DB::DropTable('utils_watchdog_subscription'); $ret &= DB::DropTable('utils_watchdog_category_subscription'); $ret &= DB::DropTable('utils_watchdog_event'); $ret &= DB::DropTable('utils_watchdog_category'); return $ret; }
public static function print_event($ev, $mode = '', $with_div = true) { $th = Base_ThemeCommon::init_smarty(); $ex = self::process_event($ev); $th->assign('event_id', $ev['id']); $th->assign('draggable', !isset($ev['draggable']) || $ev['draggable'] === true); $title = $ev['title']; $title_st = strip_tags($ev['title']); $title_s = $title; $th->assign('with_div', $with_div); $th->assign('title', $title); $th->assign('title_s', $title_s); $th->assign('description', $ev['description']); $th->assign('color', $ev['color']); $th->assign('start', $ex['start']); $th->assign('start_time', $ex['start_time']); $th->assign('end_time', $ex['end_time']); $th->assign('start_date', $ex['start_date']); $th->assign('end_date', $ex['end_date']); $th->assign('start_day', $ex['start_day']); $th->assign('end_day', $ex['end_day']); $th->assign('end', $ex['end']); $th->assign('duration', $ex['duration']); $th->assign('show_hide_info', __('Click to show / hide menu')); $th->assign('additional_info', $ev['additional_info']); $th->assign('additional_info2', $ev['additional_info2']); if (isset($ev['custom_tooltip'])) { $th->assign('custom_tooltip', $ev['custom_tooltip']); } ob_start(); Base_ThemeCommon::display_smarty($th, 'Utils_Calendar', 'event_tip'); $tip = ob_get_clean(); $th->assign('tip_tag_attrs', Utils_TooltipCommon::open_tag_attrs($tip, false)); if (!isset($ev['view_action']) || $ev['view_action'] === true) { $th->assign('view_href', Module::create_href(array('UCev_id' => $ev['id'], 'UCaction' => 'view'))); } elseif ($ev['view_action'] !== false) { $th->assign('view_href', $ev['view_action']); } if (!isset($ev['edit_action']) || $ev['edit_action'] === true) { $th->assign('edit_href', Module::create_href(array('UCev_id' => $ev['id'], 'UCaction' => 'edit'))); } elseif ($ev['edit_action'] !== false) { $th->assign('edit_href', $ev['edit_action']); } $link_text = Module::create_href_js(array('UCev_id' => $ev['id'], 'UCaction' => 'move', 'UCdate' => '__YEAR__-__MONTH__-__DAY__')); if (!isset($ev['move_action']) || $ev['move_action'] === true) { $th->assign('move_href', Utils_PopupCalendarCommon::create_href('move_event' . str_replace(array('#', '-'), '_', $ev['id']), $link_text, null, null, 'popup.clonePosition(\'utils_calendar_event:' . $ev['id'] . '\',{setWidth:false,setHeight:false,offsetTop:$(\'utils_calendar_event:' . $ev['id'] . '\').getHeight()})')); } if (!isset($ev['delete_action']) || $ev['delete_action'] === true) { $th->assign('delete_href', Module::create_confirm_href(__('Delete this event?'), array('UCev_id' => $ev['id'], 'UCaction' => 'delete'))); } elseif ($ev['delete_action'] !== false) { $th->assign('delete_href', $ev['delete_action']); } $th->assign('handle_class', 'handle'); $th->assign('custom_actions', $ev['actions']); Base_ThemeCommon::display_smarty($th, 'Utils_Calendar', 'event' . ($mode ? '_' . $mode : '')); }
public function uninstall() { DB::DropTable('recordbrowser_clipboard_pattern'); DB::DropTable('recordbrowser_browse_mode_definitions'); DB::DropTable('recordbrowser_addon'); DB::DropTable('recordbrowser_table_properties'); DB::DropTable('recordbrowser_datatype'); Base_PrintCommon::unregister_printer('Utils_RecordBrowser_RecordPrinter'); Base_ThemeCommon::uninstall_default_theme('Utils/RecordBrowser'); return true; }