diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 653fd617a06..7665ce9986a 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -218,7 +218,7 @@ jQuery(document).ready(function() { } init_myfunc(); jQuery("#mybutton").click(function() { - init_needroot(); + init_myfunc(); }); }); '; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 5da5fa621c6..5c06109219b 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -1,8 +1,8 @@ +/* Copyright (C) 2008-2015 Laurent Destailleur * Copyright (C) 2011 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -137,6 +137,11 @@ print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print "
\n"; +print '
'; +print ''; +print ''; + + $head=agenda_prepare_head(); dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"), 0, 'action'); @@ -145,10 +150,6 @@ print $langs->trans("AgendaAutoActionDesc")."
\n"; print $langs->trans("OnlyActiveElementsAreShown").'
'; print "
\n"; -print ''; -print ''; -print ''; - $var=true; print ''; print ''; @@ -185,13 +186,14 @@ if (! empty($triggers)) } print '
'; -print '
'; +dol_fiche_end(); + +print '
'; print ''; print "
"; print "\n"; -dol_fiche_end(); print "
"; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index c1a9ec3afd2..633b62f2316 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2015 Laurent Destailleur * Copyright (C) 2011-2015 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * @@ -127,6 +127,10 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print '
'; +print '
'; +print ''; +print ''; + $head=agenda_prepare_head(); dol_fiche_head($head, 'extsites', $langs->trans("Agenda"), 0, 'action'); @@ -134,7 +138,6 @@ dol_fiche_head($head, 'extsites', $langs->trans("Agenda"), 0, 'action'); print $langs->trans("AgendaExtSitesDesc")."
\n"; print "
\n"; -print ''; $selectedvalue=$conf->global->AGENDA_DISABLE_EXT; if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1; @@ -219,7 +222,8 @@ while ($i <= $MAXAGENDA) } print ''; -print '
'; + +dol_fiche_end(); print '
'; print ''; @@ -227,7 +231,6 @@ print '
'; print "
\n"; -dol_fiche_end(); llxFooter(); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index f0d9f2ca00d..f892fe7149a 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -1,7 +1,7 @@ +/* Copyright (C) 2008-2015 Laurent Destailleur * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify @@ -93,17 +93,16 @@ print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print "
\n"; + +print '
'; +print ''; + $head=agenda_prepare_head(); dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action'); -//print_titre($langs->trans("OtherOptions")); - $var=true; -print ''; -print ''; - print ''."\n"; print ''."\n"; print ''."\n"; @@ -158,11 +157,12 @@ print ''."\n"; print '
'.$langs->trans("Parameters").'
'; +dol_fiche_end(); + print '
'; print '
'; -dol_fiche_end(); print "
"; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index d196664bdf9..f7abde2280e 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2015 Laurent Destailleur * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry @@ -78,6 +78,9 @@ print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print '
'; +print '
'; +print ''; + $head=agenda_prepare_head(); dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), 0, 'action'); @@ -85,18 +88,16 @@ dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), 0, 'action'); print $langs->trans("AgendaSetupOtherDesc")."
\n"; print "
\n"; -print ''; -print ''; -print ""; +print '
'; -print ""; +print ''; print ""; print ""; //print ""; print ""; print ""; -print ""; +print ""; print '"; print ''; print ""; print ""; -print ""; +print ""; print ""; print ""; print ""; print ""; -print ""; +print ""; print ""; print ""; print ""; @@ -121,13 +122,13 @@ print '
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
'.$langs->trans("PasswordTogetVCalExport")."'; if (! empty($conf->use_javascript_ajax)) @@ -105,13 +106,13 @@ print ' 
".$langs->trans("PastDelayVCalExport")."global->MAIN_AGENDA_EXPORT_PAST_DELAY) . "\" size=\"10\"> ".$langs->trans("days")." 
".$langs->trans("UseACacheDelay")."global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\"> 
'; print '
'; -print ""; +print '
'; -print ""; +print ''; print '"; print ""; print ""; -print ""; +print ""; print '"; print ""; print '
'.$langs->trans("Parameter")."".$langs->trans("Value")."
'.$langs->trans("FixTZ").""; print ''; @@ -137,13 +138,14 @@ print "
'; -print '
'; +dol_fiche_end(); + +print '
'; print "trans("Save")."\">"; print "
"; print "\n"; -dol_fiche_end(); clearstatcache(); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 9a4b9c2cf36..75d18dd8cd5 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -924,9 +924,66 @@ if ($id > 0) print ''.$langs->trans("DateActionEnd").''; if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); + //else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend','ap'); else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); print ''; + $userepeatevent=0; // Dev in progress + if ($userepeatevent) + { + // Repeat + print ''.$langs->trans("RepeatEvent").''; + print ''; + $arrayrecurrulefreq=array( + 'no'=>$langs->trans("No"), + 'MONTHLY'=>$langs->trans("EveryMonth"), + 'WEEKLY'=>$langs->trans("EveryWeek"), + //'DAYLY'=>$langs->trans("EveryDay") + ); + $selectedrecurrulefreq='no'; + $selectedrecurrulebymonthday=''; + $selectedrecurrulebyday=''; + if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i',$object->recurrule,$reg)) $selectedrecurrulefreq=$reg[1]; + if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebymonthday=$reg[1]; + if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebyday=$reg[1]; + print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq); + // If recurrulefreq is MONTHLY + print '
'; + print $langs->trans("DayOfMonth").': '; + print '
'; + // If recurrulefreq is WEEKLY + print '
'; + print $langs->trans("DayOfWeek").': '; + print '
'; + print ''; + print ''; + } + // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$object->percentage; @@ -1000,17 +1057,15 @@ if ($id > 0) // Project if (! empty($conf->projet->enabled)) { - $formproject=new FormProjets($db); - // Projet associe $langs->load("project"); print ''.$langs->trans("Project").''; $numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid'); if ($numprojet==0) { - print '  
'.$langs->trans("AddProject").''; + print '   '.$langs->trans("AddProject").''; } print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ae32636caa6..74188b069fa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4031,14 +4031,15 @@ class Form * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only * @param string $form_name Not used * @param int $d 1=Show days, month, years - * @param int $addnowbutton Add a button "Now" + * @param int $addnowlink Add a link "Now" * @param int $nooutput Do not output html string but return it * @param int $disabled Disable input fields * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 + * @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field. * @return mixed Nothing or string if nooutput is 1 * @see form_date */ - function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='') + function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='') { global $conf,$langs; @@ -4191,7 +4192,7 @@ class Form if ($h) { // Show hour - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($hour = 0; $hour < 24; $hour++) { @@ -4205,7 +4206,7 @@ class Form if ($m) { // Show minutes - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($min = 0; $min < 60 ; $min++) { @@ -4215,14 +4216,18 @@ class Form $retstring.=''; } - // Add a "Now" button - if ($conf->use_javascript_ajax && $addnowbutton) + // Add a "Now" link + if ($conf->use_javascript_ajax && $addnowlink) { - // Script which will be inserted in the OnClick of the "Now" button + // Script which will be inserted in the onClick of the "Now" link $reset_scripts = ""; // Generate the date part, depending on the use or not of the javascript calendar - if ($usecalendar == "eldy") + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(),'day').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(),'%d').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(),'%m').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(),'%Y').'\');'; + /*if ($usecalendar == "eldy") { $base=DOL_URL_ROOT.'/core/'; $reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');'; @@ -4232,30 +4237,66 @@ class Form $reset_scripts .= 'this.form.elements[\''.$prefix.'day\'].value=formatDate(new Date(), \'d\'); '; $reset_scripts .= 'this.form.elements[\''.$prefix.'month\'].value=formatDate(new Date(), \'M\'); '; $reset_scripts .= 'this.form.elements[\''.$prefix.'year\'].value=formatDate(new Date(), \'yyyy\'); '; - } - // Generate the hour part + }*/ + // Update the hour part if ($h) { if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; - $reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; + //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(),'%H').'\');'; if ($fullday) $reset_scripts .= ' } '; } - // Generate the minute part + // Update the minute part if ($m) { if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; - $reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; + //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(),'%M').'\');'; if ($fullday) $reset_scripts .= ' } '; } - // If reset_scripts is not empty, print the button with the reset_scripts in OnClick + // If reset_scripts is not empty, print the link with the reset_scripts in the onClick if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { - $retstring.=' '; } } + // Add a "Plus one hour" link + if ($conf->use_javascript_ajax && $addplusone) + { + // Script which will be inserted in the onClick of the "Add plusone" link + $reset_scripts = ""; + + // Generate the date part, depending on the use or not of the javascript calendar + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(),'day').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(),'%d').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(),'%m').'\');'; + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(),'%Y').'\');'; + // Update the hour part + if ($h) + { + if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(),'%H').'\');'; + if ($fullday) $reset_scripts .= ' } '; + } + // Update the minute part + if ($m) + { + if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(),'%M').'\');'; + if ($fullday) $reset_scripts .= ' } '; + } + // If reset_scripts is not empty, print the link with the reset_scripts in the onClick + if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) + { + $retstring.=' '; + } + } + if (! empty($nooutput)) return $retstring; print $retstring; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index ac30b5685be..41f182b1456 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -97,3 +97,9 @@ ActionType=Event type DateActionBegin=Start event date CloneAction=Clone event ConfirmCloneEvent=Are you sure you want to clone the event %s ? +RepeatEvent=Repeat event +EveryWeek=Every week +EveryMonth=Every month +DayOfMonth=Day of month +DayOfWeek=Day of week +DateStartPlusOne=Date start + 1 hour \ No newline at end of file diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3a01e80c4ba..1281e24358e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -502,7 +502,7 @@ if ($action == 'create' && $user->rights->projet->creer) // Budget print ''.$langs->trans("Budget").''; - print ''; + print ''; print ''; // Description @@ -664,7 +664,7 @@ else // Budget print ''.$langs->trans("Budget").''; - print ''; + print ''; print ''; // Description @@ -767,7 +767,7 @@ else if ($action == 'edit' && $userWrite > 0) { print '
'; - print '     '; + print '     '; print ''; print '
'; }