SN_EXTENDED.resetRow = function(elem) {
$(elem).find('input, textarea').attr('value', '');
+ $(elem).find('input').removeAttr('disabled');
$(elem).find("select option[value='office']").attr("selected", true);
+ $(elem).find("input:checkbox").attr('checked', false);
+ $(elem).find("input[name$=-start], input[name$=-end]").each(function() {
+ $(this).removeClass('hasDatepicker');
+ $(this).datepicker({ dateFormat: 'd M yy' });
+ });
};
SN_EXTENDED.addRow = function() {
$('.add_row').live('click', SN_EXTENDED.addRow);
$('.remove_row').live('click', SN_EXTENDED.removeRow);
+ $('input:checkbox[name$=current]').each(function() {
+ var input = $(this).parent().siblings('input[id$=-end]');
+ if ($(this).is(':checked')) {
+ $(input).attr('disabled', 'true');
+ }
+ });
+
+ $('input:checkbox[name$=current]').live('click', function() {
+ var input = $(this).parent().siblings('input[id$=-end]');
+ if ($(this).is(':checked')) {
+ $(input).val('');
+ $(input).attr('disabled', 'true');
+ } else {
+ $(input).removeAttr('disabled');
+ }
+ });
+
});
$this->removeAll($user, 'website');
$i = 0;
foreach($sites as $site) {
+
+ if (!Validate::uri(
+ $site['value'],
+ array('allowed_schemes' => array('http', 'https')))
+ ) {
+ throw new Exception(sprintf(_m('Invalid URL: %s'), $site['value']));
+ }
+
if (!empty($site['value'])) {
++$i;
$this->saveField(
$expArray = array();
foreach ($experiences as $exp) {
- list($company, $current, $end, $start) = array_values($exp);
+ if (sizeof($experiences) == 4) {
+ list($company, $current, $end, $start) = array_values($exp);
+ } else {
+ $end = null;
+ list($company, $current, $start) = array_values($exp);
+ }
if (!empty($company)) {
$expArray[] = array(
'company' => $company,