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 (Moderator: Donald Lobo) »
  • Using the taglist style of the "contact" page for the "new contact" page
Pages: [1]

Author Topic: Using the taglist style of the "contact" page for the "new contact" page  (Read 1431 times)

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Using the taglist style of the "contact" page for the "new contact" page
August 22, 2014, 01:54:15 am
Hello,

I think the overview of tags is way better on the page for an existing contact (in the "Tags" tab) than when you are creating a new contact...
screenshot: existing contact page vs. new contact page

Is it possible to use the list style for the new contact page?
What would be the best way? (I think it should be implemented like that in the normal CiviCRM either way)

Thanks in advance,
TeNNoX :)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Using the taglist style of the "contact" page for the "new contact" page
August 22, 2014, 03:46:08 am
Hey there,

Implementing this 'in the normal CiviCRM' seems like a good idea. Can't tell if you are a coder or not. If so, you could have a go at implementing it (get started here: http://wiki.civicrm.org/confluence/display/CRMDOC/GitHub+for+CiviCRM) and if not, you could get/pay someone else to do it (e.g. one of these: https://civicrm.org/providers/partners or your current partner).

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using the taglist style of the "contact" page for the "new contact" page
August 22, 2014, 04:56:14 am
Quote from: Michael McAndrew on August 22, 2014, 03:46:08 am
Hey there,

Implementing this 'in the normal CiviCRM' seems like a good idea. Can't tell if you are a coder or not. If so, you could have a go at implementing it (get started here: http://wiki.civicrm.org/confluence/display/CRMDOC/GitHub+for+CiviCRM) and if not, you could get/pay someone else to do it (e.g. one of these: https://civicrm.org/providers/partners or your current partner).

Michael

Well I can code it myself, but I have almost no experience with CiviCRM coding, so I would need some point to start (Which hooks can I use for that?)...
Can't I just change the template?
A question to that: where are the variables like $tree or $form getting defined for the templates?! It's really hard for me to understand how the Smarty stuff works
« Last Edit: August 22, 2014, 07:38:22 am by TeNNoX »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using the taglist style of the "contact" page for the "new contact" page
August 25, 2014, 06:55:14 am
It's complicated.

In essence, CiviCRM's forms are simple. They all extend CRM_Core_Form which extends Quickform_Page, etc. And they all have the same name as their respective templates (but .php instead of tpl, and in the CRM folder instead of templates). So to answer your question, a variable in the template is provided by an assign() call in a php file of the same name.

BUT in this particular case it's gotten messy. The same form code is being used in multiple contexts including front-end profiles, and so there are a bunch of hard-to-understand conditionals in the form function as well as the template. AND quickform handles checkboxes differently than multiselects in that the array keys matter for one but array values matter for the other (that really bugs me, makes swapping out widgets a big pita).
Try asking your question on the new CiviCRM help site.

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
NEARLY WORKING
August 28, 2014, 02:31:59 am
I put a lot of work in it and it finally looks like it should... but the problem is: the tags are not getting saved!!
I tried to name every element the same and I tried to use the same ids for the html elements and everything.

Here are the source files:
TagsAndGroups.tpl: http://pastebin.com/qrxUjGFA
TagsAndGroups.php: http://pastebin.com/YwAfqVKt

Even the html POST data is the same (except of the numbers):
https://www.diffchecker.com/dnpdydfc

Can someone please look at it and maybe you find the little mistake that I'm searching for hours...

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using the taglist style of the "contact" page for the "new contact" page
August 28, 2014, 09:28:38 am
It looks like you've copied and pasted in some old code, using a version of CiviCRM earlier than 4.5.

I understand that it may feel a little intimidating, but getting yourself set up with a proper development environment where you can create real pull-requests will help you and also help us to help you. Dumping an entire file into pastebin is nearly impossible for us to work with. A patch would be better, and a real pull-request much better still.

It's actually not that hard. There is an automated tool that can spin up a complete developer environment for you in just a few strokes of the keyboard. Find instructions here: https://github.com/civicrm/civicrm-buildkit
Try asking your question on the new CiviCRM help site.

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using the taglist style of the "contact" page for the "new contact" page
August 29, 2014, 02:17:41 am
Quote from: Coleman Watts on August 28, 2014, 09:28:38 am
It looks like you've copied and pasted in some old code, using a version of CiviCRM earlier than 4.5.

I understand that it may feel a little intimidating, but getting yourself set up with a proper development environment where you can create real pull-requests will help you and also help us to help you. Dumping an entire file into pastebin is nearly impossible for us to work with. A patch would be better, and a real pull-request much better still.

It's actually not that hard. There is an automated tool that can spin up a complete developer environment for you in just a few strokes of the keyboard. Find instructions here: https://github.com/civicrm/civicrm-buildkit

Yes, I used the code from the 4.4.6 installation I have, because I wanted to have the changes in this environment...
But I will retry it with a proper developement environment.

And then? Should I create a patch? And what should I do with that patch?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using the taglist style of the "contact" page for the "new contact" page
August 29, 2014, 02:23:50 am
The first thing to do is to get yourself a gihub.com username.
Then go to https://github.com/civicrm/civicrm-core and click on "fork" to make your own copy of the project.
Once you've set up your local development environment using the civicrm buildkit, you can push changes to your fork and create a pull-request.

Have you read the instructions here? https://github.com/civicrm/civicrm-buildkit
Try asking your question on the new CiviCRM help site.

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using the taglist style of the "contact" page for the "new contact" page
September 04, 2014, 03:03:20 am
Quote from: Coleman Watts on August 29, 2014, 02:23:50 am
The first thing to do is to get yourself a gihub.com username.
Then go to https://github.com/civicrm/civicrm-core and click on "fork" to make your own copy of the project.
Once you've set up your local development environment using the civicrm buildkit, you can push changes to your fork and create a pull-request.

Have you read the instructions here? https://github.com/civicrm/civicrm-buildkit

Shouldn't I only create a pull request, if the changes are working?
I created a fork now: (branch bettertagoverview)
https://github.com/TeNNoX/civicrm-core/tree/bettertagoverview

Can you now take a look?
Sorry for the complications, I'm new to creating forks and stuff :)

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using the taglist style of the "contact" page for the "new contact" page
September 08, 2014, 03:23:42 am
Quote from: TeNNoX on September 04, 2014, 03:03:20 am
Quote from: Coleman Watts on August 29, 2014, 02:23:50 am
The first thing to do is to get yourself a gihub.com username.
Then go to https://github.com/civicrm/civicrm-core and click on "fork" to make your own copy of the project.
Once you've set up your local development environment using the civicrm buildkit, you can push changes to your fork and create a pull-request.

Have you read the instructions here? https://github.com/civicrm/civicrm-buildkit

Shouldn't I only create a pull request, if the changes are working?
I created a fork now: (branch bettertagoverview)
https://github.com/TeNNoX/civicrm-core/tree/bettertagoverview

Can you now take a look?
Sorry for the complications, I'm new to creating forks and stuff :)

*PUSH*

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Using the taglist style of the "contact" page for the "new contact" page
September 09, 2014, 01:22:29 am
Quote
Shouldn't I only create a pull request, if the changes are working?
I think the point is that if you create a pull request, it fits with the standard workflow and gets your code in the queue for review so others to take a look at where you are, and help you.  Otherwise it is for people easy to forget about it if it is just a post on the forum.

I'm pretty sure it is fine to have pull requests that are a work in progress.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using the taglist style of the "contact" page for the "new contact" page
September 21, 2014, 04:16:33 pm
Quote from: Michael McAndrew on September 09, 2014, 01:22:29 am
Quote
Shouldn't I only create a pull request, if the changes are working?
I think the point is that if you create a pull request, it fits with the standard workflow and gets your code in the queue for review so others to take a look at where you are, and help you.  Otherwise it is for people easy to forget about it if it is just a post on the forum.

I'm pretty sure it is fine to have pull requests that are a work in progress.

Sorry for taking so long...
I fixed the problem by myself, and here's the pull request:
https://github.com/civicrm/civicrm-core/pull/4195

Have I done this pull request stuff right?
Which branch should I submit pull requests against?

Thanks :)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Using the taglist style of the "contact" page for the "new contact" page
September 22, 2014, 01:59:27 am
Looks like there are 2 PR's

https://github.com/civicrm/civicrm-core/pull/4194
https://github.com/civicrm/civicrm-core/pull/4195

Which one is correct or we need both?

Quote
Have I done this pull request stuff right?
Which branch should I submit pull requests against?

Please submit the PR against master branch. Can you also ensure that there are no fake merge commits in your PR.
and do file an issue in issue tracker for this feature.

If you have issue creating PR, feel free to contact us on #civicrm irc channel

HTh
Kurund

Found this reply helpful? Support CiviCRM

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using the taglist style of the "contact" page for the "new contact" page
September 22, 2014, 10:19:37 am
Quote from: Kurund Jalmi on September 22, 2014, 01:59:27 am
Looks like there are 2 PR's

https://github.com/civicrm/civicrm-core/pull/4194
https://github.com/civicrm/civicrm-core/pull/4195

Which one is correct or we need both?

Please submit the PR against master branch. Can you also ensure that there are no fake merge commits in your PR.
and do file an issue in issue tracker for this feature.

If you have issue creating PR, feel free to contact us on #civicrm irc channel

HTh
Kurund

I got some support in the IRC, here's the clean, merged PR:
https://github.com/civicrm/civicrm-core/pull/4207

Here's the Improvement in the issue tracker:
https://issues.civicrm.org/jira/browse/CRM-15180

Thanks :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Using the taglist style of the "contact" page for the "new contact" page

This forum was archived on 2017-11-26.