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: /*****************************************************************************************
  4:  * X2Engine Open Source Edition is a customer relationship management program developed by
  5:  * X2Engine, Inc. Copyright (C) 2011-2016 X2Engine Inc.
  6:  * 
  7:  * This program is free software; you can redistribute it and/or modify it under
  8:  * the terms of the GNU Affero General Public License version 3 as published by the
  9:  * Free Software Foundation with the addition of the following permission added
 10:  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 11:  * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 12:  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 13:  * 
 14:  * This program is distributed in the hope that it will be useful, but WITHOUT
 15:  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 16:  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 17:  * details.
 18:  * 
 19:  * You should have received a copy of the GNU Affero General Public License along with
 20:  * this program; if not, see http://www.gnu.org/licenses or write to the Free
 21:  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 22:  * 02110-1301 USA.
 23:  * 
 24:  * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 25:  * California 95067, USA. or at email address contact@x2engine.com.
 26:  * 
 27:  * The interactive user interfaces in modified source and object code versions
 28:  * of this program must display Appropriate Legal Notices, as required under
 29:  * Section 5 of the GNU Affero General Public License version 3.
 30:  * 
 31:  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 32:  * these Appropriate Legal Notices must retain the display of the "Powered by
 33:  * X2Engine" logo. If the display of the logo is not reasonably feasible for
 34:  * technical reasons, the Appropriate Legal Notices must display the words
 35:  * "Powered by X2Engine".
 36:  *****************************************************************************************/
 37: 
 38: /**
 39:  * Configuration object for the installation contact & updates registry form.
 40:  * 
 41:  * @package application.components
 42:  * @author Demitri Morgan <demitri@x2engine.com>
 43:  */
 44: class UpdatesForm {
 45: 
 46:     /**
 47:      * @var array Form input labels
 48:      */
 49:     public $label = array(
 50:         'receiveUpdates' => 'Notify me of software updates',
 51:         'firstName' => 'First Name',
 52:         'lastName' => 'Last Name',
 53:         'email' => 'Email',
 54:         'phone' => 'Phone Number',
 55:         'source' => 'How you found X2CRM',
 56:         'subscribe' => 'Subscribe to the newsletter',
 57:         'info' => 'Comments',
 58:         'requestContact' => 'Request a follow-up contact',
 59:         'company' => 'Company',
 60:         'position' => 'Position',
 61:         'unique_id' => 'Product Key',
 62:     );
 63: 
 64:     /**
 65:      * @var array Messages
 66:      */
 67:     public $message = array(
 68:         'updatesTitle' => 'Software Updates',
 69:         'registrationTitle' => 'Registration',
 70:         'registrationSuccess' => 'Software registration succeeded.',
 71:         'registrationSubtext' => 'To receive software updates from X2Engine, please register your copy of X2CRM:',
 72:         'registrationPostText' => 'For support or sales inquiries, please contact us',
 73:         'emailIni' => 'If different from Administrator Email',
 74:         'infoIni' => 'Intended use of X2CRM, goals, etc.',
 75:         'intro' => 'Please help us improve X2CRM by providing the following information:',
 76:         'already' => 'Software update notifications enabled.',
 77:         'optionalTitle' => 'Optional Information',
 78:         'title' => 'Software Updates',
 79:         'emailValidation' => 'Please enter a valid email address.', // This one has a translation already.
 80:         'connectionErrHeader' => 'Could not connect to the updates server at this time.',
 81:         'connectionErrMessage' => 'You can continue installing the application without enabling updates and try again later by going into "General Settings" under the section "App Settings" in the Admin console.',
 82:         'connectionNOsMessage' => 'Make sure you have an active internet connection. If the problem persists, please contact us',
 83:     );
 84: 
 85:     /**
 86:      * @var array Contents of the "how you found X2CRM" selector
 87:      */
 88:     public $leadSources = array(
 89:         Null => '-----',
 90:         'Google' => 'Google',
 91:         'Sourceforge' => 'Sourceforge',
 92:         'Github' => 'Github',
 93:         'News outlet' => 'News Outlet',
 94:         'Other' => 'Other',
 95:     );
 96: 
 97:     /**
 98:      * @var array Configuration options
 99:      */
100:     public $config = array();
101: 
102:     /**
103:      * @var boolean Form display flag
104:      */
105:     public $os = True;
106: 
107: 
108:     public function __construct($config, $transFunc, $transFuncArgs = array()) {
109:         $this->config = array(
110:             'x2_version' => '',
111:             'php_version' => phpversion(),
112:             'GD_support' => function_exists('gd_info') ? 1 : 0,
113:             'db_type' => 'MySQL',
114:             'db_version' => '',
115:             'unique_id' => 'none',
116:             'formId' => '',
117:             'submitButtonId' => '',
118:             'statusId' => '',
119:             'themeUrl' => '',
120:             'titleWrap' => array('<h2>', '</h2>'),
121:             'receiveUpdates' => 1,
122:             'serverInfo' => False, // If true, server info should be included in the data that is sent via AJAX.
123:             'user_agent' => $_SERVER['HTTP_USER_AGENT'],
124:             'registered' => 0,
125:             'edition' => 'opensource',
126:             'isUpgrade' => False,
127:         );
128: 
129:         foreach ($config as $key => $value)
130:             $this->config[$key] = $value;
131: 
132:         // Is it OS edition?
133:         $this->os = $config['edition']=='opensource' && ! $this->config['isUpgrade'];
134:         // Empty the unique_id field; user will fill it.
135:         if (!$this->os)
136:             if ($this->config['unique_id'] == 'none')
137:                 $this->config['unique_id'] = '';
138: 
139:         // $this->config['unique_id'] = 'something'; // To test what the form looks like when unique_id is filled
140:             
141:         // Translate all messages for the updates form:
142:         foreach (array('label', 'message', 'leadSources') as $attr) {
143:             $attrArr = $this->$attr;
144:             foreach (array_keys($this->$attr) as $key)
145:                 $attrArr[$key] = call_user_func_array($transFunc, array_merge($transFuncArgs, array($attrArr[$key])));
146:             $this->$attr = $attrArr;
147:         }
148:         $this->message['connectionNOsMessage'] .= ': <a href="http://www.x2crm.com/contact/">x2crm.com</a>.';
149:     }
150: 
151:     /**
152:      * Wrap a title in tags specified by the titleWrap config parameter
153:      * @param type $title
154:      * @return type 
155:      */
156:     public function wrapTitle($title) {
157:         return $this->config['titleWrap'][0] . $title . $this->config['titleWrap'][1];
158:     }
159: 
160:     /**
161:      * Print fields of the form that are text inputs
162:      * @param type $fields 
163:      */
164:     public function textFields($fields = array()) {
165:         foreach ($fields as $field) {
166:             echo '<div class="row">'."\n";
167:             echo '<label for="' . $field . '">' . $this->label[$field] . '</label>';
168:             echo '<input type="text" name="' . $field . '" id="' . $field . '" />';
169:             echo '</div><!-- .row -->'."\n";
170:         }
171:     }
172: 
173:     /**
174:      * Print hidden fields of the form
175:      * @param array $fields 
176:      */
177:     public function hiddenFields($fields = array()) {
178:         foreach ($fields as $field)
179:             echo '<input type="hidden" name="' . $field . '" id="' . $field . '" value="' . $this->config[$field] . '">';
180:     }
181: 
182:     public function testMessages() {
183:         echo "<dl>\n";
184:         foreach ($this->message as $key => $value)
185:             echo "<dt>$key</dt><dd>$value</dd>\n";
186:         echo "</dl>";
187:     }
188: 
189: }
190: ?>
191: 
X2CRM Documentation API documentation generated by ApiGen 2.8.0