mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-01-22 03:46:50 +08:00
更新至V1.84,更新内容在笔记中查看
This commit is contained in:
@@ -63,45 +63,8 @@ function profile_setting($fieldid, $space=array(), $showstatus=false, $ignoreunc
|
||||
return '<p class="form-control-static profile profile-'.$fieldid.'">'.$space['birthyear'].'-'.$space['birthmonth'].'-'.$space['birthday'].'</p><input type="hidden" name="birthyear" value="'.$space['birthyear'].'" /> <input type="hidden" name="birthmonth" value="'.$space['birthmonth'].'" /><input type="hidden" name="birthday" value="'.$space['birthday'].'" />';
|
||||
}
|
||||
$birthyeayhtml = '';
|
||||
$nowy = dgmdate($_G['timestamp'], 'Y');
|
||||
for ($i=0; $i<100; $i++) {
|
||||
$they = $nowy - $i;
|
||||
$selectstr = ($they == $space['birthyear']) ?' selected':'';
|
||||
$birthyeayhtml .= "<option value=\"$they\"$selectstr>$they</option>";
|
||||
}
|
||||
$birthmonthhtml = '';
|
||||
for ($i=1; $i<13; $i++) {
|
||||
$selectstr = (($i == $space['birthmonth'])?' selected':'');
|
||||
$birthmonthhtml .= "<option value=\"$i\"$selectstr>$i</option>";
|
||||
}
|
||||
$birthdayhtml = '';
|
||||
if(empty($space['birthmonth']) || in_array($space['birthmonth'], array(1, 3, 5, 7, 8, 10, 12))) {
|
||||
$days = 31;
|
||||
} elseif(in_array($space['birthmonth'], array(4, 6, 9, 11))) {
|
||||
$days = 30;
|
||||
} elseif($space['birthyear'] && (($space['birthyear'] % 400 == 0) || ($space['birthyear'] % 4 == 0 && $space['birthyear'] % 400 != 0))) {
|
||||
$days = 29;
|
||||
} else {
|
||||
$days = 28;
|
||||
}
|
||||
for ($i=1; $i<=$days; $i++) {
|
||||
$selectstr = ($i == $space['birthday'])?' selected':'';
|
||||
$birthdayhtml .= "<option value=\"$i\"$selectstr>$i</option>";
|
||||
}
|
||||
$html = '<div class="profile-group-birthday">'
|
||||
.'<select name="birthyear" id="birthyear" onchange="showbirthday();" class="form-control input-sm pull-left profile profile-birthyear" style="width:80px;margin-right:5px;">'
|
||||
.'<option value="">'.lang('year').'</option>'
|
||||
.$birthyeayhtml
|
||||
.'</select>'
|
||||
.'<select name="birthmonth" id="birthmonth" onchange="showbirthday();" class="form-control input-sm pull-left profile profile-birthmonth" style="width:60px;margin-right:5px;">'
|
||||
.'<option value="">'.lang('month').'</option>'
|
||||
.$birthmonthhtml
|
||||
.'</select>'
|
||||
.'<select name="birthday" id="birthday" class="form-control input-sm pull-left profile profile-birthday" style="width:60px">'
|
||||
.'<option value="">'.lang('day').'</option>'
|
||||
.$birthdayhtml
|
||||
.'</select>'
|
||||
.'</div>';
|
||||
$nowy = dgmdate($_G['timestamp'], 'Y-m-d');
|
||||
$html = '<input type="text" class="form-control" data-provide="datepicker" value="'.$nowy.'" data-autoclose="true">';
|
||||
|
||||
} elseif($fieldid=='gender') {
|
||||
$space[$fieldid] = isset($space[$fieldid]) ? $space[$fieldid]:'';
|
||||
@@ -109,7 +72,7 @@ function profile_setting($fieldid, $space=array(), $showstatus=false, $ignoreunc
|
||||
return '<p class="form-control-static profile profile-'.$fieldid.'">'.lang('gender_'.intval($space[$fieldid])).'</span><input type="hidden" name="'.$fieldid.'" value="'.$space[$fieldid].'" />';
|
||||
}
|
||||
$selected = array($space[$fieldid]=>' selected="selected"');
|
||||
$html = '<select name="gender" id="gender" class="form-control input-sm profile profile-'.$fieldid.'" >';
|
||||
$html = '<select name="gender" id="gender" class="form-select" >';
|
||||
if($field['unchangeable']) {
|
||||
$html .= '<option value="">'.lang('gender').'</option>';
|
||||
} else {
|
||||
@@ -128,14 +91,14 @@ function profile_setting($fieldid, $space=array(), $showstatus=false, $ignoreunc
|
||||
.' var selorg={};'
|
||||
.' selorg.add=function(ctrlid,vals){'
|
||||
." if(vals[0].orgid=='other') vals[0].path=".lang('not_choose_agencies_departments1').";"
|
||||
." jQuery('#'+ctrlid+'_Menu').html(vals[0].path+' <span class=\"caret\"></span>');"
|
||||
." jQuery('#'+ctrlid+'_Menu').html(vals[0].path+'');"
|
||||
." jQuery('#sel_'+ctrlid).val(vals[0].orgid);"
|
||||
.' }'
|
||||
.' </script>'
|
||||
.'<div class="dropdown profile-group-department" >'
|
||||
.' <input id="sel_'.$fieldid.'" type="hidden" name="'.$fieldid.'" value="'.(!empty($space[$fieldid]) ? $space[$fieldid]:'').'" />'
|
||||
.' <button type="button" id="'.$fieldid.'_Menu" class="btn btn-default dropdown-toggle" data-toggle="dropdown">'
|
||||
.' '.($space['department_tree']?$space['department_tree']:lang('please_select_a_organization_or_department')).' <span class="caret"></span>'
|
||||
.' <button type="button" id="'.$fieldid.'_Menu" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">'
|
||||
.' '.($space['department_tree']?$space['department_tree']:lang('please_select_a_organization_or_department')).' '
|
||||
.' </button>'
|
||||
.' <div id="'.$fieldid.'_dropdown_menu" class="dropdown-menu org-sel-box" role="menu" aria-labelledby="'.$fieldid.'_Menu">'
|
||||
.' <iframe name="'.$fieldid.'_iframe" class="org-sel-box-iframe" src="index.php?mod=system&op=orgtree&ctrlid='.$fieldid.'&nouser=1&range=1" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" allowtransparency="true" ></iframe>'
|
||||
@@ -154,14 +117,14 @@ function profile_setting($fieldid, $space=array(), $showstatus=false, $ignoreunc
|
||||
$html = "<textarea name=\"$fieldid\" id=\"$fieldid\" class=\"form-control input-sm profile profile-$fieldid\" rows=\"3\" >$space[$fieldid]</textarea>";
|
||||
} elseif($field['formtype']=='select') {
|
||||
$field['choices'] = explode("\n", $field['choices']);
|
||||
$html = "<select name=\"$fieldid\" id=\"$fieldid\" class=\"form-control input-sm profile profile-$fieldid\" >";
|
||||
$html = "<select name=\"$fieldid\" id=\"$fieldid\" class=\"form-select\" >";
|
||||
foreach($field['choices'] as $op) {
|
||||
$html .= "<option value=\"$op\"".($op==$space[$fieldid] ? 'selected="selected"' : '').">$op</option>";
|
||||
}
|
||||
$html .= '</select>';
|
||||
} elseif($field['formtype']=='list') {
|
||||
$field['choices'] = explode("\n", $field['choices']);
|
||||
$html = "<select name=\"{$fieldid}[]\" id=\"$fieldid\" class=\"form-control input-sm profile profile-$fieldid\" multiple=\"multiplue\" >";
|
||||
$html = "<select name=\"{$fieldid}[]\" id=\"$fieldid\" class=\"form-select\" multiple=\"multiplue\" >";
|
||||
$space[$fieldid] = explode("\n", $space[$fieldid]);
|
||||
foreach($field['choices'] as $op) {
|
||||
$html .= "<option value=\"$op\"".(in_array($op, $space[$fieldid]) ? 'selected="selected"' : '').">$op</option>";
|
||||
|
||||
Reference in New Issue
Block a user