$objcon = new stdClass(); $out = ''; $permok = $user->rights->agenda->myactions->create; if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'; if (get_class($objthirdparty) == 'Societe') { $out .= '&socid=' . $objthirdparty->id; } $out .= (!empty($objcon->id) ? '&contactid=' . $objcon->id : '') . '&backtopage=1&percentage=-1'; //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.="</a>"; } print '<div class="tabsAction">'; if (!empty($conf->agenda->enabled)) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '">' . $langs->trans("AddAction") . '</a>'; } else { print '<a class="butActionRefused" href="#">' . $langs->trans("AddAction") . '</a>'; } } print '</div>'; print '<br>'; print load_fiche_titre($langs->trans("ActionsOnCompany"), '', ''); // List of todo actions show_actions_todo($conf, $langs, $db, $object, null, 0, 1); // List of done actions show_actions_done($conf, $langs, $db, $object); } llxFooter(); $db->close();
} // Add action if ($conf->agenda->enabled && !empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { if ($user->rights->agenda->myactions->create) { print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&socid=' . $objsoc->id . '">' . $langs->trans("AddAction") . '</a>'; } else { print '<a class="butAction" title="' . dol_escape_js($langs->trans("NotAllowed")) . '" href="#">' . $langs->trans("AddAction") . '</a>'; } } /*if ($user->rights->societe->contact->creer) { print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$objsoc->id.'&action=create">'.$langs->trans("AddContact").'</a>'; }*/ print '</div>'; print "<br>\n"; if (!empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { print '<br>'; // List of contacts show_contacts($conf, $langs, $db, $objsoc, $_SERVER["PHP_SELF"] . '?socid=' . $objsoc->id); } if (!empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { // List of todo actions show_actions_todo($conf, $langs, $db, $objsoc); // List of done actions show_actions_done($conf, $langs, $db, $objsoc); } } else { dol_print_error($db, 'Bad value for socid parameter'); } $db->close(); llxFooter('$Date: 2011/08/08 16:15:05 $ - $Revision: 1.283 $');
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&action=create\">".$langs->trans("AddContact")."</a>"; }*/ print '</div>'; print '<br>'; if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { print '<br>'; // List of contacts show_contacts($conf,$langs,$db,$societe,$_SERVER["PHP_SELF"].'?socid='.$societe->id); } if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { // List of todo actions show_actions_todo($conf,$langs,$db,$societe); // List of done actions show_actions_done($conf,$langs,$db,$societe); } } else { dol_print_error($db); } $db->close(); llxFooter('$Date: 2011/07/31 23:57:03 $ - $Revision: 1.140 $'); ?>
/** * 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); } }