SugarCRM ent 6, Android 2.2
For a demonstration purpose of this functionality, we will have our own module we build using module builder called Mobilni and in that module we added a field type Image named slika. After that we added that field to EditView and DetailView in mobile version of views.
After that it is necesary to change wireless.editviewdefs.php from out module and to change code which will enable us that on editview image is not shown but a field with a button to select a file(picture) we wish to upload.
Inside code we find the next data for a field we added and make it look like this, so we add customCode tag:
array (
'name' => 'slika',
'studio' => 'visible',
'label' => 'LBL_SLIKA',
//my code
'customCode' => '<input type="file" id="slika" name="slika" title="" size="30" maxlength="255" value="" tabindex="0" style="">'
),
After this change, when we edit a record we will see a button/browse enabled to select a photo for upload.
We need to change one more thing, and this change is not upgrade safe so keep that in mind. We need to tell sugar that out form will be transferring data so the form tag needs to include enctype='multipart/form-data'
To do this we need to edit file /include/SugarWireless/tpls/wirelessedit.tpl and change the form tag so it is like <form action="index.php" enctype='multipart/form-data' method="POST">
Also keep in mind that i removed js validation of file extension so if you select a file that is not picture it will still upload and maybe make problems for you.
Be good!


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks