index 4b10b70e4f2bf530972723bbfcc380834705ca8f..4e51ef8402784bcbe997faf42a119501c3800899 100644 (file)
var $base = "";
var $release = "";
var $copy_paste_mode = false;
+ var $cut_paste_mode = false;
+
+ var $CopyPasteVars = array("SubObjects");
function faiVariable ($config, $dn= NULL)
{
$message= plugin::check();
/* If this is a new script, check if a script with this name already exists */
- if(!empty($this->release) && $this->copy_paste_mode){
+ if(!empty($this->release) && ($this->copy_paste_mode || $this->cut_paste_mode) ){
/* Check if current name is already used for fai scripts in selected release */
$dn = 'cn='.$this->cn.",ou=variables,".$this->release;
plugin::save();
$ldap = $this->config->get_ldap_link();
-
+
+ /* Copy & Paste : Ensure that FAIstate is copied too */
+ if($this->copy_paste_mode && preg_match("/freeze/",$this->FAIstate)){
+ $this->attrs['FAIstate'] = $this->FAIstate;
+ }
+
$ldap->cat($this->dn,array("objectClass"));
if($ldap->count()!=0){
/* Write FAIscript to ldap*/
$sub_dn = "cn=".$obj['cn'].",".$this->dn;
+ if($this->copy_paste_mode){
+ $obj['status'] = "new";
+ }
+
if($obj['status']=="new"){
$ldap->cat($sub_dn,array("objectClass"));
if($ldap->count()){
$this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
}
}
+
+ /* return copy & paste dialog
+ */
+ function getCopyDialog()
+ {
+ /* Ask for cn */
+ $smarty = get_smarty();
+ $smarty->assign("cn" ,$this->cn);
+ $str = $smarty->fetch(get_template_path("paste_fai_object.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+ /* Get posted cn */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = $_POST['cn'];
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: