Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax On/Off for product tosell and tobuy #1955

Merged
merged 9 commits into from
Oct 18, 2014
Merged

Conversation

frederic34
Copy link
Contributor

No description provided.


if ($user->rights->produit->creer) {
if ($action == 'set' && $name== 'status') {
$sql = "UPDATE llx_product SET tosell=1 WHERE rowid=".$id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use this :

$object = new GenericObject($db);
if ($action == 'setStatusBuy')
$object->setValueFrom('tobuy', $value, 'product', $id);
else if ($action == 'setStatusSell')
$object->setValueFrom('tosell', $value, 'product', $id);

and use :

$.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", {
action: '$code',
value: 1, // 1 for set and 0 for del
id: ''.$id.'',
entity: ''.$entity.'' // you use product rowid, pas besoin de l'entité
},

eldy added a commit that referenced this pull request Oct 18, 2014
Ajax On/Off for product tosell and tobuy
@eldy eldy merged commit 97f98d7 into Dolibarr:develop Oct 18, 2014
@frederic34 frederic34 deleted the patch-2 branch October 23, 2014 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants