本文整理汇总了PHP中Zurmo类的典型用法代码示例。如果您正苦于以下问题:PHP Zurmo类的具体用法?PHP Zurmo怎么用?PHP Zurmo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zurmo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStageDropDownArray
/**
* Gets array for stages
* @return array
*/
protected function getStageDropDownArray()
{
$customFieldData = CustomFieldData::getByName('ProductStages');
$customFieldIndexedData = CustomFieldDataUtil::getDataIndexedByDataAndTranslatedLabelsByLanguage($customFieldData, Yii::app()->language);
$data = array_merge(array(ProductsConfigurationForm::FILTERED_BY_ALL_STAGES => Zurmo::t('Core', 'All')), $customFieldIndexedData);
return $data;
}
示例2: run
public function run()
{
$defaultView = $this->defaultView;
$inputId = $this->inputId;
$eventsUrl = Yii::app()->createUrl('calendars/default/getEvents');
//Set the goto date for calendar
$startDate = $this->startDate;
$startDateAttr = explode('-', $startDate);
$year = $startDateAttr[0];
$month = intval($startDateAttr[1]) - 1;
$day = intval($startDateAttr[2]);
$currentYear = date('Y');
$currentMonth = intval(date('m')) - 1;
$currentDay = date('d');
$maxCount = CalendarItemsDataProvider::MAXIMUM_CALENDAR_ITEMS_COUNT;
//Register full calendar script and css
self::registerFullCalendarScriptAndCss();
//Register qtip for event render
$qtip = new ZurmoTip();
$qtip->addQTip(".fc-event");
$cs = Yii::app()->getClientScript();
$loadingText = Zurmo::t('Core', 'Loading..');
// Begin Not Coding Standard
$script = "\$(document).on('ready', function() {\n \$('#{$inputId}').fullCalendar({\n editable: false,\n header: {\n left: 'prev,next today',\n center: 'title',\n right: 'month,basicWeek,basicDay'\n },\n defaultView: '{$defaultView}',\n firstDay :1,\n ignoreTimeZone:false,\n lazyFetching : false,\n loading: function(bool)\n {\n if (bool)\n {\n \$(this).makeLargeLoadingSpinner(true, '#{$inputId}');\n }\n else\n {\n \$(this).makeLargeLoadingSpinner(false, '#{$inputId}');\n }\n },\n eventSources: [\n getCalendarEvents('{$eventsUrl}', '{$inputId}')\n ],\n eventRender: function(event, element, view) {\n element.qtip({\n content: {\n text: '{$loadingText}',\n ajax: {\n url: event.description,\n type: 'get'\n },\n title: {\n text: event.title,\n button: 'Close'\n }\n },\n style: {classes:'calendar-event-tooltip'},\n show:{\n event: 'click'\n },\n hide: {\n event: 'false'\n },\n position: {\n my: 'bottom center',\n at: 'top center',\n target: 'mouse',\n viewport: \$('#calendar'),\n adjust: {\n mouse: false,\n scroll: false\n }\n }\n });\n },\n timeFormat: {\n 'month' : '',\n 'basicDay': 'h:mm-{h:mm}tt',\n 'basicWeek': 'h:mm-{h:mm}tt'\n }\n });\n \$('#{$inputId}').fullCalendar('gotoDate', {$year}, {$month}, {$day});\n \$('.fc-button-today').click(function() {\n \$('#{$inputId}').fullCalendar('changeView', 'basicDay');\n \$('#{$inputId}').fullCalendar('gotoDate', {$currentYear}, {$currentMonth}, {$currentDay});\n });\n });";
// End Not Coding Standard
$cs->registerScript('loadCalendarScript', $script, ClientScript::POS_END);
}
示例3: testApiServerUrl
public function testApiServerUrl()
{
if (!$this->isApiTestUrlConfigured()) {
$this->markTestSkipped(Zurmo::t('ApiModule', 'API test url is not configured in perInstanceTest.php file.'));
}
$this->assertTrue(strlen($this->serverUrl) > 0);
}
示例4: validateMinimumToRecipients
/**
* When the scenario is createNonDraft, it means you have to have at least one recipient
* @param string $attribute
* @param array $params
*/
public function validateMinimumToRecipients($attribute, $params)
{
if (isset($this->recipientsData['to']) && $this->recipientsData['to'] != null) {
return;
}
$this->addError($attribute . '_to', Zurmo::t('EmailMessagesModule', 'To address cannot be blank'));
}
示例5: checkServiceAndSetMessagesByMethodNameAndDisplayLabel
/**
* Override to handle scenarios where the application can detect apache is installed, but is unable to resolve
* the version.
* @see ServiceHelper::checkServiceAndSetMessagesByMethodNameAndDisplayLabel()
*/
protected function checkServiceAndSetMessagesByMethodNameAndDisplayLabel($methodName, $displayLabel)
{
assert('$this->minimumVersion != null &&
(is_array($this->minimumVersion) || is_string($this->minimumVersion))');
assert('is_string($methodName)');
assert('is_string($displayLabel)');
$actualVersion = null;
$minimumVersionLabel = $this->getMinimumVersionLabel();
$passed = $this->callCheckServiceMethod($methodName, $actualVersion);
if ($passed) {
$this->message = $displayLabel . ' ' . Zurmo::t('InstallModule', 'version installed:') . ' ' . $actualVersion;
$this->message .= ' ' . Zurmo::t('InstallModule', 'Minimum version required:') . ' ' . $minimumVersionLabel;
return true;
} else {
if ($actualVersion == null) {
if ($_SERVER['SERVER_SOFTWARE'] == 'Apache') {
$this->checkResultedInWarning = true;
$this->message = $displayLabel . ' ' . Zurmo::t('InstallModule', 'is installed, but the version is unknown.');
} else {
$this->message = $displayLabel . ' ' . Zurmo::t('InstallModule', 'is not installed.');
}
} else {
$this->message = $displayLabel . ' ' . Zurmo::t('InstallModule', 'version installed:') . ' ' . $actualVersion;
}
$this->message .= "\n";
$this->message .= Zurmo::t('InstallModule', 'Minimum version required:') . ' ' . $minimumVersionLabel;
return false;
}
}
示例6: renderLabel
/**
* Override to ensure label is pointing to the right input id
* @return A string containing the element's label
*/
protected function renderLabel()
{
if ($this->form === null) {
throw new NotImplementedException();
}
return ZurmoHtml::tag('h3', array(), Zurmo::t('ImportModule', 'Please select the module you would like to import to:'));
}
示例7: makeForExplicitReadWriteModelPermissions
protected static function makeForExplicitReadWriteModelPermissions($resolvedModelClassName)
{
assert('is_string($resolvedModelClassName)');
$form = new ExplicitReadWriteModelPermissionsWorkflowActionAttributeForm($resolvedModelClassName, 'permissions');
$form->setDisplayLabel(Zurmo::t('ZurmoModule', 'Who can read and write'));
return $form;
}
示例8: testSendSystemEmail
public function testSendSystemEmail()
{
if (!EmailMessageTestHelper::isSetEmailAccountsTestConfiguration()) {
$this->markTestSkipped(Zurmo::t('EmailMessagesModule', 'Test email settings are not configured in perInstanceTest.php file.'));
}
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
Yii::app()->imap->connect();
EmailMessage::deleteAll();
// Expunge all emails from dropbox
Yii::app()->imap->deleteMessages(true);
$this->assertEquals(0, EmailMessage::getCount());
$imapStats = Yii::app()->imap->getMessageBoxStatsDetailed();
$this->assertEquals(0, $imapStats->Nmsgs);
$subject = "System Message";
$textMessage = "System message content.";
$htmlMessage = "<strong>System</strong> message content.";
EmailMessageHelper::sendSystemEmail($subject, array(Yii::app()->imap->imapUsername), $textMessage, $htmlMessage);
sleep(30);
Yii::app()->imap->connect();
$imapStats = Yii::app()->imap->getMessageBoxStatsDetailed();
$this->assertEquals(1, $imapStats->Nmsgs);
$this->assertEquals(1, EmailMessage::getCount());
$emailMessages = EmailMessage::getAll();
$emailMessage = $emailMessages[0];
$this->assertEquals('System Message', $emailMessage->subject);
$this->assertEquals('System message content.', trim($emailMessage->content->textContent));
$this->assertEquals('<strong>System</strong> message content.', trim($emailMessage->content->htmlContent));
$this->assertEquals(1, count($emailMessage->recipients));
foreach ($emailMessage->recipients as $recipient) {
$this->assertEquals($recipient->toAddress, Yii::app()->imap->imapUsername);
$this->assertEquals(EmailMessageRecipient::TYPE_TO, $recipient->type);
}
}
示例9: resolveNextPagingAndParams
protected function resolveNextPagingAndParams($page, $params)
{
assert('$params === null || is_array($params)');
$pageCount = $this->dataProvider->getPagination()->getPageCount();
$pageSize = $this->dataProvider->getPagination()->getPageSize();
$totalItemCount = $this->dataProvider->getTotalItemCount();
$this->subSequenceCompletionPercentage = ($page + 1) / $pageCount * 100;
if ($page + 1 == $pageCount) {
$this->nextStep = 'complete';
$this->setNextMessageByStep($this->nextStep);
return null;
} else {
$params['page'] = $page + 1;
$this->nextStep = 'processRows';
$this->setNextMessageByStep($this->nextStep);
$startItemCount = ($page + 1) * $pageSize + 1;
if ($startItemCount + ($pageSize - 1) > $totalItemCount) {
$endItemCount = $totalItemCount;
} else {
$endItemCount = ($page + 2) * $pageSize;
}
$labelParams = array('{startItemCount}' => $startItemCount, '{endItemCount}' => $endItemCount, '{totalItemCount}' => $totalItemCount);
$nextMessage = ' ' . Zurmo::t('ImportModule', 'Record(s) {startItemCount} - {endItemCount} of {totalItemCount}', $labelParams);
$this->nextMessage .= $nextMessage;
return $params;
}
}
示例10: sanitizeValue
/**
* If the attribute specified is required and the value is null, attempt to utilize a default value if it is
* specified. If it is not specified or the default value specified is not a valid custom field data value, then
* an InvalidValueToSanitizeException will be thrown.
* @param string $modelClassName
* @param string $attributeName
* @param mixed $value
* @param array $mappingRuleData
*/
public static function sanitizeValue($modelClassName, $attributeName, $value, $mappingRuleData)
{
assert('is_string($modelClassName)');
assert('is_string($attributeName)');
if ($value != null) {
return $value;
}
assert('$value == null || $value instanceof OwnedCustomField');
assert('$mappingRuleData["defaultValue"] == null || is_string($mappingRuleData["defaultValue"])');
if ($mappingRuleData['defaultValue'] != null) {
try {
$customField = new OwnedCustomField();
$customField->value = $mappingRuleData['defaultValue'];
$customField->data = CustomFieldDataModelUtil::getDataByModelClassNameAndAttributeName($modelClassName, $attributeName);
} catch (NotSupportedException $e) {
throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Pick list is missing corresponding custom field data.'));
}
return $customField;
} else {
$model = new $modelClassName(false);
if (!$model->isAttributeRequired($attributeName)) {
return $value;
}
throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Pick list value required, but missing.'));
}
return $value;
}
示例11: renderTestButton
/**
* Render a test button. This link calls a modal popup.
* @return The element's content as a string.
*/
protected function renderTestButton()
{
$content = '<span>';
$content .= ZurmoHtml::ajaxLink(ZurmoHtml::wrapLabel(Zurmo::t('EmailMessagesModule', 'Send Test Email')), Yii::app()->createUrl('sendGrid/default/sendTestMessage/', array()), static::resolveAjaxOptionsForTestEmailSettings($this->form->getId()), array('id' => 'SendATestEmailToButton', 'class' => 'EmailTestingButton z-button'));
$content .= '</span>';
return $content;
}
示例12: filters
public function filters()
{
if (!YII_DEBUG) {
echo Zurmo::t('ZurmoModule', 'This action is only available in debug mode.');
Yii::app()->end(0, false);
}
}
示例13: setUp
public function setUp()
{
parent::setUp();
if (!SendGridTestHelper::isSetSendGridAccountTestConfiguration()) {
$this->markTestSkipped(Zurmo::t('SendGridModule', 'Email test settings are missing.'));
}
}
示例14: __toString
public function __toString()
{
$s = self::rightToString($this->type);
$s .= ':';
$s .= Zurmo::t('ZurmoModule', $this->name);
return $s;
}
示例15: getTypeData
/**
* @return array
*/
protected function getTypeData()
{
$categories = array();
$categories['clearCache'][] = array('titleLabel' => Zurmo::t('WorkflowsModule', 'On-Save Workflow'), 'route' => 'workflows/default/create?type=' . Workflow::TYPE_ON_SAVE);
$categories['clearCache'][] = array('titleLabel' => Zurmo::t('WorkflowsModule', 'Time-Based Workflow'), 'route' => 'workflows/default/create?type=' . Workflow::TYPE_BY_TIME);
return $categories;
}