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

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

Accessing the objects which are made of classes

More
07 Avr 2016 15:47 - 07 Avr 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 Avr 2016 19:06 by keloniton.

Please Connexion or Create an account to join the conversation.

More
08 Avr 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 Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.034 seconds

Paramétrages de cookies

×

Cookies fonctionnels

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

Veuillez vous connecter pour voir vos activités!

Autres cookies

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