/**
  *  Assign custom values for canvas
  *
  *  @param	string		&$action    	Type of action
  *  @param	int			$id				Id
  *  @return	void
  */
 function assign_values(&$action, $id)
 {
     global $conf, $db, $langs, $user;
     global $form;
     $ret = $this->getObject($id);
     parent::assign_values($action, $id);
     $this->tpl['title'] = $this->getTitle($action);
     $this->tpl['error'] = $this->error;
     $this->tpl['errors'] = $this->errors;
     if ($action == 'view') {
         // Card header
         $head = contact_prepare_head($this->object);
         $title = $this->getTitle($action);
         $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', $title, 0, 'contact');
         $this->tpl['showend'] = dol_get_fiche_end();
         $objsoc = new Societe($db);
         $objsoc->fetch($this->object->socid);
         $this->tpl['actionstodo'] = show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1);
         $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1);
     } else {
         // Confirm delete contact
         if ($action == 'delete' && $user->rights->societe->contact->supprimer) {
             $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $this->object->id, $langs->trans("DeleteContact"), $langs->trans("ConfirmDeleteContact"), "confirm_delete", '', 0, 1);
         }
     }
     if ($action == 'list') {
         $this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
     }
 }
	/**
	 *    Assign custom values for canvas
	 *    @param      action     Type of action
	 */
	function assign_values($action='')
	{
		global $conf, $db, $langs, $user;
		global $form;

		parent::assign_values($action);

        $this->tpl['title'] = $this->getTitle($action);
        $this->tpl['error'] = $this->error;
        $this->tpl['errors']= $this->errors;

		if ($action == 'view')
		{
            // Card header
            $head = contact_prepare_head($this->object);
            $title = $this->getTitle($action);

		    $this->tpl['showhead']=dol_get_fiche_head($head, 'card', $title, 0, 'contact');
		    $this->tpl['showend']=dol_get_fiche_end();

			// Confirm delete contact
        	if ($user->rights->societe->contact->supprimer)
        	{
        		if ($_GET["action"] == 'delete')
        		{
        			$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
        		}
        	}

        	$objsoc = new Societe($db);
            $objsoc->fetch($this->object->fk_soc);

            $this->tpl['actionstodo']=show_actions_todo($conf,$langs,$db,$objsoc,$this->object,1);

            $this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1);
		}
	}