Merge with master

This commit is contained in:
Romain Neutron
2012-03-13 12:01:21 +01:00
6 changed files with 104 additions and 136 deletions

View File

@@ -10,7 +10,7 @@
{% if user.ACL.has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %} {% if user.ACL.has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner"
onclick="evt_add_in_chutier('{{record.get_base_id}}','{{record.get_record_id}}',false,true);return(false);"> onclick="evt_add_in_chutier('{{record.get_sbas_id}}','{{record.get_record_id}}',false,this);return(false);">
{% trans 'action : ajouter au panier' %} {% trans 'action : ajouter au panier' %}
</div> </div>
</div> </div>

View File

@@ -2,7 +2,7 @@
{% if (record.is_from_basket is empty) and user.ACL().has_right_on_base(record.get_base_id(), 'canputinalbum') %} {% if (record.is_from_basket is empty) and user.ACL().has_right_on_base(record.get_base_id(), 'canputinalbum') %}
<div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}" <div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}"
class="baskAdder" title="{% trans 'action : ajouter au panier' %}" class="baskAdder" title="{% trans 'action : ajouter au panier' %}"
onclick="evt_add_in_chutier('{{record.get_base_id()}}','{{record.get_record_id()}}',false);return(false);"></div> onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);"></div>
{% endif %} {% endif %}
<div class="printer" title="'{% trans 'action : print' %}" <div class="printer" title="'{% trans 'action : print' %}"

View File

@@ -155,13 +155,13 @@ $ACL = $user->ACL();
if ($registry->get('GV_thesaurus')) if ($registry->get('GV_thesaurus'))
{ {
?> ?>
<script language="javascr<?php ?>ipt"> <script language="javascript">
document.getElementById('proposals').innerHTML = "<div style='height:0px; overflow:hidden'>\n<?php echo p4string::MakeString($qp['main']->proposals["QRY"], "JS") ?>\n</div>\n<?php echo p4string::MakeString(proposalsToHTML($qp['main']->proposals), "JS") ?>"; document.getElementById('proposals').innerHTML = "<div style='height:0px; overflow:hidden'>\n<?php echo p4string::MakeString($parm['qry'], "JS") ?>\n</div>\n<?php echo p4string::MakeString($proposals, "JS") ?>";
<?php <?php
if ($registry->get('GV_clientAutoShowProposals')) if ($registry->get('GV_clientAutoShowProposals'))
{ {
?> ?>
if("<?php echo p4string::MakeString(proposalsToHTML($qp['main']->proposals), "JS") ?>" != "<div class=\"proposals\"></div>") if("<?php echo p4string::MakeString($proposals, "JS") ?>" != "<div class=\"proposals\"></div>")
chgOng(4); chgOng(4);
<?php <?php
} }
@@ -432,11 +432,11 @@ if (count($result->get_datas()) > 0)
<?php <?php
if ($ACL->has_right_on_base($record->get_base_id(), "canputinalbum")) 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') if ($mod_col != '1')
{ {
?> ?>
<div style="margin-right:3px;" class="infoTips" id="INFO<?php echo $record->get_base_id() ?>_<?php echo $record->get_record_id() ?>" tooltipsrc="/prod/tooltip/tc_datas/<?php echo $record->get_sbas_id() ?>/<?php echo $record->get_record_id() ?>/"></div> <div style="margin-right:3px;" class="infoTips" id="INFO<?php echo $record->get_base_id() ?>_<?php echo $record->get_record_id() ?>" tooltipsrc="/prod/tooltip/tc_datas/<?php echo $record->get_sbas_id() ?>/<?php echo $record->get_record_id() ?>/"></div>
<?php <?php
try try
@@ -487,30 +487,30 @@ if (count($result->get_datas()) > 0)
phrasea::getHome('HELP', 'client'); phrasea::getHome('HELP', 'client');
} }
function proposalsToHTML(&$proposals) //function proposalsToHTML(&$proposals)
{ //{
//
$html = '<div class="proposals">'; // $html = '<div class="proposals">';
$b = true; // $b = true;
foreach ($proposals["BASES"] as $zbase) // foreach ($proposals["BASES"] as $zbase)
{ // {
if ((int) (count($proposals["BASES"]) > 1) && count($zbase["TERMS"]) > 0) // if ((int) (count($proposals["BASES"]) > 1) && count($zbase["TERMS"]) > 0)
{ // {
$style = $b ? 'style="margin-top:0px;"' : ''; // $style = $b ? 'style="margin-top:0px;"' : '';
$b = false; // $b = false;
$html .= "<h1 $style>" . sprintf(_('reponses::propositions pour la base %s'), htmlentities($zbase["NAME"])) . "</h1>"; // $html .= "<h1 $style>" . sprintf(_('reponses::propositions pour la base %s'), htmlentities($zbase["NAME"])) . "</h1>";
} // }
$t = true; // $t = true;
foreach ($zbase["TERMS"] as $path => $props) // foreach ($zbase["TERMS"] as $path => $props)
{ // {
$style = $t ? 'style="margin-top:0px;"' : ''; // $style = $t ? 'style="margin-top:0px;"' : '';
$t = false; // $t = false;
$html .= "<h2 $style>" . sprintf(_('reponses::propositions pour le terme %s'), htmlentities($props["TERM"])) . "</h2>"; // $html .= "<h2 $style>" . sprintf(_('reponses::propositions pour le terme %s'), htmlentities($props["TERM"])) . "</h2>";
$html .= $props["HTML"]; // $html .= $props["HTML"];
} // }
} // }
$html .= '</div>'; // $html .= '</div>';
//
return($html); // return($html);
} //}

View File

@@ -43,7 +43,7 @@ if ($Request->get('act') == "ADDIMG" && ($Request->get("p0") != "" && $Request->
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$basket = $repository->findUserBasket($Request->get('courChuId'), $user, true); $basket = $repository->findUserBasket($Request->get('courChuId'), $user, true);
$sbas_id = phrasea::sbasFromBas($Request->get('bas')); $sbas_id = $Request->get('sbas');
$record = new record_adapter($sbas_id, $Request->get('p0')); $record = new record_adapter($sbas_id, $Request->get('p0'));
$BasketElement = new \Entities\BasketElement(); $BasketElement = new \Entities\BasketElement();

View File

@@ -576,56 +576,51 @@ $user = User_Adapter::getInstance($usr_id, $appbox);
<!-- BOITE MODALE DIALOG --> <!-- BOITE MODALE DIALOG -->
<div id="MESSAGE"></div> <div id="MESSAGE"></div>
<?php </div>
echo databox_cgu::askAgreement(); <iframe id="MODALDL" class="modalbox" src="" name="download" frameborder="0">
?> </iframe>
<div id="OVERLAY2" style="display:none;"> <!--<iframe style="display:none;" id="download" name="download"></iframe>-->
<form style="display:none;" action="./index.php" target="_self" id="mainForm">
</div> </form>
<iframe id="MODALDL" class="modalbox" src="" name="download" frameborder="0"> <div id="dialog_dwnl" title="<?php echo _('action : exporter') ?>" style="display:none;z-index12000;"></div>
</iframe> <form name="formChu" id="formChu" action="./baskets.php" method="post" style="visibility:hidden; display:none" >
<!--<iframe style="display:none;" id="download" name="download"></iframe>--> <input type="hidden" name="sbas" id="formChubas" value="">
<form style="display:none;" action="./index.php" target="_self" id="mainForm"> <input type="hidden" name="act" id="formChuact" value="">
</form> <input type="hidden" name="p0" id="formChup0" value="">
<div id="dialog_dwnl" title="<?php echo _('action : exporter') ?>" style="display:none;z-index:12000;"></div> <input type="hidden" name="ssel_id" value="">
<form name="formChu" id="formChu" action="./baskets.php" method="post" style="visibility:hidden; display:none" > <input type="hidden" name="courChuId" id="formChuBaskId" value="">
<input type="hidden" name="bas" id="formChubas" value=""> </form>
<input type="hidden" name="act" id="formChuact" value=""> <form name="formPrintPage" action="printpage.php" method="post" style="visibility:hidden; display:none" >
<input type="hidden" name="p0" id="formChup0" value=""> <input type="hidden" name="lst" value="">
<input type="hidden" name="ssel_id" value=""> </form>
<input type="hidden" name="courChuId" id="formChuBaskId" value=""> <form name="validatorEject" target="wVal" id="validatorEject" action="/lightbox/index.php" method="post" style="visibility:hidden; display:none" >
</form> <input type="hidden" name="ssel_id" id="ssel2val" value="">
<form name="formPrintPage" action="printpage.php" method="post" style="visibility:hidden; display:none" > <input type="hidden" name="mode" value="0">
<input type="hidden" name="lst" value=""> </form>
</form> <form name="logout" target="_self" id="logout" action="/login/logout.php" method="post" style="visibility:hidden; display:none" >
<form name="validatorEject" target="wVal" id="validatorEject" action="/lightbox/index.php" method="post" style="visibility:hidden; display:none" > <input type="hidden" name="app" value="client">
<input type="hidden" name="ssel_id" id="ssel2val" value=""> </form>
<input type="hidden" name="mode" value="0"> <script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
</form> <script type="text/javascript" src="/include/minify/g=client"></script>
<form name="logout" target="_self" id="logout" action="/login/logout.php" method="post" style="visibility:hidden; display:none" > <script type="text/javascript" src="/include/jslibs/flowplayer/flowplayer-3.2.6.min.js"></script>
<input type="hidden" name="app" value="client"> <script type="text/javascript">
</form>
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="/include/minify/g=client"></script>
<script type="text/javascript" src="/include/jslibs/flowplayer/flowplayer-3.2.6.min.js"></script>
<script type="text/javascript">
function reModCol() function reModCol()
{ {
var mod_col = $('#mod')[0].options[$('#mod')[0].selectedIndex].value.split('X'); var mod_col = $('#mod')[0].options[$('#mod')[0].selectedIndex].value.split('X');
if(mod_col[0]) if(mod_col[0])
mod_col = mod_col[1] mod_col = mod_col[1]
var w = Math.round((bodyW - 16) / (mod_col==1?4:mod_col)) - 12; var w = Math.round((bodyW - 16) / (mod_col==1?4:mod_col)) - 12;
if(w < 128) if(w < 128)
w = 128; w = 128;
var propname = document.styleSheets[0].cssRules ? "cssRules":"rules"; // firefox=cssRules ; safari,ie=rules var propname = document.styleSheets[0].cssRules ? "cssRules":"rules"; // firefox=cssRules ; safari,ie=rules
document.styleSheets[0][propname][0].style.width = (w-20)+"px"; // IMG.hthbimg document.styleSheets[0][propname][0].style.width = (w-20)+"px"; // IMG.hthbimg
document.styleSheets[0][propname][1].style.height = (w-20)+"px"; // IMG.vthbimg document.styleSheets[0][propname][1].style.height = (w-20)+"px"; // IMG.vthbimg
document.styleSheets[0][propname][2].style.width = (w)+"px"; // .w160px document.styleSheets[0][propname][2].style.width = (w)+"px"; // .w160px
document.styleSheets[0][propname][3].style.height = (w)+"px"; // .h160px document.styleSheets[0][propname][3].style.height = (w)+"px"; // .h160px
} }

View File

@@ -30,22 +30,23 @@ function acceptCgus(name,value)
function cancelCgus(id) function cancelCgus(id)
{ {
$.ajax({
type: "POST", $.ajax({
url: "/prod/TOU/deny/" + id + "/", type: "POST",
dataType:'json', url: "/prod/prodFeedBack.php",
success: function(data){ data: {
if(data.success) sbas_id:id,
{ action:'DENY_CGU'
alert(language.cgusRelog); },
self.location.replace(self.location.href); success: function(data){
} if(data == '1')
alert {
{ alert(language.cgusRelog);
humane.error(data.message); self.location.replace(self.location.href);
} }
} }
}); });
} }
function activateCgus() function activateCgus()
@@ -631,8 +632,8 @@ function clktri(id){
* CHUTIER * CHUTIER
**************/ **************/
function evt_add_in_chutier(base_id, record_id){ function evt_add_in_chutier(sbas_id, record_id){
$('#formChubas')[0].value = base_id; $('#formChubas')[0].value = sbas_id;
$('#formChuact')[0].value = "ADDIMG"; $('#formChuact')[0].value = "ADDIMG";
$('#formChup0')[0].value = record_id; $('#formChup0')[0].value = record_id;
$('#formChu').submit(); $('#formChu').submit();
@@ -780,6 +781,8 @@ function evt_dwnl(lst)
{ {
var dialog_box = $('#dialog_dwnl'); var dialog_box = $('#dialog_dwnl');
dialog_box = $('#dialog_dwnl');
dialog_box.empty().addClass('loading').dialog({ dialog_box.empty().addClass('loading').dialog({
width:800, width:800,
height:600, height:600,
@@ -817,36 +820,6 @@ function evt_dwnl(lst)
} }
//function evt_dwnl(lst){
// var top;
// var left;
//
// var url = "" +
// "/include/multiexports.php" +
// "?" +
// "&callclient=1";
//
//
// $('#MODALDL').attr('src',url);
//
//
// var t = (bodySize.y - 400) / 2;
// var l = (bodySize.x - 550) / 2;
//
// $('#MODALDL').css({
// 'display': 'block',
// 'opacity': 0,
// 'width': '550px',
// 'position': 'absolute',
// 'top': t,
// 'left': l,
// 'height': '400px'
// }).fadeTo(500, 1);
//
// showOverlay(2);
//}
function profil(value) function profil(value)
{ {
var top; var top;