Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
3c7ad3d58c
@ -35,8 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
$langs->load("companies");
|
||||
$langs->load("members");
|
||||
|
||||
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
|
||||
// Security check
|
||||
@ -70,7 +68,7 @@ $form = new Form($db);
|
||||
/*
|
||||
* Fiche categorie de client et/ou fournisseur
|
||||
*/
|
||||
if ($id)
|
||||
if ($object->id > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
@ -133,9 +131,6 @@ if ($id)
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'action
|
||||
*/
|
||||
@ -144,7 +139,9 @@ if ($id)
|
||||
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
|
||||
// FIXME socid parameters is not valid, a member is not a thirparty
|
||||
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -473,7 +473,7 @@ llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adh
|
||||
|
||||
if ($rowid)
|
||||
{
|
||||
$res=$object->fetch($rowid,$ref);
|
||||
$res=$object->fetch($rowid);
|
||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||
//$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
//if ($res < 0) { dol_print_error($db); exit; }
|
||||
@ -558,10 +558,10 @@ if ($rowid)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
|
||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valeur">';
|
||||
if ($_GET['action'] == 'editthirdparty')
|
||||
if ($action == 'editthirdparty')
|
||||
{
|
||||
$htmlname='socid';
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="form'.$htmlname.'">';
|
||||
@ -813,7 +813,7 @@ if ($rowid)
|
||||
print '<input type="hidden" name="action" value="cotisation">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
|
||||
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($company->name).'">';
|
||||
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->name).'">';
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
|
||||
$today=dol_now();
|
||||
@ -822,16 +822,16 @@ if ($rowid)
|
||||
$paymentdate=-1;
|
||||
|
||||
// Date payment
|
||||
if ($_POST["paymentyear"] && $_POST["paymentmonth"] && $_POST["paymentday"])
|
||||
if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday'))
|
||||
{
|
||||
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
|
||||
$paymentdate=dol_mktime(0, 0, 0, GETPOST('paymentmonth'), GETPOST('paymentday'), GETPOST('paymentyear'));
|
||||
}
|
||||
|
||||
// Date start subscription
|
||||
print '<tr><td width="30%" class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>';
|
||||
if ($_POST["reday"])
|
||||
if (GETPOST('reday'))
|
||||
{
|
||||
$datefrom=dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
|
||||
$datefrom=dol_mktime(0,0,0,GETPOST('remonth'),GETPOST('reday'),GETPOST('reyear'));
|
||||
}
|
||||
if (! $datefrom)
|
||||
{
|
||||
@ -848,9 +848,9 @@ if ($rowid)
|
||||
print "</td></tr>";
|
||||
|
||||
// Date end subscription
|
||||
if ($_POST["endday"])
|
||||
if (GETPOST('endday'))
|
||||
{
|
||||
$dateto=dol_mktime(0,0,0,$_POST["endmonth"],$_POST["endday"],$_POST["endyear"]);
|
||||
$dateto=dol_mktime(0,0,0,GETPOST('endmonth'),GETPOST('endday'),GETPOST('endyear'));
|
||||
}
|
||||
if (! $dateto)
|
||||
{
|
||||
@ -863,7 +863,7 @@ if ($rowid)
|
||||
if ($adht->cotisation)
|
||||
{
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.GETPOST('cotisation').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
@ -926,33 +926,33 @@ if ($rowid)
|
||||
|
||||
// Bank account
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("FinancialAccount").'</td><td>';
|
||||
$form->select_comptes($_POST["accountid"],'accountid',0,'',1);
|
||||
$form->select_comptes(GETPOST('accountid'),'accountid',0,'',1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Payment mode
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$form->select_types_paiements($_POST["operation"],'operation','',2);
|
||||
$form->select_types_paiements(GETPOST('operation'),'operation','',2);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Date of payment
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
||||
$form->select_date($paymentdate?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1);
|
||||
$form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero');
|
||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
print '</td>';
|
||||
print '<td><input id="fieldnum_chq" name="num_chq" type="text" size="8" value="'.(empty($_POST['num_chq'])?'':$_POST['num_chq']).'"></td></tr>';
|
||||
print '<td><input id="fieldnum_chq" name="num_chq" type="text" size="8" value="'.(! GETPOST('num_chq')?'':GETPOST('num_chq')).'"></td></tr>';
|
||||
|
||||
print '<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans('CheckTransmitter');
|
||||
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||
print '</td>';
|
||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->name:$_POST['chqemetteur']).'"></td></tr>';
|
||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(! GETPOST('chqemetteur')?'':GETPOST('chqemetteur')).'"></td></tr>';
|
||||
|
||||
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Bank');
|
||||
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||
print '</td>';
|
||||
print '<td><input id="chqbank" name="chqbank" size="32" type="text" value="'.(empty($_POST['chqbank'])?'':$_POST['chqbank']).'"></td></tr>';
|
||||
print '<td><input id="chqbank" name="chqbank" size="32" type="text" value="'.(! GETPOST('chqbank')?'':GETPOST('chqbank')).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -972,7 +972,7 @@ if ($rowid)
|
||||
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
|
||||
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
|
||||
|
||||
$tmp='<input name="sendmail" type="checkbox"'.((isset($_POST["sendmail"])?$_POST["sendmail"]:$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked="checked"':'').'>';
|
||||
$tmp='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail')?GETPOST('sendmail'):(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked="checked"':'')).'>';
|
||||
$helpcontent='';
|
||||
$helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
|
||||
$helpcontent.='<b>'.$langs->trans("MailRecipient").'</b>: '.$object->email.'<br>'."\n";
|
||||
|
||||
@ -196,8 +196,7 @@ if ($id > 0)
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&socid='.$societe->id;
|
||||
$formfile->list_of_documents($filearray,$member,'member',$param, 0, get_exdir($member->id,2,0,1).'/'.$member->id.'/');
|
||||
$formfile->list_of_documents($filearray,$member,'member','', 0, get_exdir($member->id,2,0,1).'/'.$member->id.'/');
|
||||
|
||||
print "<br><br>";
|
||||
}
|
||||
|
||||
@ -52,9 +52,6 @@ $typeid=GETPOST('typeid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
|
||||
|
||||
if (! empty($conf->mailmanspip->enabled))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
@ -78,6 +75,9 @@ if (! empty($canvas))
|
||||
$objcanvas->getCanvas('adherent', 'membercard', $canvas);
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
|
||||
|
||||
$errmsg=''; $errmsgs=array();
|
||||
|
||||
if ($rowid > 0)
|
||||
@ -735,7 +735,7 @@ else
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
$object->canvas=$canvas;
|
||||
$object->fk_departement = $_POST["departement_id"];
|
||||
$object->fk_departement = GETPOST('departement_id', 'int');
|
||||
|
||||
// We set country_id, country_code and country for the selected country
|
||||
$object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id;
|
||||
@ -905,7 +905,7 @@ else
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):$object->array_options["options_".$key]);
|
||||
$value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
|
||||
print '<tr><td';
|
||||
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
||||
print '>'.$label.'</td><td>';
|
||||
@ -1235,7 +1235,7 @@ else
|
||||
dol_htmloutput_errors($errmsg,$errmsgs);
|
||||
|
||||
// Confirm create user
|
||||
if ($_GET["action"] == 'create_user')
|
||||
if ($action == 'create_user')
|
||||
{
|
||||
$login=$object->login;
|
||||
if (empty($login))
|
||||
@ -1261,7 +1261,7 @@ else
|
||||
}
|
||||
|
||||
// Confirm create third party
|
||||
if ($_GET["action"] == 'create_thirdparty')
|
||||
if ($action == 'create_thirdparty')
|
||||
{
|
||||
$name = $object->getFullName($langs);
|
||||
if (! empty($name))
|
||||
@ -1348,7 +1348,7 @@ else
|
||||
|
||||
// Cree un tableau formulaire
|
||||
$formquestion=array();
|
||||
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?'true':'false'));
|
||||
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
|
||||
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
|
||||
$ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
|
||||
if ($ret == 'html') print '<br>';
|
||||
@ -1495,10 +1495,10 @@ else
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
|
||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($_GET['action'] == 'editthirdparty')
|
||||
if ($action == 'editthirdparty')
|
||||
{
|
||||
$htmlname='socid';
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="form'.$htmlname.'">';
|
||||
@ -1533,7 +1533,7 @@ else
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrUser");
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer)
|
||||
if ($action != 'editlogin' && $user->rights->adherent->creer)
|
||||
{
|
||||
print '<td align="right">';
|
||||
if ($user->rights->user->user->creer)
|
||||
@ -1544,7 +1544,7 @@ else
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($_GET['action'] == 'editlogin')
|
||||
if ($action == 'editlogin')
|
||||
{
|
||||
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
|
||||
}
|
||||
|
||||
@ -169,11 +169,11 @@ if ($conf->use_javascript_ajax)
|
||||
{
|
||||
$datalabels[]=array($i,$adhtype->getNomUrl(0,dol_size(16)));
|
||||
$dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0);
|
||||
$dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0);
|
||||
$dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0);
|
||||
$dataval['uptodate'][]=array($i,isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0);
|
||||
$dataval['resiliated'][]=array($i,isset($MembersResiliated[$key])?$MembersResiliated[$key]:0);
|
||||
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
||||
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
||||
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0;
|
||||
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
||||
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
||||
$i++;
|
||||
@ -336,7 +336,7 @@ foreach ($AdherentType as $key => $adhtype)
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
|
||||
print '<td align="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>';
|
||||
print '<td align="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -57,7 +57,7 @@ if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
|
||||
$res=$object->update_note($_POST["note"],$user);
|
||||
if ($res < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
else
|
||||
@ -82,8 +82,6 @@ if ($id)
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
dol_htmloutput_errors($msg);
|
||||
|
||||
print "<form method=\"post\" action=\"note.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
var $datep; // Date action start (datep)
|
||||
var $datef; // Date action end (datep2)
|
||||
var $dateend; // ??
|
||||
var $durationp = -1; // -1=Unkown duration
|
||||
var $fulldayevent = 0; // 1=Event on full day
|
||||
var $punctual = 1; // Milestone
|
||||
|
||||
@ -381,54 +381,45 @@ if ($action == 'create')
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print 'jQuery(document).ready(function () {
|
||||
function setdatefields()
|
||||
{
|
||||
if (jQuery("#fullday:checked").val() == null)
|
||||
{
|
||||
jQuery(".fulldaystarthour").attr(\'disabled\', false);
|
||||
jQuery(".fulldaystartmin").attr(\'disabled\', false);
|
||||
jQuery(".fulldayendhour").attr(\'disabled\', false);
|
||||
jQuery(".fulldayendmin").attr(\'disabled\', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery(".fulldaystarthour").attr(\'disabled\', true);
|
||||
jQuery(".fulldaystartmin").attr(\'disabled\', true);
|
||||
jQuery(".fulldayendhour").attr(\'disabled\', true);
|
||||
jQuery(".fulldayendmin").attr(\'disabled\', true);
|
||||
jQuery(".fulldaystarthour").val("00");
|
||||
jQuery(".fulldaystartmin").val("00");
|
||||
//jQuery(".fulldayendhour").val("00");
|
||||
//jQuery(".fulldayendmin").val("00");
|
||||
jQuery(".fulldayendhour").val("23");
|
||||
jQuery(".fulldayendmin").val("59");
|
||||
}
|
||||
}
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
function setdatefields()
|
||||
{
|
||||
if ($("#fullday:checked").val() == null) {
|
||||
$(".fulldaystarthour").removeAttr("disabled");
|
||||
$(".fulldaystartmin").removeAttr("disabled");
|
||||
$(".fulldayendhour").removeAttr("disabled");
|
||||
$(".fulldayendmin").removeAttr("disabled");
|
||||
} else {
|
||||
$(".fulldaystarthour").attr("disabled","disabled").val("00");
|
||||
$(".fulldaystartmin").attr("disabled","disabled").val("00");
|
||||
$(".fulldayendhour").attr("disabled","disabled").val("23");
|
||||
$(".fulldayendmin").attr("disabled","disabled").val("59");
|
||||
}
|
||||
}
|
||||
setdatefields();
|
||||
jQuery("#fullday").change(function() {
|
||||
$("#fullday").change(function() {
|
||||
setdatefields();
|
||||
});
|
||||
jQuery("#selectcomplete").change(function() {
|
||||
if (jQuery("#selectcomplete").val() == 100)
|
||||
$("#selectcomplete").change(function() {
|
||||
if ($("#selectcomplete").val() == 100)
|
||||
{
|
||||
if (jQuery("#doneby").val() <= 0) jQuery("#doneby").val(\''.$user->id.'\');
|
||||
if ($("#doneby").val() <= 0) $("#doneby").val(\''.$user->id.'\');
|
||||
}
|
||||
if (jQuery("#selectcomplete").val() == 0)
|
||||
if ($("#selectcomplete").val() == 0)
|
||||
{
|
||||
jQuery("#doneby").val(-1);
|
||||
$("#doneby").val(-1);
|
||||
}
|
||||
});
|
||||
jQuery("#actioncode").change(function() {
|
||||
if (jQuery("#actioncode").val() == \'AC_RDV\') jQuery("#dateend").addClass("fieldrequired");
|
||||
else jQuery("#dateend").removeClass("fieldrequired");
|
||||
$("#actioncode").change(function() {
|
||||
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
|
||||
else $("#dateend").removeClass("fieldrequired");
|
||||
});
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
print '<form name="formaction" action="'.DOL_URL_ROOT.'/comm/action/fiche.php" method="POST">';
|
||||
print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add_action">';
|
||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
|
||||
@ -647,43 +638,34 @@ if ($id)
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print 'jQuery(document).ready(function () {
|
||||
function setdatefields()
|
||||
{
|
||||
if (jQuery("#fullday:checked").val() == null)
|
||||
{
|
||||
jQuery(".fulldaystarthour").attr(\'disabled\', false);
|
||||
jQuery(".fulldaystartmin").attr(\'disabled\', false);
|
||||
jQuery(".fulldayendhour").attr(\'disabled\', false);
|
||||
jQuery(".fulldayendmin").attr(\'disabled\', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery(".fulldaystarthour").attr(\'disabled\', true);
|
||||
jQuery(".fulldaystartmin").attr(\'disabled\', true);
|
||||
jQuery(".fulldayendhour").attr(\'disabled\', true);
|
||||
jQuery(".fulldayendmin").attr(\'disabled\', true);
|
||||
jQuery(".fulldaystarthour").val("00");
|
||||
jQuery(".fulldaystartmin").val("00");
|
||||
//jQuery(".fulldayendhour").val("00");
|
||||
//jQuery(".fulldayendmin").val("00");
|
||||
jQuery(".fulldayendhour").val("23");
|
||||
jQuery(".fulldayendmin").val("59");
|
||||
}
|
||||
}
|
||||
setdatefields();
|
||||
jQuery("#fullday").change(function() {
|
||||
setdatefields();
|
||||
});
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
function setdatefields()
|
||||
{
|
||||
if ($("#fullday:checked").val() == null) {
|
||||
$(".fulldaystarthour").removeAttr("disabled");
|
||||
$(".fulldaystartmin").removeAttr("disabled");
|
||||
$(".fulldayendhour").removeAttr("disabled");
|
||||
$(".fulldayendmin").removeAttr("disabled");
|
||||
} else {
|
||||
$(".fulldaystarthour").attr("disabled","disabled").val("00");
|
||||
$(".fulldaystartmin").attr("disabled","disabled").val("00");
|
||||
$(".fulldayendhour").attr("disabled","disabled").val("23");
|
||||
$(".fulldayendmin").attr("disabled","disabled").val("59");
|
||||
}
|
||||
}
|
||||
setdatefields();
|
||||
$("#fullday").change(function() {
|
||||
setdatefields();
|
||||
});
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
// Fiche action en mode edition
|
||||
print '<form name="formaction" action="'.DOL_URL_ROOT.'/comm/action/fiche.php" method="post">';
|
||||
print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
@ -981,8 +981,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
// Define $color and $cssclass of event
|
||||
$color=-1; $cssclass=''; $colorindex=-1;
|
||||
if ($event->author->id == $user->id || $event->usertodo->id == $user->id || $event->userdone->id == $user->id) { $nummytasks++; $colorindex=1; $cssclass='family_mytasks'; }
|
||||
else if ($event->type_code == 'ICALEVENT') { $numical++; $numicals[dol_string_nospecial($event->icalname)]++; $color=$event->icalcolor; $cssclass=($event->icalname?'family_'.dol_string_nospecial($event->icalname):'family_other'); }
|
||||
if ((! empty($event->author->id) && $event->author->id == $user->id)
|
||||
|| (! empty($event->usertodo->id) && $event->usertodo->id == $user->id)
|
||||
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id)) {
|
||||
$nummytasks++; $colorindex=1; $cssclass='family_mytasks';
|
||||
}
|
||||
else if ($event->type_code == 'ICALEVENT') {
|
||||
$numical++;
|
||||
if (! empty($event->icalname)) {
|
||||
if (! isset($numicals[dol_string_nospecial($event->icalname)])) {
|
||||
$numicals[dol_string_nospecial($event->icalname)] = 0;
|
||||
}
|
||||
$numicals[dol_string_nospecial($event->icalname)]++;
|
||||
}
|
||||
$color=$event->icalcolor;
|
||||
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other');
|
||||
}
|
||||
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; }
|
||||
else { $numother++; $colorindex=2; $cssclass='family_other'; }
|
||||
if ($color == -1) $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||
|
||||
@ -1262,7 +1262,7 @@ else
|
||||
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$object->fax.'"></td></tr>';
|
||||
|
||||
// EMail / Web
|
||||
print '<tr><td>'.$langs->trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':'').'</td><td><input type="text" name="email" size="32" value="'.$object->email.'"></td>';
|
||||
print '<tr><td>'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'</td><td><input type="text" name="email" size="32" value="'.$object->email.'"></td>';
|
||||
print '<td>'.$langs->trans('Web').'</td><td><input type="text" name="url" size="32" value="'.$object->url.'"></td></tr>';
|
||||
|
||||
// Prof ids
|
||||
|
||||
Loading…
Reference in New Issue
Block a user