72 lines
2.4 KiB
PHP
Executable file
72 lines
2.4 KiB
PHP
Executable file
<?php
|
|
|
|
$NewPartType = (isset($_POST['NewPartType']))? $_POST['NewPartType']:0;
|
|
|
|
function WriteStorageList($ParentId, $ParentIsLocked)
|
|
{
|
|
global $GlobalMysqlHandler;
|
|
global $GlobalContent;
|
|
global $GlobalTemplate;
|
|
global $EditTypesEditId;
|
|
global $PartId;
|
|
global $Part;
|
|
|
|
$ListQuery="SELECT * FROM `Storages` WHERE `ParentId` =$ParentId";
|
|
$ListQuery=mysqli_query($GlobalMysqlHandler, $ListQuery);
|
|
|
|
if (!$ParentId || NestedListVisibilityIsSet($ParentId, 'EditPartStorage'))
|
|
$GlobalContent .= "<ul style=\"display:block;\">\n";
|
|
else
|
|
$GlobalContent .= "<ul style=\"display:none;\">\n";
|
|
|
|
if (mysqli_num_rows($ListQuery))
|
|
{
|
|
while ($ListData=mysqli_fetch_array($ListQuery))
|
|
{
|
|
$GlobalContent .= " <li>\n";
|
|
if (LockIsActive('Types',$ListData['Id']) || $ParentIsLocked)
|
|
{
|
|
$GlobalContent .= ' '.OtherGetIcon('LockActive');
|
|
$ParentIsLocked = 1;
|
|
}
|
|
else
|
|
{
|
|
$GlobalContent .= ' <input type="radio" name="EditPartStorage" value="'.$ListData['Id'].'" '.(($Part['StorageId']==$ListData['Id'])? "checked":"").'>';
|
|
}
|
|
$GlobalContent .= " <a href=\"index.php?Page=ShowPart&ToDo=EditStorage&PartId=$PartId&OpenSublistId=".$ListData['Id']."\">".LangStr2Html($ListData['Name'])."</a>";
|
|
$GlobalContent .= " (".NestedListCountSubElements($ListData['Id'],'Storages').")";
|
|
$GlobalContent .= " \n</li>\n";
|
|
|
|
WriteStorageList($ListData['Id'],$ParentIsLocked);
|
|
}
|
|
}
|
|
$GlobalContent .= "</ul>\n";
|
|
}
|
|
|
|
|
|
if (UserHasRight('EditParts'))
|
|
{
|
|
///////////////
|
|
// open sublist
|
|
if (isset($_GET['OpenSublistId']) && $_GET['OpenSublistId'])
|
|
{
|
|
NestedListVisibilityToggle($_GET['OpenSublistId'], 'EditPartStorage');
|
|
}
|
|
else
|
|
{
|
|
NestedListVisibilityUnsetAllElements ('EditPartStorage');
|
|
NestedListVisibilitySetAllParents ($Part['StorageId'], 'EditPartStorage', 'Storages');
|
|
NestedListVisibilitySet ($Part['StorageId'], 'EditPartStorage');
|
|
}
|
|
|
|
$GlobalContent .= '<h1>'.LangSpellHtml('SentencePleaseSelectPartStorage').'</h1>';
|
|
$GlobalContent .= '<form action="index.php?Page=ShowPart&ToDo=SaveStorage&PartId='.$PartId.'" method="post">';
|
|
WriteStorageList(0, 0);
|
|
$GlobalContent .= '<input type="submit" value="'.LangSpellHtml('ButtonSave').'"class="Button">';
|
|
$GlobalContent .= '</form>';
|
|
}
|
|
else
|
|
{
|
|
MessageError(LangSpell("ScentenceNoUserRights"));
|
|
}
|
|
?>
|