Example #1
0
            }
            print '<td align="center" nowrap="nowrap">';
            print img_tick();
            print '</td>';
        }
        else if (in_array($obj->id, $permsgroup)) {
            // Permission own by group
            if ($caneditperms)
            {
                print '<td align="center">';
				print $form->textwithtooltip($langs->trans("Inherited"),$langs->trans("PermissionInheritedFromAGroup"));
				//print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id.'" title="'.$langs->trans("PermissionInheritedFromAGroup").'">';
				print '</td>';
            }
            print '<td align="center" nowrap="nowrap">';
            print img_tick();
            print '</td>';
        }
        else
        {
            // Do not own permission
            if ($caneditperms)
            {
                print '<td align="center"><a href="perms.php?id='.$fuser->id.'&amp;action=addrights&amp;rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>';
            }
            print '<td>&nbsp</td>';
        }

        $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle));
        print '<td>'.$perm_libelle. '</td>';
Example #2
0
   /**
	*   Return list of triggers. Function used by admin page htdoc/admin/triggers
	* 	@param		workflow		0=Return all triggers, 1=Return only triggers not disabled if workflow module activated
	* 	@return		array			Array list of triggers
	*/
	function getTriggersList($workflow=0)
	{
		global $conf, $langs;

		$html = new Form($this->db);

		$files = array();
		$modules = array();
		$orders = array();
		$i = 0;

		foreach($conf->triggers_modules as $reldir)
		{
			$dir=dol_buildpath($reldir,0);
			//print "xx".$dir;exit;
			
			// Check if directory exists
			if (!is_dir($dir)) continue;

			$handle=opendir($dir);
            if (is_resource($handle))
            {
    			while (($file = readdir($handle))!==false)
    			{
    				if (is_readable($dir.'/'.$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php/',$file,$reg))
    				{
    					$modName = 'Interface'.ucfirst($reg[2]);
    					//print "file=$file"; print "modName=$modName"; exit;
    					if (in_array($modName,$modules))
    					{
    						$langs->load("errors");
    						print '<div class="error">'.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/").'</div>';
    						$objMod = new $modName($this->db);

    						$modules[$i] = $modName;
    						$files[$i] = $file;
    						$orders[$i] = $objMod->family;   // Tri par famille
    						$i++;
    					}
    					else
    					{
    						include_once($dir.'/'.$file);
    						$objMod = new $modName($this->db);

    						$modules[$i] = $modName;
    						$files[$i] = $file;
    						$orders[$i] = $objMod->family;   // Tri par famille
    						$i++;
    					}
    				}
    			}
    			closedir($handle);
            }
		}

		asort($orders);

		$triggers = array();
		$j = 0;

		// Loop on each trigger
		foreach ($orders as $key => $value)
		{
			$modName = $modules[$key];
			if ($modName)
			{
				$objMod = new $modName($this->db);
				// Bypass if workflow module is enabled and if the trigger is compatible
				if ($workflow && ! empty($objMod->disabled_if_workflow)) continue;
			}

			// Define disabledbyname and disabledbymodule
			$disabledbyname=0;
			$disabledbymodule=1;
			$module='';
			if (preg_match('/NORUN$/i',$files[$key])) $disabledbyname=1;
			if (preg_match('/^interface_([^_]+)_(.+)\.class\.php/i',$files[$key],$reg))
			{
				// Check if trigger file is for a particular module
				$module=preg_replace('/^mod/i','',$reg[1]);
				$constparam='MAIN_MODULE_'.strtoupper($module);
				if (strtolower($reg[1]) == 'all') $disabledbymodule=0;
				else if (empty($conf->global->$constparam)) $disabledbymodule=2;
			}

			$triggers[$j]['picto'] = $objMod->picto?img_object('',$objMod->picto):img_object('','generic');
			$triggers[$j]['file'] = $files[$key];
			$triggers[$j]['version'] = $objMod->getVersion();
			$triggers[$j]['status'] = img_tick();
			if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = "&nbsp;";

			$text ='<b>'.$langs->trans("Description").':</b><br>';
			$text.=$objMod->getDesc().'<br>';
			$text.='<br><b>'.$langs->trans("Status").':</b><br>';
			if ($disabledbyname == 1)
			{
				$text.=$langs->trans("TriggerDisabledByName").'<br>';
				if ($disabledbymodule == 2) $text.=$langs->trans("TriggerDisabledAsModuleDisabled",$module).'<br>';
			}
			else
			{
				if ($disabledbymodule == 0) $text.=$langs->trans("TriggerAlwaysActive").'<br>';
				if ($disabledbymodule == 1) $text.=$langs->trans("TriggerActiveAsModuleActive",$module).'<br>';
				if ($disabledbymodule == 2) $text.=$langs->trans("TriggerDisabledAsModuleDisabled",$module).'<br>';
			}

			$triggers[$j]['info'] = $html->textwithpicto('',$text);
			$j++;
		}
		return $triggers;
	}
Example #3
0
                    });
            });
            </script>';
    form_constantes($constantes);
    print '<br>';
} else {
    $lien = '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=1&name=ADHERENT_USE_MAILMAN">' . $langs->trans("Activate") . '</a>';
    print_fiche_titre("Mailman mailing list system", $lien, '');
    print "<hr>\n";
}
/*
 * Spip
 */
$var = !$var;
if ($conf->global->ADHERENT_USE_SPIP) {
    $lien = img_tick() . ' ';
    $lien .= '<a href="' . $_SERVER["PHP_SELF"] . '?action=unset&value=0&name=ADHERENT_USE_SPIP">' . $langs->trans("Disable") . '</a>';
    // Edition des varibales globales
    $constantes = array('ADHERENT_USE_SPIP_AUTO', 'ADHERENT_SPIP_SERVEUR', 'ADHERENT_SPIP_DB', 'ADHERENT_SPIP_USER', 'ADHERENT_SPIP_PASS');
    print_fiche_titre("SPIP CMS", $lien, '');
    form_constantes($constantes);
    print '<br>';
} else {
    $lien = '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=1&name=ADHERENT_USE_SPIP">' . $langs->trans("Activate") . '</a>';
    print_fiche_titre("SPIP - CMS", $lien, '');
    print "<hr>\n";
}
/*
 * Edition info modele document
 */
$constantes = array('ADHERENT_CARD_TYPE', 'ADHERENT_CARD_HEADER_TEXT', 'ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_CARD_FOOTER_TEXT');
					<th><?php 
echo lang('dyslexicparent');
?>
</th>
					<td><?php 
echo img_tick($participant->dyslexicparent);
?>
</td>
				</tr>
				<tr>
					<th><?php 
echo lang('multilingual');
?>
</th>
					<td><?php 
echo img_tick($participant->multilingual);
?>
</td>
				</tr>
				<tr>
					<th><?php 
echo lang('last_experiment');
?>
</th>
					<td><?php 
echo $last_experiment;
?>
</td>
				</tr>
				<tr>
					<th><?php 
Example #5
0
// Modules
foreach($modules as $const => $desc)
{
	// Si condition non remplie, on ne propose pas l'option
	if (! $conditions[$const]) continue;

	$var=!$var;
	print "<tr ".$bc[$var].">";
	print '<td width="16">'.img_object("",$picto[$const]).'</td>';
	print '<td>'.$langs->trans($desc).'</td>';
	print '<td align="center" width="20">';

	$constante = 'FCKEDITOR_ENABLE_'.$const;
	$value = $conf->global->$constante;

	print $value == 1 ? img_tick() : '&nbsp;';

	print '</td>';
	print '<td align="center" width="100">';

	if($value == 0)
	{
		print '<a href="fckeditor.php?action=activate_'.strtolower($const).'">'.$langs->trans("Activate").'</a>';
	}
	else if($value == 1)
	{
		print '<a href="fckeditor.php?action=disable_'.strtolower($const).'">'.$langs->trans("Disable").'</a>';
	}

	print "</td>";
	print '</tr>';
Example #6
0
                if (sizeof($obj->errors))   $arrayoferrors[$sourcelinenb]=$obj->errors;
                if (sizeof($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
                if (! sizeof($obj->errors) && ! sizeof($obj->warnings)) $nbok++;
            }
            // Close file
            $obj->import_close_file();
        }
        else
        {
            print $langs->trans("ErrorFailedToOpenFile",$pathfile);
        }

        $db->rollback();    // We force rollback because this was just a simulation.

        // Show OK
        if (! sizeof($arrayoferrors) && ! sizeof($arrayofwarnings)) print img_tick().' <b>'.$langs->trans("NoError").'</b><br><br>';
        else print $langs->trans("NbOfLinesOK",$nbok).'</b><br><br>';

        // Show Errors
        //var_dump($arrayoferrors);
        if (sizeof($arrayoferrors))
        {
            print img_error().' <b>'.$langs->trans("ErrorsOnXLines",sizeof($arrayoferrors)).'</b><br>';
            print '<table width="100%" class="border"><tr><td>';
            foreach ($arrayoferrors as $key => $val)
            {
                $nboferrors++;
                if ($nboferrors > $maxnboferrors)
                {
                    print $langs->trans("TooMuchErrors",(sizeof($arrayoferrors)-$nboferrors))."<br>";
                    break;