30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
35 $langs->loadLangs(array(
"companies",
"bills",
"propal",
"orders"));
37 if (
GETPOST(
'actioncode',
'array')) {
38 $actioncode =
GETPOST(
'actioncode',
'array', 3);
39 if (!count($actioncode)) {
43 $actioncode =
GETPOST(
"actioncode",
"alpha", 3) ?
GETPOST(
"actioncode",
"alpha", 3) : (
GETPOST(
"actioncode") ==
'0' ?
'0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
45 $search_agenda_label =
GETPOST(
'search_agenda_label');
48 $socid =
GETPOST(
'socid',
'int');
50 $socid = $user->socid;
54 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
55 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
56 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
58 if (empty($page) || $page == -1) {
61 $offset = $limit * $page;
62 $pageprev = $page - 1;
63 $pagenext = $page + 1;
65 $sortfield =
'a.datep,a.id';
68 $sortorder =
'DESC,DESC';
72 $hookmanager->initHooks(array(
'agendathirdparty'));
79 $parameters = array(
'id'=>$socid);
80 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
85 if (empty($reshook)) {
87 if (
GETPOST(
'cancel',
'alpha') && !empty($backtopage)) {
88 header(
"Location: ".$backtopage);
93 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
95 $search_agenda_label =
'';
108 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
109 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
112 $result = $object->fetch($socid);
114 $title = $langs->trans(
"Agenda");
115 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
116 $title = $object->name.
" - ".$title;
120 if (!empty($conf->notification->enabled)) {
121 $langs->load(
"mails");
125 print
dol_get_fiche_head($head,
'agenda', $langs->trans(
"ThirdParty"), -1,
'company');
127 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
129 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
131 print
'<div class="fichecenter">';
133 print
'<div class="underbanner clearboth"></div>';
135 $object->info($socid);
146 $objthirdparty = $object;
147 $objcon =
new stdClass();
150 $permok = $user->hasRight(
'agenda',
'myactions',
'create');
151 if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
152 if (is_object($objthirdparty) && get_class($objthirdparty) ==
'Societe') {
153 $out .=
'&originid='.$objthirdparty->id.($objthirdparty->id > 0 ?
'&socid='.$objthirdparty->id :
'').
'&backtopage='.urlencode($_SERVER[
'PHP_SELF'].($objthirdparty->id > 0 ?
'?socid='.$objthirdparty->id :
''));
155 $out .= (!empty($objcon->id) ?
'&contactid='.$objcon->id :
'').
'&percentage=-1';
156 $out .=
'&datep='.dol_print_date(
dol_now(),
'dayhourlog');
161 if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
162 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/comm/action/card.php?action=create'.$out);
166 if (
isModEnabled(
'agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
169 $param =
'&socid='.urlencode($socid);
170 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
171 $param .=
'&contextpage='.urlencode($contextpage);
173 if ($limit > 0 && $limit != $conf->liste_limit) {
174 $param .=
'&limit='.urlencode($limit);
177 print
load_fiche_titre($langs->trans(
"ActionsOnCompany"), $newcardbutton,
'');
182 $filters[
'search_agenda_label'] = $search_agenda_label;
185 show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_now($mode= 'auto')
Return date for now.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
show_actions_done($conf, $langs, $db, $filterobj, $objcon= '', $noprint=0, $actioncode= '', $donetodo= 'done', $filters=array(), $sortfield= 'a.datep, a.id', $sortorder= 'DESC', $module= '')
Show html area with actions (done or not, ignore the name of function).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
isModEnabled($module)
Is Dolibarr module enabled.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.