Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Reproduce the same ...
 
Notifications
Clear all

Reproduce the same event than on ticket's page

4 Posts
2 Users
0 Reactions
4,084 Views
Antoine
(@eb0z)
Posts: 14
Active Member
Topic starter
 
[#930]

Hi Babynus,
I am looking for something.
I would reproduce the behaviour that is on Tickets' page (CF screenshot)

You fill automatically fields up with dates when we change the status or even when we click on the checkbox.

In fact, I would do the same for Document's page. I have added 2 fields (input text, readonly) and I would fill them up with the status changes.

Where can I find the function which is used for the tickets' page ?
Or how can I do that ?

Thank you.


 
Posted : 29 Jan 2013 18H57
(@babynus)
Posts: 14952
Member Admin
 

Check the function getValidationScript($colName) in Ticket.php and in SqlElement.php...


 
Posted : 29 Jan 2013 21H57
Antoine
(@eb0z)
Posts: 14
Active Member
Topic starter
 

Hi Babynus thank you for your reply,
I have tried with this code in SqlElement.php but it does not work.

 if ($colName=="idStatus") {
      $colScript .= '';
			[..........]
 
    // Ajout automatique de la date dans le champ internalValidation
      if(property_exists($this, 'internalValidation')) {
      	
      	$colScript .= htmlGetJsTable('Status', 'setInternalValidation', 'tabInternalValidation');
      	$colScript .= '  var setValidationInternal=1;';
        $colScript .= '  var filterInternalValidation=dojo.filter(tabInternalValidation, function(item){return item.id==dijit.byId("idStatus").value;});';
        $colScript .= '  dojo.forEach(filterInternalValidation, function(item, i) {setValidationInternal=item.setInternalValidation;});';
      	$colScript .= '  	if(setValidationInternal==1){';
        $colScript .= '      	var curDate = new Date();';
        $colScript .= '     	dijit.byId("internalValidation").set("value", curDate);';
        $colScript .= '		}';      
      }
		[..............................]
      $colScript .= '  formChanged();';
      $colScript .= '';
    } else if ($colName=="idle") {   
	
		[....................]

The thing is that I think it does not execute the javascript code I made.
If I write the command :

dijit.byId("internalValidation").set("value", curDate);

directly in the javascript's console in the browser, it changes the input's value. But not working with the $colScript...

Thank you.


 
Posted : 30 Jan 2013 17H00
(@babynus)
Posts: 14952
Member Admin
 

1) Check the code that you return.
=> try a debugLog on $colScript

2) use web console to debug your javascript code


 
Posted : 31 Jan 2013 0H43
Share:

Scroll to Top