i want to select multiple files at once, but only ONE File always shows up in the MultiFile-list Div container with the possibility to delete it. But i want to shop up all the files i selected.
What am i doing wrong?
$this->widget('CMultiFileUpload', array(
'model' => $gallery,
'name' => 'attachments',
'accept' => 'jpg|png',
'denied' => 'Only doc,docx,pdf and txt are allowed',
'max' => 100,
'duplicate' => 'Already Selected',
'options'=>array(
),
'htmlOptions' => array('multiple' => 'multiple', 'size' => 25)
)
);
CMultiFileUpload is based on jQuery Multiple File Upload Plugin ($.MultiFile) . On it's site we can read:
What this isn't
This plugin will not create a dialog that allows the user to select multiple files at once. That simply cannot be done via javascript. If that's what you need, you should consider using HTML5's multiple="multiple" attribute or one of the many other flash based file upload solutions (eg.: SWFupload, uploadify and others)
So probably the built in widget isn't what you are looking for. Xupload yii extension, on the other hand might be what you are looking for.
Related
I'm completing a module that concerns the registration of new users.
Now, my module creates a table in the db that has an id field and an id_usergoup field.
On the configuration page, I would like to see the box with all the user groups available.
The user can select some and their id goes to write in my table. Similarly, in the box I have to see selected ones already chosen (if there are).
How can I make the box with user groups with HelperForm?
And take select the values already chosen and saved in my table?
I hope in your suggestion. Thank you.
In the array for the inputs, you can generate the customer group with this code:
array(
'type' => 'group',
'label' => $this->l('Customer group'),
'name' => 'groupBox',
'required' => true,
'values' => Group::getGroups((int)$this->context->language->id),
'hint' => $this->l('Customer group for which this tab will be available.'),
)
And you can get the selected values with: Tools::getValue('groupBox');
Regards!
Im making a multi shop module, the module saves / adds to the modules shop tables etc.
This part is fine.
I just have an issue with the GUI its missing the Group names, to me it looks like I'm missing something for a sprintf() I just see the %s and not the group name.
The image shows what I mean.
In my renderform function I have added.
if (Shop::isFeatureActive())
{
$this->fields_form['input'][] = array(
'type' => 'shop',
'label' => $this->l('Shop association'),
'name' => 'checkBoxShopAsso',
'values' => Shop::getTree()
);
}
I wonder do i need to add anything else? all of the other modules I have look fine.
Thanks.
** Updated **
Have just found the template, it is the sprintf() that is not working because if i relace the line it works fine.
{*<label class="tree-toggler">{l s='Group: %s' sprintf=$node['name']}</label>*}
<label class="tree-toggler">{$node['name']}</label>
Any Ideas?
Thanks.
Is there a way I can access my project under Sandbox? I'm able to use the lookup method, find in order to fetch all the features from a project under the Yahoo! subscription, but how would I be able to do this for projects under Sandbox?
In your PHP code have you used Rally sandbox server URL?
https://sandbox.rallydev.com/
Here is a WebServices URL specific to Sandbox:
https://sandbox.rallydev.com/slm/doc/webservice/
I was able to figure it out. In the query to find specific features, I had to include the query parameter "workspace" to the sandbox reference which is (for 1.43) : "https://rally1.rallydev.com/slm/webservice/1.43/workspace/7189290105.js". I included the reference of the project as well which directly fetched all the features for my project. In addition, if you seek to only fetch features from your specific project and not from the ones on top of it, you have to include the "pageScopeUp" field into the query. You have to set this field to false:
$queryParams = array(
'query' => "",
'fetch' => 'true',
'pagesize' => 100,
'start' => 1,
'workspace' => "https://rally1.rallydev.com/slm/webservice/1.43/workspace/7189290105.js",
'project' => "whatever the project reference is",
'projectScopeUp' => false
);
$results = Connection::rally()->findWithQueryParameters('feature',
$queryParams);
I've got the following problem. I built a PHP file, which reads categories from a file, to impor tthem into Magento. I am able to read the file, no problem. The connection via NuSOAP to the Magento API works aswell. I can get the SessionID and I am able to get data, like Information for a category, also its possible to delete categories.
But, whenever I try to create or update anything, it throws an error. The rights for the user are ok aswell. For example, when I create a category, I add the usual data to the call:
$proxy->call(
$sessionId,
'category.create',
$rootCategory, array(
'name' => "TEST",
'is_active' => '1',
'page_layout' => 'two_columns_right',
'description' => "TEST",
'meta_title' => "TEST",
'meta_description' => '',
'meta_keywords' => "TEST",
'include_in_menu' => '0',
'display_mode' => 'PRODUCTS',
'available_sort_by' => 'price',
'default_sort_by' => 'price',
'is_anchor' => '0'
)
);
All the time, it says:
(
[faultcode] => 102
[faultstring] => Category not exists. )
Which is not true. The $rootCategory is definatly a category, which is existing. I tried all other categories, I tried to add a 'path' to the info, I tried to use less information (only the neccesary stuff), I tried to read existing categories to get their IDs, NOTHING works. It always throws this faultcode.
Same happens, when I try to update a category, or create /update a product. Deleting is no problem at all.
Do you see the problem?
i just compared your NON working exemple and i found this while comparing it with another exemple i has ( i do not pretent to be expert ) ..
but seems like your $new_category, array(blahblha) ...
should be INSIDE an array according to the exemple i already have
like this array($new_category,array(blahblah) ...
this is the mains difference i just saw ..
here is the EXEMPLE i just pulled out of the web ... Adapt to your needs..
$proxy->call(
$sessionId,
'category.create',
array(
3,
array(
'name'=>'New openerp',
'is_active'=>1,
'include_in_menu'=>2,
'available_sort_by'=>'position',
'default_sort_by'=>'position')) );
Have you tried specifying the category_id key in your $rootCategory within the call:
$selectedCategory['category_id'],
array('name'=>'New Category Through Soap')
)
Reference: http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_category
We are currently using the Magento API for importing a bunch of products into the store.
But we now run into a problem where some product attributes should be translated into a different language.
And I was wondering if it is possible to do this using the Magento API, because I can't seem to find anything related to that problem.
We currently have 2 store views, 1 for the Dutch version of the site and one for the French version of the site.
Our current import code looks something like this:
$store_id = $soapClient->call($soapSession, 'catalog_product.currentStore', array('nl'));
echo("store_id: $store_id");
$new_product_data = array(
'name' => 'NameInDutch',
'short_description' => 'DescriptionInDutch',
'price' => $price,
'weight' => $weight,
'websites' => array('base'),
'status' => '1'
);
$new_product_id = $soapClient->call($soapSession, 'catalog_product.create', array('simple', 4, $sku, $new_product_data)); // 4 => 'Default' attribute set
$localized_product_data = array(
'name' => 'NameInFrench',
'short_description' => 'DescriptionInFrench'
);
$store_id = $soapClient->call($soapSession, 'catalog_product.currentStore', array('fr'));
echo("store_id: $store_id");
$soapClient->call($soapSession, 'catalog_product.update', array($sku, $localized_product_data ));
Now, the output of the echo statements differs, the first time it's 1 and the second time it's 2, so that doesn't seem to be problem. But apparently it doesn't matter for the API if we set that value.
The result is that on the 'catalog_product.update' call, the name 'NameInFrench' overwrites the default name 'NameInDutch'.
So my question is if something like this is possible using the Magento API, and how one would accomplish this?
Ok, I found the answer, apparently I overlooked a certain line in the Magento API docs, because the solution was right there.
So: you don't need to set the currentStore each time, you just need to append the store id or code to the update array:
$soapClient->call(
$soapSession,
'catalog_product.update',
array($sku, $localized_product_data, 'fr')
);
This works perfectly.