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

@ -59,6 +59,17 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
return $out; 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 * Assigne les valeurs POST dans l'objet
*/ */

View File

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

View File

@ -57,6 +57,15 @@ class Canvas
$this->db = $DB; $this->db = $DB;
} }
/**
* Set action type
*/
function setAction($action='view')
{
return $this->action = $action;
}
/** /**
* Return the title of card * Return the title of card
*/ */
@ -65,6 +74,14 @@ class Canvas
return $this->control->getTitle($this->action); 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 * Assigne les valeurs POST dans l'objet
*/ */
@ -73,14 +90,6 @@ class Canvas
return $this->control->assign_post(); return $this->control->assign_post();
} }
/**
* Set action type
*/
function setAction($action='view')
{
return $this->action = $action;
}
/** /**
* Execute actions * Execute actions
* @param Id of object (may be empty for creation) * @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][0] = DOL_URL_ROOT.'/societe/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'company'; $head[$h][2] = 'card';
$h++; $h++;
if ($objsoc->client==1 || $objsoc->client==3 || $objsoc->object->client==1 || $objsoc->object->client==3) 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][0] = DOL_URL_ROOT.'/contact/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'general'; $head[$h][2] = 'card';
$h++; $h++;
if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE) if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)

View File

@ -60,6 +60,17 @@ class ActionsCardDefault extends ActionsCardCommon
return $out; 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 * Assigne les valeurs POST dans l'objet
*/ */

View File

@ -60,6 +60,17 @@ class ActionsCardIndividual extends ActionsCardCommon
return $out; 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 * Assigne les valeurs POST dans l'objet
*/ */

View File

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