CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Google Summer of Code »
  • Bootstrap for CiviCRM UI
Pages: 1 2 3 [4] 5

Author Topic: Bootstrap for CiviCRM UI  (Read 10622 times)

teja-amil

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Joomla! 3.2
  • MySQL version: 4
  • PHP version: 5
Re: Bootstrap for CiviCRM UI
July 24, 2014, 03:59:03 am
Update-

1. Migration of form elements: Most of the form elements are now rendered in Bootstrap. Consequently, pages like Profile, Contributions etc. are also displayed in Bootstrap.
To Do: Buttons need to be Bootstrapped. Pages have some inconsistencies.

2. CiviCRM Administration: Home page is converted to Bootstrap. Few pages in CiviCRM > Search have also been moved. Tables now scale responsively to screen size.
To Do: Should complete migration of all pages

3. Option to enable/disable bootstrap.css: Added this to Administer > System Settings > Resource URLs as a Yes/No option.

Process I followed:

1. Added  this to civicrm/CRM/Admin/Form/Setting/Url.php  to generate element via QuickForm
Code: [Select]
  $this->addYesNo('enable_bootstrap_css', ts('Use Bootstrap CSS'));  2. Added the below code in templates/CRM/Admin/Form/Setting/Url.tpl for the form to be rendered.
Code: [Select]
    <tr class="crm-url-form-block-enable_bootstrap_css">
        <td class="label">
            {$form.enable_bootstrap_css.label} {help id='id-bootstrap_help'}
        </td>
        <td>
            {$form.enable_bootstrap_css.html}
     <p class="description font-red">{ts}{$enable_bootstrap_css_description}{/ts}</p>
        </td>
    </tr>

3.  Added a condition as below to set variable in civicrm/CRM/Upgrade/Incremental/php/FourFive.php  Using SmartyDebug in browser, I can see that the variable is set to 1
Code: [Select]
if ($config->enable_bootstrap_css === 1 && strpos($config->userFramework, 'Drupal') === 0) {
      CRM_Core_BAO_Setting::updateSettingsFromMetaData();
      CRM_Core_BAO_Setting::setItem('1', CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_bootstrap_css');
    }

4. I have added the below code to addCoreStyles() function to include bootstrap.css file in civicrm/CRM/Core/Resources.php
Code: [Select]
if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,'enable_bootstrap_css'))
      {
       $this->addstyleFile('bootstrap', 'css/bootstrap.css', -99, $region);
    }

5. Finally, I have updated the civicrm/settingsCore.setting.php file to include the new variable.
Code: [Select]
'enable_bootstrap_css' => array(
    'group_name' => 'CiviCRM Preferences',
    'group' => 'core',
    'name' => 'enable_bootstrap_css',
    'type' => 'Boolean',
    'quick_form_type' => 'YesNo',
    'default' => '0',
    'add' => '4.5',
    'title' => 'Use Bootstrap CSS',
    'is_domain' => 1,
    'is_contact' => 0,
    'description' => 'Enables Bootsrap CSS files',
    'help_text' => 'This is a work in progress. It might break default CSS. Check documentation at wiki.civicrm.org/confluence/display/BootstrapUI for more details',
  ),

However, the variable value does not change to 0 when No option is selected.
Code: [Select]
"default" => '0' is assigned but the variable value is 1 and always stays 1.
Working on this right now.
« Last Edit: July 27, 2014, 09:31:04 pm by teja-amil »

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Bootstrap for CiviCRM UI
July 24, 2014, 08:01:59 am
This is great progress - I think to get the new setting to take place you need to either do an upgrade from 4.4 to 4.5 or else do a new installation of 4.5 so that the setting gets added/retained in database. Xavier - do you have any other suggestions on this or does it sound like we are on the right track?

Teja - here are the other hurdles that you need to consider from our call today:
- Ensure there is only one container being used in a page (see http://www.helloerik.com/the-subtle-magic-behind-why-the-bootstrap-3-grid-works for a great explanation - thanks to Xavier for finding this); also double check your work to make sure you are not using columns outside of rows
- Related to this, you will need to determine if a requirement of loading Bootstrap on the CiviCRM side is going to be that the user has to be in a Bootstrap-based theme on the Drupal side (https://www.drupal.org/project/bootstrap). At the very least, this needs to be included in the documentation for this project if we are going to be dependent on it to give us the main container element.
- For the civicrm homepage widgets, you'll need to review templates/CRM/common/dashboard.tpl (line 64) and examine how classes can be tied to widgets; reviewing this may lead you to other files that need to be modified.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Bootstrap for CiviCRM UI
July 24, 2014, 02:14:44 pm
Quote from: emilyf on July 24, 2014, 08:01:59 am
This is great progress - I think to get the new setting to take place you need to either do an upgrade from 4.4 to 4.5 or else do a new installation of 4.5 so that the setting gets added/retained in database. Xavier - do you have any other suggestions on this or does it sound like we are on the right track?


Teja, do you have civi installed from git? Either upgrade or new install would work (or at least potentially highlight different issues ;)

but indeed, targeting 4.5 is the best option.

Quote from: emilyf on July 24, 2014, 08:01:59 am
(https://www.drupal.org/project/bootstrap). At the very least, this needs to be included in the documentation for this project if we are going to be dependent on it to give us the main container element.


indeed, would be great there is an option "the CMS theme is already using bootstrap", IMO it doesn't matter if there is a UI setting, could be done from within the civicrm.settings.php as well.

It sounds like it's getting there! Have you planned some alpha/beta testing? Is there already a public site we could have a look at somewhere?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Bootstrap for CiviCRM UI
July 24, 2014, 06:49:35 pm
Yes - would be great to know how we can 'give it a spin'
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

teja-amil

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Joomla! 3.2
  • MySQL version: 4
  • PHP version: 5
Re: Bootstrap for CiviCRM UI
July 27, 2014, 09:25:21 pm
Hi,

I have few issues.
1. I am trying to get the back end option of Enabling Bootstrap CSS function. As Xavier and Emily suggested, I have re-installed CiviCRM 4.5 Beta 2. But here was no no result. The same problem is being faced again.

2. Changing the templates of CiviCRM to Bootstrap: Firstly I am doing Advance Search, as the total page consist of tables, converting them into bootstrap without replacing tables with divs is really becoming a tough task and in few cases its impossible.

For that Emily has suggested to add bootstrap custom tables with no border using custom css.
My css file consist of:
Code: [Select]
@import "less/bootstrap.less";
.table-borderless td,
.table-borderless th {
     border: 0;
 }

and in my templates/CRM/Contact/Form/Search/Criteria/Basic.tpl I added
Code: [Select]
<table class="table table-borderless form-layout">
But I am not able to remove borders for the tables.

Should we re-think about replacing tables with divs?


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Bootstrap for CiviCRM UI
July 27, 2014, 11:09:00 pm
Quote from: teja-amil on July 27, 2014, 09:25:21 pm

1. I am trying to get the back end option of Enabling Bootstrap CSS function. As Xavier and Emily suggested, I have re-installed CiviCRM 4.5 Beta 2. But here was no no result. The same problem is being faced again.

Not sure i understand what you mean.  What is this you experience in detail and what are you expecting?
Quote from: teja-amil on July 27, 2014, 09:25:21 pm

2. Changing the templates of CiviCRM to Bootstrap: Firstly I am doing Advance Search, as the total page consist of tables, converting them into bootstrap without replacing tables with divs is really becoming a tough task and in few cases its impossible.


Given the timing of the project, I would not try to change a page that is both complex and only used by a tiny number of users. Is everything on a contribution page or user registration for a newsletter or membership working, including all custom fields you can think of adding to the profiles?

It would be much more useful to get that working fully rather than lots of screens that are half finished
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

teja-amil

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Joomla! 3.2
  • MySQL version: 4
  • PHP version: 5
Re: Bootstrap for CiviCRM UI
July 27, 2014, 11:38:23 pm
Hi Xavier,

I am trying to include a radio button option to enable/disable Bootstrap CSS based on which we can load/not load bootstrap.css

I have explained every step what I did to get the option in my previous post and after your suggestion  I re-installed it but when I set Enable Bootstrap CSS to yes, the css which was made for Bootstrap is not loading. What ever option you select, It always sets the original CiviCRM CSS. I am not understanding where the problem is?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Bootstrap for CiviCRM UI
July 28, 2014, 12:27:38 am
Ok, so you have modified the template/code to add a new field, but this field isn't saved.

Have you written any code to handle when the the user fills the form and post the data to the server and save it? Check out how the other fields are handled CRM_Admin_Form_Setting_Url::postProcess that is using mostly is parent postProcess and commonProcess

I don't recall the detail of what to change to save a new setting, but check out the code and compare what it does with one of the existing field and yours and if should quickly point you to the missing part.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Bootstrap for CiviCRM UI
July 28, 2014, 12:40:59 am

Quote
I don't recall the detail of what to change to save a new setting
To add settings to settings forms you need to define them in the settings folder & on the form - e.g

https://github.com/civicrm/civicrm-core/blob/8f0551201883036cac63d720149953c007d4f10d/CRM/Admin/Form/Setting/Debugging.php#L42
https://github.com/civicrm/civicrm-core/blob/8f0551201883036cac63d720149953c007d4f10d/settings/Developer.setting.php#L39
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Bootstrap for CiviCRM UI
July 28, 2014, 03:49:35 am
As to your CSS issue, there is no need to add new classes. The point of a custom bootstrap css file is to override certain bootstrap elements. Then you load your custom css file last.This is basic CSS principles.

You should use less but ultimately you need to set your less file to compile to a CSS file as the end result needs to have a CSS file - the LESS file is just for your own use and to make development easy.

Steps:
1. Create a custom-bootstrap.css file (have this compile from your custom LESS file or else write it directly just as a CSS file if you are having trouble - you should probably review LESS and preprocessors as you should not be importing this directly into the same file that is importing the bootstrap file, this one needs to be compiled separately)
2. Have this custom CSS file load VERY LAST - so again you will need to include it in the same area that bootstrap.css is getting loaded in settings, only for this one have it load second.
3. Do not create NEW classes. Simply override existing classes in custom-bootstrap.css, ie:
Code: [Select]
table tr {
border: 0;
}

You need to use a code inspector to identify the exact class you need to override (it may be table td or table tr), but the point here is not to add new classes because bootstrap of course is still adding the border otherwise. If you are having trouble with this, now is a good time to review the basics, here is an article that shows this very approach: http://www.smashingmagazine.com/2013/03/12/customizing-bootstrap/

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Bootstrap for CiviCRM UI
July 28, 2014, 07:09:46 am
Teja,

It will be a lot more helpful to Eileen and Xavier if you can provide code snippets. For example, you have added enable_bootstrap_css setting to the following area of CRM / Admin / Form / Setting / Url.php:

Code: [Select]
/**
* This class generates form components for Site Url
*
*/
class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
  protected $_settings = array(
    'cvv_backoffice_required' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
    'disable_core_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
    'enable_bootstrap_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
  );
  /**
* Function to build the form
*
* @return void
* @access public
*/
  public function buildQuickForm() {
    CRM_Utils_System::setTitle(ts('Settings - Resource URLs'));
    $settingFields = civicrm_api('setting', 'getfields', array(
      'version' => 3
    ));

    $this->addElement('text', 'userFrameworkResourceURL', ts('CiviCRM Resource URL'));
    $this->addElement('text', 'imageUploadURL', ts('Image Upload URL'));
    $this->addElement('text', 'customCSSURL', ts('Custom css URL'));
    $this->addYesNo('enable_bootstrap_css', ts('Use Bootstrap CSS'));
    $this->addElement('text', 'extensionsURL', ts('Extension Resource URL'));
    $this->addYesNo('enableSSL', ts('Force Secure URLs (SSL)'));
    $this->addYesNo('verifySSL', ts('Verify SSL Certs'));
    // FIXME: verifySSL should use $_settings instead of manually adding fields
    $this->assign('verifySSL_description', $settingFields['values']['verifySSL']['description']);

    $this->addFormRule(array('CRM_Admin_Form_Setting_Url', 'formRule'));

    parent::buildQuickForm();
  }

This piece looks good to me, and Eileen's example also suggests that this part of your code is on track.

Where you are struggling is with how to actually get the setting in the database. You are using disable_core_css as your working example because that is similar to what you need to do. Using Grep, you found that this setting is added in to Civi 4.4 in CRM/Upgrade/Incremental/php/FourFour.php within this function:
Code: [Select]
  /**
* @param $rev
*/
  function upgrade_4_4_1($rev) {
    $config = CRM_Core_Config::singleton();
    // CRM-13327 upgrade handling for the newly added name badges
    $ogID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'name_badge', 'id', 'name');
    $nameBadges = array_flip(array_values(CRM_Core_BAO_OptionValue::getOptionValuesAssocArrayFromName('name_badge')));
    unset($nameBadges['Avery 5395']);
    if (!empty($nameBadges)) {
      $dimension = '{"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":4,"metric":"mm","lMargin":6,"tMargin":19,"SpaceX":0,"SpaceY":0,"width":100,"height":65,"lPadding":0,"tPadding":0}';
      $query = "UPDATE civicrm_option_value
SET value = '{$dimension}'
WHERE option_group_id = %1 AND name = 'Fattorini Name Badge 100x65'";

      CRM_Core_DAO::executeQuery($query, array(1 => array($ogID, 'Integer')));
    }
    else {
      $dimensions = array(
        1 => '{"paper-size":"a4","orientation":"landscape","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":1,"metric":"mm","lMargin":25,"tMargin":27,"SpaceX":0,"SpaceY":35,"width":106,"height":150,"lPadding":5,"tPadding":5}',
        2 => '{"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":4,"metric":"mm","lMargin":6,"tMargin":19,"SpaceX":0,"SpaceY":0,"width":100,"height":65,"lPadding":0,"tPadding":0}',
        3 => '{"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":2,"metric":"mm","lMargin":10,"tMargin":28,"SpaceX":0,"SpaceY":0,"width":96,"height":121,"lPadding":5,"tPadding":5}',
      );
      $insertStatements = array(
        1 => "($ogID, %1, '{$dimensions[1]}', %1, NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL)",
        2 => "($ogID, %2, '{$dimensions[2]}', %2, NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, NULL)",
        3 => "($ogID, %3, '{$dimensions[3]}', %3, NULL, 0, NULL, 4, NULL, 0, 0, 1, NULL, NULL)",
      );

      $queryParams = array(
        1 => array('A6 Badge Portrait 150x106', 'String'),
        2 => array('Fattorini Name Badge 100x65', 'String'),
        3 => array('Hanging Badge 3-3/4" x 4-3"/4', 'String'),
      );

      foreach ($insertStatements as $values) {
        $query = 'INSERT INTO civicrm_option_value (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) VALUES' . $values;
        CRM_Core_DAO::executeQuery($query, $queryParams);
      }
    }

    // CRM-12578 - Prior to this version a CSS file under drupal would disable core css
    if (!empty($config->customCSSURL) && strpos($config->userFramework, 'Drupal') === 0) {
      // The new setting doesn't exist yet - need to create it first
      CRM_Core_BAO_Setting::updateSettingsFromMetaData();
      CRM_Core_BAO_Setting::setItem('1', CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'disable_core_css');
    }

    // CRM-13701 - Fix $config->timeInputFormat
    $sql = "
SELECT time_format
FROM civicrm_preferences_date
WHERE time_format IS NOT NULL
AND time_format <> ''
LIMIT 1
";
    $timeInputFormat = CRM_Core_DAO::singleValueQuery($sql);
    if ($timeInputFormat && $timeInputFormat != $config->timeInputFormat) {
      $params = array('timeInputFormat' => $timeInputFormat);
      CRM_Core_BAO_ConfigSetting::add($params);
    }

    // CRM-13698 - add 'Available' and 'No-show' activity statuses
    $insertStatus = array();
    $nsinc = $avinc = $inc = 0;
    if (!CRM_Core_OptionGroup::getValue('activity_status', 'Available', 'name')) {
      $insertStatus[] = "(%1, 'Available', %2, 'Available', NULL, 0, NULL, %3, 0, 0, 1, NULL, NULL)";
      $avinc = $inc = 1;
    }
    if (!CRM_Core_OptionGroup::getValue('activity_status', 'No_show', 'name')) {
      $insertStatus[] = "(%1, 'No-show', %4, 'No_show', NULL, 0, NULL, %5, 0, 0, 1, NULL, NULL)";
      $nsinc = $inc + 1;
    }
    if (!empty($insertStatus)) {
      $acOptionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'activity_status', 'id', 'name');
      $maxVal = CRM_Core_DAO::singleValueQuery("SELECT MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = $acOptionGroupID");
      $maxWeight = CRM_Core_DAO::singleValueQuery("SELECT MAX(weight) FROM civicrm_option_value WHERE option_group_id = $acOptionGroupID");

      $p[1] = array($acOptionGroupID, 'Integer');
      if ($avinc) {
        $p[2] = array($avinc+$maxVal, 'Integer');
        $p[3] = array($avinc+$maxWeight, 'Integer');
      }
      if ($nsinc) {
        $p[4] = array($nsinc+$maxVal, 'Integer');
        $p[5] = array($nsinc+$maxWeight, 'Integer');
      }
      $insertStatus = implode(',', $insertStatus);

      $sql = "
INSERT INTO
civicrm_option_value (`option_group_id`, label, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`)
VALUES {$insertStatus}";
      CRM_Core_DAO::executeQuery($sql, $p);
    }

    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.1')), 'task_4_4_x_runSql', $rev);
    $this->addTask('Patch word-replacement schema', 'wordReplacements_patch', $rev);
  }

So you have been trying to add a similar function to FourFive.php - however, it seems you are just copying and pasting an IF statement into the bottom of the FourFive.php file:
Code: [Select]
if ($config->enable_bootstrap_css === 1 && strpos($config->userFramework, 'Drupal') === 1) {
      CRM_Core_BAO_Setting::updateSettingsFromMetaData();
      CRM_Core_BAO_Setting::setItem('1', CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_bootstrap_css');
    }

This is where your problem is.

Notice that the disable_core_css setting is added within an overall function of
Code: [Select]
function upgrade_4_4_1($rev) { - I anticipate you need to use a similar/appropriate function structure within the 4.5 incremental file - since you are just copying and pasting an if statement, my best guess is that it is not getting run in the revision upgrade/installation. You will need to utilize the correct release that you are going to add this to, then mimic the portion of the FourFour.php that is relevant - do not just copy and paste, you need to read through the function and pick it apart to gather the pieces that you need, and ensure you understand what the entire function is doing so that you can replicate it for your needs in 4.5.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Bootstrap for CiviCRM UI
July 28, 2014, 01:58:49 pm
Actually adding setiings to the db doesn't normally involve anything in the upgrade script  - generally if you define a setting which has a default it will be 'filled' into the db on upgrade -e.g fatal error template here.

https://github.com/civicrm/civicrm-core/blob/8f0551201883036cac63d720149953c007d4f10d/settings/Developer.setting.php#L86

I think you want to set it conditionally though? Or just allow people to set it?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Bootstrap for CiviCRM UI
July 28, 2014, 03:08:34 pm
Eileen - do you have any other suggestions as to what is wrong on this? As you see above he has also added to civicrm/settings/Core.setting.php
Code: [Select]
'enable_bootstrap_css' => array(
    'group_name' => 'CiviCRM Preferences',
    'group' => 'core',
    'name' => 'enable_bootstrap_css',
    'type' => 'Boolean',
    'quick_form_type' => 'YesNo',
    'default' => '0',
    'add' => '4.5',
    'title' => 'Use Bootstrap CSS',
    'is_domain' => 1,
    'is_contact' => 0,
    'description' => 'Enables Bootsrap CSS files',
    'help_text' => 'This is a work in progress. It might break default CSS. Check documentation at wiki.civicrm.org/confluence/display/BootstrapUI for more details',
  ),

Plus putting the setting in CRM/Admin/Form/Setting/Url.php (similar to your example, he is adding this to the resources area):
Code: [Select]
/**
* This class generates form components for Site Url
*
*/
class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
  protected $_settings = array(
    'cvv_backoffice_required' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
    'disable_core_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
    'enable_bootstrap_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
  );
  /**
* Function to build the form
*
* @return void
* @access public
*/
  public function buildQuickForm() {
    CRM_Utils_System::setTitle(ts('Settings - Resource URLs'));
    $settingFields = civicrm_api('setting', 'getfields', array(
      'version' => 3
    ));

    $this->addElement('text', 'userFrameworkResourceURL', ts('CiviCRM Resource URL'));
    $this->addElement('text', 'imageUploadURL', ts('Image Upload URL'));
    $this->addElement('text', 'customCSSURL', ts('Custom css URL'));
    $this->addYesNo('enable_bootstrap_css', ts('Use Bootstrap CSS'));
    $this->addElement('text', 'extensionsURL', ts('Extension Resource URL'));
    $this->addYesNo('enableSSL', ts('Force Secure URLs (SSL)'));
    $this->addYesNo('verifySSL', ts('Verify SSL Certs'));
    // FIXME: verifySSL should use $_settings instead of manually adding fields
    $this->assign('verifySSL_description', $settingFields['values']['verifySSL']['description']);

    $this->addFormRule(array('CRM_Admin_Form_Setting_Url', 'formRule'));

    parent::buildQuickForm();
  }

When this combo did not retain the value upon save (it shows up fine, it just doesn't save), I believe that is when we started down the database route - that is good if it's not necessary...do you have any other pointers as to why it might not save though?

I am at the extent of my knowledge related to the settings stuff so if you guys have ideas it would be greatly appreciated!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Bootstrap for CiviCRM UI
July 28, 2014, 03:13:20 pm
I can take a look - but it may not be until next week - will that hold anything up? Is there a branch for this? Is it being merged into core for 4.5 or will it go into 4.6 ?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Bootstrap for CiviCRM UI
July 28, 2014, 03:33:19 pm

Has anyone checked and see how these changes affect the other two CMS'es - Joomla and WP.

and what needs to be done for it to co-exist with those two also

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: 1 2 3 [4] 5
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Google Summer of Code »
  • Bootstrap for CiviCRM UI

This forum was archived on 2017-11-26.