evanmsanders / flex2sms

Web front-end to SACFS flex2sms system.
1 stars 0 forks source link

capcode-functions.js has an absolute path on line 6 #61

Closed mazzone closed 11 years ago

mazzone commented 11 years ago

This is the URL to the ajax call page. We either need to change this when deployed, or work out some way to make it dynamic...

mazzone commented 11 years ago

And now also on line 41.

evanmsanders commented 11 years ago

Is this only ever being called from the services add view? If so:

  1. It could probably go straight into the view rather than being included.
  2. It could be a relative path e.g '../../js/capcode-functions.js' from that page's path (/services/add)

If it needs including in other places as well, then we'll have to work out some other way to do it. Maybe create a CakePHP 'element' (like a mini-view) which generates js?

mazzone commented 11 years ago

It gets called from the add and edit views of Services and Contacts, which means you can't use a relative path (because it can be either /services/add or /services/edit/13).

We could possibly also set a javascript variable on each page that calls it that contains the correct path?