Add Location/Building name to Incidents Display?

91 views
Skip to first unread message

David Russell

unread,
Jul 7, 2022, 9:59:13 AM7/7/22
to Open Source CAD
For our events almost every type of incident is a named location and addresses are of little use. I have added a place as a building and I can select it when creating the incident, but the incident display on the situation screen shows the address. I'd like to change the MySQL query so it will return the columns I prefer, but I can't seem to find where in all of the PHP pages this is. Can someone point me there?

2022-07-07_8-46-15.png

David Russell

unread,
Jul 7, 2022, 4:53:46 PM7/7/22
to Open Source CAD
For anyone interested I finally found it. 

/ajax/sit_incidents.php on line 180

Changed "streets" to "address_about".

Matt Miller

unread,
Jul 7, 2022, 4:56:29 PM7/7/22
to open-so...@googlegroups.com
Just curious, what would happen if there was no data entered in the “address_about”, would it just show as something blank, or would it revert to the address line?

I’d be interested in making that change as long as it could be instructed to revert to the other if the one is blank.

--
You received this message because you are subscribed to the Google Groups "Open Source CAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-source-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-source-cad/d6d63ef9-9fbb-44a9-925f-24943ecad755n%40googlegroups.com.

David Russell

unread,
Jul 7, 2022, 5:05:51 PM7/7/22
to Open Source CAD
It would currently be blank, but that's a good idea. The SQL is easy, but I need to do it in the PHP syntax already being used here. I'll tackle that in the morning, because that's a good idea.

David Russell

unread,
Jul 7, 2022, 5:09:22 PM7/7/22
to Open Source CAD
And if you want to increase the number of characters displayed look in the same file line 238.

Where I have the number 45, the default is 20 (Characters). You can change it to whatever works for you.

$address_street=htmlentities(shorten(stripslashes($row['ticket_street'] . " " . $row['ticket_city']), 45), ENT_QUOTES);

David Russell

unread,
Jul 8, 2022, 12:21:50 PM7/8/22
to Open Source CAD
Here is line 180 to put both the address_about and the street address together. There is a space between the 'address_about' and 'street'. If one of the fields is blank it just won't be there.

If you want a dash or other separator put it between the 1st 2 single quotes. Such as this if you want a - between them.  CONCAT_WS('-',

             CONCAT_WS(' ',`$GLOBALS[mysql_prefix]ticket`.`address_about`,`$GLOBALS[mysql_prefix]ticket`.`street`) AS ticket_street, 

I also changed the length to 60 on line 238

            $address_street=htmlentities(shorten(stripslashes($row['ticket_street'] . " " . $row['ticket_city']), 60), ENT_QUOTES);

Capture.PNG

Arnie Shore

unread,
Jul 10, 2022, 7:10:51 AM7/10/22
to Open Source CAD
To David Russell, thanks for sharing your work here.

All, do you see any better support for the idea of Open Source?  Imagine what you would have to go through if Tix were a proprietary package.

AS

SO-CM

unread,
Oct 10, 2022, 9:53:15 PM10/10/22
to Open Source CAD
I tried this and I just get a message saying "error loading incidents"

David Russell

unread,
Oct 11, 2022, 10:56:07 AM10/11/22
to Open Source CAD
You'll have to troubleshoot the SQL somewhere. The error message will usually tell you more details.
Reply all
Reply to author
Forward
0 new messages