Works on contact canvas in relation to the thirdparty canvas module

This commit is contained in:
Regis Houssin 2010-11-05 08:28:49 +00:00
parent 9e8f1d3b32
commit e469ef2a7d
8 changed files with 57 additions and 21 deletions

View File

@ -58,6 +58,17 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
return $out;
}
/**
* Return the head of card (tabs)
*/
function showHead($action)
{
$head = contact_prepare_head($this->object);
$title = $this->getTitle($action);
return dol_fiche_head($head, 'card', $title, 0, 'contact');
}
/**
* Assigne les valeurs POST dans l'objet

View File

@ -284,9 +284,7 @@ if (! empty($canvas))
if ($result > 0)
{
// Card header
$head = contact_prepare_head($objcanvas->control->object);
$title = $objcanvas->getTitle();
dol_fiche_head($head, 'general', $title, 0, 'contact');
$objcanvas->showHead();
if ($_POST["name"])
{
@ -316,9 +314,7 @@ if (! empty($canvas))
if ($result > 0)
{
// Card header
$head = contact_prepare_head($objcanvas->control->object);
$title = $objcanvas->getTitle();
dol_fiche_head($head, 'general', $title, 0, 'contact');
$objcanvas->showHead();
// Assign values
$objcanvas->assign_values();
@ -377,7 +373,7 @@ else
*/
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'general', $langs->trans("Contact"), 0, 'contact');
dol_fiche_head($head, 'card', $langs->trans("Contact"), 0, 'contact');
}
if ($user->rights->societe->contact->creer)

View File

@ -56,6 +56,15 @@ class Canvas
{
$this->db = $DB;
}
/**
* Set action type
*/
function setAction($action='view')
{
return $this->action = $action;
}
/**
* Return the title of card
@ -64,6 +73,14 @@ class Canvas
{
return $this->control->getTitle($this->action);
}
/**
* Return the head of card (tabs)
*/
function showHead()
{
return $this->control->showHead($this->action);
}
/**
* Assigne les valeurs POST dans l'objet
@ -73,14 +90,6 @@ class Canvas
return $this->control->assign_post();
}
/**
* Set action type
*/
function setAction($action='view')
{
return $this->action = $action;
}
/**
* Execute actions
* @param Id of object (may be empty for creation)

View File

@ -41,7 +41,7 @@ function societe_prepare_head($objsoc)
$head[$h][0] = DOL_URL_ROOT.'/societe/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'company';
$head[$h][2] = 'card';
$h++;
if ($objsoc->client==1 || $objsoc->client==3 || $objsoc->object->client==1 || $objsoc->object->client==3)

View File

@ -41,7 +41,7 @@ function contact_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/contact/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'general';
$head[$h][2] = 'card';
$h++;
if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)

View File

@ -59,6 +59,17 @@ class ActionsCardDefault extends ActionsCardCommon
return $out;
}
/**
* Return the head of card (tabs)
*/
function showHead($action)
{
$head = societe_prepare_head($this->object);
$title = $this->getTitle($action);
return dol_fiche_head($head, 'card', $title, 0, 'company');
}
/**
* Assigne les valeurs POST dans l'objet

View File

@ -59,6 +59,17 @@ class ActionsCardIndividual extends ActionsCardCommon
return $out;
}
/**
* Return the head of card (tabs)
*/
function showHead($action)
{
$head = societe_prepare_head($this->object);
$title = $this->getTitle($action);
return dol_fiche_head($head, 'card', $title, 0, 'company');
}
/**
* Assigne les valeurs POST dans l'objet

View File

@ -461,9 +461,7 @@ if (! empty($canvas))
if ($result > 0)
{
// Card header
$head = societe_prepare_head($soccanvas->control->object);
$title = $soccanvas->getTitle();
dol_fiche_head($head, 'company', $title, 0, 'company');
$soccanvas->showHead();
// Assign values
$soccanvas->assign_values();
@ -1330,7 +1328,7 @@ else
$head = societe_prepare_head($soc);
dol_fiche_head($head, 'company', $langs->trans("ThirdParty"),0,'company');
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
$html = new Form($db);