当前位置: 首页>>代码示例>>PHP>>正文


PHP ModuleManager::is_installed方法代码示例

本文整理汇总了PHP中ModuleManager::is_installed方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleManager::is_installed方法的具体用法?PHP ModuleManager::is_installed怎么用?PHP ModuleManager::is_installed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModuleManager的用法示例。


在下文中一共展示了ModuleManager::is_installed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: admin_caption

 public static function admin_caption()
 {
     if (ModuleManager::is_installed('Base_EpesiStore') >= 0 && Base_EpesiStoreCommon::admin_access()) {
         return null;
     }
     return array('label' => __('Modules Administration'), 'section' => __('Server Configuration'));
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:SetupCommon_0.php

示例2: admin

 /**
  * For internal use only.
  */
 public function admin()
 {
     if ($this->is_back()) {
         $this->parent->reset();
         return;
     }
     $form = $this->init_module(Libs_QuickForm::module_name());
     //defaults
     $defaults = array();
     $defaults['mail_method'] = Variable::get('mail_method');
     $defaults['mail_use_replyto'] = Variable::get('mail_use_replyto');
     $defaults['mail_user'] = Variable::get('mail_user');
     $defaults['mail_from_addr'] = Variable::get('mail_from_addr');
     $defaults['mail_from_name'] = Variable::get('mail_from_name');
     $defaults['mail_host'] = Variable::get('mail_host');
     $defaults['mail_security'] = Variable::get('mail_security', false);
     $defaults['mail_auth'] = Variable::get('mail_auth');
     $defaults['mail_password'] = Variable::get('mail_password');
     $form->setDefaults($defaults);
     //form
     $form->addElement('header', null, __('Mail settings'));
     $form->addElement('select', 'mail_method', __('Choose method'), array('smtp' => __('remote smtp server'), 'mail' => __('local php.ini settings')), 'onChange="' . $form->get_submit_form_js(false) . '"');
     $form->addElement('text', 'mail_from_addr', __('Administrator e-mail address'));
     $form->addRule('mail_from_addr', __('Invalid e-mail address'), 'email');
     $form->addRule('mail_from_addr', __('Field required'), 'required');
     $form->addElement('text', 'mail_from_name', __('Send e-mails from name'));
     $form->addElement('text', 'mail_use_replyto', __('Set "Reply-To" email address'));
     $form->addRule('mail_use_replyto', __('Invalid e-mail address'), 'email');
     $method = $form->getElement('mail_method')->getSelected();
     if ($method[0] == 'smtp') {
         $form->addElement('text', 'mail_host', __('SMTP host address'));
         $form->addRule('mail_host', __('Field required'), 'required');
         $form->addElement('select', 'mail_security', __('Security'), array('' => __('None'), 'ssl' => 'SSL', 'ssl_ssc' => 'SSL (self signed certificate)', 'tls' => 'TLS', 'tls_ssc' => 'TLS (self signed certificate)'));
         $form->addElement('checkbox', 'mail_auth', __('SMTP authorization'), '', 'onChange="' . $form->get_submit_form_js(false) . '"');
         $auth = $form->getElement('mail_auth')->getValue();
         if ($auth) {
             $form->addElement('text', 'mail_user', __('Login'));
             $form->addElement('password', 'mail_password', __('Password'));
         }
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
     if (ModuleManager::is_installed('CRM_Contacts') >= 0) {
         $me = CRM_ContactsCommon::get_my_record();
         $email = $me['email'];
         Base_ActionBarCommon::add('search', __('Test'), $this->create_callback_href(array($this, 'test_mail_config'), array($email)), __('E-mail will be sent to %s to test the configuration', array('<b>' . $email . '</b>')));
     }
     if ($form->getSubmitValue('submited') && $form->validate() && $form->process(array(&$this, 'submit_admin'))) {
         Base_StatusBarCommon::message(__('Settings saved'));
     }
     $form->display();
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:55,代码来源:Mail_0.php

示例3: drawLeightbox

 public static function drawLeightbox($prefix)
 {
     if (MOBILE_DEVICE) {
         return;
     }
     $meetings = ModuleManager::is_installed('CRM/Meeting') >= 0;
     $tasks = ModuleManager::is_installed('CRM/Tasks') >= 0;
     $phonecall = ModuleManager::is_installed('CRM/PhoneCall') >= 0;
     self::check_location();
     if (!isset(self::$leightbox_ready[$prefix])) {
         self::$leightbox_ready[$prefix] = true;
         $theme = Base_ThemeCommon::init_smarty();
         eval_js_once($prefix . '_followups_deactivate = function(){leightbox_deactivate(\'' . $prefix . '_followups_leightbox\');}');
         if ($meetings) {
             $theme->assign('new_meeting', array('open' => '<a id="' . $prefix . '_new_meeting_button" onclick="' . $prefix . '_set_action(\'new_meeting\');' . $prefix . '_submit_form();">', 'text' => __('New Meeting'), 'close' => '</a>'));
             eval_js('Event.observe(\'' . $prefix . '_new_meeting_button\',\'click\', ' . $prefix . '_followups_deactivate)');
         }
         if ($tasks) {
             $theme->assign('new_task', array('open' => '<a id="' . $prefix . '_new_task_button" onclick="' . $prefix . '_set_action(\'new_task\');' . $prefix . '_submit_form();">', 'text' => __('New Task'), 'close' => '</a>'));
             eval_js('Event.observe(\'' . $prefix . '_new_task_button\',\'click\', ' . $prefix . '_followups_deactivate)');
         }
         if ($phonecall) {
             $theme->assign('new_phonecall', array('open' => '<a id="' . $prefix . '_new_phonecall_button" onclick="' . $prefix . '_set_action(\'new_phonecall\');' . $prefix . '_submit_form();">', 'text' => __('New Phonecall'), 'close' => '</a>'));
             eval_js('Event.observe(\'' . $prefix . '_new_phonecall_button\',\'click\', ' . $prefix . '_followups_deactivate)');
         }
         $theme->assign('just_close', array('open' => '<a id="' . $prefix . '_just_close_button" onclick="' . $prefix . '_set_action(\'none\');' . $prefix . '_submit_form();">', 'text' => __('Save'), 'close' => '</a>'));
         eval_js('Event.observe(\'' . $prefix . '_just_close_button\',\'click\', ' . $prefix . '_followups_deactivate)');
         eval_js($prefix . '_submit_form = function () {' . '$(\'' . $prefix . '_follow_up_form\').submited.value=1;Epesi.href($(\'' . $prefix . '_follow_up_form\').serialize(), \'processing...\');$(\'' . $prefix . '_follow_up_form\').submited.value=0;' . '}');
         eval_js($prefix . '_set_action = function (arg) {' . 'document.forms["' . $prefix . '_follow_up_form"].action.value = arg;' . '}');
         eval_js($prefix . '_set_id = function (id) {' . 'document.forms["' . $prefix . '_follow_up_form"].id.value = id;' . '$("' . $prefix . '_closecancel").value=3;' . '$("' . $prefix . '_note").value="";' . '}');
         $theme->assign('form_open', '<form id="' . $prefix . '_follow_up_form" name="' . $prefix . '_follow_up_form" method="POST">' . '<input type="hidden" name="submited" value="0" />' . '<input type="hidden" name="form_name" value="' . $prefix . '_follow_up_form" />' . '<input type="hidden" name="id" value="" />' . '<input type="hidden" name="action" value="" />');
         $status_select_options = '';
         $statuses = Utils_CommonDataCommon::get_translated_array('CRM/Status');
         foreach ($statuses as $key => $value) {
             $status_select_options .= '<option value="' . htmlspecialchars($key) . '"' . ($key == 3 ? ' selected="1"' : '') . '>' . htmlspecialchars($value) . '</option>';
         }
         $theme->assign('form_closecancel', array('label' => __('Status'), 'html' => '<select name="closecancel" id="' . $prefix . '_closecancel" value="0">' . $status_select_options . '</select>'));
         $theme->assign('form_note', array('label' => __('Note'), 'html' => '<textarea name="note" id="' . $prefix . '_note"></textarea>'));
         $theme->assign('form_close', '</form>');
         ob_start();
         Base_ThemeCommon::display_smarty($theme, 'CRM_Followup', 'leightbox');
         $profiles_out = ob_get_clean();
         Libs_LeightboxCommon::display($prefix . '_followups_leightbox', $profiles_out, __('Follow-up'));
     }
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:45,代码来源:FollowupCommon_0.php

示例4: prepare_header

    public static function prepare_header(& $tcpdf, $title='', $subject='', $printed_by=true, $logo_filename=null, $l = array()) {
        if ($title!==null) {
            if ($logo_filename===null) $logo_filename = Libs_TCPDFCommon::get_logo_filename();
            if ($logo_filename!==false && !file_exists($logo_filename)) {
                $logo_filename = Base_ThemeCommon::get_template_file('Libs/TCPDF','logo-small.png');
            }
            $margins = $tcpdf->getMargins();
            if($logo_filename) {
                $logo_size = getimagesize($logo_filename);
                $logo_height = $logo_size[1] * PDF_HEADER_LOGO_WIDTH / $logo_size[0];
            } else {
                $logo_height = 0;
            }
            $tcpdf->SetHeaderMargin(10);
            $tcpdf->SetTopMargin($logo_height + $margins['top']);
            $tcpdf->SetHeaderData($logo_filename, $logo_filename?PDF_HEADER_LOGO_WIDTH:0, $title, $subject);
        } else {
            $tcpdf->setPrintHeader(false);
        }

        //set some language-dependent strings
        $l['a_meta_charset'] = "UTF-8";
        $l['a_meta_dir'] = "ltr";
        $l['a_meta_language'] = "pl";

        $who = null;
        if (ModuleManager::is_installed('CRM/Contacts') >= 0) {
            $who = CRM_ContactsCommon::get_contact_by_user_id(Acl::get_user());
        }
        if ($who!==null) $who = $who['last_name'].' '.$who['first_name'];
        else $who= Base_UserCommon::get_user_login(Acl::get_user());
        $when = date('Y-m-d H:i:s');
        if (!isset($l['w_page'])) {
			$l['w_page'] = '';
			if ($printed_by) $l['w_page'] .= __('Printed with %s by %s, on %s, ',array('EPESI (http://epe.si)',$who,$when));
			$l['w_page'] .= __('Page');
		}
        $tcpdf->setLanguageArray($l);

        self::SetFont($tcpdf, self::$default_font, '', 9);
    }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:41,代码来源:TCPDFCommon_0.php

示例5: install

 public function install()
 {
     //addons table
     $fields = array(array('name' => _M('Recordset'), 'type' => 'text', 'param' => 64, 'display_callback' => array($this->get_type() . 'Common', 'display_recordset'), 'QFfield_callback' => array($this->get_type() . 'Common', 'QFfield_recordset'), 'required' => true, 'extra' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('phonecall_related', $fields);
     Utils_RecordBrowserCommon::set_caption('phonecall_related', _M('Phonecalls Related Recordsets'));
     Utils_RecordBrowserCommon::register_processing_callback('phonecall_related', array('CRM_PhoneCallCommon', 'processing_related'));
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'add', 'ADMIN');
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'edit', 'SUPERADMIN');
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'delete', 'SUPERADMIN');
     // ************ phone calls ************** //
     Base_ThemeCommon::install_default_theme(CRM_PhoneCallInstall::module_name());
     $fields = array(array('name' => _M('Subject'), 'type' => 'text', 'required' => true, 'param' => '64', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_subject')), array('name' => _M('Contact Name'), 'type' => 'hidden', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_contact_name')), array('name' => _M('Phone Number'), 'type' => 'hidden', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_phone_number')), array('name' => _M('Customer'), 'type' => 'crm_company_contact', 'param' => array('field_type' => 'select'), 'extra' => false), array('name' => _M('Other Customer'), 'type' => 'checkbox', 'extra' => false, 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_other_contact')), array('name' => _M('Other Customer Name'), 'type' => 'text', 'param' => '64', 'extra' => false), array('name' => _M('Permission'), 'type' => 'commondata', 'required' => true, 'param' => array('order_by_key' => true, 'CRM/Access'), 'extra' => false), array('name' => _M('Employees'), 'type' => 'crm_contact', 'param' => array('field_type' => 'multiselect', 'crits' => array('CRM_PhoneCallCommon', 'employees_crits'), 'format' => array('CRM_ContactsCommon', 'contact_format_no_company')), 'required' => true, 'extra' => false, 'visible' => true, 'filter' => true), array('name' => _M('Status'), 'type' => 'commondata', 'required' => true, 'filter' => true, 'param' => array('order_by_key' => true, 'CRM/Status'), 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_status')), array('name' => _M('Priority'), 'type' => 'commondata', 'required' => true, 'param' => array('order_by_key' => true, 'CRM/Priority'), 'extra' => false), array('name' => _M('Phone'), 'type' => 'integer', 'extra' => false, 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_phone'), 'display_callback' => array('CRM_PhoneCallCommon', 'display_phone')), array('name' => _M('Other Phone'), 'type' => 'checkbox', 'extra' => false, 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_other_phone')), array('name' => _M('Other Phone Number'), 'type' => 'text', 'param' => '64', 'extra' => false), array('name' => _M('Date and Time'), 'type' => 'timestamp', 'required' => true, 'extra' => false, 'visible' => true), array('name' => _M('Description'), 'type' => 'long text', 'required' => false, 'param' => '255', 'extra' => false), array('name' => _M('Related'), 'type' => 'multiselect', 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_related'), 'param' => '__RECORDSETS__::;CRM_PhoneCallCommon::related_crits', 'extra' => false, 'required' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('phonecall', $fields);
     Utils_RecordBrowserCommon::set_tpl('phonecall', Base_ThemeCommon::get_template_filename(CRM_PhoneCallInstall::module_name(), 'default'));
     Utils_RecordBrowserCommon::register_processing_callback('phonecall', array('CRM_PhoneCallCommon', 'submit_phonecall'));
     Utils_RecordBrowserCommon::set_icon('phonecall', Base_ThemeCommon::get_template_filename(CRM_PhoneCallInstall::module_name(), 'icon.png'));
     Utils_RecordBrowserCommon::set_recent('phonecall', 5);
     Utils_RecordBrowserCommon::set_caption('phonecall', _M('Phonecalls'));
     Utils_RecordBrowserCommon::enable_watchdog('phonecall', array('CRM_PhoneCallCommon', 'watchdog_label'));
     Utils_RecordBrowserCommon::set_search('phonecall', 2, 0);
     // ************ addons ************** //
     Utils_AttachmentCommon::new_addon('phonecall');
     Utils_RecordBrowserCommon::new_addon('phonecall', CRM_PhoneCallInstall::module_name(), 'messanger_addon', _M('Alerts'));
     CRM_RoundcubeCommon::new_addon('phonecall');
     // ************ other ************** //
     CRM_CalendarCommon::new_event_handler(_M('Phonecalls'), array('CRM_PhoneCallCommon', 'crm_calendar_handler'));
     Utils_BBCodeCommon::new_bbcode('phone', 'CRM_PhoneCallCommon', 'phone_bbcode');
     if (ModuleManager::is_installed('Premium_SalesOpportunity') >= 0) {
         Utils_RecordBrowserCommon::new_record_field('phonecall', _M('Opportunity'), 'select', true, false, 'premium_salesopportunity::Opportunity Name;Premium_SalesOpportunityCommon::crm_opportunity_reference_crits', '', false);
     }
     Utils_RecordBrowserCommon::add_access('phonecall', 'view', 'ACCESS:employee', array('(!permission' => 2, '|employees' => 'USER'));
     Utils_RecordBrowserCommon::add_access('phonecall', 'add', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('phonecall', 'edit', 'ACCESS:employee', array('(permission' => 0, '|employees' => 'USER', '|customer' => 'USER'));
     Utils_RecordBrowserCommon::add_access('phonecall', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
     Utils_RecordBrowserCommon::add_access('phonecall', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
     return true;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:39,代码来源:PhoneCallInstall.php

示例6: user_search

 public static function user_search($search = null)
 {
     $myid = Base_AclCommon::get_user();
     if (Base_User_SettingsCommon::get('Apps_Shoutbox', 'enable_im')) {
         $adm = Base_User_SettingsCommon::get_admin('Apps_Shoutbox', 'enable_im');
         if (ModuleManager::is_installed('CRM_Contacts') >= 0) {
             $emps = DB::GetAssoc('SELECT l.id,' . DB::ifelse('cd.f_last_name!=\'\'', DB::concat('cd.f_last_name', DB::qstr(' '), 'cd.f_first_name'), 'l.login') . ' as name FROM user_login l LEFT JOIN contact_data_1 cd ON (cd.f_login=l.id AND cd.active=1) LEFT JOIN base_user_settings us ON (us.user_login_id=l.id AND module=\'Apps_Shoutbox\' AND variable=\'enable_im\') WHERE l.active=1 AND l.id!=%d AND (us.value=%s OR us.value is ' . ($adm ? '' : 'not ') . 'null) AND (cd.f_first_name ' . DB::like() . ' ' . DB::concat(DB::qstr("%%"), "%s", DB::qstr("%%")) . ' OR cd.f_last_name ' . DB::like() . ' ' . DB::concat(DB::qstr("%%"), "%s", DB::qstr("%%")) . ') ORDER BY name', array($myid, serialize(1), $search, $search));
         } else {
             $emps = DB::GetAssoc('SELECT l.id,l.login FROM user_login l LEFT JOIN base_user_settings us ON (us.user_login_id=l.id AND module=\'Apps_Shoutbox\' AND variable=\'enable_im\') WHERE l.active=1 AND l.id!=%d AND (us.value=%s OR us.value is ' . ($adm ? '' : 'not ') . 'null) AND l.login ' . DB::like() . ' ' . DB::concat(DB::qstr("%%"), "%s", DB::qstr("%%")) . ' ORDER BY l.login', array($myid, serialize(1), $search));
         }
     } else {
         $emps = array();
     }
     if (ModuleManager::is_installed('Tools_WhoIsOnline') >= 0) {
         $online = Tools_WhoIsOnlineCommon::get_ids();
         foreach ($online as $id) {
             if (isset($emps[$id])) {
                 $emps[$id] = '* ' . $emps[$id];
             }
         }
     }
     return $emps;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:23,代码来源:ShoutboxCommon_0.php

示例7: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
$module_name = 'Utils/QueryBuilder';
if (ModuleManager::is_installed($module_name) < 0) {
    ModuleManager::install($module_name);
}
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:20151014_install_query_builder.php

示例8: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (ModuleManager::is_installed('Base_Help') >= 0) {
    return;
}
ModuleManager::install('Base_Help');
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:20121123_interactive_help_added.php

示例9: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (ModuleManager::is_installed('CRM_Meeting') == -1) {
    return;
}
Utils_RecordBrowserCommon::new_filter('crm_meeting', 'Date');
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:crm_meetings_filters.php

示例10: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (ModuleManager::is_installed('CRM_Roundcube') >= 0) {
    foreach (DB::GetCol('SELECT id FROM user_login') as $id) {
        $identity = DB::GetOne("SELECT " . DB::Concat('f_first_name', DB::qstr(' '), 'f_last_name') . " FROM contact_data_1 WHERE f_login =%d", array($id));
        foreach (DB::GetCol("SELECT f_email FROM rc_accounts_data_1 WHERE f_epesi_user=%d", array($id)) as $f_email) {
            DB::Execute('UPDATE rc_identities SET name=%s WHERE email=%s', array($identity, $f_email));
        }
    }
}
开发者ID:cretzu89,项目名称:EPESI,代码行数:11,代码来源:crm_roundcube_fill_identities.php

示例11: submit_meeting

 public static function submit_meeting($values, $mode)
 {
     $me = CRM_ContactsCommon::get_my_record();
     switch ($mode) {
         case 'delete':
             Utils_MessengerCommon::delete_by_id('CRM_Calendar_Event:' . $values['id']);
             break;
         case 'display':
             $pdf = Utils_RecordBrowser::$rb_obj->pack_module('Libs/TCPDF', 'L');
             if ($pdf->prepare()) {
                 $pdf->set_title($values['title']);
                 $pdf->set_subject('');
                 $pdf->prepare_header();
                 $pdf->AddPage();
                 $v = CRM_Calendar_EventCommon::get(DB::GetOne('SELECT id FROM crm_calendar_custom_events_handlers WHERE group_name=%s', array('Meetings')) . '#' . $values['id']);
                 $ev_mod = Utils_RecordBrowser::$rb_obj->init_module('CRM/Calendar/Event');
                 $ev_mod->make_event_PDF($pdf, $v, true, 'view');
             }
             $pdf->add_actionbar_icon('Print');
             if (isset($_REQUEST['day'])) {
                 $values['date'] = $_REQUEST['day'];
             }
             $ret = array();
             if ($values['time']) {
                 // normal event
                 $start = $values['time'];
                 // time in unix timestamp UTC
                 $start_disp = strtotime(Base_RegionalSettingsCommon::time2reg($start, true, true, true, false));
             } else {
                 // when event is timeless - all day event
                 $time = $values['date'] . ' 00:00:01';
                 $start = Base_RegionalSettingsCommon::reg2time($time);
                 $start_disp = strtotime($time);
             }
             $end = strtotime('+' . $values['duration'] . ' seconds', $start);
             $ret['day_details'] = array('start' => array('day' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'day', 'default_date' => strtotime($values['date']))), array()) . '>' . date('j', $start_disp) . '</a>', 'month' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'month', 'default_date' => strtotime($values['date']))), array()) . '>' . __date('F', $start_disp) . '</a>', 'year' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'year', 'default_date' => strtotime($values['date']))), array()) . '>' . date('Y', $start_disp) . '</a>', 'weekday' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'week', 'default_date' => strtotime($values['date']))), array()) . '>' . __date('l', $start_disp) . '</a>'));
             if (!isset($values['timeless']) || !$values['timeless']) {
                 $ret['event_info'] = array('start_time' => Base_RegionalSettingsCommon::time2reg($start, 2, false), 'end_time' => Base_RegionalSettingsCommon::time2reg($end, 2, false), 'duration' => Base_RegionalSettingsCommon::seconds_to_words($values['duration']), 'start_date' => '-', 'end_date' => '-');
             }
             $ret['form_data']['timeless'] = array('label' => __('Timeless'), 'html' => 'value');
             $ret['toggle_duration'] = 'tog';
             $ret['duration_block_id'] = '1';
             $ret['event_end_block_id'] = '2';
             $values['title'] = __('Follow-up') . ': ' . $values['title'];
             $values['status'] = 0;
             $cus = reset($values['customers']);
             if (ModuleManager::is_installed('CRM/Meeting') >= 0) {
                 $ret['new']['event'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Meeting')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('crm_meeting', array('title' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date' => date('Y-m-d'), 'time' => date('H:i:s'), 'duration' => 3600, 'employees' => $values['employees'], 'customers' => $values['customers'], 'status' => 0), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Calendar', 'icon-small.png') . '" /></a>';
             }
             if (ModuleManager::is_installed('CRM/Tasks') >= 0) {
                 $ret['new']['task'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Task')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('task', array('title' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'employees' => $values['employees'], 'customers' => $values['customers'], 'status' => 0, 'deadline' => date('Y-m-d', strtotime('+1 day')))) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Tasks', 'icon-small.png') . '"></a>';
             }
             if (ModuleManager::is_installed('CRM/PhoneCall') >= 0) {
                 $ret['new']['phonecall'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Phonecall')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('phonecall', array('subject' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date_and_time' => date('Y-m-d H:i:s'), 'employees' => $values['employees'], 'customer' => $cus, 'status' => 0), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_PhoneCall', 'icon-small.png') . '" /></a>';
             }
             $ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('crm_meeting/' . $values['id']);
             return $ret;
         case 'edit':
             self::subscribed_employees($values);
             $alarms = Utils_MessengerCommon::get_alarms('CRM_Calendar_Event:' . $values['id']);
             $old = Utils_RecordBrowserCommon::get_record('crm_meeting', $values['id']);
             $old_time = strtotime($old['date'] . ' ' . date('H:i:s', strtotime($old['time'])));
             $new_time = strtotime($values['date'] . ' ' . date('H:i:s', strtotime($values['time'])));
             foreach ($alarms as $id => $time) {
                 $time = strtotime($time);
                 $diff = $old_time - $time;
                 Utils_MessengerCommon::update_time($id, $new_time - $diff);
             }
         case 'add':
             if (isset($values['duration_switch']) && !$values['duration_switch']) {
                 $values['duration'] = strtotime($values['end_time']) - strtotime($values['time']);
                 if ($values['duration'] < 0) {
                     $values['duration'] += 60 * 60 * 24;
                 }
                 // failsafe
             }
             if (isset($values['timeless']) && $values['timeless']) {
                 $values['duration'] = -1;
             }
             $new = '';
             foreach (array(0 => 'Mon', 1 => 'Tue', 2 => 'Wed', 3 => 'Thu', 4 => 'Fri', 5 => 'Sat', 6 => 'Sun') as $k => $v) {
                 if (isset($values['recurrence_hash_' . $k]) && $values['recurrence_hash_' . $k]) {
                     $new .= '1';
                 } else {
                     $new .= '0';
                 }
             }
             if ($new != '0000000') {
                 $values['recurrence_hash'] = $new;
             }
             if ($values['duration'] != -1) {
                 if (isset($values['modded'])) {
                     $time = Base_RegionalSettingsCommon::time2reg($values['time'], true, true, true, false);
                     $reg_timestamp = $values['date'] . ' ' . date('H:i:s', strtotime($time));
                     $timestamp = Base_RegionalSettingsCommon::reg2time($reg_timestamp);
                     $values['date'] = date('Y-m-d', $timestamp);
                     $values['time'] = date('Y-m-d H:i:s', $timestamp);
                     if (isset($values['recurrence_end']) && $values['recurrence_end']) {
                         $values['recurrence_end'] = date('Y-m-d', Base_RegionalSettingsCommon::reg2time($values['recurrence_end'] . ' ' . date('H:i:s', strtotime($time))));
                         if ($values['recurrence_end'] < $values['date']) {
//.........这里部分代码省略.........
开发者ID:62BRAINS,项目名称:EPESI,代码行数:101,代码来源:MeetingCommon_0.php

示例12: user_settings

 public static function user_settings()
 {
     if (!Base_EpesiStoreCommon::admin_access()) {
         return array();
     }
     set_time_limit(0);
     // get default data from user contact
     $my_contact = ModuleManager::is_installed('CRM_Contacts') > -1 ? CRM_ContactsCommon::get_my_record() : array();
     // key = field name from contact => value = field name in settings
     $keys = self::get_payment_data_keys();
     $values = array();
     // do user setting entries from data
     foreach ($keys as $k => $v) {
         $x = array('name' => $v, 'label' => _V(ucwords(str_replace('_', ' ', $v))), 'type' => 'text', 'default' => isset($my_contact[$k]) ? $my_contact[$k] : '');
         if ($k == 'country') {
             $x['type'] = 'select';
             $x['values'] = Utils_CommonDataCommon::get_translated_array('Countries');
         }
         $values[] = $x;
     }
     return array(__('EPESI Store') => array_merge(array(array('name' => 'payments_header', 'label' => '', 'type' => 'header', 'default' => __('Payment credentials'))), $values));
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:22,代码来源:EpesiStoreCommon_0.php

示例13: get_lang_code

 public static function get_lang_code()
 {
     if (defined('FORCE_LANG_CODE')) {
         return FORCE_LANG_CODE;
     }
     if (!isset(self::$lang_code)) {
         if (!Acl::is_user() || ModuleManager::is_installed('Base/User/Settings') == -1 || !Variable::get('allow_lang_change', false)) {
             return Variable::get('default_lang');
         }
         if (class_exists('Base_User_SettingsCommon')) {
             self::$lang_code = Base_User_SettingsCommon::get('Base_Lang_Administrator', 'language');
         }
     }
     return self::$lang_code;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:15,代码来源:LangCommon_0.php

示例14: get_record_by_email

 public static function get_record_by_email($email, $rset = null, $rid = null)
 {
     if ($rid == null) {
         $rset = null;
     }
     $cont = DB::GetRow('SELECT id, created_on, created_by FROM contact_data_1 WHERE active=1 AND f_email ' . DB::like() . ' %s AND id!=%d', array($email, $rset == 'contact' ? $rid : -1));
     if ($cont) {
         return array('contact', $cont['id']);
     }
     if (ModuleManager::is_installed('CRM_Roundcube') >= 0) {
         $vals = array($email);
         $where_id = '';
         if ($rid != null) {
             if ($rset == 'rc_multiple_emails') {
                 $vals[] = $rid;
                 $where_id = ' AND id!=%d';
             } else {
                 $vals[] = $rset;
                 $vals[] = $rid;
                 $where_id = ' AND (f_record_type!=%s OR f_record_id!=%d)';
             }
         }
         $tmp = DB::GetRow('SELECT id, f_record_id, f_record_type FROM rc_multiple_emails_data_1 WHERE active=1 AND f_email ' . DB::like() . ' %s' . $where_id . ' ORDER BY f_record_type DESC', $vals);
         if ($tmp) {
             return array($tmp['f_record_type'], $tmp['f_record_id']);
         }
     }
     $comp = DB::GetRow('SELECT id, created_on, created_by FROM company_data_1 WHERE active=1 AND f_email ' . DB::like() . ' %s AND id!=%d', array($email, $rset == 'company' ? $rid : -1));
     if ($comp) {
         return array('company', $comp['id']);
     }
     return false;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:33,代码来源:ContactsCommon_0.php

示例15: display_dashboard

 public function display_dashboard($tab_id)
 {
     //		Base_ActionBarCommon::add('add',__('Add applet'),$this->create_callback_href(array($this,'applets_list'),$tab_id));
     $default_dash = $this->get_module_variable('default');
     $colors = Base_DashboardCommon::get_available_colors();
     $applets = array(0 => array(), 1 => array(), 2 => array());
     $config_mode = $this->get_module_variable('config_mode', false);
     if ($default_dash || !Base_DashboardCommon::has_permission_to_manage_applets()) {
         $ret = DB::Execute('SELECT col,id,module_name,color FROM base_dashboard_default_applets WHERE tab=%d ORDER BY col,pos', array($tab_id));
     } else {
         $ret = DB::Execute('SELECT col,id,module_name,color FROM base_dashboard_applets WHERE user_login_id=%d AND tab=%d ORDER BY pos', array(Base_AclCommon::get_user(), $tab_id));
     }
     while ($row = $ret->FetchRow()) {
         $applets[$row['col']][] = $row;
     }
     print '<div id="dashboard" style="width: 100%;">';
     for ($j = 0; $j < 3; $j++) {
         print '<div id="dashboard_applets_' . $tab_id . '_' . $j . '" style="width:33%;min-height:200px;padding-bottom:10px;vertical-align:top;display:inline-block">';
         foreach ($applets[$j] as $row) {
             if (!is_callable(array($row['module_name'] . 'Common', 'applet_caption'))) {
                 continue;
             }
             $cap = call_user_func(array($row['module_name'] . 'Common', 'applet_caption'));
             if (!$cap || ModuleManager::is_installed($row['module_name']) == -1) {
                 //if its invalid entry
                 continue;
             }
             $m = $this->init_module($row['module_name'], null, $row['id']);
             $opts = array();
             $opts['title'] = $cap;
             $opts['toggle'] = true;
             $opts['href'] = null;
             $opts['go'] = false;
             $opts['go_function'] = 'body';
             $opts['go_arguments'] = array();
             $opts['go_constructor_arguments'] = array();
             $opts['actions'] = array();
             $opts['id'] = $row['id'];
             $th = $this->init_module(Base_Theme::module_name());
             if ($config_mode || !$m) {
                 $content = '';
             } else {
                 $content = $this->get_html_of_module($m, array($this->get_values($row['id'], $row['module_name']), &$opts, $row['id']), 'applet');
             }
             $th->assign('content', '<div class="content">' . $content . '</div>');
             $th->assign('handle_class', 'handle');
             $th->assign('fixed', !($default_dash || Base_DashboardCommon::has_permission_to_manage_applets()));
             if ($opts['toggle'] && !$config_mode) {
                 $th->assign('toggle', '<a class="toggle" ' . Utils_TooltipCommon::open_tag_attrs(__('Toggle')) . '>=</a>');
             }
             foreach ($opts['actions'] as $k => $v) {
                 if (!$v) {
                     unset($opts['actions'][$k]);
                 }
             }
             if ($opts['go']) {
                 $opts['href'] = $this->create_main_href($row['module_name'], $opts['go_function'], $opts['go_arguments'], $opts['go_constructor_arguments']);
             }
             if ($opts['href']) {
                 $th->assign('href', '<a class="href" ' . Utils_TooltipCommon::open_tag_attrs(__('Fullscreen')) . ' ' . $opts['href'] . '>G</a>');
             }
             if ($default_dash || Base_DashboardCommon::has_permission_to_manage_applets()) {
                 $th->assign('remove', Base_DashboardCommon::get_remove_applet_button($row['id'], $default_dash));
                 if (!$config_mode) {
                     $th->assign('configure', '<a class="configure" ' . Utils_TooltipCommon::open_tag_attrs(__('Configure')) . ' ' . $this->create_callback_href(array($this, 'configure_applet'), array($row['id'], $row['module_name'])) . '>c</a>');
                 }
             }
             $th->assign('caption', $opts['title']);
             $th->assign('color', $colors[$row['color']]['class']);
             $th->assign('actions', $opts['actions']);
             $th->assign('config_mode', $config_mode);
             print '<div class="applet" id="ab_item_' . $row['id'] . '">';
             $th->display();
             print '</div>';
         }
         print '</div>';
     }
     print '</div>';
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:79,代码来源:Dashboard_0.php


注:本文中的ModuleManager::is_installed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。