• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AuxLib类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login

 /**
  * Displays the login page
  * @param object $formModel
  * @param bool $isMobile Whether this was called from mobile site controller
  */
 public function login(LoginForm $model, $isMobile = false)
 {
     $model->attributes = $_POST['LoginForm'];
     // get user input data
     Session::cleanUpSessions();
     $ip = $this->owner->getRealIp();
     $userModel = $model->getUser();
     $isRealUser = $userModel instanceof User;
     $effectiveUsername = $isRealUser ? $userModel->username : $model->username;
     $isActiveUser = $isRealUser && $userModel->status == User::STATUS_ACTIVE;
     /* increment count on every session with this user/IP, to prevent brute force attacks 
        using session_id spoofing or whatever */
     Yii::app()->db->createCommand('UPDATE x2_sessions SET status=status-1,lastUpdated=:time WHERE user=:name AND 
         CAST(IP AS CHAR)=:ip AND status BETWEEN -2 AND 0')->bindValues(array(':time' => time(), ':name' => $effectiveUsername, ':ip' => $ip))->execute();
     $activeUser = Yii::app()->db->createCommand()->select('username')->from('x2_users')->where('username=:name AND status=1', array(':name' => $model->username))->limit(1)->queryScalar();
     // get the correctly capitalized username
     if (isset($_SESSION['sessionId'])) {
         $sessionId = $_SESSION['sessionId'];
     } else {
         $sessionId = $_SESSION['sessionId'] = session_id();
     }
     $session = X2Model::model('Session')->findByPk($sessionId);
     /* get the number of failed login attempts from this IP within timeout interval. If the 
        number of login attempts exceeds maximum, display captcha */
     $badAttemptsRefreshTimeout = 900;
     $maxFailedLoginAttemptsPerIP = 100;
     $maxLoginsBeforeCaptcha = 5;
     $this->pruneTimedOutBans($badAttemptsRefreshTimeout);
     $failedLoginRecord = FailedLogins::model()->findActiveByIp($ip);
     $badAttemptsWithThisIp = $failedLoginRecord ? $failedLoginRecord->attempts : 0;
     if ($badAttemptsWithThisIp >= $maxFailedLoginAttemptsPerIP) {
         $this->recordFailedLogin($ip);
         throw new CHttpException(403, Yii::t('app', 'You are not authorized to use this application'));
     }
     // if this client has already tried to log in, increment their attempt count
     if ($session === null) {
         $session = new Session();
         $session->id = $sessionId;
         $session->user = $model->getSessionUserName();
         $session->lastUpdated = time();
         $session->status = 0;
         $session->IP = $ip;
     } else {
         $session->lastUpdated = time();
         $session->user = $model->getSessionUserName();
     }
     if ($isActiveUser === false) {
         $model->verifyCode = '';
         // clear captcha code
         $model->validate();
         // validate captcha if it's being used
         $this->recordFailedLogin($ip);
         $session->save();
         if ($badAttemptsWithThisIp + 1 >= $maxFailedLoginAttemptsPerIP) {
             throw new CHttpException(403, Yii::t('app', 'You are not authorized to use this application'));
         } else {
             if ($badAttemptsWithThisIp >= $maxLoginsBeforeCaptcha - 1) {
                 $model->useCaptcha = true;
                 $model->setScenario('loginWithCaptcha');
                 $session->status = -2;
             }
         }
     } else {
         if ($model->validate() && $model->login()) {
             // user successfully logged in
             if ($model->rememberMe) {
                 foreach (array('username', 'rememberMe') as $attr) {
                     // Expires in 30 days
                     AuxLib::setCookie(CHtml::resolveName($model, $attr), $model->{$attr}, 2592000);
                 }
             } else {
                 foreach (array('username', 'rememberMe') as $attr) {
                     // Remove the cookie if they unchecked the box
                     AuxLib::clearCookie(CHtml::resolveName($model, $attr));
                 }
             }
             // We're not using the isAdmin parameter of the application
             // here because isAdmin in this context hasn't been set yet.
             $isAdmin = Yii::app()->user->checkAccess('AdminIndex');
             if ($isAdmin && !$isMobile) {
                 $this->owner->attachBehavior('updaterBehavior', new UpdaterBehavior());
                 $this->owner->checkUpdates();
                 // check for updates if admin
             } else {
                 Yii::app()->session['versionCheck'] = true;
             }
             // ...or don't
             $session->status = 1;
             $session->save();
             SessionLog::logSession($model->username, $sessionId, 'login');
             $_SESSION['playLoginSound'] = true;
             if (YII_UNIT_TESTING && defined('X2_DEBUG_EMAIL') && X2_DEBUG_EMAIL) {
                 Yii::app()->session['debugEmailWarning'] = 1;
             }
             // if ( isset($_POST['themeName']) ) {
//.........这里部分代码省略.........
开发者ID:dsyman2,项目名称:X2CRM,代码行数:101,代码来源:CommonSiteControllerBehavior.php


示例2: init

 public function init()
 {
     if (!$this->action && Yii::app()->params->isPhoneGap) {
         $this->action = AuxLib::getRequestUrl();
     }
     return parent::init();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:7,代码来源:MobileActiveForm.php


示例3: checkFilename

 /**
  * Returns true if the file is safe to upload.
  *
  * Will use fileinfo if available for determining mime type of the uploaded file.
  * @param array $file
  */
 public function checkFilename($filename)
 {
     if (preg_match(self::EXT_BLACKLIST, $filename, $match)) {
         AuxLib::debugLog('Throwing exception for array: ' . var_export($_FILES, 1));
         throw new CHttpException(403, Yii::t('app', 'Forbidden file type: {ext}', array('{ext}' => $match['ext'])));
     }
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:13,代码来源:FileUploadsFilter.php


示例4: testExecute

 /**
  * Create new list from selection then mass add to newly created list
  */
 public function testExecute()
 {
     TestingAuxLib::suLogin('admin');
     X2List::model()->deleteAllByAttributes(array('name' => 'test'));
     $newList = new NewListFromSelection();
     $addToList = new MassAddToList();
     // create new list with 2 records
     $_POST['modelType'] = 'Contacts';
     $_POST['listName'] = 'test';
     $_SERVER['REQUEST_METHOD'] = 'POST';
     $_SERVER['SERVER_NAME'] = 'localhost';
     Yii::app()->controller = new ContactsController('contacts', new ContactsModule('contacts', null));
     $gvSelection = range(1, 2);
     AuxLib::debugLogR($newList->execute($gvSelection));
     $getFlashes = TestingAuxLib::setPublic('NewListFromSelection', 'getFlashes');
     AuxLib::debugLogR($getFlashes());
     $list = X2List::model()->findByAttributes(array('name' => 'test'));
     $itemIds = $list->queryCommand(true)->select('id')->queryColumn();
     $this->assertEquals(array(1, 2), $itemIds);
     //  add the rest of the contacts to the newly created list
     unset($_POST['modelType']);
     unset($_POST['listName']);
     $_POST['listId'] = $list->id;
     $gvSelection = range(3, 24);
     $addToList->execute($gvSelection);
     $itemIds = $list->queryCommand(true)->select('id')->queryColumn();
     $this->assertEquals(range(1, 24), $itemIds);
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:31,代码来源:MassAddToListTest.php


示例5: actionDeleteWebForm

 /**
  * Deletes a web form record with the specified id 
  * @param int $id
  */
 public function actionDeleteWebForm($id)
 {
     $model = WebForm::model()->findByPk($id);
     $name = $model->name;
     $success = false;
     if ($model) {
         $success = $model->delete();
     }
     AuxLib::ajaxReturn($success, Yii::t('app', "Deleted '{$name}'"), Yii::t('app', 'Unable to delete web form'));
 }
开发者ID:shayanyi,项目名称:CRM,代码行数:14,代码来源:MarketingController.php


示例6: gripButton

 public static function gripButton($htmlOptions = array())
 {
     if (AuxLib::getLayoutType() !== 'responsive') {
         return '';
     }
     if (!isset($htmlOptions['class'])) {
         $htmlOptions['class'] = 'mobile-dropdown-button';
     }
     return self::tag('div', $htmlOptions, '<div class="x2-bar"></div>
          <div class="x2-bar"></div>
          <div class="x2-bar"></div>');
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:12,代码来源:ResponsiveHtml.php


示例7: init

 public function init()
 {
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     // import the module-level models and components
     $this->setImport(array('charts.models.*', 'charts.components.*'));
     // Set module specific javascript packages
     $this->packages = array('jquery' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jquery.js')), 'jquerysparkline' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'css' => array('css/charts.css'), 'js' => array('js/splunk/jquery.sparkline.js'), 'depends' => array('jquery')), 'jqplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'css' => array('js/jqplot/jquery.jqplot.css', 'css/charts.css'), 'js' => array('js/jqplot/jquery.jqplot.js'), 'depends' => array('jquery')), 'jqlineplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.canvasTextRenderer.js', 'js/jqplot/plugins/jqplot.categoryAxisRenderer.js', 'js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js'), 'depends' => array('jqplot')), 'jqpieplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.pieRenderer.js'), 'depends' => array('jqplot')), 'jqbubbleplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.bubbleRenderer.js'), 'depends' => array('jqplot')), 'jqfunnelplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.funnelRenderer.js'), 'depends' => array('jqplot')), 'jqbarplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.barRenderer.js', 'js/jqplot/plugins/jqplot.canvasTextRenderer.js', 'js/jqplot/plugins/jqplot.categoryAxisRenderer.js', 'js/jqplot/plugins/jqplot.canvasAxisTickRenderer.js', 'js/jqplot/plugins/jqplot.dateAxisRenderer.js', 'js/jqplot/plugins/jqplot.pointLabels.js'), 'depends' => array('jqplot')));
     if (AuxLib::isIE8()) {
         $this->packages['jqplot']['js'][] = 'js/jqplot/excanvas.js';
     }
     Yii::app()->clientScript->packages = $this->packages;
     // set module layout
     // $this->layout = 'main';
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:15,代码来源:ChartsModule.php


示例8: run

 public function run()
 {
     $hiddenTags = json_decode(Yii::app()->params->profile->hiddenTags, true);
     $params = array();
     if (count($hiddenTags) > 0) {
         $tagParams = AuxLib::bindArray($hiddenTags);
         $params = array_merge($params, $tagParams);
         $str1 = " AND tag NOT IN (" . implode(',', array_keys($tagParams)) . ")";
     } else {
         $str1 = "";
     }
     $myTags = Yii::app()->db->createCommand()->select('COUNT(*) AS count, tag')->from('x2_tags')->where('taggedBy=:user AND tag IS NOT NULL' . $str1, array_merge($params, array(':user' => Yii::app()->user->getName())))->group('tag')->order('count DESC')->limit(20)->queryAll();
     $allTags = Yii::app()->db->createCommand()->select('COUNT(*) AS count, tag')->from('x2_tags')->group('tag')->where('tag IS NOT NULL' . $str1, $params)->order('count DESC')->limit(20)->queryAll();
     // $myTags=Tags::model()->findAllBySql("SELECT *, COUNT(*) as num FROM x2_tags WHERE taggedBy='".Yii::app()->user->getName()."' GROUP BY tag ORDER BY num DESC LIMIT 20");
     // $allTags=Tags::model()->findAllBySql("SELECT *, COUNT(*) as num FROM x2_tags GROUP BY tag ORDER BY num DESC LIMIT 20");
     $this->render('tagCloud', array('myTags' => $myTags, 'allTags' => $allTags, 'showAllUsers' => Yii::app()->params->profile->tagsShowAllUsers));
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:17,代码来源:TagCloud.php


示例9: array

 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 * California 95067, USA. or at email address [email protected].
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
/*
Public/private profile page. If the requested profile belongs to the current user, profile widgets
get displayed in addition to the activity feed/profile information sections. 
*/
Yii::app()->clientScript->registerCssFiles('profileCombinedCss', array('profile.css', 'activityFeed.css', '../../../js/multiselect/css/ui.multiselect.css'));
Yii::app()->clientScript->registerResponsiveCssFile(Yii::app()->getTheme()->getBaseUrl() . '/css/responsiveActivityFeed.css');
AuxLib::registerPassVarsToClientScriptScript('x2.profile', array('isMyProfile' => $isMyProfile ? 'true' : 'false'), 'profileScript');
$this->renderPartial('_activityFeed', array('dataProvider' => $dataProvider, 'profileId' => $model->id, 'users' => $users, 'lastEventId' => $lastEventId, 'firstEventId' => $firstEventId, 'lastTimestamp' => $lastTimestamp, 'stickyDataProvider' => $stickyDataProvider, 'userModels' => $userModels, 'isMyProfile' => $isMyProfile));
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:activity.php


示例10: function

        e.preventDefault();
        $(".items").animate({ scrollTop: 0 }, "slow");
    });*/
    $(document).on('click','#advanced-controls-toggle',function(e){
        e.preventDefault();
        if($('#advanced-controls').is(':hidden')){
            $("#advanced-controls").slideDown();
        }else{
            $("#advanced-controls").slideUp();
        }
    });
    $(document).on('ready',function(){
        $('#advanced-controls').after('<div class="form" id="action-view-pane" style="float:right;width:0px;display:none;padding:0px;"></div>');
    });
    <?php 
if (AuxLib::isIPad()) {
    echo "\$(document).on('vclick', '.view', function (e) {";
} else {
    echo "\$(document).on('click','.view',function(e){";
}
?>
        if(!$(e.target).is('a')){
            e.preventDefault();
            if(clickedFlag){
                if($('#action-view-pane').hasClass($(this).attr('id'))){
                    $('#action-view-pane').removeClass($(this).attr('id'));
                    $('.items').animate({'margin-right': '20px'},400,function(){
                        $('.items').css('margin-right','0px')
                    });
                    $('#action-view-pane').html('<div style="height:800px;"></div>');
                    $('#action-view-pane').animate({width: '0px'},400,function(){
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:index.php


示例11: renderSummary

 public function renderSummary()
 {
     if (AuxLib::getLayoutType() === 'responsive' && $this->enableResponsiveTitleBar) {
         Yii::app()->clientScript->registerCss('mobileDropdownCss', "\n            .grid-view .mobile-dropdown-button {\n                float: right;\n                display: block;\n                margin-top: -24px;\n                margin-right: 8px;\n            }\n        ");
         $afterUpdateJSString = "\n            ;(function () {\n            var grid = \$('#" . $this->id . "');\n            \$('#" . $this->namespacePrefix . "-mobile-dropdown').unbind ('click.mobileDropdownScript')\n                .bind ('click.mobileDropdownScript', function () {\n                    if (grid.hasClass ('show-top-buttons')) {\n                        grid.find ('.page-title').css ({ height: '' });\n                        grid.removeClass ('show-top-buttons');\n                    } else {\n                        grid.find ('.page-title').animate ({ height: '68px' }, 300);\n                        grid.addClass ('show-top-buttons');\n                        \$(window).one ('resize', function () {\n                            grid.find ('.page-title').css ({ height: '' });\n                            grid.removeClass ('show-top-buttons');\n                        });\n                    }\n                });\n            }) ();\n        ";
         $this->addToAfterAjaxUpdate($afterUpdateJSString);
         echo '<div id="' . $this->namespacePrefix . '-mobile-dropdown" class="mobile-dropdown-button">
             <div class="x2-bar"></div>
             <div class="x2-bar"></div>
             <div class="x2-bar"></div>
         </div>';
     }
     parent::renderSummary();
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:14,代码来源:X2GridViewBase.php


示例12: getFieldPermissions

 /**
  * Getter for {@link fieldPermissions}
  * @return type
  */
 public function getFieldPermissions()
 {
     $class = get_class($this);
     if (!isset(self::$_fieldPermissions[$class])) {
         $roles = Roles::getUserRoles(Yii::app()->getSuId());
         if (!$this->isExemptFromFieldLevelPermissions) {
             $permRecords = Yii::app()->db->createCommand()->select("f.fieldName,MAX(rtp.permission),f.readOnly")->from(RoleToPermission::model()->tableName() . ' rtp')->join(Fields::model()->tableName() . ' f', 'rtp.fieldId=f.id ' . 'AND rtp.roleId IN ' . AuxLib::arrToStrList($roles) . ' ' . 'AND f.modelName=:class', array(':class' => $class))->group('f.fieldName')->queryAll(false);
         } else {
             $permRecords = Yii::app()->db->createCommand()->select("fieldName,CAST(2 AS UNSIGNED INTEGER),readOnly")->from(Fields::model()->tableName() . ' f')->where('modelName=:class', array(':class' => $class))->queryAll(false);
         }
         $fieldPerms = array();
         foreach ($permRecords as $record) {
             // If the permissions of the user on the field are "2" (write),
             // subtract the readOnly field
             $fieldPerms[$record[0]] = $record[1] - (int) ((int) $record[1] === 2 ? $record[2] : 0);
         }
         self::$_fieldPermissions[$class] = $fieldPerms;
     }
     return self::$_fieldPermissions[$class];
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:24,代码来源:X2Model.php


示例13: getGroupmates

 /**
  * Gets a list of names of all users having a group in common with a user.
  *
  * @param integer $userId User's ID
  * @param boolean $cache Whether to cache or not
  * @return array 
  */
 public static function getGroupmates($userId, $cache = true)
 {
     if ($cache === true && ($groupmates = Yii::app()->cache->get('user_groupmates')) !== false) {
         if (isset($groupmates[$userId])) {
             return $groupmates[$userId];
         }
     } else {
         $groupmates = array();
     }
     $userGroups = self::getUserGroups($userId, $cache);
     $groupmates[$userId] = array();
     if (!empty($userGroups)) {
         $groupParam = AuxLib::bindArray($userGroups, 'gid_');
         $inGroup = AuxLib::arrToStrList(array_keys($groupParam));
         $groupmates[$userId] = Yii::app()->db->createCommand()->select('DISTINCT(gtu.username)')->from(GroupToUser::model()->tableName() . ' gtu')->join(User::model()->tableName() . ' u', 'gtu.userId=u.id AND gtu.groupId IN ' . $inGroup, $groupParam)->queryColumn();
     }
     if ($cache === true) {
         Yii::app()->cache->set('user_groupmates', $groupmates, 259200);
     }
     return $groupmates[$userId];
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:28,代码来源:Groups.php


示例14: getItems2

 /**
  * Improved version of getItems which enables use of empty search string, pagination, and
  * configurable option values/names.
  * @param string $prefix name prefix of items to retrieve
  * @param int $page page number of results to retrieve
  * @param int $limit max number of results to retrieve
  * @param string|array $valueAttr attribute(s) used to popuplate the option values. If an 
  *  array is passed, value will composed of values of each of the attributes specified, joined
  *  by commas
  * @param string $nameAttr attribute used to popuplate the option names
  * @return array name, value pairs
  */
 public function getItems2($prefix = '', $page = 0, $limit = 20, $valueAttr = 'name', $nameAttr = 'name')
 {
     $modelClass = get_class($this->owner);
     $model = CActiveRecord::model($modelClass);
     $table = $model->tableName();
     $offset = intval($page) * intval($limit);
     AuxLib::coerceToArray($valueAttr);
     $modelClass::checkThrowAttrError(array_merge($valueAttr, array($nameAttr)));
     $params = array();
     if ($prefix !== '') {
         $params[':prefix'] = $prefix . '%';
     }
     $offset = abs((int) $offset);
     $limit = abs((int) $limit);
     $command = Yii::app()->db->createCommand("\n            SELECT " . implode(',', $valueAttr) . ", {$nameAttr} as __name\n            FROM {$table}\n            WHERE " . ($prefix === '' ? '1=1' : $nameAttr . ' LIKE :prefix') . "\n            ORDER BY __name\n            LIMIT {$offset}, {$limit}\n        ");
     $rows = $command->queryAll(true, $params);
     $items = array();
     foreach ($rows as $row) {
         $name = $row['__name'];
         unset($row['__name']);
         $items[] = array($name, $row);
     }
     return $items;
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:36,代码来源:X2LinkableBehavior.php


示例15: array

 $attributes = array();
 if ($model->type === 'email') {
     foreach (X2Model::model('Contacts')->getAttributeLabels() as $fieldName => $label) {
         $attributes[$label] = '{' . $fieldName . '}';
     }
 } else {
     $accountAttributes = array();
     $contactAttributes = array();
     $quoteAttributes = array();
     foreach (Contacts::model()->getAttributeLabels() as $fieldName => $label) {
         AuxLib::debugLog('Iterating over contact attributes ' . $fieldName . '=>' . $label);
         $index = Yii::t('contacts', "{contact}", array('{contact}' => $modTitles['contact'])) . ": {$label}";
         $contactAttributes[$index] = "{associatedContacts.{$fieldName}}";
     }
     foreach (Accounts::model()->getAttributeLabels() as $fieldName => $label) {
         AuxLib::debugLog('Iterating over account attributes ' . $fieldName . '=>' . $label);
         $index = Yii::t('accounts', "{account}", array('{account}' => $modTitles['account'])) . ": {$label}";
         $accountAttributes[$index] = "{accountName.{$fieldName}}";
     }
     $Quote = Yii::t('quotes', "{quote}: ", array('{quote}' => $modTitles['quote']));
     $quoteAttributes[$Quote . Yii::t('quotes', "Item Table")] = '{lineItems}';
     $quoteAttributes[$Quote . Yii::t('quotes', "Date printed/emailed")] = '{dateNow}';
     $quoteAttributes[$Quote . Yii::t('quotes', '{quote} or Invoice', array('{quote}' => $modTitles['quote']))] = '{quoteOrInvoice}';
     foreach (Quote::model()->getAttributeLabels() as $fieldName => $label) {
         $index = $Quote . "{$label}";
         $quoteAttributes[$index] = "{" . $fieldName . "}";
     }
 }
 if ($model->type === 'email') {
     $js = 'x2.insertableAttributes = ' . CJSON::encode(array(Yii::t('contacts', '{contact} Attributes', array('{contact}' => $modTitles['contact'])) => $attributes)) . ';';
 } else {
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:_form.php


示例16:

 * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 * California 95067, USA. or at email address [email protected].
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
/**
 * Used by inline workflow widget to render the funnel 
 */
if (AuxLib::isIE8()) {
    Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl() . '/js/jqplot/excanvas.js');
}
if ($this->id !== 'Workflow') {
    $assetsUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.modules.workflow.assets'), false, -1, YII_DEBUG ? true : null);
} else {
    $assetsUrl = $this->module->assetsUrl;
}
Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/X2Geometry.js', CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/BaseFunnel.js', CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/InlineFunnel.js', CClientScript::POS_END);
Yii::app()->clientScript->registerScript('_funnelJS', "\n\nx2.inlineFunnel = new x2.InlineFunnel ({\n    workflowStatus: " . CJSON::encode($workflowStatus) . ",\n    translations: " . CJSON::encode(array('Completed' => Yii::t('workflow', 'Completed'), 'Started' => Yii::t('workflow', 'Started'), 'Details' => Yii::t('workflow', 'Details'), 'Revert Stage' => Yii::t('workflow', 'Revert Stage'), 'Complete Stage' => Yii::t('workflow', 'Complete Stage'), 'Start' => Yii::t('workflow', 'Start'), 'noRevertPermissions' => Yii::t('workflow', 'You do not have permission to revert this stage.'), 'noCompletePermissions' => Yii::t('workflow', 'You do not have permission to complete this stage.'))) . ",\n    stageCount: " . $stageCount . ",\n    containerSelector: '#funnel-container',\n    colors: " . CJSON::encode($colors) . ",\n    revertButtonUrl: '" . Yii::app()->theme->getBaseUrl() . "/images/icons/Uncomplete.png',\n    completeButtonUrl: '" . Yii::app()->theme->getBaseUrl() . "/images/icons/Complete.png',\n    stageNames: " . CJSON::encode(Workflow::getStageNames($workflowStatus)) . ",\n    stagePermissions: " . CJSON::encode(Workflow::getStagePermissions($workflowStatus)) . ",\n    uncompletionPermissions: " . CJSON::encode(Workflow::getStageUncompletionPermissions($workflowStatus)) . ",\n    stagesWhichRequireComments: " . CJSON::encode(Workflow::getStageCommentRequirements($workflowStatus)) . "\n});\n\n", CClientScript::POS_END);
?>
<div id='funnel-container'></div>
开发者ID:tymiles003,项目名称:X2CRM,代码行数:30,代码来源:_inlineFunnel.php


示例17: tearDownAfterClass

 /**
  * Clean up custom field columns 
  */
 public static function tearDownAfterClass()
 {
     $fields = Fields::model()->findAllByAttributes(array('custom' => 1));
     foreach ($fields as $field) {
         assert($field->delete());
     }
     Yii::app()->db->schema->refresh();
     Yii::app()->cache->flush();
     Contacts::model()->refreshMetaData();
     Contacts::model()->resetFieldsPropertyCache();
     AuxLib::debugLogR('Contacts::model ()->getAttributes () = ');
     AuxLib::debugLogR(Contacts::model()->getAttributes());
     parent::tearDownAfterClass();
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:17,代码来源:FieldFormatterTest.php


示例18: registerMain

 /**
  * Performs all the necessary JavaScript/CSS initializations for most parts of the app.
  */
 public function registerMain()
 {
     foreach (array('IS_IPAD', 'RESPONSIVE_LAYOUT') as $layoutConst) {
         defined($layoutConst) or define($layoutConst, false);
     }
     $fullscreen = $this->fullscreen;
     $profile = $this->profile;
     $baseUrl = $this->baseUrl;
     $themeUrl = $this->themeUrl;
     $scriptUrl = $this->scriptUrl;
     $admin = $this->admin;
     $isGuest = $this->isGuest;
     // jQuery and jQuery UI libraries
     $this->registerCoreScript('jquery')->registerCoreScript('jquery.ui')->registerCoreScript('jquery.migrate')->registerCoreScript('bbq');
     $this->registerPackages($this->getDefaultPackages());
     $cldScript = $this->getCurrencyConfigScript();
     AuxLib::registerPassVarsToClientScriptScript('auxlib', array('saveMiscLayoutSettingUrl' => "'" . addslashes(Yii::app()->createUrl('/profile/saveMiscLayoutSetting')) . "'"), 'passAuxLibVars');
     $this->registerX2ModelMappingsScript();
     $this->registerX2Forms();
     $this->registerX2QuickCRUD();
     $this->registerX2Flashes();
     Yii::app()->clientScript->registerScript('csrfTokenScript', "\n            x2.csrfToken = '" . Yii::app()->request->getCsrfToken() . "';\n        ", CClientScript::POS_HEAD);
     $this->registerAttachments();
     $this->registerDateFormats();
     if (YII_DEBUG) {
         $this->registerScriptFile($baseUrl . '/js/Timer.js');
     }
     Yii::app()->clientScript->registerPackage('spectrum');
     // custom scripts
     $this->registerScriptFile($baseUrl . '/js/json2.js')->registerScriptFile($baseUrl . '/js/webtoolkit.sha256.js')->registerScriptFile($baseUrl . '/js/main.js', CCLientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/auxlib.js', CClientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/IframeFixOverlay.js', CClientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/LayoutManager.js')->registerScriptFile($baseUrl . '/js/media.js')->registerScript('formatCurrency-locales', $cldScript, CCLientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/modernizr.custom.66175.js')->registerScriptFile($baseUrl . '/js/widgets.js')->registerScriptFile($baseUrl . '/js/qtip/jquery.qtip.min.js')->registerScriptFile($baseUrl . '/js/ActionFrames.js')->registerScriptFile($baseUrl . '/js/ColorPicker.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/PopupDropdownMenu.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/jQueryOverrides.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/checklistDropdown/jquery.multiselect.js');
     $this->registerTestingScripts();
     $this->registerDebuggingScripts();
     if (IS_IPAD) {
         $this->registerScriptFile($baseUrl . '/js/jquery.mobile.custom.js');
     }
     $this->registerInitScript();
     $this->registerAuxLibTranslationsScript();
     if (Yii::app()->session['translate']) {
         $this->registerScriptFile($baseUrl . '/js/translator.js');
     }
     $this->registerScriptFile($baseUrl . '/js/backgroundFade.js');
     $this->registerScript('datepickerLanguage', "\n            \$.datepicker.setDefaults(\$.datepicker.regional['']);\n        ");
     $mmPath = Yii::getPathOfAlias('application.extensions.moneymask.assets');
     $aMmPath = Yii::app()->getAssetManager()->publish($mmPath);
     $this->registerScriptFile("{$aMmPath}/jquery.maskMoney.js");
     $this->registerCssFile($baseUrl . '/css/normalize.css', 'all')->registerCssFile($themeUrl . '/css/print.css', 'print')->registerCoreScript('cookie');
     $this->registerCombinedCss();
     if (!RESPONSIVE_LAYOUT && IS_ANDROID) {
         $this->registerCssFile($themeUrl . '/css/androidLayout.css', 'screen, projection');
     } elseif (IS_IPAD) {
         $this->registerCssFile($themeUrl . '/css/ipadLayout.css', 'screen, projection');
     }
     $this->registerScript('fullscreenToggle', '
         window.enableFullWidth = ' . (!Yii::app()->user->isGuest ? $profile->enableFullWidth ? 'true' : 'false' : 'true') . ';
         window.fullscreen = ' . ($fullscreen ? 'true' : 'false') . ';
     ', CClientScript::POS_HEAD);
     if (is_object(Yii::app()->controller->module)) {
         $this->registerScript('saveCurrModule', "\n                x2.currModule = '" . Yii::app()->controller->module->name . "';\n            ", CClientScript::POS_HEAD);
     }
     if (!$isGuest) {
         $this->registerScript('notificationsParams', "\n                x2.notifications = new x2.Notifs ({\n                    disablePopup: " . ($profile->disableNotifPopup ? 'true' : 'false') . ",\n                    translations: {\n                        clearAll: '" . addslashes(Yii::t('app', 'Permanently delete all notifications?')) . "'\n                    }\n                });\n            ", CClientScript::POS_READY);
         $this->registerScriptFile($baseUrl . '/js/jstorage.min.js')->registerScriptFile($baseUrl . '/js/notifications.js', CClientScript::POS_BEGIN);
     }
     if (!$isGuest && ($profile->language == 'he' || $profile->language == 'fa')) {
         $this->registerCss('rtl-language', 'body{text-align:right;}');
     }
     $this->registerCoreScript('rating');
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:71,代码来源:X2ClientScript.php


示例19: parseFilters

 private static function parseFilters($filters, &$params)
 {
     unset($filters['filters']);
     $visibility = $filters['visibility'];
     $visibility = str_replace('Public', '1', $visibility);
     $visibility = str_replace('Private', '0', $visibility);
     $visibilityFilter = explode(",", $visibility);
     if ($visibility != "") {
         $visibilityParams = AuxLib::bindArray($visibilityFilter, 'visibility');
         $params = array_merge($params, $visibilityParams);
         $visibilityCondition = " AND visibility NOT IN (" . implode(',', array_keys($visibilityParams)) . ")";
     } else {
         $visibilityCondition = "";
         $visibilityFilter = array();
     }
     $users = $filters['users'];
     if ($users != "") {
         $users = explode(",", $users);
         $users[] = '';
         $users[] = 'api';
         $userFilter = $users;
         if (sizeof($users)) {
             $usersParams = AuxLib::bindArray($users, 'users');
             $params = array_merge($params, $usersParams);
             $userCondition = " AND (user NOT IN (" . implode(',', array_keys($usersParams)) . ")";
         } else {
             $userCondition = "(";
         }
         if (!in_array('Anyone', $users)) {
             $userCondition .= " OR user IS NULL)";
         } else {
             $userCondition .= ")";
         }
     } else {
         $userCondition = "";
         $userFilter = array();
     }
     $types = $filters['types'];
     if ($types != "") {
         $types = explode(",", $types);
         $typeFilter = $types;
         $typesParams = AuxLib::bindArray($types, 'types');
         $params = array_merge($params, $typesParams);
         $typeCondition = " AND (type NOT IN (" . implode(',', array_keys($typesParams)) . ") OR important=1)";
     } else {
         $typeCondition = "";
         $typeFilter = array();
     }
     $subtypes = $filters['subtypes'];
     if (is_array($types) && $subtypes != "") {
         $subtypes = explode(",", $subtypes);
         $subtypeFilter = $subtypes;
         if (sizeof($subtypes)) {
             $subtypeParams = AuxLib::bindArray($subtypes, 'subtypes');
             $params = array_merge($params, $subtypeParams);
             $subtypeCondition = " AND (\n                    type!='feed' OR subtype NOT IN (" . implode(',', array_keys($subtypeParams)) . ") OR important=1)";
         } else {
             $subtypeCondition = "";
         }
     } else {
         $subtypeCondition = "";
         $subtypeFilter = array();
     }
     $ret = array('filters' => array('visibility' => $visibilityFilter, 'users' => $userFilter, 'types' => $typeFilter, 'subtypes' => $subtypeFilter), 'conditions' => array('visibility' => $visibilityCondition, 'users' => $userCondition, 'types' => $typeCondition, 'subtypes' => $subtypeCondition), 'params' => $params);
     return $ret;
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:66,代码来源:Events.php


示例20: array


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Av_exception类代码示例发布时间:2022-05-23
下一篇:
PHP Autoloader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap