From bac318240cbddc098c1fb88d62f2cea4e492774f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Nov 2010 18:41:09 +0000 Subject: [PATCH] New: Add a button to jump to calendar from action card --- htdocs/comm/action/class/actioncomm.class.php | 4 +- htdocs/comm/action/fiche.php | 74 +++++++++++-------- htdocs/comm/action/index.php | 74 +++++++++++-------- 3 files changed, 87 insertions(+), 65 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 6338501afbd..85ce14aba3c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -597,7 +597,7 @@ class ActionComm extends CommonObject /** * Export events from database into a cal file. - * @param format 'ical' or 'vcal' + * @param format 'vcal', 'ical/ics', 'rss' * @param type 'event' or 'journal' * @param cachedelay Do not rebuild file if date older than cachedelay seconds * @param filename Force filename @@ -782,8 +782,8 @@ class ActionComm extends CommonObject } // Write file + if ($format == 'vcal') $result=build_calfile($format,$title,$desc,$eventarray,$outputfiletmp); if ($format == 'ical') $result=build_calfile($format,$title,$desc,$eventarray,$outputfiletmp); - if ($format == 'vcal') $result=build_calfile($format,$title,$desc,$eventarray,$outputfiletmp); if ($format == 'rss') $result=build_rssfile($format,$title,$desc,$eventarray,$outputfiletmp); if ($result >= 0) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 446fbc7cd01..b9dd6a77846 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -491,9 +491,6 @@ if (GETPOST('action') == 'create') // Title print ''.$langs->trans("Title").''; - // Location - print ''.$langs->trans("Location").''; - // Full day print ''.$langs->trans("EventOnFullDay").''; @@ -510,7 +507,7 @@ if (GETPOST('action') == 'create') else $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); print ''; - // Avancement + // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print ''; $percent=0; @@ -526,8 +523,13 @@ if (GETPOST('action') == 'create') print $htmlactions->form_select_status_action('formaction',$percent,1); print ''; + // Location + print ''.$langs->trans("Location").''; + print ''; + print '
'; + print ''; // Affected by @@ -594,12 +596,12 @@ if (GETPOST('action') == 'create') add_row_for_calendar_link(); - // Note - print ''; + // Description + print ''; print '
'.$langs->trans("Note").''; - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),280,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); - $doleditor->Create(); - print '
'.$langs->trans("Description").''; + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),280,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); + $doleditor->Create(); + print '
'; @@ -723,9 +725,6 @@ if ($id) // Title print ''.$langs->trans("Title").''; - // Location - print ''.$langs->trans("Location").''; - // Full day event print ''.$langs->trans("EventOnFullDay").'fulldayevent?' checked="true"':'').'>'; @@ -748,6 +747,9 @@ if ($id) print $htmlactions->form_select_status_action('formaction',$percent,1); print ''; + // Location + print ''.$langs->trans("Location").''; + print '
'; // Input by @@ -807,13 +809,13 @@ if ($id) print ''; } - // Note - print ''; + // Description + print ''; print '
'.$act->objet_url.'
'.$langs->trans("Note").''; - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note',$act->note,240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); - $doleditor->Create(); - print '
'.$langs->trans("Description").''; + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',$act->note,240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_5,90); + $doleditor->Create(); + print '
'; @@ -839,21 +841,28 @@ if ($id) // Title print ''.$langs->trans("Title").''.$act->label.''; - // Location - print ''.$langs->trans("Location").''.$act->location.''; - // Full day event print ''.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).''; - // Date debut - print ''.$langs->trans("DateActionStart").''; + // Date start + print ''.$langs->trans("DateActionStart").''; if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); else print dol_print_date($act->datep,'day'); if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print ''; + print ''; + print ''."\n"; + print '
'; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print '
'."\n"; + print ''; + print ''; - // Date fin - print ''.$langs->trans("DateActionEnd").''; + // Date end + print ''.$langs->trans("DateActionEnd").''; if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); else print dol_print_date($act->datef,'day'); if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); @@ -864,6 +873,9 @@ if ($id) print $act->getLibStatut(4); print ''; + // Location + print ''.$langs->trans("Location").''.$act->location.''; + print '
'; // Input by @@ -884,7 +896,7 @@ if ($id) print '

'; - // Societe - contact + // Third party - Contact print ''; } - // Note - print ''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 0d5639a9ba6..66596ba399f 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -179,6 +179,7 @@ $sql.= ' a.datea,'; $sql.= ' a.datea2,'; $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; +$sql.= ' a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; @@ -252,6 +253,10 @@ if ($resql) $action->usertodo->id=$obj->fk_user_action; $action->userdone->id=$obj->fk_user_done; + $action->priority=$obj->priority; + $action->fulldayevent=$obj->fulldayevent; + $action->location=$obj->location; + $action->societe->id=$obj->fk_soc; $action->contact->id=$obj->fk_contact; @@ -558,38 +563,43 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); if ($act->societe->id && $act->type_code == 'AC_TEL') { @@ -939,8 +951,8 @@ if ($id) print ''.$act->objet_url.'
'.$langs->trans("Note").''; + // Description + print '
'.$langs->trans("Description").''; print dol_htmlentitiesbr($act->note); print '
'; if ($action->type_code != 'BIRTHDAY') { - $tmpyearstart = date('Y',$action->date_start_in_calendar); - $tmpmonthstart = date('m',$action->date_start_in_calendar); - $tmpdaystart = date('d',$action->date_start_in_calendar); - $tmpyearend = date('Y',$action->date_end_in_calendar); - $tmpmonthend = date('m',$action->date_end_in_calendar); - $tmpdayend = date('d',$action->date_end_in_calendar); - // Hour start - if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) - { - print dol_print_date($action->date_start_in_calendar,'%H:%M'); - if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar) - { - if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) - print '-'; - //else - //print '...'; - } - } - if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar) - { - if ($tmpyearstart != $tmpyearend || $tmpmonthstart != $tmpmonthend || $tmpdaystart != $tmpdayend) - { - print '...'; - } - } - // Hour end - if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar) - { - if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) - print dol_print_date($action->date_end_in_calendar,'%H:%M'); - } - print '
'; + if (empty($action->fulldayevent)) + { + // Show hours (start ... end) + $tmpyearstart = date('Y',$action->date_start_in_calendar); + $tmpmonthstart = date('m',$action->date_start_in_calendar); + $tmpdaystart = date('d',$action->date_start_in_calendar); + $tmpyearend = date('Y',$action->date_end_in_calendar); + $tmpmonthend = date('m',$action->date_end_in_calendar); + $tmpdayend = date('d',$action->date_end_in_calendar); + // Hour start + if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) + { + print dol_print_date($action->date_start_in_calendar,'%H:%M'); + if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar) + { + if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) + print '-'; + //else + //print '...'; + } + } + if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar) + { + if ($tmpyearstart != $tmpyearend || $tmpmonthstart != $tmpmonthend || $tmpdaystart != $tmpdayend) + { + print '...'; + } + } + // Hour end + if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar) + { + if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) + print dol_print_date($action->date_end_in_calendar,'%H:%M'); + } + print '
'; + } + // If action related to company / contact $linerelatedto='';$length=16; if (! empty($action->societe->id) && ! empty($action->contact->id)) $length=8;