dotProject Forums
Google
 

Go Back   dotProject Forums > DOTPROJECT VERSION 2 > Customisation Questions 2.x
Register FAQTop Posters Members List Calendar Search Today's Posts Resend Activation Email Mark Forums Read
dotProject Documentation dotProject FAQ Bugs & Feature Requests Language Packs & Themes Download dotProject

Customisation Questions 2.x How do you modify ..... for your own site

Reply
 
Thread Tools Display Modes
  #1  
Old 14-08-07, 08:39 PM
thehcdreamer thehcdreamer is offline
Junior Member
New Participant
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 14-08-07
Posts: 2
Default Adding field to new event form

Hello, i have added a field in the new event form

Code:
<td align="right"><?php echo $AppUI->_('Company');?>:</td>
<td>
<?php
	echo arraySelect( $companies, 'company_id', 'size="1" class="text"', @$obj->company_name );
?>
</td>
I have create the array that display value in the top of this file, with:

Code:
require_once( $AppUI->getModuleClass ('companies' ) );

$row = new CCompany();
$companies = $row->getAllowedRecords( $AppUI->user_id, 'company_id,company_name', 'company_name' );
$companies = arrayMerge( array( '0'=>'' ), $companies );
But i need only companies where type in the database is set to 1. Where can i set this?

Thanks

Reply With Quote
  #2  
Old 15-08-07, 10:16 AM
ajdonnison's Avatar
ajdonnison ajdonnison is offline
Administrator
Utter Fanatic
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 13-04-04
Posts: 2,112
Default Re: Adding field to new event form

$companies = $row->getAllowedRecords ($AppUI->user_id, 'company_id,company_name', 'company_name', array('where' => 'company_type = 1'));
__________________

http://www.saki.com.au/ - The driving force behind dotProject
Latest dotProject Release: 2.1.2 Download now
Nightly Stable 2 Snapshot
Reply With Quote
  #3  
Old 15-08-07, 08:56 PM
thehcdreamer thehcdreamer is offline
Junior Member
New Participant
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 14-08-07
Posts: 2
Default Re: Adding field to new event form

thanks! You are great!

Reply With Quote
  #4  
Old 21-07-10, 08:47 PM
mayureshwatharkar mayureshwatharkar is offline
Junior Member
Return Visitor
dotProject Version: 2.1.3
php Version: 5.2
MySQL Version: 5.2
Operating System Version: Windows
Browser: IE 8
 
Join Date: 13-07-10
Posts: 9
Send a message via Skype™ to mayureshwatharkar
Default Re: Adding field to new event form

Hello,

I want to add a new field named "countries" in the "new project". I tried to add this field just below the "companies" field. I have a made a seperate table for "countries", but I am not able to display the records from that table into the dropdown list. I have done everything same as that if companies for "countries"...

Reply With Quote
  #5  
Old 22-07-10, 01:08 AM
krad krad is offline
Valued Users
Return Visitor
dotProject Version: 2.1.3
php Version: 5.2
MySQL Version: 5.1
Operating System Version: Unix
Browser: Firefox
 
Join Date: 15-07-10
Posts: 12
Default Re: Adding field to new event form

do you mean you have a table with the list of countries which you want in a drop down list??

if so you would do the following:-

Select the information from your table
Code:
$query_Magazine = "SELECT * FROM contries ";
$options =db_exec( $query_Contries );
You could use the DBQuery funtions but to make find simple I have done it this way.

Next you need to loop the table out into a select list.

PHP Code:
<?php 
      
<select name="Contries_id">
          <?
php while ($row db_fetch_assoc$options )) { ?>
          <option value="<?php echo $row["contries_id"]?>"> <?php echo $row["Contries_name"]
?></option>
          <?php }?>
        </select>
So what you are doing is looping through the table and printing each option with a value of the field ID and the content of a field..

THe next step would be to select and option and send back the Contries_id back in an insert.. But you need to provied information about the relationship between the tables.

Hope this helps?

Reply With Quote
  #6  
Old 28-07-10, 07:16 PM
mayureshwatharkar mayureshwatharkar is offline
Junior Member
Return Visitor
dotProject Version: 2.1.3
php Version: 5.2
MySQL Version: 5.2
Operating System Version: Windows
Browser: IE 8
 
Join Date: 13-07-10
Posts: 9
Send a message via Skype™ to mayureshwatharkar
Default Re: Adding field to new event form

thanks Krad fro your information.

my next question is, I want to save this country_id as a column name in the table "projects". I am trying to figure out where exactly they are saving all other data in the table. How shall I do this?

Reply With Quote
  #7  
Old 29-07-10, 07:00 PM
ajdonnison's Avatar
ajdonnison ajdonnison is offline
Administrator
Utter Fanatic
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 13-04-04
Posts: 2,112
Default Re: Adding field to new event form

For each module there is a module.class.php file (where module is the name of the module), so if you wanted to manage what is being saved in projects, you would need to edit modules/projects/projects.class.php
__________________

http://www.saki.com.au/ - The driving force behind dotProject
Latest dotProject Release: 2.1.2 Download now
Nightly Stable 2 Snapshot
Reply With Quote
  #8  
Old 30-07-10, 06:22 PM
mayureshwatharkar mayureshwatharkar is offline
Junior Member
Return Visitor
dotProject Version: 2.1.3
php Version: 5.2
MySQL Version: 5.2
Operating System Version: Windows
Browser: IE 8
 
Join Date: 13-07-10
Posts: 9
Send a message via Skype™ to mayureshwatharkar
Default Re: Adding field to new event form

Thank you very much. In case of more queries, I will come back to you..

Reply With Quote
  #9  
Old 30-07-10, 08:30 PM
mayureshwatharkar mayureshwatharkar is offline
Junior Member
Return Visitor
dotProject Version: 2.1.3
php Version: 5.2
MySQL Version: 5.2
Operating System Version: Windows
Browser: IE 8
 
Join Date: 13-07-10
Posts: 9
Send a message via Skype™ to mayureshwatharkar
Default Re: Adding field to new event form

Thanks ajdonnison,
Now, what if, I want to display this newly saved field in the list of all projects (table)? Do I have to change modules/projects/in dex.php? Or which file do I have to change?

Reply With Quote
  #10  
Old 30-07-10, 09:21 PM
mayureshwatharkar mayureshwatharkar is offline
Junior Member
Return Visitor
dotProject Version: 2.1.3
php Version: 5.2
MySQL Version: 5.2
Operating System Version: Windows
Browser: IE 8
 
Join Date: 13-07-10
Posts: 9
Send a message via Skype™ to mayureshwatharkar
Default Re: Adding field to new event form

I tried to change page "admin_tab.viewuser.projects.php" for adding a column named "country" to projects list; but the changes were not reflected in the page. I do not understand which file is displaying the page of projects list.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +10. The time now is 08:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.