Search found 525 matches

by pböttcher
2019-08-21 18:13
Forum: Advanced Customizations > Hooks
Topic: format phone number input
Replies: 2
Views: 81

Re: format phone number input

Hi,

you can add a pattern to the input field.

e.g.

$j('#field').attr("pattern", '0[0-9] [0-9]{4} [0-9]{4}');
by pböttcher
2019-08-21 17:30
Forum: Advanced Customizations > Hooks
Topic: Getting Jquery to call Function In Hooks file
Replies: 9
Views: 617

Re: Getting Jquery to call Function In Hooks file

Hi, you need to show your field move_equiment in AppGini in the detail view, but hide it in you actual DV via jquery. You can try this. function pnb_user_dv($selectedID, $memberInfo, &$html, $data){ /* if this is the print preview, don't modify the detail view */ if(isset($_REQUEST['dvprint_x'])) re...
by pböttcher
2019-08-21 14:37
Forum: Getting Started
Topic: How: Change "border" of table depending on value?
Replies: 7
Views: 99

Re: How: Change "border" of table depending on value?

hmm, you have the value in your table, so you can just use the value, so some kind of substring extraction (like in your case, use the string between the "-" and the "/" and compare this value. The each(function() will go through each row, so old_text will have the text of the previous row which you...
by pböttcher
2019-08-21 14:00
Forum: Getting Started
Topic: How: Change "border" of table depending on value?
Replies: 7
Views: 99

Re: How: Change "border" of table depending on value?

Hi, you can use the hooks/TABLENAME-tv.js file and add something like $j(function(){ var old_text=""; $j('td.TABLENAME-platz').each(function(){ // platz is the field you show in the screenshot, so I assume that is the one you look for. var new_text = $j(this).text(); $compare="MAKE YOUR COMPARISON H...
by pböttcher
2019-08-21 13:36
Forum: Advanced Customizations > Hooks
Topic: Security, forced logout
Replies: 4
Views: 151

Re: Security, forced logout

Hi,

maybe you can call

Code: Select all

logOutUser();
This shall logout the current user.
by pböttcher
2019-08-20 20:24
Forum: Getting Started
Topic: pipe email to php script?
Replies: 4
Views: 66

Re: pipe email to php script?

Hi, can you check your settings on your php file. The file needs to have unix line endings. Can you check the php path. The php file needs to have the rights 755. I tried this in my environment and this worked just fine (needed to remove the appgini settings as I do not have appgini running in that ...
by pböttcher
2019-08-20 17:18
Forum: Getting Started
Topic: pipe email to php script?
Replies: 4
Views: 66

Re: pipe email to php script?

Hi,

what is your issue?

In your file you have a blank before php,

<? php

maybe you need to change it to

<?php
by pböttcher
2019-08-01 06:37
Forum: Advanced Customizations > Hooks
Topic: Editable default value problem
Replies: 10
Views: 202

Re: Editable default value problem

Hi,

thanks. So everything looks good. The issue could be that the script (on change) gets called bevor the dropdown is created. Can you try to change it to

$j('input[name="etu_sigle"]').on('change', function(){
by pböttcher
2019-07-31 09:20
Forum: Advanced Customizations > Hooks
Topic: Editable default value problem
Replies: 10
Views: 202

Re: Editable default value problem

Hi,

is the dropdown a lookup or a selection of values?
Can you post a screenshot with the debugger showing the dropdown definitions?
by pböttcher
2019-07-30 21:54
Forum: Advanced Customizations > Hooks
Topic: Editable default value problem
Replies: 10
Views: 202

Re: Editable default value problem

Hi,

hmmm, strange,

can you add an alert(sigid;) after the
var sigid = $j('input[name="etu_sigle"]').val();
and verify if that is the correct id?

If that is the correct id, can you run

select nbrhres from sigle where id= with the id you retrieved.

What is the result you get?
by pböttcher
2019-07-30 20:57
Forum: Advanced Customizations > Hooks
Topic: Editable default value problem
Replies: 10
Views: 202

Re: Editable default value problem

Hi,

sorry for my misunderstanding. If you need to ID, try instead

$j('input[name="etu_sigle"]').val()
by pböttcher
2019-07-30 20:24
Forum: Advanced Customizations > Hooks
Topic: Hide/show fields in Detail View
Replies: 12
Views: 185

Re: Hide/show fields in Detail View

Hi,

can you post a screenshot of the debugger showing the other_marriages name pls.
by pböttcher
2019-07-30 20:19
Forum: Advanced Customizations > Hooks
Topic: Editable default value problem
Replies: 10
Views: 202

Re: Editable default value problem

Hi,

try instead of

var sigid = $j('#etu_sigle').val();

var sigid = $j('#s2id_etu_sigle-container .select2-chosen').text();
by pböttcher
2019-07-30 19:56
Forum: Advanced Customizations > Others
Topic: Conditional Hide/Unhide fields in detail view?
Replies: 5
Views: 3161

Re: Conditional Hide/Unhide fields in detail view?

Hi, you can add to you hooks/TABLENAME.php tablename_dv function. if(isset($_REQUEST['dvprint_x'])) return; ob_start(); ?> <script> $j(function(){ if ($j("#field2 option[value=texttocheckfor]:selected").length == 0){ $j("label[for='field3']").parent().hide(); } /* hide some stuff according to the al...
by pböttcher
2019-07-30 19:38
Forum: Advanced Customizations > Hooks
Topic: Hide/show fields in Detail View
Replies: 12
Views: 185

Re: Hide/show fields in Detail View

Additional to your question.

The

if(isset($_REQUEST['dvprint_x'])) return;

is just used if you try to print the page, as the logic does not necessarily apply. If it does for you, you can leave it out.
by pböttcher
2019-07-30 19:34
Forum: Advanced Customizations > Hooks
Topic: Calculation Hook for reducing balance automatically
Replies: 16
Views: 294

Re: Calculation Hook for reducing balance automatically

Thanks, can you try this: function Consumable_Tools_after_insert($data, $memberInfo, &$args){ $new_qty=sqlvalue("SELECT IFNULL(i.Stock_QTY,0)-{$data['Qty_Issued']} from Inventory i where i.InventoryID = {$data['Item']}"); sqlvalue("UPDATE Inventory i set i.Stock_QTY = {$new_qty} where i.InventoryID ...
by pböttcher
2019-07-30 18:41
Forum: Advanced Customizations > Hooks
Topic: Hide/show fields in Detail View
Replies: 12
Views: 185

Re: Hide/show fields in Detail View

Hi,

glad to see that it works half :-).

Sorry i forgot to mention that you need to change the marriage to name of your radio buttons. I guess it is Other_Marriages, but not sure.
You can check it through the development console and have a look at your radio buttons.
by pböttcher
2019-07-30 09:28
Forum: Advanced Customizations > Hooks
Topic: Hide/show fields in Detail View
Replies: 12
Views: 185

Re: Hide/show fields in Detail View

Just to add to my post, in the case statements you need of course to put your data instead of none, 1,2,3 reflecting your checkbox criteria.
by pböttcher
2019-07-30 09:13
Forum: Advanced Customizations > Hooks
Topic: Hide/show fields in Detail View
Replies: 12
Views: 185

Re: Hide/show fields in Detail View

Hi, you can try to put this in your Marriages.php Marriages_dv function : if(isset($_REQUEST['dvprint_x'])) return; ob_start(); ?> <script> $j(function(){ /* hide some stuff according to the already checked entry*/ if ($j("input#other_marriages2").is(":checked")) { $j("label[for='Marriage_2']").pare...
by pböttcher
2019-07-29 21:08
Forum: Advanced Customizations > Hooks
Topic: Calculation Hook for reducing balance automatically
Replies: 16
Views: 294

Re: Calculation Hook for reducing balance automatically

Hi, can you try $new_qty=sqlvalue("SELECT IFNULL(i.Stock_QTY-{$data['Qty_Issued']},0) from Inventory i where i.InventoryID = {$data['Stock_QTY']}"); sqlvalue("UPDATE Inventory i set i.Stock_QTY = {$new_qty} where i.InventoryID ={$data['Stock_QTY']}"); Are you having data in your inventory table?
by pböttcher
2019-07-29 17:44
Forum: Advanced Customizations > Hooks
Topic: Calculation Hook for reducing balance automatically
Replies: 16
Views: 294

Re: Calculation Hook for reducing balance automatically

Hi,

what is the link (lookup) from the Consumable_Tools to the Inventory? Is it the item?
by pböttcher
2019-07-29 16:04
Forum: Advanced Customizations > Hooks
Topic: Calculation Hook for reducing balance automatically
Replies: 16
Views: 294

Re: Calculation Hook for reducing balance automatically

Hi, put the code inside the function, like this. function Consumable_Tools_after_insert($data, $memberInfo, &$args){ $new_qty=sqlvalue("SELECT i.Stock_QTY-{$data['Qty_Issued']} from Inventory i where i.InventoryID = {$data['Stock_QTY']}"); sqlvalue("UPDATE Inventory i set i.Stock_QTY = {$new_qty} wh...
by pböttcher
2019-07-29 14:44
Forum: Advanced Customizations > Hooks
Topic: SUM OF COLUMN
Replies: 9
Views: 241

Re: SUM OF COLUMN

Hi, could it be that the values you try to retrieve from the table entrees ond/or sorties do not exist yet? If so, try the SQL with $total_entrees = sqlValue("SELECT IFNULL(total_tous_entree,0) FROM entrees WHERE matricule = '$id' "); $total_sorties = sqlValue("SELECT IFNULL(total_tous_sortie,0) FRO...
by pböttcher
2019-07-29 14:36
Forum: Advanced Customizations > Hooks
Topic: Calculation Hook for reducing balance automatically
Replies: 16
Views: 294

Re: Calculation Hook for reducing balance automatically

Hi,

can you post the complete function as you have it now. And a screenshot of the Consumable_Tools Stock_QTY defintion in AppGini
by pböttcher
2019-07-28 21:11
Forum: Advanced Customizations > Hooks
Topic: Calculation Hook for reducing balance automatically
Replies: 16
Views: 294

Re: Calculation Hook for reducing balance automatically

Hi, you can do this in the hooks/Consumable_Tools.php file. In the after_insert, after_update and bevor_delete function you need to add you calculation. so, eg. in the after_insert function you can try $new_qty=sqlvalue("SELECT i.Stock_QTY-{$data['Qty_Issued']} from Inventory i where i.id = {$data['...