Works on contact canvas in relation to the thirdparty canvas module

This commit is contained in:
Regis Houssin 2010-11-03 17:27:44 +00:00
parent 49ee01d586
commit ac85f14cb6
8 changed files with 26 additions and 48 deletions

View File

@ -67,10 +67,11 @@ class ActionsContactCardCommon
{
if ($conf->use_javascript_ajax)
{
$this->tpl['ajax_selectpays'] = "\n".'<script type="text/javascript" language="javascript">
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectpays_id").change(function() {
document.formsoc.action.value="'.$action.'";
document.formsoc.canvas.value="'.$canvas.'";
document.formsoc.submit();
});
})
@ -130,7 +131,7 @@ class ActionsContactCardCommon
if ($conf->mailing->enabled)
{
$langs->load("mails");
$this->tpl['nb_emailing'] = $object->getNbOfEMailings();
$this->tpl['nb_emailing'] = $this->object->getNbOfEMailings();
}
// Linked element

View File

@ -21,12 +21,13 @@
<!-- BEGIN PHP TEMPLATE -->
<?php echo $this->tpl['ajax_selectpays']; ?>
<?php echo $this->control->tpl['ajax_selectcountry']; ?>
<br>
<form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="action" value="add">
<?php if ($this->control->tpl['company_id']) { ?>
<input type="hidden" name="socid" value="<?php echo $this->control->tpl['company_id']; ?>">

View File

@ -21,12 +21,13 @@
<!-- BEGIN PHP TEMPLATE -->
<?php echo $this->tpl['ajax_selectpays']; ?>
<?php echo $this->control->tpl['ajax_selectcountry']; ?>
<br>
<form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST("id"); ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="id" value="<?php echo GETPOST("id"); ?>">
<input type="hidden" name="action" value="update">
<input type="hidden" name="contactid" value="<?php echo $this->control->tpl['id']; ?>">

View File

@ -71,6 +71,19 @@ class ActionsCardCommon
if ($action == 'create' || $action == 'edit')
{
if ($conf->use_javascript_ajax)
{
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectpays_id").change(function() {
document.formsoc.action.value="'.$action.'";
document.formsoc.canvas.value="'.$canvas.'";
document.formsoc.submit();
});
})
</script>'."\n";
}
// Load object modCodeClient
$module=$conf->global->SOCIETE_CODECLIENT_ADDON;
if (! $module) dolibarr_error('',$langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));

View File

@ -46,16 +46,7 @@ jQuery(document).ready(function () {
<input type="radio" id="radioprivate" class="flat" name="private" value="1"'<?php echo (! $_REQUEST["private"]?'':' checked="true"'); ?>> <?php echo $langs->trans("Individual"); ?> (<?php echo $langs->trans("ToCreateContactWithSameName") ?>)
<br>
<br>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectpays_id").change(function() {
document.formsoc.action.value="create";
document.formsoc.canvas.value="<?php echo $canvas ?>";
document.formsoc.submit();
});
});
</script>
<?php echo $this->control->tpl['ajax_selectcountry']; ?>
<?php } ?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST" name="formsoc">

View File

@ -21,17 +21,7 @@
<!-- BEGIN PHP TEMPLATE -->
<?php if ($conf->use_javascript_ajax) { ?>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectpays_id").change(function() {
document.formsoc.action.value="update";
document.formsoc.canvas.value="<?php echo $canvas ?>";
document.formsoc.submit();
});
});
</script>
<?php } ?>
<?php echo $this->control->tpl['ajax_selectcountry']; ?>
<form action="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id']; ?>" method="POST" name="formsoc">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">

View File

@ -46,16 +46,7 @@ jQuery(document).ready(function () {
<input type="radio" id="radioprivate" class="flat" name="private" value="1"'<?php echo (! $_REQUEST["private"]?'':' checked="true"'); ?>> <?php echo $langs->trans("Individual"); ?> (<?php echo $langs->trans("ToCreateContactWithSameName") ?>)
<br>
<br>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectpays_id").change(function() {
document.formsoc.action.value="create";
document.formsoc.canvas.value="<?php echo $canvas ?>";
document.formsoc.submit();
});
});
</script>
<?php echo $this->control->tpl['ajax_selectcountry']; ?>
<?php } ?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST" name="formsoc">

View File

@ -21,17 +21,7 @@
<!-- BEGIN PHP TEMPLATE -->
<?php if ($conf->use_javascript_ajax) { ?>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectpays_id").change(function() {
document.formsoc.action.value="update";
document.formsoc.canvas.value="<?php echo $canvas ?>";
document.formsoc.submit();
});
});
</script>
<?php } ?>
<?php echo $this->control->tpl['ajax_selectcountry']; ?>
<form action="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id']; ?>" method="POST" name="formsoc">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
@ -127,9 +117,9 @@ if ($this->control->tpl['fournisseur']) {
<tr>
<td><?php echo $langs->trans('Zip'); ?></td>
<td><input size="6" type="text" name="cp" value="<?php echo $this->control->tpl['cp']; ?>"><?php echo $this->control->tpl['autofilltownfromzip']; ?></td>
<td><?php echo $this->control->tpl['select_zip']; ?></td>
<td><?php echo $langs->trans('Town'); ?></td>
<td><input type="text" name="ville" value="<?php echo $this->control->tpl['ville']; ?>"></td>
<td><?php echo $this->control->tpl['select_town']; ?></td>
</tr>
<tr>