Add a line of filter in list of events related to thirdparty or projects
This commit is contained in:
parent
b952df32bc
commit
c1bf7c52f4
@ -203,7 +203,6 @@ dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action');
|
|||||||
* Documents models for supplier orders
|
* Documents models for supplier orders
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("AgendaModelModule"),'','');
|
|
||||||
|
|
||||||
// Define array def of models
|
// Define array def of models
|
||||||
$def = array();
|
$def = array();
|
||||||
@ -230,109 +229,114 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||||
print '<tr class="liste_titre">'."\n";
|
|
||||||
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
|
|
||||||
print '<td>'.$langs->trans("Description").'</td>'."\n";
|
|
||||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
|
|
||||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
|
|
||||||
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
|
|
||||||
print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
|
|
||||||
print '</tr>'."\n";
|
|
||||||
|
|
||||||
clearstatcache();
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
foreach ($dirmodels as $reldir)
|
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/action/doc/");
|
print load_fiche_titre($langs->trans("AgendaModelModule"),'','');
|
||||||
|
|
||||||
if (is_dir($dir))
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
|
print '<tr class="liste_titre">'."\n";
|
||||||
|
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>'."\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
|
||||||
|
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$handle=opendir($dir);
|
$dir = dol_buildpath($reldir."core/modules/action/doc/");
|
||||||
if (is_resource($handle))
|
|
||||||
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
$handle=opendir($dir);
|
||||||
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
$name = substr($file, 4, dol_strlen($file) -16);
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
require_once $dir.'/'.$file;
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
$module = new $classname($db, new ActionComm($db));
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
$var=!$var;
|
$module = new $classname($db, new ActionComm($db));
|
||||||
print "<tr ".$bc[$var].">\n";
|
|
||||||
print "<td>";
|
$var=!$var;
|
||||||
print (empty($module->name)?$name:$module->name);
|
print "<tr ".$bc[$var].">\n";
|
||||||
print "</td>\n";
|
print "<td>";
|
||||||
print "<td>\n";
|
print (empty($module->name)?$name:$module->name);
|
||||||
require_once $dir.$file;
|
print "</td>\n";
|
||||||
$module = new $classname($db,$specimenthirdparty);
|
print "<td>\n";
|
||||||
if (method_exists($module,'info'))
|
require_once $dir.$file;
|
||||||
print $module->info($langs);
|
$module = new $classname($db,$specimenthirdparty);
|
||||||
else
|
if (method_exists($module,'info'))
|
||||||
print $module->description;
|
print $module->info($langs);
|
||||||
print "</td>\n";
|
else
|
||||||
|
print $module->description;
|
||||||
// Active
|
print "</td>\n";
|
||||||
if (in_array($name, $def))
|
|
||||||
{
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
print '<td align="center">'."\n";
|
{
|
||||||
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
|
||||||
{
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
{
|
||||||
print '</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||||
}
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
else
|
print '</a>';
|
||||||
{
|
}
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
else
|
||||||
}
|
{
|
||||||
print "</td>";
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
}
|
}
|
||||||
else
|
print "</td>";
|
||||||
{
|
}
|
||||||
print '<td align="center">'."\n";
|
else
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
{
|
||||||
print "</td>";
|
print '<td align="center">'."\n";
|
||||||
}
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
// Default
|
}
|
||||||
print '<td align="center">';
|
|
||||||
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name")
|
// Default
|
||||||
{
|
print '<td align="center">';
|
||||||
print img_picto($langs->trans("Default"),'on');
|
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name")
|
||||||
}
|
{
|
||||||
else
|
print img_picto($langs->trans("Default"),'on');
|
||||||
{
|
}
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
else
|
||||||
}
|
{
|
||||||
print '</td>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
// Info
|
print '</td>';
|
||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
// Info
|
||||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
print '<td align="center">';
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||||
print '</td>';
|
print '<td align="center">';
|
||||||
print '<td align="center">';
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
print '</td>';
|
||||||
print '</td>';
|
print '<td align="center">';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||||
print "</tr>\n";
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
closedir($handle);
|
||||||
}
|
}
|
||||||
closedir($handle);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print '</table><br>';
|
||||||
}
|
}
|
||||||
print '</table><br>';
|
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
|||||||
@ -952,15 +952,16 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac
|
|||||||
* @param Conf $conf Object conf
|
* @param Conf $conf Object conf
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param DoliDB $db Object db
|
* @param DoliDB $db Object db
|
||||||
* @param Adherent|Societe $filterobj Object third party or member
|
* @param Adherent|Societe|Project $filterobj Object third party or member or project
|
||||||
* @param Contact $objcon Object contact
|
* @param Contact $objcon Object contact
|
||||||
* @param int $noprint Return string but does not output it
|
* @param int $noprint Return string but does not output it
|
||||||
* @param string $actioncode Filter on actioncode
|
* @param string $actioncode Filter on actioncode
|
||||||
* @param string $donetodo Filter on avent 'done' or 'todo' or ''=nofilter.
|
* @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter.
|
||||||
|
* @param array $filters Filter on other fields
|
||||||
* @return mixed Return html part or void if noprint is 1
|
* @return mixed Return html part or void if noprint is 1
|
||||||
* TODO change function to be able to list event linked to an object.
|
* TODO change function to be able to list event linked to an object.
|
||||||
*/
|
*/
|
||||||
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done')
|
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array())
|
||||||
{
|
{
|
||||||
global $bc,$user,$conf;
|
global $bc,$user,$conf;
|
||||||
global $form;
|
global $form;
|
||||||
@ -1000,6 +1001,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
if (!empty($actioncode)) $sql.= " AND c.code='".$actioncode."' ";
|
if (!empty($actioncode)) $sql.= " AND c.code='".$actioncode."' ";
|
||||||
if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||||
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||||
|
if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']);
|
||||||
$sql.= " ORDER BY a.datep DESC, a.id DESC";
|
$sql.= " ORDER BY a.datep DESC, a.id DESC";
|
||||||
|
|
||||||
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
||||||
@ -1144,7 +1146,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
$out.='<td></td>';
|
$out.='<td></td>';
|
||||||
}
|
}
|
||||||
$out.='<td></td>';
|
$out.='<td></td>';
|
||||||
$out.='<td></td>';
|
$out.='<td><input type="text" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||||
$out.='<td></td>';
|
$out.='<td></td>';
|
||||||
$out.='<td>';
|
$out.='<td>';
|
||||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||||
@ -1216,11 +1218,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
}
|
}
|
||||||
$out.="</td>\n";
|
$out.="</td>\n";
|
||||||
|
|
||||||
if($conf->global->AGENDA_USE_EVENT_TYPE) {
|
$out.='<td>';
|
||||||
$out.='<td>';
|
$out.=$actionstatic->type;
|
||||||
$out.=$actionstatic->type;
|
$out.='</td>';
|
||||||
$out.='</td>';
|
|
||||||
}
|
|
||||||
// Title of event
|
// Title of event
|
||||||
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';
|
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ else
|
|||||||
{
|
{
|
||||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||||
}
|
}
|
||||||
|
$search_agenda_label=GETPOST('search_agenda_label');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
@ -61,6 +62,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$actioncode='';
|
$actioncode='';
|
||||||
|
$search_agenda_label='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -163,7 +165,9 @@ if (!empty($object->id))
|
|||||||
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
||||||
|
|
||||||
// List of all actions
|
// List of all actions
|
||||||
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '');
|
$filters=array();
|
||||||
|
$filters['search_agenda_label']=$search_agenda_label;
|
||||||
|
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ else
|
|||||||
{
|
{
|
||||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||||
}
|
}
|
||||||
|
$search_agenda_label=GETPOST('search_agenda_label');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
@ -65,6 +66,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$actioncode='';
|
$actioncode='';
|
||||||
|
$search_agenda_label='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,7 +191,9 @@ if ($socid)
|
|||||||
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
||||||
|
|
||||||
// List of all actions
|
// List of all actions
|
||||||
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '');
|
$filters=array();
|
||||||
|
$filters['search_agenda_label']=$search_agenda_label;
|
||||||
|
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user