Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • AccountsGridViewProfileWidget
  • ActionMenu
  • ActionsGridViewProfileWidget
  • ActionsQuickCreateRelationshipBehavior
  • ActiveDateRangeInput
  • ApplicationConfigBehavior
  • Attachments
  • ChatBox
  • CommonControllerBehavior
  • ContactMapInlineTags
  • ContactsGridViewProfileWidget
  • CronForm
  • CSaveRelationsBehavior
  • DateRangeInputsWidget
  • DocsGridViewProfileWidget
  • DocViewer
  • DocViewerProfileWidget
  • EButtonColumnWithClearFilters
  • EmailDeliveryBehavior
  • EmailProgressControl
  • EncryptedFieldsBehavior
  • EventsChartProfileWidget
  • FileUploader
  • FontPickerInput
  • Formatter
  • FormView
  • GridViewWidget
  • History
  • IframeWidget
  • ImportExportBehavior
  • InlineActionForm
  • InlineEmailAction
  • InlineEmailForm
  • InlineEmailModelBehavior
  • InlineQuotes
  • JSONEmbeddedModelFieldsBehavior
  • JSONFieldsDefaultValuesBehavior
  • LeadRoutingBehavior
  • LeftWidget
  • LoginThemeHelper
  • LoginThemeHelperBase
  • MarketingGridViewProfileWidget
  • MediaBox
  • MessageBox
  • MobileFormatter
  • MobileFormLayoutRenderer
  • MobileLayoutRenderer
  • MobileLoginThemeHelper
  • MobileViewLayoutRenderer
  • ModelFileUploader
  • NewWebLeadsGridViewProfileWidget
  • NormalizedJSONFieldsBehavior
  • NoteBox
  • OnlineUsers
  • OpportunitiesGridViewProfileWidget
  • Panel
  • ProfileDashboardManager
  • ProfileGridViewWidget
  • ProfileLayoutEditor
  • ProfilesGridViewProfileWidget
  • Publisher
  • PublisherActionTab
  • PublisherCalendarEventTab
  • PublisherCallTab
  • PublisherCommentTab
  • PublisherEventTab
  • PublisherSmallCalendarEventTab
  • PublisherTab
  • PublisherTimeTab
  • QuickContact
  • QuickCreateRelationshipBehavior
  • QuotesGridViewProfileWidget
  • RecordAliasesWidget
  • RecordViewLayoutManager
  • RecordViewWidgetManager
  • RememberPagination
  • Reminders
  • ResponseBehavior
  • ResponsiveHtml
  • SearchIndexBehavior
  • ServicesGridViewProfileWidget
  • SmallCalendar
  • SmartActiveDataProvider
  • SmartDataProviderBehavior
  • SmartSort
  • SocialForm
  • SortableWidgetManager
  • SortableWidgets
  • TagBehavior
  • TagCloud
  • TemplatesGridViewProfileWidget
  • TimeZone
  • TopContacts
  • TopSites
  • TransformedFieldStorageBehavior
  • TranslationLogger
  • TwitterFeed
  • TwoColumnSortableWidgetManager
  • UpdaterBehavior
  • UpdatesForm
  • UserIdentity
  • UsersChartProfileWidget
  • WorkflowBehavior
  • X2ActiveGridView
  • X2ActiveGridViewForSortableWidgets
  • X2AssetManager
  • X2AuthManager
  • X2ChangeLogBehavior
  • X2ClientScript
  • X2Color
  • X2DateUtil
  • X2FixtureManager
  • X2FlowFormatter
  • X2GridView
  • X2GridViewBase
  • X2GridViewForSortableWidgets
  • X2GridViewSortableWidgetsBehavior
  • X2LeadsGridViewProfileWidget
  • X2LinkableBehavior
  • X2ListView
  • X2PillBox
  • X2ProgressBar
  • X2SmartSearchModelBehavior
  • X2TimestampBehavior
  • X2TranslationBehavior
  • X2UrlRule
  • X2WebModule
  • X2Widget
  • X2WidgetList
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /*****************************************************************************************
  3:  * X2Engine Open Source Edition is a customer relationship management program developed by
  4:  * X2Engine, Inc. Copyright (C) 2011-2016 X2Engine Inc.
  5:  * 
  6:  * This program is free software; you can redistribute it and/or modify it under
  7:  * the terms of the GNU Affero General Public License version 3 as published by the
  8:  * Free Software Foundation with the addition of the following permission added
  9:  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 10:  * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 11:  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 12:  * 
 13:  * This program is distributed in the hope that it will be useful, but WITHOUT
 14:  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 15:  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 16:  * details.
 17:  * 
 18:  * You should have received a copy of the GNU Affero General Public License along with
 19:  * this program; if not, see http://www.gnu.org/licenses or write to the Free
 20:  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 21:  * 02110-1301 USA.
 22:  * 
 23:  * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 24:  * California 95067, USA. or at email address contact@x2engine.com.
 25:  * 
 26:  * The interactive user interfaces in modified source and object code versions
 27:  * of this program must display Appropriate Legal Notices, as required under
 28:  * Section 5 of the GNU Affero General Public License version 3.
 29:  * 
 30:  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 31:  * these Appropriate Legal Notices must retain the display of the "Powered by
 32:  * X2Engine" logo. If the display of the logo is not reasonably feasible for
 33:  * technical reasons, the Appropriate Legal Notices must display the words
 34:  * "Powered by X2Engine".
 35:  *****************************************************************************************/
 36: 
 37: /**
 38:  * @package application.components
 39:  */
 40: abstract class ProfileGridViewWidget extends GridViewWidget {
 41: 
 42:     public $viewFile = '_gridViewProfileWidget';
 43: 
 44:     private static $_JSONPropertiesStructure;
 45: 
 46:     /**
 47:      * @var object the model to be associated with this grid view widget 
 48:      */
 49:     protected $_model;
 50: 
 51:     /**
 52:      * @var object 
 53:      */
 54:     protected $_dataProvider;
 55: 
 56:     /**
 57:      * @var array the config array passed to widget ()
 58:      */
 59:     private $_gridViewConfig;
 60: 
 61:     /**
 62:      * @return object the model to be associated with the grid view widget 
 63:      */
 64:     abstract protected function getModel ();
 65: 
 66:     /**
 67:      * Should be called after model is instantiated in getModel 
 68:      */
 69:     protected function afterGetModel () {}
 70: 
 71:     /**
 72:      * overrides parent method
 73:      */
 74:     public static function getJSONPropertiesStructure () {
 75:         if (!isset (self::$_JSONPropertiesStructure)) {
 76:             self::$_JSONPropertiesStructure = array_merge (
 77:                 parent::getJSONPropertiesStructure (),
 78:                 array (
 79:                     'dbPersistentGridSettings' => false, 
 80:                 )
 81:             );
 82:         }
 83:         return self::$_JSONPropertiesStructure;
 84:     }
 85: 
 86:     public function getTemplate () {
 87:         $model = $this->getModel ();
 88:         $moduleName = strtolower (X2Model::getModuleName (get_class ($model)));
 89:         return "<div class='submenu-title-bar widget-title-bar $moduleName'>{widgetLabel}{closeButton}{minimizeButton}{settingsMenu}</div>{widgetContents}";
 90:     }
 91: 
 92:     /**
 93:      * @return array the config array passed to widget ()
 94:      */
 95:     public function getGridViewConfig () {
 96:         if (!isset ($this->_gridViewConfig)) {
 97:             $this->_gridViewConfig = array_merge (parent::getGridViewConfig (), array (
 98:                 'sortableWidget' => $this,
 99:                 'id'=>$this->getWidgetKey (),
100:                 'enableScrollOnPageChange' => false,
101:                 'possibleResultsPerPage' => array(5, 10, 20, 30, 40, 50, 75, 100),
102:                 'buttons'=>array('advancedSearch','clearFilters','columnSelector','autoResize'),
103:                 'template'=>
104:                     CHtml::openTag ('div', X2Html::mergeHtmlOptions (array (
105:                         'class' => 'page-title'
106:                     ), array (
107:                         'style' =>  
108:                             !CPropertyValue::ensureBoolean (
109:                                 $this->getWidgetProperty('showHeader')) &&
110:                             !CPropertyValue::ensureBoolean (
111:                                 $this->getWidgetProperty('hideFullHeader')) ?
112:                                 'display: none;' : ''
113: 
114:                     ))).
115:                     '<h2 class="grid-widget-title-bar-dummy-element">'.
116:                     '</h2>{buttons}{filterHint}'.
117:                     
118:                     '{summary}{topPager}<div class="clear"></div></div>{items}{pager}',
119:                 'fixedHeader'=>false,
120:                 'dataProvider'=>$this->dataProvider,
121:                 'filter'=>$this->model,
122:                 'pager'=>array('class'=>'CLinkPager','maxButtonCount'=>10),
123:                 'modelName'=> get_class ($this->model),
124:                 'viewName'=>'profile',
125:                 'gvSettingsName'=> get_called_class ().$this->widgetUID,
126:                 'enableControls'=>true,
127:                 'fullscreen'=>false,
128:                 'enableSelectAllOnAllPages' => false,
129:             ));
130:         }
131:         return $this->_gridViewConfig;
132:     }
133: 
134:     protected function getSettingsMenuContentEntries () {
135:         return 
136:             '<li class="grid-settings-button">'.
137:                 X2Html::fa('fa-gear').
138:                 Yii::t('profile', 'Widget Grid Settings').'
139:             </li>'.parent::getSettingsMenuContentEntries ();
140:     }
141: 
142:     /**
143:      * Magic getter. Returns this widget's css
144:      * @return array key is the proposed name of the css string which should be passed as the first
145:      *  argument to yii's registerCss. The value is the css string.
146:      */
147:     protected function getCss () {
148:         if (!isset ($this->_css)) {
149:             $this->_css = array_merge (
150:                 parent::getCss (),
151:                 array (
152:                     'gridViewWidgetCss' => "
153:                         .sortable-widget-container .x2grid-header-container {
154:                             width: 100% !important;
155:                         }
156: 
157:                         .sortable-widget-container .page-title {
158:                             border-radius: 0 !important;
159:                         }
160: 
161:                         .sortable-widget-container .pager {
162:                             float: none;
163:                             -moz-border-radius: 0px 0px 4px 4px;
164:                             -o-border-radius: 0px 0px 4px 4px;
165:                             -webkit-border-radius: 0px 0px 4px 4px;
166:                             border-radius: 0px 0px 4px 4px;
167:                         }
168: 
169:                         .sortable-widget-container div.page-title {
170:                             background:#cfcfcf;
171:                             border-bottom: 1px solid #cfcfcf;
172:                         }
173: 
174:                         .sortable-widget-container div.page-title .x2-minimal-select {
175:                             border:1px solid #cfcfcf !important;
176:                         }
177: 
178:                         .sortable-widget-container div.page-title .x2-minimal-select:hover,
179:                         .sortable-widget-container div.page-title .x2-minimal-select:focus {
180:                             border: 1px solid #A0A0A0;
181:                             background: rgb(221, 221, 221);
182:                         }
183: 
184:                         .sortable-widget-container div.page-title .x2-minimal-select:hover + .after-x2-minimal-select-outer > .after-x2-minimal-select,
185:                         .sortable-widget-container div.page-title .x2-minimal-select:focus + .after-x2-minimal-select-outer > .after-x2-minimal-select {
186: 
187:                             background: rgb(221, 221, 221);
188:                             background-image: url(".Yii::app()->theme->getBaseUrl ()."/images/icons/Collapse_Widget.png) !important;
189:                             background-repeat: no-repeat !important;
190:                             background-position: 7px !important;
191:                         }
192: 
193:                         .grid-widget-title-bar-dummy-element {
194:                             height: 33px;
195:                             display: none !important;
196:                         }
197: 
198:                         @media (max-width: 657px) {
199:                             .grid-widget-title-bar-dummy-element {
200:                                 display: block !important;
201:                             }
202:                             .sortable-widget-container .x2-gridview-mass-action-buttons {
203:                                 top: -41px;
204:                                 right: -20px;
205:                             }
206:                             .sortable-widget-container .show-top-buttons .x2-gridview-mass-action-buttons {
207:                                     right: -24px; 
208:                             }
209:                         }
210:                         
211:                         .sortable-widget-container .grid-view .page-title {
212:                             min-height: 34px;
213:                             height: auto;
214:                         }
215:                     "
216:                 )
217:             );
218:         }
219:         return $this->_css;
220:     }
221: 
222:     /**
223:      * @return object Data provider object to be used for the grid view
224:      */
225:     protected function getDataProvider () {
226:         if (!isset ($this->_dataProvider)) {
227:             $resultsPerPage = $this->getWidgetProperty (
228:                 'resultsPerPage');
229:             $this->_dataProvider = $this->model->search (
230:                 $resultsPerPage, get_called_class ().$this->widgetUID);
231:         }
232:         return $this->_dataProvider;
233:     }
234: 
235:     protected function getSettingsMenuContentDialogs () {
236:         return
237:             '<div id="grid-settings-dialog-'.$this->widgetKey.'" 
238:               style="display: none;">'.
239:                 '<div>'.Yii::t('profile', 'Use persistent filter and sort settings?').'</div>'.
240:                 CHtml::checkbox (
241:                     'dbPersistentGridSettings', 
242:                     self::getJSONProperty (
243:                         $this->profile, 'dbPersistentGridSettings', $this->widgetType,
244:                         $this->widgetUID), 
245:                     array (
246:                         'id' => 'dbPersistentGridSettings-'.$this->widgetKey,
247:                     )
248:                 ).
249:                 X2Html::hint (
250:                     Yii::t(
251:                         'profile', 'Leaving this box checked will prevent your grid filter and '.
252:                         'sort settings from being reset when you log out of the app.'), 
253:                     false, null, true, true).
254:             '</div>'.parent::getSettingsMenuContentDialogs ();
255:     }
256: 
257: }
258: ?>
259: 
X2CRM Documentation API documentation generated by ApiGen 2.8.0