예제 #1
0
 static function build_history($type, $value, $data_old)
 {
     if ($value == "0" and in_array($type, array("folder", "date", "datetime", "time"))) {
         return "";
     }
     switch ($type) {
         case "folder":
             $value = modify::getpathfull($value, false, "/") . " ([/" . $value . "])";
             break;
         case "password":
             $value = "";
             break;
         case "date":
             $value = sys_date("{t}m/d/Y{/t}", $value);
             break;
         case "datetime":
             $value = sys_date("{t}m/d/Y g:i a{/t}", $value);
             break;
         case "time":
             $value = sys_date("{t}g:i a{/t}", $value);
             break;
         case "dateselect":
             $data = array();
             foreach (explode("|", trim($value, "|")) as $date) {
                 $data[] = sys_date("{t}m/d/Y{/t}", $date);
             }
             $value = implode(", ", $data);
             break;
         case "files":
             $new = explode("|", trim($value, "|"));
             $old = explode("|", trim($data_old, "|"));
             $value = array("");
             foreach ($new as $file) {
                 if ($file != "" and !in_array($file, $old)) {
                     $value[] = "+ " . modify::basename($file);
                 }
             }
             foreach ($old as $file) {
                 if ($file != "" and !in_array($file, $new)) {
                     $value[] = "- " . modify::basename($file);
                 }
             }
             $value = rtrim(implode("\n  ", $value));
             break;
         case "select":
             $value = str_replace("|", ", ", trim($value, "|"));
             break;
         case "checkbox":
             $value = $value ? "{t}yes{/t}" : "{t}no{/t}";
             break;
         case "textarea":
             $value = self::build_diff($data_old, $value);
             break;
         default:
             if (is_call_type($type)) {
                 $value = call_type($type, "build_history", $data_old, $value);
             }
             break;
     }
     return $value;
 }
예제 #2
0
    static function form($folder, $required_fields)
    {
        setup::out_exit('
	Folder: ' . q(modify::getpathfull($folder)) . '<br>
	<br>
	<a href="index.php?export=calc&limit=1&hide_fields=id&folder=' . q($folder) . '&view=details">{t}Download example file{/t} (.xls)</a>
	<br>
	{t}Required fields{/t}: ' . q(implode(", ", $required_fields)) . '
	<br><br>
	{t}File{/t} (.xls):<br>
	<form method="post" action="import.php?" enctype="multipart/form-data">
	<input type="hidden" name="token" value="' . modify::get_form_token() . '">
	<input type="hidden" name="folder" value="' . q($folder) . '">
	<input type="File" name="file[]" value="" multiple="true" required="true">
	<input type="submit" value="{t}I m p o r t{/t}" class="submit">
	<input type="submit" name="validate_only" value="{t}V a l i d a t e{/t}" class="submit">
	</form>
	<br>
	<b>{t}Note{/t}:</b> {t}Assets can be imported into multiple folders by adding the "Folder" column.{/t}<br>
	<b>{t}Note{/t}:</b> {t}Assets can be overwritten by adding the "Id" column.{/t}<br>
	<br>
	<div style="border-top: 1px solid black;">Powered by Simple Groupware, Copyright (C) 2002-2012 by Thomas Bley.</div></div>
	</body>
	</html>
  ');
    }
	<td style="white-space:nowrap;"><label for="fdescription_new">{t}Description{/t}&nbsp;</label></td>
	<td><textarea id="fdescription_new" rows="4" style="width:100%; height:65px;"></textarea></td>
	</tr>
	<tr>
	<td><label for="ffirst">{t}First in list{/t}</label></td>
	<td><input id="ffirst" type="checkbox" value="1" checked class="checkbox"></td>
	</tr>
	<tr>
	<td><label for="cmultiple">{t}Multiple{/t}</label></td>
	<td><input id="cmultiple" type="checkbox" value="1" class="checkbox" onchange="showhide('fmultiple_line');">
	</td>
	</tr>
	<tr id="fmultiple_line" style="display:none;">
	<td><label for="fmultiple">{t}Parent folder{/t}</label></td>
	<td><input id="fmultiple" type="Text" style="width:100%;" value="<?php 
    echo q(modify::getpathfull($this->folder["id"], false, "/"));
    ?>
/*/">
	</td>
	</tr>
	<?php 
}
?>
	<tr><td></td><td style="padding-top:4px;">
	  <input type="submit" value="{t}Ok{/t}" style="width:50px;">&nbsp;
  	  <input type="button" value="{t}Cancel{/t}" onclick="hide('folder_info');">
	</td></tr>
  </table>
</form>
<div style="border-top: <?php 
echo $this->c("border");