Skip to content
Snippets Groups Projects
Commit e5367895 authored by Satish's avatar Satish
Browse files

Fixes #459 - Bugs in all modules - list filters

parent a8b92096
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
<div class="sidebar-container lists-menu-container">
<div class="sidebar-header clearfix">
<h5 class="pull-left">{vtranslate('LBL_LISTS',$MODULE)}</h5>
<button id="createFilter" data-url="{CustomView_Record_Model::getCreateViewUrl($MODULE)}" class="btn btn-default pull-right sidebar-btn" title="{vtranslate('LBL_CREATE_FILTER',$MODULE)}">
<button id="createFilter" data-url="{CustomView_Record_Model::getCreateViewUrl($MODULE)}" class="btn btn-sm btn-default pull-right sidebar-btn" title="{vtranslate('LBL_CREATE_LIST',$MODULE)}">
<div class="fa fa-plus" aria-hidden="true"></div>
</button>
</div>
......@@ -20,13 +20,14 @@
<input class="search-list" type="text" placeholder="{vtranslate('LBL_SEARCH_FOR_LIST',$MODULE)}">
</div>
<div class="menu-scroller scrollContainer" style="position:relative; top:0; left:0;">
<div class="list-menu-content">
<div class="list-menu-content">
{assign var="CUSTOM_VIEW_NAMES" value=array()}
{if $CUSTOM_VIEWS && count($CUSTOM_VIEWS) > 0}
{foreach key=GROUP_LABEL item=GROUP_CUSTOM_VIEWS from=$CUSTOM_VIEWS}
{if $GROUP_LABEL neq 'Mine' && $GROUP_LABEL neq 'Shared'}
{continue}
{/if}
<div class="list-group">
<div class="list-group" id="{if $GROUP_LABEL eq 'Mine'}myList{else}sharedList{/if}">
<h6 class="lists-header {if count($GROUP_CUSTOM_VIEWS) <=0} hide {/if}" >
{if $GROUP_LABEL eq 'Mine'}
{vtranslate('LBL_MY_LIST',$MODULE)}
......@@ -36,17 +37,27 @@
</h6>
<input type="hidden" name="allCvId" value="{CustomView_Record_Model::getAllFilterByModule($MODULE)->get('cvid')}" />
<ul class="lists-menu">
{assign var=count value=0}
{foreach item="CUSTOM_VIEW" from=$GROUP_CUSTOM_VIEWS name="customView"}
{assign var=IS_DEFAULT value=$CUSTOM_VIEW->isDefault()}
<li style="font-size:12px;" class='listViewFilter {if $VIEWID eq $CUSTOM_VIEW->getId() && ($CURRENT_TAG eq '')} active{/if} {if $smarty.foreach.customView.iteration gt 5} filterHidden hide{/if} '>
{assign var=VIEWNAME value={vtranslate($CUSTOM_VIEW->get('viewname'), $MODULE)}}
<a class="filterName" href="javascript:;" data-filter-id="{$CUSTOM_VIEW->getId()}">{if {$VIEWNAME|strlen > 30} } {$VIEWNAME|substr:0:21|@escape:'html'}..{else}{$VIEWNAME|@escape:'html'}{/if}</a>
{assign var="CUSTOME_VIEW_RECORD_MODEL" value=CustomView_Record_Model::getInstanceById($CUSTOM_VIEW->getId())}
{assign var="MEMBERS" value=$CUSTOME_VIEW_RECORD_MODEL->getMembers()}
{assign var="LIST_STATUS" value=$CUSTOME_VIEW_RECORD_MODEL->get('status')}
{foreach key=GROUP_LABEL item="MEMBER_LIST" from=$MEMBERS}
{if $MEMBER_LIST|@count gt 0}
{assign var="SHARED_MEMBER_COUNT" value=1}
{/if}
{/foreach}
<li style="font-size:12px;" class='listViewFilter {if $VIEWID eq $CUSTOM_VIEW->getId() && ($CURRENT_TAG eq '')} active {if $smarty.foreach.customView.iteration gt 10} {assign var=count value=1} {/if} {else if $smarty.foreach.customView.iteration gt 10} filterHidden hide{/if} '>
{assign var=VIEWNAME value={vtranslate($CUSTOM_VIEW->get('viewname'), $MODULE)}}
{append var="CUSTOM_VIEW_NAMES" value=$VIEWNAME}
<a class="filterName listViewFilterElipsis" href="javascript:;" oncontextmenu="return false;" data-filter-id="{$CUSTOM_VIEW->getId()}" title="{$VIEWNAME|@escape:'html'}">{$VIEWNAME|@escape:'html'}</a>
<div class="pull-right">
<span class="js-popover-container" style="cursor:pointer;">
<span class="fa fa-angle-down" rel="popover" data-toggle="popover" aria-expanded="true"
{if $CUSTOM_VIEW->isMine() and $CUSTOM_VIEW->get('viewname') neq 'All'}
data-deletable="{if $CUSTOM_VIEW->isDeletable()}true{else}false{/if}" data-editable="{if $CUSTOM_VIEW->isEditable()}true{else}false{/if}"
{if $CUSTOM_VIEW->isEditable()} data-editurl="{$CUSTOM_VIEW->getEditUrl()}{/if}" {if $CUSTOM_VIEW->isDeletable()} data-deleteurl="{$CUSTOM_VIEW->getDeleteUrl()}"{/if}
{if $CUSTOM_VIEW->isEditable()} data-editurl="{$CUSTOM_VIEW->getEditUrl()}{/if}" {if $CUSTOM_VIEW->isDeletable()} {if $SHARED_MEMBER_COUNT eq 1 or $LIST_STATUS eq 3} data-shared="1"{/if} data-deleteurl="{$CUSTOM_VIEW->getDeleteUrl()}"{/if}
{/if}
toggleClass="fa {if $IS_DEFAULT}fa-check-square-o{else}fa-square-o{/if}" data-filter-id="{$CUSTOM_VIEW->getId()}"
data-is-default="{$IS_DEFAULT}" data-defaulttoggle="{$CUSTOM_VIEW->getToggleDefaultUrl()}" data-default="{$CUSTOM_VIEW->getDuplicateUrl()}" data-isMine="{if $CUSTOM_VIEW->isMine()}true{else}false{/if}">
......@@ -56,17 +67,22 @@
</li>
{/foreach}
</ul>
<div class='clearfix'>
<a class="toggleFilterSize" data-more-text="Show more" data-less-text="Show less">{if $smarty.foreach.customView.iteration gt 5}
{vtranslate('LBL_SHOW_MORE',Vtiger)}
{/if}</a>
</div>
<div class='clearfix'>
{if $smarty.foreach.customView.iteration - 10 - $count}
<a class="toggleFilterSize" data-more-text=" {$smarty.foreach.customView.iteration - 10 - $count} {vtranslate('LBL_MORE',Vtiger)|@strtolower}" data-less-text="Show less">
{if $smarty.foreach.customView.iteration gt 10}
{$smarty.foreach.customView.iteration - 10 - $count} {vtranslate('LBL_MORE',Vtiger)|@strtolower}
{/if}
</a>{/if}
</div>
</div>
{/foreach}
{/foreach}
<input type="hidden" id='allFilterNames' value='{Vtiger_Util_Helper::toSafeHTML(Zend_JSON::encode($CUSTOM_VIEWS_NAMES))}'/>
<div id="filterActionPopoverHtml">
<ul class="listmenu hide" role="menu">
<li role="presentation" class="editFilter">
<a role="menuitem"><i class="fa fa-pencil-square-o"></i>&nbsp;{vtranslate('LBL_EDIT',$MODULE)}</a>
<a role="menuitem"><i class="fa fa-pencil"></i>&nbsp;{vtranslate('LBL_EDIT',$MODULE)}</a>
</li>
<li role="presentation" class="deleteFilter">
<a role="menuitem"><i class="fa fa-trash"></i>&nbsp;{vtranslate('LBL_DELETE',$MODULE)}</a>
......@@ -157,7 +173,7 @@
<input type="hidden" name="id" value="" />
<div class="editTagContents">
<div>
<input type="text" name="tagName" value="" style="width:100%" />
<input type="text" name="tagName" value="" style="width:100%" maxlength="25"/>
</div>
<div>
<div class="checkbox">
......
......@@ -175,12 +175,12 @@ Vtiger.Class('Vtiger_ListSidebar_Js',{},{
contentEle.find('.deleteFilter').css("display","none");
}
if (!jQuery(ele).data('editable')) {
contentEle.find('.editFilter').addClass('disabled');
contentEle.find('.editFilter').remove();
} else {
contentEle.find('.editFilter').removeClass('disabled');
}
if (!jQuery(ele).data('deletable')) {
contentEle.find('.deleteFilter').addClass('disabled');
contentEle.find('.deleteFilter').remove();
} else {
contentEle.find('.deleteFilter').removeClass('disabled');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment