Fixes for jpegPhoto attributes during copy operations

This commit is contained in:
Deon George 2011-04-28 23:20:06 +10:00
parent db241f1c98
commit 1f9308dc4d
4 changed files with 16 additions and 10 deletions

View File

@ -187,9 +187,9 @@ if (count($request['template']->getLDAPmodify(true))) {
echo '<div style="text-align: center;">';
echo '<br />';
printf('<input type="submit" value="%s" %s/>',
_('Commit'),
(isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'update_form\'),\'%s\');"',_('Updating Object')) : ''));
// @todo cant use AJAX here, it affects file uploads.
printf('<input type="submit" value="%s" />',
_('Update Object'));
printf('<input type="submit" name="cancel" value="%s" %s/>',
_('Cancel'),

View File

@ -836,7 +836,10 @@ class PageRender extends Visitor {
}
protected function drawFormReadOnlyValueJpegAttribute($attribute,$i) {
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false);
$this->draw('HiddenValue',$attribute,$i);
$_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i);
draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
}
protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) {

View File

@ -708,6 +708,10 @@ class Template extends xmlTemplate {
}
}
}
// @todo If this is a Jpeg Attribute, we need to mark it read only, since it cant be deleted like text attributes can
if (strcasecmp(get_class($attribute),'jpegAttribute') == 0)
$attribute->setReadOnly();
}
# If we have any RDN values left over, there werent in the original entry and need to be added.

View File

@ -1444,9 +1444,8 @@ class TemplateRender extends PageRender {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if (! $this->template->isReadOnly())
printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" %s/></td></tr>',
_('Update Object'),
(isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'entry_form\'),\'%s\');"',_('Updating DN')) : ''),
// @todo cant use AJAX here, it affects file uploads.
printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" /></td></tr>',
_('Update Object'));
}
@ -1546,9 +1545,9 @@ class TemplateRender extends PageRender {
if ($page < $this->pagelast)
printf('<td>&nbsp;</td><td><input type="submit" id="create_button" value="%s" /></td>',_('Proceed &gt;&gt;'));
else
printf('<td style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" %s /></td>',
_('Create Object'),
(isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'entry_form\'),\'%s\');"',_('Creating Object')) : ''));
// @todo cant use AJAX here, it affects file uploads.
printf('<td style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" /></td>',
_('Create Object'));
echo '</tr>';
}