Files
CRM/layouts/v7/modules/Vtiger/partials/EditViewContents.tpl
BACHIR SOULDI 2794e62571 first commit
2025-09-28 08:49:37 +01:00

239 lines
10 KiB
Smarty

{*<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
-->*}
{strip}
{if !empty($PICKIST_DEPENDENCY_DATASOURCE)}
<input type="hidden" name="picklistDependency" value='{Vtiger_Util_Helper::toSafeHTML($PICKIST_DEPENDENCY_DATASOURCE)}' />
{/if}
<div name='editContent'>
{if $DUPLICATE_RECORDS}
<div class="fieldBlockContainer duplicationMessageContainer">
<div class="duplicationMessageHeader"><b>{vtranslate('LBL_DUPLICATES_DETECTED', $MODULE)}</b></div>
<div>{getDuplicatesPreventionMessage($MODULE, $DUPLICATE_RECORDS)}</div>
</div>
{/if}
{foreach key=BLOCK_LABEL item=BLOCK_FIELDS from=$RECORD_STRUCTURE name=blockIterator}
{if $BLOCK_FIELDS|@count gt 0}
<div class='fieldBlockContainer' data-block="{$BLOCK_LABEL}" {if $BLOCK_LABEL eq 'Gestion des focus'}style='display: none;' id='focus'{/if}>
<h4 class='fieldBlockHeader'>{vtranslate($BLOCK_LABEL, $MODULE)}</h4>
<hr>
<table class="table table-borderless">
<tr>
{assign var=COUNTER value=0}
{foreach key=FIELD_NAME item=FIELD_MODEL from=$BLOCK_FIELDS name=blockfields}
{if ($FIELD_NAME eq 'industry' && $FIELD_MODEL->get('fieldvalue') eq 'Pharmacie')}
{assign var="isPharma" value=1}
{/if}
{if ($FIELD_NAME eq 'industry' && $FIELD_MODEL->get('fieldvalue') eq 'Medecin')}
{assign var="isMedecin" value=1}
{/if}
{if ($FIELD_NAME eq 'industry' && $FIELD_MODEL->get('fieldvalue') eq 'Grossiste')}
{assign var="isGrossiste" value=1}
{/if}
{if ($MODULE eq 'Events' && $FIELD_NAME eq 'subject')}
{continue}
{/if}
{assign var="isPotentiel" value=0}
{if ($MODULE eq 'Accounts' && $FIELD_NAME eq 'rating' && $isPharma)}
{assign var="isPotentiel" value=1}
{/if}
{if ($FIELD_NAME eq 'cf_1159' || $FIELD_NAME eq 'cf_1063' || $FIELD_NAME eq 'cf_1157') && !$isMedecin }
{continue}
{/if}
{if ($FIELD_NAME eq 'cf_968' || $FIELD_NAME eq 'cf_1015' || $FIELD_NAME eq 'cf_1161') && !$isPharma }
{continue}
{/if}
{if $FIELD_NAME eq 'cf_1025' && !$isGrossiste }
{continue}
{/if}
{assign var="isReferenceField" value=$FIELD_MODEL->getFieldDataType()}
{assign var="refrenceList" value=$FIELD_MODEL->getReferenceList()}
{assign var="refrenceListCount" value=count($refrenceList)}
{if $FIELD_MODEL->isEditable() eq true}
{if $FIELD_MODEL->get('uitype') eq "19"}
{if $COUNTER eq '1'}
<td></td><td></td></tr><tr>
{assign var=COUNTER value=0}
{/if}
{/if}
{if $COUNTER eq 2}
</tr><tr>
{assign var=COUNTER value=1}
{else}
{assign var=COUNTER value=$COUNTER+1}
{/if}
<td class="fieldLabel alignMiddle">
{if $isReferenceField eq "reference"}
{if $refrenceListCount > 1}
{assign var="DISPLAYID" value=$FIELD_MODEL->get('fieldvalue')}
{assign var="REFERENCED_MODULE_STRUCTURE" value=$FIELD_MODEL->getUITypeModel()->getReferenceModule($DISPLAYID)}
{if !empty($REFERENCED_MODULE_STRUCTURE)}
{assign var="REFERENCED_MODULE_NAME" value=$REFERENCED_MODULE_STRUCTURE->get('name')}
{/if}
<select disabled style="width: 140px;" class="select2 referenceModulesList">
{foreach key=index item=value from=$refrenceList}
<option value="{$value}" {if $value eq $REFERENCED_MODULE_NAME} selected {/if}>{vtranslate($value, $value)}</option>
{/foreach}
</select>
{else}
{vtranslate($FIELD_MODEL->get('label'), $MODULE)}
{/if}
{else if $FIELD_MODEL->get('uitype') eq "83"}
{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE) COUNTER=$COUNTER MODULE=$MODULE}
{if $TAXCLASS_DETAILS}
{assign 'taxCount' count($TAXCLASS_DETAILS)%2}
{if $taxCount eq 0}
{if $COUNTER eq 2}
{assign var=COUNTER value=1}
{else}
{assign var=COUNTER value=2}
{/if}
{/if}
{/if}
{else}
{if $MODULE eq 'Documents' && $FIELD_MODEL->get('label') eq 'File Name'}
{assign var=FILE_LOCATION_TYPE_FIELD value=$RECORD_STRUCTURE['LBL_FILE_INFORMATION']['filelocationtype']}
{if $FILE_LOCATION_TYPE_FIELD}
{if $FILE_LOCATION_TYPE_FIELD->get('fieldvalue') eq 'E'}
{vtranslate("LBL_FILE_URL", $MODULE)}&nbsp;<span class="redColor">*</span>
{else}
{vtranslate($FIELD_MODEL->get('label'), $MODULE)}
{/if}
{else}
{vtranslate($FIELD_MODEL->get('label'), $MODULE)}
{/if}
{else}
{if $MODULE eq 'Accounts' && $FIELD_MODEL->get('label') eq "Assigned To"}
Visiteur
{else}
{vtranslate($FIELD_MODEL->get('label'), $MODULE)}
{/if}
{/if}
{/if}
&nbsp;{if $FIELD_MODEL->isMandatory() eq true} <span class="redColor">*</span> {/if}
</td>
{if $FIELD_MODEL->get('uitype') neq '83'}
<td class="fieldValue" {if $FIELD_MODEL->getFieldDataType() eq 'boolean'} style="width:25%" {/if} {if $FIELD_MODEL->get('uitype') eq '19'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}>
{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
{if ($MODULE eq 'Accounts' and $FIELD_NAME eq 'rating' and !$isPharma)}&nbsp; <span id='help' class="btn addButton btn-success">?</span> {/if}
</td>
{/if}
{/if}
{/foreach}
{*If their are odd number of fields in edit then border top is missing so adding the check*}
{if $COUNTER is odd}
<td></td>
<td></td>
{/if}
</tr>
{if $BLOCK_LABEL eq 'GPS'}
<tr>
<td class="fieldLabel alignMiddle"></td>
<td class="fieldLabel alignMiddle">
<button type="button" class="btn addButton btn-danger" onclick ="getLocation();">
<div class="fa fa-crosshairs" aria-hidden="true">
</div>&nbsp;&nbsp;Géolocalisation</button>
</td>
</tr>
{/if}
</table>
</div>
{/if}
{/foreach}
</div>
<div class="modal fade" id="helpModalCenter" tabindex="-1">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button style="margin-top:0px;" type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">
<span aria-hidden="true">&times;</span>
</button>
<h5 class="modal-title" id="helpModalLongTitle">Segmentation</h5>
</div>
<div class="modal-body">
<br><p> A : plus de 200 patients / Semaine</p><br>
<p> B : 150 - 199 patients / Semaine</p><br>
<p"> C : 100 - 149 patients / Semaine</p><br>
<p> D : 50 - 99 patients / Semaine</p><br>
<p> E : 0 - 49 patients / Semaine</p><br><br>
<p> + : Pro SOPHAL</p><br>
<p> - : Pro Concurrent</p>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
{/strip}
<script>
$("#help").click(function(){
$('#helpModalCenter').modal('show');
});
function showLocation(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
document.getElementById("Accounts_editView_fieldName_cf_986").value = latitude;
document.getElementById("Accounts_editView_fieldName_cf_988").value = longitude;
}
function errorHandler(err) {
if(err.code == 1) {
alert("Erreur: Accès refusé");
} else if( err.code == 2) {
alert("Erreur: Votre position n'est pas disponible");
}
}
function getLocation() {
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position){
navigator.geolocation.getCurrentPosition(showLocation, errorHandler, { enableHighAccuracy: true, maximumAge: 1000, timeout: 6000 });
},function(){}, { maximumAge: 0, timeout: 6000 });
} else {
alert("Votre navigateur ne supporte pas la géolocalisation!");
}
}
</script>
<script>
$(document).ready(function() {
var res = $('#activitytype').val();
if(res == 'Focus'){
$("#focus").css("display", "block");
}
});
$('#activitytype').change(function() {
var res = $(this).val();
if(res == 'Focus'){
$("#focus").css("display", "block");
}else{
$("#focus").css("display", "none");
}
});
</script>