Пример #1
0
 public function testSugarWidgetSubpanelTopButtonQuickCreate()
 {
     $defines = array();
     $defines['focus'] = $this->account;
     $defines['module'] = 'Accounts';
     $defines['action'] = 'DetailView';
     $subpanel_definitions = new SubPanelDefinitions(new Contact());
     $contactSubpanelDef = $subpanel_definitions->load_subpanel('contacts');
     $subpanel = new SubPanel('Accounts', $this->account->id, 'contacts', $contactSubpanelDef, 'Accounts');
     $defines['subpanel_definition'] = $subpanel->subpanel_defs;
     $button = new SugarWidgetSubPanelTopButtonQuickCreate();
     $code = $button->_get_form($defines);
     $this->assertRegExp('/\\<input[^\\>]*?name=\\"return_name\\"/', $code, "Assert that the hidden input field return_name was created");
 }
Пример #2
0
 function &_get_form($defines, $additionalFormFields = null)
 {
     //<sl_change author="Demydenko" date="2015-01-20" desc="создние платежного требования":>
     //Получаем дополнительные поля для формы
     foreach ($defines['additional_form_fields'] as $key => $value) {
         if (!empty($defines['focus']->{$value})) {
             $additionalFormFields[$key] = $defines['focus']->{$value};
         } else {
             $additionalFormFields[$key] = '';
         }
     }
     //</sl_change>
     return parent::_get_form($defines, $additionalFormFields);
 }