Example #1
0
 public static function menu()
 {
     if (!Acl::is_user() || !Base_AclCommon::check_permission('Fax - Browse')) {
         return array();
     }
     return array(_M('CRM') => array('__submenu__' => 1, _M('Fax') => array()));
 }
Example #2
0
 public static function menu()
 {
     if (Base_AclCommon::check_permission('Shoutbox')) {
         return array(_M('Shoutbox') => array());
     }
     return array();
 }
Example #3
0
 public function setShowValues($show)
 {
     if (!is_bool($show)) {
         throw new EControlException(_M($this->className . ':: setShowValues() - This method expects an boolean as parameter!'));
     }
     $this->showValues = $show;
 }
Example #4
0
 public function __construct($message = NULL, $code = 0)
 {
     if (!$message) {
         $message = _M('Unknow exception') . get_class($this);
     }
     parent::__construct($message, $code);
 }
Example #5
0
	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;
	}
 protected function _addControl($control, $pos = 0, $op = 'add')
 {
     if (is_null($control)) {
         return;
     } elseif (is_array($control)) {
         foreach ($control as $c) {
             $this->_addControl($c);
         }
         return;
     } elseif (!is_object($control)) {
         $control = new MRawControl($control);
     }
     if ($control instanceof MControl) {
         if ($control->getAjax() == null) {
             $control->setAjax($this->getAjax());
         }
         if ($op == 'add') {
             $this->controls->add($control);
         } elseif ($op == 'ins') {
             $this->controls->insert($control, $pos);
         } elseif ($op == 'set') {
             $this->controls->set($pos, $control);
         }
         $control->owner = $this;
     } else {
         throw new EControlException(_M('Using non-control with MContainerControl::_addControl: ' . $control));
     }
 }
Example #7
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;
	}
Example #8
0
 public function checkAccess($module, $action, $deny = false, $group = false)
 {
     if ($this->auth->isLogged()) {
         $login = $this->auth->getLogin();
         // MLogin object
         $isAdmin = $login->isAdmin();
         // Is administrator?
         $rights = $login->rights[$module];
         // user rights
         if (!$rights) {
             $login->setRights($this->getRights($login->id));
         }
         $ok = @in_array($action, $login->rights[$module]);
         if (!$ok && $group) {
             $groups = $this->getGroupsAllowed($module, $action);
             $ok = sizeof(array_intersect($groups, $login->groups)) > 0;
         }
     }
     if (!$ok && $deny) {
         $msg = _M('Access Denied') . "<br><br>\n" . '<center><big><i><font color=red>' . _M('Transaction: ') . "{$transaction}</font></i></big></center><br><br>\n" . _M('Please inform a valid login/password to access this content.') . "<br>";
         $users = $this->getUsersAllowed($module, $action);
         if ($users) {
             $msg .= "<br><br>\n" . _M('Users with access rights') . ":<ul><li>" . implode('<li>', $users) . '</ul>';
         }
         $go = $this->manager->history->back('action');
         $error = Prompt::error($msg, $go, $caption, '');
         $error->addButton(_M('   Login   '), $this->manager->getActionURL($this->manager->getConf('login.module'), 'login', null, array('return_to' => urlencode($this->manager->history->top()))), '');
         $this->manager->prompt($error, $deny);
         //$this->manager->error($msg, $go);
     }
     return $ok;
 }
Example #9
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;
 }
Example #10
0
 public static function menu()
 {
     if (Base_AclCommon::check_permission('Advanced User Settings')) {
         return array(_M('My settings') => array('__weight__' => 10, '__submenu__' => 1, _M('Control panel') => array()));
     }
     return array();
 }
Example #11
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;
 }
Example #12
0
 public function install()
 {
     Base_ThemeCommon::install_default_theme('CRM/Contacts/Activities');
     Utils_RecordBrowserCommon::new_addon('company', 'CRM/Contacts/Activities', 'company_activities', _M('Activities'));
     Utils_RecordBrowserCommon::new_addon('contact', 'CRM/Contacts/Activities', 'contact_activities', _M('Activities'));
     return true;
 }
Example #13
0
 public function setChecked($checked)
 {
     if (!is_bool($checked)) {
         throw new EControlException(_M($this->className . ':: setChecked() - This method expects an boolean as parameter!'));
     }
     $this->checked = $checked;
 }
Example #14
0
 public function dispatch($action)
 {
     mtrace('mcontroller::dispatch = ' . $action);
     if (!method_exists($this, $action)) {
         mtrace('action does not exists = ' . $action);
         try {
             $this->render($action);
         } catch (Exception $e) {
             throw new ERunTimeException(_M("App: [{$this->application}], Module: [{$this->module}], Controller: [{$this->name}] : action [{$action}] not found!"));
         }
     } else {
         try {
             $this->action = $action;
             if (MPage::isPostBack()) {
                 $actionPost = $action . 'Post';
                 if (method_exists($this, $actionPost)) {
                     $action = $actionPost;
                 }
             }
             mtrace('executing = ' . $action);
             $this->{$action}();
         } catch (Exception $e) {
             mdump($e->getMessage());
             if (\Manager::PROD()) {
                 $this->renderPrompt('error', $e->getMessage());
             } else {
                 $this->renderPrompt('error', "[<b>" . $this->name . '/' . $action . "</b>]" . $e->getMessage());
             }
         }
     }
 }
Example #15
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;
    }
Example #16
0
 public static function menu()
 {
     if (!Base_AclCommon::i_am_admin()) {
         return array();
     }
     return array('__split__' => array('__weight__' => 2000), _M('Administrator') => array('__weight__' => 2001));
 }
Example #17
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;
 }
Example #18
0
 public static function menu()
 {
     if (Base_AclCommon::check_permission('Calendar')) {
         return array(_M('CRM') => array('__submenu__' => 1, _M('Calendar') => array()));
     } else {
         return array();
     }
 }
Example #19
0
 public function install()
 {
     Base_ThemeCommon::install_default_theme($this->get_type());
     Utils_RecordBrowserCommon::new_addon('contact', 'CRM/Contacts/NotesAggregate', 'contact_addon', _M('Related Notes'));
     Utils_RecordBrowserCommon::new_addon('company', 'CRM/Contacts/NotesAggregate', 'company_addon', _M('Related Notes'));
     Utils_RecordBrowserCommon::new_addon('premium_salesopportunity', 'CRM/Contacts/NotesAggregate', 'salesopportunity_addon', _M('Related Notes'));
     return true;
 }
Example #20
0
 public static function menu()
 {
     if (Utils_RecordBrowserCommon::get_access('task', 'browse')) {
         return array(_M('CRM') => array('__submenu__' => 1, _M('Tasks') => array()));
     } else {
         return array();
     }
 }
Example #21
0
 public function install()
 {
     Base_ThemeCommon::install_default_theme($this->get_type());
     Utils_CommonDataCommon::new_id('Base_Notify/Timeout', true);
     Utils_CommonDataCommon::new_array('Base_Notify/Timeout', array(-1 => _M('Disable Notification'), 0 => _M('Manually')), true, true);
     Utils_CommonDataCommon::new_array('Base_Notify/Timeout', array(10000 => _M('10 seconds'), 30000 => _M('30 seconds'), 60000 => _M('1 minute')));
     return true;
 }
Example #22
0
 public function install()
 {
     Utils_CommonDataCommon::new_array('CRM', array(), true, true);
     Utils_CommonDataCommon::new_array('CRM/Priority', array(0 => _M('Low'), 1 => _M('Medium'), 2 => _M('High')), true, true);
     Utils_CommonDataCommon::new_array('CRM/Access', array(0 => _M('Public'), 1 => _M('Public, Read-Only'), 2 => _M('Private')), true, true);
     Utils_CommonDataCommon::new_array('CRM/Status', array(_M('Open'), _M('In Progress'), _M('On Hold'), _M('Closed'), _M('Canceled')), true, true);
     return true;
 }
 public function formNewFrameElement()
 {
     $this->data->idTemplate = $this->data->id;
     $model = new Template($this->data->idTemplate);
     $this->data->template = $model->getEntry() . '  [' . $model->getName() . ']';
     $this->data->save = "@fnbr20/structure/template/newFrameElement|formNewFrameElement";
     $this->data->close = "!\$('#formNewFrameElement_dialog').dialog('close');";
     $this->data->title = _M('New FrameElement');
     $this->render();
 }
 public function formNewDocument()
 {
     $this->data->idCorpus = $this->data->id;
     $model = new Corpus($this->data->idCorpus);
     $this->data->corpus = $model->getEntry() . '  [' . $model->getName() . ']';
     $this->data->save = "@fnbr20/structure/corpus/newDocument|formNewDocument";
     $this->data->close = "!\$('#formNewDocument_dialog').dialog('close');";
     $this->data->title = _M('New Document');
     $this->render();
 }
Example #25
0
 public static function menu()
 {
     if (Base_AclCommon::check_permission('Dashboard')) {
         $tray_settings = Utils_TrayCommon::get_trays();
         if (count($tray_settings) > 0) {
             return array(_M('Tray') => array('__icon__' => 'pile_small.png'));
         }
     }
     return array();
 }
Example #26
0
 public static function menu()
 {
     if (!self::admin_access()) {
         return;
     }
     if (self::has_license_key()) {
         return;
     }
     return array(_M('Support') => array('__submenu__' => 1, _M('Register EPESI!') => array()));
 }
 public function formObject()
 {
     $model = new RelationGroup($this->data->id);
     $this->data->forUpdate = $this->data->id != '';
     $this->data->object = $model->getData();
     $this->data->title = $this->data->forUpdate ? $model->getDescription() : _M("New Relation Group");
     $this->data->save = "@fnbr20/admin/relationgroup/save/" . $model->getId() . '|formObject';
     $this->data->delete = "@fnbr20/admin/relationgroup/delete/" . $model->getId() . '|formObject';
     $this->render();
 }
Example #28
0
 public static function menu()
 {
     if (!self::admin_access()) {
         return;
     }
     if (!Base_EssClientCommon::has_license_key()) {
         return;
     }
     return array(_M('Support') => array('__submenu__' => 1, _M('EPESI Store') => array('__function__' => 'manage')));
 }
 public function formNewRelationType()
 {
     $nodeId = $this->data->id;
     if ($nodeId[0] == 'm') {
         $this->data->id = substr($this->data->id, 1);
     }
     $this->data->save = "@fnbr20/structure/relationtype/newRelationType|formNewRelationType";
     $this->data->close = "!\$('#formNew_dialog').dialog('close');";
     $this->data->title = _M('New Relation Type');
     $this->render();
 }
 public function formNewLayerGroup()
 {
     $nodeId = $this->data->id;
     if ($nodeId[0] == 'm') {
         $this->data->id = substr($this->data->id, 1);
     }
     $this->data->save = "@fnbr20/structure/layergroup/newLayerGroup|formNewLayerGroup";
     $this->data->close = "!\$('#formNew_dialog').dialog('close');";
     $this->data->title = _M('New Layer Group');
     $this->render();
 }