You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
312 lines
10 KiB
312 lines
10 KiB
<macros>
|
|
|
|
<macro name="jsConfirm(?text)">confirm(::if text==null::'Confirmer cette action ?'::else::'::escapeJS(text)::'::end::)</macro>
|
|
|
|
<macro name="confirm(?text)" onclick="return $$jsConfirm(::text::)"/>
|
|
|
|
<macro name="file(id,?def)">
|
|
::if id == null && def != null::
|
|
::def::
|
|
::else::
|
|
/file/::makeFileSign(id)::.jpg
|
|
::end::
|
|
</macro>
|
|
|
|
<macro name="img(id,?def)"><img src="$$file(::id::,::def::)"/></macro>
|
|
|
|
<macro name="browse(b,url)">$$browseCustom(::b::,::url::,Page ::b.page:: ::if b.pages::/::b.pages:: ::end::)</macro>
|
|
|
|
<macro name="browseCustom(b,url,custom)">
|
|
<
|
|
::if b.prev::<a href="::url::/?page=::b.prev::">::_("Previous")::</a>::else:: ::_("Previous"):: ::end::
|
|
| ::custom:: |
|
|
::if b.next::<a href="::url::/?page=::b.next::">::_("Next")::</a>::else:: ::_("Next"):: ::end:: >
|
|
</macro>
|
|
|
|
<macro name="nullSafe(text)">::if text==null::::else::::text::::end::</macro>
|
|
|
|
<macro name="edit(text,url)">
|
|
|
|
<a href="::url::" class="btn btn-default btn-sm">
|
|
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
|
|
::text::
|
|
</a>
|
|
</macro>
|
|
|
|
<macro name="insert(text,url)">
|
|
<!--<img src="/img/icons/add.png" style="vertical-align:middle;" /> <a href="::url::">::text::</a>-->
|
|
<a href="::url::" class="btn btn-default btn-sm">
|
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
|
::text::
|
|
</a>
|
|
</macro>
|
|
|
|
<macro name="delete(text,url)">
|
|
<a href="::url::" $$confirm(::_("Delete ?")::) class="btn btn-default btn-sm" >
|
|
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
|
|
::if text!=null && text!=""::
|
|
::text::
|
|
::end::
|
|
</a>
|
|
</macro>
|
|
|
|
<macro name="export(url)">
|
|
<a href="::url::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list-alt"></span> ::_("Excel/CSV Export")::</a>
|
|
</macro>
|
|
|
|
<macro name="bool(v)">
|
|
::if v==true::
|
|
<img src="/img/icons/accept.png" />
|
|
::else::
|
|
<img src="/img/icons/stop.png" />
|
|
::end::
|
|
</macro>
|
|
|
|
<macro name="check(v)">
|
|
::if(v==true || v==1)::
|
|
<span class="glyphicon glyphicon-ok" style="color:#060"></span>
|
|
::else::
|
|
<span class="glyphicon glyphicon-exclamation-sign" style="color:#a94442"></span>
|
|
::end::
|
|
</macro>
|
|
|
|
|
|
<macro name="date(dow,d,m,y,place)">
|
|
<div class="dateBox" >
|
|
<div class="box">
|
|
<div>::dow::</div>
|
|
<div style="font-size:28px;color:#990000;">::d::</div>
|
|
<div>::m::</div>
|
|
</div>
|
|
::if place!=null::
|
|
<div style="margin-top:6px;">
|
|
<span class="glyphicon glyphicon-map-marker"></span>
|
|
<a href="#" onclick="_.overlay('/group/place/::place.id::','::urlEncode(place.name)::')">::place::</a>
|
|
</div>
|
|
::end::
|
|
</div>
|
|
</macro>
|
|
|
|
<macro name="place(place)">
|
|
<span class="glyphicon glyphicon-map-marker"></span>
|
|
<a onclick="_.overlay('/group/place/::place.id::','::urlEncode(place.name)::')">::place::</a>
|
|
<div class="address">
|
|
$$nullSafe(::place.address1::)
|
|
$$nullSafe(::place.address2::)
|
|
$$nullSafe(::place.zipCode::)
|
|
$$nullSafe(::place.city::)
|
|
</div>
|
|
</macro>
|
|
|
|
<macro name="today(dow,d,m,y,h,place)">
|
|
<div class="dateBox" style="background-color:#080;" >
|
|
<img src="/img/go.png"/>
|
|
<div style="font-size:16px;margin-bottom:8px;">
|
|
::if Std.parseInt(h)<=12::
|
|
::_("THIS MORNING")::
|
|
::elseif Std.parseInt(h)<18::
|
|
<span style="font-size:14px;">CET<br/>::_("AFTERNOON")::</span>
|
|
::else::
|
|
::_("THIS EVENING")::
|
|
::end::
|
|
|
|
</div>
|
|
::if place!=null::
|
|
<div style="margin-top:6px;">
|
|
<span class="glyphicon glyphicon-map-marker"></span>
|
|
<a href="#" onclick="_.overlay('/group/place/::place.id::','::urlEncode(place.name)::')">::place::</a>
|
|
</div>
|
|
::end::
|
|
</div>
|
|
</macro>
|
|
|
|
<macro name="contact(u)">
|
|
|
|
<i class="icon-user"></i>
|
|
|
|
::if u!=null::
|
|
<b>::u.firstName:: ::u.lastName::</b><br/>
|
|
<span ::cond u.email!=null::>
|
|
<span class="glyphicon glyphicon-envelope"></span> <a href="mailto: ::u.email::">::u.email::</a><br/>
|
|
</span>
|
|
<span ::cond u.phone!=null::>
|
|
<span class="glyphicon glyphicon-phone-alt"></span> ::u.phone::<br/>
|
|
</span>
|
|
::else::
|
|
::_("No contact")::
|
|
::end::
|
|
|
|
</macro>
|
|
|
|
|
|
<macro name="alert(msg)">
|
|
<div class="alert alert-danger">
|
|
<span class="glyphicon glyphicon-exclamation-sign"></span>
|
|
|
|
::raw msg::
|
|
</div>
|
|
</macro>
|
|
|
|
|
|
<macro name="operation(t)">
|
|
::set x = t.getTypeIndex()::
|
|
<!--::if x==2:: ::set class="text-right":: ::end:: -->
|
|
<td class="::class::">
|
|
::if x==0::
|
|
<i class="fa fa-shopping-cart" aria-hidden="true"></i> ::_("Order")::
|
|
::elseif x==1::
|
|
<i class="fa fa-shopping-basket" aria-hidden="true"></i> ::raw _("CSA contract")::
|
|
::elseif x==2::
|
|
<!--<span style="margin-left:48px;">::_("Payment"):: ::_(t.getPaymentType())::</span>-->
|
|
<i class="fa fa-credit-card" aria-hidden="true"></i> ::_("Payment"):: ::t.getPaymentTypeName()::
|
|
::else::
|
|
<i class="fa fa-user" aria-hidden="true"></i> ::_("Subscription")::
|
|
::end::
|
|
</td>
|
|
|
|
<td>
|
|
::if t.pending==true::
|
|
<i class="fa fa-circle-thin" style="color:#CCC;" aria-hidden="true"></i>
|
|
::else::
|
|
<i class="fa fa-check" aria-hidden="true"></i>
|
|
::end::
|
|
</td>
|
|
<td style="font-size:1em;">
|
|
|
|
::t.name::<br/>
|
|
|
|
::if x==2 && t.pending==true::
|
|
::if(t.getPaymentType()=="check")::
|
|
<span style="color:red;">::_("Check to be given at the collection of products")::</span>
|
|
::elseif(t.getPaymentType()=="cash")::
|
|
<span style="color:red;">::_("Cash to be given at the collection of products")::</span>
|
|
::elseif(t.getPaymentType()=="transfer")::
|
|
<span style="color:red;">::_("This transfer must be validated by a coordinator")::</span>
|
|
::else::
|
|
::t.name::<br/>
|
|
<span style="font-size:0.90em;color:#AAA;">::hDate(t.date)::</span>
|
|
::end::
|
|
|
|
::else::
|
|
<span style="font-size:0.90em;color:#AAA;">::hDate(t.date)::</span>
|
|
::end::
|
|
</td>
|
|
<td class="text-right">
|
|
::if(t.amount<0)::
|
|
-
|
|
::end::
|
|
</td>
|
|
<td>::formatNum(Math.abs(t.amount)):: ::currency()::</td>
|
|
::set class=""::
|
|
</macro>
|
|
|
|
<macro name="back()">
|
|
<a href="#" onclick="window.history.back();" class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-chevron-left"></span> ::_("Back")::</a>
|
|
</macro>
|
|
|
|
|
|
<macro name="deliveryPro(k,showBtns)">
|
|
::set now = Date.now()::
|
|
<div class="row">
|
|
<div class="col-md-4 text-center">
|
|
<!-- find color/icon to display -->
|
|
::set open = 0::
|
|
::set notyetopened = 0::
|
|
::set closed = 0::
|
|
|
|
::foreach d k::
|
|
::if d.orderStartDate!=null::
|
|
::if now.getTime() > d.orderStartDate.getTime() && now.getTime() < d.orderEndDate.getTime()::
|
|
<!-- commande en cours -->
|
|
::set open = open+1::
|
|
::elseif now.getTime() > d.orderEndDate.getTime()::
|
|
<!-- commande terminée -->
|
|
::set closed = closed+1::
|
|
::else::
|
|
<!-- commande pas ouverte -->
|
|
::set notyetopened = notyetopened+1::
|
|
::end::
|
|
::else::
|
|
<!-- AMAP : commande terminée -->
|
|
::set closed = closed+1::
|
|
::end::
|
|
::end::
|
|
|
|
<div style="display:inline-block;">
|
|
::set x = getDate(k[0].date)::
|
|
$$date(::x.dow::,::x.d::,::x.m::,::x.y::,::k[0]._place::)
|
|
</div>
|
|
|
|
<div style="text-align: center;font-weight: bold;margin-top: 12px;font-size: 1.2em;color:#666;">::x.h+":"+x.i::</div>
|
|
|
|
</div>
|
|
<div class="col-md-8">
|
|
|
|
::if (open==k.length)::
|
|
<span class="fa-stack fa-lg" data-toggle="tooltip" title="Commande en cours.">
|
|
<i class="fa fa-circle fa-stack-2x" style="color:#F80;"></i>
|
|
<i class="fa fa-shopping-basket fa-stack-1x fa-inverse"></i>
|
|
</span>
|
|
::elseif(closed==k.length)::
|
|
<span class="fa-stack fa-lg" data-toggle="tooltip" title="Commande close. Préparez votre livraison">
|
|
<i class="fa fa-circle fa-stack-2x" style="color:#0A0;"></i>
|
|
<i class="fa fa-truck fa-stack-1x fa-inverse"></i>
|
|
</span>
|
|
::elseif(notyetopened==k.length)::
|
|
<span class="fa-stack fa-lg" data-toggle="tooltip" title="Commande pas encore ouverte">
|
|
<i class="fa fa-circle fa-stack-2x" style="color:#999;" ></i>
|
|
<i class="fa fa-clock-o fa-stack-1x fa-inverse"></i>
|
|
</span>
|
|
::else::
|
|
<span class="fa-stack fa-lg" data-toggle="tooltip" title="Statut mixte">
|
|
<i class="fa fa-circle fa-stack-2x" style="color:#999;" ></i>
|
|
<i class="fa fa-truck fa-stack-1x fa-inverse"></i>
|
|
</span>
|
|
::end::
|
|
|
|
<b>::k[0]._contract._amap.name::</b><br/>
|
|
|
|
<table>
|
|
::foreach d k::
|
|
<tr>
|
|
<td>
|
|
::if d.orderStartDate!=null::
|
|
::if now.getTime() > d.orderStartDate.getTime() && now.getTime() < d.orderEndDate.getTime()::
|
|
<!-- commande en cours -->
|
|
<i class="fa fa-circle" style="color:#F80;" data-toggle="tooltip" title="Commande en cours."></i>
|
|
::elseif now.getTime() > d.orderEndDate.getTime()::
|
|
<!-- commande terminée -->
|
|
<i class="fa fa-circle" style="color:#0A0;" data-toggle="tooltip" title="Commande close. Préparez votre livraison"></i>
|
|
::else::
|
|
<!-- commande pas ouverte -->
|
|
<i class="fa fa-circle-thin" style="color:#666;" data-toggle="tooltip" title="Commande pas encore ouverte"></i>
|
|
::end::
|
|
::else::
|
|
<!-- AMAP -->
|
|
<i class="fa fa-circle" style="color:#0A0;" data-toggle="tooltip" title="Commande close. Préparez votre livraison"></i>
|
|
::end::
|
|
|
|
::set c = getCatalog(d)::
|
|
<a href="/p/pro/delivery/view/::d.id::">::c.name::</a>
|
|
</td>
|
|
<td>
|
|
::if showBtns::
|
|
<div class="btn-group">
|
|
<a href="/p/pro/delivery/edit/::d.id::" title="::_("Edit")::" data-toggle="tooltip" class="btn btn-default btn-sm">
|
|
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
|
|
</a>
|
|
<a href="/p/pro/delivery/delete/::d.id::?token=::token::" title="::_("Delete")::" data-toggle="tooltip" $$confirm(::_("Delete ?")::) class="btn btn-default btn-sm" >
|
|
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
|
|
</a>
|
|
</div>
|
|
::end::
|
|
</td>
|
|
</tr>
|
|
::end::
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
</macro>
|
|
|
|
</macros>
|