Forum

Reproduce the same ...
 
Notifications
Retirer tout

Reproduce the same event than on ticket's page

4 Posts
2 Utilisateurs
0 Reactions
4,083 Vu
Antoine
(@eb0z)
Posts: 14
Active Member
Début du sujet
 
[#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.


 
Posté : 29 Jan PM 18:011
(@babynus)
Posts: 14952
Membre Admin
 

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


 
Posté : 29 Jan PM 21:011
Antoine
(@eb0z)
Posts: 14
Active Member
Début du sujet
 

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.


 
Posté : 30 Jan PM 17:011
(@babynus)
Posts: 14952
Membre Admin
 

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

2) use web console to debug your javascript code


 
Posté : 31 Jan AM 00:011
Share:
Retour en haut