:-[] :-|| Vivek Khokhar rambles here :-O :-[]

January 23, 2007

PHP / Windows Task scheduling from command prompt

Filed under: php, windows — Vivek Khokhar @ 12:11 am

schtasks /create /tn “My Scheduled Jobs” /tr “php-win.exe D:\Program Files\xampp\htdocs\somefile.php” /sc minute

make sure that php-win.exe is in path while giving this command

March 20, 2006

WickEnable Sugar

Filed under: sugar, php — Vivek Khokhar @ 3:10 pm

The purpose of this patch is to provide Dropdowns just like Google suggest, capability of using Dropdowns defined in sugar language, and or from a specific field of some some table in the database(not dynamic yet I am working on it).

Is it ajax ??

No. Its not.. simply because there is no need of that here, and I believe in doing whats best. Most of the Language arrays are static(less frequently updated)
Yes, I am working on Ajax Part it.. for fetching data from database(more frequently updated). for now there is a workaround for that, not truly real-time, but can be used in most of the cases.(Serves my purpose right now)
How to use it?

Download the file(WickEnablePatch For Sugar 4.0.1e) and apply it to your sugar installation via Upgrade WIzard (not module loader).

After Applying the patch above, Go To admin panel -> Repair -> Rebuild Wick Collection . This will Rebuild the collection.js file by putting all language arrays (mostly Dropdowns) from Language files.

If you want to use a values from a database table, just edit the vardef.php of the corresponding module as follows:

for example: If you wish to use Accounts->name as a dropdown, just edit vardef.php of Accounts. to make following changes

$dictionary[‘Account’] =

array(‘table’ => ‘accounts’,
‘audited’=>true,
‘fields’ => array (

‘name’ =>
array (   ‘name’ => ‘name’,
‘type’ => ‘name’,
‘wickEnabled’=>true, //add this item to every fielddef for which you want a dropdown
‘dbType’ => ‘varchar’,
‘vname’ => ‘LBL_NAME’,
‘len’ => 150,
),

….

….

After this again run admin panel -> Repair -> Rebuild Wick Collection. This will create a collection(array) in collection .js with accounts_name (tablename_fieldname)

Ok Collection is made now.. How to use it in HTML.. Very simple..

Open the HTML file where you wish the dropdown to show up. Lets say EditView.html of Contacts module. Lets make a text field for demo… lets say
input type=”text” class=”wickEnabled” collection=”account_name”
Thats it.. your drop down is ready. Now Save this template, and fire your browser. Try typing something in the field you just created. If there are accounts in your database they will populate the drop down as you type

In case of dropdowns from language files just change the collection name to some existing dropdown array name for example document_category_dom: collection=”document_category_dom” class=”wickEnabled”

Go to AdminPanel and Browse DropDown Editor.. for more better examples.

Thats all.

Main poins to remember:

- dont forget to rebuild collection after making changes to vardefs/language dropdown files.

- dont forget to add collection=”ur_collection_name” class=”wickEnabled” to your text boxes.

Questions are welcome..

Powered by WordPress