Merge pull request #1982 from atm-alexis/feature_agenda_files_on_card_view

add files view into agenda card
This commit is contained in:
Laurent Destailleur 2014-11-22 16:24:09 +01:00
commit 8b545af325
2 changed files with 38 additions and 0 deletions

View File

@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -74,6 +76,7 @@ $cactioncomm = new CActionComm($db);
$object = new ActionComm($db);
$contact = new Contact($db);
$extrafields = new ExtraFields($db);
$formfile = new FormFile($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@ -1243,6 +1246,34 @@ if ($id > 0)
if ($action != 'edit')
{
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) {
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
/*
* Documents generes
*/
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
$genallowed=$user->rights->agenda->myactions->create;
$delallowed=$user->rights->agenda->myactions->delete;
$var=true;
$somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</div></div></div>';
print '<div style="clear:both;">&nbsp;</div>';
}
// Link to agenda views
print '<div id="agendaviewbutton">';
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';

View File

@ -301,6 +301,12 @@ class FormFile
$modellist=ModeleThirdPartyDoc::liste_modeles($this->db);
}
}
else if ($modulepart == 'agenda')
{
null;
}
else if ($modulepart == 'propal')
{
if (is_array($genallowed)) $modellist=$genallowed;
@ -433,6 +439,7 @@ class FormFile
}
else
{
// For normalized standard modules
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
if (file_exists($file))