View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Accessing the objects which are made of classes - ProjeQtOr
 
 

Accessing the objects which are made of classes

More
07 Apr 2016 15:47 - 07 Apr 2016 19:06 #1 by keloniton
Hello Dear Mr Babynus,
i am trying to access the the month field of Expense object which is made of model/Expense.php. In order to do this, in tool/saveobject i add the following code. But it does not work. Can you help me to understand the problem:

if ($className == "Expense") { //first i check whether the class is Expesne or not
$equilgregoriandate= gregorian_to_jalali( substr($newObj->day,0,4) , substr($newObj->day,4,2) , substr($newObj->day,6,2)); //I get the jalali date of the day field
if ($equilgregoriandate[1]<10) { //i check if the date is in correct format
$equilgregoriandate[1]='0'.$equilgregoriandate[1];
}
if ($equilgregoriandate[2]<10) { //i check if the date is in correct format
$equilgregoriandate[2]='0'.$equilgregoriandate[2];
}
$newObj->month = jdate('Ym',jmktime(0,0,0,$equilgregoriandate[1],$equilgregoriandate[2],$equilgregoriandate[0]),'','','en'); //i replace the month field with another string;
}
There is no error, but it does not work when i check the Expense table in Phpadmin.
Thank you
Last edit: 07 Apr 2016 19:06 by keloniton.

Please Log in or Create an account to join the conversation.

More
08 Apr 2016 22:41 #2 by babynus
The implementation in the saveObject in not good.
You should instead implement your code in the save() functin of the Expense object.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.043 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.