New: Add hook "searchAgendaFrom".

This commit is contained in:
Laurent Destailleur 2014-06-29 02:45:55 +02:00
parent a96655c363
commit 330c965cb9
7 changed files with 49 additions and 37 deletions

View File

@ -5,15 +5,16 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
New: [ task #867 ] Remove ESAEB external module code from core.
New: Can create proposal from an intervention.
New: Can filter events on a group of users.
- New: [ task #867 ] Remove ESAEB external module code from core.
- New: Can create proposal from an intervention.
- New: Can filter events on a group of users.
- New: Add thirdparty to filter on events.
For translators:
- Update language files.
For developers:
-
- New: Add hook "searchAgendaFrom".
***** ChangeLog for 3.6 compared to 3.5.* *****

View File

@ -56,9 +56,10 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="a.datec";
// Security check
$socid = GETPOST("socid","int",1);
$socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
if ($socid < 0) $socid='';
$canedit=1;
if (! $user->rights->agenda->myactions->read) accessforbidden();
@ -102,6 +103,8 @@ $langs->load("agenda");
$langs->load("other");
$langs->load("commercial");
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('agenda'));
/*
@ -993,7 +996,7 @@ else // View by day
$timestamp=dol_mktime(12,0,0,$month,$day,$year);
$arraytimestamp=dol_getdate($timestamp);
echo '<table width="100%" class="nocellnopadd">';
echo '<table width="100%" class="nocellnopadd cal_month">';
echo ' <tr class="liste_titre">';
echo ' <td align="center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
echo " </tr>\n";

View File

@ -78,6 +78,7 @@ if (! $sortfield)
$socid = GETPOST("socid",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
if ($socid < 0) $socid='';
$canedit=1;
if (! $user->rights->agenda->myactions->read) accessforbidden();
@ -89,6 +90,8 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
$filterd=$user->id;
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('agendalist'));
/*
@ -192,7 +195,7 @@ if ($resql)
if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions");
if ($socid)
/*if ($socid)
{
$societe = new Societe($db);
$societe->fetch($socid);
@ -201,8 +204,8 @@ if ($resql)
else
{
$newtitle=$langs->trans($title);
}
}*/
$newtitle=$langs->trans($title);
$tabactive='';
if ($action == 'show_month') $tabactive='cardmonth';
@ -210,10 +213,10 @@ if ($resql)
if ($action == 'show_day') $tabactive='cardday';
if ($action == 'show_list') $tabactive='cardlist';
$head = calendars_prepare_head('');
$head = calendars_prepare_head($param);
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'');
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'',0);
dol_fiche_end();
// Add link to show birthdays

View File

@ -671,7 +671,7 @@ class Form
* Return HTML code to select a company.
*
* @param int $selected Preselected products
* @param string $htmlname Name of HTML seletc field (must be unique in page)
* @param string $htmlname Name of HTML select field (must be unique in page)
* @param int $filter Filter on thirdparty
* @param int $limit Limit on number of returned lines
* @param array $ajaxoptions Options for ajax_autocompleter

View File

@ -46,7 +46,7 @@
*/
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $usergroupid='')
{
global $conf, $user, $langs, $db;
global $conf, $user, $langs, $db, $hookmanager;
// Filters
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
@ -59,10 +59,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
//print '<table class="nobordernopadding" width="100%">';
//print '<tr><td class="nowrap">';
if (! empty($conf->browser->phone)) print '<div class="fichehalfleft">';
else print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
print '<table class="nobordernopadding">';
@ -110,6 +108,16 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '</td></tr>';
}
if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
{
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Thirdpary").' &nbsp; ';
print '</td><td class="nowrap maxwidthonsmartphone">';
print $form->select_thirdparty($socid, 'socid');
print '</td></tr>';
}
if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
@ -123,37 +131,29 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '</td></tr>';
}
// Hooks
$parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid);
$reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been
print '</table>';
//print '</td>';
print '</div>';
if (! empty($conf->browser->phone)) print '</div>';
else print '</td>';
// Buttons
/*print '<td align="center" valign="middle" class="nowrap">';
print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="' . $langs->trans("ViewCal") . '">';
print '<br>';
print img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="' . $langs->trans("ViewWeek") . '">';
print '<br>';
print img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewday" value="' . $langs->trans("ViewDay") . '">';
print '<br>';
print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="' . $langs->trans("ViewList") . '">';
print '</td>';*/
//print '<td align="center" valign="middle" class="nowrap">';
print '<div class="fichehalfright" valign="middle">';
if (! empty($conf->browser->phone)) print '<div class="fichehalfright" valign="middle">';
else print '<td align="center" valign="middle" class="nowrap">';
print '<table><tr><td align="center">';
print '<div class="formleftzone">';
print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="' . $langs->trans("Refresh") . '">';
print '</div>';
print '</td></tr>';
print '</table>';
print '</div>';
if (! empty($conf->browser->phone)) print '</div>';
else print '</td></tr></table>';
print '</div>';
print '</div>'; // Close fichecenter
print '<div style="clear:both"></div>';
print '</form>';
@ -471,6 +471,10 @@ function calendars_prepare_head($param)
$head[$h][2] = 'cardlist';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:'');
$head[$h][1] = $langs->trans("ViewPerUser");
$head[$h][2] = 'cardperuser';
$h++;
$object=new stdClass();

View File

@ -33,6 +33,7 @@ ViewList=List view
ViewCal=Month view
ViewDay=Day view
ViewWeek=Week view
ViewPerUser=Per user
ViewWithPredefinedFilters= View with predefined filters
AutoActions= Automatic filling
AgendaAutoActionDesc= Define here events for which you want Dolibarr to create automatically an event in agenda. If nothing is checked (by default), only manual actions will be included in agenda.

View File

@ -2271,7 +2271,7 @@ li.cal_event { border: none; list-style-type: none; }
/* Ajax - Liste deroulante de l'autocompletion */
/* ============================================================================== */
.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff; }
.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; }
.ui-autocomplete-loading { background: white url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/working.gif',1) ?>) right center no-repeat; }
.ui-autocomplete {