mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Fix add in basket
This commit is contained in:
@@ -431,7 +431,7 @@ $npages = $result->get_total_pages();
|
||||
<?php
|
||||
if ($ACL->has_right_on_base($record->get_base_id(), "canputinalbum"))
|
||||
{
|
||||
?><div class="baskAdder" title="<?php echo _('action : ajouter au panier') ?>" onClick="evt_add_in_chutier('<?php echo $record->get_base_id() ?>', '<?php echo $record->get_record_id() ?>');"></div><?php
|
||||
?><div class="baskAdder" title="<?php echo _('action : ajouter au panier') ?>" onClick="evt_add_in_chutier('<?php echo $record->get_sbas_id() ?>', '<?php echo $record->get_record_id() ?>');"></div><?php
|
||||
}
|
||||
if ($mod_col != '1')
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ $session = $appbox->get_session();
|
||||
$usr_id = $session->get_usr_id();
|
||||
|
||||
$request = http_request::getInstance();
|
||||
$parm = $request->get_parms("bas", "courChuId", "act", "p0", "first");
|
||||
$parm = $request->get_parms("sbas", "courChuId", "act", "p0", "first");
|
||||
|
||||
$parm['p0'] = utf8_decode($parm['p0']);
|
||||
|
||||
@@ -41,7 +41,7 @@ if ($parm["act"] == "DELIMG" && $parm["p0"] != "")
|
||||
if ($parm["act"] == "ADDIMG" && ($parm["p0"] != "" && $parm["p0"] != null))
|
||||
{
|
||||
$basket = basket_adapter::getInstance($appbox, $parm['courChuId'], $user->get_id());
|
||||
$sbas_id = phrasea::sbasFromBas($parm['bas']);
|
||||
$sbas_id = (int) $parm['sbas'];
|
||||
$record = new record_adapter($sbas_id, $parm['p0']);
|
||||
$basket->push_element($record, false, false);
|
||||
unset($record);
|
||||
|
@@ -588,7 +588,7 @@ if ($cssfile)
|
||||
</form>
|
||||
<div id="dialog_dwnl" title="<?php echo _('action : exporter') ?>" style="display:none;z-index12000;"></div>
|
||||
<form name="formChu" id="formChu" action="./baskets.php" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="bas" id="formChubas" value="">
|
||||
<input type="hidden" name="sbas" id="formChubas" value="">
|
||||
<input type="hidden" name="act" id="formChuact" value="">
|
||||
<input type="hidden" name="p0" id="formChup0" value="">
|
||||
<input type="hidden" name="ssel_id" value="">
|
||||
|
@@ -632,8 +632,8 @@ function clktri(id){
|
||||
* CHUTIER
|
||||
**************/
|
||||
|
||||
function evt_add_in_chutier(base_id, record_id){
|
||||
$('#formChubas')[0].value = base_id;
|
||||
function evt_add_in_chutier(sbas_id, record_id){
|
||||
$('#formChubas')[0].value = sbas_id;
|
||||
$('#formChuact')[0].value = "ADDIMG";
|
||||
$('#formChup0')[0].value = record_id;
|
||||
$('#formChu').submit();
|
||||
|
@@ -281,6 +281,7 @@ function dropOnBask(event,from,destKey)
|
||||
{
|
||||
sselcont = [];
|
||||
lstbr = p4.sel.join(';');
|
||||
console.log(from, $(from).hasClass('baskAdder'));
|
||||
if($(from).hasClass('baskAdder'))
|
||||
lstbr = $(from).attr('id').split('_').slice(2,4).join('_');
|
||||
}
|
||||
@@ -3352,7 +3353,10 @@ function evt_print(value)
|
||||
function evt_add_in_chutier(a,b,event,el)
|
||||
{
|
||||
if($('#baskets .SSTT.active').length == 1)
|
||||
{
|
||||
console.log('evaluating', '#PREV_BASKADD_'+a+'_'+b);
|
||||
dropOnBask(event,$('#PREV_BASKADD_'+a+'_'+b),$('#baskets .SSTT.active'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user